diff options
author | Daniel Axtens <dja@axtens.net> | 2015-03-31 01:00:49 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-04-11 06:49:15 -0400 |
commit | e63f26d3757fb8c00116b7f7c75d2a2e15bb5549 (patch) | |
tree | c502436f08608fa1728eb90a4dd16a8abc205e6d | |
parent | 798248a3c083a4cf0ead44a85e66c6a18647abea (diff) |
powerpc/powermac: Move controller ops from ppc_md to controller_ops
This moves the Power Mac platform to use the pci_controller_ops
structure rather than ppc_md for PCI controller operations.
Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r-- | arch/powerpc/platforms/powermac/pci.c | 17 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/pmac.h | 5 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/setup.c | 4 |
3 files changed, 17 insertions, 9 deletions
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c index 9c89fd29da60..59ab16fa600f 100644 --- a/arch/powerpc/platforms/powermac/pci.c +++ b/arch/powerpc/platforms/powermac/pci.c | |||
@@ -27,6 +27,8 @@ | |||
27 | #include <asm/grackle.h> | 27 | #include <asm/grackle.h> |
28 | #include <asm/ppc-pci.h> | 28 | #include <asm/ppc-pci.h> |
29 | 29 | ||
30 | #include "pmac.h" | ||
31 | |||
30 | #undef DEBUG | 32 | #undef DEBUG |
31 | 33 | ||
32 | #ifdef DEBUG | 34 | #ifdef DEBUG |
@@ -798,6 +800,7 @@ static int __init pmac_add_bridge(struct device_node *dev) | |||
798 | return -ENOMEM; | 800 | return -ENOMEM; |
799 | hose->first_busno = bus_range ? bus_range[0] : 0; | 801 | hose->first_busno = bus_range ? bus_range[0] : 0; |
800 | hose->last_busno = bus_range ? bus_range[1] : 0xff; | 802 | hose->last_busno = bus_range ? bus_range[1] : 0xff; |
803 | hose->controller_ops = pmac_pci_controller_ops; | ||
801 | 804 | ||
802 | disp_name = NULL; | 805 | disp_name = NULL; |
803 | 806 | ||
@@ -942,7 +945,7 @@ void __init pmac_pci_init(void) | |||
942 | } | 945 | } |
943 | 946 | ||
944 | #ifdef CONFIG_PPC32 | 947 | #ifdef CONFIG_PPC32 |
945 | bool pmac_pci_enable_device_hook(struct pci_dev *dev) | 948 | static bool pmac_pci_enable_device_hook(struct pci_dev *dev) |
946 | { | 949 | { |
947 | struct device_node* node; | 950 | struct device_node* node; |
948 | int updatecfg = 0; | 951 | int updatecfg = 0; |
@@ -1225,7 +1228,7 @@ static void fixup_u4_pcie(struct pci_dev* dev) | |||
1225 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_U4_PCIE, fixup_u4_pcie); | 1228 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_U4_PCIE, fixup_u4_pcie); |
1226 | 1229 | ||
1227 | #ifdef CONFIG_PPC64 | 1230 | #ifdef CONFIG_PPC64 |
1228 | int pmac_pci_probe_mode(struct pci_bus *bus) | 1231 | static int pmac_pci_probe_mode(struct pci_bus *bus) |
1229 | { | 1232 | { |
1230 | struct device_node *node = pci_bus_to_OF_node(bus); | 1233 | struct device_node *node = pci_bus_to_OF_node(bus); |
1231 | 1234 | ||
@@ -1240,3 +1243,13 @@ int pmac_pci_probe_mode(struct pci_bus *bus) | |||
1240 | return PCI_PROBE_DEVTREE; | 1243 | return PCI_PROBE_DEVTREE; |
1241 | } | 1244 | } |
1242 | #endif /* CONFIG_PPC64 */ | 1245 | #endif /* CONFIG_PPC64 */ |
1246 | |||
1247 | struct pci_controller_ops pmac_pci_controller_ops = { | ||
1248 | #ifdef CONFIG_PPC64 | ||
1249 | .probe_mode = pmac_pci_probe_mode, | ||
1250 | #endif | ||
1251 | #ifdef CONFIG_PPC32 | ||
1252 | .enable_device_hook = pmac_pci_enable_device_hook, | ||
1253 | #endif | ||
1254 | }; | ||
1255 | |||
diff --git a/arch/powerpc/platforms/powermac/pmac.h b/arch/powerpc/platforms/powermac/pmac.h index b8d572159faa..e7f8163d6769 100644 --- a/arch/powerpc/platforms/powermac/pmac.h +++ b/arch/powerpc/platforms/powermac/pmac.h | |||
@@ -25,7 +25,6 @@ extern void pmac_pci_init(void); | |||
25 | extern void pmac_nvram_update(void); | 25 | extern void pmac_nvram_update(void); |
26 | extern unsigned char pmac_nvram_read_byte(int addr); | 26 | extern unsigned char pmac_nvram_read_byte(int addr); |
27 | extern void pmac_nvram_write_byte(int addr, unsigned char val); | 27 | extern void pmac_nvram_write_byte(int addr, unsigned char val); |
28 | extern bool pmac_pci_enable_device_hook(struct pci_dev *dev); | ||
29 | extern void pmac_pcibios_after_init(void); | 28 | extern void pmac_pcibios_after_init(void); |
30 | extern int of_show_percpuinfo(struct seq_file *m, int i); | 29 | extern int of_show_percpuinfo(struct seq_file *m, int i); |
31 | 30 | ||
@@ -39,8 +38,6 @@ extern void low_cpu_die(void) __attribute__((noreturn)); | |||
39 | extern int pmac_nvram_init(void); | 38 | extern int pmac_nvram_init(void); |
40 | extern void pmac_pic_init(void); | 39 | extern void pmac_pic_init(void); |
41 | 40 | ||
42 | #ifdef CONFIG_PPC64 | 41 | extern struct pci_controller_ops pmac_pci_controller_ops; |
43 | extern int pmac_pci_probe_mode(struct pci_bus *bus); | ||
44 | #endif | ||
45 | 42 | ||
46 | #endif /* __PMAC_H__ */ | 43 | #endif /* __PMAC_H__ */ |
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c index 71a353c07d0c..8dd78f4e1af4 100644 --- a/arch/powerpc/platforms/powermac/setup.c +++ b/arch/powerpc/platforms/powermac/setup.c | |||
@@ -473,7 +473,7 @@ static void __init pmac_init_early(void) | |||
473 | udbg_adb_init(!!strstr(boot_command_line, "btextdbg")); | 473 | udbg_adb_init(!!strstr(boot_command_line, "btextdbg")); |
474 | 474 | ||
475 | #ifdef CONFIG_PPC64 | 475 | #ifdef CONFIG_PPC64 |
476 | iommu_init_early_dart(NULL); | 476 | iommu_init_early_dart(&pmac_pci_controller_ops); |
477 | #endif | 477 | #endif |
478 | 478 | ||
479 | /* SMP Init has to be done early as we need to patch up | 479 | /* SMP Init has to be done early as we need to patch up |
@@ -656,12 +656,10 @@ define_machine(powermac) { | |||
656 | .feature_call = pmac_do_feature_call, | 656 | .feature_call = pmac_do_feature_call, |
657 | .progress = udbg_progress, | 657 | .progress = udbg_progress, |
658 | #ifdef CONFIG_PPC64 | 658 | #ifdef CONFIG_PPC64 |
659 | .pci_probe_mode = pmac_pci_probe_mode, | ||
660 | .power_save = power4_idle, | 659 | .power_save = power4_idle, |
661 | .enable_pmcs = power4_enable_pmcs, | 660 | .enable_pmcs = power4_enable_pmcs, |
662 | #endif /* CONFIG_PPC64 */ | 661 | #endif /* CONFIG_PPC64 */ |
663 | #ifdef CONFIG_PPC32 | 662 | #ifdef CONFIG_PPC32 |
664 | .pcibios_enable_device_hook = pmac_pci_enable_device_hook, | ||
665 | .pcibios_after_init = pmac_pcibios_after_init, | 663 | .pcibios_after_init = pmac_pcibios_after_init, |
666 | .phys_mem_access_prot = pci_phys_mem_access_prot, | 664 | .phys_mem_access_prot = pci_phys_mem_access_prot, |
667 | #endif | 665 | #endif |