]> git.hungrycats.org Git - linux/commitdiff
[PATCH] console autodetection for pmac
authorAndrew Morton <akpm@osdl.org>
Sat, 22 May 2004 03:37:30 +0000 (20:37 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 22 May 2004 03:37:30 +0000 (20:37 -0700)
From: Olaf Hering <olh@suse.de>

This one allows console autodetection for powermacs.

arch/ppc64/kernel/setup.c

index 65b9356ebd96f9c47de82d3b3dc62fbffe2de916..94b48786824941cdb21af9f4f7382fd0d7c897b2 100644 (file)
@@ -476,6 +476,7 @@ static int __init set_preferred_console(void)
 {
        struct device_node *prom_stdout;
        char *name;
+       int offset;
 
        /* The user has requested a console so this is already set up. */
        if (strstr(saved_command_line, "console="))
@@ -493,7 +494,6 @@ static int __init set_preferred_console(void)
                int i;
                u32 *reg = (u32 *)get_property(prom_stdout, "reg", &i);
                if (i > 8) {
-                       int offset;
                        switch (reg[1]) {
                                case 0x3f8:
                                        offset = 0;
@@ -511,15 +511,19 @@ static int __init set_preferred_console(void)
                                        /* We dont recognise the serial port */
                                        return -ENODEV;
                        }
-
-                       return add_preferred_console("ttyS", offset, NULL);
                }
-       } else if (strcmp(name, "vty") == 0) {
+       } else if (strcmp(name, "vty") == 0)
                /* pSeries LPAR virtual console */
                return add_preferred_console("hvc", 0, NULL);
-       }
+       else if (strcmp(name, "ch-a") == 0)
+               offset = 0;
+       else if (strcmp(name, "ch-b") == 0)
+               offset = 1;
+       else
+               return -ENODEV;
+
+       return add_preferred_console("ttyS", offset, NULL);
 
-       return -ENODEV;
 }
 console_initcall(set_preferred_console);