Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35456 )
Change subject: [RFC] sconfig: Allow to give static device nodes a name ......................................................................
Patch Set 2:
Patch Set 2:
To solve my original problem, I have a more elaborate scheme in mind now:
The piece of code that consumes the device reference would have to be a driver that is hooked up as a `chip` in the dt. In the `chip.h` we'd declare the device reference as part of the config struct, e.g.:
struct some_chip_driver_config { DEVTREE_CONST struct device *needed_eeprom; };
Now in the dt, we'd name the referenced device, but only for sconfig's internal use:
device i2c 0x50 alias my_eeprom on end
The author of the dt would be free to choose this name. Later, when configuring the driver in the dt we would associate this given name with the one in the `chip.h`:
chip some/chip/driver use my_eeprom as needed_eeprom end
No global names anymore! I hope you like that, Aaron :)
Meh, https://review.coreboot.org/16080 If we have code at the mainboard level that needs a device reference (e.g. smbios_mainboard_serial_number()) how could that be handled? any ideas? revert to mb/chip.h?