watchdog:OMAP3:Add support for IVA2, SECURE WDTs
Subsystems (5)
v3 cover watchdog:OMAP3:Add support for IVA2, SECURE WDTs
This patch series enables support for IVA2 and SECURE WDTs, available on omap34xx.
The WDTs will be accessible (when present on device) through:
MPU: /dev/watchdog
SECURE: /dev/watchdog_secure
IVA: /dev/watchdog_iva2
Tested on Zoom1 OMAP3 platform
---
This patch set has a dependency on:
compilation: [PATCH 1/2] OMAP2/3: SoC IDs: add omap_type() for determining GP/EMU/HS
runtime: [PATCH 1/1] watchdog: OMAP fixes: enable clock in probe, trigger timer reload
arch/arm/mach-omap2/clock34xx.c | 12 ++--- arch/arm/plat-omap/devices.c | 81 ++++++++++++++++++++++++++++++++-------- drivers/watchdog/omap_wdt.c | 51 +++++++++++++++++++++---- 3 files changed, 114 insertions(+), 30 deletions(-)
PATCH v3 1/2 watchdog:OMAP3:Register IVA and SECURE WDT, make clks accessible
Enabling registration of IVA and SECURE WDT devices. Making ick and fck for IVA and SECURE WDTs accessible.
Tested on Zoom1 OMAP3 platform
---
This patch has a dependency on:
compilation: PATCH 1/2] OMAP2/3: SoC IDs: add omap_type() for determining GP/EMU/HS
arch/arm/mach-omap2/clock34xx.c | 12 +++--- arch/arm/plat-omap/devices.c | 81 +++++++++++++++++++++++++++++++-------- 2 files changed, 71 insertions(+), 22 deletions(-)
arch/arm/mach-omap2/clock34xx.c +6 -6
@@ -215,11 +215,11 @@ static struct omap_clk omap34xx_clks[] = {CLK (NULL ,"gpt1_fck" , &gpt1_fck,CK_343X ),CLK (NULL ,"wkup_32k_fck" , &wkup_32k_fck,CK_343X ),CLK (NULL ,"gpio1_dbck" , &gpio1_dbck,CK_343X ), -CLK ("omap_wdt" ,"fck" , &wdt2_fck,CK_343X ), +CLK ("omap_wdt.2" ,"fck" , &wdt2_fck,CK_343X ),CLK (NULL ,"wkup_l4_ick" , &wkup_l4_ick,CK_343X ),CLK (NULL ,"usim_ick" , &usim_ick,CK_3430ES2 ), -CLK ("omap_wdt" ,"ick" , &wdt2_ick,CK_343X ), -CLK (NULL ,"wdt1_ick" , &wdt1_ick,CK_343X ), +CLK ("omap_wdt.2" ,"ick" , &wdt2_ick,CK_343X ), +CLK ("omap_wdt.1" ,"ick" , &wdt1_ick,CK_343X ),CLK (NULL ,"gpio1_ick" , &gpio1_ick,CK_343X ),CLK (NULL ,"omap_32ksync_ick" , &omap_32ksync_ick,CK_343X ), CLK(NULL, "gpt12_ick", &gpt12_ick, CK_343X),
@@ -241,14 +241,14 @@ static struct omap_clk omap34xx_clks[] = {CLK (NULL ,"gpio4_dbck" , &gpio4_dbck,CK_343X ),CLK (NULL ,"gpio3_dbck" , &gpio3_dbck,CK_343X ),CLK (NULL ,"gpio2_dbck" , &gpio2_dbck,CK_343X ), -CLK (NULL ,"wdt3_fck" , &wdt3_fck,CK_343X ), +CLK ("omap_wdt.3" ,"fck" , &wdt3_fck,CK_343X ),CLK (NULL ,"per_l4_ick" , &per_l4_ick,CK_343X ),CLK (NULL ,"gpio6_ick" , &gpio6_ick,CK_343X ),CLK (NULL ,"gpio5_ick" , &gpio5_ick,CK_343X ),CLK (NULL ,"gpio4_ick" , &gpio4_ick,CK_343X ),CLK (NULL ,"gpio3_ick" , &gpio3_ick,CK_343X ),CLK (NULL ,"gpio2_ick" , &gpio2_ick,CK_343X ), -CLK (NULL ,"wdt3_ick" , &wdt3_ick,CK_343X ), +CLK ("omap_wdt.3" ,"ick" , &wdt3_ick,CK_343X ),CLK (NULL ,"uart3_ick" , &uart3_ick,CK_343X ),CLK (NULL ,"gpt9_ick" , &gpt9_ick,CK_343X ), CLK(NULL, "gpt8_ick", &gpt8_ick, CK_343X),
@@ -275,7 +275,7 @@ static struct omap_clk omap34xx_clks[] = {CLK (NULL ,"sr_l4_ick" , &sr_l4_ick,CK_343X ),CLK (NULL ,"secure_32k_fck" , &secure_32k_fck,CK_343X ),CLK (NULL ,"gpt12_fck" , &gpt12_fck,CK_343X ), - CLK(NULL, "wdt1_fck", &wdt1_fck, CK_343X), + CLK("omap_wdt.1", "fck", &wdt1_fck, CK_343X), };/* CM_AUTOIDLE_PLL*.AUTO_* bit values */
arch/arm/plat-omap/devices.c +65 -16
107 lines not on this page · raw message
Signature · 1 line
1.5.4.3
PATCH v3 2/2 watchdog:OMAP3:Enable support for IVA2 and SECURE
This patch enables the IVA2 and SECURE WDTs in the omap_wdt driver for omap34xx family. SECURE will be available as /dev/watchdog_secure on HS/EMU devices and IVA2 will be available as /dev/watchdog_iva2. MPU will still be available as /dev/watchdog
Tested on Zoom1 OMAP3 platform
---
This patch has a dependency on:
runtime: [PATCH 1/1] watchdog: OMAP fixes: enable clock in probe, trigger timer reload
drivers/watchdog/omap_wdt.c | 51 ++++++++++++++++++++++++++++++++++++------ 1 files changed, 43 insertions(+), 8 deletions(-)
drivers/watchdog/omap_wdt.c +43 -8
@@ -47,7 +47,15 @@#include "omap_wdt.h" -static struct platform_device *omap_wdt_dev; +#define NUM_WDTS 3 + +enum { +SECURE_WDT =1 , +MPU_WDT , +IVA2_WDT , +}; + +static struct platform_device *omap_wdt_dev[NUM_WDTS ];static unsigned timer_margin;module_param (timer_margin, uint,0 );
@@ -139,8 +147,23 @@ static void omap_wdt_set_timeout(struct omap_wdt_dev *wdev)*/ static int omap_wdt_open (struct inode *inode,struct file *file) { -struct omap_wdt_dev *wdev =platform_get_drvdata (omap_wdt_dev); -void __iomem *base = wdev->base; +struct omap_wdt_dev *wdev; +void __iomem *base; + +/* by default MPU wdt is present across omap family */ + wdev =platform_get_drvdata (omap_wdt_dev[1 ]); + +/* Find match between device node and wdt device */ +int i; +for (i =0 ; i <NUM_WDTS ; i++) { +if (omap_wdt_dev[i]) { + wdev =platform_get_drvdata (omap_wdt_dev[i]); +if (iminor (inode) == wdev->omap_wdt_miscdev.minor) +break ; + } + } + + base = wdev->base;if (test_and_set_bit (1 , (unsigned long *)&(wdev->omap_wdt_users)))return -EBUSY ;
@@ -271,7 +294,7 @@ static int __devinit omap_wdt_probe(struct platform_device *pdev) goto err_get_resource; } -if (omap_wdt_dev) { +if (omap_wdt_dev[pdev->id-1 ]) { ret = -EBUSY ; goto err_busy; }
@@ -317,10 +340,21 @@ static int __devinit omap_wdt_probe(struct platform_device *pdev)omap_wdt_adjust_timeout (timer_margin); wdev->omap_wdt_miscdev.parent = &pdev->dev; - wdev->omap_wdt_miscdev.minor =WATCHDOG_MINOR ; - wdev->omap_wdt_miscdev.name ="watchdog" ; + wdev->omap_wdt_miscdev.minor =MISC_DYNAMIC_MINOR ; wdev->omap_wdt_miscdev.fops = &omap_wdt_fops; +switch (pdev->id) { +case SECURE_WDT : + wdev->omap_wdt_miscdev.name ="watchdog_secure" ; +break ; +case IVA2_WDT : + wdev->omap_wdt_miscdev.name ="watchdog_iva2" ; +break ; +case MPU_WDT : +default : + wdev->omap_wdt_miscdev.name ="watchdog" ; + } + ret =misc_register (&(wdev->omap_wdt_miscdev));if (ret) goto err_misc;
@@ -332,7 +366,8 @@ static int __devinit omap_wdt_probe(struct platform_device *pdev)/* autogate OCP interface clock */ __raw_writel (0x01 , wdev->base +OMAP_WATCHDOG_SYS_CONFIG ); - omap_wdt_dev = pdev; +/* keep track of the wdt platform devices in local device array */ + omap_wdt_dev[pdev->id -1 ] = pdev;return 0 ;
@@ -384,7 +419,7 @@ static int __devexit omap_wdt_remove(struct platform_device *pdev)iounmap (wdev->base);kfree (wdev); - omap_wdt_dev =NULL ; + omap_wdt_dev[pdev->id-1 ] =NULL ;return 0 ; }
Signature · 1 line
1.5.4.3
Tony Lindgren
maintainerRe: [PATCH v3 1/2] watchdog:OMAP3:Register IVA and SECURE WDT, make clks accessible
In reply to Ulrik Bech HaldHi,
Quoted 50 lines · Ulrik Bech Hald
Enabling registration of IVA and SECURE WDT devices. Making ick and fck for IVA and SECURE WDTs accessible.
Tested on Zoom1 OMAP3 platform
Signed-off-by Ulrik Bech Hald <[email protected]>---
This patch has a dependency on:
compilation: PATCH 1/2] OMAP2/3: SoC IDs: addomap_type()for determining GP/EMU/HSarch/arm/mach-omap2/clock34xx.c | 12 +++--- arch/arm/plat-omap/devices.c | 81 +++++++++++++++++++++++++++++++-------- 2 files changed, 71 insertions(+), 22 deletions(-)arch/arm/mach-omap2/clock34xx.c +5
-5@@ -215,11 +215,11 @@ static struct omap_clk omap34xx_clks[] = {CLK (NULL ,"gpt1_fck" , &gpt1_fck,CK_343X ),CLK (NULL ,"wkup_32k_fck" , &wkup_32k_fck,CK_343X ),CLK (NULL ,"gpio1_dbck" , &gpio1_dbck,CK_343X ), -CLK ("omap_wdt" ,"fck" , &wdt2_fck,CK_343X ), +CLK ("omap_wdt.2" ,"fck" , &wdt2_fck,CK_343X ),CLK (NULL ,"wkup_l4_ick" , &wkup_l4_ick,CK_343X ),CLK (NULL ,"usim_ick" , &usim_ick,CK_3430ES2 ), -CLK ("omap_wdt" ,"ick" , &wdt2_ick,CK_343X ), -CLK (NULL ,"wdt1_ick" , &wdt1_ick,CK_343X ), +CLK ("omap_wdt.2" ,"ick" , &wdt2_ick,CK_343X ), +CLK ("omap_wdt.1" ,"ick" , &wdt1_ick,CK_343X ),CLK (NULL ,"gpio1_ick" , &gpio1_ick,CK_343X ),CLK (NULL ,"omap_32ksync_ick" , &omap_32ksync_ick,CK_343X ), CLK(NULL, "gpt12_ick", &gpt12_ick, CK_343X),@@ -241,14 +241,14 @@ static struct omap_clk omap34xx_clks[] = {CLK (NULL ,"gpio4_dbck" , &gpio4_dbck,CK_343X ),CLK (NULL ,"gpio3_dbck" , &gpio3_dbck,CK_343X ),CLK (NULL ,"gpio2_dbck" , &gpio2_dbck,CK_343X ), -CLK (NULL ,"wdt3_fck" , &wdt3_fck,CK_343X ), +CLK ("omap_wdt.3" ,"fck" , &wdt3_fck,CK_343X ),CLK (NULL ,"per_l4_ick" , &per_l4_ick,CK_343X ),CLK (NULL ,"gpio6_ick" , &gpio6_ick,CK_343X ),CLK (NULL ,"gpio5_ick" , &gpio5_ick,CK_343X ),CLK (NULL ,"gpio4_ick" , &gpio4_ick,CK_343X ),CLK (NULL ,"gpio3_ick" , &gpio3_ick,CK_343X ),CLK (NULL ,"gpio2_ick" , &gpio2_ick,CK_343X ), -CLK (NULL ,"wdt3_ick" , &wdt3_ick,CK_343X ), +CLK ("omap_wdt.3" ,"ick" , &wdt3_ick,CK_343X ),CLK (NULL ,"uart3_ick" , &uart3_ick,CK_343X ),CLK (NULL ,"gpt9_ick" , &gpt9_ick,CK_343X ), CLK(NULL, "gpt8_ick", &gpt8_ick, CK_343X),
arch/arm/mach-omap2/clock34xx.c static struct omap_clk omap34xx_clks[] = { · line 281
Quoted 8 lines
arch/arm/mach-omap2/clock34xx.c +1
-1@@ -275,7 +275,7 @@ static struct omap_clk omap34xx_clks[] = {CLK (NULL ,"sr_l4_ick" , &sr_l4_ick,CK_343X ),CLK (NULL ,"secure_32k_fck" , &secure_32k_fck,CK_343X ),CLK (NULL ,"gpt12_fck" , &gpt12_fck,CK_343X ), - CLK(NULL, "wdt1_fck", &wdt1_fck, CK_343X), + CLK("omap_wdt.1", "fck", &wdt1_fck, CK_343X), };/* CM_AUTOIDLE_PLL*.AUTO_* bit values */
To me it looks like you need to make the omap_wdt clock alias rename change also for mach-omap1/clock.c.
Regards,
Tony
Quoted 121 lines
arch/arm/plat-omap/devices.c +65
-16@@ -288,42 +288,91 @@ static inline void omap_init_uwire(void) {}#if defined(CONFIG_OMAP_WATCHDOG ) || defined(CONFIG_OMAP_WATCHDOG_MODULE ) -static struct resource wdt_resources[] = { +#define OMAP34XX_WDT1_BASE 0x4830c000 +#define OMAP34XX_WDT2_BASE 0x48314000 +#define OMAP34XX_WDT3_BASE 0x49030000 +#define OMAP2430_WDT_BASE 0x49016000 +#define OMAP2420_WDT_BASE 0x48022000 +#define OMAP16XX_WDT_BASE 0xfffeb000 + +static struct resource wdt1_resources[] = { { - .flags =IORESOURCE_MEM , + .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 struct resource wdt2_resources[] = { + { + .flags =IORESOURCE_MEM , + }, +}; + +static struct resource wdt3_resources[] = { + { + .flags =IORESOURCE_MEM , + }, +}; + +/* SECURE WDT */ +static struct platform_device omap_wdt1_device = { + .name ="omap_wdt" , + .id =1 , + .num_resources =ARRAY_SIZE (wdt1_resources), + .resource = wdt1_resources, +}; + +/* MPU WDT */ +static struct platform_device omap_wdt2_device = { + .name ="omap_wdt" , + .id =2 , + .num_resources =ARRAY_SIZE (wdt2_resources), + .resource = wdt2_resources, +}; + +/* IVA WDT */ +static struct platform_device omap_wdt3_device = { + .name ="omap_wdt" , + .id =3 , + .num_resources =ARRAY_SIZE (wdt3_resources), + .resource = wdt3_resources, };static void omap_init_wdt (void ) {if (cpu_is_omap16xx ()) - wdt_resources[0 ].start =0xfffeb000 ; + wdt2_resources[0 ].start =OMAP16XX_WDT_BASE ;else if (cpu_is_omap2420 ()) - wdt_resources[0 ].start =0x48022000 ;/* WDT2 */ + wdt2_resources[0 ].start =OMAP2420_WDT_BASE ;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 ; + wdt2_resources[0 ].start =OMAP2430_WDT_BASE ; +else if (cpu_is_omap343x ()) { + wdt1_resources[0 ].start =OMAP34XX_WDT1_BASE ; + wdt1_resources[0 ].end = wdt1_resources[0 ].start +0x4f ; + wdt2_resources[0 ].start =OMAP34XX_WDT2_BASE ; + wdt3_resources[0 ].start =OMAP34XX_WDT3_BASE ; + wdt3_resources[0 ].end = wdt3_resources[0 ].start +0x4f ; + }else return ; - wdt_resources[0 ].end = wdt_resources[0 ].start +0x4f ; + wdt2_resources[0 ].end = wdt2_resources[0 ].start +0x4f ; - (void )platform_device_register (&omap_wdt_device); +/* MPU WDT present across omap family */ + (void )platform_device_register (&omap_wdt2_device); + +if (cpu_is_omap34xx ()) { + (void )platform_device_register (&omap_wdt3_device); +if (omap_type () ==OMAP2_DEVICE_TYPE_SEC + ||omap_type () ==OMAP2_DEVICE_TYPE_EMU ) + (void )platform_device_register (&omap_wdt1_device); + } } +#else static inline void omap_init_wdt (void ) {}#endif +/*-------------------------------------------------------------------------*/ #if defined(CONFIG_HW_RANDOM_OMAP ) || defined(CONFIG_HW_RANDOM_OMAP_MODULE )Signature · 6 lines
1.5.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH v3 1/2] watchdog:OMAP3:Register IVA and SECURE WDT, make clks accessible
Quoted 71 lines
-----Original Message-----
From: Tony Lindgren [mailto:[email protected]]
Sent: Wednesday, June 17, 2009 8:48 AM
To: Hald, Ulrik Bech
Cc: [email protected]
Subject: Re: [PATCH v3 1/2] watchdog:OMAP3:Register IVA and SECURE WDT, make clks accessibleHi,
Quoted 8 lines · Ulrik Bech Hald
Enabling registration of IVA and SECURE WDT devices. Making ick and fck for IVA and SECURE WDTs accessible.
Tested on Zoom1 OMAP3 platform
Signed-off-by Ulrik Bech Hald <[email protected]>---
This patch has a dependency on:
compilation: PATCH 1/2] OMAP2/3: SoC IDs: addomap_type()fordetermining GP/EMU/HS
Quoted 3 lines
arch/arm/mach-omap2/clock34xx.c | 12 +++--- arch/arm/plat-omap/devices.c | 81 +++++++++++++++++++++++++++++++--------
arch/arm/mach-
Quoted 3 lines
2 files changed, 71 insertions(+), 22 deletions(-)arch/arm/mach- renamed from arch/arm/mach-omap2/clock34xx.c +0
-0
omap2/clock34xx.cQuoted 43 lines
index 9e43fe5..933ae9e 100644
arch/arm/mach-omap2/clock34xx.c +6
-6@@ -215,11 +215,11 @@ static struct omap_clk omap34xx_clks[] = {CLK (NULL ,"gpt1_fck" , &gpt1_fck,CK_343X ),CLK (NULL ,"wkup_32k_fck" , &wkup_32k_fck,CK_343X ),CLK (NULL ,"gpio1_dbck" , &gpio1_dbck,CK_343X ), -CLK ("omap_wdt" ,"fck" , &wdt2_fck,CK_343X ), +CLK ("omap_wdt.2" ,"fck" , &wdt2_fck,CK_343X ),CLK (NULL ,"wkup_l4_ick" , &wkup_l4_ick,CK_343X ),CLK (NULL ,"usim_ick" , &usim_ick,CK_3430ES2 ), -CLK ("omap_wdt" ,"ick" , &wdt2_ick,CK_343X ), -CLK (NULL ,"wdt1_ick" , &wdt1_ick,CK_343X ), +CLK ("omap_wdt.2" ,"ick" , &wdt2_ick,CK_343X ), +CLK ("omap_wdt.1" ,"ick" , &wdt1_ick,CK_343X ),CLK (NULL ,"gpio1_ick" , &gpio1_ick,CK_343X ),CLK (NULL ,"omap_32ksync_ick" , &omap_32ksync_ick,CK_343X ), CLK(NULL, "gpt12_ick", &gpt12_ick, CK_343X),@@ -241,14 +241,14 @@ static struct omap_clk omap34xx_clks[] = {CLK (NULL ,"gpio4_dbck" , &gpio4_dbck,CK_343X ),CLK (NULL ,"gpio3_dbck" , &gpio3_dbck,CK_343X ),CLK (NULL ,"gpio2_dbck" , &gpio2_dbck,CK_343X ), -CLK (NULL ,"wdt3_fck" , &wdt3_fck,CK_343X ), +CLK ("omap_wdt.3" ,"fck" , &wdt3_fck,CK_343X ),CLK (NULL ,"per_l4_ick" , &per_l4_ick,CK_343X ),CLK (NULL ,"gpio6_ick" , &gpio6_ick,CK_343X ),CLK (NULL ,"gpio5_ick" , &gpio5_ick,CK_343X ),CLK (NULL ,"gpio4_ick" , &gpio4_ick,CK_343X ),CLK (NULL ,"gpio3_ick" , &gpio3_ick,CK_343X ),CLK (NULL ,"gpio2_ick" , &gpio2_ick,CK_343X ), -CLK (NULL ,"wdt3_ick" , &wdt3_ick,CK_343X ), +CLK ("omap_wdt.3" ,"ick" , &wdt3_ick,CK_343X ),CLK (NULL ,"uart3_ick" , &uart3_ick,CK_343X ),CLK (NULL ,"gpt9_ick" , &gpt9_ick,CK_343X ), CLK(NULL, "gpt8_ick", &gpt8_ick, CK_343X),@@ -275,7 +275,7 @@ static struct omap_clk omap34xx_clks[] = {CLK (NULL ,"sr_l4_ick" , &sr_l4_ick,CK_343X ),CLK (NULL ,"secure_32k_fck" , &secure_32k_fck,CK_343X ),CLK (NULL ,"gpt12_fck" , &gpt12_fck,CK_343X ), - CLK(NULL, "wdt1_fck", &wdt1_fck, CK_343X), + CLK("omap_wdt.1", "fck", &wdt1_fck, CK_343X), };
Quoted 9 lines
arch/arm/mach-omap2/clock34xx.c static struct omap_clk omap34xx_clks[] = { · line 281
Quoted 1 line
arch/arm/mach-omap2/clock34xx.c +0
-0/* CM_AUTOIDLE_PLL*.AUTO_* bit values */ To me it looks like you need to make the
omap_wdtclock alias rename change also formach-omap1/clock.c.Regards,
Tony
You're right, and it also looks like mach-omap2/clock24xx.c needs the alias rename to omap_wdt.1 as well.
Thanks for looking at it Tony.
/Ulrik
Quoted 125 lines
arch/arm/plat-omap/devices.c static inline void omap_init_uwire(void) {} · line 289
Quoted 10 lines
arch/arm/plat-omap/devices.c +0
-0@@ -288,42 +288,91 @@ static inline void omap_init_uwire(void) {} #if defined(CONFIG_OMAP_WATCHDOG) ||
defined(CONFIG_OMAP_WATCHDOG_MODULE)Quoted 93 lines
arch/arm/plat-omap/devices.c +61
-16-static struct resource wdt_resources[] = { +#define OMAP34XX_WDT1_BASE 0x4830c000 +#define OMAP34XX_WDT2_BASE 0x48314000 +#define OMAP34XX_WDT3_BASE 0x49030000 +#define OMAP2430_WDT_BASE 0x49016000 +#define OMAP2420_WDT_BASE 0x48022000 +#define OMAP16XX_WDT_BASE 0xfffeb000 + +static struct resource wdt1_resources[] = { { - .flags =IORESOURCE_MEM , + .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 struct resource wdt2_resources[] = { + { + .flags =IORESOURCE_MEM , + }, +}; + +static struct resource wdt3_resources[] = { + { + .flags =IORESOURCE_MEM , + }, +}; + +/* SECURE WDT */ +static struct platform_device omap_wdt1_device = { + .name ="omap_wdt" , + .id =1 , + .num_resources =ARRAY_SIZE (wdt1_resources), + .resource = wdt1_resources, +}; + +/* MPU WDT */ +static struct platform_device omap_wdt2_device = { + .name ="omap_wdt" , + .id =2 , + .num_resources =ARRAY_SIZE (wdt2_resources), + .resource = wdt2_resources, +}; + +/* IVA WDT */ +static struct platform_device omap_wdt3_device = { + .name ="omap_wdt" , + .id =3 , + .num_resources =ARRAY_SIZE (wdt3_resources), + .resource = wdt3_resources, };static void omap_init_wdt (void ) {if (cpu_is_omap16xx ()) - wdt_resources[0 ].start =0xfffeb000 ; + wdt2_resources[0 ].start =OMAP16XX_WDT_BASE ;else if (cpu_is_omap2420 ()) - wdt_resources[0 ].start =0x48022000 ;/* WDT2 */ + wdt2_resources[0 ].start =OMAP2420_WDT_BASE ;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 ; + wdt2_resources[0 ].start =OMAP2430_WDT_BASE ; +else if (cpu_is_omap343x ()) { + wdt1_resources[0 ].start =OMAP34XX_WDT1_BASE ; + wdt1_resources[0 ].end = wdt1_resources[0 ].start +0x4f ; + wdt2_resources[0 ].start =OMAP34XX_WDT2_BASE ; + wdt3_resources[0 ].start =OMAP34XX_WDT3_BASE ; + wdt3_resources[0 ].end = wdt3_resources[0 ].start +0x4f ; + }else return ; - wdt_resources[0 ].end = wdt_resources[0 ].start +0x4f ; + wdt2_resources[0 ].end = wdt2_resources[0 ].start +0x4f ; - (void )platform_device_register (&omap_wdt_device); +/* MPU WDT present across omap family */ + (void )platform_device_register (&omap_wdt2_device); + +if (cpu_is_omap34xx ()) { + (void )platform_device_register (&omap_wdt3_device); +if (omap_type () ==OMAP2_DEVICE_TYPE_SEC + ||omap_type () ==OMAP2_DEVICE_TYPE_EMU )arch/arm/plat-omap/devices.c static inline void omap_init_uwire(void) {}
Quoted 10 lines
arch/arm/plat-omap/devices.c +4
-0+ (void) platform_device_register(&omap_wdt1_device); + } } +#else static inline void omap_init_wdt (void ) {}#endif +/*--------------------------------------------------------------------- ----*/
arch/arm/plat-omap/devices.c static inline void omap_init_uwire(void) {} · line 376
Quoted 2 lines
arch/arm/plat-omap/devices.c +0
-0#if defined(CONFIG_HW_RANDOM_OMAP) ||
defined(CONFIG_HW_RANDOM_OMAP_MODULE)Quoted 7 lines
arch/arm/plat-omap/devices.c +0
-1--1.5.4.3
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH v3 1/2] watchdog:OMAP3:Register IVA and SECURE WDT, make clks accessible
Quoted 86 lines
-----Original Message-----
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Hald, Ulrik Bech
Sent: Wednesday, June 17, 2009 9:52 AM
To: Tony Lindgren
Cc: [email protected]
Subject: RE: [PATCH v3 1/2] watchdog:OMAP3:Register IVA and SECURE WDT, make clks accessibleQuoted 14 lines
-----Original Message-----
From: Tony Lindgren [mailto:[email protected]]
Sent: Wednesday, June 17, 2009 8:48 AM
To: Hald, Ulrik Bech
Cc: [email protected]
Subject: Re: [PATCH v3 1/2] watchdog:OMAP3:Register IVA and SECURE WDT, make clks accessibleHi,
Quoted 3 lines · Ulrik Bech Hald
Enabling registration of IVA and SECURE WDT devices. Making ick and fck for IVA and SECURE WDTs accessible.
Quoted 9 lines
Quoted 5 lines
Tested on Zoom1 OMAP3 platform
Signed-off-by Ulrik Bech Hald <[email protected]>---
This patch has a dependency on:
compilation: PATCH 1/2] OMAP2/3: SoC IDs: addomap_type()fordetermining GP/EMU/HS
Quoted 3 lines
arch/arm/mach-omap2/clock34xx.c | 12 +++--- arch/arm/plat-omap/devices.c | 81+++++++++++++++++++++++++++++++-
Quoted 53 lines
-------
arch/arm/mach-
Quoted 3 lines
2 files changed, 71 insertions(+), 22 deletions(-)arch/arm/mach- renamed from arch/arm/mach-omap2/clock34xx.c +0
-0
omap2/clock34xx.cQuoted 36 lines
index 9e43fe5..933ae9e 100644
arch/arm/mach-omap2/clock34xx.c +5
-5@@ -215,11 +215,11 @@ static struct omap_clk omap34xx_clks[] = {CLK (NULL ,"gpt1_fck" , &gpt1_fck,CK_343X ),CLK (NULL ,"wkup_32k_fck" , &wkup_32k_fck,CK_343X ),CLK (NULL ,"gpio1_dbck" , &gpio1_dbck,CK_343X ), -CLK ("omap_wdt" ,"fck" , &wdt2_fck,CK_343X ), +CLK ("omap_wdt.2" ,"fck" , &wdt2_fck,CK_343X ),CLK (NULL ,"wkup_l4_ick" , &wkup_l4_ick,CK_343X ),CLK (NULL ,"usim_ick" , &usim_ick,CK_3430ES2 ), -CLK ("omap_wdt" ,"ick" , &wdt2_ick,CK_343X ), -CLK (NULL ,"wdt1_ick" , &wdt1_ick,CK_343X ), +CLK ("omap_wdt.2" ,"ick" , &wdt2_ick,CK_343X ), +CLK ("omap_wdt.1" ,"ick" , &wdt1_ick,CK_343X ),CLK (NULL ,"gpio1_ick" , &gpio1_ick,CK_343X ),CLK (NULL ,"omap_32ksync_ick" , &omap_32ksync_ick,CK_343X ), CLK(NULL, "gpt12_ick", &gpt12_ick, CK_343X),@@ -241,14 +241,14 @@ static struct omap_clk omap34xx_clks[] = {CLK (NULL ,"gpio4_dbck" , &gpio4_dbck,CK_343X ),CLK (NULL ,"gpio3_dbck" , &gpio3_dbck,CK_343X ),CLK (NULL ,"gpio2_dbck" , &gpio2_dbck,CK_343X ), -CLK (NULL ,"wdt3_fck" , &wdt3_fck,CK_343X ), +CLK ("omap_wdt.3" ,"fck" , &wdt3_fck,CK_343X ),CLK (NULL ,"per_l4_ick" , &per_l4_ick,CK_343X ),CLK (NULL ,"gpio6_ick" , &gpio6_ick,CK_343X ),CLK (NULL ,"gpio5_ick" , &gpio5_ick,CK_343X ),CLK (NULL ,"gpio4_ick" , &gpio4_ick,CK_343X ),CLK (NULL ,"gpio3_ick" , &gpio3_ick,CK_343X ),CLK (NULL ,"gpio2_ick" , &gpio2_ick,CK_343X ), -CLK (NULL ,"wdt3_ick" , &wdt3_ick,CK_343X ), +CLK ("omap_wdt.3" ,"ick" , &wdt3_ick,CK_343X ),CLK (NULL ,"uart3_ick" , &uart3_ick,CK_343X ),CLK (NULL ,"gpt9_ick" , &gpt9_ick,CK_343X ), CLK(NULL, "gpt8_ick", &gpt8_ick, CK_343X),arch/arm/mach-omap2/clock34xx.c static struct omap_clk omap34xx_clks[] = { · line 281
Quoted 8 lines
arch/arm/mach-omap2/clock34xx.c +1
-1@@ -275,7 +275,7 @@ static struct omap_clk omap34xx_clks[] = {CLK (NULL ,"sr_l4_ick" , &sr_l4_ick,CK_343X ),CLK (NULL ,"secure_32k_fck" , &secure_32k_fck,CK_343X ),CLK (NULL ,"gpt12_fck" , &gpt12_fck,CK_343X ), - CLK(NULL, "wdt1_fck", &wdt1_fck, CK_343X), + CLK("omap_wdt.1", "fck", &wdt1_fck, CK_343X), };/* CM_AUTOIDLE_PLL*.AUTO_* bit values */ To me it looks like you need to make the
omap_wdtclock alias rename change also formach-omap1/clock.c.
Quoted 7 lines
Quoted 4 lines
Regards,
Tony
You're right, and it also looks like
mach-omap2/clock24xx.cneeds the alias rename to omap_wdt.1 as well.
And by omap_wdt.1 I really mean omap_wdt.2 (mpu) :)
Quoted 137 lines
Thanks for looking at it Tony.
/Ulrik
Quoted 2 lines
arch/arm/plat-
Quoted 2 lines
arch/arm/plat- renamed from arch/arm/plat-omap/devices.c +0
-0
omap/devices.cQuoted 110 lines
arch/arm/plat-omap/devices.c static inline void omap_init_uwire(void) {} · line 289
Quoted 8 lines
old mode 100644
new mode 100755
index a64b692..de5182carch/arm/plat-omap/devices.c +0
-0@@ -288,42 +288,91 @@ static inline void omap_init_uwire(void) {} #if defined(CONFIG_OMAP_WATCHDOG) ||
defined(CONFIG_OMAP_WATCHDOG_MODULE)Quoted 101 lines
arch/arm/plat-omap/devices.c +64
-16-static struct resource wdt_resources[] = { +#define OMAP34XX_WDT1_BASE 0x4830c000 +#define OMAP34XX_WDT2_BASE 0x48314000 +#define OMAP34XX_WDT3_BASE 0x49030000 +#define OMAP2430_WDT_BASE 0x49016000 +#define OMAP2420_WDT_BASE 0x48022000 +#define OMAP16XX_WDT_BASE 0xfffeb000 + +static struct resource wdt1_resources[] = { { - .flags =IORESOURCE_MEM , + .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 struct resource wdt2_resources[] = { + { + .flags =IORESOURCE_MEM , + }, +}; + +static struct resource wdt3_resources[] = { + { + .flags =IORESOURCE_MEM , + }, +}; + +/* SECURE WDT */ +static struct platform_device omap_wdt1_device = { + .name ="omap_wdt" , + .id =1 , + .num_resources =ARRAY_SIZE (wdt1_resources), + .resource = wdt1_resources, +}; + +/* MPU WDT */ +static struct platform_device omap_wdt2_device = { + .name ="omap_wdt" , + .id =2 , + .num_resources =ARRAY_SIZE (wdt2_resources), + .resource = wdt2_resources, +}; + +/* IVA WDT */ +static struct platform_device omap_wdt3_device = { + .name ="omap_wdt" , + .id =3 , + .num_resources =ARRAY_SIZE (wdt3_resources), + .resource = wdt3_resources, };static void omap_init_wdt (void ) {if (cpu_is_omap16xx ()) - wdt_resources[0 ].start =0xfffeb000 ; + wdt2_resources[0 ].start =OMAP16XX_WDT_BASE ;else if (cpu_is_omap2420 ()) - wdt_resources[0 ].start =0x48022000 ;/* WDT2 */ + wdt2_resources[0 ].start =OMAP2420_WDT_BASE ;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 ; + wdt2_resources[0 ].start =OMAP2430_WDT_BASE ; +else if (cpu_is_omap343x ()) { + wdt1_resources[0 ].start =OMAP34XX_WDT1_BASE ; + wdt1_resources[0 ].end = wdt1_resources[0 ].start +0x4f ; + wdt2_resources[0 ].start =OMAP34XX_WDT2_BASE ; + wdt3_resources[0 ].start =OMAP34XX_WDT3_BASE ; + wdt3_resources[0 ].end = wdt3_resources[0 ].start +0x4f ; + }else return ; - wdt_resources[0 ].end = wdt_resources[0 ].start +0x4f ; + wdt2_resources[0 ].end = wdt2_resources[0 ].start +0x4f ; - (void )platform_device_register (&omap_wdt_device); +/* MPU WDT present across omap family */ + (void )platform_device_register (&omap_wdt2_device); + +if (cpu_is_omap34xx ()) { + (void )platform_device_register (&omap_wdt3_device); +if (omap_type () ==OMAP2_DEVICE_TYPE_SEC + ||omap_type () ==OMAP2_DEVICE_TYPE_EMU ) + (void )platform_device_register (&omap_wdt1_device); + } } +#else static inline void omap_init_wdt (void ) {}#endif Quoted 2 lines
arch/arm/plat-omap/devices.c static inline void omap_init_uwire(void) {} · line 375
Quoted 2 lines
arch/arm/plat-omap/devices.c +1
-0+/*------------------------------------------------------------------- --
Quoted 9 lines
----*/
arch/arm/plat-omap/devices.c static inline void omap_init_uwire(void) {} · line 376
Quoted 2 lines
arch/arm/plat-omap/devices.c +0
-0#if defined(CONFIG_HW_RANDOM_OMAP) ||
defined(CONFIG_HW_RANDOM_OMAP_MODULE)Quoted 5 lines
arch/arm/plat-omap/devices.c +0
-1--1.5.4.3
--
To unsubscribe from this list: send the line "unsubscribe linux-omap"in
Quoted 2 lines
Quoted 2 lines
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html