Duncan Laurie has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35456 )
Change subject: sconfig: Allow to link devices to other device' drivers ......................................................................
Patch Set 4:
(5 comments)
https://review.coreboot.org/c/coreboot/+/35456/4//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/35456/4//COMMIT_MSG@32 PS4, Line 32: use my_eeprom as needed_eeprom
whoops, I got the names backwards, but you see my point. […]
'dev' seems a bit overloaded in the grammar since it already uses 'device' quite a bit.
I have a patch series that builds on this and adds a chipset provided devicetree:
``` chipset.cb: device pci 15.0 alias i2c0 off end ```
And I added 'ref' as a synonym for 'use' because it seemed odd otherwise.
This is a completely made up example to show ways to use the alias, obviously wouldn't need both for the same device.
``` devicetree.cb: device ref i2c0 on use i2c0 as my_i2c_port end ```
We could build on that and replace 'use' with 'ref' completely and invert the syntax as suggested:
``` devicetree.cb: device ref i2c0 on ref my_i2c_port is i2c0 end ```
https://review.coreboot.org/c/coreboot/+/35456/4//COMMIT_MSG@36 PS4, Line 36: defined in the base tree.
Changing the alias feels wrong. But we can start with this behavior […]
I ended up changing this, overrides can now add an alias if it does not exist but cannot change an existing one.
https://review.coreboot.org/c/coreboot/+/35456/4//COMMIT_MSG@38 PS4, Line 38: conflits
confli*c*ts
Done
https://review.coreboot.org/c/coreboot/+/35456/4/util/sconfig/main.c File util/sconfig/main.c:
https://review.coreboot.org/c/coreboot/+/35456/4/util/sconfig/main.c@862 PS4, Line 862: free(alias);
This looks a bit odd now that we have a copy of the pointer in the `->ref` […]
Done
https://review.coreboot.org/c/coreboot/+/35456/4/util/sconfig/main.c@1716 PS4, Line 1716: walk_device_tree(autogen, autohead, &base_root_dev, update_references);
Could we just do it as part of pass0()? If not, is there a reason to […]
The device names don't get created until pass0 now (this was a more recent change) so it needs to happen after pass0 as a separate step once all the devices have names to link to.