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] Warning: fix RTC/NVRAM accesses on Maple

To: Maria Butrico <butrico@xxxxxxxxxxxxxx>
Subject: [XenPPC] Warning: fix RTC/NVRAM accesses on Maple
From: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Date: Fri, 19 May 2006 07:18:04 -0400
Cc: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 19 May 2006 04:18:49 -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>
References: <1147988040.2692.40.camel@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hollis discovered that Linux could not find the ISA bus. It turns out the PIBS ISA information is incorrect, making finding ISA devices in a "documented" way impossible. We are patching linux, I'll be adding a similar work-around on Xen so you can find the UART :)

Hollis's Linux diff is below.
-JX

Begin forwarded message:

From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: May 18, 2006 5:34:00 PM EDT
To: linuxppc-dev@xxxxxxxxxx
Cc: Ben Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Subject: [patch] fix RTC/NVRAM accesses on Maple

It looks like RTC and NVRAM accesses (including halt/reboot) on Maple
have been broken since January, when an untested build fix went in
("[PATCH] powerpc: Fix Maple build").

PIBS (the firmware on Maple) has a bad "ranges" property for the ISA
bus, which means of_address_to_resource() fails for ISA devices, and
that breaks maple_find_nvram_base() and maple_get_boot_time().

This patch adds ifdefs mid-file, but some were already present anyways,
and I don't see a better way.

Please apply.

--
Hollis Blanchard
IBM Linux Technology Center

Signed-off-by: Hollis Blanchard <hollisb@xxxxxxxxxx>

diff -r 5158eb8d85b7 arch/powerpc/kernel/prom_init.c
--- a/arch/powerpc/kernel/prom_init.c   Thu May 18 11:32:22 2006 +0700
+++ b/arch/powerpc/kernel/prom_init.c   Thu May 18 16:23:40 2006 -0500
@@ -2057,10 +2057,44 @@ static void __init flatten_device_tree(v

 }

-
-static void __init fixup_device_tree(void)
-{
+#ifdef CONFIG_PPC_MAPLE
+/* 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 fixup_device_tree_maple(void)
+{
+       phandle isa;
+       u32 isa_ranges[6];
+
+       isa = call_prom("finddevice", 1, 1, ADDR("/ht@0/isa@4"));
+       if (!PHANDLE_VALID(isa))
+               return;
+
+       if (prom_getprop(isa, "ranges", isa_ranges, sizeof(isa_ranges))
+           == PROM_ERROR)
+               return;
+
+       if (isa_ranges[0] != 0x1 ||
+           isa_ranges[1] != 0xf4000000 ||
+           isa_ranges[2] != 0x00010000)
+               return;
+
+       prom_printf("fixing up bogus ISA range on Maple...\n");
+
+       isa_ranges[0] = 0x1;
+       isa_ranges[1] = 0x0;
+       isa_ranges[2] = 0x0;
+       isa_ranges[3] = 0x0;
+       isa_ranges[4] = 0x0;
+       isa_ranges[5] = 0x00010000;
+       prom_setprop(isa, "/ht@0/isa@4", "ranges",
+                    isa_ranges, sizeof(isa_ranges));
+}
+#endif
+
+               
 #if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC)
+static void __init fixup_device_tree_pmac(void)
+{
        phandle u3, i2c, mpic;
        u32 u3_rev;
        u32 interrupts[2];
@@ -2097,9 +2131,18 @@ static void __init fixup_device_tree(voi
        parent = (u32)mpic;
        prom_setprop(i2c, "/u3@0,f8000000/i2c@f8001000", "interrupt-parent",
                     &parent, sizeof(parent));
-#endif
-}
-
+}
+#endif
+
+static void __init fixup_device_tree(void)
+{
+#ifdef CONFIG_PPC_MAPLE
+       fixup_device_tree_maple();
+#endif
+#if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC)
+       fixup_device_tree_pmac();
+#endif
+}

 static void __init prom_find_boot_cpu(void)
 {




_______________________________________________
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] Warning: fix RTC/NVRAM accesses on Maple, Jimi Xenidis <=