<br><br><div class="gmail_quote">2009/2/27 Benjamin Herrenschmidt <span dir="ltr"><<a href="mailto:benh@kernel.crashing.org">benh@kernel.crashing.org</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Thu, 2009-02-26 at 18:08 +0800, Tiejun Chen wrote:<br>
> In the DTB tree created by firmware on Maple 64bit target, host bridge<br>
> parent<br>
> node has specified both of these two properties to be 2. However, the<br>
> actual<br>
> "cell" value for host bridge node is 1. we have to provide one fixup<br>
> function.<br>
<br>
</div>Hi !<br>
<br>
Thanks for the patch. A couple of things tho: Can you make it a bit<br>
more robust by properly checking the board type first ?</blockquote><div><br>That is ATCA 6101 and the following is from the MOTLoad firmware.<br>------<br>Copyright Motorola Inc. 1999-2006, All Rights Reserved<br>MOTLoad RTOS Version 2.0, PAL Version 1.1 RM01<br>
Built on Tue Jun 13 10:31:56 EDT 2006 by q3316c<br>bbs 2.0 build 38<br><br>Part Number =01-W3930F04A<br>Serial Number =0000001<br><br>MPU-Type =PPC970FX DD3.1<br>MPU-Int Clock Speed =1800MHz<br>
Memory Speed =333MHz<br><br>PCI bus instance 1 =64 bit, 100 MHz, PCI-X<br>PCI bus instance 2 =64 bit, 100 MHz, PCI-X<br>PCI bus instance 3 =64 bit, 100 MHz, PCI-X<br>PCI bus instance 4 =64 bit, 100 MHz, PCI-X<br>
PCI bus instance 5 =32 bit, 33 MHz, PCI<br><br>HT Link instance 1 =16 bit, 400 MHz<br>HT Link instance 2 = 8 bit, 600 MHz<br>HT Link instance 3 = 8 bit, 200 MHz<br><br>MOTLoad FLASH Image =FLASH Bank A<br><br>Local Memory Found =080000000 (&2147483648)<br>
User Download Buffer =0611A5000:0613A4FFF<br>------<br><br>Here is some board information I can know:<br>------<br>Board revision: 01<br>Boot loader version: 2.0<br>Silicon revision: 3.1 (pvr 003c 0301) <br>------<br><br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
Also, what is this "hostbridge" node ? ie, what does it represent ?</blockquote><div><br> That means IBM CPC925 system controller resided on the ATCA 6101.<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
Can you send me a full dump of /proc/device-tree from the machine ?<br>
(ie tar it up)<br>
</blockquote><div><br>See the attachment.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Finally, it looks like your patch was whitespace damaged by your mailer.<br>
</blockquote><div><br>After you confirm others is ok I will send v2 improved patch.<br><br>Thanks & Best Regards<br>Tiejun<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Cheers,<br>
Ben.<br>
<div><div></div><div class="Wj3C7c"><br>
<br>
> Signed-off-by: Tiejun Chen <<a href="mailto:tiejun.china@gmail.com">tiejun.china@gmail.com</a>><br>
> ---<br>
> arch/powerpc/kernel/prom_init.c | 42<br>
> +++++++++++++++++++++++++++++++++++++++<br>
> 1 files changed, 42 insertions(+), 0 deletions(-)<br>
><br>
> diff --git a/arch/powerpc/kernel/prom_init.c<br>
> b/arch/powerpc/kernel/prom_init.c<br>
> index 2445945..9cd23b6 100644<br>
> --- a/arch/powerpc/kernel/prom_init.c<br>
> +++ b/arch/powerpc/kernel/prom_init.c<br>
> @@ -1948,8 +1948,49 @@ static void __init<br>
> fixup_device_tree_maple(void)<br>
> prom_setprop(isa, name, "ranges",<br>
> isa_ranges, sizeof(isa_ranges));<br>
> }<br>
> +<br>
> +/* On Maple 64bit target host bridge parent node has specified<br>
> address and<br>
> + * size properties to be 2. But the actual "cell" value for host<br>
> bridge node<br>
> + * is 1 since early MOTLoad internal bug. */<br>
> +static void __init fixup_device_tree_maple_hb(void)<br>
> +{<br>
> + phandle hb;<br>
> + u32 hb_ranges[4];<br>
> + u32 size_cell, addr_cell;<br>
> + struct prom_t *_prom = &RELOC(prom);<br>
> + char *name;<br>
> +<br>
> + name = "/hostbridge@f8000000";<br>
> + hb = call_prom("finddevice", 1, 1, ADDR(name));<br>
> + if (!PHANDLE_VALID(hb))<br>
> + return;<br>
> +<br>
> + if (prom_getproplen(hb, "reg") != 8)<br>
> + return;<br>
> +<br>
> + if (prom_getprop(hb, "reg", hb_ranges, (sizeof(hb_ranges))/2)<br>
> + == PROM_ERROR)<br>
> + return;<br>
> +<br>
> + prom_getprop(_prom->root, "#address-cells", &addr_cell,<br>
> sizeof(addr_cell));<br>
> + prom_getprop(_prom->root, "#size-cells", &size_cell,<br>
> sizeof(size_cell));<br>
> +<br>
> + if ((addr_cell != 2) || (size_cell != 2) ||<br>
> + (hb_ranges[0] != 0xf8000000))<br>
> + return;<br>
> +<br>
> + prom_printf("Fixing up bogus HOSTBRIDGE reg on<br>
> Maple/Apache...\n");<br>
> +<br>
> + hb_ranges[3] = hb_ranges[1];<br>
> + hb_ranges[1] = hb_ranges[0];<br>
> + hb_ranges[0] = hb_ranges[2] = 0;<br>
> + prom_setprop(hb, name, "reg",<br>
> + hb_ranges, sizeof(hb_ranges));<br>
> +}<br>
> +<br>
> #else<br>
> #define fixup_device_tree_maple()<br>
> +#define fixup_device_tree_maple_hb()<br>
> #endif<br>
><br>
> #ifdef CONFIG_PPC_CHRP<br>
> @@ -2190,6 +2231,7 @@ static void __init fixup_device_tree_efika(void)<br>
> static void __init fixup_device_tree(void)<br>
> {<br>
> fixup_device_tree_maple();<br>
> + fixup_device_tree_maple_hb();<br>
> fixup_device_tree_chrp();<br>
> fixup_device_tree_pmac();<br>
> fixup_device_tree_efika();<br>
> --<br>
> 1.5.6<br>
><br>
><br>
><br>
<br>
</div></div></blockquote></div><br>