i.MX28: Get Boot Mode from ROM loader

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX28: Get Boot Mode from ROM loader

865 Views
jörg_krause
Contributor III

Hello,

I want to read from the second stage bootloader which boot mode the ROM loader used to boot the device, especially to distinguish if it was booted by USB recovery or NAND boot mode. Reading the Boot Mode Pads is not reliable since the Boot Mode Pads can be already released (eg, BM2 to force from NAND to USB recovery mode) when the bootloader reads the pin values (high or low).

Is there any register, I didn't find one in the manual, which holds the boot mode at power-up? Or is there any other way to obtain the boot mode at power-up state?

Regards

Jörg Krause

Labels (1)
0 Kudos
5 Replies

546 Views
igorpadykov
NXP Employee
NXP Employee

Hi Jörg

you are right - there is no register preserving  power-up boot mode.

Seems one can add small routine in bootlets (at power initialization)

reading boot pins and storing them somewhere.

Best regards

igor

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

Note: If this post answers your question, please click the Correct Answer button. Thank you!

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

0 Kudos

546 Views
jörg_krause
Contributor III

Hi Igor,

many thanks for your reply! Reading boot pins does not work in all cases for USB recovery boot mode. If the recovery button, e.g. BM2 for switching from NAND to USB boot, is pressed and the USB is connected the ROM loader starts in USB recovery boot mode. Now, the button is released and afterwards a BootStream image (bootlets) is loaded by the ROM loader. If the bootlet now reads the boot pins, the pins do not have the same state as they had when the ROM loader read the pins, because the button was released and so BM2 is not low anymore.

Best regards

Jörg

0 Kudos

546 Views
igorpadykov
NXP Employee
NXP Employee

Hi Jörg

for USB usage in recovery boot mode one can check USB settings, like

HW_USBPHY_CTRL[CLKGATE]

Best regards

igor

546 Views
jörg_krause
Contributor III

Checking the USB-PHY registers helps to distinguish between NAND boot mode and USB recovery boot mode, but it seems more like a workaround.

In a U-Boot version from Timesys for i.MX28EVK I've found a comment that the ROM loader stores the boot mode at the fixed address 0x00019BF0 in OCRAM. I've checked this and it seems correct. Reading this address after power-up shows 0x0 for USB boot mode and 0x4 for NAND boot mode. Is this documented somewhere?

Best regards

Jörg

546 Views
igorpadykov
NXP Employee
NXP Employee

I am afraid not.

Best regards

igor

0 Kudos