diff options
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r-- | drivers/pci/probe.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index f991359f0c36..4a55bf380957 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -842,11 +842,14 @@ static void set_pcie_port_type(struct pci_dev *pdev) | |||
842 | * reading the dword at 0x100 which must either be 0 or a valid extended | 842 | * reading the dword at 0x100 which must either be 0 or a valid extended |
843 | * capability header. | 843 | * capability header. |
844 | */ | 844 | */ |
845 | int pci_cfg_space_size(struct pci_dev *dev) | 845 | int pci_cfg_space_size_ext(struct pci_dev *dev, unsigned check_exp_pcix) |
846 | { | 846 | { |
847 | int pos; | 847 | int pos; |
848 | u32 status; | 848 | u32 status; |
849 | 849 | ||
850 | if (!check_exp_pcix) | ||
851 | goto skip; | ||
852 | |||
850 | pos = pci_find_capability(dev, PCI_CAP_ID_EXP); | 853 | pos = pci_find_capability(dev, PCI_CAP_ID_EXP); |
851 | if (!pos) { | 854 | if (!pos) { |
852 | pos = pci_find_capability(dev, PCI_CAP_ID_PCIX); | 855 | pos = pci_find_capability(dev, PCI_CAP_ID_PCIX); |
@@ -858,6 +861,7 @@ int pci_cfg_space_size(struct pci_dev *dev) | |||
858 | goto fail; | 861 | goto fail; |
859 | } | 862 | } |
860 | 863 | ||
864 | skip: | ||
861 | if (pci_read_config_dword(dev, 256, &status) != PCIBIOS_SUCCESSFUL) | 865 | if (pci_read_config_dword(dev, 256, &status) != PCIBIOS_SUCCESSFUL) |
862 | goto fail; | 866 | goto fail; |
863 | if (status == 0xffffffff) | 867 | if (status == 0xffffffff) |
@@ -869,6 +873,11 @@ int pci_cfg_space_size(struct pci_dev *dev) | |||
869 | return PCI_CFG_SPACE_SIZE; | 873 | return PCI_CFG_SPACE_SIZE; |
870 | } | 874 | } |
871 | 875 | ||
876 | int pci_cfg_space_size(struct pci_dev *dev) | ||
877 | { | ||
878 | return pci_cfg_space_size_ext(dev, 1); | ||
879 | } | ||
880 | |||
872 | static void pci_release_bus_bridge_dev(struct device *dev) | 881 | static void pci_release_bus_bridge_dev(struct device *dev) |
873 | { | 882 | { |
874 | kfree(dev); | 883 | kfree(dev); |
@@ -964,7 +973,6 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus) | |||
964 | dev->dev.release = pci_release_dev; | 973 | dev->dev.release = pci_release_dev; |
965 | pci_dev_get(dev); | 974 | pci_dev_get(dev); |
966 | 975 | ||
967 | set_dev_node(&dev->dev, pcibus_to_node(bus)); | ||
968 | dev->dev.dma_mask = &dev->dma_mask; | 976 | dev->dev.dma_mask = &dev->dma_mask; |
969 | dev->dev.dma_parms = &dev->dma_parms; | 977 | dev->dev.dma_parms = &dev->dma_parms; |
970 | dev->dev.coherent_dma_mask = 0xffffffffull; | 978 | dev->dev.coherent_dma_mask = 0xffffffffull; |
@@ -1080,6 +1088,10 @@ unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus) | |||
1080 | return max; | 1088 | return max; |
1081 | } | 1089 | } |
1082 | 1090 | ||
1091 | void __attribute__((weak)) set_pci_bus_resources_arch_default(struct pci_bus *b) | ||
1092 | { | ||
1093 | } | ||
1094 | |||
1083 | struct pci_bus * pci_create_bus(struct device *parent, | 1095 | struct pci_bus * pci_create_bus(struct device *parent, |
1084 | int bus, struct pci_ops *ops, void *sysdata) | 1096 | int bus, struct pci_ops *ops, void *sysdata) |
1085 | { | 1097 | { |
@@ -1119,6 +1131,9 @@ struct pci_bus * pci_create_bus(struct device *parent, | |||
1119 | goto dev_reg_err; | 1131 | goto dev_reg_err; |
1120 | b->bridge = get_device(dev); | 1132 | b->bridge = get_device(dev); |
1121 | 1133 | ||
1134 | if (!parent) | ||
1135 | set_dev_node(b->bridge, pcibus_to_node(b)); | ||
1136 | |||
1122 | b->dev.class = &pcibus_class; | 1137 | b->dev.class = &pcibus_class; |
1123 | b->dev.parent = b->bridge; | 1138 | b->dev.parent = b->bridge; |
1124 | sprintf(b->dev.bus_id, "%04x:%02x", pci_domain_nr(b), bus); | 1139 | sprintf(b->dev.bus_id, "%04x:%02x", pci_domain_nr(b), bus); |
@@ -1136,6 +1151,8 @@ struct pci_bus * pci_create_bus(struct device *parent, | |||
1136 | b->resource[0] = &ioport_resource; | 1151 | b->resource[0] = &ioport_resource; |
1137 | b->resource[1] = &iomem_resource; | 1152 | b->resource[1] = &iomem_resource; |
1138 | 1153 | ||
1154 | set_pci_bus_resources_arch_default(b); | ||
1155 | |||
1139 | return b; | 1156 | return b; |
1140 | 1157 | ||
1141 | dev_create_file_err: | 1158 | dev_create_file_err: |