diff options
author | Jingchang Lu <b35083@freescale.com> | 2014-10-31 05:01:13 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2014-11-23 01:56:21 -0500 |
commit | 4e3fea4a950e3ec22ec8f99a7438aa5ba584263a (patch) | |
tree | c460e261dcc12181346e0582621bbb6e0b69df3d /arch | |
parent | 7f0fb6104b3a9c48d7b253d3984d3a619bb1e654 (diff) |
ARM: imx: Add Freescale LS1021A SMP support
Freescale LS1021A SoCs deploy two cortex-A7 processors,
this adds bring-up support for the secondary core.
Signed-off-by: Jingchang Lu <b35083@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-imx/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/common.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-ls1021a.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/platsmp.c | 33 |
4 files changed, 36 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index 19dc7bfa8a8c..f5ac685a29fc 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile | |||
@@ -89,7 +89,7 @@ obj-$(CONFIG_HAVE_IMX_ANATOP) += anatop.o | |||
89 | obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o | 89 | obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o |
90 | obj-$(CONFIG_HAVE_IMX_MMDC) += mmdc.o | 90 | obj-$(CONFIG_HAVE_IMX_MMDC) += mmdc.o |
91 | obj-$(CONFIG_HAVE_IMX_SRC) += src.o | 91 | obj-$(CONFIG_HAVE_IMX_SRC) += src.o |
92 | ifdef CONFIG_SOC_IMX6 | 92 | ifneq ($(CONFIG_SOC_IMX6)$(CONFIG_SOC_LS1021A),) |
93 | AFLAGS_headsmp.o :=-Wa,-march=armv7-a | 93 | AFLAGS_headsmp.o :=-Wa,-march=armv7-a |
94 | obj-$(CONFIG_SMP) += headsmp.o platsmp.o | 94 | obj-$(CONFIG_SMP) += headsmp.o platsmp.o |
95 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o | 95 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o |
diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index 23c84e67a56d..fe9a908da3ed 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h | |||
@@ -158,5 +158,6 @@ static inline void imx_init_l2cache(void) {} | |||
158 | #endif | 158 | #endif |
159 | 159 | ||
160 | extern struct smp_operations imx_smp_ops; | 160 | extern struct smp_operations imx_smp_ops; |
161 | extern struct smp_operations ls1021a_smp_ops; | ||
161 | 162 | ||
162 | #endif | 163 | #endif |
diff --git a/arch/arm/mach-imx/mach-ls1021a.c b/arch/arm/mach-imx/mach-ls1021a.c index 9d2034b1a150..b89c858ebfd6 100644 --- a/arch/arm/mach-imx/mach-ls1021a.c +++ b/arch/arm/mach-imx/mach-ls1021a.c | |||
@@ -17,5 +17,6 @@ static const char * const ls1021a_dt_compat[] __initconst = { | |||
17 | }; | 17 | }; |
18 | 18 | ||
19 | DT_MACHINE_START(LS1021A, "Freescale LS1021A") | 19 | DT_MACHINE_START(LS1021A, "Freescale LS1021A") |
20 | .smp = smp_ops(ls1021a_smp_ops), | ||
20 | .dt_compat = ls1021a_dt_compat, | 21 | .dt_compat = ls1021a_dt_compat, |
21 | MACHINE_END | 22 | MACHINE_END |
diff --git a/arch/arm/mach-imx/platsmp.c b/arch/arm/mach-imx/platsmp.c index 771bd25c1025..7f270015fe58 100644 --- a/arch/arm/mach-imx/platsmp.c +++ b/arch/arm/mach-imx/platsmp.c | |||
@@ -11,7 +11,10 @@ | |||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/of_address.h> | ||
15 | #include <linux/of.h> | ||
14 | #include <linux/smp.h> | 16 | #include <linux/smp.h> |
17 | |||
15 | #include <asm/cacheflush.h> | 18 | #include <asm/cacheflush.h> |
16 | #include <asm/page.h> | 19 | #include <asm/page.h> |
17 | #include <asm/smp_scu.h> | 20 | #include <asm/smp_scu.h> |
@@ -94,3 +97,33 @@ struct smp_operations imx_smp_ops __initdata = { | |||
94 | .cpu_kill = imx_cpu_kill, | 97 | .cpu_kill = imx_cpu_kill, |
95 | #endif | 98 | #endif |
96 | }; | 99 | }; |
100 | |||
101 | #define DCFG_CCSR_SCRATCHRW1 0x200 | ||
102 | |||
103 | static int ls1021a_boot_secondary(unsigned int cpu, struct task_struct *idle) | ||
104 | { | ||
105 | arch_send_wakeup_ipi_mask(cpumask_of(cpu)); | ||
106 | |||
107 | return 0; | ||
108 | } | ||
109 | |||
110 | static void __init ls1021a_smp_prepare_cpus(unsigned int max_cpus) | ||
111 | { | ||
112 | struct device_node *np; | ||
113 | void __iomem *dcfg_base; | ||
114 | unsigned long paddr; | ||
115 | |||
116 | np = of_find_compatible_node(NULL, NULL, "fsl,ls1021a-dcfg"); | ||
117 | dcfg_base = of_iomap(np, 0); | ||
118 | BUG_ON(!dcfg_base); | ||
119 | |||
120 | paddr = virt_to_phys(secondary_startup); | ||
121 | writel_relaxed(cpu_to_be32(paddr), dcfg_base + DCFG_CCSR_SCRATCHRW1); | ||
122 | |||
123 | iounmap(dcfg_base); | ||
124 | } | ||
125 | |||
126 | struct smp_operations ls1021a_smp_ops __initdata = { | ||
127 | .smp_prepare_cpus = ls1021a_smp_prepare_cpus, | ||
128 | .smp_boot_secondary = ls1021a_boot_secondary, | ||
129 | }; | ||