Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8cc4c5488a28fe6a1f834e99317bb762798600f7
Commit:     8cc4c5488a28fe6a1f834e99317bb762798600f7
Parent:     c4057f5260650f165054bc56e16acc4aa0510d4f
Author:     Catalin Marinas <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 4 17:43:02 2008 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Mon Feb 4 17:52:26 2008 +0000

    [ARM] 4820/1: RealView: Select the timer IRQ at run-time
    
    This patch sets the timer IRQ at run-time by moving the sys_timer
    structure and the timer_init function to the realview_eb.c file. This
    allows multiple RealView platforms to be compiled in the same kernel
    image.
    
    Signed-off-by: Catalin Marinas <[EMAIL PROTECTED]>
    Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-realview/core.c        |   15 +++++----------
 arch/arm/mach-realview/core.h        |    3 +--
 arch/arm/mach-realview/realview_eb.c |   19 ++++++++++++++++++-
 3 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 29514ac..98aefc9 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -39,7 +39,6 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/flash.h>
 #include <asm/mach/irq.h>
-#include <asm/mach/time.h>
 #include <asm/mach/map.h>
 #include <asm/mach/mmc.h>
 
@@ -513,12 +512,12 @@ static struct clock_event_device timer0_clockevent =      
 {
        .set_mode       = timer_set_mode,
        .set_next_event = timer_set_next_event,
        .rating         = 300,
-       .irq            = IRQ_TIMERINT0_1,
        .cpumask        = CPU_MASK_ALL,
 };
 
-static void __init realview_clockevents_init(void)
+static void __init realview_clockevents_init(unsigned int timer_irq)
 {
+       timer0_clockevent.irq = timer_irq;
        timer0_clockevent.mult =
                div_sc(1000000, NSEC_PER_SEC, timer0_clockevent.shift);
        timer0_clockevent.max_delta_ns =
@@ -581,7 +580,7 @@ static void __init realview_clocksource_init(void)
 /*
  * Set up the clock source and clock events devices
  */
-static void __init realview_timer_init(void)
+void __init realview_timer_init(unsigned int timer_irq)
 {
        u32 val;
 
@@ -616,12 +615,8 @@ static void __init realview_timer_init(void)
        /* 
         * Make irqs happen for the system timer
         */
-       setup_irq(IRQ_TIMERINT0_1, &realview_timer_irq);
+       setup_irq(timer_irq, &realview_timer_irq);
 
        realview_clocksource_init();
-       realview_clockevents_init();
+       realview_clockevents_init(timer_irq);
 }
-
-struct sys_timer realview_timer = {
-       .init           = realview_timer_init,
-};
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h
index 1c09137..16c9d45 100644
--- a/arch/arm/mach-realview/core.h
+++ b/arch/arm/mach-realview/core.h
@@ -27,8 +27,6 @@
 #include <asm/leds.h>
 #include <asm/io.h>
 
-extern struct sys_timer realview_timer;
-
 #define AMBA_DEVICE(name,busid,base,plat)                      \
 static struct amba_device name##_device = {                    \
        .dev            = {                                     \
@@ -55,5 +53,6 @@ extern struct clcd_board clcd_plat_data;
 extern void __iomem *gic_cpu_base_addr;
 
 extern void realview_leds_event(led_event_t ledevt);
+extern void realview_timer_init(unsigned int timer_irq);
 
 #endif
diff --git a/arch/arm/mach-realview/realview_eb.c 
b/arch/arm/mach-realview/realview_eb.c
index f36af13..20b05f2 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -36,6 +36,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/mmc.h>
+#include <asm/mach/time.h>
 
 #include <asm/arch/board-eb.h>
 #include <asm/arch/irqs.h>
@@ -304,6 +305,22 @@ static void realview_eb11mp_fixup(void)
        realview_eb_smc91x_resources[1].end     = IRQ_EB11MP_ETH;
 }
 
+static void __init realview_eb_timer_init(void)
+{
+       unsigned int timer_irq;
+
+       if (core_tile_eb11mp())
+               timer_irq = IRQ_EB11MP_TIMER0_1;
+       else
+               timer_irq = IRQ_EB_TIMER0_1;
+
+       realview_timer_init(timer_irq);
+}
+
+static struct sys_timer realview_eb_timer = {
+       .init           = realview_eb_timer_init,
+};
+
 static void __init realview_eb_init(void)
 {
        int i;
@@ -339,6 +356,6 @@ MACHINE_START(REALVIEW_EB, "ARM-RealView EB")
        .boot_params    = 0x00000100,
        .map_io         = realview_eb_map_io,
        .init_irq       = gic_init_irq,
-       .timer          = &realview_timer,
+       .timer          = &realview_eb_timer,
        .init_machine   = realview_eb_init,
 MACHINE_END
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to