aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel/setup.c')
-rw-r--r--arch/arm/kernel/setup.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 1522c7ae31b0..a1a2fbaaa31c 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -37,6 +37,7 @@
37#include <asm/cputype.h> 37#include <asm/cputype.h>
38#include <asm/elf.h> 38#include <asm/elf.h>
39#include <asm/procinfo.h> 39#include <asm/procinfo.h>
40#include <asm/psci.h>
40#include <asm/sections.h> 41#include <asm/sections.h>
41#include <asm/setup.h> 42#include <asm/setup.h>
42#include <asm/smp_plat.h> 43#include <asm/smp_plat.h>
@@ -128,7 +129,9 @@ struct stack {
128 u32 und[3]; 129 u32 und[3];
129} ____cacheline_aligned; 130} ____cacheline_aligned;
130 131
132#ifndef CONFIG_CPU_V7M
131static struct stack stacks[NR_CPUS]; 133static struct stack stacks[NR_CPUS];
134#endif
132 135
133char elf_platform[ELF_PLATFORM_SIZE]; 136char elf_platform[ELF_PLATFORM_SIZE];
134EXPORT_SYMBOL(elf_platform); 137EXPORT_SYMBOL(elf_platform);
@@ -207,7 +210,7 @@ static const char *proc_arch[] = {
207 "5TEJ", 210 "5TEJ",
208 "6TEJ", 211 "6TEJ",
209 "7", 212 "7",
210 "?(11)", 213 "7M",
211 "?(12)", 214 "?(12)",
212 "?(13)", 215 "?(13)",
213 "?(14)", 216 "?(14)",
@@ -216,6 +219,12 @@ static const char *proc_arch[] = {
216 "?(17)", 219 "?(17)",
217}; 220};
218 221
222#ifdef CONFIG_CPU_V7M
223static int __get_cpu_architecture(void)
224{
225 return CPU_ARCH_ARMv7M;
226}
227#else
219static int __get_cpu_architecture(void) 228static int __get_cpu_architecture(void)
220{ 229{
221 int cpu_arch; 230 int cpu_arch;
@@ -248,6 +257,7 @@ static int __get_cpu_architecture(void)
248 257
249 return cpu_arch; 258 return cpu_arch;
250} 259}
260#endif
251 261
252int __pure cpu_architecture(void) 262int __pure cpu_architecture(void)
253{ 263{
@@ -293,7 +303,9 @@ static void __init cacheid_init(void)
293{ 303{
294 unsigned int arch = cpu_architecture(); 304 unsigned int arch = cpu_architecture();
295 305
296 if (arch >= CPU_ARCH_ARMv6) { 306 if (arch == CPU_ARCH_ARMv7M) {
307 cacheid = 0;
308 } else if (arch >= CPU_ARCH_ARMv6) {
297 unsigned int cachetype = read_cpuid_cachetype(); 309 unsigned int cachetype = read_cpuid_cachetype();
298 if ((cachetype & (7 << 29)) == 4 << 29) { 310 if ((cachetype & (7 << 29)) == 4 << 29) {
299 /* ARMv7 register format */ 311 /* ARMv7 register format */
@@ -392,6 +404,7 @@ static void __init feat_v6_fixup(void)
392 */ 404 */
393void notrace cpu_init(void) 405void notrace cpu_init(void)
394{ 406{
407#ifndef CONFIG_CPU_V7M
395 unsigned int cpu = smp_processor_id(); 408 unsigned int cpu = smp_processor_id();
396 struct stack *stk = &stacks[cpu]; 409 struct stack *stk = &stacks[cpu];
397 410
@@ -442,6 +455,7 @@ void notrace cpu_init(void)
442 "I" (offsetof(struct stack, und[0])), 455 "I" (offsetof(struct stack, und[0])),
443 PLC (PSR_F_BIT | PSR_I_BIT | SVC_MODE) 456 PLC (PSR_F_BIT | PSR_I_BIT | SVC_MODE)
444 : "r14"); 457 : "r14");
458#endif
445} 459}
446 460
447int __cpu_logical_map[NR_CPUS]; 461int __cpu_logical_map[NR_CPUS];
@@ -796,9 +810,15 @@ void __init setup_arch(char **cmdline_p)
796 unflatten_device_tree(); 810 unflatten_device_tree();
797 811
798 arm_dt_init_cpu_maps(); 812 arm_dt_init_cpu_maps();
813 psci_init();
799#ifdef CONFIG_SMP 814#ifdef CONFIG_SMP
800 if (is_smp()) { 815 if (is_smp()) {
801 smp_set_ops(mdesc->smp); 816 if (!mdesc->smp_init || !mdesc->smp_init()) {
817 if (psci_smp_available())
818 smp_set_ops(&psci_smp_ops);
819 else if (mdesc->smp)
820 smp_set_ops(mdesc->smp);
821 }
802 smp_init_cpus(); 822 smp_init_cpus();
803 } 823 }
804#endif 824#endif