Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45878 )
Change subject: tigerlake mainboards: switch to devtree aliases for PMC MUX connectors ......................................................................
Patch Set 7:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45878/6/src/mainboard/google/voltee... File src/mainboard/google/volteer/mainboard.c:
https://review.coreboot.org/c/coreboot/+/45878/6/src/mainboard/google/voltee... PS6, Line 23: dev->path.generic.id == 1;
Sure could, but those checks are so, how shall we say, inelegant đ?
Agreed. Ideally we should be solving this at the sconfig/devicetree level rather than having to check at runtime.
100% agree
There's got to be a better way to establish device "identity" than a `void *`...
Currently, the only way to ensure that you are inspecting the right structure is looking at the device->chip_ops. That gives us some confidence that future changes to the hierarchy won't silently change bits in an unrelated structure.
That's fair, it could be tricky to catch later, I'll add the ugly code đ
or maybe a new bus type "virtual" or similar
That would run into the same problem. In this case, you can restrict to using virtual only for pmc_mux, but we might run into similar problem with other device/buses as well.
Yeah, that was a strawman, I guess I mean some way in devtree to add an "identity" and/or "class of device"