Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48293 )
Change subject: mb/prodrive/hermes: Wrap UART driver by PCI device ......................................................................
Patch Set 4:
Patch Set 4: Code-Review-1
(1 comment)
Patch Set 4:
I don't understand why this is necessary at all. Looks like you found a bug in sconfig you are trying to work around.
I don't know if it is a bug actually or if this is just not meant to be. When we started adding the chipset devicetrees for soc/skylake and soc/cannonlake, we encountered that problem on cannonlake.
If the PCI device on mb/hermes is wrapped by the UART driver and if also the patch for the chipset devicetree is applied, then the PCI device has two declarations in static.c.
DEVTREE_CONST struct device *DEVTREE_CONST __pci_0_19_2 = &_dev32; ... DEVTREE_CONST struct device *DEVTREE_CONST __pci_0_19_2 = &_dev70;
There was a similar problem with drivers/wifi/generic (CB:46865) as Michael mentioned. Furquan solved that by turning it around. So he moved the driver into the device. Here in this case, only the declaration for &_dev32 (from the example above) is left then, while &_dev72 is declared as a sub device.
This is a bug in sconfig as it's clearly the same PCI device (same dev function number, same parent).
It's not a bug in sconfig but a driver problem; see discussion in CB:46531