diff options
author | Russell Currey <ruscur@russell.cc> | 2016-03-21 12:00:01 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-03-31 16:41:17 +1100 |
commit | 3d66ba68a9fabf37cd11b20275f83b42d8d77933 (patch) | |
tree | c4c984cf3722e974ab3cff2a31c36db82dfbc9cf /core/pci.c | |
parent | 9c2d82394fd2303847cac4a665dee62556ca528a (diff) | |
download | skiboot-3d66ba68a9fabf37cd11b20275f83b42d8d77933.zip skiboot-3d66ba68a9fabf37cd11b20275f83b42d8d77933.tar.gz skiboot-3d66ba68a9fabf37cd11b20275f83b42d8d77933.tar.bz2 |
pci: Add for_each_phb macro for PHB traversal
Similar to for_each_cpu, adding a for_each_phb makes PHB traversal easy.
Suggested-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/pci.c')
-rw-r--r-- | core/pci.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -24,6 +24,7 @@ #define MAX_PHB_ID 256 static struct phb *phbs[MAX_PHB_ID]; +int last_phb_id = 0; #define PCITRACE(_p, _bdfn, fmt, a...) \ prlog(PR_TRACE, "PHB#%04x:%02x:%02x.%x " fmt, \ @@ -818,6 +819,8 @@ int64_t pci_register_phb(struct phb *phb, int opal_id) phbs[opal_id] = phb; phb->opal_id = opal_id; + if (opal_id > last_phb_id) + last_phb_id = opal_id; dt_add_property_cells(phb->dt_node, "ibm,opal-phbid", 0, phb->opal_id); PCIDBG(phb, 0, "PCI: Registered PHB\n"); |