]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Move OMAP1 specific core files to omap1 subdirectory
authorPaul Mundt <lethal@linux-sh.org>
Mon, 9 May 2005 19:03:41 +0000 (12:03 -0700)
committerTony Lindgren <tony@atomide.com>
Mon, 9 May 2005 19:03:41 +0000 (12:03 -0700)
Sync with linux-omap tree. Moves OMAP1 specific core files, such
as irq.c, time.c and fpga.c to omap1 subdirectory.

Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap/omap1/fpga.c [moved from arch/arm/mach-omap/fpga.c with 100% similarity]
arch/arm/mach-omap/omap1/irq.c [moved from arch/arm/mach-omap/irq.c with 94% similarity]
arch/arm/mach-omap/omap1/leds-h2p2-debug.c [moved from arch/arm/mach-omap/leds-h2p2-debug.c with 100% similarity]
arch/arm/mach-omap/omap1/leds-innovator.c [moved from arch/arm/mach-omap/leds-innovator.c with 100% similarity]
arch/arm/mach-omap/omap1/leds-osk.c [moved from arch/arm/mach-omap/leds-osk.c with 98% similarity]
arch/arm/mach-omap/omap1/leds.c [moved from arch/arm/mach-omap/leds.c with 100% similarity]
arch/arm/mach-omap/omap1/leds.h [moved from arch/arm/mach-omap/leds.h with 100% similarity]
arch/arm/mach-omap/omap1/time.c [moved from arch/arm/mach-omap/time.c with 87% similarity]

similarity index 94%
rename from arch/arm/mach-omap/irq.c
rename to arch/arm/mach-omap/omap1/irq.c
index f01c99266a866c7fdb8325912d3c094dfe6fdfee..a11b6d807352ccf93add9b87dae0069f204d6bc3 100644 (file)
@@ -56,6 +56,7 @@
 struct omap_irq_bank {
        unsigned long base_reg;
        unsigned long trigger_map;
+       unsigned long wake_enable;
 };
 
 static unsigned int irq_bank_count = 0;
@@ -105,6 +106,19 @@ static void omap_mask_ack_irq(unsigned int irq)
        omap_ack_irq(irq);
 }
 
+static int omap_wake_irq(unsigned int irq, unsigned int enable)
+{
+       int bank = IRQ_BANK(irq);
+
+       if (enable)
+               irq_banks[bank].wake_enable |= IRQ_BIT(irq);
+       else
+               irq_banks[bank].wake_enable &= ~IRQ_BIT(irq);
+
+       return 0;
+}
+
+
 /*
  * Allows tuning the IRQ type and priority
  *
@@ -145,7 +159,7 @@ static struct omap_irq_bank omap1510_irq_banks[] = {
 static struct omap_irq_bank omap1610_irq_banks[] = {
        { .base_reg = OMAP_IH1_BASE,            .trigger_map = 0xb3fefe8f },
        { .base_reg = OMAP_IH2_BASE,            .trigger_map = 0xfdb7c1fd },
-       { .base_reg = OMAP_IH2_BASE + 0x100,    .trigger_map = 0xfffff7ff },
+       { .base_reg = OMAP_IH2_BASE + 0x100,    .trigger_map = 0xffffb7ff },
        { .base_reg = OMAP_IH2_BASE + 0x200,    .trigger_map = 0xffffffff },
 };
 #endif
@@ -154,6 +168,7 @@ static struct irqchip omap_irq_chip = {
        .ack    = omap_mask_ack_irq,
        .mask   = omap_mask_irq,
        .unmask = omap_unmask_irq,
+       .wake   = omap_wake_irq,
 };
 
 void __init omap_init_irq(void)
similarity index 98%
rename from arch/arm/mach-omap/leds-osk.c
rename to arch/arm/mach-omap/omap1/leds-osk.c
index f5177f430793b6e2cd22bbcc2348855f3df297f5..4a0e8b9d4fc37d5748e067c01ff0b84a59d1e1d2 100644 (file)
@@ -129,14 +129,11 @@ void osk_leds_event(led_event_t evt)
 
 #ifdef CONFIG_FB_OMAP
 
-#ifdef CONFIG_LEDS_TIMER
        case led_timer:
                hw_led_state ^= TIMER_LED;
                mistral_setled();
                break;
-#endif
 
-#ifdef CONFIG_LEDS_CPU
        case led_idle_start:
                hw_led_state |= IDLE_LED;
                mistral_setled();
@@ -146,7 +143,6 @@ void osk_leds_event(led_event_t evt)
                hw_led_state &= ~IDLE_LED;
                mistral_setled();
                break;
-#endif
 
 #endif /* CONFIG_FB_OMAP */
 
similarity index 87%
rename from arch/arm/mach-omap/time.c
rename to arch/arm/mach-omap/omap1/time.c
index 4205fdcb632c238fd173df7ffc51b0bedfeed45b..b5e3aa7c0d1c2f0424128d29eb27e037017834d6 100644 (file)
@@ -1,10 +1,10 @@
 /*
- * linux/arch/arm/mach-omap/time.c
+ * linux/arch/arm/mach-omap/omap1/time.c
  *
  * OMAP Timers
  *
  * Copyright (C) 2004 Nokia Corporation
- * Partial timer rewrite and additional VST timer support by
+ * Partial timer rewrite and additional dynamic tick timer support by
  * Tony Lindgen <tony@atomide.com> and
  * Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
  *
@@ -58,17 +58,9 @@ struct sys_timer omap_timer;
  * MPU timer
  * ---------------------------------------------------------------------------
  */
-#define OMAP_MPU_TIMER1_BASE           (0xfffec500)
-#define OMAP_MPU_TIMER2_BASE           (0xfffec600)
-#define OMAP_MPU_TIMER3_BASE           (0xfffec700)
 #define OMAP_MPU_TIMER_BASE            OMAP_MPU_TIMER1_BASE
 #define OMAP_MPU_TIMER_OFFSET          0x100
 
-#define MPU_TIMER_FREE                 (1 << 6)
-#define MPU_TIMER_CLOCK_ENABLE         (1 << 5)
-#define MPU_TIMER_AR                   (1 << 1)
-#define MPU_TIMER_ST                   (1 << 0)
-
 /* cycles to nsec conversions taken from arch/i386/kernel/timers/timer_tsc.c,
  * converted to use kHz by Kevin Hilman */
 /* convert from cycles(64bits) => nanoseconds (64bits)
@@ -347,6 +339,54 @@ static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id,
        return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_NO_IDLE_HZ
+/*
+ * Programs the next timer interrupt needed. Called when dynamic tick is
+ * enabled, and to reprogram the ticks to skip from pm_idle.
+ */
+void omap_32k_timer_next_dyn_tick_interrupt(void)
+{
+       unsigned long next;
+
+       if (!system_timer->dyn_tick->state & DYN_TICK_ENABLED)
+               return;
+
+       next = next_timer_interrupt() - jiffies;
+
+       if (next > MAX_SKIP_JIFFIES)
+               next = MAX_SKIP_JIFFIES;
+
+       /*
+        * We can keep the timer continuous, no need to set it to
+        * run in one-shot mode. When using dynamic tick, the timer
+        * will get reprogrammed again after the next interrupt.
+        */
+       omap_32k_timer_start(JIFFIES_TO_HW_TICKS(next, 32768) + 1);
+}
+
+static struct irqaction omap_32k_timer_irq;
+extern struct timer_update_handler timer_update;
+
+static int omap_32k_timer_enable_dyn_tick(void)
+{
+       omap_32k_timer_next_dyn_tick_interrupt();
+       return 0;
+}
+
+static int omap_32k_timer_disable_dyn_tick(void)
+{
+       omap_32k_timer_start(OMAP_32K_TIMER_TICK_PERIOD);
+       return 0;
+}
+
+static struct dyn_tick_timer omap_dyn_tick_timer = {
+       .enable         = omap_32k_timer_enable_dyn_tick,
+       .disable        = omap_32k_timer_disable_dyn_tick,
+       .reprogram      = omap_32k_timer_next_dyn_tick_interrupt,
+       .handler        = omap_32k_timer_interrupt,
+};
+#endif /* CONFIG_NO_IDLE_HZ */
+
 static struct irqaction omap_32k_timer_irq = {
        .name           = "32KHz timer",
        .flags          = SA_INTERRUPT,
@@ -355,6 +395,14 @@ static struct irqaction omap_32k_timer_irq = {
 
 static __init void omap_init_32k_timer(void)
 {
+
+#ifdef CONFIG_NO_IDLE_HZ
+       omap_timer.dyn_tick = &omap_dyn_tick_timer;
+
+       /* Tell __do_irq not to duplicate timer ticks with dyn-tick */
+       omap_32k_timer_irq.flags |= SA_TIMER;
+#endif
+
        setup_irq(INT_OS_TIMER, &omap_32k_timer_irq);
        omap_timer.offset  = omap_32k_timer_gettimeoffset;
        omap_32k_last_tick = omap_32k_sync_timer_read();
@@ -367,7 +415,7 @@ static __init void omap_init_32k_timer(void)
  * Timer initialization
  * ---------------------------------------------------------------------------
  */
-void __init omap_timer_init(void)
+static void __init omap_timer_init(void)
 {
 #if defined(CONFIG_OMAP_MPU_TIMER)
        omap_init_mpu_timer();