aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2016-04-26 11:56:53 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-05-03 17:54:43 +1000
commit0d4d3355e00e5beee08123d6db6e08aa3d9e47c8 (patch)
treed41385ac7c927d0be5ca19718468a98676a401eb /core
parent00f3d2ca92b325db1c7832e4560b564359977202 (diff)
downloadskiboot-0d4d3355e00e5beee08123d6db6e08aa3d9e47c8.zip
skiboot-0d4d3355e00e5beee08123d6db6e08aa3d9e47c8.tar.gz
skiboot-0d4d3355e00e5beee08123d6db6e08aa3d9e47c8.tar.bz2
PCI: Introduce phb_ops->phb_final_fixup()
phb_ops->device_node_fixup() was introduced for NPU1 so that the chip backend can bind the emulated NPU device with the GPU device and fixes the device-tree node accordingly. There're couple of issues as I can image: * In pci_fixup_nodes(), one PHB has only one level of device depth in the hierarchy tree. It's true for NPU PHBs, but false for other PHBs. That indicates the function can be called for NPU PHBs. * The callback name indicates the specific work to be done there. That doesn't make sense. We need another name without indicating the specific work to do. It will give the backend on chip level more freedom. Similarly, the callback is called on basis of PCI device. It's hard for backend to manuplate the PHB. More freedom the backend will get with more bold granularity. This fixes above issues by replacing phb_ops->device_node_fixup() with phb_ops->phb_final_fixup(). More freedom will be received in the backends. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core')
-rw-r--r--core/pci.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/core/pci.c b/core/pci.c
index 66c2470..9b238d0 100644
--- a/core/pci.c
+++ b/core/pci.c
@@ -1450,17 +1450,6 @@ static void pci_add_nodes(struct phb *phb)
pci_add_one_node(phb, pd, phb->dt_node, lstate, 0);
}
-static void pci_fixup_nodes(struct phb *phb)
-{
- struct pci_device *pd;
-
- if (!phb->ops->device_node_fixup)
- return;
-
- list_for_each(&phb->devices, pd, link)
- phb->ops->device_node_fixup(phb, pd);
-}
-
static void __pci_reset(struct list_head *list)
{
struct pci_device *pd;
@@ -1542,12 +1531,12 @@ void pci_init_slots(void)
pci_add_nodes(phbs[i]);
}
- /* Do device node fixups now that all the devices have been
- * added to the device tree. */
+ /* PHB final fixup */
for (i = 0; i < ARRAY_SIZE(phbs); i++) {
- if (!phbs[i])
+ if (!phbs[i] || !phbs[i]->ops || !phbs[i]->ops->phb_final_fixup)
continue;
- pci_fixup_nodes(phbs[i]);
+
+ phbs[i]->ops->phb_final_fixup(phbs[i]);
}
}