Skip to content

Commit 877768c

Browse files
committed
ARC: [Review] Multi-platform image #3: switch to board callback
-platform API is retired and instead callbacks are used Signed-off-by: Vineet Gupta <[email protected]> Cc: Arnd Bergmann <[email protected]> Acked-by: Arnd Bergmann <[email protected]>
1 parent 03a6d28 commit 877768c

File tree

10 files changed

+48
-26
lines changed

10 files changed

+48
-26
lines changed

arch/arc/include/asm/irq.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include <asm-generic/irq.h>
1818

1919
extern void __init arc_init_IRQ(void);
20-
extern void __init plat_init_IRQ(void);
2120
extern int __init get_hw_config_num_irq(void);
2221

2322
void __cpuinit arc_local_timer_setup(unsigned int cpu);

arch/arc/include/asm/smp.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ extern int smp_ipi_irq_setup(int cpu, int irq);
4646
* arc_platform_smp_cpuinfo:
4747
* returns a string containing info for /proc/cpuinfo
4848
*
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-
*
5349
* arc_platform_smp_wait_to_boot:
5450
* Called from early bootup code for non-Master CPUs to "park" them
5551
*
@@ -64,7 +60,6 @@ extern int smp_ipi_irq_setup(int cpu, int irq);
6460
* Takes @cpu which got IPI at @irq to do any IPI clearing
6561
*/
6662
extern const char *arc_platform_smp_cpuinfo(void);
67-
extern void arc_platform_smp_init_cpu(void);
6863
extern void arc_platform_smp_wait_to_boot(int cpu);
6964
extern void arc_platform_smp_wakeup_cpu(int cpu, unsigned long pc);
7065
extern void arc_platform_ipi_send(const struct cpumask *callmap);

arch/arc/kernel/irq.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,13 @@ void __init init_onchip_IRQ(void)
124124
void __init init_IRQ(void)
125125
{
126126
init_onchip_IRQ();
127-
plat_init_IRQ();
128127

129128
/* Any external intc can be setup here */
130129
if (machine_desc->init_irq)
131130
machine_desc->init_irq();
132131

133132
#ifdef CONFIG_SMP
134133
/* Master CPU can initialize it's side of IPI */
135-
arc_platform_smp_init_cpu();
136134
if (machine_desc->init_smp)
137135
machine_desc->init_smp(smp_processor_id());
138136
#endif

arch/arc/kernel/setup.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,6 @@ void __init setup_processor(void)
319319
arc_chk_fpu();
320320
}
321321

322-
void __init __attribute__((weak)) arc_platform_early_init(void)
323-
{
324-
}
325-
326322
void __init setup_arch(char **cmdline_p)
327323
{
328324
#ifdef CONFIG_CMDLINE_UBOOT
@@ -347,7 +343,6 @@ void __init setup_arch(char **cmdline_p)
347343
parse_early_param();
348344

349345
/* Platform/board specific: e.g. early console registration */
350-
arc_platform_early_init();
351346
if (machine_desc->init_early)
352347
machine_desc->init_early();
353348

arch/arc/kernel/smp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ void __cpuinit start_kernel_secondary(void)
127127

128128
pr_info("## CPU%u LIVE ##: Executing Code...\n", cpu);
129129

130-
arc_platform_smp_init_cpu();
131130
if (machine_desc->init_smp)
132131
machine_desc->init_smp(smp_processor_id());
133132

arch/arc/plat-arcfpga/include/plat/irq.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@
3232
#define IDU_INTERRUPT_0 16
3333
#endif
3434

35+
extern void __init plat_fpga_init_IRQ(void);
36+
3537
#endif

arch/arc/plat-arcfpga/include/plat/smp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ struct idu_irq_status {
110110
extern void idu_irq_set_tgtcpu(uint8_t irq, uint32_t mask);
111111
extern void idu_irq_set_mode(uint8_t irq, uint8_t dest_mode, uint8_t trig_mode);
112112

113+
extern void iss_model_init_smp(unsigned int cpu);
114+
113115
#endif /* CONFIG_SMP */
114116

115117
#endif

arch/arc/plat-arcfpga/irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <linux/interrupt.h>
1212
#include <asm/irq.h>
1313

14-
void __init plat_init_IRQ(void)
14+
void __init plat_fpga_init_IRQ(void)
1515
{
1616
/*
1717
* SMP Hack because UART IRQ hardwired to cpu0 (boot-cpu) but if the

arch/arc/plat-arcfpga/platform.c

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
#include <asm/setup.h>
1919
#include <asm/irq.h>
2020
#include <asm/clk.h>
21+
#include <asm/mach_desc.h>
2122
#include <plat/memmap.h>
23+
#include <plat/smp.h>
2224

2325
/*-----------------------BVCI Latency Unit -----------------------------*/
2426

@@ -153,10 +155,7 @@ static void arc_fpga_serial_init(void)
153155
#endif
154156
}
155157

156-
/*
157-
* Early Platform Initialization called from setup_arch()
158-
*/
159-
void __init arc_platform_early_init(void)
158+
static void __init plat_fpga_early_init(void)
160159
{
161160
pr_info("[plat-arcfpga]: registering early dev resources\n");
162161

@@ -172,7 +171,7 @@ static struct of_dev_auxdata plat_auxdata_lookup[] __initdata = {
172171
{}
173172
};
174173

175-
int __init fpga_plat_init(void)
174+
static void __init plat_fpga_populate_dev(void)
176175
{
177176
pr_info("[plat-arcfpga]: registering device resources\n");
178177

@@ -182,7 +181,42 @@ int __init fpga_plat_init(void)
182181
*/
183182
of_platform_populate(NULL, of_default_bus_match_table,
184183
plat_auxdata_lookup, NULL);
185-
186-
return 0;
187184
}
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

arch/arc/plat-arcfpga/smp.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,8 @@ void arc_platform_smp_wakeup_cpu(int cpu, unsigned long pc)
6363
* -Master : init_IRQ()
6464
* -Other(s) : start_kernel_secondary()
6565
*/
66-
void arc_platform_smp_init_cpu(void)
66+
void iss_model_init_smp(unsigned int cpu)
6767
{
68-
int cpu = smp_processor_id();
69-
7068
/* Check if CPU is configured for more than 16 interrupts */
7169
if (NR_IRQS <= 16 || get_hw_config_num_irq() <= 16)
7270
panic("[arcfpga] IRQ system can't support IDU IPI\n");

0 commit comments

Comments
 (0)