PCA9451A PWRON_STAT register

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PCA9451A PWRON_STAT register

975 Views
wooosaiiii
Contributor IV

Hi,

We are using i.MX93 SoM with PCA9451A PMIC.

We are reading the PMIC's PWRON_STAT (0x05) register in U-Boot.

wooosaiiii_0-1756802701449.png

In case of a reset command or watchdog timeout, the appropriate bits are set!

e.g. U-Boot reset (i2c command sent to PMIC to reset): 

bit 5 -> SW_RST

e.g. U-Boot watchdog timeout (simulate with loop 0 0 command):

bit 6 -> WDOG

However, when unplugging/plugging in power, two bits are set in this register.

Read register value 0x90 -> bit7 and bit4

bit 7 ... PWRON (expected)

bit 4 ... PMIC_RST (not expected)

Is this expected?

Are we supposed to read all bits? How to choose then if 2 bits set which reset reason was performed?

 

 

 

 

0 Kudos
Reply
2 Replies

962 Views
wooosaiiii
Contributor IV

Hi @TomasVaverka , Thanks for your input.

Can you say bits are already arranged by the order of priority?

BIT7 -> top priority

BIT4 -> lowest priority

I want as generic an implementation as possible.

 

0 Kudos
Reply

964 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Primoz,

Yes, this is expected. The PCA9451A can and does set multiple bits in PWRON_STAT when more than one reset/event happened and the bits are latched until read. Perhaps you can apply a priority rule in software. Example:

If PWRON set → treat as power-on (power-cycle) boot.
else if WDOG set → treat as watchdog reset.
else if SW_RST set → treat as software reset.
else if PMIC_RST set → treat as PMIC pin reset.

BRs, Tomas

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2161991%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EPCA9451A%20PWRON_STAT%20register%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2161991%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EWe%20are%20using%20i.MX93%20SoM%20with%20PCA9451A%20PMIC.%3C%2FP%3E%3CP%3EWe%20are%20reading%20the%20PMIC's%20PWRON_STAT%20(0x05)%20register%20in%20U-Boot.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22wooosaiiii_0-1756802701449.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22wooosaiiii_0-1756802701449.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F355157iA19E0AC14905DFEB%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22wooosaiiii_0-1756802701449.png%22%20alt%3D%22wooosaiiii_0-1756802701449.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EIn%20case%20of%20a%20reset%20command%20or%20watchdog%20timeout%2C%20the%20appropriate%20bits%20are%20set!%3C%2FP%3E%3CP%3Ee.g.%20U-Boot%20reset%20(i2c%20command%20sent%20to%20PMIC%20to%20reset)%3A%26nbsp%3B%3C%2FP%3E%3CP%3Ebit%205%20-%26gt%3B%20SW_RST%3C%2FP%3E%3CP%3Ee.g.%20U-Boot%20watchdog%20timeout%20(simulate%20with%20loop%200%200%20command)%3A%3C%2FP%3E%3CP%3Ebit%206%20-%26gt%3B%20WDOG%3C%2FP%3E%3CP%3EHowever%2C%20when%20unplugging%2Fplugging%20in%20power%2C%20two%20bits%20are%20set%20in%20this%20register.%3C%2FP%3E%3CP%3ERead%20register%20value%20%3CSTRONG%3E0x90%3C%2FSTRONG%3E%20-%26gt%3B%20%3CSTRONG%3Ebit7%3C%2FSTRONG%3E%20and%20%3CSTRONG%3Ebit4%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3Ebit%207%20...%20PWRON%20(expected)%3C%2FP%3E%3CP%3Ebit%204%20...%20PMIC_RST%20(not%20expected)%3C%2FP%3E%3CP%3EIs%20this%20expected%3F%3C%2FP%3E%3CP%3EAre%20we%20supposed%20to%20read%20all%20bits%3F%20How%20to%20choose%20then%20if%202%20bits%20set%20which%20reset%20reason%20was%20performed%3F%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2162087%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20PCA9451A%20PWRON_STAT%20register%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2162087%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F12216%22%20target%3D%22_blank%22%3E%40TomasVaverka%3C%2FA%3E%26nbsp%3B%2C%20Thanks%20for%20your%20input.%3C%2FP%3E%3CP%3ECan%20you%20say%20bits%20are%20already%20arranged%20by%20the%20order%20of%20priority%3F%3C%2FP%3E%3CP%3EBIT7%20-%26gt%3B%20top%20priority%3C%2FP%3E%3CP%3EBIT4%20-%26gt%3B%20lowest%20priority%3C%2FP%3E%3CP%3EI%20want%20as%20generic%20an%20implementation%20as%20possible.%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2162085%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20PCA9451A%20PWRON_STAT%20register%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2162085%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Primoz%2C%3C%2FP%3E%0A%3CP%3EYes%2C%20this%20is%20expected.%20The%20PCA9451A%20can%20and%20does%20set%20multiple%20bits%20in%20PWRON_STAT%20when%20more%20than%20one%20reset%2Fevent%20happened%20and%20the%20bits%20are%20latched%20until%20read.%20Perhaps%20you%20can%20apply%20a%20priority%20rule%20in%20software.%20Example%3A%3C%2FP%3E%0A%3CP%3EIf%20PWRON%20set%20%E2%86%92%20treat%20as%20power-on%20(power-cycle)%20boot.%3CBR%20%2F%3Eelse%20if%20WDOG%20set%20%E2%86%92%20treat%20as%20watchdog%20reset.%3CBR%20%2F%3Eelse%20if%20SW_RST%20set%20%E2%86%92%20treat%20as%20software%20reset.%3CBR%20%2F%3Eelse%20if%20PMIC_RST%20set%20%E2%86%92%20treat%20as%20PMIC%20pin%20reset.%3C%2FP%3E%0A%3CP%3EBRs%2C%20Tomas%3C%2FP%3E%3C%2FLINGO-BODY%3E