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.

how to know the board is rebooted because of kernel panic in u-boot

Other Parts Discussed in Thread: AM3352

We are currently working on custom design board based on AM3352 processor

I'm trying to detect the reboot was due to Kernel panic

Seting bootarg panic =1 restarts the board in 1 sec.

And On panic We are observing GLOBAL_WARM_SW_RST bit of PRM_RSTST Register set to 1. and after a normal boot it is set to 0

But GLOBAL_WARM_SW_RST will set  even on reboot command issued from terminal after login

We have tried Bootcount method too.. It seems bootcount also increments on warm reset..

We want to distinguish between reboot on kernel panic and system reboot.. for booting kernel from a recovery option

Will WDT1_RST bit of PRM_RSTST Register go high on Kernel panic ? we are always reading that bit as 0 in u-boot

Any help would be highly appreciated.

Regards,
Sooraj


  • Hi Sooraj,

    sooraj r k said:
    And On panic We are observing GLOBAL_WARM_SW_RST bit of PRM_RSTST Register set to 1. and after a normal boot it is set to 0

    But GLOBAL_WARM_SW_RST will set  even on reboot command issued from terminal after login

    I think this is normal and expected. Most probably the kernel panic handler is making the same SW reset as the console reboot command is doing.

    sooraj r k said:
    We want to distinguish between reboot on kernel panic and system reboot.. for booting kernel from a recovery option

    I can suggest you to try with a flag in AM335x RTC scratchpad registers or flag in external non-volatile flash memory (NAND, EEPROM). See the below e2e threads for more info:

    sooraj r k said:
    Will WDT1_RST bit of PRM_RSTST Register go high on Kernel panic ? we are always reading that bit as 0 in u-boot

    No, it will not. This bit will go high only after WDT reset.

    Regards,
    Pavel

  • Thanx for the prompt reply.
    Now Im able to understand bootcount driver in u-boot-2016.05 better.
    RTC_SCRATCH2_REG is already used by the bootcounter driver to store bootcount. (drivers/bootcount/bootcount_davinci.c)
    I will try to write to use other regs for incrementing bootcount only on kernel panic or failure to load kernel.
    Thanks Again.