diff options
author | Robert Jarzmik <robert.jarzmik@free.fr> | 2014-09-28 07:59:41 -0400 |
---|---|---|
committer | Robert Jarzmik <robert.jarzmik@free.fr> | 2014-11-19 17:53:14 -0500 |
commit | 4508f7751728980873c0368dedb298fc6f550b50 (patch) | |
tree | f042c810e94b09fc8616d8f0cb40988eebf12278 | |
parent | ef6dbda600ecf037c539c7f4c7f8fe93fb66ef3e (diff) |
arm: pxa: move init functions into generic.h
In order to have a unique .c file for all pxa variants device-tree
definitions, all the initialization functions for MACHINE_START and
DT_MACHINE_START have been put together into generic.h.
The alternative would have been one pxaXXX-dt.c file per variant.
The move is necessary because each include/mach/pxaXXX.h includes the
variant register descriptions which intersects and conflicts one with
each other.
The change is a preparation for pxa-dt.c to support multiple pxa,
ie. pxa3xx and pxa27x.
The machine files including mach/pxaXXX.h all include generic.h, which
guarantees no regression should be introduced.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r-- | arch/arm/mach-pxa/generic.h | 65 | ||||
-rw-r--r-- | arch/arm/mach-pxa/include/mach/pxa25x.h | 8 | ||||
-rw-r--r-- | arch/arm/mach-pxa/include/mach/pxa27x.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-pxa/include/mach/pxa3xx.h | 5 |
4 files changed, 42 insertions, 40 deletions
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h index 8963984d1f43..7a9fa1aa4e41 100644 --- a/arch/arm/mach-pxa/generic.h +++ b/arch/arm/mach-pxa/generic.h | |||
@@ -13,11 +13,11 @@ | |||
13 | 13 | ||
14 | struct irq_data; | 14 | struct irq_data; |
15 | 15 | ||
16 | extern void pxa_timer_init(void); | ||
17 | |||
18 | extern void __init pxa_map_io(void); | ||
19 | |||
20 | extern unsigned int get_clk_frequency_khz(int info); | 16 | extern unsigned int get_clk_frequency_khz(int info); |
17 | extern void __init pxa_dt_irq_init(int (*fn)(struct irq_data *, | ||
18 | unsigned int)); | ||
19 | extern void __init pxa_map_io(void); | ||
20 | extern void pxa_timer_init(void); | ||
21 | 21 | ||
22 | #define SET_BANK(__nr,__start,__size) \ | 22 | #define SET_BANK(__nr,__start,__size) \ |
23 | mi->bank[__nr].start = (__start), \ | 23 | mi->bank[__nr].start = (__start), \ |
@@ -25,6 +25,43 @@ extern unsigned int get_clk_frequency_khz(int info); | |||
25 | 25 | ||
26 | #define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) | 26 | #define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) |
27 | 27 | ||
28 | #define pxa25x_handle_irq icip_handle_irq | ||
29 | extern void __init pxa25x_init_irq(void); | ||
30 | extern void __init pxa25x_map_io(void); | ||
31 | extern void __init pxa26x_init_irq(void); | ||
32 | |||
33 | #define pxa27x_handle_irq ichp_handle_irq | ||
34 | extern void __init pxa27x_dt_init_irq(void); | ||
35 | extern unsigned pxa27x_get_clk_frequency_khz(int); | ||
36 | extern void __init pxa27x_init_irq(void); | ||
37 | extern void __init pxa27x_map_io(void); | ||
38 | |||
39 | #define pxa3xx_handle_irq ichp_handle_irq | ||
40 | extern void __init pxa3xx_dt_init_irq(void); | ||
41 | extern void __init pxa3xx_init_irq(void); | ||
42 | extern void __init pxa3xx_map_io(void); | ||
43 | |||
44 | extern struct syscore_ops pxa_irq_syscore_ops; | ||
45 | extern struct syscore_ops pxa2xx_mfp_syscore_ops; | ||
46 | extern struct syscore_ops pxa3xx_mfp_syscore_ops; | ||
47 | |||
48 | void __init pxa_set_ffuart_info(void *info); | ||
49 | void __init pxa_set_btuart_info(void *info); | ||
50 | void __init pxa_set_stuart_info(void *info); | ||
51 | void __init pxa_set_hwuart_info(void *info); | ||
52 | |||
53 | void pxa_restart(enum reboot_mode, const char *); | ||
54 | |||
55 | #if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) | ||
56 | extern void pxa2xx_clear_reset_status(unsigned int); | ||
57 | #else | ||
58 | static inline void pxa2xx_clear_reset_status(unsigned int mask) {} | ||
59 | #endif | ||
60 | |||
61 | /* | ||
62 | * Once fully converted to the clock framework, all these functions should be | ||
63 | * removed, and replaced with a clk_get(NULL, "core"). | ||
64 | */ | ||
28 | #ifdef CONFIG_PXA25x | 65 | #ifdef CONFIG_PXA25x |
29 | extern unsigned pxa25x_get_clk_frequency_khz(int); | 66 | extern unsigned pxa25x_get_clk_frequency_khz(int); |
30 | #else | 67 | #else |
@@ -32,30 +69,12 @@ extern unsigned pxa25x_get_clk_frequency_khz(int); | |||
32 | #endif | 69 | #endif |
33 | 70 | ||
34 | #ifdef CONFIG_PXA27x | 71 | #ifdef CONFIG_PXA27x |
35 | extern unsigned pxa27x_get_clk_frequency_khz(int); | ||
36 | #else | 72 | #else |
37 | #define pxa27x_get_clk_frequency_khz(x) (0) | 73 | #define pxa27x_get_clk_frequency_khz(x) (0) |
38 | #endif | 74 | #endif |
39 | 75 | ||
40 | #if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) | ||
41 | extern void pxa2xx_clear_reset_status(unsigned int); | ||
42 | #else | ||
43 | static inline void pxa2xx_clear_reset_status(unsigned int mask) {} | ||
44 | #endif | ||
45 | |||
46 | #ifdef CONFIG_PXA3xx | 76 | #ifdef CONFIG_PXA3xx |
47 | extern unsigned pxa3xx_get_clk_frequency_khz(int); | 77 | extern unsigned pxa3xx_get_clk_frequency_khz(int); |
48 | #else | 78 | #else |
49 | #define pxa3xx_get_clk_frequency_khz(x) (0) | 79 | #define pxa3xx_get_clk_frequency_khz(x) (0) |
50 | #endif | 80 | #endif |
51 | |||
52 | extern struct syscore_ops pxa_irq_syscore_ops; | ||
53 | extern struct syscore_ops pxa2xx_mfp_syscore_ops; | ||
54 | extern struct syscore_ops pxa3xx_mfp_syscore_ops; | ||
55 | |||
56 | void __init pxa_set_ffuart_info(void *info); | ||
57 | void __init pxa_set_btuart_info(void *info); | ||
58 | void __init pxa_set_stuart_info(void *info); | ||
59 | void __init pxa_set_hwuart_info(void *info); | ||
60 | |||
61 | void pxa_restart(enum reboot_mode, const char *); | ||
diff --git a/arch/arm/mach-pxa/include/mach/pxa25x.h b/arch/arm/mach-pxa/include/mach/pxa25x.h index 3ac0baac7350..5a341752e32c 100644 --- a/arch/arm/mach-pxa/include/mach/pxa25x.h +++ b/arch/arm/mach-pxa/include/mach/pxa25x.h | |||
@@ -6,12 +6,4 @@ | |||
6 | #include <mach/mfp-pxa25x.h> | 6 | #include <mach/mfp-pxa25x.h> |
7 | #include <mach/irqs.h> | 7 | #include <mach/irqs.h> |
8 | 8 | ||
9 | extern void __init pxa25x_map_io(void); | ||
10 | extern void __init pxa25x_init_irq(void); | ||
11 | #ifdef CONFIG_CPU_PXA26x | ||
12 | extern void __init pxa26x_init_irq(void); | ||
13 | #endif | ||
14 | |||
15 | #define pxa25x_handle_irq icip_handle_irq | ||
16 | |||
17 | #endif /* __MACH_PXA25x_H */ | 9 | #endif /* __MACH_PXA25x_H */ |
diff --git a/arch/arm/mach-pxa/include/mach/pxa27x.h b/arch/arm/mach-pxa/include/mach/pxa27x.h index 7cff640582b8..599b925a657c 100644 --- a/arch/arm/mach-pxa/include/mach/pxa27x.h +++ b/arch/arm/mach-pxa/include/mach/pxa27x.h | |||
@@ -19,11 +19,7 @@ | |||
19 | #define ARB_CORE_PARK (1<<24) /* Be parked with core when idle */ | 19 | #define ARB_CORE_PARK (1<<24) /* Be parked with core when idle */ |
20 | #define ARB_LOCK_FLAG (1<<23) /* Only Locking masters gain access to the bus */ | 20 | #define ARB_LOCK_FLAG (1<<23) /* Only Locking masters gain access to the bus */ |
21 | 21 | ||
22 | extern void __init pxa27x_map_io(void); | ||
23 | extern void __init pxa27x_init_irq(void); | ||
24 | extern int __init pxa27x_set_pwrmode(unsigned int mode); | 22 | extern int __init pxa27x_set_pwrmode(unsigned int mode); |
25 | extern void pxa27x_cpu_pm_enter(suspend_state_t state); | 23 | extern void pxa27x_cpu_pm_enter(suspend_state_t state); |
26 | 24 | ||
27 | #define pxa27x_handle_irq ichp_handle_irq | ||
28 | |||
29 | #endif /* __MACH_PXA27x_H */ | 25 | #endif /* __MACH_PXA27x_H */ |
diff --git a/arch/arm/mach-pxa/include/mach/pxa3xx.h b/arch/arm/mach-pxa/include/mach/pxa3xx.h index 6dd7fa163e29..b4143fb6631f 100644 --- a/arch/arm/mach-pxa/include/mach/pxa3xx.h +++ b/arch/arm/mach-pxa/include/mach/pxa3xx.h | |||
@@ -5,9 +5,4 @@ | |||
5 | #include <mach/pxa3xx-regs.h> | 5 | #include <mach/pxa3xx-regs.h> |
6 | #include <mach/irqs.h> | 6 | #include <mach/irqs.h> |
7 | 7 | ||
8 | extern void __init pxa3xx_map_io(void); | ||
9 | extern void __init pxa3xx_init_irq(void); | ||
10 | |||
11 | #define pxa3xx_handle_irq ichp_handle_irq | ||
12 | |||
13 | #endif /* __MACH_PXA3XX_H */ | 8 | #endif /* __MACH_PXA3XX_H */ |