WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [pushed] [ppc] remove the device that Xen is using for console

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [pushed] [ppc] remove the device that Xen is using for console from the devtree we give dom0
From: jimix@xxxxxxxxxxxxxx
Date: Fri, 19 May 2006 07:05:09 -0400
Delivery-date: Fri, 19 May 2006 04:03:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
changeset:   10292:362e8769dba11053cc7d26ec9796698ac4219f93
user:        jimix@xxxxxxxxxxxxxxxxxxxxx
date:        Thu May 18 13:58:17 2006 -0400
files:       xen/arch/ppc/boot_of.c
description:
[ppc] remove the device that Xen is using for console from the devtree we give 
dom0


diff -r 953fd3f66b0015c8883815c89549fda1e920b4da -r 
362e8769dba11053cc7d26ec9796698ac4219f93 xen/arch/ppc/boot_of.c
--- a/xen/arch/ppc/boot_of.c    Thu May 18 13:57:33 2006 -0400
+++ b/xen/arch/ppc/boot_of.c    Thu May 18 13:58:17 2006 -0400
@@ -730,6 +730,79 @@ static ulong find_space(u32 size, ulong 
     }
 }
 
+
+static int __init boot_of_serial(void *oftree)
+{
+    int n;
+    int p;
+    int rc;
+    u32 val[3];
+    char buf[128];
+
+    n = of_instance_to_package(of_out);
+    if (n == OF_FAILURE) {
+        of_panic("instance-to-package of /chosen/stdout: failed\n");
+    }
+
+    /* prune this from the oftree */
+    rc = of_package_to_path(n, buf, sizeof(buf));
+    if (rc == OF_FAILURE) {
+        of_panic("package-to-path of /chosen/stdout: failed\n");
+    }
+    of_printf("Pruning from devtree: %s\n"
+              "  since Xen will be using it for console\n", buf);
+    rc = ofd_prune_path(oftree, buf);
+    if (rc < 0) {
+        of_panic("prune path \"%s\" failed\n", buf);
+    }
+    
+
+    p = of_getparent(n);
+    if (p == OF_FAILURE) {
+        of_panic("no parent for: 0x%x\n", n);
+    }
+
+    buf[0] = '\0';
+    of_getprop(p, "device_type", buf, sizeof (buf));
+    if (strstr(buf, "isa") == NULL) {
+        of_panic("only ISA UARTS supported\n");
+    }
+
+    /* should get this from devtree */
+    isa_io_base = 0xf4000000;
+    of_printf("%s: ISA base: 0x%lx\n", __func__, isa_io_base);
+
+    buf[0] = '\0';
+    of_getprop(n, "device_type", buf, sizeof (buf));
+    if (strstr(buf, "serial") == NULL) {
+        of_panic("only UARTS supported\n");
+    }
+
+    rc = of_getprop(n, "reg", val, sizeof (val));
+    if (rc == OF_FAILURE) {
+        of_panic("%s: no location for serial port\n", __func__);
+    }
+    ns16550.io_base = val[1];
+
+    ns16550.baud = BAUD_AUTO;
+    ns16550.data_bits = 8;
+    ns16550.parity = 'n';
+    ns16550.stop_bits = 1;
+
+    rc = of_getprop(n, "interrupts", val, sizeof (val));
+    if (rc == OF_FAILURE) {
+        of_printf("%s: no ISRC, forcing poll mode\n", __func__);
+        ns16550.irq = 0;
+    } else {
+        ns16550.irq = val[0];
+        of_printf("%s: ISRC=0x%x, but forcing poll mode\n",
+                  __func__, ns16550.irq);
+        ns16550.irq = 0;
+    }
+
+    return 1;
+}
+
 static void boot_of_module(ulong r3, ulong r4, multiboot_info_t *mbi)
 {
     static module_t mods[3];
@@ -828,66 +901,8 @@ static void boot_of_module(ulong r3, ulo
     mbi->flags |= MBI_MODULES;
     mbi->mods_count = 2;
     mbi->mods_addr = (u32)mods;
-}
-
-
-static int __init boot_of_serial(void)
-{
-    int n;
-    int p;
-    int rc;
-    u32 val[3];
-    char buf[64];
-
-    n = of_instance_to_package(of_out);
-    if (n == OF_FAILURE) {
-        of_panic("instance-to-package of /chosen/stdout: failed\n");
-    }
-
-    p = of_getparent(n);
-    if (p == OF_FAILURE) {
-        of_panic("no parent for: 0x%x\n", n);
-    }
-
-    buf[0] = '\0';
-    of_getprop(p, "device_type", buf, sizeof (buf));
-    if (strstr(buf, "isa") == NULL) {
-        of_panic("only ISA UARTS supported\n");
-    }
-
-    /* should get this from devtree */
-    isa_io_base = 0xf4000000;
-    of_printf("%s: ISA base: 0x%lx\n", __func__, isa_io_base);
-
-    buf[0] = '\0';
-    of_getprop(n, "device_type", buf, sizeof (buf));
-    if (strstr(buf, "serial") == NULL) {
-        of_panic("only UARTS supported\n");
-    }
-
-    rc = of_getprop(n, "reg", val, sizeof (val));
-    if (rc == OF_FAILURE) {
-        of_panic("%s: no location for serial port\n", __func__);
-    }
-    ns16550.io_base = val[1];
-
-    ns16550.baud = BAUD_AUTO;
-    ns16550.data_bits = 8;
-    ns16550.parity = 'n';
-    ns16550.stop_bits = 1;
-
-    rc = of_getprop(n, "interrupts", val, sizeof (val));
-    if (rc == OF_FAILURE) {
-        of_printf("%s: no ISRC, forcing poll mode\n", __func__);
-        ns16550.irq = 0;
-    } else {
-        ns16550.irq = val[0];
-      of_printf("%s: ISRC=0x%x, but forcing poll mode\n",
-                __func__, ns16550.irq);
-      ns16550.irq = 0;
-    }
-
-    return 1;
+
+    boot_of_serial(oftree);
 }
 
 static int __init boot_of_cpus(void)
@@ -1007,7 +1022,6 @@ multiboot_info_t __init *boot_of_init(
     boot_of_probemem(&mbi);
     boot_of_bootargs(&mbi);
     boot_of_module(r3, r4, &mbi);
-    boot_of_serial();
     boot_of_cpus();
     boot_of_rtas();
     boot_of_pic();



_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [XenPPC] [pushed] [ppc] remove the device that Xen is using for console from the devtree we give dom0, jimix <=