aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/prom_init.c
diff options
context:
space:
mode:
authorOlaf Hering <olaf@aepfle.de>2007-04-04 12:20:04 -0400
committerPaul Mackerras <paulus@samba.org>2007-04-12 14:00:25 -0400
commite48059225c2edc6f1e5a2008261f1efdf606f247 (patch)
treee4c3bc21bc53b0014dfa8a0c1982f84a3e55b028 /arch/powerpc/kernel/prom_init.c
parent9c1a2bae0cc52b21121ea2380a2db0294ad0d8e7 (diff)
[POWERPC] Add correct interrupt property for pegasos ide
The firmware assigns irq 20/21 to the VIA IDE device on Pegasos. But the required interrupt is 14/15. Maybe someone confused decimal vs. hexadecimal values. Signed-off-by: Olaf Hering <olaf@aepfle.de> 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.c55
1 files changed, 33 insertions, 22 deletions
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 4fb5938ce6d3..e27d9d1b6e67 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -2035,39 +2035,50 @@ static void __init fixup_device_tree_maple(void)
2035#endif 2035#endif
2036 2036
2037#ifdef CONFIG_PPC_CHRP 2037#ifdef CONFIG_PPC_CHRP
2038/* Pegasos and BriQ lacks the "ranges" property in the isa node */ 2038/*
2039 * Pegasos and BriQ lacks the "ranges" property in the isa node
2040 * Pegasos needs decimal IRQ 14/15, not hexadecimal
2041 */
2039static void __init fixup_device_tree_chrp(void) 2042static void __init fixup_device_tree_chrp(void)
2040{ 2043{
2041 phandle isa; 2044 phandle ph;
2042 u32 isa_ranges[6]; 2045 u32 prop[6];
2043 u32 rloc = 0x01006000; /* IO space; PCI device = 12 */ 2046 u32 rloc = 0x01006000; /* IO space; PCI device = 12 */
2044 char *name; 2047 char *name;
2045 int rc; 2048 int rc;
2046 2049
2047 name = "/pci@80000000/isa@c"; 2050 name = "/pci@80000000/isa@c";
2048 isa = call_prom("finddevice", 1, 1, ADDR(name)); 2051 ph = call_prom("finddevice", 1, 1, ADDR(name));
2049 if (!PHANDLE_VALID(isa)) { 2052 if (!PHANDLE_VALID(ph)) {
2050 name = "/pci@ff500000/isa@6"; 2053 name = "/pci@ff500000/isa@6";
2051 isa = call_prom("finddevice", 1, 1, ADDR(name)); 2054 ph = call_prom("finddevice", 1, 1, ADDR(name));
2052 rloc = 0x01003000; /* IO space; PCI device = 6 */ 2055 rloc = 0x01003000; /* IO space; PCI device = 6 */
2053 } 2056 }
2054 if (!PHANDLE_VALID(isa)) 2057 if (PHANDLE_VALID(ph)) {
2055 return; 2058 rc = prom_getproplen(ph, "ranges");
2056 2059 if (rc == 0 || rc == PROM_ERROR) {
2057 rc = prom_getproplen(isa, "ranges"); 2060 prom_printf("Fixing up missing ISA range on Pegasos...\n");
2058 if (rc != 0 && rc != PROM_ERROR) 2061
2059 return; 2062 prop[0] = 0x1;
2060 2063 prop[1] = 0x0;
2061 prom_printf("Fixing up missing ISA range on Pegasos...\n"); 2064 prop[2] = rloc;
2065 prop[3] = 0x0;
2066 prop[4] = 0x0;
2067 prop[5] = 0x00010000;
2068 prom_setprop(ph, name, "ranges", prop, sizeof(prop));
2069 }
2070 }
2062 2071
2063 isa_ranges[0] = 0x1; 2072 name = "/pci@80000000/ide@C,1";
2064 isa_ranges[1] = 0x0; 2073 ph = call_prom("finddevice", 1, 1, ADDR(name));
2065 isa_ranges[2] = rloc; 2074 if (PHANDLE_VALID(ph)) {
2066 isa_ranges[3] = 0x0; 2075 prom_printf("Fixing up IDE interrupt on Pegasos...\n");
2067 isa_ranges[4] = 0x0; 2076 prop[0] = 14;
2068 isa_ranges[5] = 0x00010000; 2077 prop[1] = 0x0;
2069 prom_setprop(isa, name, "ranges", 2078 prop[2] = 15;
2070 isa_ranges, sizeof(isa_ranges)); 2079 prop[3] = 0x0;
2080 prom_setprop(ph, name, "interrupts", prop, 4*sizeof(u32));
2081 }
2071} 2082}
2072#else 2083#else
2073#define fixup_device_tree_chrp() 2084#define fixup_device_tree_chrp()