Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

Altera boot_loader_cfi + SRAM

Hi all,

On my Cyclone III developpement board, I have a fully functionnal uClinux O/S which runs from the SDRAM.

At the present time, the power-up steps are the following :

1. power on

2. config sof from flash to FPGA

3. Nios II CPU start at the reset vector (flash), which contain the boot loader

4. the boot loader copy program image from flash to SDRAM for the zImage

5. the uncompress loader in our zImage, copy the real kernel image to (sdram base)

6. kernel start up

Here is the command lines I used with bootloader (flash range 0x00000000 to 0x1ffffff) :

----------------------------------------------------------------------------------

> elf2flash --base=0x00000000 --end=0x1ffffff --reset=0x0

--input=zImage --output=zImage.flash

--boot=/…/nios2eds/components/altera_nios2/boot_loader_cfi.srec

> nios2-flash-programmer --base=0x00000000 zImage.flash

----------------------------------------------------------------------------------

I know that it is possible to force uClinux to boot from SRAM and the devboard has in fact 4MByte of SRAM... So here is my question :

is it possible to modify the "boot_loader_cfi.srec" from altera in order to copy the zimage from flash to sram, instead of sdram ??

Thanks for your help !

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    What you need to do is define the .text section for zImage to the SRAM instead of the SDRAM. I don't know the uClinux toolchain, but I guess you can set it somewhere in a configuration or linker script.

    The bootloader just copies the application where you tell it to in the elf image.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Ok I didn't realize that the bootloader was reading directly the zImage to find the copy location...

    So I juste have to select SRAM (as the device to execute kernel from) when I use this command :

    -------------------------------------

    make vendor_hwselect SYSPTF=file.ptf

    -------------------------------------

    Thanks for your help !