Your statement that the mx51 "will try to boot from the devices in the following order, NOR, oneNAND, NAND, MMC, SPI/I2C, EEPROM" isn't really correct. That is the order the devices are listed in the flow chart, but there is no "sequencing" of the devices and they could have been listed in any order in the chart. The determination of which external device to boot from is made entirely by the setting of BT_MEM_CTL and BT_MEM_TYPE.
If you are trying to boot from NAND you should be setting (pert table 2-2 of the Security Reference Manual):
BOOT_MODE[1:0] = 00 [to enable boot from external device]
BT_MEM_CTL[1:0] = 01 [for NAND]
BT_MEM_TYPE[1:0] = [set per table below based on the number of address cycles your NAND device requires]
In my opinion, section 9.4.3 of the Reference Manual is correct. It will try to run the internal boot if BMOD =00 or 01. If there is no valid image in the selected memory (NAND / WEIM), it will jump to the serial downloader.
There is a high level boot sequence (flow chart) in chapter 2.10 of the SRM. It says that imx51 will try to boot from the devices in the following order, NOR, oneNAND, NAND, MMC, SPI/I2C, EEPROM. If it is not able to boot from the above mentioned devices, it shall jump to serial downloader.
That is what exactly happening to our system. I am tring to boot from NAND. I made the boot switches as per the RM. It is not booting. Then i connected the ATK Tool Kit. It is connecting.
Is this the boot image problem or some setting of signals like BT_MEM_CTL? This needs to be checked out.
It turns out that because there are a lot of security features wrapped around boot Freescale has chosen to move the detailed description of the boot process into the "Security Reference Manual" document, which requires an NDA to obtain.
Chapter 2 of the Security Reference Manual is basically the same as Chapter 9 of the Reference Manual, but with a huge number of missing details fleshed out (including a very clear flowchart of the precise boot decision tree).
Unfortunately the Security Reference Manual is "Confidential Proprietary" so I'm bound by the NDA to not reproduce sections here, even though I strongly believe that there is a fair bit of material there which belongs in Chapter 9 of the Reference Manual. I recommend you execute an NDA with Freescale and get a copy. What I can safely clarify is that in "normal" (i.e. non-secure) use the process of booting to an external memory device by setting BMOD=0 and using BT_MEM_CTL/BT_MEM_TYPE to select the boot device functions as one would hope (i.e. the processor determines the external boot memory device, fetches code from it, and begins executing that code; the internal ROM is not involved and can indeed be blank, and apparently is blank as shipped).
For me section 9.4.3 of the Reference Manual was confusing, because it says that the serial downloader will run if "
BMOD[1:0] = 00 or 10 (internal or internal boot with fuses) and there is not a valid image in the Flash device". I believe that
should read " BMOD[1:0] = 00 or 10 (
external or internal boot with fuses) and there is not a valid image in the
selected boot device". So yes, if you set BMOD=00 and use BT_MEM_CTL/BT_MEM_TYPE to select, say, NAND, then the MX51 will try to boot from NAND and if it doesn't find a valid image in NAND
then it will invoke the serial downloader.
For the specifics of how the MX51 decides that a code image is invalid you will have to refer to the Security Reference Manual (though again I personally believe that information belongs in the Reference Manual).
We set all the settings as per the reference menual as well as SRM. But the device did not boot from NAND...!
We are setting the following settings.
1.1. BT_MEM_CTL[1:0] = 01 for boot from NANDFlash (Switch 7 - OFF, switch 8 ON) 1.2. BT_PAGE_SIZE[1:0] according to - 01 2 K bytes (R382 not mounted and R383mounted) 1.3. In case of 4Kbyte page size NAND Flash configure BT_SPARE_SIZEaccording to: - 0 for 128 bytes spare (Samsung) (R388 mounted)
1.4. BT_BUS_WIDTH[1:0] according to: - 00 for 8-bit; (R384 not mounted)
1.5. BT_MEM_TYPE[1:0] according to (Switch 4 - OFF, switch 5- ON) - 01 4 address cycles
1.6. BT_MLC_SEL - 0 SLC NAND device (R386 not mounted)
1.7. GPIO_BT_SEL =0 for efuse override (Verified by reading the fuse settings) 1.8. Internal Boot mode - BMODE[0:1]=00 (Switch 1 & 2 - OFF)
Still it is not working...!
We are thinking of changing the NAND chip itself...!
We are using the imx51 babbage board with external NAND (numonyx NAND01GR3B2C - 8 bit 2k page NAND) connected.
We have configured the Boot settings as follows.
1.1. BT_MEM_CTL[1:0] = 01 for boot from NAND Flash (Switch 7 - OFF, switch 8 ON) 1.2. BT_PAGE_SIZE[1:0] according to - 01 2 K bytes (R382 not mounted and R383 mounted) 1.3. In case of 4Kbyte page size NAND Flash configure BT_SPARE_SIZE according to: - 0 for 128 bytes spare (Samsung) (R388 mounted)
1.4. BT_BUS_WIDTH[1:0] according to: - 00 for 8-bit; (R384 not mounted)
1.5. BT_MEM_TYPE[1:0] according to (Switch 4 - OFF, switch 5 - ON) - 01 4 address cycles
1.6. BT_MLC_SEL - 0 SLC NAND device (R386 not mounted)
1.7. GPIO_BT_SEL =0 for efuse override (We dont know how to set this?)
/* Monitor at beginning of flash */ #define CONFIG_FSL_ENV_IN_NAND
And we have compiled the u-boot and written to NAND flash at the offset 0x0. Except booting from NAND, all other NAND operations like erase, read write to NAND flash is working fine. Even, mounting the filesystem from NAND is also works fine.
Its look like the address cycle from the Boot ROM is different than what the NAND Flash address cycle. In boot switch I configured as 4 address cycle, but according to the boot ROM is sending 5 address cycles. Is the boot switch settings will override the boot ROM settings?