* [v4 1/6] OMAP3: hwmod data: Add watchdog timer
2010-09-13 15:13 [v4 0/6] OMAP: WDT: Implement WDT in hwmod way Varadarajan, Charulatha
@ 2010-09-13 15:13 ` Varadarajan, Charulatha
2010-09-13 15:13 ` [v4 2/6] OMAP2420: " Varadarajan, Charulatha
` (4 subsequent siblings)
5 siblings, 0 replies; 13+ messages in thread
From: Varadarajan, Charulatha @ 2010-09-13 15:13 UTC (permalink / raw)
To: tony, wim, linux-watchdog
Cc: khilman, paul, b-cousson, rnayak, p-basak2, linux-omap,
Varadarajan, Charulatha
Add watchdog timer hwmod data for OMAP3 chip
Signed-off-by: Charulatha V <charu@ti.com>
---
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 61 ++++++++++++++++++++++++++++
arch/arm/mach-omap2/prcm-common.h | 4 ++
2 files changed, 65 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..a9812a8 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -36,6 +36,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 +198,65 @@ static struct omap_hwmod omap3xxx_iva_hwmod = {
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
};
+/* WDTIMER2 <- L4_WKUP interface */
+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,
+};
+
+/* WDTIMER common */
+
+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,
+};
+
+/* WDTIMER2 */
+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_EN_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 +264,7 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
&omap3xxx_l4_wkup_hwmod,
&omap3xxx_mpu_hwmod,
&omap3xxx_iva_hwmod,
+ &omap3xxx_wd_timer2_hwmod,
NULL,
};
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h
index 995b7ed..e190c64 100644
--- a/arch/arm/mach-omap2/prcm-common.h
+++ b/arch/arm/mach-omap2/prcm-common.h
@@ -237,6 +237,8 @@
#define OMAP24XX_ST_USB_MASK (1 << 0)
/* CM_FCLKEN_WKUP, CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */
+#define OMAP24XX_EN_WDT2_SHIFT 3
+#define OMAP24XX_EN_WDT2_MASK (1 << 3)
#define OMAP24XX_EN_GPIOS_SHIFT 2
#define OMAP24XX_EN_GPIOS_MASK (1 << 2)
#define OMAP24XX_EN_GPT1_SHIFT 0
@@ -344,6 +346,8 @@
#define OMAP3430_ST_D2D_MASK (1 << 3)
/* CM_FCLKEN_WKUP, CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */
+#define OMAP3430_EN_WDT2_SHIFT 5
+#define OMAP3430_EN_WDT2_MASK (1 << 5)
#define OMAP3430_EN_GPIO1_MASK (1 << 3)
#define OMAP3430_EN_GPIO1_SHIFT 3
#define OMAP3430_EN_GPT12_MASK (1 << 1)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [v4 2/6] OMAP2420: hwmod data: Add watchdog timer
2010-09-13 15:13 [v4 0/6] OMAP: WDT: Implement WDT in hwmod way Varadarajan, Charulatha
2010-09-13 15:13 ` [v4 1/6] OMAP3: hwmod data: Add watchdog timer Varadarajan, Charulatha
@ 2010-09-13 15:13 ` Varadarajan, Charulatha
2010-09-13 15:13 ` [v4 3/6] OMAP2430: " Varadarajan, Charulatha
` (3 subsequent siblings)
5 siblings, 0 replies; 13+ messages in thread
From: Varadarajan, Charulatha @ 2010-09-13 15:13 UTC (permalink / raw)
To: tony, wim, linux-watchdog
Cc: khilman, paul, b-cousson, rnayak, p-basak2, linux-omap,
Varadarajan, Charulatha
Add watchdog timer hwmod data for OMAP2420 chip
Signed-off-by: Charulatha V <charu@ti.com>
---
arch/arm/mach-omap2/omap_hwmod_2420_data.c | 59 ++++++++++++++++++++++++++++
1 files changed, 59 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..73a516e 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -33,6 +33,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 +166,70 @@ static struct omap_hwmod omap2420_iva_hwmod = {
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
};
+/* WDTIMER2 <- L4_WKUP interface */
+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,
+};
+
+/* WDTIMER common */
+
+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,
+};
+
+/* WDTIMER2 */
+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_WDT2_SHIFT,
+ .module_offs = WKUP_MOD,
+ .idlest_reg_id = 1,
+ .idlest_idle_bit = OMAP24XX_EN_WDT2_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] 13+ messages in thread
* [v4 3/6] OMAP2430: hwmod data: Add watchdog timer
2010-09-13 15:13 [v4 0/6] OMAP: WDT: Implement WDT in hwmod way Varadarajan, Charulatha
2010-09-13 15:13 ` [v4 1/6] OMAP3: hwmod data: Add watchdog timer Varadarajan, Charulatha
2010-09-13 15:13 ` [v4 2/6] OMAP2420: " Varadarajan, Charulatha
@ 2010-09-13 15:13 ` Varadarajan, Charulatha
2010-09-13 15:13 ` [v4 4/6] OMAP4: " Varadarajan, Charulatha
` (2 subsequent siblings)
5 siblings, 0 replies; 13+ messages in thread
From: Varadarajan, Charulatha @ 2010-09-13 15:13 UTC (permalink / raw)
To: tony, wim, linux-watchdog
Cc: khilman, paul, b-cousson, rnayak, p-basak2, linux-omap,
Varadarajan, Charulatha
Add watchdog timer hwmod data for OMAP2430 chip
Signed-off-by: Charulatha V <charu@ti.com>
---
arch/arm/mach-omap2/omap_hwmod_2430_data.c | 59 ++++++++++++++++++++++++++++
1 files changed, 59 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..f74fca0 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -33,6 +33,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 +166,70 @@ static struct omap_hwmod omap2430_iva_hwmod = {
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
};
+/* WDTIMER2 <- L4_WKUP interface */
+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,
+};
+
+/* WDTIMER common */
+
+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,
+};
+
+/* WDTIMER2 */
+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_WDT2_SHIFT,
+ .module_offs = WKUP_MOD,
+ .idlest_reg_id = 1,
+ .idlest_idle_bit = OMAP24XX_EN_WDT2_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] 13+ messages in thread
* [v4 4/6] OMAP4: hwmod data: Add watchdog timer
2010-09-13 15:13 [v4 0/6] OMAP: WDT: Implement WDT in hwmod way Varadarajan, Charulatha
` (2 preceding siblings ...)
2010-09-13 15:13 ` [v4 3/6] OMAP2430: " Varadarajan, Charulatha
@ 2010-09-13 15:13 ` Varadarajan, Charulatha
2010-09-14 18:06 ` Kevin Hilman
2010-09-13 15:13 ` [v4 5/6] OMAP2PLUS: WDT: use omap_device_build for device registration Varadarajan, Charulatha
2010-09-13 15:13 ` [v4 6/6] OMAP: WDT: Use PM runtime APIs instead of clk FW APIs Varadarajan, Charulatha
5 siblings, 1 reply; 13+ messages in thread
From: Varadarajan, Charulatha @ 2010-09-13 15:13 UTC (permalink / raw)
To: tony, wim, linux-watchdog
Cc: khilman, paul, b-cousson, rnayak, p-basak2, linux-omap, Charulatha V
From: Benoit Cousson <b-cousson@ti.com>
Add watchdog timer hwmod data for OMAP4 chip
This patch is extracted from the below patch sent by Benoit
OMAP4: hwmod: Add partial hwmod support for OMAP4430 ES1.0
https://patchwork.kernel.org/patch/99052/
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Charulatha V <charu@ti.com>
---
arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 68 ++++++++++++++++++++++++++++
1 files changed, 68 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..06851f7 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -452,6 +452,72 @@ 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),
+};
+
static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
/* dmm class */
&omap44xx_dmm_hwmod,
@@ -472,6 +538,8 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
/* mpu class */
&omap44xx_mpu_hwmod,
+ /* wd_timer class */
+ &omap44xx_wd_timer2_hwmod,
NULL,
};
--
1.7.0.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [v4 4/6] OMAP4: hwmod data: Add watchdog timer
2010-09-13 15:13 ` [v4 4/6] OMAP4: " Varadarajan, Charulatha
@ 2010-09-14 18:06 ` Kevin Hilman
0 siblings, 0 replies; 13+ messages in thread
From: Kevin Hilman @ 2010-09-14 18:06 UTC (permalink / raw)
To: Varadarajan, Charulatha
Cc: tony, wim, linux-watchdog, paul, b-cousson, rnayak, p-basak2, linux-omap
"Varadarajan, Charulatha" <charu@ti.com> writes:
> From: Benoit Cousson <b-cousson@ti.com>
>
> Add watchdog timer hwmod data for OMAP4 chip
>
> This patch is extracted from the below patch sent by Benoit
> OMAP4: hwmod: Add partial hwmod support for OMAP4430 ES1.0
> https://patchwork.kernel.org/patch/99052/
Minor nit: the above paragraph is better to put after the '---' as it is
useful for the reviewers/maintainers, but doesn't need to go in the
final commit log.
Kevin
> Signed-off-by: Benoit Cousson <b-cousson@ti.com>
> Signed-off-by: Charulatha V <charu@ti.com>
> ---
> arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 68 ++++++++++++++++++++++++++++
> 1 files changed, 68 insertions(+), 0 deletions(-)
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [v4 4/6] OMAP4: hwmod data: Add watchdog timer
@ 2010-09-14 18:06 ` Kevin Hilman
0 siblings, 0 replies; 13+ messages in thread
From: Kevin Hilman @ 2010-09-14 18:06 UTC (permalink / raw)
To: Varadarajan, Charulatha
Cc: tony, wim, linux-watchdog, paul, b-cousson, rnayak, p-basak2, linux-omap
"Varadarajan, Charulatha" <charu@ti.com> writes:
> From: Benoit Cousson <b-cousson@ti.com>
>
> Add watchdog timer hwmod data for OMAP4 chip
>
> This patch is extracted from the below patch sent by Benoit
> OMAP4: hwmod: Add partial hwmod support for OMAP4430 ES1.0
> https://patchwork.kernel.org/patch/99052/
Minor nit: the above paragraph is better to put after the '---' as it is
useful for the reviewers/maintainers, but doesn't need to go in the
final commit log.
Kevin
> Signed-off-by: Benoit Cousson <b-cousson@ti.com>
> Signed-off-by: Charulatha V <charu@ti.com>
> ---
> arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 68 ++++++++++++++++++++++++++++
> 1 files changed, 68 insertions(+), 0 deletions(-)
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [v4 4/6] OMAP4: hwmod data: Add watchdog timer
2010-09-14 18:06 ` Kevin Hilman
(?)
@ 2010-09-15 5:33 ` Varadarajan, Charulatha
-1 siblings, 0 replies; 13+ messages in thread
From: Varadarajan, Charulatha @ 2010-09-15 5:33 UTC (permalink / raw)
To: Kevin Hilman
Cc: tony, wim, linux-watchdog, paul, Cousson, Benoit, Nayak,
Rajendra, Basak, Partha, linux-omap
Kevin,
> -----Original Message-----
> From: Kevin Hilman [mailto:khilman@deeprootsystems.com]
> Sent: Tuesday, September 14, 2010 11:36 PM
> To: Varadarajan, Charulatha
> Cc: tony@atomide.com; wim@iguana.be; linux-watchdog@vger.kernel.org;
> paul@pwsan.com; Cousson, Benoit; Nayak, Rajendra; Basak, Partha; linux-
> omap@vger.kernel.org
> Subject: Re: [v4 4/6] OMAP4: hwmod data: Add watchdog timer
>
> "Varadarajan, Charulatha" <charu@ti.com> writes:
>
> > From: Benoit Cousson <b-cousson@ti.com>
> >
> > Add watchdog timer hwmod data for OMAP4 chip
> >
> > This patch is extracted from the below patch sent by Benoit
> > OMAP4: hwmod: Add partial hwmod support for OMAP4430 ES1.0
> > https://patchwork.kernel.org/patch/99052/
>
> Minor nit: the above paragraph is better to put after the '---' as it is
> useful for the reviewers/maintainers, but doesn't need to go in the
> final commit log.
>
Point noted. This comment is addressed in the v5 version of patch series.
-Charulatha
> > Signed-off-by: Benoit Cousson <b-cousson@ti.com>
> > Signed-off-by: Charulatha V <charu@ti.com>
> > ---
> > arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 68
> ++++++++++++++++++++++++++++
> > 1 files changed, 68 insertions(+), 0 deletions(-)
> >
^ permalink raw reply [flat|nested] 13+ messages in thread
* [v4 5/6] OMAP2PLUS: WDT: use omap_device_build for device registration
2010-09-13 15:13 [v4 0/6] OMAP: WDT: Implement WDT in hwmod way Varadarajan, Charulatha
` (3 preceding siblings ...)
2010-09-13 15:13 ` [v4 4/6] OMAP4: " Varadarajan, Charulatha
@ 2010-09-13 15:13 ` Varadarajan, Charulatha
2010-09-13 15:13 ` [v4 6/6] OMAP: WDT: Use PM runtime APIs instead of clk FW APIs Varadarajan, Charulatha
5 siblings, 0 replies; 13+ messages in thread
From: Varadarajan, Charulatha @ 2010-09-13 15:13 UTC (permalink / raw)
To: tony, wim, linux-watchdog
Cc: khilman, paul, b-cousson, rnayak, p-basak2, linux-omap,
Varadarajan, Charulatha
Use omap_device_build API instead of platform_device_register for
watchdog timer device registration.
For OMAP2PLUS chips, the device specific data defined in centralized
hwmod database will be used.
Signed-off-by: Charulatha V <charu@ti.com>
---
arch/arm/plat-omap/devices.c | 64 ++++++++++++++++++++++++++++-------------
1 files changed, 44 insertions(+), 20 deletions(-)
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index d1920be..6885f4f 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -15,6 +15,7 @@
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/slab.h>
+#include <linux/err.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>
@@ -28,6 +29,8 @@
#include <plat/menelaus.h>
#include <plat/mcbsp.h>
#include <plat/omap44xx.h>
+#include <plat/omap_hwmod.h>
+#include <plat/omap_device.h>
/*-------------------------------------------------------------------------*/
@@ -236,37 +239,58 @@ static inline void omap_init_uwire(void) {}
#if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE)
-static struct resource wdt_resources[] = {
+struct omap_device_pm_latency omap2_wdt_latency[] = {
+ [0] = {
+ .deactivate_func = omap_device_idle_hwmods,
+ .activate_func = omap_device_enable_hwmods,
+ .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+ },
+};
+
+static void omap2_init_wdt(void)
+{
+ int id = -1;
+ struct omap_device *od;
+ struct omap_hwmod *oh;
+ char *oh_name = "wd_timer2";
+ char *name = "omap_wdt";
+
+ oh = omap_hwmod_lookup(oh_name);
+ if (!oh) {
+ pr_err("Could not look up %s\n", oh_name);
+ return;
+ }
+
+ od = omap_device_build(name, id, oh, NULL, 0,
+ omap2_wdt_latency,
+ ARRAY_SIZE(omap2_wdt_latency), 0);
+ WARN(IS_ERR(od), "Cant build omap_device for %s:%s.\n",
+ name, oh->name);
+ return;
+}
+
+static struct resource omap1_wdt_resources[] = {
{
+ .start = 0xfffeb000,
+ .end = 0xfffeb07F,
.flags = IORESOURCE_MEM,
},
};
-static struct platform_device omap_wdt_device = {
+static struct platform_device omap1_wdt_device = {
.name = "omap_wdt",
.id = -1,
- .num_resources = ARRAY_SIZE(wdt_resources),
- .resource = wdt_resources,
+ .num_resources = ARRAY_SIZE(omap1_wdt_resources),
+ .resource = omap1_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);
+ if (cpu_class_is_omap2())
+ omap2_init_wdt();
+ else if (cpu_is_omap16xx())
+ (void) platform_device_register(&omap1_wdt_device);
+ return;
}
#else
static inline void omap_init_wdt(void) {}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [v4 6/6] OMAP: WDT: Use PM runtime APIs instead of clk FW APIs
2010-09-13 15:13 [v4 0/6] OMAP: WDT: Implement WDT in hwmod way Varadarajan, Charulatha
` (4 preceding siblings ...)
2010-09-13 15:13 ` [v4 5/6] OMAP2PLUS: WDT: use omap_device_build for device registration Varadarajan, Charulatha
@ 2010-09-13 15:13 ` Varadarajan, Charulatha
2010-09-14 18:04 ` Kevin Hilman
5 siblings, 1 reply; 13+ messages in thread
From: Varadarajan, Charulatha @ 2010-09-13 15:13 UTC (permalink / raw)
To: tony, wim, linux-watchdog
Cc: khilman, paul, b-cousson, rnayak, p-basak2, linux-omap,
Varadarajan, Charulatha
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>
---
drivers/watchdog/omap_wdt.c | 57 ++++++++++++++++--------------------------
1 files changed, 22 insertions(+), 35 deletions(-)
diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
index 76b58ab..34bf435 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
@@ -260,6 +256,21 @@ static const struct file_operations omap_wdt_fops = {
.release = omap_wdt_release,
};
+static int wdt_runtime_suspend(struct device *dev)
+{
+ return 0;
+}
+
+static int wdt_runtime_resume(struct device *dev)
+{
+ return 0;
+}
+
+static const struct dev_pm_ops gpio_pm_ops = {
+ .runtime_suspend = wdt_runtime_suspend,
+ .runtime_resume = wdt_runtime_resume,
+};
+
static int __devinit omap_wdt_probe(struct platform_device *pdev)
{
struct resource *res, *mem;
@@ -292,19 +303,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 +313,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 +332,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 +344,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 +375,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] 13+ messages in thread
* Re: [v4 6/6] OMAP: WDT: Use PM runtime APIs instead of clk FW APIs
2010-09-13 15:13 ` [v4 6/6] OMAP: WDT: Use PM runtime APIs instead of clk FW APIs Varadarajan, Charulatha
@ 2010-09-14 18:04 ` Kevin Hilman
0 siblings, 0 replies; 13+ messages in thread
From: Kevin Hilman @ 2010-09-14 18:04 UTC (permalink / raw)
To: Varadarajan, Charulatha
Cc: tony, wim, linux-watchdog, paul, b-cousson, rnayak, p-basak2, linux-omap
"Varadarajan, Charulatha" <charu@ti.com> writes:
> 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>
Looks mostly good, one minor comment
[...]
> +static int wdt_runtime_suspend(struct device *dev)
> +{
> + return 0;
> +}
> +
> +static int wdt_runtime_resume(struct device *dev)
> +{
> + return 0;
> +}
> +
> +static const struct dev_pm_ops gpio_pm_ops = {
> + .runtime_suspend = wdt_runtime_suspend,
> + .runtime_resume = wdt_runtime_resume,
> +};
> +
This isn't needed anymore for 2.6.37, a fix for the return values in the
generic runtime PM calls has been queued for 2.6.37[1]
Kevin
[1] https://lists.linux-foundation.org/pipermail/linux-pm/2010-September/028466.html
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [v4 6/6] OMAP: WDT: Use PM runtime APIs instead of clk FW APIs
@ 2010-09-14 18:04 ` Kevin Hilman
0 siblings, 0 replies; 13+ messages in thread
From: Kevin Hilman @ 2010-09-14 18:04 UTC (permalink / raw)
To: Varadarajan, Charulatha
Cc: tony, wim, linux-watchdog, paul, b-cousson, rnayak, p-basak2, linux-omap
"Varadarajan, Charulatha" <charu@ti.com> writes:
> 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>
Looks mostly good, one minor comment
[...]
> +static int wdt_runtime_suspend(struct device *dev)
> +{
> + return 0;
> +}
> +
> +static int wdt_runtime_resume(struct device *dev)
> +{
> + return 0;
> +}
> +
> +static const struct dev_pm_ops gpio_pm_ops = {
> + .runtime_suspend = wdt_runtime_suspend,
> + .runtime_resume = wdt_runtime_resume,
> +};
> +
This isn't needed anymore for 2.6.37, a fix for the return values in the
generic runtime PM calls has been queued for 2.6.37[1]
Kevin
[1] https://lists.linux-foundation.org/pipermail/linux-pm/2010-September/028466.html
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [v4 6/6] OMAP: WDT: Use PM runtime APIs instead of clk FW APIs
2010-09-14 18:04 ` Kevin Hilman
(?)
@ 2010-09-15 5:31 ` Varadarajan, Charulatha
-1 siblings, 0 replies; 13+ messages in thread
From: Varadarajan, Charulatha @ 2010-09-15 5:31 UTC (permalink / raw)
To: Kevin Hilman
Cc: tony, wim, linux-watchdog, paul, Cousson, Benoit, Nayak,
Rajendra, Basak, Partha, linux-omap
> -----Original Message-----
> From: Kevin Hilman [mailto:khilman@deeprootsystems.com]
> Sent: Tuesday, September 14, 2010 11:35 PM
> To: Varadarajan, Charulatha
> Cc: tony@atomide.com; wim@iguana.be; linux-watchdog@vger.kernel.org;
> paul@pwsan.com; Cousson, Benoit; Nayak, Rajendra; Basak, Partha; linux-
> omap@vger.kernel.org
> Subject: Re: [v4 6/6] OMAP: WDT: Use PM runtime APIs instead of clk FW
> APIs
>
> "Varadarajan, Charulatha" <charu@ti.com> writes:
>
> > 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>
>
> Looks mostly good, one minor comment
>
> [...]
>
> > +static int wdt_runtime_suspend(struct device *dev)
> > +{
> > + return 0;
> > +}
> > +
> > +static int wdt_runtime_resume(struct device *dev)
> > +{
> > + return 0;
> > +}
> > +
> > +static const struct dev_pm_ops gpio_pm_ops = {
> > + .runtime_suspend = wdt_runtime_suspend,
> > + .runtime_resume = wdt_runtime_resume,
> > +};
> > +
>
> This isn't needed anymore for 2.6.37, a fix for the return values in the
> generic runtime PM calls has been queued for 2.6.37[1]
Thanks. I've removed runtime_suspend/resume hooks from watchdog driver and
sent the next version of the series.
>
> Kevin
>
> [1] https://lists.linux-foundation.org/pipermail/linux-pm/2010-
> September/028466.html
^ permalink raw reply [flat|nested] 13+ messages in thread