Merge branch 'fixes' into next
[linux-2.6-block.git] / arch / powerpc / kernel / prom_init.c
index 00682b8df3305aa16c5ede61467a33f5207978f9..a3fb90bb5a3968d4570db3469d235146bf571449 100644 (file)
@@ -172,6 +172,7 @@ static unsigned long __prombss prom_tce_alloc_end;
 
 #ifdef CONFIG_PPC_PSERIES
 static bool __prombss prom_radix_disable;
+static bool __prombss prom_xive_disable;
 #endif
 
 struct platform_support {
@@ -808,6 +809,12 @@ static void __init early_cmdline_parse(void)
        }
        if (prom_radix_disable)
                prom_debug("Radix disabled from cmdline\n");
+
+       opt = prom_strstr(prom_cmd_line, "xive=off");
+       if (opt) {
+               prom_xive_disable = true;
+               prom_debug("XIVE disabled from cmdline\n");
+       }
 #endif /* CONFIG_PPC_PSERIES */
 }
 
@@ -1216,10 +1223,17 @@ static void __init prom_parse_xive_model(u8 val,
        switch (val) {
        case OV5_FEAT(OV5_XIVE_EITHER): /* Either Available */
                prom_debug("XIVE - either mode supported\n");
-               support->xive = true;
+               support->xive = !prom_xive_disable;
                break;
        case OV5_FEAT(OV5_XIVE_EXPLOIT): /* Only Exploitation mode */
                prom_debug("XIVE - exploitation mode supported\n");
+               if (prom_xive_disable) {
+                       /*
+                        * If we __have__ to do XIVE, we're better off ignoring
+                        * the command line rather than not booting.
+                        */
+                       prom_printf("WARNING: Ignoring cmdline option xive=off\n");
+               }
                support->xive = true;
                break;
        case OV5_FEAT(OV5_XIVE_LEGACY): /* Only Legacy mode */
@@ -1566,9 +1580,6 @@ static void __init reserve_mem(u64 base, u64 size)
 static void __init prom_init_mem(void)
 {
        phandle node;
-#ifdef DEBUG_PROM
-       char *path;
-#endif
        char type[64];
        unsigned int plen;
        cell_t *p, *endp;
@@ -1590,9 +1601,6 @@ static void __init prom_init_mem(void)
        prom_debug("root_size_cells: %x\n", rsc);
 
        prom_debug("scanning memory:\n");
-#ifdef DEBUG_PROM
-       path = prom_scratch;
-#endif
 
        for (node = 0; prom_next_node(&node); ) {
                type[0] = 0;
@@ -1617,9 +1625,10 @@ static void __init prom_init_mem(void)
                endp = p + (plen / sizeof(cell_t));
 
 #ifdef DEBUG_PROM
-               memset(path, 0, sizeof(prom_scratch));
-               call_prom("package-to-path", 3, 1, node, path, sizeof(prom_scratch) - 1);
-               prom_debug("  node %s :\n", path);
+               memset(prom_scratch, 0, sizeof(prom_scratch));
+               call_prom("package-to-path", 3, 1, node, prom_scratch,
+                         sizeof(prom_scratch) - 1);
+               prom_debug("  node %s :\n", prom_scratch);
 #endif /* DEBUG_PROM */
 
                while ((endp - p) >= (rac + rsc)) {
@@ -2340,6 +2349,7 @@ static void __init prom_check_displays(void)
                        prom_printf("W=%d H=%d LB=%d addr=0x%x\n",
                                    width, height, pitch, addr);
                        btext_setup_display(width, height, 8, pitch, addr);
+                       btext_prepare_BAT();
                }
 #endif /* CONFIG_PPC_EARLY_DEBUG_BOOTX */
        }