aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci
diff options
context:
space:
mode:
authorMark A. Greer <mgreer@mvista.com>2009-04-15 15:40:21 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-05-26 11:20:31 -0400
commit951d6f6d703110790256abfce03ced117d2dcc6b (patch)
tree598b30a93ff618f56579d2c1218088bd908e5125 /arch/arm/mach-davinci
parentf64691b3ab795268072e76ddb89290b6277cdf33 (diff)
davinci: Add watchdog base address flexibility
The watchdog code currently hardcodes the base address of the timer its using. To support new SoCs, make it support timers at any address. Use the soc_info structure to do this. Signed-off-by: Mark A. Greer <mgreer@mvista.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci')
-rw-r--r--arch/arm/mach-davinci/devices.c7
-rw-r--r--arch/arm/mach-davinci/dm355.c1
-rw-r--r--arch/arm/mach-davinci/dm644x.c1
-rw-r--r--arch/arm/mach-davinci/dm646x.c1
-rw-r--r--arch/arm/mach-davinci/include/mach/common.h1
-rw-r--r--arch/arm/mach-davinci/include/mach/time.h1
-rw-r--r--arch/arm/mach-davinci/time.c5
7 files changed, 12 insertions, 5 deletions
diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c
index 36c528ff30f9..7ebf6713f6a2 100644
--- a/arch/arm/mach-davinci/devices.c
+++ b/arch/arm/mach-davinci/devices.c
@@ -216,8 +216,6 @@ void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config)
216 216
217static struct resource wdt_resources[] = { 217static struct resource wdt_resources[] = {
218 { 218 {
219 .start = 0x01c21c00,
220 .end = 0x01c21fff,
221 .flags = IORESOURCE_MEM, 219 .flags = IORESOURCE_MEM,
222 }, 220 },
223}; 221};
@@ -231,6 +229,11 @@ struct platform_device davinci_wdt_device = {
231 229
232static void davinci_init_wdt(void) 230static void davinci_init_wdt(void)
233{ 231{
232 struct davinci_soc_info *soc_info = &davinci_soc_info;
233
234 wdt_resources[0].start = (resource_size_t)soc_info->wdt_base;
235 wdt_resources[0].end = (resource_size_t)soc_info->wdt_base + SZ_1K - 1;
236
234 platform_device_register(&davinci_wdt_device); 237 platform_device_register(&davinci_wdt_device);
235} 238}
236 239
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index 293a419a4a8e..1b7c16cd2672 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -646,6 +646,7 @@ static struct davinci_soc_info davinci_soc_info_dm355 = {
646 .intc_irq_prios = dm355_default_priorities, 646 .intc_irq_prios = dm355_default_priorities,
647 .intc_irq_num = DAVINCI_N_AINTC_IRQ, 647 .intc_irq_num = DAVINCI_N_AINTC_IRQ,
648 .timer_info = &dm355_timer_info, 648 .timer_info = &dm355_timer_info,
649 .wdt_base = IO_ADDRESS(DAVINCI_WDOG_BASE),
649}; 650};
650 651
651void __init dm355_init(void) 652void __init dm355_init(void)
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index 8e9385c34853..c66269264cca 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -589,6 +589,7 @@ static struct davinci_soc_info davinci_soc_info_dm644x = {
589 .intc_irq_prios = dm644x_default_priorities, 589 .intc_irq_prios = dm644x_default_priorities,
590 .intc_irq_num = DAVINCI_N_AINTC_IRQ, 590 .intc_irq_num = DAVINCI_N_AINTC_IRQ,
591 .timer_info = &dm644x_timer_info, 591 .timer_info = &dm644x_timer_info,
592 .wdt_base = IO_ADDRESS(DAVINCI_WDOG_BASE),
592}; 593};
593 594
594void __init dm644x_init(void) 595void __init dm644x_init(void)
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index 219063f4d000..83d67cf6935f 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -568,6 +568,7 @@ static struct davinci_soc_info davinci_soc_info_dm646x = {
568 .intc_irq_prios = dm646x_default_priorities, 568 .intc_irq_prios = dm646x_default_priorities,
569 .intc_irq_num = DAVINCI_N_AINTC_IRQ, 569 .intc_irq_num = DAVINCI_N_AINTC_IRQ,
570 .timer_info = &dm646x_timer_info, 570 .timer_info = &dm646x_timer_info,
571 .wdt_base = IO_ADDRESS(DAVINCI_WDOG_BASE),
571}; 572};
572 573
573void __init dm646x_init(void) 574void __init dm646x_init(void)
diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h
index 90b43be1174e..d63703826a60 100644
--- a/arch/arm/mach-davinci/include/mach/common.h
+++ b/arch/arm/mach-davinci/include/mach/common.h
@@ -57,6 +57,7 @@ struct davinci_soc_info {
57 u8 *intc_irq_prios; 57 u8 *intc_irq_prios;
58 unsigned long intc_irq_num; 58 unsigned long intc_irq_num;
59 struct davinci_timer_info *timer_info; 59 struct davinci_timer_info *timer_info;
60 void __iomem *wdt_base;
60}; 61};
61 62
62extern struct davinci_soc_info davinci_soc_info; 63extern struct davinci_soc_info davinci_soc_info;
diff --git a/arch/arm/mach-davinci/include/mach/time.h b/arch/arm/mach-davinci/include/mach/time.h
index 1428d77c989e..1c971d8d8ba8 100644
--- a/arch/arm/mach-davinci/include/mach/time.h
+++ b/arch/arm/mach-davinci/include/mach/time.h
@@ -13,6 +13,7 @@
13 13
14#define DAVINCI_TIMER0_BASE (IO_PHYS + 0x21400) 14#define DAVINCI_TIMER0_BASE (IO_PHYS + 0x21400)
15#define DAVINCI_TIMER1_BASE (IO_PHYS + 0x21800) 15#define DAVINCI_TIMER1_BASE (IO_PHYS + 0x21800)
16#define DAVINCI_WDOG_BASE (IO_PHYS + 0x21C00)
16 17
17enum { 18enum {
18 T0_BOT, 19 T0_BOT,
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
index faafb897f4bd..f80ae25a52e4 100644
--- a/arch/arm/mach-davinci/time.c
+++ b/arch/arm/mach-davinci/time.c
@@ -35,8 +35,6 @@
35static struct clock_event_device clockevent_davinci; 35static struct clock_event_device clockevent_davinci;
36static unsigned int davinci_clock_tick_rate; 36static unsigned int davinci_clock_tick_rate;
37 37
38#define DAVINCI_WDOG_BASE (IO_PHYS + 0x21C00)
39
40/* 38/*
41 * This driver configures the 2 64-bit count-up timers as 4 independent 39 * This driver configures the 2 64-bit count-up timers as 4 independent
42 * 32-bit count-up timers used as follows: 40 * 32-bit count-up timers used as follows:
@@ -343,7 +341,8 @@ struct sys_timer davinci_timer = {
343void davinci_watchdog_reset(void) 341void davinci_watchdog_reset(void)
344{ 342{
345 u32 tgcr, wdtcr; 343 u32 tgcr, wdtcr;
346 void __iomem *base = IO_ADDRESS(DAVINCI_WDOG_BASE); 344 struct davinci_soc_info *soc_info = &davinci_soc_info;
345 void __iomem *base = soc_info->wdt_base;
347 struct clk *wd_clk; 346 struct clk *wd_clk;
348 347
349 wd_clk = clk_get(&davinci_wdt_device.dev, NULL); 348 wd_clk = clk_get(&davinci_wdt_device.dev, NULL);