]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/kernel/setup_64.c
[POWERPC] 85xx: Add support for relocatable kernel (and booting at non-zero)
[linux-2.6-omap-h63xx.git] / arch / powerpc / kernel / setup_64.c
index 6018178708a55f76be298d405c0fd8d76c9af6b2..153a48dc8f40e351b1115e9d4a157e0248d2a9bd 100644 (file)
@@ -33,6 +33,8 @@
 #include <linux/serial_8250.h>
 #include <linux/bootmem.h>
 #include <linux/pci.h>
+#include <linux/lockdep.h>
+#include <linux/lmb.h>
 #include <asm/io.h>
 #include <asm/kdump.h>
 #include <asm/prom.h>
@@ -55,7 +57,6 @@
 #include <asm/cache.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <asm/lmb.h>
 #include <asm/firmware.h>
 #include <asm/xmon.h>
 #include <asm/udbg.h>
@@ -178,12 +179,15 @@ void __init early_setup(unsigned long dt_ptr)
        /* Enable early debugging if any specified (see udbg.h) */
        udbg_early_init();
 
+       /* Initialize lockdep early or else spinlocks will blow */
+       lockdep_init();
+
        DBG(" -> early_setup(), dt_ptr: 0x%lx\n", dt_ptr);
 
        /*
-        * Do early initializations using the flattened device
-        * tree, like retreiving the physical memory map or
-        * calculating/retreiving the hash table size
+        * Do early initialization using the flattened device
+        * tree, such as retrieving the physical memory map or
+        * calculating/retrieving the hash table size.
         */
        early_init_devtree(__va(dt_ptr));
 
@@ -291,23 +295,16 @@ static void __init initialize_cache_info(void)
                if ( num_cpus == 1 ) {
                        const u32 *sizep, *lsizep;
                        u32 size, lsize;
-                       const char *dc, *ic;
-
-                       /* Then read cache informations */
-                       if (machine_is(powermac)) {
-                               dc = "d-cache-block-size";
-                               ic = "i-cache-block-size";
-                       } else {
-                               dc = "d-cache-line-size";
-                               ic = "i-cache-line-size";
-                       }
 
                        size = 0;
                        lsize = cur_cpu_spec->dcache_bsize;
                        sizep = of_get_property(np, "d-cache-size", NULL);
                        if (sizep != NULL)
                                size = *sizep;
-                       lsizep = of_get_property(np, dc, NULL);
+                       lsizep = of_get_property(np, "d-cache-block-size", NULL);
+                       /* fallback if block size missing */
+                       if (lsizep == NULL)
+                               lsizep = of_get_property(np, "d-cache-line-size", NULL);
                        if (lsizep != NULL)
                                lsize = *lsizep;
                        if (sizep == 0 || lsizep == 0)
@@ -324,7 +321,9 @@ static void __init initialize_cache_info(void)
                        sizep = of_get_property(np, "i-cache-size", NULL);
                        if (sizep != NULL)
                                size = *sizep;
-                       lsizep = of_get_property(np, ic, NULL);
+                       lsizep = of_get_property(np, "i-cache-block-size", NULL);
+                       if (lsizep == NULL)
+                               lsizep = of_get_property(np, "i-cache-line-size", NULL);
                        if (lsizep != NULL)
                                lsize = *lsizep;
                        if (sizep == 0 || lsizep == 0)
@@ -426,14 +425,17 @@ void __init setup_system(void)
        printk("-----------------------------------------------------\n");
        printk("ppc64_pft_size                = 0x%lx\n", ppc64_pft_size);
        printk("physicalMemorySize            = 0x%lx\n", lmb_phys_mem_size());
-       printk("ppc64_caches.dcache_line_size = 0x%x\n",
-              ppc64_caches.dline_size);
-       printk("ppc64_caches.icache_line_size = 0x%x\n",
-              ppc64_caches.iline_size);
-       printk("htab_address                  = 0x%p\n", htab_address);
+       if (ppc64_caches.dline_size != 0x80)
+               printk("ppc64_caches.dcache_line_size = 0x%x\n",
+                      ppc64_caches.dline_size);
+       if (ppc64_caches.iline_size != 0x80)
+               printk("ppc64_caches.icache_line_size = 0x%x\n",
+                      ppc64_caches.iline_size);
+       if (htab_address)
+               printk("htab_address                  = 0x%p\n", htab_address);
        printk("htab_hash_mask                = 0x%lx\n", htab_hash_mask);
 #if PHYSICAL_START > 0
-       printk("physical_start                = 0x%x\n", PHYSICAL_START);
+       printk("physical_start                = 0x%lx\n", PHYSICAL_START);
 #endif
        printk("-----------------------------------------------------\n");
 
@@ -512,7 +514,7 @@ void __init setup_arch(char **cmdline_p)
        if (ppc_md.panic)
                setup_panic();
 
-       init_mm.start_code = PAGE_OFFSET;
+       init_mm.start_code = (unsigned long)_stext;
        init_mm.end_code = (unsigned long) _etext;
        init_mm.end_data = (unsigned long) _edata;
        init_mm.brk = klimit;
@@ -530,7 +532,8 @@ void __init setup_arch(char **cmdline_p)
        conswitchp = &dummy_con;
 #endif
 
-       ppc_md.setup_arch();
+       if (ppc_md.setup_arch)
+               ppc_md.setup_arch();
 
        paging_init();
        ppc64_boot_msg(0x15, "Setup Done");
@@ -596,6 +599,9 @@ void __init setup_per_cpu_areas(void)
                paca[i].data_offset = ptr - __per_cpu_start;
                memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start);
        }
+
+       /* Now that per_cpu is setup, initialize cpu_sibling_map */
+       smp_setup_cpu_sibling_map();
 }
 #endif