aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2007-12-19 22:54:57 -0500
committerPaul Mackerras <paulus@samba.org>2007-12-20 00:18:12 -0500
commitbc0826cfb102b6f360f2ec3082fa794f5dbbdee7 (patch)
tree05dc6ff44ea3f952bc466262ccf8894c2e093500 /arch
parent549beb9ba3b03345cbd8e1233825d5b197a3f9f7 (diff)
[POWERPC] Fixup powermac enable device hook
Powermac's use of the pcibios_enable_device_hook() got slightly broken by the recent PCI merge in that it won't be called for the "initial" case of assigning resources to a previously unassigned device. This was an abuse of that hook anyway, so instead we now use a header quirk. While at it, we move a #ifdef CONFIG_PPC32 to enclose more code that is only ever used on 32 bits. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/powermac/pci.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index 1e51a8ee2b7d..96a2933a15b5 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -1058,6 +1058,7 @@ void __init pmac_pci_init(void)
1058#endif 1058#endif
1059} 1059}
1060 1060
1061#ifdef CONFIG_PPC32
1061int pmac_pci_enable_device_hook(struct pci_dev *dev) 1062int pmac_pci_enable_device_hook(struct pci_dev *dev)
1062{ 1063{
1063 struct device_node* node; 1064 struct device_node* node;
@@ -1106,7 +1107,6 @@ int pmac_pci_enable_device_hook(struct pci_dev *dev)
1106 * bridge and we must not, for example, enable MWI or set the 1107 * bridge and we must not, for example, enable MWI or set the
1107 * cache line size on them. 1108 * cache line size on them.
1108 */ 1109 */
1109#ifdef CONFIG_PPC32
1110 if (updatecfg) { 1110 if (updatecfg) {
1111 u16 cmd; 1111 u16 cmd;
1112 1112
@@ -1118,12 +1118,23 @@ int pmac_pci_enable_device_hook(struct pci_dev *dev)
1118 1118
1119 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 1119 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE,
1120 L1_CACHE_BYTES >> 2); 1120 L1_CACHE_BYTES >> 2);
1121#endif
1122 } 1121 }
1123 1122
1124 return 0; 1123 return 0;
1125} 1124}
1126 1125
1126void __devinit pmac_pci_fixup_ohci(struct pci_dev *dev)
1127{
1128 struct device_node *node = pci_device_to_OF_node(dev);
1129
1130 /* We don't want to assign resources to USB controllers
1131 * absent from the OF tree (iBook second controller)
1132 */
1133 if (dev->class == PCI_CLASS_SERIAL_USB_OHCI && !node)
1134 dev->resource[0].flags = 0;
1135}
1136DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_APPLE, PCI_ANY_ID, pmac_pci_fixup_ohci);
1137
1127/* We power down some devices after they have been probed. They'll 1138/* We power down some devices after they have been probed. They'll
1128 * be powered back on later on 1139 * be powered back on later on
1129 */ 1140 */
@@ -1171,7 +1182,6 @@ void __init pmac_pcibios_after_init(void)
1171 of_node_put(nd); 1182 of_node_put(nd);
1172} 1183}
1173 1184
1174#ifdef CONFIG_PPC32
1175void pmac_pci_fixup_cardbus(struct pci_dev* dev) 1185void pmac_pci_fixup_cardbus(struct pci_dev* dev)
1176{ 1186{
1177 if (!machine_is(powermac)) 1187 if (!machine_is(powermac))
@@ -1259,7 +1269,7 @@ void pmac_pci_fixup_pciata(struct pci_dev* dev)
1259 } 1269 }
1260} 1270}
1261DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, pmac_pci_fixup_pciata); 1271DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, pmac_pci_fixup_pciata);
1262#endif 1272#endif /* CONFIG_PPC32 */
1263 1273
1264/* 1274/*
1265 * Disable second function on K2-SATA, it's broken 1275 * Disable second function on K2-SATA, it's broken