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
|