diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2013-01-23 06:02:48 -0500 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2013-02-15 12:46:14 -0500 |
commit | 877768c84d6ca8f7dedafff0e44615a12e82f8f4 (patch) | |
tree | bf81883aecb24a75ae899a84c40290ef735008ba /arch/arc | |
parent | 03a6d28cdddfbd11b338c23e7fe51d0816b9bdef (diff) |
ARC: [Review] Multi-platform image #3: switch to board callback
-platform API is retired and instead callbacks are used
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arc')
-rw-r--r-- | arch/arc/include/asm/irq.h | 1 | ||||
-rw-r--r-- | arch/arc/include/asm/smp.h | 5 | ||||
-rw-r--r-- | arch/arc/kernel/irq.c | 2 | ||||
-rw-r--r-- | arch/arc/kernel/setup.c | 5 | ||||
-rw-r--r-- | arch/arc/kernel/smp.c | 1 | ||||
-rw-r--r-- | arch/arc/plat-arcfpga/include/plat/irq.h | 2 | ||||
-rw-r--r-- | arch/arc/plat-arcfpga/include/plat/smp.h | 2 | ||||
-rw-r--r-- | arch/arc/plat-arcfpga/irq.c | 2 | ||||
-rw-r--r-- | arch/arc/plat-arcfpga/platform.c | 50 | ||||
-rw-r--r-- | arch/arc/plat-arcfpga/smp.c | 4 |
10 files changed, 48 insertions, 26 deletions
diff --git a/arch/arc/include/asm/irq.h b/arch/arc/include/asm/irq.h index c91b2e4344a1..f1b318d92877 100644 --- a/arch/arc/include/asm/irq.h +++ b/arch/arc/include/asm/irq.h | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <asm-generic/irq.h> | 17 | #include <asm-generic/irq.h> |
18 | 18 | ||
19 | extern void __init arc_init_IRQ(void); | 19 | extern void __init arc_init_IRQ(void); |
20 | extern void __init plat_init_IRQ(void); | ||
21 | extern int __init get_hw_config_num_irq(void); | 20 | extern int __init get_hw_config_num_irq(void); |
22 | 21 | ||
23 | void __cpuinit arc_local_timer_setup(unsigned int cpu); | 22 | void __cpuinit arc_local_timer_setup(unsigned int cpu); |
diff --git a/arch/arc/include/asm/smp.h b/arch/arc/include/asm/smp.h index f91f1946272f..0cff3a548136 100644 --- a/arch/arc/include/asm/smp.h +++ b/arch/arc/include/asm/smp.h | |||
@@ -46,10 +46,6 @@ extern int smp_ipi_irq_setup(int cpu, int irq); | |||
46 | * arc_platform_smp_cpuinfo: | 46 | * arc_platform_smp_cpuinfo: |
47 | * returns a string containing info for /proc/cpuinfo | 47 | * returns a string containing info for /proc/cpuinfo |
48 | * | 48 | * |
49 | * arc_platform_smp_init_cpu: | ||
50 | * Called from start_kernel_secondary to do any CPU local setup | ||
51 | * such as starting a timer, setting up IPI etc | ||
52 | * | ||
53 | * arc_platform_smp_wait_to_boot: | 49 | * arc_platform_smp_wait_to_boot: |
54 | * Called from early bootup code for non-Master CPUs to "park" them | 50 | * Called from early bootup code for non-Master CPUs to "park" them |
55 | * | 51 | * |
@@ -64,7 +60,6 @@ extern int smp_ipi_irq_setup(int cpu, int irq); | |||
64 | * Takes @cpu which got IPI at @irq to do any IPI clearing | 60 | * Takes @cpu which got IPI at @irq to do any IPI clearing |
65 | */ | 61 | */ |
66 | extern const char *arc_platform_smp_cpuinfo(void); | 62 | extern const char *arc_platform_smp_cpuinfo(void); |
67 | extern void arc_platform_smp_init_cpu(void); | ||
68 | extern void arc_platform_smp_wait_to_boot(int cpu); | 63 | extern void arc_platform_smp_wait_to_boot(int cpu); |
69 | extern void arc_platform_smp_wakeup_cpu(int cpu, unsigned long pc); | 64 | extern void arc_platform_smp_wakeup_cpu(int cpu, unsigned long pc); |
70 | extern void arc_platform_ipi_send(const struct cpumask *callmap); | 65 | extern void arc_platform_ipi_send(const struct cpumask *callmap); |
diff --git a/arch/arc/kernel/irq.c b/arch/arc/kernel/irq.c index 1198168850e8..551c10dff481 100644 --- a/arch/arc/kernel/irq.c +++ b/arch/arc/kernel/irq.c | |||
@@ -124,7 +124,6 @@ void __init init_onchip_IRQ(void) | |||
124 | void __init init_IRQ(void) | 124 | void __init init_IRQ(void) |
125 | { | 125 | { |
126 | init_onchip_IRQ(); | 126 | init_onchip_IRQ(); |
127 | plat_init_IRQ(); | ||
128 | 127 | ||
129 | /* Any external intc can be setup here */ | 128 | /* Any external intc can be setup here */ |
130 | if (machine_desc->init_irq) | 129 | if (machine_desc->init_irq) |
@@ -132,7 +131,6 @@ void __init init_IRQ(void) | |||
132 | 131 | ||
133 | #ifdef CONFIG_SMP | 132 | #ifdef CONFIG_SMP |
134 | /* Master CPU can initialize it's side of IPI */ | 133 | /* Master CPU can initialize it's side of IPI */ |
135 | arc_platform_smp_init_cpu(); | ||
136 | if (machine_desc->init_smp) | 134 | if (machine_desc->init_smp) |
137 | machine_desc->init_smp(smp_processor_id()); | 135 | machine_desc->init_smp(smp_processor_id()); |
138 | #endif | 136 | #endif |
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c index 20273b89e545..e591c6ae88a6 100644 --- a/arch/arc/kernel/setup.c +++ b/arch/arc/kernel/setup.c | |||
@@ -319,10 +319,6 @@ void __init setup_processor(void) | |||
319 | arc_chk_fpu(); | 319 | arc_chk_fpu(); |
320 | } | 320 | } |
321 | 321 | ||
322 | void __init __attribute__((weak)) arc_platform_early_init(void) | ||
323 | { | ||
324 | } | ||
325 | |||
326 | void __init setup_arch(char **cmdline_p) | 322 | void __init setup_arch(char **cmdline_p) |
327 | { | 323 | { |
328 | #ifdef CONFIG_CMDLINE_UBOOT | 324 | #ifdef CONFIG_CMDLINE_UBOOT |
@@ -347,7 +343,6 @@ void __init setup_arch(char **cmdline_p) | |||
347 | parse_early_param(); | 343 | parse_early_param(); |
348 | 344 | ||
349 | /* Platform/board specific: e.g. early console registration */ | 345 | /* Platform/board specific: e.g. early console registration */ |
350 | arc_platform_early_init(); | ||
351 | if (machine_desc->init_early) | 346 | if (machine_desc->init_early) |
352 | machine_desc->init_early(); | 347 | machine_desc->init_early(); |
353 | 348 | ||
diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c index ea15f073452f..8ee010fdbc18 100644 --- a/arch/arc/kernel/smp.c +++ b/arch/arc/kernel/smp.c | |||
@@ -127,7 +127,6 @@ void __cpuinit start_kernel_secondary(void) | |||
127 | 127 | ||
128 | pr_info("## CPU%u LIVE ##: Executing Code...\n", cpu); | 128 | pr_info("## CPU%u LIVE ##: Executing Code...\n", cpu); |
129 | 129 | ||
130 | arc_platform_smp_init_cpu(); | ||
131 | if (machine_desc->init_smp) | 130 | if (machine_desc->init_smp) |
132 | machine_desc->init_smp(smp_processor_id()); | 131 | machine_desc->init_smp(smp_processor_id()); |
133 | 132 | ||
diff --git a/arch/arc/plat-arcfpga/include/plat/irq.h b/arch/arc/plat-arcfpga/include/plat/irq.h index 255b90e973ee..6515df232f21 100644 --- a/arch/arc/plat-arcfpga/include/plat/irq.h +++ b/arch/arc/plat-arcfpga/include/plat/irq.h | |||
@@ -32,4 +32,6 @@ | |||
32 | #define IDU_INTERRUPT_0 16 | 32 | #define IDU_INTERRUPT_0 16 |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | extern void __init plat_fpga_init_IRQ(void); | ||
36 | |||
35 | #endif | 37 | #endif |
diff --git a/arch/arc/plat-arcfpga/include/plat/smp.h b/arch/arc/plat-arcfpga/include/plat/smp.h index 8c5e46c01b15..27822ac8155e 100644 --- a/arch/arc/plat-arcfpga/include/plat/smp.h +++ b/arch/arc/plat-arcfpga/include/plat/smp.h | |||
@@ -110,6 +110,8 @@ struct idu_irq_status { | |||
110 | extern void idu_irq_set_tgtcpu(uint8_t irq, uint32_t mask); | 110 | extern void idu_irq_set_tgtcpu(uint8_t irq, uint32_t mask); |
111 | extern void idu_irq_set_mode(uint8_t irq, uint8_t dest_mode, uint8_t trig_mode); | 111 | extern void idu_irq_set_mode(uint8_t irq, uint8_t dest_mode, uint8_t trig_mode); |
112 | 112 | ||
113 | extern void iss_model_init_smp(unsigned int cpu); | ||
114 | |||
113 | #endif /* CONFIG_SMP */ | 115 | #endif /* CONFIG_SMP */ |
114 | 116 | ||
115 | #endif | 117 | #endif |
diff --git a/arch/arc/plat-arcfpga/irq.c b/arch/arc/plat-arcfpga/irq.c index 590edd174c47..0ea43c26f16a 100644 --- a/arch/arc/plat-arcfpga/irq.c +++ b/arch/arc/plat-arcfpga/irq.c | |||
@@ -11,7 +11,7 @@ | |||
11 | #include <linux/interrupt.h> | 11 | #include <linux/interrupt.h> |
12 | #include <asm/irq.h> | 12 | #include <asm/irq.h> |
13 | 13 | ||
14 | void __init plat_init_IRQ(void) | 14 | void __init plat_fpga_init_IRQ(void) |
15 | { | 15 | { |
16 | /* | 16 | /* |
17 | * SMP Hack because UART IRQ hardwired to cpu0 (boot-cpu) but if the | 17 | * SMP Hack because UART IRQ hardwired to cpu0 (boot-cpu) but if the |
diff --git a/arch/arc/plat-arcfpga/platform.c b/arch/arc/plat-arcfpga/platform.c index b7f63e3f3cae..ac85d6927334 100644 --- a/arch/arc/plat-arcfpga/platform.c +++ b/arch/arc/plat-arcfpga/platform.c | |||
@@ -18,7 +18,9 @@ | |||
18 | #include <asm/setup.h> | 18 | #include <asm/setup.h> |
19 | #include <asm/irq.h> | 19 | #include <asm/irq.h> |
20 | #include <asm/clk.h> | 20 | #include <asm/clk.h> |
21 | #include <asm/mach_desc.h> | ||
21 | #include <plat/memmap.h> | 22 | #include <plat/memmap.h> |
23 | #include <plat/smp.h> | ||
22 | 24 | ||
23 | /*-----------------------BVCI Latency Unit -----------------------------*/ | 25 | /*-----------------------BVCI Latency Unit -----------------------------*/ |
24 | 26 | ||
@@ -153,10 +155,7 @@ static void arc_fpga_serial_init(void) | |||
153 | #endif | 155 | #endif |
154 | } | 156 | } |
155 | 157 | ||
156 | /* | 158 | static void __init plat_fpga_early_init(void) |
157 | * Early Platform Initialization called from setup_arch() | ||
158 | */ | ||
159 | void __init arc_platform_early_init(void) | ||
160 | { | 159 | { |
161 | pr_info("[plat-arcfpga]: registering early dev resources\n"); | 160 | pr_info("[plat-arcfpga]: registering early dev resources\n"); |
162 | 161 | ||
@@ -172,7 +171,7 @@ static struct of_dev_auxdata plat_auxdata_lookup[] __initdata = { | |||
172 | {} | 171 | {} |
173 | }; | 172 | }; |
174 | 173 | ||
175 | int __init fpga_plat_init(void) | 174 | static void __init plat_fpga_populate_dev(void) |
176 | { | 175 | { |
177 | pr_info("[plat-arcfpga]: registering device resources\n"); | 176 | pr_info("[plat-arcfpga]: registering device resources\n"); |
178 | 177 | ||
@@ -182,7 +181,42 @@ int __init fpga_plat_init(void) | |||
182 | */ | 181 | */ |
183 | of_platform_populate(NULL, of_default_bus_match_table, | 182 | of_platform_populate(NULL, of_default_bus_match_table, |
184 | plat_auxdata_lookup, NULL); | 183 | plat_auxdata_lookup, NULL); |
185 | |||
186 | return 0; | ||
187 | } | 184 | } |
188 | arch_initcall(fpga_plat_init); | 185 | |
186 | /*----------------------- Machine Descriptions ------------------------------ | ||
187 | * | ||
188 | * Machine description is simply a set of platform/board specific callbacks | ||
189 | * This is not directly related to DeviceTree based dynamic device creation, | ||
190 | * however as part of early device tree scan, we also select the right | ||
191 | * callback set, by matching the DT compatible name. | ||
192 | */ | ||
193 | |||
194 | static const char *aa4_compat[] __initdata = { | ||
195 | "snps,arc-angel4", | ||
196 | NULL, | ||
197 | }; | ||
198 | |||
199 | MACHINE_START(ANGEL4, "angel4") | ||
200 | .dt_compat = aa4_compat, | ||
201 | .init_early = plat_fpga_early_init, | ||
202 | .init_machine = plat_fpga_populate_dev, | ||
203 | .init_irq = plat_fpga_init_IRQ, | ||
204 | #ifdef CONFIG_SMP | ||
205 | .init_smp = iss_model_init_smp, | ||
206 | #endif | ||
207 | MACHINE_END | ||
208 | |||
209 | static const char *ml509_compat[] __initdata = { | ||
210 | "snps,arc-ml509", | ||
211 | NULL, | ||
212 | }; | ||
213 | |||
214 | MACHINE_START(ML509, "ml509") | ||
215 | .dt_compat = ml509_compat, | ||
216 | .init_early = plat_fpga_early_init, | ||
217 | .init_machine = plat_fpga_populate_dev, | ||
218 | .init_irq = plat_fpga_init_IRQ, | ||
219 | #ifdef CONFIG_SMP | ||
220 | .init_smp = iss_model_init_smp, | ||
221 | #endif | ||
222 | MACHINE_END | ||
diff --git a/arch/arc/plat-arcfpga/smp.c b/arch/arc/plat-arcfpga/smp.c index a95fcdb29033..fec18793bbe0 100644 --- a/arch/arc/plat-arcfpga/smp.c +++ b/arch/arc/plat-arcfpga/smp.c | |||
@@ -63,10 +63,8 @@ void arc_platform_smp_wakeup_cpu(int cpu, unsigned long pc) | |||
63 | * -Master : init_IRQ() | 63 | * -Master : init_IRQ() |
64 | * -Other(s) : start_kernel_secondary() | 64 | * -Other(s) : start_kernel_secondary() |
65 | */ | 65 | */ |
66 | void arc_platform_smp_init_cpu(void) | 66 | void iss_model_init_smp(unsigned int cpu) |
67 | { | 67 | { |
68 | int cpu = smp_processor_id(); | ||
69 | |||
70 | /* Check if CPU is configured for more than 16 interrupts */ | 68 | /* Check if CPU is configured for more than 16 interrupts */ |
71 | if (NR_IRQS <= 16 || get_hw_config_num_irq() <= 16) | 69 | if (NR_IRQS <= 16 || get_hw_config_num_irq() <= 16) |
72 | panic("[arcfpga] IRQ system can't support IDU IPI\n"); | 70 | panic("[arcfpga] IRQ system can't support IDU IPI\n"); |