diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2006-07-04 00:06:29 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-07-07 06:19:15 -0400 |
commit | e8c0acf9a4fe3b2b6847541bf5cc3c86c18272ec (patch) | |
tree | e3017dabe83ffb716bd91c33b50c61fa1ff1a75a | |
parent | 3a09aa4730f021ad917a66a0c6d2ff6d616a7e4f (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>
-rw-r--r-- | arch/powerpc/kernel/prom_init.c | 34 |
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 */ | ||
2035 | static 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) |
2034 | static void __init fixup_device_tree_pmac(void) | 2067 | static void __init fixup_device_tree_pmac(void) |
2035 | { | 2068 | { |
@@ -2077,6 +2110,7 @@ static void __init fixup_device_tree_pmac(void) | |||
2077 | static void __init fixup_device_tree(void) | 2110 | static 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 | ||