]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/powerpc/kernel/setup_64.c
Merge tag 'platform-drivers-x86-v4.12-2' of git://git.infradead.org/linux-platform...
[karo-tx-linux.git] / arch / powerpc / kernel / setup_64.c
index 0d4dcaeaafcb4d0b8396f06ba8cc93e4a30e5d0b..a8c1f99e96072530cb1f2d9ed702dffd78665720 100644 (file)
@@ -49,6 +49,7 @@
 #include <asm/paca.h>
 #include <asm/time.h>
 #include <asm/cputable.h>
+#include <asm/dt_cpu_ftrs.h>
 #include <asm/sections.h>
 #include <asm/btext.h>
 #include <asm/nvram.h>
@@ -274,8 +275,10 @@ void __init early_setup(unsigned long dt_ptr)
 
        /* -------- printk is _NOT_ safe to use here ! ------- */
 
-       /* Identify CPU type */
-       identify_cpu(0, mfspr(SPRN_PVR));
+       /* Try new device tree based feature discovery ... */
+       if (!dt_cpu_ftrs_init(__va(dt_ptr)))
+               /* Otherwise use the old style CPU table */
+               identify_cpu(0, mfspr(SPRN_PVR));
 
        /* Assume we're on cpu 0 for now. Don't write to the paca yet! */
        initialise_paca(&boot_paca, 0);
@@ -541,6 +544,9 @@ void __init initialize_cache_info(void)
        dcache_bsize = ppc64_caches.l1d.block_size;
        icache_bsize = ppc64_caches.l1i.block_size;
 
+       cur_cpu_spec->dcache_bsize = dcache_bsize;
+       cur_cpu_spec->icache_bsize = icache_bsize;
+
        DBG(" <- initialize_cache_info()\n");
 }
 
@@ -655,7 +661,7 @@ void __init emergency_stack_init(void)
 
 static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, size_t align)
 {
-       return __alloc_bootmem_node(NODE_DATA(cpu_to_node(cpu)), size, align,
+       return __alloc_bootmem_node(NODE_DATA(early_cpu_to_node(cpu)), size, align,
                                    __pa(MAX_DMA_ADDRESS));
 }
 
@@ -666,7 +672,7 @@ static void __init pcpu_fc_free(void *ptr, size_t size)
 
 static int pcpu_cpu_distance(unsigned int from, unsigned int to)
 {
-       if (cpu_to_node(from) == cpu_to_node(to))
+       if (early_cpu_to_node(from) == early_cpu_to_node(to))
                return LOCAL_DISTANCE;
        else
                return REMOTE_DISTANCE;