]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/ppc64/kernel/prom_init.c
ppc64: move stack switching up in interrupt processing
[karo-tx-linux.git] / arch / ppc64 / kernel / prom_init.c
index adcf972711fc1c8a24d81279173c0fa1823ee064..e4c880dab997bf9cc7baeb33efe3cd54bcca22fc 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/init.h>
-#include <linux/version.h>
 #include <linux/threads.h>
 #include <linux/spinlock.h>
 #include <linux/types.h>
@@ -45,8 +44,6 @@
 #include <asm/pgtable.h>
 #include <asm/pci.h>
 #include <asm/iommu.h>
-#include <asm/bootinfo.h>
-#include <asm/ppcdebug.h>
 #include <asm/btext.h>
 #include <asm/sections.h>
 #include <asm/machdep.h>
@@ -892,7 +889,10 @@ static void __init prom_init_mem(void)
        if ( RELOC(of_platform) == PLATFORM_PSERIES_LPAR )
                RELOC(alloc_top) = RELOC(rmo_top);
        else
-               RELOC(alloc_top) = RELOC(rmo_top) = min(0x40000000ul, RELOC(ram_top));
+               /* Some RS64 machines have buggy firmware where claims up at 1GB
+                * fails. Cap at 768MB as a workaround. Still plenty of room.
+                */
+               RELOC(alloc_top) = RELOC(rmo_top) = min(0x30000000ul, RELOC(ram_top));
 
        prom_printf("memory layout at init:\n");
        prom_printf("  memory_limit : %x (16 MB aligned)\n", RELOC(prom_memory_limit));
@@ -1709,6 +1709,7 @@ static void __init flatten_device_tree(void)
        unsigned long offset = reloc_offset();
        unsigned long mem_start, mem_end, room;
        struct boot_param_header *hdr;
+       struct prom_t *_prom = PTRRELOC(&prom);
        char *namep;
        u64 *rsvmap;
 
@@ -1763,6 +1764,7 @@ static void __init flatten_device_tree(void)
        RELOC(dt_struct_end) = PAGE_ALIGN(mem_start);
 
        /* Finish header */
+       hdr->boot_cpuid_phys = _prom->cpu;
        hdr->magic = OF_DT_HEADER;
        hdr->totalsize = RELOC(dt_struct_end) - RELOC(dt_header_start);
        hdr->off_dt_struct = RELOC(dt_struct_start) - RELOC(dt_header_start);
@@ -1822,7 +1824,7 @@ static void __init fixup_device_tree(void)
        if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev))
            == PROM_ERROR)
                return;
-       if (u3_rev != 0x35 && u3_rev != 0x37)
+       if (u3_rev < 0x35 || u3_rev > 0x39)
                return;
        /* does it need fixup ? */
        if (prom_getproplen(i2c, "interrupts") > 0)
@@ -1852,7 +1854,6 @@ static void __init prom_find_boot_cpu(void)
 
        cpu_pkg = call_prom("instance-to-package", 1, 1, prom_cpu);
 
-       prom_setprop(cpu_pkg, "linux,boot-cpu", NULL, 0);
        prom_getprop(cpu_pkg, "reg", &getprop_rval, sizeof(getprop_rval));
        _prom->cpu = getprop_rval;
 
@@ -1937,9 +1938,9 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4, unsigned long
                prom_send_capabilities();
 
        /*
-        * On pSeries and BPA, copy the CPU hold code
+        * On pSeries and Cell, copy the CPU hold code
         */
-               if (RELOC(of_platform) & (PLATFORM_PSERIES | PLATFORM_BPA))
+               if (RELOC(of_platform) & (PLATFORM_PSERIES | PLATFORM_CELL))
                        copy_and_flush(0, KERNELBASE - offset, 0x100, 0);
 
        /*