Showing results for 
Search instead for 
Did you mean: 
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

Preloader Notes

Preloader Notes

13.0sp1Preloader Notes

New Features


With SDRAM ECC (error correcting code), the SDRAM controller will fix single bit error automatically.

The Preloader will now be interrupted and informed about any single bit corrections responding by clearing the interrupt bit.

When double bit errors occur, there is not much can be done by controller or the Preloader.

There is might a chance that processor might fetch the error instructions.

For critical software, user would need to enable the watchdog to overcome this.

Do note that the Preloader will enable the watchdog (based on handoff) and leave it enabled upon exiting.

As of now, the Preloader won't initialize all the SDRAM ECC bits after the ECC is enabled.

This is because the time need for initialization will take 3-5 seconds.

This will be visited at later release on how to speed up the initialization (such as utilizing DMA or cacheline dump method).

Without the initialization, user might get false double bit error when reading from uninitialized memory.

This is applicable for scenario such as cache fill in subsequent bootloader (such as U-Boot).

It is ok for subsequent software to turn off the interrupt for SDRAM ECC as the single bit error will still be corrected by controller.

Subsequent software won't be interrupted whenever ECC errors happen.

To enable the ECC, the user just needs to specify interface width of 40 (32bit + 8bit ECC) or 24 (16bits + 8bit ECC) in Qsys.

Bug Fixes

False Double Bit Error in U-Boot (and beyond)

With the Preloader now enabling ECC bits, it is possible that false double bit errors will be received in any successive code. 

U-boot now disables this interrupt to avoid false errors. At some point in the future, ECC bits will be properly initialized.

Do note that the single bit error still will be corrected by the hardware / SDRAM controller.

EMAC using soft PHY in FPGA

Instead of using the hard EMAC PHY that located on the board, you can connect the EMAC to a soft PHY controller within the FPGA.

To enable that, the Preloader is changed to initialize the FPGA interface register within the System Manager.

It enables the interface between the EMAC controller with FPGA's soft IPs such as soft PHY.

Enable ODT for 533MHz operation

This Preloader is updated to initialize the SDRAM ODT registers. 

This is required for faster operation of SDRAM such as 533MHz.

FPGA2SDRAM Port Reset Configuration

This Preloader is updated to allow soft IP access to HPS SDRAM through FPGA2SDRAM port.

It enables the port(s) as told by Qsys instead of all them.

Ultimately, downstream software will need to change these settings based upon changing "soft" FPGA IP needs.

Clock Manager Macro

This change updates the Preloader Clock Manager macro. 

Although its not a functional defect, it might cause higher current consumption during clock configuration.

Resetting EMAC controller during PHY interface configuration

This change updates U-Boot's EMAC driver. 

U-Boot will put the EMAC controller into reset when configuring the PHY interface select register within System Manager.

It is to avoid potential clock glitch that might cause the EMAC and PHY going into unknown state.

* Note: This change is not rolled into the Preloader that is part of 13.0sp1, but is available via git on

Quick Tips

SD Card Layout

Below is the layout of SD card which contain all the boot image.

Location of everything except the Preloader is configurable.

FlashLayout-SDMMC.png (Click here for image)

Programming QSPI using U-boot

User can use U-Boot to program or update the boot image within QSPI flash.

  1. You can store you files into FAT partition of SDMMC.
  2. This can be done by just using normal Windows machine and copy into it.
  3. When reaching U-Boot stage, invoke the console.
  4. Load the file from the SDMMC

 % fatload mmc 0:1 <temporary memory location in sdram, example 0x2000000> <filename>.

  1. Erase the flash memory area you wish to program into

 %sf probe (optional in case you haven't initialize Quad SPI controller before)

 %sf erase <start of flash address> <erase size, minimum 0x10000>


For Preloader ->

 %sf erase 0x0 0x40000

For U-Boot ->

 %sf erase 0x60000 0x40000.

  1. Program the file into the flash memory

 %sf write <memory location specified in step 3> <flash address specified in step 4> $filesize


For Preloader -> sf write 0x2000000 0x0 $filesize

For U-Boot -> sf write 0x2000000 0x60000 $filesize.

FlashLayout-QSPI.png (Click here for image)

Running Preloader from onchip RAM on FPGA

This is to support the BootROM's FPGA boot flow. 

This is enabled when BSEL = boot from FPGA.

  1. Edit the board/altera/socfpga_cyclone5/build.h and tell Preloader that you want to execute on FPGA.
  3. At same file, tell Preloader where you want Preloader's rw data section and stacks located.
  4. #define CONFIG_FPGA_DATA_BASE 0xFFFF0000.
  5. At include/configs/socfpga_cyclone5, tell Preloader where you want Preloader's .text and .rodata section located.
  7. #define CONFIG_SPL_TEXT_BASE 0xC0000000
  8. #else
  9. #define CONFIG_SPL_TEXT_BASE 0xFFFF0000
  10. #endif


To enable the BootROM's to pass off boot to a preloader residing in the FPGA, you need to properly tie off signals in Qsys and Quartus.

FPGA_ocram.png (Click here for image)

Please refer to the following steps:

  1. At Qsys, do tick the option "Enable boot from fpga signals" at HPS components
  2. export the "f2h_boot_from_fpga" signal in Qsys "System Contents" tab
  3. Build Qsys and lanch Quartus
  4. Pull the signal exported to top level of Quartus and tied that signal to high.
  5. Example: ".hps_0_f2h_boot_from_fpga_boot_from_fpga_ready (1'b1)"
  • Preparing FPGA boot image*
  1. Using the Preloader’s ELF file, convert it to Intel HEX format
  2. % arm-none-eabi-objcopy -O ihex --adjust-vma -0xc0000000 u-boot-spl u-boot-spl.hex

  1. At Qsys, ensure you have connected hps's full weight bridge (HPS2FPGA) to onchip_memory where 
  2. * base address is 0x0 
  3. * data width is 8 bit.
  4. At the “Memory initialization” section, 
  5. * Tick “Initialize memory content” 
  6. * Tick “Enable non-default initialization file”. 
  7. * Specify the user created initialization file to the hex file generated at step 1
  8. Import the Qsys into Quartus.
  9. Build the project. The output POF file then programmed into FPGA. 
  10. Do ensure you select the correct BSEL = FPGA boot.
  11. From here, the BootROM will handover to the Preloader residing in the FPGA

Enabling a simple memory test

To enable a simple and quick memory test after the SDRAM successfully calibrated, just enable the hardware diagnostic mode.

At board/altera/socfpga_cyclone5/build.h, #define CONFIG_PRELOADER_HARDWARE_DIAGNOSTIC (1)

Do note that the value of PHYS_SDRAM_1_SIZE should be in power of 2 (SDRAM device size always in a value of power of 2 too).

Ethernet PHY and data clock tuning from within U-Boot

User can configure the data and clock skew run time without the need to recompile the source.

Here are the steps:

Invoke U-Boot console

 % env set micrel-ksz9021-clk-skew 0xa0d0

 % env set micrel-ksz9021-data-skew 0x0

 % saveenv

 % reset

The value will take effect after the restart.

Version history
Last update:
‎06-27-2019 12:27 AM
Updated by: