Forum Discussion

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

Bootloader for uClinux-MMU with EPCS

I'd like to load uClinux-MMU from the EPCS. The physical address for instruction memory is 0x02000000, so the only way to access it is through the TLB. The default boot copier supplied for the EPCS does not initialize the MMU. So as I see it, my options are:

- Modify the default boot copier to initialize the MMU

- U-Boot?

- Other?

In my searching, I couldn't confirm that U-Boot supports this boot method. I'm interested in any opinions on the best path to take.

Thanks.

5 Replies

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

    The altera epcs boot loader is position independent. It is located in a onchip memory inside the epcs controller. The elf2flash gets load address from the elf, which is in kernel space, such as c0800000. For example, if the epcs controller base is 0x03200000,

    sof2flash --epcs --input=NiosII_cycloneII_2c35_full_featured.sof --output=fpga.flash

    nios2-flash-programmer --epcs --mmu --base=0x03200000 fpga.flash

    elf2flash --epcs --after=fpga.flash --input=zImage --output=zImage.flash --boot=$SOPC_KIT_NIOS2/components/altera_nios2/boot_loader_epcs.srec

    nios2-flash-programmer --epcs --mmu --base=0x03200000 zImage.flash

    Please note, the sof flash generated using quartus v9.1sp2 doesn't work. I have filed a service request. Please try v7.2 or others.

    u-boot can be used instead of zImage.

    - Hippo

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

    Thanks for the reply. Sorry, I wasn't clear...and I had a typo.

    In our design, the boot copier needs to copy the image from the EPCS to external memory at physical address 0x20000000 (I incorrectly stated 0x02000000 before). Unfortunately, that address is only reachable through the TLB. This would mean that the boot copier needs to initialize the MMU. My plan is to modify Altera's default boot copier, but I'm looking for opinions first.

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

    Then this is a hardware design issue. You will have to relocate your sdram in sopc builder, to address lower than 0x20000000. I would suggest 0x10000000 for the coming fdt support. I will update the wiki on this point.

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

    Thanks a lot, I'll make the change.

    Btw, regarding:

    --- Quote Start ---

    Please note, the sof flash generated using quartus v9.1sp2 doesn't work.

    --- Quote End ---

    What is the issue? I'm concerned because that version appears to be working for me. Could it be that I'm somehow avoiding the issue, or could there be a subtle issue that bites me down the road?

    Thanks, I appreciate the help!
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I met the error on 2C35. Maybe it works for your device. Then you may continue with this version.

    - Hippo