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.

AM335x Determine Boot Source

I was looking through the TRM and couldn't figure out how to determine this.  Is there a way to determine what bootsource was actually used by the ROM loader?  I know you can read the SYSBOOT pins out of the CONTROL_STATUS register, but this doesn't tell me which one actually succeeded just the order.

I want to use my uSD as a fallback so my boot order is NAND then uSD and i want to use U-Boot to detect if we booted from uSD and if so then restore the NAND.  Currently i generate 2 different U-Boot images, one for NAND and one for SD, but I'd like to make just one image which would be really easy if there was a way to determine what we booted from.

  • Look in the Initialization chapter in the TRM. The boot ROM loads register R0 with the address of a Booting Parameters Block that contains a byte telling you what you actually booted from. The SPL code reads this to determine where to get u-boot from. If you wanted u-boot to know where it came from, you would have to find some way for MLO to pass it to u-boot.

    Steve K.

  • Awesome!  I was able to locate the code in U-Boot that pulls it in in common/spl/spl.c.

    I will probably just toss the ID into RAM somewhere or into a UART Scratch Register from the SPL so that U-Boot can pull it back out : ).

    Thank you for pointing me in correct direction : ).  I knew there had to be someway in U-Boot of getting that info I just couldn't figure out where to start looking.