I am working on i.MX7D based custom platform with secure boot enabled. We use u-boot as bootloader which is flashed on NAND. I see that u-boot is also stored in a secondary NAND area (secondary bootstream) when flashed using "kobs-ng" utility. Based on this, I have following questions:
- Can I force to u-boot to boot from secondary boot-stream (either boot-stream 0 or 1)?
- In Technical Reference Manual document, I see that PERSIST_SECONDARY_BOOT (SRC_GPR10) can be used to select from which bootstream to use. However, value of PERSIST_SECONDARY_BOOT bit is preserved only across SW reset.
- I change the value to PERSIST_SECONDARY_BOOT bit (from 0 to 1, to force booting from boot-stream 1) from u-boot prompt using following command, is it correct?
- # mw.l 0x30390098 0x40000000
- I noticed that after running this command, if I run "reset" command on u-boot, it still boots from boot-stream 0. Can you please point out what am I doing wrong?
- According to TRM section 18.104.22.168.2:
If during primary image read there is a page with a number of errors higher than ECC can
correct, the boot ROM will turn on PERSIST_SECONDARY_BOOT bit and perform
SW reset (After SW reset, secondary image is used).
- I try to force the above situation by writing garbage data to 1st page of boot-stream 0 (i.e. at offset 0x00200000). Now I expect the Boot ROM to set the PERSIST_SECONDARY_BOOT and perform SW reset, but that does not happen and the device just does not boot. I have to use serial downloader to make the device bootable again.