With I.MX28, is there any way to know the event that caused the device to power up? I mean how to know if the device reset happens due to Watchdog reset? I have checked with HW_POWER_STS status register but didn't have any indication for reset from Watchdog. Based on that I would like to know if the systems fails to boot due to flash corruption/boot failure and boot with other partition.
Any inputs will be appreciated.
I think except HW_POWER_STS there are no other
ways to know sources of reset. I.MX28 iROM uses other mechanizms
to recover from boot failures due to flash corruption. For example,
according to Table 12-10 (Persistent Bits) of the i.MX28 Reference Manual,
when bit 1 of the HW_RTC_PERSISTENT1 (ROM_SECONDARY_BOOT) is set
"ROM attempts to boot from the secondary image if the boot driver supports it.
This bit is set by the ROM boot driver and cleared by the SDK after repair."
Please look at section 22.214.171.124 (Redundant Boot Support in ROM NAND driver)
MCIMX28RM about secondary boot details.
Is there any other way to detect it not using secure boot mechanism you have suggested?
Like as I said earlier, I am dealing with firmware recovery mechanism in our device and having trouble in detecting the Kernel Panic(Filesystem Mount failure - due to flash corruption) on u-boot for switching the boot path. The Processor doesnt support the power up event detection (like watchdog reset or power reset).
NAND Memory LAYOUT:
How to handle following boot flow:
1. power on the device
2. U-boot boots the PATH 1 (kernel1 and rootfs1)
3. Kernel1 boots but fails to mount Filesystem due to flash corruption
4. System resets after 10 seconds of panic as the PANIC=10 is in bootargs
5. u-boot started booting.
6. ??? How to know if the device now has to use PATH 2 (kernel2 and rootfs2) to boot.
Any suggestions will be helpful.
Wonderful Suggestion!! I havent thought of that.
Does on processor reset(due to kernel panic) the iRAM get resets too to default cleaning up all the marking?
Is it possible to access iRAM in u-boot ?
It worked Igor. Thanks a lot.
Just for Info how it is used in linux (May help other):
|char *ptr = (char*) (MX28_OCRAM_ADDR + 0xE400);|