diff options
author | Linus Walleij <linus.walleij@stericsson.com> | 2010-08-05 02:58:58 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-08-10 17:10:55 -0400 |
commit | b7276b236dcf400003179e77f5b4b4c05e1fb29c (patch) | |
tree | bd6d2ca778640be672356bf92808450dfa01bede /arch/arm/mach-u300 | |
parent | 379aae5d6c3d8d9751d85a8022e68a90df13a7ae (diff) |
ARM: 6296/1: clock U300 intcon and timer properly
This removes the quirks to clock the U300 VIC and timer by custom
hooks and moves the control out to the clock framework where it
belongs. This is possible now that clocks are available early.
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-u300')
-rw-r--r-- | arch/arm/mach-u300/clock.c | 19 | ||||
-rw-r--r-- | arch/arm/mach-u300/clock.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-u300/core.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-u300/timer.c | 11 |
4 files changed, 17 insertions, 24 deletions
diff --git a/arch/arm/mach-u300/clock.c b/arch/arm/mach-u300/clock.c index 7836de35893c..7a94729caff9 100644 --- a/arch/arm/mach-u300/clock.c +++ b/arch/arm/mach-u300/clock.c | |||
@@ -1315,25 +1315,6 @@ static void __init clk_register(void) | |||
1315 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | 1315 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
1316 | } | 1316 | } |
1317 | 1317 | ||
1318 | /* | ||
1319 | * The interrupt controller is enabled before the clock API is registered. | ||
1320 | */ | ||
1321 | void u300_enable_intcon_clock(void) | ||
1322 | { | ||
1323 | clk_enable(&intcon_clk); | ||
1324 | } | ||
1325 | EXPORT_SYMBOL(u300_enable_intcon_clock); | ||
1326 | |||
1327 | /* | ||
1328 | * The timer is enabled before the clock API is registered. | ||
1329 | */ | ||
1330 | void u300_enable_timer_clock(void) | ||
1331 | { | ||
1332 | clk_enable(&app_timer_clk); | ||
1333 | } | ||
1334 | EXPORT_SYMBOL(u300_enable_timer_clock); | ||
1335 | |||
1336 | |||
1337 | #if (defined(CONFIG_DEBUG_FS) && defined(CONFIG_U300_DEBUG)) | 1318 | #if (defined(CONFIG_DEBUG_FS) && defined(CONFIG_U300_DEBUG)) |
1338 | /* | 1319 | /* |
1339 | * The following makes it possible to view the status (especially | 1320 | * The following makes it possible to view the status (especially |
diff --git a/arch/arm/mach-u300/clock.h b/arch/arm/mach-u300/clock.h index fc40c326566f..c34f3ea3017c 100644 --- a/arch/arm/mach-u300/clock.h +++ b/arch/arm/mach-u300/clock.h | |||
@@ -45,8 +45,6 @@ struct clk { | |||
45 | void (*disable) (struct clk *); | 45 | void (*disable) (struct clk *); |
46 | }; | 46 | }; |
47 | 47 | ||
48 | void u300_enable_intcon_clock(void); | ||
49 | void u300_enable_timer_clock(void); | ||
50 | int u300_clock_init(void); | 48 | int u300_clock_init(void); |
51 | 49 | ||
52 | #endif | 50 | #endif |
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c index b18976370824..ea41c236be0f 100644 --- a/arch/arm/mach-u300/core.c +++ b/arch/arm/mach-u300/core.c | |||
@@ -19,6 +19,8 @@ | |||
19 | #include <linux/amba/bus.h> | 19 | #include <linux/amba/bus.h> |
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/gpio.h> | 21 | #include <linux/gpio.h> |
22 | #include <linux/clk.h> | ||
23 | #include <linux/err.h> | ||
22 | #include <mach/coh901318.h> | 24 | #include <mach/coh901318.h> |
23 | 25 | ||
24 | #include <asm/types.h> | 26 | #include <asm/types.h> |
@@ -1477,14 +1479,19 @@ static struct platform_device *platform_devs[] __initdata = { | |||
1477 | void __init u300_init_irq(void) | 1479 | void __init u300_init_irq(void) |
1478 | { | 1480 | { |
1479 | u32 mask[2] = {0, 0}; | 1481 | u32 mask[2] = {0, 0}; |
1482 | struct clk *clk; | ||
1480 | int i; | 1483 | int i; |
1481 | 1484 | ||
1482 | /* initialize clocking early, we want to clock the INTCON */ | 1485 | /* initialize clocking early, we want to clock the INTCON */ |
1483 | u300_clock_init(); | 1486 | u300_clock_init(); |
1484 | 1487 | ||
1488 | /* Clock the interrupt controller */ | ||
1489 | clk = clk_get_sys("intcon", NULL); | ||
1490 | BUG_ON(IS_ERR(clk)); | ||
1491 | clk_enable(clk); | ||
1492 | |||
1485 | for (i = 0; i < NR_IRQS; i++) | 1493 | for (i = 0; i < NR_IRQS; i++) |
1486 | set_bit(i, (unsigned long *) &mask[0]); | 1494 | set_bit(i, (unsigned long *) &mask[0]); |
1487 | u300_enable_intcon_clock(); | ||
1488 | vic_init((void __iomem *) U300_INTCON0_VBASE, 0, mask[0], mask[0]); | 1495 | vic_init((void __iomem *) U300_INTCON0_VBASE, 0, mask[0], mask[0]); |
1489 | vic_init((void __iomem *) U300_INTCON1_VBASE, 32, mask[1], mask[1]); | 1496 | vic_init((void __iomem *) U300_INTCON1_VBASE, 32, mask[1], mask[1]); |
1490 | } | 1497 | } |
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c index 26d26f5100fe..01f161831956 100644 --- a/arch/arm/mach-u300/timer.c +++ b/arch/arm/mach-u300/timer.c | |||
@@ -15,6 +15,8 @@ | |||
15 | #include <linux/clocksource.h> | 15 | #include <linux/clocksource.h> |
16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/clk.h> | ||
19 | #include <linux/err.h> | ||
18 | 20 | ||
19 | #include <mach/hardware.h> | 21 | #include <mach/hardware.h> |
20 | 22 | ||
@@ -23,7 +25,6 @@ | |||
23 | #include <asm/mach/time.h> | 25 | #include <asm/mach/time.h> |
24 | #include <asm/mach/irq.h> | 26 | #include <asm/mach/irq.h> |
25 | 27 | ||
26 | #include "clock.h" | ||
27 | 28 | ||
28 | /* | 29 | /* |
29 | * APP side special timer registers | 30 | * APP side special timer registers |
@@ -367,7 +368,13 @@ unsigned long long notrace sched_clock(void) | |||
367 | */ | 368 | */ |
368 | static void __init u300_timer_init(void) | 369 | static void __init u300_timer_init(void) |
369 | { | 370 | { |
370 | u300_enable_timer_clock(); | 371 | struct clk *clk; |
372 | |||
373 | /* Clock the interrupt controller */ | ||
374 | clk = clk_get_sys("apptimer", NULL); | ||
375 | BUG_ON(IS_ERR(clk)); | ||
376 | clk_enable(clk); | ||
377 | |||
371 | /* | 378 | /* |
372 | * Disable the "OS" and "DD" timers - these are designed for Symbian! | 379 | * Disable the "OS" and "DD" timers - these are designed for Symbian! |
373 | * Example usage in cnh1601578 cpu subsystem pd_timer_app.c | 380 | * Example usage in cnh1601578 cpu subsystem pd_timer_app.c |