aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powermac
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:11 -0500
commit549beb9ba3b03345cbd8e1233825d5b197a3f9f7 (patch)
treec192ba6cdfa13e9888d9e5f534d2862127d412cb /arch/powerpc/platforms/powermac
parent24f8c827f9b8ab2c8644f7ab85a1b1d58fc0fcf7 (diff)
[POWERPC] Merge 32 and 64 bits pcibios_enable_device
This merge the two implementations, based on the previously fixed up 32 bits one. The pcibios_enable_device_hook in ppc_md is now available for ppc64 use. Also remove the new unused "initial" parameter from it and fixup users. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/powermac')
-rw-r--r--arch/powerpc/platforms/powermac/pci.c22
-rw-r--r--arch/powerpc/platforms/powermac/pmac.h2
2 files changed, 11 insertions, 13 deletions
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index 6bbf3c881711..1e51a8ee2b7d 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -1058,8 +1058,7 @@ void __init pmac_pci_init(void)
1058#endif 1058#endif
1059} 1059}
1060 1060
1061int 1061int pmac_pci_enable_device_hook(struct pci_dev *dev)
1062pmac_pci_enable_device_hook(struct pci_dev *dev, int initial)
1063{ 1062{
1064 struct device_node* node; 1063 struct device_node* node;
1065 int updatecfg = 0; 1064 int updatecfg = 0;
@@ -1101,26 +1100,25 @@ pmac_pci_enable_device_hook(struct pci_dev *dev, int initial)
1101 updatecfg = 1; 1100 updatecfg = 1;
1102 } 1101 }
1103 1102
1103 /*
1104 * Fixup various header fields on 32 bits. We don't do that on
1105 * 64 bits as some of these have strange values behind the HT
1106 * bridge and we must not, for example, enable MWI or set the
1107 * cache line size on them.
1108 */
1109#ifdef CONFIG_PPC32
1104 if (updatecfg) { 1110 if (updatecfg) {
1105 u16 cmd; 1111 u16 cmd;
1106 1112
1107 /*
1108 * Make sure PCI is correctly configured
1109 *
1110 * We use old pci_bios versions of the function since, by
1111 * default, gmac is not powered up, and so will be absent
1112 * from the kernel initial PCI lookup.
1113 *
1114 * Should be replaced by 2.4 new PCI mechanisms and really
1115 * register the device.
1116 */
1117 pci_read_config_word(dev, PCI_COMMAND, &cmd); 1113 pci_read_config_word(dev, PCI_COMMAND, &cmd);
1118 cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER 1114 cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER
1119 | PCI_COMMAND_INVALIDATE; 1115 | PCI_COMMAND_INVALIDATE;
1120 pci_write_config_word(dev, PCI_COMMAND, cmd); 1116 pci_write_config_word(dev, PCI_COMMAND, cmd);
1121 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 16); 1117 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 16);
1118
1122 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 1119 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE,
1123 L1_CACHE_BYTES >> 2); 1120 L1_CACHE_BYTES >> 2);
1121#endif
1124 } 1122 }
1125 1123
1126 return 0; 1124 return 0;
diff --git a/arch/powerpc/platforms/powermac/pmac.h b/arch/powerpc/platforms/powermac/pmac.h
index fcde070f7054..b3abaaf61eb4 100644
--- a/arch/powerpc/platforms/powermac/pmac.h
+++ b/arch/powerpc/platforms/powermac/pmac.h
@@ -26,7 +26,7 @@ extern void pmac_pci_init(void);
26extern void pmac_nvram_update(void); 26extern void pmac_nvram_update(void);
27extern unsigned char pmac_nvram_read_byte(int addr); 27extern unsigned char pmac_nvram_read_byte(int addr);
28extern void pmac_nvram_write_byte(int addr, unsigned char val); 28extern void pmac_nvram_write_byte(int addr, unsigned char val);
29extern int pmac_pci_enable_device_hook(struct pci_dev *dev, int initial); 29extern int pmac_pci_enable_device_hook(struct pci_dev *dev);
30extern void pmac_pcibios_after_init(void); 30extern void pmac_pcibios_after_init(void);
31extern int of_show_percpuinfo(struct seq_file *m, int i); 31extern int of_show_percpuinfo(struct seq_file *m, int i);
32 32