ppc64: Rearrange btext initialization for consistency with ppc32
authorPaul Mackerras <paulus@samba.org>
Sat, 22 Oct 2005 05:36:52 +0000 (15:36 +1000)
committerPaul Mackerras <paulus@samba.org>
Sat, 22 Oct 2005 05:36:52 +0000 (15:36 +1000)
Moved init_boot_display from arch/ppc64/kernel/pmac_setup.c to
arch/ppc64/kernel/btext.c and declared it in asm-ppc64/btext.h.
Call it from init_early rather than pmac_init_early.

Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/ppc64/kernel/btext.c
arch/ppc64/kernel/pmac_setup.c
arch/ppc64/kernel/setup.c
include/asm-ppc64/btext.h

index b6fbfbe9032d4f26cee7109116e1464f7ad8a385..506a37885c5c25728a2c334f68d4c8ce800983d2 100644 (file)
@@ -18,6 +18,7 @@
 #include <asm/io.h>
 #include <asm/lmb.h>
 #include <asm/processor.h>
+#include <asm/udbg.h>
 
 #undef NO_SCROLL
 
@@ -131,6 +132,47 @@ int btext_initialize(struct device_node *np)
        return 0;
 }
 
+static void btext_putc(unsigned char c)
+{
+       btext_drawchar(c);
+}
+
+void __init init_boot_display(void)
+{
+       char *name;
+       struct device_node *np = NULL; 
+       int rc = -ENODEV;
+
+       printk("trying to initialize btext ...\n");
+
+       name = (char *)get_property(of_chosen, "linux,stdout-path", NULL);
+       if (name != NULL) {
+               np = of_find_node_by_path(name);
+               if (np != NULL) {
+                       if (strcmp(np->type, "display") != 0) {
+                               printk("boot stdout isn't a display !\n");
+                               of_node_put(np);
+                               np = NULL;
+                       }
+               }
+       }
+       if (np)
+               rc = btext_initialize(np);
+       if (rc) {
+               for (np = NULL; (np = of_find_node_by_type(np, "display"));) {
+                       if (get_property(np, "linux,opened", NULL)) {
+                               printk("trying %s ...\n", np->full_name);
+                               rc = btext_initialize(np);
+                               printk("result: %d\n", rc);
+                       }
+                       if (rc == 0)
+                               break;
+               }
+       }
+       if (rc == 0 && udbg_putc == NULL)
+               udbg_putc = btext_putc;
+}
+
 
 /* Calc the base address of a given point (x,y) */
 static unsigned char * calc_base(int x, int y)
index c059805d8ccef59adc19ec0c09882711305abc2e..c3ea73df937d058379abf68b2dd557aa47e86192 100644 (file)
@@ -274,48 +274,6 @@ static void pmac_halt(void)
        pmac_power_off();
 }
 
-#ifdef CONFIG_BOOTX_TEXT
-static void btext_putc(unsigned char c)
-{
-       btext_drawchar(c);
-}
-
-static void __init init_boot_display(void)
-{
-       char *name;
-       struct device_node *np = NULL; 
-       int rc = -ENODEV;
-
-       printk("trying to initialize btext ...\n");
-
-       name = (char *)get_property(of_chosen, "linux,stdout-path", NULL);
-       if (name != NULL) {
-               np = of_find_node_by_path(name);
-               if (np != NULL) {
-                       if (strcmp(np->type, "display") != 0) {
-                               printk("boot stdout isn't a display !\n");
-                               of_node_put(np);
-                               np = NULL;
-                       }
-               }
-       }
-       if (np)
-               rc = btext_initialize(np);
-       if (rc == 0)
-               return;
-
-       for (np = NULL; (np = of_find_node_by_type(np, "display"));) {
-               if (get_property(np, "linux,opened", NULL)) {
-                       printk("trying %s ...\n", np->full_name);
-                       rc = btext_initialize(np);
-                       printk("result: %d\n", rc);
-               }
-               if (rc == 0)
-                       return;
-       }
-}
-#endif /* CONFIG_BOOTX_TEXT */
-
 /* 
  * Early initialization.
  */
@@ -333,13 +291,6 @@ static void __init pmac_init_early(void)
                sccdbg = 1;
                        udbg_init_scc(NULL);
                }
-#ifdef CONFIG_BOOTX_TEXT
-       else {
-               init_boot_display();
-
-               udbg_putc = btext_putc;
-       }
-#endif /* CONFIG_BOOTX_TEXT */
 
        /* Setup interrupt mapping options */
        ppc64_interrupt_controller = IC_OPEN_PIC;
index b7885028fcf1ac8b089c1b7b4d85d650b9085ea4..44ee6ebe9a603a24eabdf3f74685a56e7d988816 100644 (file)
@@ -585,6 +585,10 @@ void __init setup_system(void)
         */
        finish_device_tree();
 
+#ifdef CONFIG_BOOTX_TEXT
+       init_boot_display();
+#endif
+
        /*
         * Initialize xmon
         */
index 67aef0cc72c0f340b4523f79f8fbc207109f119a..71cce36bc63099e837b4081547acaa5c8f76442f 100644 (file)
@@ -15,6 +15,7 @@ extern int boot_text_mapped;
 extern int btext_initialize(struct device_node *np);
 
 extern void map_boot_text(void);
+extern void init_boot_display(void);
 extern void btext_update_display(unsigned long phys, int width, int height,
                                 int depth, int pitch);