prom_init.c (5a84d159061d914c8dd4aa372ac6e9529c2be453) prom_init.c (e48059225c2edc6f1e5a2008261f1efdf606f247)
1/*
2 * Procedures for interfacing to Open Firmware.
3 *
4 * Paul Mackerras August 1996.
5 * Copyright (C) 1996-2005 Paul Mackerras.
6 *
7 * Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner.
8 * {engebret|bergner}@us.ibm.com

--- 2021 unchanged lines hidden (view full) ---

2030 prom_setprop(isa, name, "ranges",
2031 isa_ranges, sizeof(isa_ranges));
2032}
2033#else
2034#define fixup_device_tree_maple()
2035#endif
2036
2037#ifdef CONFIG_PPC_CHRP
1/*
2 * Procedures for interfacing to Open Firmware.
3 *
4 * Paul Mackerras August 1996.
5 * Copyright (C) 1996-2005 Paul Mackerras.
6 *
7 * Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner.
8 * {engebret|bergner}@us.ibm.com

--- 2021 unchanged lines hidden (view full) ---

2030 prom_setprop(isa, name, "ranges",
2031 isa_ranges, sizeof(isa_ranges));
2032}
2033#else
2034#define fixup_device_tree_maple()
2035#endif
2036
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)
2040{
2042static void __init fixup_device_tree_chrp(void)
2043{
2041 phandle isa;
2042 u32 isa_ranges[6];
2044 phandle ph;
2045 u32 prop[6];
2043 u32 rloc = 0x01006000; /* IO space; PCI device = 12 */
2044 char *name;
2045 int rc;
2046
2047 name = "/pci@80000000/isa@c";
2046 u32 rloc = 0x01006000; /* IO space; PCI device = 12 */
2047 char *name;
2048 int rc;
2049
2050 name = "/pci@80000000/isa@c";
2048 isa = call_prom("finddevice", 1, 1, ADDR(name));
2049 if (!PHANDLE_VALID(isa)) {
2051 ph = call_prom("finddevice", 1, 1, ADDR(name));
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 */
2053 }
2055 rloc = 0x01003000; /* IO space; PCI device = 6 */
2056 }
2054 if (!PHANDLE_VALID(isa))
2055 return;
2057 if (PHANDLE_VALID(ph)) {
2058 rc = prom_getproplen(ph, "ranges");
2059 if (rc == 0 || rc == PROM_ERROR) {
2060 prom_printf("Fixing up missing ISA range on Pegasos...\n");
2056
2061
2057 rc = prom_getproplen(isa, "ranges");
2058 if (rc != 0 && rc != PROM_ERROR)
2059 return;
2062 prop[0] = 0x1;
2063 prop[1] = 0x0;
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 }
2060
2071
2061 prom_printf("Fixing up missing ISA range on Pegasos...\n");
2062
2063 isa_ranges[0] = 0x1;
2064 isa_ranges[1] = 0x0;
2065 isa_ranges[2] = rloc;
2066 isa_ranges[3] = 0x0;
2067 isa_ranges[4] = 0x0;
2068 isa_ranges[5] = 0x00010000;
2069 prom_setprop(isa, name, "ranges",
2070 isa_ranges, sizeof(isa_ranges));
2072 name = "/pci@80000000/ide@C,1";
2073 ph = call_prom("finddevice", 1, 1, ADDR(name));
2074 if (PHANDLE_VALID(ph)) {
2075 prom_printf("Fixing up IDE interrupt on Pegasos...\n");
2076 prop[0] = 14;
2077 prop[1] = 0x0;
2078 prop[2] = 15;
2079 prop[3] = 0x0;
2080 prom_setprop(ph, name, "interrupts", prop, 4*sizeof(u32));
2081 }
2071}
2072#else
2073#define fixup_device_tree_chrp()
2074#endif
2075
2076#if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC)
2077static void __init fixup_device_tree_pmac(void)
2078{

--- 351 unchanged lines hidden ---
2082}
2083#else
2084#define fixup_device_tree_chrp()
2085#endif
2086
2087#if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC)
2088static void __init fixup_device_tree_pmac(void)
2089{

--- 351 unchanged lines hidden ---