diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/cm.h | 13 | ||||
-rw-r--r-- | arch/arm/mach-omap2/control.c | 24 | ||||
-rw-r--r-- | arch/arm/mach-omap2/memory.c | 11 | ||||
-rw-r--r-- | arch/arm/mach-omap2/mux.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prcm.c | 55 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm.h | 12 | ||||
-rw-r--r-- | arch/arm/mach-omap2/sdrc.h | 10 | ||||
-rw-r--r-- | arch/arm/plat-omap/common.c | 59 |
8 files changed, 131 insertions, 55 deletions
diff --git a/arch/arm/mach-omap2/cm.h b/arch/arm/mach-omap2/cm.h index 8489f3029fed..e2d404e69454 100644 --- a/arch/arm/mach-omap2/cm.h +++ b/arch/arm/mach-omap2/cm.h | |||
@@ -96,15 +96,10 @@ | |||
96 | /* Clock management domain register get/set */ | 96 | /* Clock management domain register get/set */ |
97 | 97 | ||
98 | #ifndef __ASSEMBLER__ | 98 | #ifndef __ASSEMBLER__ |
99 | static inline void cm_write_mod_reg(u32 val, s16 module, s16 idx) | 99 | |
100 | { | 100 | extern u32 cm_read_mod_reg(s16 module, u16 idx); |
101 | __raw_writel(val, OMAP_CM_REGADDR(module, idx)); | 101 | extern void cm_write_mod_reg(u32 val, s16 module, u16 idx); |
102 | } | 102 | |
103 | |||
104 | static inline u32 cm_read_mod_reg(s16 module, s16 idx) | ||
105 | { | ||
106 | return __raw_readl(OMAP_CM_REGADDR(module, idx)); | ||
107 | } | ||
108 | #endif | 103 | #endif |
109 | 104 | ||
110 | /* CM register bits shared between 24XX and 3430 */ | 105 | /* CM register bits shared between 24XX and 3430 */ |
diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c index a5d86a49c213..51f70300996f 100644 --- a/arch/arm/mach-omap2/control.c +++ b/arch/arm/mach-omap2/control.c | |||
@@ -13,22 +13,21 @@ | |||
13 | #undef DEBUG | 13 | #undef DEBUG |
14 | 14 | ||
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/io.h> | ||
16 | 17 | ||
17 | #include <asm/io.h> | 18 | #include <asm/arch/common.h> |
18 | |||
19 | #include <asm/arch/control.h> | 19 | #include <asm/arch/control.h> |
20 | 20 | ||
21 | static u32 omap2_ctrl_base; | 21 | static void __iomem *omap2_ctrl_base; |
22 | 22 | ||
23 | #define OMAP_CTRL_REGADDR(reg) (void __iomem *)IO_ADDRESS(omap2_ctrl_base \ | 23 | #define OMAP_CTRL_REGADDR(reg) (omap2_ctrl_base + (reg)) |
24 | + (reg)) | ||
25 | 24 | ||
26 | void omap_ctrl_base_set(u32 base) | 25 | void __init omap2_set_globals_control(struct omap_globals *omap2_globals) |
27 | { | 26 | { |
28 | omap2_ctrl_base = base; | 27 | omap2_ctrl_base = omap2_globals->ctrl; |
29 | } | 28 | } |
30 | 29 | ||
31 | u32 omap_ctrl_base_get(void) | 30 | void __iomem *omap_ctrl_base_get(void) |
32 | { | 31 | { |
33 | return omap2_ctrl_base; | 32 | return omap2_ctrl_base; |
34 | } | 33 | } |
@@ -50,25 +49,16 @@ u32 omap_ctrl_readl(u16 offset) | |||
50 | 49 | ||
51 | void omap_ctrl_writeb(u8 val, u16 offset) | 50 | void omap_ctrl_writeb(u8 val, u16 offset) |
52 | { | 51 | { |
53 | pr_debug("omap_ctrl_writeb: writing 0x%0x to 0x%0x\n", val, | ||
54 | (u32)OMAP_CTRL_REGADDR(offset)); | ||
55 | |||
56 | __raw_writeb(val, OMAP_CTRL_REGADDR(offset)); | 52 | __raw_writeb(val, OMAP_CTRL_REGADDR(offset)); |
57 | } | 53 | } |
58 | 54 | ||
59 | void omap_ctrl_writew(u16 val, u16 offset) | 55 | void omap_ctrl_writew(u16 val, u16 offset) |
60 | { | 56 | { |
61 | pr_debug("omap_ctrl_writew: writing 0x%0x to 0x%0x\n", val, | ||
62 | (u32)OMAP_CTRL_REGADDR(offset)); | ||
63 | |||
64 | __raw_writew(val, OMAP_CTRL_REGADDR(offset)); | 57 | __raw_writew(val, OMAP_CTRL_REGADDR(offset)); |
65 | } | 58 | } |
66 | 59 | ||
67 | void omap_ctrl_writel(u32 val, u16 offset) | 60 | void omap_ctrl_writel(u32 val, u16 offset) |
68 | { | 61 | { |
69 | pr_debug("omap_ctrl_writel: writing 0x%0x to 0x%0x\n", val, | ||
70 | (u32)OMAP_CTRL_REGADDR(offset)); | ||
71 | |||
72 | __raw_writel(val, OMAP_CTRL_REGADDR(offset)); | 62 | __raw_writel(val, OMAP_CTRL_REGADDR(offset)); |
73 | } | 63 | } |
74 | 64 | ||
diff --git a/arch/arm/mach-omap2/memory.c b/arch/arm/mach-omap2/memory.c index 12479081881a..73cadb2c75cf 100644 --- a/arch/arm/mach-omap2/memory.c +++ b/arch/arm/mach-omap2/memory.c | |||
@@ -24,6 +24,7 @@ | |||
24 | 24 | ||
25 | #include <asm/io.h> | 25 | #include <asm/io.h> |
26 | 26 | ||
27 | #include <asm/arch/common.h> | ||
27 | #include <asm/arch/clock.h> | 28 | #include <asm/arch/clock.h> |
28 | #include <asm/arch/sram.h> | 29 | #include <asm/arch/sram.h> |
29 | 30 | ||
@@ -32,8 +33,8 @@ | |||
32 | #include "memory.h" | 33 | #include "memory.h" |
33 | #include "sdrc.h" | 34 | #include "sdrc.h" |
34 | 35 | ||
35 | unsigned long omap2_sdrc_base; | 36 | void __iomem *omap2_sdrc_base; |
36 | unsigned long omap2_sms_base; | 37 | void __iomem *omap2_sms_base; |
37 | 38 | ||
38 | static struct memory_timings mem_timings; | 39 | static struct memory_timings mem_timings; |
39 | static u32 curr_perf_level = CORE_CLK_SRC_DPLL_X2; | 40 | static u32 curr_perf_level = CORE_CLK_SRC_DPLL_X2; |
@@ -154,6 +155,12 @@ void omap2_init_memory_params(u32 force_lock_to_unlock_mode) | |||
154 | mem_timings.slow_dll_ctrl |= ((1 << 1) | (3 << 8)); | 155 | mem_timings.slow_dll_ctrl |= ((1 << 1) | (3 << 8)); |
155 | } | 156 | } |
156 | 157 | ||
158 | void __init omap2_set_globals_memory(struct omap_globals *omap2_globals) | ||
159 | { | ||
160 | omap2_sdrc_base = omap2_globals->sdrc; | ||
161 | omap2_sms_base = omap2_globals->sms; | ||
162 | } | ||
163 | |||
157 | /* turn on smart idle modes for SDRAM scheduler and controller */ | 164 | /* turn on smart idle modes for SDRAM scheduler and controller */ |
158 | void __init omap2_init_memory(void) | 165 | void __init omap2_init_memory(void) |
159 | { | 166 | { |
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index 930770012a75..8f98b20f30a1 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c | |||
@@ -236,7 +236,7 @@ void __init_or_module omap2_cfg_debug(const struct pin_config *cfg, u8 reg) | |||
236 | warn = (orig != reg); | 236 | warn = (orig != reg); |
237 | if (debug || warn) | 237 | if (debug || warn) |
238 | printk(KERN_WARNING | 238 | printk(KERN_WARNING |
239 | "MUX: setup %s (0x%08x): 0x%02x -> 0x%02x\n", | 239 | "MUX: setup %s (0x%p): 0x%04x -> 0x%04x\n", |
240 | cfg->name, omap_ctrl_base_get() + cfg->mux_reg, | 240 | cfg->name, omap_ctrl_base_get() + cfg->mux_reg, |
241 | orig, reg); | 241 | orig, reg); |
242 | } | 242 | } |
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c index b12f423b8595..9584376d055a 100644 --- a/arch/arm/mach-omap2/prcm.c +++ b/arch/arm/mach-omap2/prcm.c | |||
@@ -16,12 +16,18 @@ | |||
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/clk.h> | 18 | #include <linux/clk.h> |
19 | #include <linux/io.h> | ||
19 | 20 | ||
20 | #include <asm/io.h> | 21 | #include <asm/arch/common.h> |
22 | #include <asm/arch/prcm.h> | ||
21 | 23 | ||
24 | #include "clock.h" | ||
22 | #include "prm.h" | 25 | #include "prm.h" |
23 | #include "prm-regbits-24xx.h" | 26 | #include "prm-regbits-24xx.h" |
24 | 27 | ||
28 | static void __iomem *prm_base; | ||
29 | static void __iomem *cm_base; | ||
30 | |||
25 | extern void omap2_clk_prepare_for_reboot(void); | 31 | extern void omap2_clk_prepare_for_reboot(void); |
26 | 32 | ||
27 | u32 omap_prcm_get_reset_sources(void) | 33 | u32 omap_prcm_get_reset_sources(void) |
@@ -41,3 +47,50 @@ void omap_prcm_arch_reset(char mode) | |||
41 | prm_write_mod_reg(wkup, WKUP_MOD, RM_RSTCTRL); | 47 | prm_write_mod_reg(wkup, WKUP_MOD, RM_RSTCTRL); |
42 | } | 48 | } |
43 | } | 49 | } |
50 | |||
51 | static inline u32 __omap_prcm_read(void __iomem *base, s16 module, u16 reg) | ||
52 | { | ||
53 | BUG_ON(!base); | ||
54 | return __raw_readl(base + module + reg); | ||
55 | } | ||
56 | |||
57 | static inline void __omap_prcm_write(u32 value, void __iomem *base, | ||
58 | s16 module, u16 reg) | ||
59 | { | ||
60 | BUG_ON(!base); | ||
61 | __raw_writel(value, base + module + reg); | ||
62 | } | ||
63 | |||
64 | /* Read a register in a PRM module */ | ||
65 | u32 prm_read_mod_reg(s16 module, u16 idx) | ||
66 | { | ||
67 | return __omap_prcm_read(prm_base, module, idx); | ||
68 | } | ||
69 | EXPORT_SYMBOL(prm_read_mod_reg); | ||
70 | |||
71 | /* Write into a register in a PRM module */ | ||
72 | void prm_write_mod_reg(u32 val, s16 module, u16 idx) | ||
73 | { | ||
74 | __omap_prcm_write(val, prm_base, module, idx); | ||
75 | } | ||
76 | EXPORT_SYMBOL(prm_write_mod_reg); | ||
77 | |||
78 | /* Read a register in a CM module */ | ||
79 | u32 cm_read_mod_reg(s16 module, u16 idx) | ||
80 | { | ||
81 | return __omap_prcm_read(cm_base, module, idx); | ||
82 | } | ||
83 | EXPORT_SYMBOL(cm_read_mod_reg); | ||
84 | |||
85 | /* Write into a register in a CM module */ | ||
86 | void cm_write_mod_reg(u32 val, s16 module, u16 idx) | ||
87 | { | ||
88 | __omap_prcm_write(val, cm_base, module, idx); | ||
89 | } | ||
90 | EXPORT_SYMBOL(cm_write_mod_reg); | ||
91 | |||
92 | void __init omap2_set_globals_prcm(struct omap_globals *omap2_globals) | ||
93 | { | ||
94 | prm_base = omap2_globals->prm; | ||
95 | cm_base = omap2_globals->cm; | ||
96 | } | ||
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h index dcdb35bfa0c0..e901fb99b237 100644 --- a/arch/arm/mach-omap2/prm.h +++ b/arch/arm/mach-omap2/prm.h | |||
@@ -166,16 +166,8 @@ | |||
166 | #ifndef __ASSEMBLER__ | 166 | #ifndef __ASSEMBLER__ |
167 | 167 | ||
168 | /* Power/reset management domain register get/set */ | 168 | /* Power/reset management domain register get/set */ |
169 | 169 | extern u32 prm_read_mod_reg(s16 module, u16 idx); | |
170 | static inline void prm_write_mod_reg(u32 val, s16 module, s16 idx) | 170 | extern void prm_write_mod_reg(u32 val, s16 module, u16 idx); |
171 | { | ||
172 | __raw_writel(val, OMAP_PRM_REGADDR(module, idx)); | ||
173 | } | ||
174 | |||
175 | static inline u32 prm_read_mod_reg(s16 module, s16 idx) | ||
176 | { | ||
177 | return __raw_readl(OMAP_PRM_REGADDR(module, idx)); | ||
178 | } | ||
179 | 171 | ||
180 | #endif | 172 | #endif |
181 | 173 | ||
diff --git a/arch/arm/mach-omap2/sdrc.h b/arch/arm/mach-omap2/sdrc.h index d7f23bc9550a..1b1fe4f6e030 100644 --- a/arch/arm/mach-omap2/sdrc.h +++ b/arch/arm/mach-omap2/sdrc.h | |||
@@ -18,13 +18,11 @@ | |||
18 | #include <asm/arch/sdrc.h> | 18 | #include <asm/arch/sdrc.h> |
19 | 19 | ||
20 | #ifndef __ASSEMBLER__ | 20 | #ifndef __ASSEMBLER__ |
21 | extern unsigned long omap2_sdrc_base; | 21 | extern void __iomem *omap2_sdrc_base; |
22 | extern unsigned long omap2_sms_base; | 22 | extern void __iomem *omap2_sms_base; |
23 | 23 | ||
24 | #define OMAP_SDRC_REGADDR(reg) \ | 24 | #define OMAP_SDRC_REGADDR(reg) (omap2_sdrc_base + (reg)) |
25 | (void __iomem *)IO_ADDRESS(omap2_sdrc_base + (reg)) | 25 | #define OMAP_SMS_REGADDR(reg) (omap2_sms_base + (reg)) |
26 | #define OMAP_SMS_REGADDR(reg) \ | ||
27 | (void __iomem *)IO_ADDRESS(omap2_sms_base + (reg)) | ||
28 | 26 | ||
29 | /* SDRC global register get/set */ | 27 | /* SDRC global register get/set */ |
30 | 28 | ||
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c index bd1cef2c3c14..8d04929a3c75 100644 --- a/arch/arm/plat-omap/common.c +++ b/arch/arm/plat-omap/common.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <asm/io.h> | 26 | #include <asm/io.h> |
27 | #include <asm/setup.h> | 27 | #include <asm/setup.h> |
28 | 28 | ||
29 | #include <asm/arch/common.h> | ||
29 | #include <asm/arch/board.h> | 30 | #include <asm/arch/board.h> |
30 | #include <asm/arch/control.h> | 31 | #include <asm/arch/control.h> |
31 | #include <asm/arch/mux.h> | 32 | #include <asm/arch/mux.h> |
@@ -241,30 +242,70 @@ arch_initcall(omap_init_clocksource_32k); | |||
241 | 242 | ||
242 | /* Global address base setup code */ | 243 | /* Global address base setup code */ |
243 | 244 | ||
245 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) | ||
246 | |||
247 | static struct omap_globals *omap2_globals; | ||
248 | |||
249 | static void __init __omap2_set_globals(void) | ||
250 | { | ||
251 | omap2_set_globals_memory(omap2_globals); | ||
252 | omap2_set_globals_control(omap2_globals); | ||
253 | omap2_set_globals_prcm(omap2_globals); | ||
254 | } | ||
255 | |||
256 | #endif | ||
257 | |||
244 | #if defined(CONFIG_ARCH_OMAP2420) | 258 | #if defined(CONFIG_ARCH_OMAP2420) |
259 | |||
260 | static struct omap_globals omap242x_globals = { | ||
261 | .tap = (__force void __iomem *)OMAP2_IO_ADDRESS(0x48014000), | ||
262 | .sdrc = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP2420_SDRC_BASE), | ||
263 | .sms = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP2420_SMS_BASE), | ||
264 | .ctrl = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP2420_CTRL_BASE), | ||
265 | .prm = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP2420_PRM_BASE), | ||
266 | .cm = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP2420_CM_BASE), | ||
267 | }; | ||
268 | |||
245 | void __init omap2_set_globals_242x(void) | 269 | void __init omap2_set_globals_242x(void) |
246 | { | 270 | { |
247 | omap2_sdrc_base = OMAP2420_SDRC_BASE; | 271 | omap2_globals = &omap242x_globals; |
248 | omap2_sms_base = OMAP2420_SMS_BASE; | 272 | __omap2_set_globals(); |
249 | omap_ctrl_base_set(OMAP2420_CTRL_BASE); | ||
250 | } | 273 | } |
251 | #endif | 274 | #endif |
252 | 275 | ||
253 | #if defined(CONFIG_ARCH_OMAP2430) | 276 | #if defined(CONFIG_ARCH_OMAP2430) |
277 | |||
278 | static struct omap_globals omap243x_globals = { | ||
279 | .tap = (__force void __iomem *)OMAP2_IO_ADDRESS(0x4900a000), | ||
280 | .sdrc = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP243X_SDRC_BASE), | ||
281 | .sms = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP243X_SMS_BASE), | ||
282 | .ctrl = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP243X_CTRL_BASE), | ||
283 | .prm = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP2430_PRM_BASE), | ||
284 | .cm = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP2430_CM_BASE), | ||
285 | }; | ||
286 | |||
254 | void __init omap2_set_globals_243x(void) | 287 | void __init omap2_set_globals_243x(void) |
255 | { | 288 | { |
256 | omap2_sdrc_base = OMAP243X_SDRC_BASE; | 289 | omap2_globals = &omap243x_globals; |
257 | omap2_sms_base = OMAP243X_SMS_BASE; | 290 | __omap2_set_globals(); |
258 | omap_ctrl_base_set(OMAP243X_CTRL_BASE); | ||
259 | } | 291 | } |
260 | #endif | 292 | #endif |
261 | 293 | ||
262 | #if defined(CONFIG_ARCH_OMAP3430) | 294 | #if defined(CONFIG_ARCH_OMAP3430) |
295 | |||
296 | static struct omap_globals omap343x_globals = { | ||
297 | .tap = (__force void __iomem *)OMAP2_IO_ADDRESS(0x4830A000), | ||
298 | .sdrc = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE), | ||
299 | .sms = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE), | ||
300 | .ctrl = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE), | ||
301 | .prm = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE), | ||
302 | .cm = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP3430_CM_BASE), | ||
303 | }; | ||
304 | |||
263 | void __init omap2_set_globals_343x(void) | 305 | void __init omap2_set_globals_343x(void) |
264 | { | 306 | { |
265 | omap2_sdrc_base = OMAP343X_SDRC_BASE; | 307 | omap2_globals = &omap343x_globals; |
266 | omap2_sms_base = OMAP343X_SMS_BASE; | 308 | __omap2_set_globals(); |
267 | omap_ctrl_base_set(OMAP343X_CTRL_BASE); | ||
268 | } | 309 | } |
269 | #endif | 310 | #endif |
270 | 311 | ||