diff options
author | R Sricharan <r.sricharan@ti.com> | 2012-07-04 07:04:00 -0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2012-07-04 07:04:00 -0400 |
commit | 3f4990f44a5dcf15a053a041c813fa73ffa75608 (patch) | |
tree | e6d09bdbfe81d5fe379e8fb755ec899a1e220d2c | |
parent | bed9d1bb4ed8c9bdaca77d31a2562c3a9dae43a7 (diff) |
ARM: OMAP2+: PRM/CM: Move the stubbed prm and cm functions to prcm.c file and make them __weak
Some prm and cm registers read/write and status functions
are built only for some custom OMAP2+ builds and are stubbed
in header files for other builds under ifdef statements.
But this results in adding new CONFIG_ARCH_OMAPXXX
checks when SOCs are added in the future. So move them
to a common place for OMAP2+ and make them 'weak' implementations.
This way no new ifdefs would be required in the future and also
cleans up the existing code.
Signed-off-by: R Sricharan <r.sricharan@ti.com>
[paul@pwsan.com: unsplit quoted strings; moved PRM functions to
mach-omap2/prm_common.c; resolved sparse warnings]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
-rw-r--r-- | arch/arm/mach-omap2/cminst44xx.h | 25 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prcm.c | 23 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm2xxx_3xxx.h | 65 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm_common.c | 62 |
4 files changed, 85 insertions, 90 deletions
diff --git a/arch/arm/mach-omap2/cminst44xx.h b/arch/arm/mach-omap2/cminst44xx.h index a018a7327879..d69fdefef985 100644 --- a/arch/arm/mach-omap2/cminst44xx.h +++ b/arch/arm/mach-omap2/cminst44xx.h | |||
@@ -16,38 +16,13 @@ extern void omap4_cminst_clkdm_enable_hwsup(u8 part, s16 inst, u16 cdoffs); | |||
16 | extern void omap4_cminst_clkdm_disable_hwsup(u8 part, s16 inst, u16 cdoffs); | 16 | extern void omap4_cminst_clkdm_disable_hwsup(u8 part, s16 inst, u16 cdoffs); |
17 | extern void omap4_cminst_clkdm_force_sleep(u8 part, s16 inst, u16 cdoffs); | 17 | extern void omap4_cminst_clkdm_force_sleep(u8 part, s16 inst, u16 cdoffs); |
18 | extern void omap4_cminst_clkdm_force_wakeup(u8 part, s16 inst, u16 cdoffs); | 18 | extern void omap4_cminst_clkdm_force_wakeup(u8 part, s16 inst, u16 cdoffs); |
19 | |||
20 | extern int omap4_cminst_wait_module_ready(u8 part, u16 inst, s16 cdoffs, u16 clkctrl_offs); | 19 | extern int omap4_cminst_wait_module_ready(u8 part, u16 inst, s16 cdoffs, u16 clkctrl_offs); |
21 | |||
22 | # ifdef CONFIG_ARCH_OMAP4 | ||
23 | extern int omap4_cminst_wait_module_idle(u8 part, u16 inst, s16 cdoffs, | 20 | extern int omap4_cminst_wait_module_idle(u8 part, u16 inst, s16 cdoffs, |
24 | u16 clkctrl_offs); | 21 | u16 clkctrl_offs); |
25 | |||
26 | extern void omap4_cminst_module_enable(u8 mode, u8 part, u16 inst, s16 cdoffs, | 22 | extern void omap4_cminst_module_enable(u8 mode, u8 part, u16 inst, s16 cdoffs, |
27 | u16 clkctrl_offs); | 23 | u16 clkctrl_offs); |
28 | extern void omap4_cminst_module_disable(u8 part, u16 inst, s16 cdoffs, | 24 | extern void omap4_cminst_module_disable(u8 part, u16 inst, s16 cdoffs, |
29 | u16 clkctrl_offs); | 25 | u16 clkctrl_offs); |
30 | |||
31 | # else | ||
32 | |||
33 | static inline int omap4_cminst_wait_module_idle(u8 part, u16 inst, s16 cdoffs, | ||
34 | u16 clkctrl_offs) | ||
35 | { | ||
36 | return 0; | ||
37 | } | ||
38 | |||
39 | static inline void omap4_cminst_module_enable(u8 mode, u8 part, u16 inst, | ||
40 | s16 cdoffs, u16 clkctrl_offs) | ||
41 | { | ||
42 | } | ||
43 | |||
44 | static inline void omap4_cminst_module_disable(u8 part, u16 inst, s16 cdoffs, | ||
45 | u16 clkctrl_offs) | ||
46 | { | ||
47 | } | ||
48 | |||
49 | # endif | ||
50 | |||
51 | /* | 26 | /* |
52 | * In an ideal world, we would not export these low-level functions, | 27 | * In an ideal world, we would not export these low-level functions, |
53 | * but this will probably take some time to fix properly | 28 | * but this will probably take some time to fix properly |
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c index 480f40a5ee42..28cbfb2b5733 100644 --- a/arch/arm/mach-omap2/prcm.c +++ b/arch/arm/mach-omap2/prcm.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include "prm2xxx_3xxx.h" | 35 | #include "prm2xxx_3xxx.h" |
36 | #include "prm44xx.h" | 36 | #include "prm44xx.h" |
37 | #include "prminst44xx.h" | 37 | #include "prminst44xx.h" |
38 | #include "cminst44xx.h" | ||
38 | #include "prm-regbits-24xx.h" | 39 | #include "prm-regbits-24xx.h" |
39 | #include "prm-regbits-44xx.h" | 40 | #include "prm-regbits-44xx.h" |
40 | #include "control.h" | 41 | #include "control.h" |
@@ -164,3 +165,25 @@ void __init omap2_set_globals_prcm(struct omap_globals *omap2_globals) | |||
164 | omap_cm_base_init(); | 165 | omap_cm_base_init(); |
165 | } | 166 | } |
166 | } | 167 | } |
168 | |||
169 | /* | ||
170 | * Stubbed functions so that common files continue to build when | ||
171 | * custom builds are used | ||
172 | * XXX These are temporary and should be removed at the earliest possible | ||
173 | * opportunity | ||
174 | */ | ||
175 | int __weak omap4_cminst_wait_module_idle(u8 part, u16 inst, s16 cdoffs, | ||
176 | u16 clkctrl_offs) | ||
177 | { | ||
178 | return 0; | ||
179 | } | ||
180 | |||
181 | void __weak omap4_cminst_module_enable(u8 mode, u8 part, u16 inst, | ||
182 | s16 cdoffs, u16 clkctrl_offs) | ||
183 | { | ||
184 | } | ||
185 | |||
186 | void __weak omap4_cminst_module_disable(u8 part, u16 inst, s16 cdoffs, | ||
187 | u16 clkctrl_offs) | ||
188 | { | ||
189 | } | ||
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.h b/arch/arm/mach-omap2/prm2xxx_3xxx.h index 70ac2a19dc5f..f7bb57fff416 100644 --- a/arch/arm/mach-omap2/prm2xxx_3xxx.h +++ b/arch/arm/mach-omap2/prm2xxx_3xxx.h | |||
@@ -228,68 +228,6 @@ | |||
228 | 228 | ||
229 | 229 | ||
230 | #ifndef __ASSEMBLER__ | 230 | #ifndef __ASSEMBLER__ |
231 | /* | ||
232 | * Stub omap2xxx/omap3xxx functions so that common files | ||
233 | * continue to build when custom builds are used | ||
234 | */ | ||
235 | #if defined(CONFIG_ARCH_OMAP4) && !(defined(CONFIG_ARCH_OMAP2) || \ | ||
236 | defined(CONFIG_ARCH_OMAP3)) | ||
237 | static inline u32 omap2_prm_read_mod_reg(s16 module, u16 idx) | ||
238 | { | ||
239 | WARN(1, "prm: omap2xxx/omap3xxx specific function and " | ||
240 | "not suppose to be used on omap4\n"); | ||
241 | return 0; | ||
242 | } | ||
243 | static inline void omap2_prm_write_mod_reg(u32 val, s16 module, u16 idx) | ||
244 | { | ||
245 | WARN(1, "prm: omap2xxx/omap3xxx specific function and " | ||
246 | "not suppose to be used on omap4\n"); | ||
247 | } | ||
248 | static inline u32 omap2_prm_rmw_mod_reg_bits(u32 mask, u32 bits, | ||
249 | s16 module, s16 idx) | ||
250 | { | ||
251 | WARN(1, "prm: omap2xxx/omap3xxx specific function and " | ||
252 | "not suppose to be used on omap4\n"); | ||
253 | return 0; | ||
254 | } | ||
255 | static inline u32 omap2_prm_set_mod_reg_bits(u32 bits, s16 module, s16 idx) | ||
256 | { | ||
257 | WARN(1, "prm: omap2xxx/omap3xxx specific function and " | ||
258 | "not suppose to be used on omap4\n"); | ||
259 | return 0; | ||
260 | } | ||
261 | static inline u32 omap2_prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx) | ||
262 | { | ||
263 | WARN(1, "prm: omap2xxx/omap3xxx specific function and " | ||
264 | "not suppose to be used on omap4\n"); | ||
265 | return 0; | ||
266 | } | ||
267 | static inline u32 omap2_prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask) | ||
268 | { | ||
269 | WARN(1, "prm: omap2xxx/omap3xxx specific function and " | ||
270 | "not suppose to be used on omap4\n"); | ||
271 | return 0; | ||
272 | } | ||
273 | static inline int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift) | ||
274 | { | ||
275 | WARN(1, "prm: omap2xxx/omap3xxx specific function and " | ||
276 | "not suppose to be used on omap4\n"); | ||
277 | return 0; | ||
278 | } | ||
279 | static inline int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift) | ||
280 | { | ||
281 | WARN(1, "prm: omap2xxx/omap3xxx specific function and " | ||
282 | "not suppose to be used on omap4\n"); | ||
283 | return 0; | ||
284 | } | ||
285 | static inline int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, | ||
286 | u8 st_shift) | ||
287 | { | ||
288 | WARN(1, "prm: omap2xxx/omap3xxx specific function and " | ||
289 | "not suppose to be used on omap4\n"); | ||
290 | return 0; | ||
291 | } | ||
292 | #else | ||
293 | /* Power/reset management domain register get/set */ | 231 | /* Power/reset management domain register get/set */ |
294 | extern u32 omap2_prm_read_mod_reg(s16 module, u16 idx); | 232 | extern u32 omap2_prm_read_mod_reg(s16 module, u16 idx); |
295 | extern void omap2_prm_write_mod_reg(u32 val, s16 module, u16 idx); | 233 | extern void omap2_prm_write_mod_reg(u32 val, s16 module, u16 idx); |
@@ -320,9 +258,6 @@ extern void omap3xxx_prm_read_pending_irqs(unsigned long *events); | |||
320 | extern void omap3xxx_prm_ocp_barrier(void); | 258 | extern void omap3xxx_prm_ocp_barrier(void); |
321 | extern void omap3xxx_prm_save_and_clear_irqen(u32 *saved_mask); | 259 | extern void omap3xxx_prm_save_and_clear_irqen(u32 *saved_mask); |
322 | extern void omap3xxx_prm_restore_irqen(u32 *saved_mask); | 260 | extern void omap3xxx_prm_restore_irqen(u32 *saved_mask); |
323 | |||
324 | #endif /* CONFIG_ARCH_OMAP4 */ | ||
325 | |||
326 | #endif | 261 | #endif |
327 | 262 | ||
328 | /* | 263 | /* |
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c index dfe00ddb5c60..663ade3b2f45 100644 --- a/arch/arm/mach-omap2/prm_common.c +++ b/arch/arm/mach-omap2/prm_common.c | |||
@@ -319,3 +319,65 @@ err: | |||
319 | omap_prcm_irq_cleanup(); | 319 | omap_prcm_irq_cleanup(); |
320 | return -ENOMEM; | 320 | return -ENOMEM; |
321 | } | 321 | } |
322 | |||
323 | /* | ||
324 | * Stubbed functions so that common files continue to build when | ||
325 | * custom builds are used | ||
326 | * XXX These are temporary and should be removed at the earliest possible | ||
327 | * opportunity | ||
328 | */ | ||
329 | u32 __weak omap2_prm_read_mod_reg(s16 module, u16 idx) | ||
330 | { | ||
331 | WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); | ||
332 | return 0; | ||
333 | } | ||
334 | |||
335 | void __weak omap2_prm_write_mod_reg(u32 val, s16 module, u16 idx) | ||
336 | { | ||
337 | WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); | ||
338 | } | ||
339 | |||
340 | u32 __weak omap2_prm_rmw_mod_reg_bits(u32 mask, u32 bits, | ||
341 | s16 module, s16 idx) | ||
342 | { | ||
343 | WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); | ||
344 | return 0; | ||
345 | } | ||
346 | |||
347 | u32 __weak omap2_prm_set_mod_reg_bits(u32 bits, s16 module, s16 idx) | ||
348 | { | ||
349 | WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); | ||
350 | return 0; | ||
351 | } | ||
352 | |||
353 | u32 __weak omap2_prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx) | ||
354 | { | ||
355 | WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); | ||
356 | return 0; | ||
357 | } | ||
358 | |||
359 | u32 __weak omap2_prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask) | ||
360 | { | ||
361 | WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); | ||
362 | return 0; | ||
363 | } | ||
364 | |||
365 | int __weak omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift) | ||
366 | { | ||
367 | WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); | ||
368 | return 0; | ||
369 | } | ||
370 | |||
371 | int __weak omap2_prm_assert_hardreset(s16 prm_mod, u8 shift) | ||
372 | { | ||
373 | WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); | ||
374 | return 0; | ||
375 | } | ||
376 | |||
377 | int __weak omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, | ||
378 | u8 st_shift) | ||
379 | { | ||
380 | WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); | ||
381 | return 0; | ||
382 | } | ||
383 | |||