From c588f7204559cf2475251b1b87d43543e0811db7 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Wed, 4 Jan 2006 17:16:27 -0800 Subject: [PATCH] ARM: OMAP: Clean-up omap2 low-level io init and ensure cache & tlb flushing Clean-up omap2 low-level io init and ensure cache & tlb flushing --- arch/arm/mach-omap2/board-generic.c | 3 ++- arch/arm/mach-omap2/board-h4.c | 3 ++- arch/arm/mach-omap2/io.c | 19 +++++++++++++++++-- include/asm-arm/arch-omap/io.h | 3 +++ 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index c602e7a3d93..dd2377e36a8 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c @@ -33,6 +33,7 @@ static void __init omap_generic_init_irq(void) { + omap2_init_common_hw(); omap_init_irq(); } @@ -64,7 +65,7 @@ static void __init omap_generic_init(void) static void __init omap_generic_map_io(void) { - omap_map_common_io(); + omap2_map_common_io(); } MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx") diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index 6a5e88dd2c6..19b498d7002 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c @@ -136,6 +136,7 @@ static inline void __init h4_init_smc91x(void) static void __init omap_h4_init_irq(void) { + omap2_init_common_hw(); omap_init_irq(); omap_gpio_init(); h4_init_smc91x(); @@ -181,7 +182,7 @@ static void __init omap_h4_init(void) static void __init omap_h4_map_io(void) { - omap_map_common_io(); + omap2_map_common_io(); } MACHINE_START(OMAP_H4, "OMAP2420 H4 board") diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 8ea67bf196a..cfe155e7503 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c @@ -16,8 +16,11 @@ #include #include -#include +#include #include + +#include + #include extern void omap_sram_init(void); @@ -43,11 +46,23 @@ static struct map_desc omap2_io_desc[] __initdata = { } }; -void __init omap_map_common_io(void) +void __init omap2_map_common_io(void) { iotable_init(omap2_io_desc, ARRAY_SIZE(omap2_io_desc)); + + /* Normally devicemaps_init() would flush caches and tlb after + * mdesc->map_io(), but we must also do it here because of the CPU + * revision check below. + */ + local_flush_tlb_all(); + flush_cache_all(); + omap2_check_revision(); omap_sram_init(); +} + +void __init omap2_init_common_hw(void) +{ omap2_mux_init(); omap2_clk_init(); } diff --git a/include/asm-arm/arch-omap/io.h b/include/asm-arm/arch-omap/io.h index 929efab5879..b726acfcab1 100644 --- a/include/asm-arm/arch-omap/io.h +++ b/include/asm-arm/arch-omap/io.h @@ -119,6 +119,9 @@ typedef struct { volatile u32 offset[4096]; } __regbase32; extern void omap1_map_common_io(void); extern void omap1_init_common_hw(void); +extern void omap2_map_common_io(void); +extern void omap2_init_common_hw(void); + #else #define __REG8(paddr) io_p2v(paddr) -- 2.41.1