* [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 2012-01-23 11:13 ` [PATCH 2/2] ARM: omap: Fix omap_prcm_get_reset_sources() for omap3/4 Shubhrajyoti D 0 siblings, 2 replies; 8+ messages in thread From: Shubhrajyoti D @ 2012-01-23 11:13 UTC (permalink / raw) To: linux-watchdog; +Cc: linux-omap, linux-arm-kernel, Shubhrajyoti D 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] 8+ 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 1 sibling, 1 reply; 8+ messages in thread From: Shubhrajyoti D @ 2012-01-23 11:13 UTC (permalink / raw) To: linux-watchdog; +Cc: linux-omap, linux-arm-kernel, Shubhrajyoti D 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] 8+ messages in thread
* RE: [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; 8+ messages in thread From: Bedia, Vaibhav @ 2012-01-24 5:02 UTC (permalink / raw) To: Datta, Shubhrajyoti, linux-watchdog@vger.kernel.org Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [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; 8+ messages in thread From: Shubhrajyoti Datta @ 2012-01-24 6:10 UTC (permalink / raw) To: Bedia, Vaibhav Cc: Datta, Shubhrajyoti, linux-watchdog@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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@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@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [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; 8+ messages in thread From: Bedia, Vaibhav @ 2012-01-24 6:29 UTC (permalink / raw) To: Shubhrajyoti Datta Cc: Datta, Shubhrajyoti, linux-watchdog@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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. -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [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; 8+ messages in thread From: Wolfram Sang @ 2012-01-24 9:33 UTC (permalink / raw) To: Bedia, Vaibhav Cc: Shubhrajyoti Datta, linux-omap@vger.kernel.org, Datta, Shubhrajyoti, linux-arm-kernel@lists.infradead.org, linux-watchdog@vger.kernel.org [-- Attachment #1: Type: text/plain, Size: 566 bytes --] > 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/ | [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [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; 8+ messages in thread From: Shubhrajyoti @ 2012-01-24 9:49 UTC (permalink / raw) To: Wolfram Sang Cc: Bedia, Vaibhav, Shubhrajyoti Datta, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-watchdog@vger.kernel.org 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] 8+ 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 1 sibling, 0 replies; 8+ messages in thread From: Shubhrajyoti D @ 2012-01-23 11:13 UTC (permalink / raw) To: linux-watchdog Cc: linux-omap, linux-arm-kernel, Rajendra Nayak, Shubhrajyoti D, Gina Glaser, Benoit Cousson 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] 8+ messages in thread
end of thread, other threads:[~2012-01-24 9:49 UTC | newest] Thread overview: 8+ 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
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).