imx: distinguish POR from POR+WDOG reset cause for first wd
Subsystems (3)
PATCH 1/1 imx: distinguish POR from POR+WDOG reset cause for first wd
In some application the possibility to check if the reset is caused by a watchdog is essential, even if it occurs simultaneously with POR.
--- arch/arm/mach-imx/cpu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
arch/arm/mach-imx/cpu.c +6 -1
@@ -47,7 +47,6 @@ static char *get_reset_cause(void) {switch (get_imx_reset_cause ()) {case 0x00001 : -case 0x00011 :return "POR" ;case 0x00004 :return "CSU" ;
@@ -59,6 +58,12 @@ static char *get_reset_cause(void)#else return "WDOG" ;#endif +case 0x00011 : +#ifdef CONFIG_MX7 +return "POR + WDOG1" ; +#else +return "POR + WDOG" ; +#endif case 0x00020 :return "JTAG HIGH-Z" ;case 0x00040 :
Signature · 1 line
2.7.4
Fabio Estevam
reviewerPATCH 1/1 imx: distinguish POR from POR+WDOG reset cause for first wd
Hi Flavio,
Quoted 25 lines · Flavio Suligoi
In some application the possibility to check if the reset is caused by a watchdog is essential, even if it occurs simultaneously with POR.
Signed-off-by Flavio Suligoi <[email protected]>--- arch/arm/mach-imx/cpu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)arch/arm/mach-imx/cpu.c +0
-1@@ -47,7 +47,6 @@ static char *get_reset_cause(void) {switch (get_imx_reset_cause ()) {case 0x00001 : -case 0x00011 :return "POR" ;case 0x00004 :return "CSU" ;@@ -59,6 +58,12 @@ static char *get_reset_cause(void)#else return "WDOG" ;
arch/arm/mach-imx/cpu.c static char *get_reset_cause(void) · line 69
Quoted 10 lines
arch/arm/mach-imx/cpu.c +6
-0#endif +case 0x00011 : +#ifdef CONFIG_MX7 +return "POR + WDOG1" ; +#else +return "POR + WDOG" ; +#endif case 0x00020 :return "JTAG HIGH-Z" ;case 0x00040 :
If I understand this correctly your board has a WDOG_B pin connected to the PMIC and when WDOG_B is asserted the PMIC is power cycled and the system resets via POR.
Is this correct? If not, please describe exactly your setup and what you are trying to achieve.
It seems that the current behavior is correct for me.
Thanks
PATCH 1/1 imx: distinguish POR from POR+WDOG reset cause for first wd
Hi Fabio,
Quoted 44 lines
Hi Flavio,
Quoted 25 lines · Flavio Suligoi
In some application the possibility to check if the reset is caused by a watchdog is essential, even if it occurs simultaneously with POR.
Signed-off-by Flavio Suligoi <[email protected]>--- arch/arm/mach-imx/cpu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)arch/arm/mach-imx/cpu.c +0
-1@@ -47,7 +47,6 @@ static char *get_reset_cause(void) {switch (get_imx_reset_cause ()) {case 0x00001 : -case 0x00011 :return "POR" ;case 0x00004 :return "CSU" ;@@ -59,6 +58,12 @@ static char *get_reset_cause(void)#else return "WDOG" ;arch/arm/mach-imx/cpu.c static char *get_reset_cause(void) · line 69
Quoted 10 lines
arch/arm/mach-imx/cpu.c +6
-0#endif +case 0x00011 : +#ifdef CONFIG_MX7 +return "POR + WDOG1" ; +#else +return "POR + WDOG" ; +#endif case 0x00020 :return "JTAG HIGH-Z" ;case 0x00040 :If I understand this correctly your board has a
WDOG_Bpin connected to the PMIC and whenWDOG_Bis asserted the PMIC is power cycled and the system resets via POR.
Quoted 6 lines
Is this correct? If not, please describe exactly your setup and what you are trying to achieve.
It seems that the current behavior is correct for me.
Thanks
I'm currently use the imx8mm_evk board, with the PMIC Rohom BD71847AMWV.
After a:
- power-on
- push-button reset
- a watchdog using the WDOG_B
the i.MX8MMini register SRC_SRSR (address 0x3039005C) is:SRC_SRSR = 0x00000001 --> POR
but after a soft reset, from u-boot, using the WDOG1_WCR (address 0x30280000):
mw.w 30280000 053C
we have:SRC_SRSR = 0x00000011 --> POR + WDOG
and in this case is important for me to distinguish the two different situation.
Thanks,
Flavio
PATCH 1/1 imx: distinguish POR from POR+WDOG reset cause for first wd
Quoted 62 lines
Subject: RE: [PATCH] imx: distinguish POR from POR+WDOG reset cause for first wd
Hi Fabio,
Quoted 40 lines
Hi Flavio,
Quoted 22 lines · Flavio Suligoi
In some application the possibility to check if the reset is caused by a watchdog is essential, even if it occurs simultaneously with POR.
Signed-off-by Flavio Suligoi <[email protected]>--- arch/arm/mach-imx/cpu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)arch/arm/mach-imx/cpu.c index renamed from arch/arm/mach-imx/cpu.c +0
-0bfa85c6..ce0c663 100644
arch/arm/mach-imx/cpu.c +0
-1@@ -47,7 +47,6 @@ static char *get_reset_cause(void) {switch (get_imx_reset_cause ()) {case 0x00001 : -case 0x00011 :return "POR" ;case 0x00004 :return "CSU" ;arch/arm/mach-imx/cpu.c static char *get_reset_cause(void) #else · line 66
Quoted 9 lines
arch/arm/mach-imx/cpu.c +4
-0@@ -59,6 +58,12 @@ static char *get_reset_cause(void) #elsereturn "WDOG" ;#endif +case 0x00011 : +#ifdef CONFIG_MX7 +return "POR + WDOG1" ;#else +return "POR + WDOG" ;#endif case 0x00020 :return "JTAG HIGH-Z" ;case 0x00040 :If I understand this correctly your board has a
WDOG_Bpin connected to the PMIC and whenWDOG_Bis asserted the PMIC is power cycled and the system resets via POR.Quoted 6 lines
Is this correct? If not, please describe exactly your setup and what you are trying to achieve.
It seems that the current behavior is correct for me.
Thanks
I'm currently use the
imx8mm_evkboard, with the PMIC Rohom BD71847AMWV.
After a:- power-on
- push-button reset
- a watchdog using theWDOG_B
Quoted 7 lines
the i.MX8MMini register
SRC_SRSR(address0x3039005C) is:SRC_SRSR=0x00000001--> PORbut after a soft reset, from u-boot, using the
WDOG1_WCR(address0x30280000):mw.w 30280000 053C
This will trigger a wdog timeout wdog_b assert to pmic, so it should be POR.
Quoted 3 lines
we have:
SRC_SRSR=0x00000011--> POR + WDOG
If bit4 is set, that means you are not really doing POR. Have you tried clear Bit 3 and 5 when set WCR?
If you wanna soft reset, using wdog_b to trigger pmic is not correct. You need use SRS.
Regards,
Peng.
Quoted 6 lines
and in this case is important for me to distinguish the two different situation.
Thanks,
Flavio
PATCH 1/1 imx: distinguish POR from POR+WDOG reset cause for first wd
Hi Peng,
Quoted 87 lines
-----Original Message-----
From: Peng Fan <[email protected]>
Sent: lunedì 27 gennaio 2020 13:50
To: Flavio Suligoi <[email protected]>; Fabio Estevam <[email protected]>
Cc: Stefano Babic <[email protected]>; dl-uboot-imx <[email protected]>; U- Boot-Denx <[email protected]>
Subject: RE: [PATCH] imx: distinguish POR from POR+WDOG reset cause for first wdQuoted 9 lines
Subject: RE: [PATCH] imx: distinguish POR from POR+WDOG reset cause for first wd
Hi Fabio,
Quoted 4 lines
Hi Flavio,
On Wed, Jan 22, 2020 at 11:18 AM Flavio Suligoi <[email protected]>
Quoted 51 lines · wrote:
Quoted 36 lines
Quoted 22 lines
In some application the possibility to check if the reset is caused by a watchdog is essential, even if it occurs simultaneously with POR.
Signed-off-by Flavio Suligoi <[email protected]>--- arch/arm/mach-imx/cpu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)arch/arm/mach-imx/cpu.c index renamed from arch/arm/mach-imx/cpu.c +0
-0bfa85c6..ce0c663 100644
arch/arm/mach-imx/cpu.c +0
-1@@ -47,7 +47,6 @@ static char *get_reset_cause(void) {switch (get_imx_reset_cause ()) {case 0x00001 : -case 0x00011 :return "POR" ;case 0x00004 :return "CSU" ;arch/arm/mach-imx/cpu.c static char *get_reset_cause(void) #else · line 66
Quoted 9 lines
arch/arm/mach-imx/cpu.c +4
-0@@ -59,6 +58,12 @@ static char *get_reset_cause(void) #elsereturn "WDOG" ;#endif +case 0x00011 : +#ifdef CONFIG_MX7 +return "POR + WDOG1" ;#else +return "POR + WDOG" ;#endif case 0x00020 :return "JTAG HIGH-Z" ;case 0x00040 :If I understand this correctly your board has a
WDOG_Bpin connected to the PMIC and whenWDOG_Bis asserted the PMIC is power cycled and the system resets via POR.Quoted 6 lines
Is this correct? If not, please describe exactly your setup and what you are trying to achieve.
It seems that the current behavior is correct for me.
Thanks
I'm currently use the
imx8mm_evkboard, with the PMIC Rohom BD71847AMWV.
After a:- power-on
- push-button reset
- a watchdog using theWDOG_BQuoted 7 lines
the i.MX8MMini register
SRC_SRSR(address0x3039005C) is:SRC_SRSR=0x00000001--> PORbut after a soft reset, from u-boot, using the
WDOG1_WCR(address0x30280000):mw.w 30280000 053C
This will trigger a wdog timeout
wdog_bassert to pmic, so it should be POR.Quoted 3 lines
we have:
SRC_SRSR=0x00000011--> POR + WDOG
Quoted 6 lines
If bit4 is set, that means you are not really doing POR. Have you tried clear
Bit 3 and 5 when set WCR?If you wanna soft reset, using
wdog_bto trigger pmic is not correct. You need use SRS.
My goal is to use the wd to have an hw reset, using the WDOG_B connected to the PMIC, but, in the same time, at reboot, I want to distinguish a real POR (a real power-on, for example) from a reset caused by the wd-->WDOG_B.
In our future mx8mm board we want to use the new PCA9450, using its capability to generate a cold reset, recycling all the voltage regulators except LDO1/2 (see cap.7.4 PMIC Reset, register 0x08 RESET_CTRL).
In this way the SNVS_LP power should maintain the values inside the SRC Reset Status Register (SRC_SRSR) of the mx8mm. Is it correct?
Thanks and regards,
Flavio
Quoted 11 lines
Regards,
Peng.Quoted 2 lines
and in this case is important for me to distinguish the two different
situation.
Quoted 4 lines
Thanks,
Flavio