aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/prom_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/prom_init.c')
-rw-r--r--arch/powerpc/kernel/prom_init.c60
1 files changed, 56 insertions, 4 deletions
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 078fb5533541..f70bd090dacd 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -822,6 +822,7 @@ static void __init prom_send_capabilities(void)
822 /* try calling the ibm,client-architecture-support method */ 822 /* try calling the ibm,client-architecture-support method */
823 if (call_prom_ret("call-method", 3, 2, &ret, 823 if (call_prom_ret("call-method", 3, 2, &ret,
824 ADDR("ibm,client-architecture-support"), 824 ADDR("ibm,client-architecture-support"),
825 root,
825 ADDR(ibm_architecture_vec)) == 0) { 826 ADDR(ibm_architecture_vec)) == 0) {
826 /* the call exists... */ 827 /* the call exists... */
827 if (ret) 828 if (ret)
@@ -1622,6 +1623,15 @@ static int __init prom_find_machine_type(void)
1622 if (strstr(p, RELOC("Power Macintosh")) || 1623 if (strstr(p, RELOC("Power Macintosh")) ||
1623 strstr(p, RELOC("MacRISC"))) 1624 strstr(p, RELOC("MacRISC")))
1624 return PLATFORM_POWERMAC; 1625 return PLATFORM_POWERMAC;
1626#ifdef CONFIG_PPC64
1627 /* We must make sure we don't detect the IBM Cell
1628 * blades as pSeries due to some firmware issues,
1629 * so we do it here.
1630 */
1631 if (strstr(p, RELOC("IBM,CBEA")) ||
1632 strstr(p, RELOC("IBM,CPBW-1.0")))
1633 return PLATFORM_GENERIC;
1634#endif /* CONFIG_PPC64 */
1625 i += sl + 1; 1635 i += sl + 1;
1626 } 1636 }
1627 } 1637 }
@@ -1636,7 +1646,7 @@ static int __init prom_find_machine_type(void)
1636 compat, sizeof(compat)-1); 1646 compat, sizeof(compat)-1);
1637 if (len <= 0) 1647 if (len <= 0)
1638 return PLATFORM_GENERIC; 1648 return PLATFORM_GENERIC;
1639 if (strncmp(compat, RELOC("chrp"), 4)) 1649 if (strcmp(compat, RELOC("chrp")))
1640 return PLATFORM_GENERIC; 1650 return PLATFORM_GENERIC;
1641 1651
1642 /* Default to pSeries. We need to know if we are running LPAR */ 1652 /* Default to pSeries. We need to know if we are running LPAR */
@@ -2057,10 +2067,45 @@ static void __init flatten_device_tree(void)
2057 2067
2058} 2068}
2059 2069
2060 2070#ifdef CONFIG_PPC_MAPLE
2061static void __init fixup_device_tree(void) 2071/* PIBS Version 1.05.0000 04/26/2005 has an incorrect /ht/isa/ranges property.
2072 * The values are bad, and it doesn't even have the right number of cells. */
2073static void __init fixup_device_tree_maple(void)
2062{ 2074{
2075 phandle isa;
2076 u32 isa_ranges[6];
2077
2078 isa = call_prom("finddevice", 1, 1, ADDR("/ht@0/isa@4"));
2079 if (!PHANDLE_VALID(isa))
2080 return;
2081
2082 if (prom_getprop(isa, "ranges", isa_ranges, sizeof(isa_ranges))
2083 == PROM_ERROR)
2084 return;
2085
2086 if (isa_ranges[0] != 0x1 ||
2087 isa_ranges[1] != 0xf4000000 ||
2088 isa_ranges[2] != 0x00010000)
2089 return;
2090
2091 prom_printf("fixing up bogus ISA range on Maple...\n");
2092
2093 isa_ranges[0] = 0x1;
2094 isa_ranges[1] = 0x0;
2095 isa_ranges[2] = 0x01002000; /* IO space; PCI device = 4 */
2096 isa_ranges[3] = 0x0;
2097 isa_ranges[4] = 0x0;
2098 isa_ranges[5] = 0x00010000;
2099 prom_setprop(isa, "/ht@0/isa@4", "ranges",
2100 isa_ranges, sizeof(isa_ranges));
2101}
2102#else
2103#define fixup_device_tree_maple()
2104#endif
2105
2063#if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC) 2106#if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC)
2107static void __init fixup_device_tree_pmac(void)
2108{
2064 phandle u3, i2c, mpic; 2109 phandle u3, i2c, mpic;
2065 u32 u3_rev; 2110 u32 u3_rev;
2066 u32 interrupts[2]; 2111 u32 interrupts[2];
@@ -2097,9 +2142,16 @@ static void __init fixup_device_tree(void)
2097 parent = (u32)mpic; 2142 parent = (u32)mpic;
2098 prom_setprop(i2c, "/u3@0,f8000000/i2c@f8001000", "interrupt-parent", 2143 prom_setprop(i2c, "/u3@0,f8000000/i2c@f8001000", "interrupt-parent",
2099 &parent, sizeof(parent)); 2144 &parent, sizeof(parent));
2100#endif
2101} 2145}
2146#else
2147#define fixup_device_tree_pmac()
2148#endif
2102 2149
2150static void __init fixup_device_tree(void)
2151{
2152 fixup_device_tree_maple();
2153 fixup_device_tree_pmac();
2154}
2103 2155
2104static void __init prom_find_boot_cpu(void) 2156static void __init prom_find_boot_cpu(void)
2105{ 2157{