* [PATCH RFC 0/2] watchdog boot status
@ 2012-01-23 11:13 Shubhrajyoti D
2012-01-23 11:13 ` [PATCH RFC 1/2] watchdog : omap_wdt : Implement WDIOC_GETBOOTSTATUS for omap3+ Shubhrajyoti D
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Shubhrajyoti D @ 2012-01-23 11:13 UTC (permalink / raw)
To: linux-arm-kernel
This patch series does the following
Patch 1:
Fixes the omap_prcm_get_reset_sources() for omap3/4
Patch 2:
Extends the WDIOC_GETBOOTSTATUS to support omap3/4.
Tested on omap3sdp and omap4sdp.
Rajendra Nayak (1):
ARM: omap: Fix omap_prcm_get_reset_sources() for omap3/4
Shubhrajyoti D (1):
watchdog : omap_wdt : Implement WDIOC_GETBOOTSTATUS for omap3+
arch/arm/mach-omap2/prcm.c | 13 ++++++++-----
arch/arm/mach-omap2/prm44xx.h | 3 ---
drivers/watchdog/omap_wdt.c | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH RFC 1/2] watchdog : omap_wdt : Implement WDIOC_GETBOOTSTATUS for omap3+
2012-01-23 11:13 [PATCH RFC 0/2] watchdog boot status Shubhrajyoti D
@ 2012-01-23 11:13 ` Shubhrajyoti D
2012-01-24 5:02 ` Bedia, Vaibhav
2012-01-23 11:13 ` [PATCH 2/2] ARM: omap: Fix omap_prcm_get_reset_sources() for omap3/4 Shubhrajyoti D
2014-02-20 8:02 ` [PATCH RFC 0/2] watchdog boot status Mandar Nandale
2 siblings, 1 reply; 9+ messages in thread
From: Shubhrajyoti D @ 2012-01-23 11:13 UTC (permalink / raw)
To: linux-arm-kernel
This patch intends to implement the WDIOC_GETBOOTSTATUS ioctl
for the omap3 and omap4.
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
drivers/watchdog/omap_wdt.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
index 4b33e3f..5395a4c 100644
--- a/drivers/watchdog/omap_wdt.c
+++ b/drivers/watchdog/omap_wdt.c
@@ -229,7 +229,7 @@ static long omap_wdt_ioctl(struct file *file, unsigned int cmd,
if (cpu_is_omap16xx())
return put_user(__raw_readw(ARM_SYSST),
(int __user *)arg);
- if (cpu_is_omap24xx())
+ if (cpu_is_omap24xx() || cpu_is_omap34xx() || cpu_is_omap44xx())
return put_user(omap_prcm_get_reset_sources(),
(int __user *)arg);
return put_user(0, (int __user *)arg);
--
1.7.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] ARM: omap: Fix omap_prcm_get_reset_sources() for omap3/4
2012-01-23 11:13 [PATCH RFC 0/2] watchdog boot status Shubhrajyoti D
2012-01-23 11:13 ` [PATCH RFC 1/2] watchdog : omap_wdt : Implement WDIOC_GETBOOTSTATUS for omap3+ Shubhrajyoti D
@ 2012-01-23 11:13 ` Shubhrajyoti D
2014-02-20 8:02 ` [PATCH RFC 0/2] watchdog boot status Mandar Nandale
2 siblings, 0 replies; 9+ messages in thread
From: Shubhrajyoti D @ 2012-01-23 11:13 UTC (permalink / raw)
To: linux-arm-kernel
From: Rajendra Nayak <rnayak@ti.com>
Fix omap_prcm_get_reset_sources() for omap3 to look into the
right register, and for omap4 to use the right api (and hence
look into the right register).
With this, get rid of some of the unused and also wrongly
defined macros for OMAP4.
Thanks to Gina Glaser for identifying the issue with the
offset macros for OMAP4_RM_RSTST and OMAP4_RM_RSTTIME being
swapped, which resulted in this patch.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Cc: Gina Glaser <g-glaser@ti.com>
Cc: Benoit Cousson <b-cousson@ti.com>
---
arch/arm/mach-omap2/prcm.c | 13 ++++++++-----
arch/arm/mach-omap2/prm44xx.h | 3 ---
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
index 626acfa..d855f40 100644
--- a/arch/arm/mach-omap2/prcm.c
+++ b/arch/arm/mach-omap2/prcm.c
@@ -36,7 +36,7 @@
#include "prm44xx.h"
#include "prminst44xx.h"
#include "prm-regbits-24xx.h"
-#include "prm-regbits-44xx.h"
+#include "prcm44xx.h"
#include "control.h"
void __iomem *prm_base;
@@ -47,12 +47,15 @@ void __iomem *cm2_base;
u32 omap_prcm_get_reset_sources(void)
{
- /* XXX This presumably needs modification for 34XX */
- if (cpu_is_omap24xx() || cpu_is_omap34xx())
+ if (cpu_is_omap24xx())
return omap2_prm_read_mod_reg(WKUP_MOD, OMAP2_RM_RSTST) & 0x7f;
+ if (cpu_is_omap34xx())
+ return omap2_prm_read_mod_reg(OMAP3430_GR_MOD,
+ OMAP3_PRM_RSTST_OFFSET) & 0x7ff;
if (cpu_is_omap44xx())
- return omap2_prm_read_mod_reg(WKUP_MOD, OMAP4_RM_RSTST) & 0x7f;
-
+ return omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
+ OMAP4430_PRM_DEVICE_INST,
+ OMAP4_PRM_RSTST_OFFSET) & 0x7ff;
return 0;
}
EXPORT_SYMBOL(omap_prcm_get_reset_sources);
diff --git a/arch/arm/mach-omap2/prm44xx.h b/arch/arm/mach-omap2/prm44xx.h
index 7978092..41353e4 100644
--- a/arch/arm/mach-omap2/prm44xx.h
+++ b/arch/arm/mach-omap2/prm44xx.h
@@ -61,9 +61,6 @@
#define OMAP4430_PRM_EMU_CM_EMU_CDOFFS 0x0000
/* OMAP4 specific register offsets */
-#define OMAP4_RM_RSTCTRL 0x0000
-#define OMAP4_RM_RSTTIME 0x0004
-#define OMAP4_RM_RSTST 0x0008
#define OMAP4_PM_PWSTCTRL 0x0000
#define OMAP4_PM_PWSTST 0x0004
--
1.7.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH RFC 1/2] watchdog : omap_wdt : Implement WDIOC_GETBOOTSTATUS for omap3+
2012-01-23 11:13 ` [PATCH RFC 1/2] watchdog : omap_wdt : Implement WDIOC_GETBOOTSTATUS for omap3+ Shubhrajyoti D
@ 2012-01-24 5:02 ` Bedia, Vaibhav
2012-01-24 6:10 ` Shubhrajyoti Datta
0 siblings, 1 reply; 9+ messages in thread
From: Bedia, Vaibhav @ 2012-01-24 5:02 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Jan 23, 2012 at 16:43:07, Datta, Shubhrajyoti wrote:
> This patch intends to implement the WDIOC_GETBOOTSTATUS ioctl
> for the omap3 and omap4.
>
Instead of just returning the register content why not parse
the RSTST register value and check if it's really a watchdog
reset or not?
> Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
> ---
> drivers/watchdog/omap_wdt.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
> index 4b33e3f..5395a4c 100644
> --- a/drivers/watchdog/omap_wdt.c
> +++ b/drivers/watchdog/omap_wdt.c
> @@ -229,7 +229,7 @@ static long omap_wdt_ioctl(struct file *file, unsigned int cmd,
> if (cpu_is_omap16xx())
> return put_user(__raw_readw(ARM_SYSST),
> (int __user *)arg);
> - if (cpu_is_omap24xx())
> + if (cpu_is_omap24xx() || cpu_is_omap34xx() || cpu_is_omap44xx())
> return put_user(omap_prcm_get_reset_sources(),
> (int __user *)arg);
> return put_user(0, (int __user *)arg);
> --
> 1.7.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH RFC 1/2] watchdog : omap_wdt : Implement WDIOC_GETBOOTSTATUS for omap3+
2012-01-24 5:02 ` Bedia, Vaibhav
@ 2012-01-24 6:10 ` Shubhrajyoti Datta
2012-01-24 6:29 ` Bedia, Vaibhav
0 siblings, 1 reply; 9+ messages in thread
From: Shubhrajyoti Datta @ 2012-01-24 6:10 UTC (permalink / raw)
To: linux-arm-kernel
Hi Vaibhav,
On Tue, Jan 24, 2012 at 10:32 AM, Bedia, Vaibhav <vaibhav.bedia@ti.com> wrote:
> On Mon, Jan 23, 2012 at 16:43:07, Datta, Shubhrajyoti wrote:
>> This patch intends to implement the WDIOC_GETBOOTSTATUS ioctl
>> for the omap3 and omap4.
>>
>
> Instead of just returning the register content why not parse
> the RSTST register value and check if it's really a watchdog
> reset or not?
That is what is done for 24xx and below cpus. So I thought of extending it.
>
>> Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
>> ---
>> ?drivers/watchdog/omap_wdt.c | ? ?2 +-
>> ?1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
>> index 4b33e3f..5395a4c 100644
>> --- a/drivers/watchdog/omap_wdt.c
>> +++ b/drivers/watchdog/omap_wdt.c
>> @@ -229,7 +229,7 @@ static long omap_wdt_ioctl(struct file *file, unsigned int cmd,
>> ? ? ? ? ? ? ? if (cpu_is_omap16xx())
>> ? ? ? ? ? ? ? ? ? ? ? return put_user(__raw_readw(ARM_SYSST),
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? (int __user *)arg);
>> - ? ? ? ? ? ? if (cpu_is_omap24xx())
>> + ? ? ? ? ? ? if (cpu_is_omap24xx() || cpu_is_omap34xx() || cpu_is_omap44xx())
>> ? ? ? ? ? ? ? ? ? ? ? return put_user(omap_prcm_get_reset_sources(),
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? (int __user *)arg);
>> ? ? ? ? ? ? ? return put_user(0, (int __user *)arg);
>> --
>> 1.7.1
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH RFC 1/2] watchdog : omap_wdt : Implement WDIOC_GETBOOTSTATUS for omap3+
2012-01-24 6:10 ` Shubhrajyoti Datta
@ 2012-01-24 6:29 ` Bedia, Vaibhav
2012-01-24 9:33 ` Wolfram Sang
0 siblings, 1 reply; 9+ messages in thread
From: Bedia, Vaibhav @ 2012-01-24 6:29 UTC (permalink / raw)
To: linux-arm-kernel
Hi Shubhrajyoti,
On Tue, Jan 24, 2012 at 11:40:43, Shubhrajyoti Datta wrote:
> Hi Vaibhav,
>
> On Tue, Jan 24, 2012 at 10:32 AM, Bedia, Vaibhav <vaibhav.bedia@ti.com> wrote:
> > On Mon, Jan 23, 2012 at 16:43:07, Datta, Shubhrajyoti wrote:
> >> This patch intends to implement the WDIOC_GETBOOTSTATUS ioctl
> >> for the omap3 and omap4.
> >>
> >
> > Instead of just returning the register content why not parse
> > the RSTST register value and check if it's really a watchdog
> > reset or not?
>
> That is what is done for 24xx and below cpus. So I thought of extending it.
>
>
IMO they also need to be fixed then :)
Just returning the register content does not help much and looking at other
implementations, like Blackfin, I am guessing this IOCTL is supposed to give
a yes/no sort of result.
Regards,
Vaibhav B.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH RFC 1/2] watchdog : omap_wdt : Implement WDIOC_GETBOOTSTATUS for omap3+
2012-01-24 6:29 ` Bedia, Vaibhav
@ 2012-01-24 9:33 ` Wolfram Sang
2012-01-24 9:49 ` Shubhrajyoti
0 siblings, 1 reply; 9+ messages in thread
From: Wolfram Sang @ 2012-01-24 9:33 UTC (permalink / raw)
To: linux-arm-kernel
> Just returning the register content does not help much and looking at other
> implementations, like Blackfin, I am guessing this IOCTL is supposed to give
> a yes/no sort of result.
It needs to return WDIOF_* flags as defined in include/linux/watchdog.h.
Check also Documentation/watchdog/watchdog-api.txt for further info.
Yes, not all drivers follow this style, sadly.
Regards,
Wolfram
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120124/f1918c62/attachment.sig>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH RFC 1/2] watchdog : omap_wdt : Implement WDIOC_GETBOOTSTATUS for omap3+
2012-01-24 9:33 ` Wolfram Sang
@ 2012-01-24 9:49 ` Shubhrajyoti
0 siblings, 0 replies; 9+ messages in thread
From: Shubhrajyoti @ 2012-01-24 9:49 UTC (permalink / raw)
To: linux-arm-kernel
On Tuesday 24 January 2012 03:03 PM, Wolfram Sang wrote:
>> Just returning the register content does not help much and looking at other
>> implementations, like Blackfin, I am guessing this IOCTL is supposed to give
>> a yes/no sort of result.
> It needs to return WDIOF_* flags as defined in include/linux/watchdog.h.
> Check also Documentation/watchdog/watchdog-api.txt for further info.
> Yes, not all drivers follow this style, sadly.
Yes I agree.
> Regards,
>
> Wolfram
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH RFC 0/2] watchdog boot status
2012-01-23 11:13 [PATCH RFC 0/2] watchdog boot status Shubhrajyoti D
2012-01-23 11:13 ` [PATCH RFC 1/2] watchdog : omap_wdt : Implement WDIOC_GETBOOTSTATUS for omap3+ Shubhrajyoti D
2012-01-23 11:13 ` [PATCH 2/2] ARM: omap: Fix omap_prcm_get_reset_sources() for omap3/4 Shubhrajyoti D
@ 2014-02-20 8:02 ` Mandar Nandale
2 siblings, 0 replies; 9+ messages in thread
From: Mandar Nandale @ 2014-02-20 8:02 UTC (permalink / raw)
To: linux-arm-kernel
Shubhrajyoti D <shubhrajyoti <at> ti.com> writes:
>
> This patch series does the following
> Patch 1:
> Fixes the omap_prcm_get_reset_sources() for omap3/4
>
> Patch 2:
> Extends the WDIOC_GETBOOTSTATUS to support omap3/4.
>
> Tested on omap3sdp and omap4sdp.
>
> Rajendra Nayak (1):
> ARM: omap: Fix omap_prcm_get_reset_sources() for omap3/4
>
> Shubhrajyoti D (1):
> watchdog : omap_wdt : Implement WDIOC_GETBOOTSTATUS for omap3+
>
> arch/arm/mach-omap2/prcm.c | 13 ++++++++-----
> arch/arm/mach-omap2/prm44xx.h | 3 ---
> drivers/watchdog/omap_wdt.c | 2 +-
> 3 files changed, 9 insertions(+), 9 deletions(-)
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo <at> vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
Hi ,
I am trying to get a last reboot reason using WDIOC_GETBOOTSTATUS ioctl
call from application. Previously before applying this patch it was always
returning me non-zero value no matter reboot is caused by watchdog or power
on reset, so i applied this patch and added some prink statements to
omap_wdt.c file and now after applying patch :
if (cpu_is_omap24xx() || cpu_is_omap34xx() || cpu_is_omap44xx()) this
condition is successfull and omap_prcm_get_reset_sources() function is
getting called and everytime i am getting 0 for ioctl call thus even if
reboot is caused by watchdog it will return me 0 (Power-On-Reset).
What may be the reasons behind this kind of behaviour?
This is the omap_prcm_get_reset_sources() function from
arch/arm/mach-omap2/prcm.c file in my kernel source :
u32 omap_prcm_get_reset_sources(void)
{
/* XXX This presumably needs modification for 34XX */
if (cpu_is_omap24xx() || cpu_is_omap34xx())
return omap2_prm_read_mod_reg(WKUP_MOD, OMAP2_RM_RSTST) & 0x7f;
if (cpu_is_omap44xx())
return omap2_prm_read_mod_reg(WKUP_MOD, OMAP4_RM_RSTST) & 0x7f;
return 0;
}
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-02-20 8:02 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-23 11:13 [PATCH RFC 0/2] watchdog boot status Shubhrajyoti D
2012-01-23 11:13 ` [PATCH RFC 1/2] watchdog : omap_wdt : Implement WDIOC_GETBOOTSTATUS for omap3+ Shubhrajyoti D
2012-01-24 5:02 ` Bedia, Vaibhav
2012-01-24 6:10 ` Shubhrajyoti Datta
2012-01-24 6:29 ` Bedia, Vaibhav
2012-01-24 9:33 ` Wolfram Sang
2012-01-24 9:49 ` Shubhrajyoti
2012-01-23 11:13 ` [PATCH 2/2] ARM: omap: Fix omap_prcm_get_reset_sources() for omap3/4 Shubhrajyoti D
2014-02-20 8:02 ` [PATCH RFC 0/2] watchdog boot status Mandar Nandale
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox