diff options
Diffstat (limited to 'arch/powerpc/platforms/powermac/pci.c')
-rw-r--r-- | arch/powerpc/platforms/powermac/pci.c | 46 |
1 files changed, 3 insertions, 43 deletions
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c index c4af9e21ac93..92586db19754 100644 --- a/arch/powerpc/platforms/powermac/pci.c +++ b/arch/powerpc/platforms/powermac/pci.c | |||
@@ -35,8 +35,6 @@ | |||
35 | #define DBG(x...) | 35 | #define DBG(x...) |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | static int add_bridge(struct device_node *dev); | ||
39 | |||
40 | /* XXX Could be per-controller, but I don't think we risk anything by | 38 | /* XXX Could be per-controller, but I don't think we risk anything by |
41 | * assuming we won't have both UniNorth and Bandit */ | 39 | * assuming we won't have both UniNorth and Bandit */ |
42 | static int has_uninorth; | 40 | static int has_uninorth; |
@@ -897,7 +895,7 @@ static void __init setup_u3_ht(struct pci_controller* hose) | |||
897 | * "pci" (a MPC106) and no bandit or chaos bridges, and contrariwise, | 895 | * "pci" (a MPC106) and no bandit or chaos bridges, and contrariwise, |
898 | * if we have one or more bandit or chaos bridges, we don't have a MPC106. | 896 | * if we have one or more bandit or chaos bridges, we don't have a MPC106. |
899 | */ | 897 | */ |
900 | static int __init add_bridge(struct device_node *dev) | 898 | static int __init pmac_add_bridge(struct device_node *dev) |
901 | { | 899 | { |
902 | int len; | 900 | int len; |
903 | struct pci_controller *hose; | 901 | struct pci_controller *hose; |
@@ -918,15 +916,9 @@ static int __init add_bridge(struct device_node *dev) | |||
918 | " bus 0\n", dev->full_name); | 916 | " bus 0\n", dev->full_name); |
919 | } | 917 | } |
920 | 918 | ||
921 | /* XXX Different prototypes, to be merged */ | ||
922 | #ifdef CONFIG_PPC64 | ||
923 | hose = pcibios_alloc_controller(dev); | 919 | hose = pcibios_alloc_controller(dev); |
924 | #else | ||
925 | hose = pcibios_alloc_controller(); | ||
926 | #endif | ||
927 | if (!hose) | 920 | if (!hose) |
928 | return -ENOMEM; | 921 | return -ENOMEM; |
929 | hose->arch_data = dev; | ||
930 | hose->first_busno = bus_range ? bus_range[0] : 0; | 922 | hose->first_busno = bus_range ? bus_range[0] : 0; |
931 | hose->last_busno = bus_range ? bus_range[1] : 0xff; | 923 | hose->last_busno = bus_range ? bus_range[1] : 0xff; |
932 | 924 | ||
@@ -1006,19 +998,6 @@ void __devinit pmac_pci_irq_fixup(struct pci_dev *dev) | |||
1006 | #endif /* CONFIG_PPC32 */ | 998 | #endif /* CONFIG_PPC32 */ |
1007 | } | 999 | } |
1008 | 1000 | ||
1009 | #ifdef CONFIG_PPC64 | ||
1010 | static void __init pmac_fixup_phb_resources(void) | ||
1011 | { | ||
1012 | struct pci_controller *hose, *tmp; | ||
1013 | |||
1014 | list_for_each_entry_safe(hose, tmp, &hose_list, list_node) { | ||
1015 | printk(KERN_INFO "PCI Host %d, io start: %lx; io end: %lx\n", | ||
1016 | hose->global_number, | ||
1017 | hose->io_resource.start, hose->io_resource.end); | ||
1018 | } | ||
1019 | } | ||
1020 | #endif | ||
1021 | |||
1022 | void __init pmac_pci_init(void) | 1001 | void __init pmac_pci_init(void) |
1023 | { | 1002 | { |
1024 | struct device_node *np, *root; | 1003 | struct device_node *np, *root; |
@@ -1036,7 +1015,7 @@ void __init pmac_pci_init(void) | |||
1036 | if (strcmp(np->name, "bandit") == 0 | 1015 | if (strcmp(np->name, "bandit") == 0 |
1037 | || strcmp(np->name, "chaos") == 0 | 1016 | || strcmp(np->name, "chaos") == 0 |
1038 | || strcmp(np->name, "pci") == 0) { | 1017 | || strcmp(np->name, "pci") == 0) { |
1039 | if (add_bridge(np) == 0) | 1018 | if (pmac_add_bridge(np) == 0) |
1040 | of_node_get(np); | 1019 | of_node_get(np); |
1041 | } | 1020 | } |
1042 | if (strcmp(np->name, "ht") == 0) { | 1021 | if (strcmp(np->name, "ht") == 0) { |
@@ -1050,28 +1029,9 @@ void __init pmac_pci_init(void) | |||
1050 | /* Probe HT last as it relies on the agp resources to be already | 1029 | /* Probe HT last as it relies on the agp resources to be already |
1051 | * setup | 1030 | * setup |
1052 | */ | 1031 | */ |
1053 | if (ht && add_bridge(ht) != 0) | 1032 | if (ht && pmac_add_bridge(ht) != 0) |
1054 | of_node_put(ht); | 1033 | of_node_put(ht); |
1055 | 1034 | ||
1056 | /* | ||
1057 | * We need to call pci_setup_phb_io for the HT bridge first | ||
1058 | * so it gets the I/O port numbers starting at 0, and we | ||
1059 | * need to call it for the AGP bridge after that so it gets | ||
1060 | * small positive I/O port numbers. | ||
1061 | */ | ||
1062 | if (u3_ht) | ||
1063 | pci_setup_phb_io(u3_ht, 1); | ||
1064 | if (u3_agp) | ||
1065 | pci_setup_phb_io(u3_agp, 0); | ||
1066 | if (u4_pcie) | ||
1067 | pci_setup_phb_io(u4_pcie, 0); | ||
1068 | |||
1069 | /* | ||
1070 | * On ppc64, fixup the IO resources on our host bridges as | ||
1071 | * the common code does it only for children of the host bridges | ||
1072 | */ | ||
1073 | pmac_fixup_phb_resources(); | ||
1074 | |||
1075 | /* Setup the linkage between OF nodes and PHBs */ | 1035 | /* Setup the linkage between OF nodes and PHBs */ |
1076 | pci_devs_phb_init(); | 1036 | pci_devs_phb_init(); |
1077 | 1037 | ||