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>
This commit is contained in:
parent
03a6d28cdd
commit
877768c84d
10 changed files with 48 additions and 26 deletions
|
@ -17,7 +17,6 @@
|
||||||
#include <asm-generic/irq.h>
|
#include <asm-generic/irq.h>
|
||||||
|
|
||||||
extern void __init arc_init_IRQ(void);
|
extern void __init arc_init_IRQ(void);
|
||||||
extern void __init plat_init_IRQ(void);
|
|
||||||
extern int __init get_hw_config_num_irq(void);
|
extern int __init get_hw_config_num_irq(void);
|
||||||
|
|
||||||
void __cpuinit arc_local_timer_setup(unsigned int cpu);
|
void __cpuinit arc_local_timer_setup(unsigned int cpu);
|
||||||
|
|
|
@ -46,10 +46,6 @@ extern int smp_ipi_irq_setup(int cpu, int irq);
|
||||||
* arc_platform_smp_cpuinfo:
|
* arc_platform_smp_cpuinfo:
|
||||||
* returns a string containing info for /proc/cpuinfo
|
* returns a string containing info for /proc/cpuinfo
|
||||||
*
|
*
|
||||||
* arc_platform_smp_init_cpu:
|
|
||||||
* Called from start_kernel_secondary to do any CPU local setup
|
|
||||||
* such as starting a timer, setting up IPI etc
|
|
||||||
*
|
|
||||||
* arc_platform_smp_wait_to_boot:
|
* arc_platform_smp_wait_to_boot:
|
||||||
* Called from early bootup code for non-Master CPUs to "park" them
|
* Called from early bootup code for non-Master CPUs to "park" them
|
||||||
*
|
*
|
||||||
|
@ -64,7 +60,6 @@ extern int smp_ipi_irq_setup(int cpu, int irq);
|
||||||
* Takes @cpu which got IPI at @irq to do any IPI clearing
|
* Takes @cpu which got IPI at @irq to do any IPI clearing
|
||||||
*/
|
*/
|
||||||
extern const char *arc_platform_smp_cpuinfo(void);
|
extern const char *arc_platform_smp_cpuinfo(void);
|
||||||
extern void arc_platform_smp_init_cpu(void);
|
|
||||||
extern void arc_platform_smp_wait_to_boot(int cpu);
|
extern void arc_platform_smp_wait_to_boot(int cpu);
|
||||||
extern void arc_platform_smp_wakeup_cpu(int cpu, unsigned long pc);
|
extern void arc_platform_smp_wakeup_cpu(int cpu, unsigned long pc);
|
||||||
extern void arc_platform_ipi_send(const struct cpumask *callmap);
|
extern void arc_platform_ipi_send(const struct cpumask *callmap);
|
||||||
|
|
|
@ -124,7 +124,6 @@ void __init init_onchip_IRQ(void)
|
||||||
void __init init_IRQ(void)
|
void __init init_IRQ(void)
|
||||||
{
|
{
|
||||||
init_onchip_IRQ();
|
init_onchip_IRQ();
|
||||||
plat_init_IRQ();
|
|
||||||
|
|
||||||
/* Any external intc can be setup here */
|
/* Any external intc can be setup here */
|
||||||
if (machine_desc->init_irq)
|
if (machine_desc->init_irq)
|
||||||
|
@ -132,7 +131,6 @@ void __init init_IRQ(void)
|
||||||
|
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
/* Master CPU can initialize it's side of IPI */
|
/* Master CPU can initialize it's side of IPI */
|
||||||
arc_platform_smp_init_cpu();
|
|
||||||
if (machine_desc->init_smp)
|
if (machine_desc->init_smp)
|
||||||
machine_desc->init_smp(smp_processor_id());
|
machine_desc->init_smp(smp_processor_id());
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -319,10 +319,6 @@ void __init setup_processor(void)
|
||||||
arc_chk_fpu();
|
arc_chk_fpu();
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init __attribute__((weak)) arc_platform_early_init(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void __init setup_arch(char **cmdline_p)
|
void __init setup_arch(char **cmdline_p)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_CMDLINE_UBOOT
|
#ifdef CONFIG_CMDLINE_UBOOT
|
||||||
|
@ -347,7 +343,6 @@ void __init setup_arch(char **cmdline_p)
|
||||||
parse_early_param();
|
parse_early_param();
|
||||||
|
|
||||||
/* Platform/board specific: e.g. early console registration */
|
/* Platform/board specific: e.g. early console registration */
|
||||||
arc_platform_early_init();
|
|
||||||
if (machine_desc->init_early)
|
if (machine_desc->init_early)
|
||||||
machine_desc->init_early();
|
machine_desc->init_early();
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,6 @@ void __cpuinit start_kernel_secondary(void)
|
||||||
|
|
||||||
pr_info("## CPU%u LIVE ##: Executing Code...\n", cpu);
|
pr_info("## CPU%u LIVE ##: Executing Code...\n", cpu);
|
||||||
|
|
||||||
arc_platform_smp_init_cpu();
|
|
||||||
if (machine_desc->init_smp)
|
if (machine_desc->init_smp)
|
||||||
machine_desc->init_smp(smp_processor_id());
|
machine_desc->init_smp(smp_processor_id());
|
||||||
|
|
||||||
|
|
|
@ -32,4 +32,6 @@
|
||||||
#define IDU_INTERRUPT_0 16
|
#define IDU_INTERRUPT_0 16
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern void __init plat_fpga_init_IRQ(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -110,6 +110,8 @@ struct idu_irq_status {
|
||||||
extern void idu_irq_set_tgtcpu(uint8_t irq, uint32_t mask);
|
extern void idu_irq_set_tgtcpu(uint8_t irq, uint32_t mask);
|
||||||
extern void idu_irq_set_mode(uint8_t irq, uint8_t dest_mode, uint8_t trig_mode);
|
extern void idu_irq_set_mode(uint8_t irq, uint8_t dest_mode, uint8_t trig_mode);
|
||||||
|
|
||||||
|
extern void iss_model_init_smp(unsigned int cpu);
|
||||||
|
|
||||||
#endif /* CONFIG_SMP */
|
#endif /* CONFIG_SMP */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <asm/irq.h>
|
#include <asm/irq.h>
|
||||||
|
|
||||||
void __init plat_init_IRQ(void)
|
void __init plat_fpga_init_IRQ(void)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* SMP Hack because UART IRQ hardwired to cpu0 (boot-cpu) but if the
|
* SMP Hack because UART IRQ hardwired to cpu0 (boot-cpu) but if the
|
||||||
|
|
|
@ -18,7 +18,9 @@
|
||||||
#include <asm/setup.h>
|
#include <asm/setup.h>
|
||||||
#include <asm/irq.h>
|
#include <asm/irq.h>
|
||||||
#include <asm/clk.h>
|
#include <asm/clk.h>
|
||||||
|
#include <asm/mach_desc.h>
|
||||||
#include <plat/memmap.h>
|
#include <plat/memmap.h>
|
||||||
|
#include <plat/smp.h>
|
||||||
|
|
||||||
/*-----------------------BVCI Latency Unit -----------------------------*/
|
/*-----------------------BVCI Latency Unit -----------------------------*/
|
||||||
|
|
||||||
|
@ -153,10 +155,7 @@ static void arc_fpga_serial_init(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
static void __init plat_fpga_early_init(void)
|
||||||
* Early Platform Initialization called from setup_arch()
|
|
||||||
*/
|
|
||||||
void __init arc_platform_early_init(void)
|
|
||||||
{
|
{
|
||||||
pr_info("[plat-arcfpga]: registering early dev resources\n");
|
pr_info("[plat-arcfpga]: registering early dev resources\n");
|
||||||
|
|
||||||
|
@ -172,7 +171,7 @@ static struct of_dev_auxdata plat_auxdata_lookup[] __initdata = {
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
int __init fpga_plat_init(void)
|
static void __init plat_fpga_populate_dev(void)
|
||||||
{
|
{
|
||||||
pr_info("[plat-arcfpga]: registering device resources\n");
|
pr_info("[plat-arcfpga]: registering device resources\n");
|
||||||
|
|
||||||
|
@ -182,7 +181,42 @@ int __init fpga_plat_init(void)
|
||||||
*/
|
*/
|
||||||
of_platform_populate(NULL, of_default_bus_match_table,
|
of_platform_populate(NULL, of_default_bus_match_table,
|
||||||
plat_auxdata_lookup, NULL);
|
plat_auxdata_lookup, NULL);
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
arch_initcall(fpga_plat_init);
|
|
||||||
|
/*----------------------- Machine Descriptions ------------------------------
|
||||||
|
*
|
||||||
|
* Machine description is simply a set of platform/board specific callbacks
|
||||||
|
* This is not directly related to DeviceTree based dynamic device creation,
|
||||||
|
* however as part of early device tree scan, we also select the right
|
||||||
|
* callback set, by matching the DT compatible name.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static const char *aa4_compat[] __initdata = {
|
||||||
|
"snps,arc-angel4",
|
||||||
|
NULL,
|
||||||
|
};
|
||||||
|
|
||||||
|
MACHINE_START(ANGEL4, "angel4")
|
||||||
|
.dt_compat = aa4_compat,
|
||||||
|
.init_early = plat_fpga_early_init,
|
||||||
|
.init_machine = plat_fpga_populate_dev,
|
||||||
|
.init_irq = plat_fpga_init_IRQ,
|
||||||
|
#ifdef CONFIG_SMP
|
||||||
|
.init_smp = iss_model_init_smp,
|
||||||
|
#endif
|
||||||
|
MACHINE_END
|
||||||
|
|
||||||
|
static const char *ml509_compat[] __initdata = {
|
||||||
|
"snps,arc-ml509",
|
||||||
|
NULL,
|
||||||
|
};
|
||||||
|
|
||||||
|
MACHINE_START(ML509, "ml509")
|
||||||
|
.dt_compat = ml509_compat,
|
||||||
|
.init_early = plat_fpga_early_init,
|
||||||
|
.init_machine = plat_fpga_populate_dev,
|
||||||
|
.init_irq = plat_fpga_init_IRQ,
|
||||||
|
#ifdef CONFIG_SMP
|
||||||
|
.init_smp = iss_model_init_smp,
|
||||||
|
#endif
|
||||||
|
MACHINE_END
|
||||||
|
|
|
@ -63,10 +63,8 @@ void arc_platform_smp_wakeup_cpu(int cpu, unsigned long pc)
|
||||||
* -Master : init_IRQ()
|
* -Master : init_IRQ()
|
||||||
* -Other(s) : start_kernel_secondary()
|
* -Other(s) : start_kernel_secondary()
|
||||||
*/
|
*/
|
||||||
void arc_platform_smp_init_cpu(void)
|
void iss_model_init_smp(unsigned int cpu)
|
||||||
{
|
{
|
||||||
int cpu = smp_processor_id();
|
|
||||||
|
|
||||||
/* Check if CPU is configured for more than 16 interrupts */
|
/* Check if CPU is configured for more than 16 interrupts */
|
||||||
if (NR_IRQS <= 16 || get_hw_config_num_irq() <= 16)
|
if (NR_IRQS <= 16 || get_hw_config_num_irq() <= 16)
|
||||||
panic("[arcfpga] IRQ system can't support IDU IPI\n");
|
panic("[arcfpga] IRQ system can't support IDU IPI\n");
|
||||||
|
|
Loading…
Add table
Reference in a new issue