diff options
Diffstat (limited to 'arch/powerpc/kernel/pci_of_scan.c')
-rw-r--r-- | arch/powerpc/kernel/pci_of_scan.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c index 7311fdfb9bf8..4aa17401657b 100644 --- a/arch/powerpc/kernel/pci_of_scan.c +++ b/arch/powerpc/kernel/pci_of_scan.c | |||
@@ -123,6 +123,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node, | |||
123 | { | 123 | { |
124 | struct pci_dev *dev; | 124 | struct pci_dev *dev; |
125 | const char *type; | 125 | const char *type; |
126 | struct pci_slot *slot; | ||
126 | 127 | ||
127 | dev = alloc_pci_dev(); | 128 | dev = alloc_pci_dev(); |
128 | if (!dev) | 129 | if (!dev) |
@@ -140,6 +141,11 @@ struct pci_dev *of_create_pci_dev(struct device_node *node, | |||
140 | dev->devfn = devfn; | 141 | dev->devfn = devfn; |
141 | dev->multifunction = 0; /* maybe a lie? */ | 142 | dev->multifunction = 0; /* maybe a lie? */ |
142 | dev->needs_freset = 0; /* pcie fundamental reset required */ | 143 | dev->needs_freset = 0; /* pcie fundamental reset required */ |
144 | set_pcie_port_type(dev); | ||
145 | |||
146 | list_for_each_entry(slot, &dev->bus->slots, list) | ||
147 | if (PCI_SLOT(dev->devfn) == slot->number) | ||
148 | dev->slot = slot; | ||
143 | 149 | ||
144 | dev->vendor = get_int_prop(node, "vendor-id", 0xffff); | 150 | dev->vendor = get_int_prop(node, "vendor-id", 0xffff); |
145 | dev->device = get_int_prop(node, "device-id", 0xffff); | 151 | dev->device = get_int_prop(node, "device-id", 0xffff); |
@@ -160,10 +166,14 @@ struct pci_dev *of_create_pci_dev(struct device_node *node, | |||
160 | dev->error_state = pci_channel_io_normal; | 166 | dev->error_state = pci_channel_io_normal; |
161 | dev->dma_mask = 0xffffffff; | 167 | dev->dma_mask = 0xffffffff; |
162 | 168 | ||
169 | /* Early fixups, before probing the BARs */ | ||
170 | pci_fixup_device(pci_fixup_early, dev); | ||
171 | |||
163 | if (!strcmp(type, "pci") || !strcmp(type, "pciex")) { | 172 | if (!strcmp(type, "pci") || !strcmp(type, "pciex")) { |
164 | /* a PCI-PCI bridge */ | 173 | /* a PCI-PCI bridge */ |
165 | dev->hdr_type = PCI_HEADER_TYPE_BRIDGE; | 174 | dev->hdr_type = PCI_HEADER_TYPE_BRIDGE; |
166 | dev->rom_base_reg = PCI_ROM_ADDRESS1; | 175 | dev->rom_base_reg = PCI_ROM_ADDRESS1; |
176 | set_pcie_hotplug_bridge(dev); | ||
167 | } else if (!strcmp(type, "cardbus")) { | 177 | } else if (!strcmp(type, "cardbus")) { |
168 | dev->hdr_type = PCI_HEADER_TYPE_CARDBUS; | 178 | dev->hdr_type = PCI_HEADER_TYPE_CARDBUS; |
169 | } else { | 179 | } else { |