History

powerpc/pci: Add calls to set_pcie_port_type() and set_pcie_hotplug_bridge()

We are missing these when building the pci_dev from scratch off the Open Firmware device-tree

Benjamin Herrenschmidt committed 16 years ago

Commit bb209c81 parent b04da8b3 files · +8 −2Browse files

Unified · Split

3 files
  1. arch/powerpc/kernel/pci_of_scan.c +2 −0
  2. drivers/pci/probe.c +2 −2
  3. include/linux/pci.h +4 −0
arch/powerpc/kernel/pci_of_scan.c+2−0
@@ -140,6 +140,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node, · 139 unmodified lines
140 dev->devfn = devfn;140 dev->devfn = devfn;
141 dev->multifunction = 0; /* maybe a lie? */141 dev->multifunction = 0; /* maybe a lie? */
142 dev->needs_freset = 0; /* pcie fundamental reset required */142 dev->needs_freset = 0; /* pcie fundamental reset required */
143 set_pcie_port_type(dev);
143 144
144 dev->vendor = get_int_prop(node, "vendor-id", 0xffff);145 dev->vendor = get_int_prop(node, "vendor-id", 0xffff);
145 dev->device = get_int_prop(node, "device-id", 0xffff);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 /* a PCI-PCI bridge */165 /* a PCI-PCI bridge */
165 dev->hdr_type = PCI_HEADER_TYPE_BRIDGE;166 dev->hdr_type = PCI_HEADER_TYPE_BRIDGE;
166 dev->rom_base_reg = PCI_ROM_ADDRESS1;167 dev->rom_base_reg = PCI_ROM_ADDRESS1;
168 set_pcie_hotplug_bridge(dev);
167 } else if (!strcmp(type, "cardbus")) {169 } else if (!strcmp(type, "cardbus")) {
168 dev->hdr_type = PCI_HEADER_TYPE_CARDBUS;170 dev->hdr_type = PCI_HEADER_TYPE_CARDBUS;
169 } else {171 } else {
drivers/pci/probe.c+2−2
@@ -681,7 +681,7 @@ static void pci_read_irq(struct pci_dev *dev) · 680 unmodified lines
681 dev->irq = irq;681 dev->irq = irq;
682}682}
683 683
684static void set_pcie_port_type(struct pci_dev *pdev)684void set_pcie_port_type(struct pci_dev *pdev)
685{685{
686 int pos;686 int pos;
687 u16 reg16;687 u16 reg16;
@@ -695,7 +695,7 @@ static void set_pcie_port_type(struct pci_dev *pdev) · 7 unmodified lines
695 pdev->pcie_type = (reg16 & PCI_EXP_FLAGS_TYPE) >> 4;695 pdev->pcie_type = (reg16 & PCI_EXP_FLAGS_TYPE) >> 4;
696}696}
697 697
698static void set_pcie_hotplug_bridge(struct pci_dev *pdev)698void set_pcie_hotplug_bridge(struct pci_dev *pdev)
699{699{
700 int pos;700 int pos;
701 u16 reg16;701 u16 reg16;
include/linux/pci.h+4−0
@@ -756,6 +756,10 @@ pci_power_t pci_target_state(struct pci_dev *dev); · 755 unmodified lines
756int pci_prepare_to_sleep(struct pci_dev *dev);756int pci_prepare_to_sleep(struct pci_dev *dev);
757int pci_back_from_sleep(struct pci_dev *dev);757int pci_back_from_sleep(struct pci_dev *dev);
758 758
759/* For use by arch with custom probe code */
760void set_pcie_port_type(struct pci_dev *pdev);
761void set_pcie_hotplug_bridge(struct pci_dev *pdev);
762
759/* Functions for PCI Hotplug drivers to use */763/* Functions for PCI Hotplug drivers to use */
760int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap);764int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap);
761#ifdef CONFIG_HOTPLUG765#ifdef CONFIG_HOTPLUG