Commit 741e3a89 authored by Tony Lindgren's avatar Tony Lindgren
Browse files

omap: Use separate init_irq functions to avoid cpu_is_omap tests early


This allows us to remove cpu_is_omap calls from init_irq functions.
There should not be any need for cpu_is_omap calls as at this point.
During the timer init we only care about SoC generation, and not about
subrevisions.

The main reason for the patch is that we want to initialize only
minimal omap specific code from the init_early call.
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
Reviewed-by: default avatarKevin Hilman <khilman@ti.com>
parent 2c53b436
...@@ -137,7 +137,7 @@ MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board") ...@@ -137,7 +137,7 @@ MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
.reserve = omap_reserve, .reserve = omap_reserve,
.map_io = omap3_map_io, .map_io = omap3_map_io,
.init_early = omap_zoom_init_early, .init_early = omap_zoom_init_early,
.init_irq = omap_init_irq, .init_irq = omap3_init_irq,
.init_machine = omap_zoom_init, .init_machine = omap_zoom_init,
.timer = &omap_timer, .timer = &omap_timer,
MACHINE_END MACHINE_END
...@@ -147,7 +147,7 @@ MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board") ...@@ -147,7 +147,7 @@ MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
.reserve = omap_reserve, .reserve = omap_reserve,
.map_io = omap3_map_io, .map_io = omap3_map_io,
.init_early = omap_zoom_init_early, .init_early = omap_zoom_init_early,
.init_irq = omap_init_irq, .init_irq = omap3_init_irq,
.init_machine = omap_zoom_init, .init_machine = omap_zoom_init,
.timer = &omap_timer, .timer = &omap_timer,
MACHINE_END MACHINE_END
...@@ -333,23 +333,9 @@ static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data) ...@@ -333,23 +333,9 @@ static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
return omap_hwmod_set_postsetup_state(oh, *(u8 *)data); return omap_hwmod_set_postsetup_state(oh, *(u8 *)data);
} }
/* See irq.c, omap4-common.c and entry-macro.S */
void __iomem *omap_irq_base; void __iomem *omap_irq_base;
/*
* Initialize asm_irq_base for entry-macro.S
*/
static inline void omap_irq_base_init(void)
{
if (cpu_is_omap24xx())
omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE);
else if (cpu_is_omap34xx())
omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE);
else if (cpu_is_omap44xx())
omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE);
else
pr_err("Could not initialize omap_irq_base\n");
}
void __init omap2_init_common_infrastructure(void) void __init omap2_init_common_infrastructure(void)
{ {
u8 postsetup_state; u8 postsetup_state;
...@@ -422,7 +408,6 @@ void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0, ...@@ -422,7 +408,6 @@ void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0,
_omap2_init_reprogram_sdrc(); _omap2_init_reprogram_sdrc();
} }
omap_irq_base_init();
} }
/* /*
......
...@@ -141,25 +141,20 @@ omap_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num) ...@@ -141,25 +141,20 @@ omap_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num)
IRQ_NOREQUEST | IRQ_NOPROBE, 0); IRQ_NOREQUEST | IRQ_NOPROBE, 0);
} }
void __init omap_init_irq(void) static void __init omap_init_irq(u32 base, int nr_irqs)
{ {
unsigned long nr_of_irqs = 0; unsigned long nr_of_irqs = 0;
unsigned int nr_banks = 0; unsigned int nr_banks = 0;
int i, j; int i, j;
omap_irq_base = ioremap(base, SZ_4K);
if (WARN_ON(!omap_irq_base))
return;
for (i = 0; i < ARRAY_SIZE(irq_banks); i++) { for (i = 0; i < ARRAY_SIZE(irq_banks); i++) {
unsigned long base = 0;
struct omap_irq_bank *bank = irq_banks + i; struct omap_irq_bank *bank = irq_banks + i;
if (cpu_is_omap24xx()) bank->nr_irqs = nr_irqs;
base = OMAP24XX_IC_BASE;
else if (cpu_is_omap34xx())
base = OMAP34XX_IC_BASE;
BUG_ON(!base);
if (cpu_is_ti816x())
bank->nr_irqs = 128;
/* Static mapping, never released */ /* Static mapping, never released */
bank->base_reg = ioremap(base, SZ_4K); bank->base_reg = ioremap(base, SZ_4K);
...@@ -181,6 +176,21 @@ void __init omap_init_irq(void) ...@@ -181,6 +176,21 @@ void __init omap_init_irq(void)
nr_of_irqs, nr_banks, nr_banks > 1 ? "s" : ""); nr_of_irqs, nr_banks, nr_banks > 1 ? "s" : "");
} }
void __init omap2_init_irq(void)
{
omap_init_irq(OMAP24XX_IC_BASE, 96);
}
void __init omap3_init_irq(void)
{
omap_init_irq(OMAP34XX_IC_BASE, 96);
}
void __init ti816x_init_irq(void)
{
omap_init_irq(OMAP34XX_IC_BASE, 128);
}
#ifdef CONFIG_ARCH_OMAP3 #ifdef CONFIG_ARCH_OMAP3
static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)]; static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)];
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#include <asm/hardware/gic.h> #include <asm/hardware/gic.h>
#include <asm/hardware/cache-l2x0.h> #include <asm/hardware/cache-l2x0.h>
#include <plat/irqs.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/omap4-common.h> #include <mach/omap4-common.h>
...@@ -31,17 +33,15 @@ void __iomem *gic_dist_base_addr; ...@@ -31,17 +33,15 @@ void __iomem *gic_dist_base_addr;
void __init gic_init_irq(void) void __init gic_init_irq(void)
{ {
void __iomem *gic_cpu_base;
/* Static mapping, never released */ /* Static mapping, never released */
gic_dist_base_addr = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K); gic_dist_base_addr = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K);
BUG_ON(!gic_dist_base_addr); BUG_ON(!gic_dist_base_addr);
/* Static mapping, never released */ /* Static mapping, never released */
gic_cpu_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512); omap_irq_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512);
BUG_ON(!gic_cpu_base); BUG_ON(!omap_irq_base);
gic_init(0, 29, gic_dist_base_addr, gic_cpu_base); gic_init(0, 29, gic_dist_base_addr, omap_irq_base);
} }
#ifdef CONFIG_CACHE_L2X0 #ifdef CONFIG_CACHE_L2X0
......
...@@ -428,7 +428,11 @@ ...@@ -428,7 +428,11 @@
#define INTCPS_NR_IRQS 96 #define INTCPS_NR_IRQS 96
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern void omap_init_irq(void); extern void __iomem *omap_irq_base;
void omap1_init_irq(void);
void omap2_init_irq(void);
void omap3_init_irq(void);
void ti816x_init_irq(void);
extern int omap_irq_pending(void); extern int omap_irq_pending(void);
void omap_intc_save_context(void); void omap_intc_save_context(void);
void omap_intc_restore_context(void); void omap_intc_restore_context(void);
......
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