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.

AM5728: How to distingwish in u-boot between power-on and cold reset/reboot

Part Number: AM5728

Hi,

I'd like to have a reliable possibility in u-boot to distinguish between start-up after power-on and after cold reset/reboot (disregard whether initiated by u-boot or linux).

I tried to use PRM_RSTST register, but it has value 0x1 disregard whether after power on on reboot.

I appritiate any idea.

Best regards,

Timur.

  • Hello Timur,

    You are looking at the right register i.e PRM_RSTST register.

    bit 0 set shows that Power-on reset has occurred(This will be set as soon as you boot power-on).

    However either from Linux/u-boot if you do a warm reset you should be seeing that bit1 also gets
    set so you should be reading a value of 0x3. Let me know if you read different from that.

    - Keerthy

  • Hi Keerthy,

    as I already wrote I get always 0x1 value in PRM_RSRST register disregard whether just after power on of the board, or after reset command in U-Boot or after reboot command in Linux.

    As far as I understand this is a correct behaviour, because bit 0 of this register means COLD_RESET and both U-Boot's reset and Linux' reboot initiate cold reset.

    But the question is, if there is a possibility to distiquish between cold reset and power on ?

    For example it may be some counter which is not affected by cold reset or some other register which explicitely indicates power on and gets reset after reading (as a suggestion).

    Probably I had to mention that I'm speking about a custom board based on AM5728.

    Best regards,

    Timur.

  • Timur,

    I misinterpreted it as warm reset versus cold reset question.

    Can you elaborate on what exactly you mean by power on?

    Is it like the first time power on of the board basically power cycling the board VS cold_reset?

    - Keerthy

  • Hi Keerthy,

    I want to be sure, that if I ask a user to power cycle the board it really does it.

    In other words I need to be sure that the board is getting up bacause of the first power on or a power cycle and not after a reset (cold or warm.).

    Best regrds,

    Timur.

  • Hello Timur,

    There is a PMIC RTC which keeps on ticking. I verified across reboot it still
    keeps ticking however if you power cycle the board it starts afresh.

    cat /sys/class/rtc/rtc1/time

    Try that once you give a reboot and once you power cycle we can see the difference
    in behavior. I hope you could use that for your decision making.

    - Keerthy

  • Hi Keerthy,

    the RTC on my board and is equipped with a battery therefore in my case the RTC counter keeps counting also when power is off.

    I suspect there should be some processor counter, not a one from external device, which survives cold reset but of course not power cycle,

    or some other processor register.

    Best regards,

    Timur.

  • Hi Keerthy,

    do you meen, that I need to enable PMIC RTC first and then check its counter and not one of my on-board RTC with battery ?

    Best regards,

    Timur.

  • Hi Timur,

    Yes i am specifically talking about PMIC RTC.

    cat /sys/class/rtc/rtc1/name
    palmas-rtc 48070000.i2c:tps659038@58:tps659038_rtc

    The above one.

    The AM5728 on chip RTC is:

    cat /sys/class/rtc/rtc2/name
    omap_rtc 48838000.rtc

    So the PMIC RTC is ticking until you do a hard power cycle. Any reset/reboot does not
    stop that. Hence the suggestion.

    - Keerthy

  • Hi Keerthy,

    thanks a lot. With this I can live further.

    You can close the ticket.

    Best regards,

    Timur.