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] detect and fix ISA range in Maple/PIBS devtree

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [pushed] [ppc] detect and fix ISA range in Maple/PIBS devtree
From: jimix@xxxxxxxxxxxxxx
Date: Fri, 19 May 2006 11:00:09 -0400
Delivery-date: Fri, 19 May 2006 07:58:03 -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:   10298:a382b1f876b8dcfa7329581cc4f03dd6e26aa3fc
tag:         tip
user:        jimix@xxxxxxxxxxxxxxxxxxxxx
date:        Fri May 19 10:59:48 2006 -0400
files:       xen/arch/ppc/boot_of.c
description:
[ppc] detect and fix ISA range in Maple/PIBS devtree


diff -r 2c4956f3947b2d3af9e1c8c843589aea852c8667 -r 
a382b1f876b8dcfa7329581cc4f03dd6e26aa3fc xen/arch/ppc/boot_of.c
--- a/xen/arch/ppc/boot_of.c    Fri May 19 07:01:47 2006 -0400
+++ b/xen/arch/ppc/boot_of.c    Fri May 19 10:59:48 2006 -0400
@@ -199,8 +199,8 @@ static int __init of_getprop(int ph, con
     return rets[0];
 }
 
-#ifdef USE_SETPROP
-static int __init of_setprop(int ph, const char *name, void *buf, u32 buflen)
+static int __init of_setprop(
+    int ph, const char *name, const void *buf, u32 buflen)
 {
     int rets[1] = { OF_FAILURE };
 
@@ -214,7 +214,6 @@ static int __init of_setprop(int ph, con
     DBG("setprop 0x%x %s -> %s\n", ph, name, (char *)buf);
     return rets[0];
 }
-#endif
 
 /*
  * returns 0 if there are no children (of spec)
@@ -729,7 +728,35 @@ static ulong find_space(u32 size, ulong 
     }
 }
 
-
+/* PIBS Version 1.05.0000 04/26/2005 has an incorrect /ht/isa/ranges
+ * property.  The values are bad, and it doesn't even have the
+ * right number of cells. */
+
+static void __init boot_of_fix_maple(void)
+{
+    int isa;
+    const char *ranges = "ranges";
+    u32 isa_ranges[3];
+    const u32 isa_test[] = { 0x00000001, 0xf4000000, 0x00010000 };
+    const u32 isa_fixed[] = { 0x1, 0x0, 0x0, 0x0, 0x0, 0x00010000 };
+
+    isa = of_finddevice("/ht@0/isa@4");
+    if (isa != OF_FAILURE) {
+        if (of_getproplen(isa, ranges) == sizeof (isa_test)) {
+            of_getprop(isa, ranges, isa_ranges, sizeof (isa_ranges));
+            if (memcmp(isa_ranges, isa_test, sizeof (isa_test)) == 0) {
+                int rc;
+
+                of_printf("OF: fixing bogus ISA range on maple\n");
+                rc = of_setprop(isa, ranges, isa_fixed, sizeof (isa_fixed));
+                if (rc == OF_FAILURE) {
+                    of_panic("of_setprop() failed\n");
+                }
+            }
+        }
+    }
+}
+    
 static int __init boot_of_serial(void *oftree)
 {
     int n;
@@ -993,6 +1020,7 @@ multiboot_info_t __init *boot_of_init(
     }
     of_printf("%s: _start %p _end %p 0x%lx\n", __func__, _start, _end, r6);
 
+    boot_of_fix_maple();
     boot_of_probemem(&mbi);
     boot_of_bootargs(&mbi);
     boot_of_module(r3, r4, &mbi);



_______________________________________________
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] detect and fix ISA range in Maple/PIBS devtree, jimix <=