Commit 82f2348e authored by Paul Mundt's avatar Paul Mundt Committed by Tony Lindgren

ARM: OMAP: Move OMAP1 specific core files to omap1 subdirectory

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: default avatarTony Lindgren <tony@atomide.com>
parent 712622ef
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
struct omap_irq_bank { struct omap_irq_bank {
unsigned long base_reg; unsigned long base_reg;
unsigned long trigger_map; unsigned long trigger_map;
unsigned long wake_enable;
}; };
static unsigned int irq_bank_count = 0; static unsigned int irq_bank_count = 0;
...@@ -105,6 +106,19 @@ static void omap_mask_ack_irq(unsigned int irq) ...@@ -105,6 +106,19 @@ static void omap_mask_ack_irq(unsigned int irq)
omap_ack_irq(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 * Allows tuning the IRQ type and priority
* *
...@@ -145,7 +159,7 @@ static struct omap_irq_bank omap1510_irq_banks[] = { ...@@ -145,7 +159,7 @@ static struct omap_irq_bank omap1510_irq_banks[] = {
static struct omap_irq_bank omap1610_irq_banks[] = { static struct omap_irq_bank omap1610_irq_banks[] = {
{ .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3fefe8f }, { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3fefe8f },
{ .base_reg = OMAP_IH2_BASE, .trigger_map = 0xfdb7c1fd }, { .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 }, { .base_reg = OMAP_IH2_BASE + 0x200, .trigger_map = 0xffffffff },
}; };
#endif #endif
...@@ -154,6 +168,7 @@ static struct irqchip omap_irq_chip = { ...@@ -154,6 +168,7 @@ static struct irqchip omap_irq_chip = {
.ack = omap_mask_ack_irq, .ack = omap_mask_ack_irq,
.mask = omap_mask_irq, .mask = omap_mask_irq,
.unmask = omap_unmask_irq, .unmask = omap_unmask_irq,
.wake = omap_wake_irq,
}; };
void __init omap_init_irq(void) void __init omap_init_irq(void)
......
...@@ -129,14 +129,11 @@ void osk_leds_event(led_event_t evt) ...@@ -129,14 +129,11 @@ void osk_leds_event(led_event_t evt)
#ifdef CONFIG_FB_OMAP #ifdef CONFIG_FB_OMAP
#ifdef CONFIG_LEDS_TIMER
case led_timer: case led_timer:
hw_led_state ^= TIMER_LED; hw_led_state ^= TIMER_LED;
mistral_setled(); mistral_setled();
break; break;
#endif
#ifdef CONFIG_LEDS_CPU
case led_idle_start: case led_idle_start:
hw_led_state |= IDLE_LED; hw_led_state |= IDLE_LED;
mistral_setled(); mistral_setled();
...@@ -146,7 +143,6 @@ void osk_leds_event(led_event_t evt) ...@@ -146,7 +143,6 @@ void osk_leds_event(led_event_t evt)
hw_led_state &= ~IDLE_LED; hw_led_state &= ~IDLE_LED;
mistral_setled(); mistral_setled();
break; break;
#endif
#endif /* CONFIG_FB_OMAP */ #endif /* CONFIG_FB_OMAP */
......
/* /*
* linux/arch/arm/mach-omap/time.c * linux/arch/arm/mach-omap/omap1/time.c
* *
* OMAP Timers * OMAP Timers
* *
* Copyright (C) 2004 Nokia Corporation * 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 * Tony Lindgen <tony@atomide.com> and
* Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com> * Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
* *
...@@ -58,17 +58,9 @@ struct sys_timer omap_timer; ...@@ -58,17 +58,9 @@ struct sys_timer omap_timer;
* MPU 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_BASE OMAP_MPU_TIMER1_BASE
#define OMAP_MPU_TIMER_OFFSET 0x100 #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, /* cycles to nsec conversions taken from arch/i386/kernel/timers/timer_tsc.c,
* converted to use kHz by Kevin Hilman */ * converted to use kHz by Kevin Hilman */
/* convert from cycles(64bits) => nanoseconds (64bits) /* convert from cycles(64bits) => nanoseconds (64bits)
...@@ -347,6 +339,54 @@ static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id, ...@@ -347,6 +339,54 @@ static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id,
return IRQ_HANDLED; 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 = { static struct irqaction omap_32k_timer_irq = {
.name = "32KHz timer", .name = "32KHz timer",
.flags = SA_INTERRUPT, .flags = SA_INTERRUPT,
...@@ -355,6 +395,14 @@ static struct irqaction omap_32k_timer_irq = { ...@@ -355,6 +395,14 @@ static struct irqaction omap_32k_timer_irq = {
static __init void omap_init_32k_timer(void) 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); setup_irq(INT_OS_TIMER, &omap_32k_timer_irq);
omap_timer.offset = omap_32k_timer_gettimeoffset; omap_timer.offset = omap_32k_timer_gettimeoffset;
omap_32k_last_tick = omap_32k_sync_timer_read(); omap_32k_last_tick = omap_32k_sync_timer_read();
...@@ -367,7 +415,7 @@ static __init void omap_init_32k_timer(void) ...@@ -367,7 +415,7 @@ static __init void omap_init_32k_timer(void)
* Timer initialization * Timer initialization
* --------------------------------------------------------------------------- * ---------------------------------------------------------------------------
*/ */
void __init omap_timer_init(void) static void __init omap_timer_init(void)
{ {
#if defined(CONFIG_OMAP_MPU_TIMER) #if defined(CONFIG_OMAP_MPU_TIMER)
omap_init_mpu_timer(); omap_init_mpu_timer();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment