summaryrefslogtreecommitdiff
path: root/arch/arc/plat-arcfpga
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2013-01-23 15:02:48 +0400
committerVineet Gupta <vgupta@synopsys.com>2013-02-15 21:46:14 +0400
commit877768c84d6ca8f7dedafff0e44615a12e82f8f4 (patch)
treebf81883aecb24a75ae899a84c40290ef735008ba /arch/arc/plat-arcfpga
parent03a6d28cdddfbd11b338c23e7fe51d0816b9bdef (diff)
downloadlinux-877768c84d6ca8f7dedafff0e44615a12e82f8f4.tar.xz
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/plat-arcfpga')
-rw-r--r--arch/arc/plat-arcfpga/include/plat/irq.h2
-rw-r--r--arch/arc/plat-arcfpga/include/plat/smp.h2
-rw-r--r--arch/arc/plat-arcfpga/irq.c2
-rw-r--r--arch/arc/plat-arcfpga/platform.c50
-rw-r--r--arch/arc/plat-arcfpga/smp.c4
5 files changed, 48 insertions, 12 deletions
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 @@
#define IDU_INTERRUPT_0 16
#endif
+extern void __init plat_fpga_init_IRQ(void);
+
#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 {
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 iss_model_init_smp(unsigned int cpu);
+
#endif /* CONFIG_SMP */
#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 @@
#include <linux/interrupt.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
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 @@
#include <asm/setup.h>
#include <asm/irq.h>
#include <asm/clk.h>
+#include <asm/mach_desc.h>
#include <plat/memmap.h>
+#include <plat/smp.h>
/*-----------------------BVCI Latency Unit -----------------------------*/
@@ -153,10 +155,7 @@ static void arc_fpga_serial_init(void)
#endif
}
-/*
- * Early Platform Initialization called from setup_arch()
- */
-void __init arc_platform_early_init(void)
+static void __init plat_fpga_early_init(void)
{
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");
@@ -182,7 +181,42 @@ int __init fpga_plat_init(void)
*/
of_platform_populate(NULL, of_default_bus_match_table,
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
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)
* -Master : init_IRQ()
* -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 */
if (NR_IRQS <= 16 || get_hw_config_num_irq() <= 16)
panic("[arcfpga] IRQ system can't support IDU IPI\n");