On Fri, Sep 27, 2019 at 8:11 PM Nico Huber nico.h@gmx.de wrote:
On 26.09.19 18:45, Aaron Durbin via coreboot wrote:
Here's some of the requirements/issues we should resolve that come to mind:
- Easy way to directly retrieve a device's chip config object w/o
traversing the device hierarchy. Which leads to... 2. Symbol alias for accessing struct device directly (no bdf lookup)
What we already have:
Static pointers to `struct device` for devices with a globally valid address (PCI devices on bus 0 and PNP devices), e.g.:
DEVTREE_CONST struct device *DEVTREE_CONST __pci_0_02_0 = &_dev6; DEVTREE_CONST struct device *DEVTREE_CONST __pnp_002e_00 = &_dev56;
What I suggested somewhere on Gerrit:
At the chip driver level, add a header file that maps these to more distinct names, e.g.
#define igd_dev __pci_0_02_0;
But that was last week. Since then I've written yet another override tree and realized something. We write a lot lines like
device pci 02.0 on end # Integrated Graphics Device
What's wrong with that? (if you know me it's obvious) there is a comment! IIRC, Kyösti suggested it already, we could let sconfig read a chip specific mapping for device names. That would also allow us to write the above as
One way or another, I would like most of <soc/pci_devs.h> gone and same information derived from devicetree.cb files.
For the record, I am rebasing my local trees, this work removes most if not all #if __SIMPLE_DEVICE__ under soc/intel. Except for [1] and [2] I do not have any work pending related to providing usable alias names, or much interest to work on devicetree.cb parser.
[1] https://review.coreboot.org/c/coreboot/+/31936 [2] https://review.coreboot.org/c/coreboot/+/31934
Kyösti