Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jingchang Lu and committed by
Shawn Guo
4e3fea4a 7f0fb610

+36 -1
+1 -1
arch/arm/mach-imx/Makefile
··· 89 89 obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o 90 90 obj-$(CONFIG_HAVE_IMX_MMDC) += mmdc.o 91 91 obj-$(CONFIG_HAVE_IMX_SRC) += src.o 92 - ifdef CONFIG_SOC_IMX6 92 + ifneq ($(CONFIG_SOC_IMX6)$(CONFIG_SOC_LS1021A),) 93 93 AFLAGS_headsmp.o :=-Wa,-march=armv7-a 94 94 obj-$(CONFIG_SMP) += headsmp.o platsmp.o 95 95 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
+1
arch/arm/mach-imx/common.h
··· 158 158 #endif 159 159 160 160 extern struct smp_operations imx_smp_ops; 161 + extern struct smp_operations ls1021a_smp_ops; 161 162 162 163 #endif
+1
arch/arm/mach-imx/mach-ls1021a.c
··· 17 17 }; 18 18 19 19 DT_MACHINE_START(LS1021A, "Freescale LS1021A") 20 + .smp = smp_ops(ls1021a_smp_ops), 20 21 .dt_compat = ls1021a_dt_compat, 21 22 MACHINE_END
+33
arch/arm/mach-imx/platsmp.c
··· 11 11 */ 12 12 13 13 #include <linux/init.h> 14 + #include <linux/of_address.h> 15 + #include <linux/of.h> 14 16 #include <linux/smp.h> 17 + 15 18 #include <asm/cacheflush.h> 16 19 #include <asm/page.h> 17 20 #include <asm/smp_scu.h> ··· 96 93 .cpu_die = imx_cpu_die, 97 94 .cpu_kill = imx_cpu_kill, 98 95 #endif 96 + }; 97 + 98 + #define DCFG_CCSR_SCRATCHRW1 0x200 99 + 100 + static int ls1021a_boot_secondary(unsigned int cpu, struct task_struct *idle) 101 + { 102 + arch_send_wakeup_ipi_mask(cpumask_of(cpu)); 103 + 104 + return 0; 105 + } 106 + 107 + static void __init ls1021a_smp_prepare_cpus(unsigned int max_cpus) 108 + { 109 + struct device_node *np; 110 + void __iomem *dcfg_base; 111 + unsigned long paddr; 112 + 113 + np = of_find_compatible_node(NULL, NULL, "fsl,ls1021a-dcfg"); 114 + dcfg_base = of_iomap(np, 0); 115 + BUG_ON(!dcfg_base); 116 + 117 + paddr = virt_to_phys(secondary_startup); 118 + writel_relaxed(cpu_to_be32(paddr), dcfg_base + DCFG_CCSR_SCRATCHRW1); 119 + 120 + iounmap(dcfg_base); 121 + } 122 + 123 + struct smp_operations ls1021a_smp_ops __initdata = { 124 + .smp_prepare_cpus = ls1021a_smp_prepare_cpus, 125 + .smp_boot_secondary = ls1021a_boot_secondary, 99 126 };