[Skiboot] [PATCH] pci: Use a fixed numbering of PHBs on OPAL and improve log consistency
stewart at linux.vnet.ibm.com
Wed Oct 7 18:44:30 AEDT 2015
Benjamin Herrenschmidt <benh at kernel.crashing.org> writes:
> On P8, we calculate the OPAL ID of the PHB as a function of the physical
> chip number and PHB index on that chip. P7 continues using "allocated"
> numbers for now.
> We also consistently print the PHB ID as a 4-digit hex number which
> facilitates decoding it, and print the chip:index location in the probe
> code to make it easier to correlate log entries.
> + chip = get_chip(NULL);
> + if (chip && chip->type == PROC_CHIP_P8_NAPLES)
> + opal_id = p->chip_id * 8 + p->index;
> + else
> + opal_id = p->chip_id * 4 + p->index;
> + pci_register_phb(&p->phb, opal_id);
I switched this to next_chip(NULL) rather than get_chip(NULL) as
a) get_chip(NULL) throws a compiler error (NULL for a uint32_t)
b) next_chip(NULL) ensures we get the first chip.
So you were probably lucky with chip ids and compilers :)
Merged into skiboot master as of 72f0f43
More information about the Skiboot