]> err.no Git - linux-2.6/blobdiff - arch/sparc64/kernel/prom.c
tty: The big operations rework
[linux-2.6] / arch / sparc64 / kernel / prom.c
index d1a78c976cef0cfe73c9b51a2610d3ab4fa4d015..ed03a18d3b36da1b48148109595b0443733492b0 100644 (file)
@@ -19,8 +19,8 @@
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/mm.h>
-#include <linux/bootmem.h>
 #include <linux/module.h>
+#include <linux/lmb.h>
 
 #include <asm/prom.h>
 #include <asm/of_device.h>
@@ -122,16 +122,20 @@ int of_find_in_proplist(const char *list, const char *match, int len)
 }
 EXPORT_SYMBOL(of_find_in_proplist);
 
-static unsigned int prom_early_allocated;
+static unsigned int prom_early_allocated __initdata;
 
 static void * __init prom_early_alloc(unsigned long size)
 {
+       unsigned long paddr = lmb_alloc(size, SMP_CACHE_BYTES);
        void *ret;
 
-       ret = __alloc_bootmem(size, SMP_CACHE_BYTES, 0UL);
-       if (ret != NULL)
-               memset(ret, 0, size);
+       if (!paddr) {
+               prom_printf("prom_early_alloc(%lu) failed\n");
+               prom_halt();
+       }
 
+       ret = __va(paddr);
+       memset(ret, 0, size);
        prom_early_allocated += size;
 
        return ret;
@@ -1046,7 +1050,8 @@ static void __init irq_trans_init(struct device_node *dp)
        if (!strcmp(dp->name, "fhc") &&
            !strcmp(dp->parent->name, "central"))
                return central_irq_trans_init(dp);
-       if (!strcmp(dp->name, "virtual-devices"))
+       if (!strcmp(dp->name, "virtual-devices") ||
+           !strcmp(dp->name, "niu"))
                return sun4v_vdev_irq_trans_init(dp);
 }
 
@@ -1583,8 +1588,12 @@ static void __init of_fill_in_cpu_data(void)
                ncpus_probed++;
 
 #ifdef CONFIG_SMP
-               if (cpuid >= NR_CPUS)
+               if (cpuid >= NR_CPUS) {
+                       printk(KERN_WARNING "Ignoring CPU %d which is "
+                              ">= NR_CPUS (%d)\n",
+                              cpuid, NR_CPUS);
                        continue;
+               }
 #else
                /* On uniprocessor we only want the values for the
                 * real physical cpu the kernel booted onto, however
@@ -1711,7 +1720,6 @@ static void __init of_console_init(void)
 
        of_console_device = dp;
 
-       prom_printf(msg, of_console_path);
        printk(msg, of_console_path);
 }