This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Determining boot source chosen by boot ROM in x-loader

Hi,

I have a 3530 board with sys_boot pins[4:0] set for boot order: usb,uart3,mmc1,nand.  This order works booting from NAND, but with flash erased and booting MLO from an SD card, x-loader tries getting the secondary bootloader from flash instead of SD.

The way x-loader is written, it uses the 3530's control_status register (0x480022F0) to determine where to get u-boot, and in my case, mmc_boot() is never attempted.

Is there a way to determine which boot source (nand or sd) the 3530 boot ROM used to read MLO? I'd like to avoid having a physical switch like the BeagleBoard uses to change the sys_boot pins and instead have x-loader figure out the right thing to do: MLO from SD loads u-boot.bin from SD and x-loader from NAND gets u-boot from NAND.

 

Thanks!

John

  • Maybe you can look at the tracing vector.  I see bitfields for SD/MMC1, SD/MMC2, NAND, etc.

  • Hi Brad,

    That's exactly what I was looking for.  Booting from SD gives 0x00000040800095f8 and from NAND gives 0x00020044800095f8, so bit 34 tells me if I started from NAND.

    Thanks!

    ,

    John

  • Hi John and Brad,

    While I  totally agree that using the tracing vector is a valid way of doing this, I think I will just suggest another way of doing it for future reference as well. When the ROM code gives over control to the user boot-loader the value in R0 will be an address of a "Booting Parameter Structure" which will specifically specify the booting device in question as well as some other boot information (i.e. Reset reason)

    More information about this can be found in chapter 25.4.8.4 of the TRM (just prior to the chapter describing the content of the Tracing Vector)

    Best regards
      Søren