aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-omap1/io.c42
-rw-r--r--arch/arm/plat-omap/sram.c9
-rw-r--r--include/asm-arm/arch-omap/io.h6
3 files changed, 39 insertions, 18 deletions
diff --git a/arch/arm/mach-omap1/io.c b/arch/arm/mach-omap1/io.c
index a7a19f75b9e1..82d556be79c5 100644
--- a/arch/arm/mach-omap1/io.c
+++ b/arch/arm/mach-omap1/io.c
@@ -13,6 +13,7 @@
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/init.h> 14#include <linux/init.h>
15 15
16#include <asm/tlb.h>
16#include <asm/mach/map.h> 17#include <asm/mach/map.h>
17#include <asm/io.h> 18#include <asm/io.h>
18#include <asm/arch/mux.h> 19#include <asm/arch/mux.h>
@@ -83,15 +84,24 @@ static struct map_desc omap16xx_io_desc[] __initdata = {
83}; 84};
84#endif 85#endif
85 86
86static int initialized = 0; 87/*
87 88 * Maps common IO regions for omap1. This should only get called from
88static void __init _omap_map_io(void) 89 * board specific init.
90 */
91void __init omap1_map_common_io(void)
89{ 92{
90 initialized = 1;
91
92 /* We have to initialize the IO space mapping before we can run
93 * cpu_is_omapxxx() macros. */
94 iotable_init(omap_io_desc, ARRAY_SIZE(omap_io_desc)); 93 iotable_init(omap_io_desc, ARRAY_SIZE(omap_io_desc));
94
95 /* Normally devicemaps_init() would flush caches and tlb after
96 * mdesc->map_io(), but we must also do it here because of the CPU
97 * revision check below.
98 */
99 local_flush_tlb_all();
100 flush_cache_all();
101
102 /* We want to check CPU revision early for cpu_is_omapxxxx() macros.
103 * IO space mapping must be initialized before we can do that.
104 */
95 omap_check_revision(); 105 omap_check_revision();
96 106
97#ifdef CONFIG_ARCH_OMAP730 107#ifdef CONFIG_ARCH_OMAP730
@@ -111,7 +121,14 @@ static void __init _omap_map_io(void)
111#endif 121#endif
112 122
113 omap_sram_init(); 123 omap_sram_init();
124}
114 125
126/*
127 * Common low-level hardware init for omap1. This should only get called from
128 * board specific init.
129 */
130void __init omap1_init_common_hw()
131{
115 /* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort 132 /* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort
116 * on a Posted Write in the TIPB Bridge". 133 * on a Posted Write in the TIPB Bridge".
117 */ 134 */
@@ -121,16 +138,7 @@ static void __init _omap_map_io(void)
121 /* Must init clocks early to assure that timer interrupt works 138 /* Must init clocks early to assure that timer interrupt works
122 */ 139 */
123 omap1_clk_init(); 140 omap1_clk_init();
124}
125 141
126/* 142 omap1_mux_init();
127 * This should only get called from board specific init
128 */
129void __init omap_map_common_io(void)
130{
131 if (!initialized) {
132 _omap_map_io();
133 omap1_mux_init();
134 }
135} 143}
136 144
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index 792f66375830..ee82763b02b8 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -17,6 +17,7 @@
17#include <linux/init.h> 17#include <linux/init.h>
18 18
19#include <asm/mach/map.h> 19#include <asm/mach/map.h>
20#include <asm/tlb.h>
20#include <asm/io.h> 21#include <asm/io.h>
21#include <asm/cacheflush.h> 22#include <asm/cacheflush.h>
22 23
@@ -96,6 +97,14 @@ void __init omap_map_sram(void)
96 omap_sram_io_desc[0].length); 97 omap_sram_io_desc[0].length);
97 98
98 /* 99 /*
100 * Normally devicemaps_init() would flush caches and tlb after
101 * mdesc->map_io(), but since we're called from map_io(), we
102 * must do it here.
103 */
104 local_flush_tlb_all();
105 flush_cache_all();
106
107 /*
99 * Looks like we need to preserve some bootloader code at the 108 * Looks like we need to preserve some bootloader code at the
100 * beginning of SRAM for jumping to flash for reboot to work... 109 * beginning of SRAM for jumping to flash for reboot to work...
101 */ 110 */
diff --git a/include/asm-arm/arch-omap/io.h b/include/asm-arm/arch-omap/io.h
index f5bcc9a1aed6..b726acfcab14 100644
--- a/include/asm-arm/arch-omap/io.h
+++ b/include/asm-arm/arch-omap/io.h
@@ -116,7 +116,11 @@ typedef struct { volatile u32 offset[4096]; } __regbase32;
116 ->offset[((vaddr)&4095)>>2] 116 ->offset[((vaddr)&4095)>>2]
117#define __REG32(paddr) __REGV32(io_p2v(paddr)) 117#define __REG32(paddr) __REGV32(io_p2v(paddr))
118 118
119extern void omap_map_common_io(void); 119extern void omap1_map_common_io(void);
120extern void omap1_init_common_hw(void);
121
122extern void omap2_map_common_io(void);
123extern void omap2_init_common_hw(void);
120 124
121#else 125#else
122 126