]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/arm/kernel/setup.c
Merge branch 'for-next' of git://git.pengutronix.de/git/ukl/linux into devel-stable
[karo-tx-linux.git] / arch / arm / kernel / setup.c
index 728007c4a2b7eaf18e038d93a8075699d7a479dc..ea5cd6e3beb6d8646798b66a4e7b7dceb0a004eb 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/bootmem.h>
 #include <linux/seq_file.h>
 #include <linux/screen_info.h>
+#include <linux/of_platform.h>
 #include <linux/init.h>
 #include <linux/kexec.h>
 #include <linux/of_fdt.h>
@@ -127,7 +128,9 @@ struct stack {
        u32 und[3];
 } ____cacheline_aligned;
 
+#ifndef CONFIG_CPU_V7M
 static struct stack stacks[NR_CPUS];
+#endif
 
 char elf_platform[ELF_PLATFORM_SIZE];
 EXPORT_SYMBOL(elf_platform);
@@ -206,7 +209,7 @@ static const char *proc_arch[] = {
        "5TEJ",
        "6TEJ",
        "7",
-       "?(11)",
+       "7M",
        "?(12)",
        "?(13)",
        "?(14)",
@@ -215,6 +218,12 @@ static const char *proc_arch[] = {
        "?(17)",
 };
 
+#ifdef CONFIG_CPU_V7M
+static int __get_cpu_architecture(void)
+{
+       return CPU_ARCH_ARMv7M;
+}
+#else
 static int __get_cpu_architecture(void)
 {
        int cpu_arch;
@@ -247,6 +256,7 @@ static int __get_cpu_architecture(void)
 
        return cpu_arch;
 }
+#endif
 
 int __pure cpu_architecture(void)
 {
@@ -292,7 +302,9 @@ static void __init cacheid_init(void)
 {
        unsigned int arch = cpu_architecture();
 
-       if (arch >= CPU_ARCH_ARMv6) {
+       if (arch == CPU_ARCH_ARMv7M) {
+               cacheid = 0;
+       } else if (arch >= CPU_ARCH_ARMv6) {
                unsigned int cachetype = read_cpuid_cachetype();
                if ((cachetype & (7 << 29)) == 4 << 29) {
                        /* ARMv7 register format */
@@ -391,6 +403,7 @@ static void __init feat_v6_fixup(void)
  */
 void notrace cpu_init(void)
 {
+#ifndef CONFIG_CPU_V7M
        unsigned int cpu = smp_processor_id();
        struct stack *stk = &stacks[cpu];
 
@@ -441,6 +454,7 @@ void notrace cpu_init(void)
              "I" (offsetof(struct stack, und[0])),
              PLC (PSR_F_BIT | PSR_I_BIT | SVC_MODE)
            : "r14");
+#endif
 }
 
 int __cpu_logical_map[NR_CPUS];
@@ -659,9 +673,19 @@ struct screen_info screen_info = {
 
 static int __init customize_machine(void)
 {
-       /* customizes platform devices, or adds new ones */
+       /*
+        * customizes platform devices, or adds new ones
+        * On DT based machines, we fall back to populating the
+        * machine from the device tree, if no callback is provided,
+        * otherwise we would always need an init_machine callback.
+        */
        if (machine_desc->init_machine)
                machine_desc->init_machine();
+#ifdef CONFIG_OF
+       else
+               of_platform_populate(NULL, of_default_bus_match_table,
+                                       NULL, NULL);
+#endif
        return 0;
 }
 arch_initcall(customize_machine);