aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/prom_init.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2006-07-04 00:06:29 -0400
committerPaul Mackerras <paulus@samba.org>2006-07-25 11:26:24 -0400
commitf0ca330bc4ce00377f940b786d7ec7d848dc4102 (patch)
treea07461c721eb08012f3997b1a91c4d3172d4d34c /arch/powerpc/kernel/prom_init.c
parentd1a8df9136ff55e554e11ce65854c282965be8f5 (diff)
[POWERPC] Workaround Pegasos incorrect ISA "ranges"
The Pegasos firmware doesn't create a valid "ranges" property for the ISA bridge, thus causing translation of ISA addresses and IO ports to fail. This fixes it, thus re-enabling proper early serial console to work on Pegasos. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/prom_init.c')
-rw-r--r--arch/powerpc/kernel/prom_init.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index ebd501a59abd..b6c3ac20c14c 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -2030,6 +2030,39 @@ static void __init fixup_device_tree_maple(void)
2030#define fixup_device_tree_maple() 2030#define fixup_device_tree_maple()
2031#endif 2031#endif
2032 2032
2033#ifdef CONFIG_PPC_CHRP
2034/* Pegasos lacks the "ranges" property in the isa node */
2035static void __init fixup_device_tree_chrp(void)
2036{
2037 phandle isa;
2038 u32 isa_ranges[6];
2039 char *name;
2040 int rc;
2041
2042 name = "/pci@80000000/isa@c";
2043 isa = call_prom("finddevice", 1, 1, ADDR(name));
2044 if (!PHANDLE_VALID(isa))
2045 return;
2046
2047 rc = prom_getproplen(isa, "ranges");
2048 if (rc != 0 && rc != PROM_ERROR)
2049 return;
2050
2051 prom_printf("Fixing up missing ISA range on Pegasos...\n");
2052
2053 isa_ranges[0] = 0x1;
2054 isa_ranges[1] = 0x0;
2055 isa_ranges[2] = 0x01006000;
2056 isa_ranges[3] = 0x0;
2057 isa_ranges[4] = 0x0;
2058 isa_ranges[5] = 0x00010000;
2059 prom_setprop(isa, name, "ranges",
2060 isa_ranges, sizeof(isa_ranges));
2061}
2062#else
2063#define fixup_device_tree_chrp()
2064#endif
2065
2033#if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC) 2066#if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC)
2034static void __init fixup_device_tree_pmac(void) 2067static void __init fixup_device_tree_pmac(void)
2035{ 2068{
@@ -2077,6 +2110,7 @@ static void __init fixup_device_tree_pmac(void)
2077static void __init fixup_device_tree(void) 2110static void __init fixup_device_tree(void)
2078{ 2111{
2079 fixup_device_tree_maple(); 2112 fixup_device_tree_maple();
2113 fixup_device_tree_chrp();
2080 fixup_device_tree_pmac(); 2114 fixup_device_tree_pmac();
2081} 2115}
2082 2116