We are missing these when building the pci_dev from scratch off the Open Firmware device-tree
Unified · Split
| @@ -140,6 +140,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node, · 139 unmodified lines | ||
| 140 | 140 | dev->devfn = devfn; |
| 141 | 141 | dev->multifunction = 0; /* maybe a lie? */ |
| 142 | 142 | dev->needs_freset = 0; /* pcie fundamental reset required */ |
| 143 | + set_pcie_port_type(dev); | |
| 143 | 144 | |
| 144 | 145 | dev->vendor = get_int_prop(node, "vendor-id", 0xffff); |
| 145 | 146 | dev->device = get_int_prop(node, "device-id", 0xffff); |
| @@ -164,6 +165,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node, · 18 unmodified lines | ||
| 164 | 165 | /* a PCI-PCI bridge */ |
| 165 | 166 | dev->hdr_type = PCI_HEADER_TYPE_BRIDGE; |
| 166 | 167 | dev->rom_base_reg = PCI_ROM_ADDRESS1; |
| 168 | + set_pcie_hotplug_bridge(dev); | |
| 167 | 169 | } else if (!strcmp(type, "cardbus")) { |
| 168 | 170 | dev->hdr_type = PCI_HEADER_TYPE_CARDBUS; |
| 169 | 171 | } else { |
| @@ -681,7 +681,7 @@ static void pci_read_irq(struct pci_dev *dev) · 680 unmodified lines | ||
| 681 | 681 | dev->irq = irq; |
| 682 | 682 | } |
| 683 | 683 | |
| 684 | −static void set_pcie_port_type(struct pci_dev *pdev) | |
| 684 | +void set_pcie_port_type(struct pci_dev *pdev) | |
| 685 | 685 | { |
| 686 | 686 | int pos; |
| 687 | 687 | u16 reg16; |
| @@ -695,7 +695,7 @@ static void set_pcie_port_type(struct pci_dev *pdev) · 7 unmodified lines | ||
| 695 | 695 | pdev->pcie_type = (reg16 & PCI_EXP_FLAGS_TYPE) >> 4; |
| 696 | 696 | } |
| 697 | 697 | |
| 698 | −static void set_pcie_hotplug_bridge(struct pci_dev *pdev) | |
| 698 | +void set_pcie_hotplug_bridge(struct pci_dev *pdev) | |
| 699 | 699 | { |
| 700 | 700 | int pos; |
| 701 | 701 | u16 reg16; |
| @@ -756,6 +756,10 @@ pci_power_t pci_target_state(struct pci_dev *dev); · 755 unmodified lines | ||
| 756 | 756 | int pci_prepare_to_sleep(struct pci_dev *dev); |
| 757 | 757 | int pci_back_from_sleep(struct pci_dev *dev); |
| 758 | 758 | |
| 759 | +/* For use by arch with custom probe code */ | |
| 760 | +void set_pcie_port_type(struct pci_dev *pdev); | |
| 761 | +void set_pcie_hotplug_bridge(struct pci_dev *pdev); | |
| 762 | + | |
| 759 | 763 | /* Functions for PCI Hotplug drivers to use */ |
| 760 | 764 | int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); |
| 761 | 765 | #ifdef CONFIG_HOTPLUG |