linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v8 0/6] OMAP: WDT: Implement WDT in hwmod way
@ 2010-09-23 14:32 Varadarajan, Charulatha
  2010-09-23 14:32 ` [PATCH v8 1/6] OMAP3: hwmod data: Add watchdog timer Varadarajan, Charulatha
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Varadarajan, Charulatha @ 2010-09-23 14:32 UTC (permalink / raw)
  To: linux-arm-kernel

Series of patches to port watchdog module to use hwmod APIs
for OMAP2PLUS chips and use runtime APIs for all OMAP chips.
For this hwmod database for OMAP2PLUS watchdog instances are
populated and implements watchdog module to use PM runtime APIs.

This patch series is generated on "origin/pm-core" which
has Kevin's pm-next series, the runtime PM core patch series,
and a collection of hwmod fixes that Paul/Benoit have lined up
for 2.6.37.

Tested on OMAP2430, OMAP4430 (ES1.0 & ES2.0), OMAP3430 SDP boards
and zoom3 board. Also verified that this patch series does not
break the OMAP1 build.

This series is tested on OMAP4430 ES2 using the below series
(dependency series for ES2.0 silicon)
http://www.spinics.net/lists/linux-omap/msg36023.html

Version History:
---------------
Version v8:
*Enable wd_timer3 in the hwmod list

Version v7:
*Use EN_*SHIFT macros for module_bit and ST_*SHIFT macros for
idlest_idle_bit in OMAP2&3 hwmod database
(based on suggestions given by Paul for I2C hwmod series)
*Remove new definitions of EN_*SHIFT macros as they already exist
Some of the v7 links:
https://patchwork.kernel.org/patch/197022/

Version v6:
*Split omap_init_wdt() into separate omap_init_wdt functions
under mach-omap1 and mach-omap2 and set them up with
subsys_initcall
*Include wd_timer3 database for OMAP4
*In hwmod database follow naming convention "wd_timerX"
Some of the v6 links:
http://www.spinics.net/lists/linux-omap/msg36678.html
https://patchwork.kernel.org/patch/188242/
https://patchwork.kernel.org/patch/188222/

Version v5:
*Delete wdt_runtime_resume and wdt_runtime_suspend
functions as the fix for the return values in the generic
runtime PM calls has been queued for 2.6.37 (see below link)
https://lists.linux-foundation.org/pipermail/linux-pm/2010-September/028466.html
Some of the v5 links:
https://patchwork.kernel.org/patch/181812/
https://patchwork.kernel.org/patch/181782/
https://patchwork.kernel.org/patch/181772/
https://patchwork.kernel.org/patch/181792/

Version v4:
*Implement hwmod adapdation first and then PM runtime adaptation
as two different patches in the series
*Remove inclusion of omap_device.h in the driver file.
Some of the v4 links:
https://patchwork.kernel.org/patch/174672/
https://patchwork.kernel.org/patch/174662/

Version v3:
*Fix Minor comments like renaming omap1 watchdog structures
with an omap1_ prefix
Some of the v3 links:
https://patchwork.kernel.org/patch/119698/
https://patchwork.kernel.org/patch/119696/ 

Version v2:
*Rebase to latest kernel
Some of the v2 links:
http://www.spinics.net/lists/linux-omap/msg34741.html
http://www.spinics.net/lists/linux-omap/msg34673.html

Version v1:
*Initial series
Some of the v1 links:
http://www.spinics.net/lists/linux-omap/msg30628.html
http://www.spinics.net/lists/linux-omap/msg30625.html

Benoit Cousson (1):
  OMAP4: hwmod data: Add watchdog timer

Varadarajan, Charulatha (5):
  OMAP3: hwmod data: Add watchdog timer
  OMAP2420: hwmod data: Add watchdog timer
  OMAP2430: hwmod data: Add watchdog timer
  OMAP2PLUS: WDT: use omap_device_build for device registration
  OMAP: WDT: Use PM runtime APIs instead of clk FW APIs

 arch/arm/mach-omap1/devices.c              |   27 ++++++
 arch/arm/mach-omap2/devices.c              |   39 ++++++++
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |   64 +++++++++++++
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |   64 +++++++++++++
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   66 ++++++++++++++
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  135 ++++++++++++++++++++++++++++
 arch/arm/plat-omap/devices.c               |   41 ---------
 drivers/watchdog/omap_wdt.c                |   42 ++-------
 8 files changed, 402 insertions(+), 76 deletions(-)

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v8 1/6] OMAP3: hwmod data: Add watchdog timer
  2010-09-23 14:32 [PATCH v8 0/6] OMAP: WDT: Implement WDT in hwmod way Varadarajan, Charulatha
@ 2010-09-23 14:32 ` Varadarajan, Charulatha
  2010-09-23 14:32 ` [PATCH v8 2/6] OMAP2420: " Varadarajan, Charulatha
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Varadarajan, Charulatha @ 2010-09-23 14:32 UTC (permalink / raw)
  To: linux-arm-kernel

Add watchdog timer hwmod data for OMAP3 chip

Signed-off-by: Charulatha V <charu@ti.com>
Acked-by: Cousson, Benoit <b-cousson@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   66 ++++++++++++++++++++++++++++
 1 files changed, 66 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 5d8eb58..5bfe9c9 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -21,6 +21,7 @@
 #include "omap_hwmod_common_data.h"
 
 #include "prm-regbits-34xx.h"
+#include "cm-regbits-34xx.h"
 
 /*
  * OMAP3xxx hardware module integration data
@@ -36,6 +37,7 @@ static struct omap_hwmod omap3xxx_iva_hwmod;
 static struct omap_hwmod omap3xxx_l3_main_hwmod;
 static struct omap_hwmod omap3xxx_l4_core_hwmod;
 static struct omap_hwmod omap3xxx_l4_per_hwmod;
+static struct omap_hwmod omap3xxx_wd_timer2_hwmod;
 
 /* L3 -> L4_CORE interface */
 static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = {
@@ -197,6 +199,69 @@ static struct omap_hwmod omap3xxx_iva_hwmod = {
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
 };
 
+/* l4_wkup -> wd_timer2 */
+static struct omap_hwmod_addr_space omap3xxx_wd_timer2_addrs[] = {
+	{
+		.pa_start	= 0x48314000,
+		.pa_end		= 0x4831407f,
+		.flags		= ADDR_TYPE_RT
+	},
+};
+
+static struct omap_hwmod_ocp_if omap3xxx_l4_wkup__wd_timer2 = {
+	.master		= &omap3xxx_l4_wkup_hwmod,
+	.slave		= &omap3xxx_wd_timer2_hwmod,
+	.clk		= "wdt2_ick",
+	.addr		= omap3xxx_wd_timer2_addrs,
+	.addr_cnt	= ARRAY_SIZE(omap3xxx_wd_timer2_addrs),
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/*
+ * 'wd_timer' class
+ * 32-bit watchdog upward counter that generates a pulse on the reset pin on
+ * overflow condition
+ */
+
+static struct omap_hwmod_class_sysconfig omap3xxx_wd_timer_sysc = {
+	.rev_offs	= 0x0000,
+	.sysc_offs	= 0x0010,
+	.syss_offs	= 0x0014,
+	.sysc_flags	= (SYSC_HAS_SIDLEMODE | SYSC_HAS_EMUFREE |
+			   SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
+			   SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY),
+	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+	.sysc_fields    = &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap3xxx_wd_timer_hwmod_class = {
+	.name = "wd_timer",
+	.sysc = &omap3xxx_wd_timer_sysc,
+};
+
+/* wd_timer2 */
+static struct omap_hwmod_ocp_if *omap3xxx_wd_timer2_slaves[] = {
+	&omap3xxx_l4_wkup__wd_timer2,
+};
+
+static struct omap_hwmod omap3xxx_wd_timer2_hwmod = {
+	.name		= "wd_timer2",
+	.class		= &omap3xxx_wd_timer_hwmod_class,
+	.main_clk	= "wdt2_fck",
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP3430_EN_WDT2_SHIFT,
+			.module_offs = WKUP_MOD,
+			.idlest_reg_id = 1,
+			.idlest_idle_bit = OMAP3430_ST_WDT2_SHIFT,
+		},
+	},
+	.slaves		= omap3xxx_wd_timer2_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap3xxx_wd_timer2_slaves),
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
 static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
 	&omap3xxx_l3_main_hwmod,
 	&omap3xxx_l4_core_hwmod,
@@ -204,6 +269,7 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
 	&omap3xxx_l4_wkup_hwmod,
 	&omap3xxx_mpu_hwmod,
 	&omap3xxx_iva_hwmod,
+	&omap3xxx_wd_timer2_hwmod,
 	NULL,
 };
 
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v8 2/6] OMAP2420: hwmod data: Add watchdog timer
  2010-09-23 14:32 [PATCH v8 0/6] OMAP: WDT: Implement WDT in hwmod way Varadarajan, Charulatha
  2010-09-23 14:32 ` [PATCH v8 1/6] OMAP3: hwmod data: Add watchdog timer Varadarajan, Charulatha
@ 2010-09-23 14:32 ` Varadarajan, Charulatha
  2010-09-23 14:32 ` [PATCH v8 3/6] OMAP2430: " Varadarajan, Charulatha
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Varadarajan, Charulatha @ 2010-09-23 14:32 UTC (permalink / raw)
  To: linux-arm-kernel

Add watchdog timer hwmod data for OMAP2420 chip

Signed-off-by: Charulatha V <charu@ti.com>
Acked-by: Cousson, Benoit <b-cousson@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |   64 ++++++++++++++++++++++++++++
 1 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index 3cc768e..66678d9 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -19,6 +19,7 @@
 #include "omap_hwmod_common_data.h"
 
 #include "prm-regbits-24xx.h"
+#include "cm-regbits-24xx.h"
 
 /*
  * OMAP2420 hardware module integration data
@@ -33,6 +34,7 @@ static struct omap_hwmod omap2420_mpu_hwmod;
 static struct omap_hwmod omap2420_iva_hwmod;
 static struct omap_hwmod omap2420_l3_main_hwmod;
 static struct omap_hwmod omap2420_l4_core_hwmod;
+static struct omap_hwmod omap2420_wd_timer2_hwmod;
 
 /* L3 -> L4_CORE interface */
 static struct omap_hwmod_ocp_if omap2420_l3_main__l4_core = {
@@ -165,12 +167,74 @@ static struct omap_hwmod omap2420_iva_hwmod = {
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
 };
 
+/* l4_wkup -> wd_timer2 */
+static struct omap_hwmod_addr_space omap2420_wd_timer2_addrs[] = {
+	{
+		.pa_start	= 0x48022000,
+		.pa_end		= 0x4802207f,
+		.flags		= ADDR_TYPE_RT
+	},
+};
+
+static struct omap_hwmod_ocp_if omap2420_l4_wkup__wd_timer2 = {
+	.master		= &omap2420_l4_wkup_hwmod,
+	.slave		= &omap2420_wd_timer2_hwmod,
+	.clk		= "mpu_wdt_ick",
+	.addr		= omap2420_wd_timer2_addrs,
+	.addr_cnt	= ARRAY_SIZE(omap2420_wd_timer2_addrs),
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/*
+ * 'wd_timer' class
+ * 32-bit watchdog upward counter that generates a pulse on the reset pin on
+ * overflow condition
+ */
+
+static struct omap_hwmod_class_sysconfig omap2420_wd_timer_sysc = {
+	.rev_offs	= 0x0000,
+	.sysc_offs	= 0x0010,
+	.syss_offs	= 0x0014,
+	.sysc_flags	= (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET |
+			   SYSC_HAS_AUTOIDLE),
+	.sysc_fields    = &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap2420_wd_timer_hwmod_class = {
+	.name = "wd_timer",
+	.sysc = &omap2420_wd_timer_sysc,
+};
+
+/* wd_timer2 */
+static struct omap_hwmod_ocp_if *omap2420_wd_timer2_slaves[] = {
+	&omap2420_l4_wkup__wd_timer2,
+};
+
+static struct omap_hwmod omap2420_wd_timer2_hwmod = {
+	.name		= "wd_timer2",
+	.class		= &omap2420_wd_timer_hwmod_class,
+	.main_clk	= "mpu_wdt_fck",
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
+			.module_offs = WKUP_MOD,
+			.idlest_reg_id = 1,
+			.idlest_idle_bit = OMAP24XX_ST_MPU_WDT_SHIFT,
+		},
+	},
+	.slaves		= omap2420_wd_timer2_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap2420_wd_timer2_slaves),
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
 static __initdata struct omap_hwmod *omap2420_hwmods[] = {
 	&omap2420_l3_main_hwmod,
 	&omap2420_l4_core_hwmod,
 	&omap2420_l4_wkup_hwmod,
 	&omap2420_mpu_hwmod,
 	&omap2420_iva_hwmod,
+	&omap2420_wd_timer2_hwmod,
 	NULL,
 };
 
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v8 3/6] OMAP2430: hwmod data: Add watchdog timer
  2010-09-23 14:32 [PATCH v8 0/6] OMAP: WDT: Implement WDT in hwmod way Varadarajan, Charulatha
  2010-09-23 14:32 ` [PATCH v8 1/6] OMAP3: hwmod data: Add watchdog timer Varadarajan, Charulatha
  2010-09-23 14:32 ` [PATCH v8 2/6] OMAP2420: " Varadarajan, Charulatha
@ 2010-09-23 14:32 ` Varadarajan, Charulatha
  2010-09-23 15:25   ` Russell King - ARM Linux
  2010-09-23 14:32 ` [PATCH v8 4/6] OMAP4: " Varadarajan, Charulatha
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Varadarajan, Charulatha @ 2010-09-23 14:32 UTC (permalink / raw)
  To: linux-arm-kernel

Add watchdog timer hwmod data for OMAP2430 chip

Signed-off-by: Charulatha V <charu@ti.com>
Acked-by: Cousson, Benoit <b-cousson@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |   64 ++++++++++++++++++++++++++++
 1 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 4526628..7ec927a 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -19,6 +19,7 @@
 #include "omap_hwmod_common_data.h"
 
 #include "prm-regbits-24xx.h"
+#include "cm-regbits-24xx.h"
 
 /*
  * OMAP2430 hardware module integration data
@@ -33,6 +34,7 @@ static struct omap_hwmod omap2430_mpu_hwmod;
 static struct omap_hwmod omap2430_iva_hwmod;
 static struct omap_hwmod omap2430_l3_main_hwmod;
 static struct omap_hwmod omap2430_l4_core_hwmod;
+static struct omap_hwmod omap2430_wd_timer2_hwmod;
 
 /* L3 -> L4_CORE interface */
 static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = {
@@ -165,12 +167,74 @@ static struct omap_hwmod omap2430_iva_hwmod = {
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
 };
 
+/* l4_wkup -> wd_timer2 */
+static struct omap_hwmod_addr_space omap2430_wd_timer2_addrs[] = {
+	{
+		.pa_start	= 0x49016000,
+		.pa_end		= 0x4901607f,
+		.flags		= ADDR_TYPE_RT
+	},
+};
+
+static struct omap_hwmod_ocp_if omap2430_l4_wkup__wd_timer2 = {
+	.master		= &omap2430_l4_wkup_hwmod,
+	.slave		= &omap2430_wd_timer2_hwmod,
+	.clk		= "mpu_wdt_ick",
+	.addr		= omap2430_wd_timer2_addrs,
+	.addr_cnt	= ARRAY_SIZE(omap2430_wd_timer2_addrs),
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/*
+ * 'wd_timer' class
+ * 32-bit watchdog upward counter that generates a pulse on the reset pin on
+ * overflow condition
+ */
+
+static struct omap_hwmod_class_sysconfig omap2430_wd_timer_sysc = {
+	.rev_offs	= 0x0,
+	.sysc_offs	= 0x0010,
+	.syss_offs	= 0x0014,
+	.sysc_flags	= (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET |
+			   SYSC_HAS_AUTOIDLE),
+	.sysc_fields    = &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap2430_wd_timer_hwmod_class = {
+	.name = "wd_timer",
+	.sysc = &omap2430_wd_timer_sysc,
+};
+
+/* wd_timer2 */
+static struct omap_hwmod_ocp_if *omap2430_wd_timer2_slaves[] = {
+	&omap2430_l4_wkup__wd_timer2,
+};
+
+static struct omap_hwmod omap2430_wd_timer2_hwmod = {
+	.name		= "wd_timer2",
+	.class		= &omap2430_wd_timer_hwmod_class,
+	.main_clk	= "mpu_wdt_fck",
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
+			.module_offs = WKUP_MOD,
+			.idlest_reg_id = 1,
+			.idlest_idle_bit = OMAP24XX_ST_MPU_WDT_SHIFT,
+		},
+	},
+	.slaves		= omap2430_wd_timer2_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap2430_wd_timer2_slaves),
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
 static __initdata struct omap_hwmod *omap2430_hwmods[] = {
 	&omap2430_l3_main_hwmod,
 	&omap2430_l4_core_hwmod,
 	&omap2430_l4_wkup_hwmod,
 	&omap2430_mpu_hwmod,
 	&omap2430_iva_hwmod,
+	&omap2430_wd_timer2_hwmod,
 	NULL,
 };
 
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v8 4/6] OMAP4: hwmod data: Add watchdog timer
  2010-09-23 14:32 [PATCH v8 0/6] OMAP: WDT: Implement WDT in hwmod way Varadarajan, Charulatha
                   ` (2 preceding siblings ...)
  2010-09-23 14:32 ` [PATCH v8 3/6] OMAP2430: " Varadarajan, Charulatha
@ 2010-09-23 14:32 ` Varadarajan, Charulatha
  2010-09-23 14:32 ` [PATCH v8 5/6] OMAP: WDT: Split OMAP1 and OMAP2PLUS device registration Varadarajan, Charulatha
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Varadarajan, Charulatha @ 2010-09-23 14:32 UTC (permalink / raw)
  To: linux-arm-kernel

From: Benoit Cousson <b-cousson@ti.com>

Add watchdog timer hwmod data for OMAP4 chip

Note: wd_timer3 in enabled in the hwmod list but it is
not yet supported by the watchdog driver.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Charulatha V <charu@ti.com>
---
This patch is extracted from the below patch sent by Benoit
https://patchwork.kernel.org/patch/117347/

 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  135 ++++++++++++++++++++++++++++
 1 files changed, 135 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index e20b0ee..8660fea 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -452,6 +452,136 @@ static struct omap_hwmod omap44xx_mpu_hwmod = {
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 };
 
+/*
+ * 'wd_timer' class
+ * 32-bit watchdog upward counter that generates a pulse on the reset pin on
+ * overflow condition
+ */
+
+static struct omap_hwmod_class_sysconfig omap44xx_wd_timer_sysc = {
+	.rev_offs	= 0x0000,
+	.sysc_offs	= 0x0010,
+	.syss_offs	= 0x0014,
+	.sysc_flags	= (SYSC_HAS_SIDLEMODE | SYSC_HAS_EMUFREE |
+			   SYSC_HAS_SOFTRESET),
+	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+	.sysc_fields	= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap44xx_wd_timer_hwmod_class = {
+	.name = "wd_timer",
+	.sysc = &omap44xx_wd_timer_sysc,
+};
+
+/* wd_timer2 */
+static struct omap_hwmod omap44xx_wd_timer2_hwmod;
+static struct omap_hwmod_irq_info omap44xx_wd_timer2_irqs[] = {
+	{ .irq = 80 + OMAP44XX_IRQ_GIC_START },
+};
+
+static struct omap_hwmod_addr_space omap44xx_wd_timer2_addrs[] = {
+	{
+		.pa_start	= 0x4a314000,
+		.pa_end		= 0x4a31407f,
+		.flags		= ADDR_TYPE_RT
+	},
+};
+
+/* l4_wkup -> wd_timer2 */
+static struct omap_hwmod_ocp_if omap44xx_l4_wkup__wd_timer2 = {
+	.master		= &omap44xx_l4_wkup_hwmod,
+	.slave		= &omap44xx_wd_timer2_hwmod,
+	.clk		= "l4_wkup_clk_mux_ck",
+	.addr		= omap44xx_wd_timer2_addrs,
+	.addr_cnt	= ARRAY_SIZE(omap44xx_wd_timer2_addrs),
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* wd_timer2 slave ports */
+static struct omap_hwmod_ocp_if *omap44xx_wd_timer2_slaves[] = {
+	&omap44xx_l4_wkup__wd_timer2,
+};
+
+static struct omap_hwmod omap44xx_wd_timer2_hwmod = {
+	.name		= "wd_timer2",
+	.class		= &omap44xx_wd_timer_hwmod_class,
+	.mpu_irqs	= omap44xx_wd_timer2_irqs,
+	.mpu_irqs_cnt	= ARRAY_SIZE(omap44xx_wd_timer2_irqs),
+	.main_clk	= "wd_timer2_fck",
+	.prcm = {
+		.omap4 = {
+			.clkctrl_reg = OMAP4430_CM_WKUP_WDT2_CLKCTRL,
+		},
+	},
+	.slaves		= omap44xx_wd_timer2_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap44xx_wd_timer2_slaves),
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+/* wd_timer3 */
+static struct omap_hwmod omap44xx_wd_timer3_hwmod;
+static struct omap_hwmod_irq_info omap44xx_wd_timer3_irqs[] = {
+	{ .irq = 36 + OMAP44XX_IRQ_GIC_START },
+};
+
+static struct omap_hwmod_addr_space omap44xx_wd_timer3_addrs[] = {
+	{
+		.pa_start	= 0x40130000,
+		.pa_end		= 0x4013007f,
+		.flags		= ADDR_TYPE_RT
+	},
+};
+
+/* l4_abe -> wd_timer3 */
+static struct omap_hwmod_ocp_if omap44xx_l4_abe__wd_timer3 = {
+	.master		= &omap44xx_l4_abe_hwmod,
+	.slave		= &omap44xx_wd_timer3_hwmod,
+	.clk		= "ocp_abe_iclk",
+	.addr		= omap44xx_wd_timer3_addrs,
+	.addr_cnt	= ARRAY_SIZE(omap44xx_wd_timer3_addrs),
+	.user		= OCP_USER_MPU,
+};
+
+/* l4_abe -> wd_timer3 (dma) */
+static struct omap_hwmod_addr_space omap44xx_wd_timer3_dma_addrs[] = {
+	{
+		.pa_start	= 0x49030000,
+		.pa_end		= 0x4903007f,
+		.flags		= ADDR_TYPE_RT
+	},
+};
+
+static struct omap_hwmod_ocp_if omap44xx_l4_abe__wd_timer3_dma = {
+	.master		= &omap44xx_l4_abe_hwmod,
+	.slave		= &omap44xx_wd_timer3_hwmod,
+	.clk		= "ocp_abe_iclk",
+	.addr		= omap44xx_wd_timer3_dma_addrs,
+	.addr_cnt	= ARRAY_SIZE(omap44xx_wd_timer3_dma_addrs),
+	.user		= OCP_USER_SDMA,
+};
+
+/* wd_timer3 slave ports */
+static struct omap_hwmod_ocp_if *omap44xx_wd_timer3_slaves[] = {
+	&omap44xx_l4_abe__wd_timer3,
+	&omap44xx_l4_abe__wd_timer3_dma,
+};
+
+static struct omap_hwmod omap44xx_wd_timer3_hwmod = {
+	.name		= "wd_timer3",
+	.class		= &omap44xx_wd_timer_hwmod_class,
+	.mpu_irqs	= omap44xx_wd_timer3_irqs,
+	.mpu_irqs_cnt	= ARRAY_SIZE(omap44xx_wd_timer3_irqs),
+	.main_clk	= "wd_timer3_fck",
+	.prcm = {
+		.omap4 = {
+			.clkctrl_reg = OMAP4430_CM1_ABE_WDT3_CLKCTRL,
+		},
+	},
+	.slaves		= omap44xx_wd_timer3_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap44xx_wd_timer3_slaves),
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
 static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
 	/* dmm class */
 	&omap44xx_dmm_hwmod,
@@ -472,6 +602,9 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
 
 	/* mpu class */
 	&omap44xx_mpu_hwmod,
+	/* wd_timer class */
+	&omap44xx_wd_timer2_hwmod,
+	&omap44xx_wd_timer3_hwmod,
 	NULL,
 };
 
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v8 5/6] OMAP: WDT: Split OMAP1 and OMAP2PLUS device registration
  2010-09-23 14:32 [PATCH v8 0/6] OMAP: WDT: Implement WDT in hwmod way Varadarajan, Charulatha
                   ` (3 preceding siblings ...)
  2010-09-23 14:32 ` [PATCH v8 4/6] OMAP4: " Varadarajan, Charulatha
@ 2010-09-23 14:32 ` Varadarajan, Charulatha
  2010-09-23 14:32 ` [PATCH v8 6/6] OMAP: WDT: Use PM runtime APIs instead of clk FW APIs Varadarajan, Charulatha
  2010-09-29  1:05 ` [PATCH v8 0/6] OMAP: WDT: Implement WDT in hwmod way Kevin Hilman
  6 siblings, 0 replies; 14+ messages in thread
From: Varadarajan, Charulatha @ 2010-09-23 14:32 UTC (permalink / raw)
  To: linux-arm-kernel

This patch splits omap_init_wdt() into separate omap_init_wdt()
functions under mach-omap1 and mach-omap2 and set them up with
subsys_initcall.

Also it uses  omap_device_build() API instead of
platform_device_register() for watchdog timer device registration
for OMAP2plus chips.

For OMAP2plus chips, the device specific data defined in centralized
hwmod database will be used.

Signed-off-by: Charulatha V <charu@ti.com>
Acked-by: Cousson, Benoit <b-cousson@ti.com>
---
 arch/arm/mach-omap1/devices.c |   27 +++++++++++++++++++++++++++
 arch/arm/mach-omap2/devices.c |   39 +++++++++++++++++++++++++++++++++++++++
 arch/arm/plat-omap/devices.c  |   41 -----------------------------------------
 3 files changed, 66 insertions(+), 41 deletions(-)

diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index aa07256..39447fa 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -232,3 +232,30 @@ static int __init omap1_init_devices(void)
 }
 arch_initcall(omap1_init_devices);
 
+#if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE)
+
+static struct resource wdt_resources[] = {
+	{
+		.start		= 0xfffeb000,
+		.end		= 0xfffeb07F,
+		.flags		= IORESOURCE_MEM,
+	},
+};
+
+static struct platform_device omap_wdt_device = {
+	.name	   = "omap_wdt",
+	.id	     = -1,
+	.num_resources	= ARRAY_SIZE(wdt_resources),
+	.resource	= wdt_resources,
+};
+
+static int __init omap_init_wdt(void)
+{
+	if (!cpu_is_omap16xx())
+		return;
+
+	platform_device_register(&omap_wdt_device);
+	return 0;
+}
+subsys_initcall(omap_init_wdt);
+#endif
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 2dbb265..439bfb3 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -15,6 +15,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/clk.h>
+#include <linux/err.h>
 
 #include <mach/hardware.h>
 #include <mach/irqs.h>
@@ -28,6 +29,8 @@
 #include <mach/gpio.h>
 #include <plat/mmc.h>
 #include <plat/dma.h>
+#include <plat/omap_hwmod.h>
+#include <plat/omap_device.h>
 
 #include "mux.h"
 
@@ -859,3 +862,39 @@ static int __init omap2_init_devices(void)
 	return 0;
 }
 arch_initcall(omap2_init_devices);
+
+#if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE)
+struct omap_device_pm_latency omap_wdt_latency[] = {
+	[0] = {
+		.deactivate_func = omap_device_idle_hwmods,
+		.activate_func   = omap_device_enable_hwmods,
+		.flags		 = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+	},
+};
+
+static int __init omap_init_wdt(void)
+{
+	int id = -1;
+	struct omap_device *od;
+	struct omap_hwmod *oh;
+	char *oh_name = "wd_timer2";
+	char *dev_name = "omap_wdt";
+
+	if (!cpu_class_is_omap2())
+		return 0;
+
+	oh = omap_hwmod_lookup(oh_name);
+	if (!oh) {
+		pr_err("Could not look up wd_timer%d hwmod\n", id);
+		return -EINVAL;
+	}
+
+	od = omap_device_build(dev_name, id, oh, NULL, 0,
+				omap_wdt_latency,
+				ARRAY_SIZE(omap_wdt_latency), 0);
+	WARN(IS_ERR(od), "Cant build omap_device for %s:%s.\n",
+				dev_name, oh->name);
+	return 0;
+}
+subsys_initcall(omap_init_wdt);
+#endif
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index d1920be..8e88e0e 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -232,46 +232,6 @@ static void omap_init_uwire(void)
 static inline void omap_init_uwire(void) {}
 #endif
 
-/*-------------------------------------------------------------------------*/
-
-#if	defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE)
-
-static struct resource wdt_resources[] = {
-	{
-		.flags		= IORESOURCE_MEM,
-	},
-};
-
-static struct platform_device omap_wdt_device = {
-	.name	   = "omap_wdt",
-	.id	     = -1,
-	.num_resources	= ARRAY_SIZE(wdt_resources),
-	.resource	= wdt_resources,
-};
-
-static void omap_init_wdt(void)
-{
-	if (cpu_is_omap16xx())
-		wdt_resources[0].start = 0xfffeb000;
-	else if (cpu_is_omap2420())
-		wdt_resources[0].start = 0x48022000; /* WDT2 */
-	else if (cpu_is_omap2430())
-		wdt_resources[0].start = 0x49016000; /* WDT2 */
-	else if (cpu_is_omap343x())
-		wdt_resources[0].start = 0x48314000; /* WDT2 */
-	else if (cpu_is_omap44xx())
-		wdt_resources[0].start = 0x4a314000;
-	else
-		return;
-
-	wdt_resources[0].end = wdt_resources[0].start + 0x4f;
-
-	(void) platform_device_register(&omap_wdt_device);
-}
-#else
-static inline void omap_init_wdt(void) {}
-#endif
-
 /*
  * This gets called after board-specific INIT_MACHINE, and initializes most
  * on-chip peripherals accessible on this board (except for few like USB):
@@ -300,7 +260,6 @@ static int __init omap_init_devices(void)
 	omap_init_rng();
 	omap_init_mcpdm();
 	omap_init_uwire();
-	omap_init_wdt();
 	return 0;
 }
 arch_initcall(omap_init_devices);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v8 6/6] OMAP: WDT: Use PM runtime APIs instead of clk FW APIs
  2010-09-23 14:32 [PATCH v8 0/6] OMAP: WDT: Implement WDT in hwmod way Varadarajan, Charulatha
                   ` (4 preceding siblings ...)
  2010-09-23 14:32 ` [PATCH v8 5/6] OMAP: WDT: Split OMAP1 and OMAP2PLUS device registration Varadarajan, Charulatha
@ 2010-09-23 14:32 ` Varadarajan, Charulatha
  2010-09-29  1:05 ` [PATCH v8 0/6] OMAP: WDT: Implement WDT in hwmod way Kevin Hilman
  6 siblings, 0 replies; 14+ messages in thread
From: Varadarajan, Charulatha @ 2010-09-23 14:32 UTC (permalink / raw)
  To: linux-arm-kernel

Call runtime pm APIs pm_runtime_put_sync() and pm_runtime_get_sync()
for enabling/disabling the clocks, sysconfig settings instead of using
clock FW APIs.

Signed-off-by: Charulatha V <charu@ti.com>
Acked-by: Cousson, Benoit <b-cousson@ti.com>
---
 drivers/watchdog/omap_wdt.c |   42 +++++++-----------------------------------
 1 files changed, 7 insertions(+), 35 deletions(-)

diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
index 76b58ab..dbbc580 100644
--- a/drivers/watchdog/omap_wdt.c
+++ b/drivers/watchdog/omap_wdt.c
@@ -38,11 +38,11 @@
 #include <linux/err.h>
 #include <linux/platform_device.h>
 #include <linux/moduleparam.h>
-#include <linux/clk.h>
 #include <linux/bitops.h>
 #include <linux/io.h>
 #include <linux/uaccess.h>
 #include <linux/slab.h>
+#include <linux/pm_runtime.h>
 #include <mach/hardware.h>
 #include <plat/prcm.h>
 
@@ -61,8 +61,6 @@ struct omap_wdt_dev {
 	void __iomem    *base;          /* physical */
 	struct device   *dev;
 	int             omap_wdt_users;
-	struct clk      *ick;
-	struct clk      *fck;
 	struct resource *mem;
 	struct miscdevice omap_wdt_miscdev;
 };
@@ -146,8 +144,7 @@ static int omap_wdt_open(struct inode *inode, struct file *file)
 	if (test_and_set_bit(1, (unsigned long *)&(wdev->omap_wdt_users)))
 		return -EBUSY;
 
-	clk_enable(wdev->ick);    /* Enable the interface clock */
-	clk_enable(wdev->fck);    /* Enable the functional clock */
+	pm_runtime_get_sync(wdev->dev);
 
 	/* initialize prescaler */
 	while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x01)
@@ -177,8 +174,7 @@ static int omap_wdt_release(struct inode *inode, struct file *file)
 
 	omap_wdt_disable(wdev);
 
-	clk_disable(wdev->ick);
-	clk_disable(wdev->fck);
+	pm_runtime_put_sync(wdev->dev);
 #else
 	printk(KERN_CRIT "omap_wdt: Unexpected close, not stopping!\n");
 #endif
@@ -292,19 +288,7 @@ static int __devinit omap_wdt_probe(struct platform_device *pdev)
 
 	wdev->omap_wdt_users = 0;
 	wdev->mem = mem;
-
-	wdev->ick = clk_get(&pdev->dev, "ick");
-	if (IS_ERR(wdev->ick)) {
-		ret = PTR_ERR(wdev->ick);
-		wdev->ick = NULL;
-		goto err_clk;
-	}
-	wdev->fck = clk_get(&pdev->dev, "fck");
-	if (IS_ERR(wdev->fck)) {
-		ret = PTR_ERR(wdev->fck);
-		wdev->fck = NULL;
-		goto err_clk;
-	}
+	wdev->dev = &pdev->dev;
 
 	wdev->base = ioremap(res->start, resource_size(res));
 	if (!wdev->base) {
@@ -314,8 +298,8 @@ static int __devinit omap_wdt_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, wdev);
 
-	clk_enable(wdev->ick);
-	clk_enable(wdev->fck);
+	pm_runtime_enable(wdev->dev);
+	pm_runtime_get_sync(wdev->dev);
 
 	omap_wdt_disable(wdev);
 	omap_wdt_adjust_timeout(timer_margin);
@@ -333,11 +317,7 @@ static int __devinit omap_wdt_probe(struct platform_device *pdev)
 		__raw_readl(wdev->base + OMAP_WATCHDOG_REV) & 0xFF,
 		timer_margin);
 
-	/* autogate OCP interface clock */
-	__raw_writel(0x01, wdev->base + OMAP_WATCHDOG_SYS_CONFIG);
-
-	clk_disable(wdev->ick);
-	clk_disable(wdev->fck);
+	pm_runtime_put_sync(wdev->dev);
 
 	omap_wdt_dev = pdev;
 
@@ -349,12 +329,6 @@ err_misc:
 
 err_ioremap:
 	wdev->base = NULL;
-
-err_clk:
-	if (wdev->ick)
-		clk_put(wdev->ick);
-	if (wdev->fck)
-		clk_put(wdev->fck);
 	kfree(wdev);
 
 err_kzalloc:
@@ -386,8 +360,6 @@ static int __devexit omap_wdt_remove(struct platform_device *pdev)
 	release_mem_region(res->start, resource_size(res));
 	platform_set_drvdata(pdev, NULL);
 
-	clk_put(wdev->ick);
-	clk_put(wdev->fck);
 	iounmap(wdev->base);
 
 	kfree(wdev);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v8 3/6] OMAP2430: hwmod data: Add watchdog timer
  2010-09-23 14:32 ` [PATCH v8 3/6] OMAP2430: " Varadarajan, Charulatha
@ 2010-09-23 15:25   ` Russell King - ARM Linux
  2010-09-23 17:07     ` Paul Walmsley
  0 siblings, 1 reply; 14+ messages in thread
From: Russell King - ARM Linux @ 2010-09-23 15:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Sep 23, 2010 at 08:02:40PM +0530, Varadarajan, Charulatha wrote:
> +static struct omap_hwmod omap2430_wd_timer2_hwmod = {
> +	.name		= "wd_timer2",
> +	.class		= &omap2430_wd_timer_hwmod_class,
> +	.main_clk	= "mpu_wdt_fck",

Why are we going backwards to naming clocks by source rather than
looking them up by device + connection ?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v8 3/6] OMAP2430: hwmod data: Add watchdog timer
  2010-09-23 15:25   ` Russell King - ARM Linux
@ 2010-09-23 17:07     ` Paul Walmsley
  0 siblings, 0 replies; 14+ messages in thread
From: Paul Walmsley @ 2010-09-23 17:07 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Russell,

On Thu, 23 Sep 2010, Russell King - ARM Linux wrote:

> On Thu, Sep 23, 2010 at 08:02:40PM +0530, Varadarajan, Charulatha wrote:
> > +static struct omap_hwmod omap2430_wd_timer2_hwmod = {
> > +	.name		= "wd_timer2",
> > +	.class		= &omap2430_wd_timer_hwmod_class,
> > +	.main_clk	= "mpu_wdt_fck",
> 
> Why are we going backwards to naming clocks by source rather than
> looking them up by device + connection ?

(Device, connection) clock addressing is still used by device drivers.  
It is a superior method for drivers, and one that's not going anywhere. 
Drivers still should do:

    c = clk_get(dev, "fck");

... if it needs to work with clocks directly.  [ Most drivers won't even 
need to do this now, unless they wish to change clock sources or rates, 
since pm_runtime_{get,put}() will automatically enable/disable clocks on 
OMAP. ]

The OMAP clock code still uses clkdev to map (device, connection name) to 
the appropriate struct clk.  The utility of that dual naming is not in 
question.  For driver code, that clock naming scheme is crucial to having 
drivers that can work across multiple SoCs without modification.

The hwmod data, however, describes the hardware at a fundamental level: 
one that is independent of the Linux driver model.  Like the OMAP struct 
clks, clockdomains, and powerdomains, this data is intended to be 
autogenerated from the TI hardware database.  This is data that, in an 
ideal world, would be in ROM somewhere on the OMAP: ideally it should 
never change across the life of the device.  For the OMAP core code that 
uses this data, it doesn't care whether there is a platform_device above 
it, an of_device, or an omap_device, or whether someone has just written a 
new driver that groups devices differently.  This hwmod data describes the 
hardware itself and is used for basic IP block control: to reset, 
initialize, enable, idle, and disable on-chip IP blocks.  Much of this 
happens very early in boot, before the Linux driver model code enumerates 
devices.

So the clock names used here are intended to be the TI hardware database 
clock names, which also appear in the OMAP struct clk.name.  The only 
place the hwmod clock names are used in the kernel is by the hwmod core 
code.  There is a core-internal function in the OMAP clock code used by 
the hwmod code to connect the autogenerated struct clks to the 
autogenerated hwmod data.  Any other part of the kernel that works with 
struct devices must use the (device, connection) naming scheme, via the 
clock code.


I appreciate the comments,

- Paul

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v8 0/6] OMAP: WDT: Implement WDT in hwmod way
  2010-09-23 14:32 [PATCH v8 0/6] OMAP: WDT: Implement WDT in hwmod way Varadarajan, Charulatha
                   ` (5 preceding siblings ...)
  2010-09-23 14:32 ` [PATCH v8 6/6] OMAP: WDT: Use PM runtime APIs instead of clk FW APIs Varadarajan, Charulatha
@ 2010-09-29  1:05 ` Kevin Hilman
  2010-09-29 13:14   ` Varadarajan, Charulatha
  6 siblings, 1 reply; 14+ messages in thread
From: Kevin Hilman @ 2010-09-29  1:05 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Charu,

"Varadarajan, Charulatha" <charu@ti.com> writes:

> Series of patches to port watchdog module to use hwmod APIs
> for OMAP2PLUS chips and use runtime APIs for all OMAP chips.
> For this hwmod database for OMAP2PLUS watchdog instances are
> populated and implements watchdog module to use PM runtime APIs.
>
> This patch series is generated on "origin/pm-core" which
> has Kevin's pm-next series, the runtime PM core patch series,
> and a collection of hwmod fixes that Paul/Benoit have lined up
> for 2.6.37.
>
> Tested on OMAP2430, OMAP4430 (ES1.0 & ES2.0), OMAP3430 SDP boards
> and zoom3 board. Also verified that this patch series does not
> break the OMAP1 build.

I found a little snag with this series.  Try testing with
omap2plus_defconfig and changing CONFIG_OMAP_WATCHDOG=n.

If CONFIG_OMAP_WATCHDOG is not enabled in the kernel config, the system
will reboot soon after bootup.  One of the things the bootloader
historically has done was disable the watchdog so a driver wasn't needed.
With a reset of the IP triggered by the hwmod init, we lose this setting
and the watchog is armed by default.

I think we need to handle this case when CONFIG_OMAP_WATCHDOG=n in the
device init code by disabling the watchdog.

Kevin


> This series is tested on OMAP4430 ES2 using the below series
> (dependency series for ES2.0 silicon)
> http://www.spinics.net/lists/linux-omap/msg36023.html
>
> Version History:
> ---------------
> Version v8:
> *Enable wd_timer3 in the hwmod list
>
> Version v7:
> *Use EN_*SHIFT macros for module_bit and ST_*SHIFT macros for
> idlest_idle_bit in OMAP2&3 hwmod database
> (based on suggestions given by Paul for I2C hwmod series)
> *Remove new definitions of EN_*SHIFT macros as they already exist
> Some of the v7 links:
> https://patchwork.kernel.org/patch/197022/
>
> Version v6:
> *Split omap_init_wdt() into separate omap_init_wdt functions
> under mach-omap1 and mach-omap2 and set them up with
> subsys_initcall
> *Include wd_timer3 database for OMAP4
> *In hwmod database follow naming convention "wd_timerX"
> Some of the v6 links:
> http://www.spinics.net/lists/linux-omap/msg36678.html
> https://patchwork.kernel.org/patch/188242/
> https://patchwork.kernel.org/patch/188222/
>
> Version v5:
> *Delete wdt_runtime_resume and wdt_runtime_suspend
> functions as the fix for the return values in the generic
> runtime PM calls has been queued for 2.6.37 (see below link)
> https://lists.linux-foundation.org/pipermail/linux-pm/2010-September/028466.html
> Some of the v5 links:
> https://patchwork.kernel.org/patch/181812/
> https://patchwork.kernel.org/patch/181782/
> https://patchwork.kernel.org/patch/181772/
> https://patchwork.kernel.org/patch/181792/
>
> Version v4:
> *Implement hwmod adapdation first and then PM runtime adaptation
> as two different patches in the series
> *Remove inclusion of omap_device.h in the driver file.
> Some of the v4 links:
> https://patchwork.kernel.org/patch/174672/
> https://patchwork.kernel.org/patch/174662/
>
> Version v3:
> *Fix Minor comments like renaming omap1 watchdog structures
> with an omap1_ prefix
> Some of the v3 links:
> https://patchwork.kernel.org/patch/119698/
> https://patchwork.kernel.org/patch/119696/ 
>
> Version v2:
> *Rebase to latest kernel
> Some of the v2 links:
> http://www.spinics.net/lists/linux-omap/msg34741.html
> http://www.spinics.net/lists/linux-omap/msg34673.html
>
> Version v1:
> *Initial series
> Some of the v1 links:
> http://www.spinics.net/lists/linux-omap/msg30628.html
> http://www.spinics.net/lists/linux-omap/msg30625.html
>
> Benoit Cousson (1):
>   OMAP4: hwmod data: Add watchdog timer
>
> Varadarajan, Charulatha (5):
>   OMAP3: hwmod data: Add watchdog timer
>   OMAP2420: hwmod data: Add watchdog timer
>   OMAP2430: hwmod data: Add watchdog timer
>   OMAP2PLUS: WDT: use omap_device_build for device registration
>   OMAP: WDT: Use PM runtime APIs instead of clk FW APIs
>
>  arch/arm/mach-omap1/devices.c              |   27 ++++++
>  arch/arm/mach-omap2/devices.c              |   39 ++++++++
>  arch/arm/mach-omap2/omap_hwmod_2420_data.c |   64 +++++++++++++
>  arch/arm/mach-omap2/omap_hwmod_2430_data.c |   64 +++++++++++++
>  arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   66 ++++++++++++++
>  arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  135 ++++++++++++++++++++++++++++
>  arch/arm/plat-omap/devices.c               |   41 ---------
>  drivers/watchdog/omap_wdt.c                |   42 ++-------
>  8 files changed, 402 insertions(+), 76 deletions(-)

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v8 0/6] OMAP: WDT: Implement WDT in hwmod way
  2010-09-29  1:05 ` [PATCH v8 0/6] OMAP: WDT: Implement WDT in hwmod way Kevin Hilman
@ 2010-09-29 13:14   ` Varadarajan, Charulatha
  2010-09-29 14:37     ` Kevin Hilman
  0 siblings, 1 reply; 14+ messages in thread
From: Varadarajan, Charulatha @ 2010-09-29 13:14 UTC (permalink / raw)
  To: linux-arm-kernel



> -----Original Message-----
> From: Kevin Hilman [mailto:khilman at deeprootsystems.com]
> Sent: Wednesday, September 29, 2010 6:36 AM
> To: Varadarajan, Charulatha
> Cc: tony at atomide.com; wim at iguana.be; linux-omap at vger.kernel.org; linux-
> watchdog at vger.kernel.org; linux-arm-kernel at lists.infradead.org;
> paul at pwsan.com; Cousson, Benoit; Nayak, Rajendra; Basak, Partha
> Subject: Re: [PATCH v8 0/6] OMAP: WDT: Implement WDT in hwmod way
> 
> Hi Charu,
> 
> "Varadarajan, Charulatha" <charu@ti.com> writes:
> 
> > Series of patches to port watchdog module to use hwmod APIs
> > for OMAP2PLUS chips and use runtime APIs for all OMAP chips.
> > For this hwmod database for OMAP2PLUS watchdog instances are
> > populated and implements watchdog module to use PM runtime APIs.
> >
> > This patch series is generated on "origin/pm-core" which
> > has Kevin's pm-next series, the runtime PM core patch series,
> > and a collection of hwmod fixes that Paul/Benoit have lined up
> > for 2.6.37.
> >
> > Tested on OMAP2430, OMAP4430 (ES1.0 & ES2.0), OMAP3430 SDP boards
> > and zoom3 board. Also verified that this patch series does not
> > break the OMAP1 build.
> 
> I found a little snag with this series.  Try testing with
> omap2plus_defconfig and changing CONFIG_OMAP_WATCHDOG=n.
> 
> If CONFIG_OMAP_WATCHDOG is not enabled in the kernel config, the system
> will reboot soon after bootup. 

Thanks for finding this issue.

After watchdog module reset, the WDTs are enabled. The default time
for a system reset after a watchdog module reset is ~10s as per the
default value of the WDT registers. Hence the above problem is observed.

If CONFIG_OMAP_WATCHDOG is defined, wdt's probe is called within this
10s time and watchdog_disable is called during probe. Hence we are not
finding this issue if CONFIG_OMAP_WATCHDOG is defined.

Ideally, because of the above, watchdog should be with
HWMOD_INIT_NO_RESET flag.

If agreed, I would send the below patch (extended to other OMAPs)
on top of my watchdog timer hwmod series with proper change log.

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-
omap2/omap_hwmod_3xxx_data.c
index 5bfe9c9..c567b24 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -260,6 +260,7 @@ static struct omap_hwmod omap3xxx_wd_timer2_hwmod = {
        .slaves         = omap3xxx_wd_timer2_slaves,
        .slaves_cnt     = ARRAY_SIZE(omap3xxx_wd_timer2_slaves),
        .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+       .flags          = HWMOD_INIT_NO_RESET,
 };

-V Charulatha

<<snip>>

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v8 0/6] OMAP: WDT: Implement WDT in hwmod way
  2010-09-29 13:14   ` Varadarajan, Charulatha
@ 2010-09-29 14:37     ` Kevin Hilman
  2010-09-29 14:46       ` Varadarajan, Charulatha
  0 siblings, 1 reply; 14+ messages in thread
From: Kevin Hilman @ 2010-09-29 14:37 UTC (permalink / raw)
  To: linux-arm-kernel

"Varadarajan, Charulatha" <charu@ti.com> writes:

>> -----Original Message-----
>> From: Kevin Hilman [mailto:khilman at deeprootsystems.com]
>> Sent: Wednesday, September 29, 2010 6:36 AM
>> To: Varadarajan, Charulatha
>> Cc: tony at atomide.com; wim at iguana.be; linux-omap at vger.kernel.org; linux-
>> watchdog at vger.kernel.org; linux-arm-kernel at lists.infradead.org;
>> paul at pwsan.com; Cousson, Benoit; Nayak, Rajendra; Basak, Partha
>> Subject: Re: [PATCH v8 0/6] OMAP: WDT: Implement WDT in hwmod way
>> 
>> Hi Charu,
>> 
>> "Varadarajan, Charulatha" <charu@ti.com> writes:
>> 
>> > Series of patches to port watchdog module to use hwmod APIs
>> > for OMAP2PLUS chips and use runtime APIs for all OMAP chips.
>> > For this hwmod database for OMAP2PLUS watchdog instances are
>> > populated and implements watchdog module to use PM runtime APIs.
>> >
>> > This patch series is generated on "origin/pm-core" which
>> > has Kevin's pm-next series, the runtime PM core patch series,
>> > and a collection of hwmod fixes that Paul/Benoit have lined up
>> > for 2.6.37.
>> >
>> > Tested on OMAP2430, OMAP4430 (ES1.0 & ES2.0), OMAP3430 SDP boards
>> > and zoom3 board. Also verified that this patch series does not
>> > break the OMAP1 build.
>> 
>> I found a little snag with this series.  Try testing with
>> omap2plus_defconfig and changing CONFIG_OMAP_WATCHDOG=n.
>> 
>> If CONFIG_OMAP_WATCHDOG is not enabled in the kernel config, the system
>> will reboot soon after bootup. 
>
> Thanks for finding this issue.
>
> After watchdog module reset, the WDTs are enabled. The default time
> for a system reset after a watchdog module reset is ~10s as per the
> default value of the WDT registers. Hence the above problem is observed.
>
> If CONFIG_OMAP_WATCHDOG is defined, wdt's probe is called within this
> 10s time and watchdog_disable is called during probe. Hence we are not
> finding this issue if CONFIG_OMAP_WATCHDOG is defined.
>
> Ideally, because of the above, watchdog should be with
> HWMOD_INIT_NO_RESET flag.
>
> If agreed, I would send the below patch (extended to other OMAPs)
> on top of my watchdog timer hwmod series with proper change log.

Using HWMOD_INIT_NO_RESET makes us still dependent on the bootloader
settings.

Instead, I would rather have a small piece of code in omap_init_wdt()
which disarms the watchdog so we don't have any assumptions about
bootloader behavior.

The question remains whether this disarm should be
#ifndef CONFIG_OMAP_WATCHDOG or if it should happen all the time.  In
case the watchdog is a module, it's probe may not happen within the
timeout period and they system may reboot also, so I lean towards
disarming the watchdog unconditionally.

Kevin

> diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-
> omap2/omap_hwmod_3xxx_data.c
> index 5bfe9c9..c567b24 100644
> --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
> +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
> @@ -260,6 +260,7 @@ static struct omap_hwmod omap3xxx_wd_timer2_hwmod = {
>         .slaves         = omap3xxx_wd_timer2_slaves,
>         .slaves_cnt     = ARRAY_SIZE(omap3xxx_wd_timer2_slaves),
>         .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
> +       .flags          = HWMOD_INIT_NO_RESET,
>  };
>
> -V Charulatha
>
> <<snip>>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v8 0/6] OMAP: WDT: Implement WDT in hwmod way
  2010-09-29 14:37     ` Kevin Hilman
@ 2010-09-29 14:46       ` Varadarajan, Charulatha
  2010-09-29 15:43         ` Kevin Hilman
  0 siblings, 1 reply; 14+ messages in thread
From: Varadarajan, Charulatha @ 2010-09-29 14:46 UTC (permalink / raw)
  To: linux-arm-kernel

Kevin,

> -----Original Message-----
> From: Kevin Hilman [mailto:khilman at deeprootsystems.com]

<<snip>>

> >>
> >> I found a little snag with this series.  Try testing with
> >> omap2plus_defconfig and changing CONFIG_OMAP_WATCHDOG=n.
> >>
> >> If CONFIG_OMAP_WATCHDOG is not enabled in the kernel config, the system
> >> will reboot soon after bootup.
> >
> > Thanks for finding this issue.
> >
> > After watchdog module reset, the WDTs are enabled. The default time
> > for a system reset after a watchdog module reset is ~10s as per the
> > default value of the WDT registers. Hence the above problem is observed.
> >
> > If CONFIG_OMAP_WATCHDOG is defined, wdt's probe is called within this
> > 10s time and watchdog_disable is called during probe. Hence we are not
> > finding this issue if CONFIG_OMAP_WATCHDOG is defined.
> >
> > Ideally, because of the above, watchdog should be with
> > HWMOD_INIT_NO_RESET flag.
> >
> > If agreed, I would send the below patch (extended to other OMAPs)
> > on top of my watchdog timer hwmod series with proper change log.
> 
> Using HWMOD_INIT_NO_RESET makes us still dependent on the bootloader
> settings.

Agreed.

> 
> Instead, I would rather have a small piece of code in omap_init_wdt()
> which disarms the watchdog so we don't have any assumptions about
> bootloader behavior.
> 
> The question remains whether this disarm should be
> #ifndef CONFIG_OMAP_WATCHDOG or if it should happen all the time.  In
> case the watchdog is a module, it's probe may not happen within the
> timeout period and they system may reboot also, so I lean towards
> disarming the watchdog unconditionally.

Agreed. But this shall be handled in mach-omap2/devices.c by directly
accessing the watchdog registers and disabling it, as the watchdog driver
would not be available by this time. If this okay, I would send a
separate patch on top my hwmod series to handle this.

-V Charulatha

<<snip>>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v8 0/6] OMAP: WDT: Implement WDT in hwmod way
  2010-09-29 14:46       ` Varadarajan, Charulatha
@ 2010-09-29 15:43         ` Kevin Hilman
  0 siblings, 0 replies; 14+ messages in thread
From: Kevin Hilman @ 2010-09-29 15:43 UTC (permalink / raw)
  To: linux-arm-kernel

"Varadarajan, Charulatha" <charu@ti.com> writes:

[...]

>> 
>> Instead, I would rather have a small piece of code in omap_init_wdt()
>> which disarms the watchdog so we don't have any assumptions about
>> bootloader behavior.
>> 
>> The question remains whether this disarm should be
>> #ifndef CONFIG_OMAP_WATCHDOG or if it should happen all the time.  In
>> case the watchdog is a module, it's probe may not happen within the
>> timeout period and they system may reboot also, so I lean towards
>> disarming the watchdog unconditionally.
>
> Agreed. But this shall be handled in mach-omap2/devices.c by directly
> accessing the watchdog registers and disabling it, as the watchdog driver
> would not be available by this time. 

Correct.

> If this okay, I would send a separate patch on top my hwmod series to
> handle this.

Yes please.

Thanks,

Kevin

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-09-29 15:43 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-23 14:32 [PATCH v8 0/6] OMAP: WDT: Implement WDT in hwmod way Varadarajan, Charulatha
2010-09-23 14:32 ` [PATCH v8 1/6] OMAP3: hwmod data: Add watchdog timer Varadarajan, Charulatha
2010-09-23 14:32 ` [PATCH v8 2/6] OMAP2420: " Varadarajan, Charulatha
2010-09-23 14:32 ` [PATCH v8 3/6] OMAP2430: " Varadarajan, Charulatha
2010-09-23 15:25   ` Russell King - ARM Linux
2010-09-23 17:07     ` Paul Walmsley
2010-09-23 14:32 ` [PATCH v8 4/6] OMAP4: " Varadarajan, Charulatha
2010-09-23 14:32 ` [PATCH v8 5/6] OMAP: WDT: Split OMAP1 and OMAP2PLUS device registration Varadarajan, Charulatha
2010-09-23 14:32 ` [PATCH v8 6/6] OMAP: WDT: Use PM runtime APIs instead of clk FW APIs Varadarajan, Charulatha
2010-09-29  1:05 ` [PATCH v8 0/6] OMAP: WDT: Implement WDT in hwmod way Kevin Hilman
2010-09-29 13:14   ` Varadarajan, Charulatha
2010-09-29 14:37     ` Kevin Hilman
2010-09-29 14:46       ` Varadarajan, Charulatha
2010-09-29 15:43         ` Kevin Hilman

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).