dm: Add dtoc implementation of device instantiation (part D)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest33 patches 3 repliesIn review
- v149 patches 0 repliesSuperseded
Changes in v2 from the cover letter
- New patch
- New patch
- New patch
- Drop patches previously applied
- Update cover letter
- Fix the naming for uclass_plat_name so it is different from uclass_priv
- Tidy up tabbing to make the code output line up better
- Add a summary to the top of the generated file
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/33 | bootstage: Fix dependency for BOOTSTAGE_RECORD_COUNTcommon/ common/ | +4 | 0 replies | |
| 1/33 | bootstage: Fix dependency for BOOTSTAGE_RECORD_COUNT | +0 | 0 replies | |
| 2/33 | dtoc: Scan drivers for available informationtools/ tools/ | +311 | 0 replies | |
| 2/33 | dtoc: Scan drivers for available information | +0 | 0 replies | |
| 3/33 | dtoc: Save scan information across test runstools/ tools/ tools/ | +43 | 0 replies | |
| 3/33 | dtoc: Save scan information across test runs | +0 | 0 replies | |
| 4/33 | dtoc: Ignore unwanted files when scanning for driverstools/ tools/ | +9 | 0 replies | |
| 4/33 | dtoc: Ignore unwanted files when scanning for drivers | +0 | 0 replies | |
| 5/33 | dtoc: Collect priv/plat struct info from driverstools/ tools/ | +55 | 0 replies | |
| 5/33 | dtoc: Collect priv/plat struct info from drivers | +0 | 0 replies | |
| 6/33 | dtoc: Support scanning of uclassestools/ tools/ | +177 | 0 replies | |
| 6/33 | dtoc: Support scanning of uclasses | +0 | 0 replies | |
| 7/33 | dtoc: Support scanning of structs in header filestools/ tools/ | +128 | 0 replies | |
| 7/33 | dtoc: Support scanning of structs in header files | +0 | 0 replies | |
| 8/33 | dtoc: Move test files into a test/ directorytools/ tools/ tools/ +20 more | +24 | 0 replies | |
| 8/33 | dtoc: Move test files into a test/ directory | +0 | 0 replies | |
| 9/33 | dtoc: Rename sandbox_i2c_test and sandbox_pmic_testtools/ tools/ | +8 | 0 replies | |
| 9/33 | dtoc: Rename sandbox_i2c_test and sandbox_pmic_test | +0 | 0 replies | |
| 10/33 | dtoc: Add some extra properties to nodestools/ | +37 | 0 replies | |
| 10/33 | dtoc: Add some extra properties to nodes | +0 | 0 replies | |
| 11/33 | dtoc: Make use of node propertiestools/ | +19 | 0 replies | |
| 11/33 | dtoc: Make use of node properties | +0 | 0 replies | |
| 12/33 | dtoc: Process nodes to set up required propertiestools/ tools/ tools/ | +124 | 0 replies | |
| 12/33 | dtoc: Process nodes to set up required properties | +0 | 0 replies | |
| 13/33 | dtoc: Track nodes which are actually usedtools/ tools/ tools/ +1 more | +37 | 0 replies | |
| 13/33 | dtoc: Track nodes which are actually used | +0 | 0 replies | |
| 14/33 | dtoc: Support tracking the phase of U-Bootinclude/ tools/ tools/ +3 more | +47 | 0 replies | |
| 14/33 | dtoc: Support tracking the phase of U-Boot | +0 | 0 replies | |
| 15/33 | Makefile: Pass the U-Boot phase to dtocscripts/ | +1 | 0 replies | |
| 15/33 | Makefile: Pass the U-Boot phase to dtoc | +0 | 0 replies | |
| 16/33 | dtoc: Support headers needed for driversinclude/ tools/ tools/ | +29 | 0 replies | |
| 16/33 | dtoc: Support headers needed for drivers | +0 | 0 replies | |
| 17/33 | dtoc: Process driver aliases along with driversdoc/ tools/ tools/ | +11 | 3 replies | |
| 17/33 | dtoc: Process driver aliases along with drivers | +0 | 0 replies | |
| 18/33 | dtoc: Warn of duplicate driverstools/ tools/ | +122 | 0 replies | |
| 18/33 | dtoc: Warn of duplicate drivers | +0 | 0 replies | |
| 19/33 | dtoc: Read aliases for uclassestools/ tools/ tools/ +4 more | +345 | 0 replies | |
| 19/33 | dtoc: Read aliases for uclasses | +0 | 0 replies | |
| 20/33 | dtoc: Detect drivers only at the start of start of linetools/ | +2 | 0 replies | |
| 20/33 | dtoc: Detect drivers only at the start of start of line | +0 | 0 replies | |
| 21/33 | dtoc: Assign a sequence number to each nodedrivers/ test/ tools/ +1 more | +53 | 0 replies | |
| 21/33 | dtoc: Assign a sequence number to each node | +0 | 0 replies | |
| 22/33 | dtoc: Set up the uclasses that are usedtools/ tools/ tools/ +1 more | +119 | 0 replies | |
| 22/33 | dtoc: Set up the uclasses that are used | +0 | 0 replies | |
| 23/33 | dtoc: Support processing the root nodetools/ tools/ tools/ +1 more | +59 | 0 replies | |
| 23/33 | dtoc: Support processing the root node | +0 | 0 replies | |
| 24/33 | dtoc: Add an option for device instantiationtools/ tools/ tools/ | +36 | 0 replies | |
| 24/33 | dtoc: Add an option for device instantiation | +0 | 0 replies | |
| 25/33 | dm: of-platadata: Add option for device instantiationdts/ scripts/ | +25 | 0 replies | |
| 25/33 | dm: of-platadata: Add option for device instantiation | +0 | 0 replies | |
| 26/33 | dtoc: Add support for decl filetools/ tools/ | +120 | 0 replies | |
| 26/33 | dtoc: Add support for decl file | +0 | 0 replies | |
| 27/33 | dtoc: Don't generate platform data with instantiationtools/ tools/ | +75 | 0 replies | |
| 27/33 | dtoc: Don't generate platform data with instantiation | +0 | 0 replies | |
| 28/33 | sandbox: Make sandbox,emul more conventionalarch/ doc/ | +6 | 0 replies | |
| 28/33 | sandbox: Make sandbox,emul more conventional | +0 | 0 replies | |
| 29/33 | sandbox: i2c: Rename driver names to work with of-platdataarch/ drivers/ drivers/ | +5 | 0 replies | |
| 29/33 | sandbox: i2c: Rename driver names to work with of-platdata | +0 | 0 replies | |
| 30/33 | dtoc: Tidy up the list of supported phandle propertiestools/ | +21 | 0 replies | |
| 30/33 | dtoc: Tidy up the list of supported phandle properties | +0 | 0 replies | |
| 31/33 | dtoc: Generate a summary in the dt-plat.c filetools/ tools/ | +169 | 0 replies | |
| 31/33 | dtoc: Generate a summary in the dt-plat.c file | +0 | 0 replies | |
| 32/33 | dtoc: Generate uclass devicesdrivers/ include/ tools/ +1 more | +250 | 0 replies | |
| 32/33 | dtoc: Generate uclass devices | +0 | 0 replies | |
| 33/33 | dtoc: Generate device instancesdrivers/ tools/ tools/ | +484 | 0 replies | |
| 33/33 | dtoc: Generate device instances | +0 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 00/33] dm: Add dtoc implementation of device instantiation (part D)
By way of background, in May[1] and July[2] two 'tiny-dm' series were sent out, showing a possible way to reduce the overhead of driver model in SPL. The potential impact of that work was described in the cover letter[3].
While this was a successful demonstration, all but eliminating the overhead of driver model, it was not very practical, since it would have required substantial effort to adapt drivers used in SPL to what was effectively a parallel driver model.
Instead, after much discussion [4], it was decided to try to use the tiny-dm methods to adapt the existing of-platdata infrastructure. This is considerably more work up front but should result in much less effort for maintainers, along with a single, more consistent driver model.
Of the options mentioned in [3], the following are implemented (in dtoc only, not driver model) as part of this series (CS=reduces code size, DS=reduces data size):
CS - drop driver_bind() and create devices (struct udevice) at
build-time
CS - allocate all device- and uclass-private data at build-time
In addition the following was completed in an earlier series:
CS / DS - Combine req_seq and seq and calculate the new value at
build-time
So this series updates dtoc to support generating devices and uclasses that are ready for use when SPL starts and don't need to be bound.
This 'build-time' instantiation helps to reduce the code-size overhead of driver model in SPL.
As part of this series, a new -i option is added to dtoc. This changes it to emit build-time-instantiated devices. Separate Kconfig options control instantiation and whether run-time binding is supported.
Several corner cases have come up in making this work on sandbox_spl and chromebook_coral. It is possible that others will come up in the future, but it should be possible to adapt things to address these, based on the work here.
This is part D of the overall effort. The final series includes the driver model implementation, as well as updating the documentation.
To find out what the new generated files look like, see the last four patches of this series.
It is available at u-boot-dm/prepd-working
[1] http://patchwork.ozlabs.org/project/uboot/list/?series=179128&state=*
[2] http://patchwork.ozlabs.org/project/uboot/list/?series=187295&state=*
[3] https://lists.denx.de/pipermail/u-boot/2020-July/418433.html
[4] http://patchwork.ozlabs.org/project/uboot/patch/20200525093539.1.Ibf2d19439cde35e39192a9d4a8dad23539fae2e6 at changeid/
Changes in v2:
- New patch
- New patch
- New patch
- Drop patches previously applied
- Update cover letter
- Fix the naming for uclass_plat_name so it is different from uclass_priv
- Tidy up tabbing to make the code output line up better
- Add a summary to the top of the generated file
Simon Glass (33):
bootstage: Fix dependency for BOOTSTAGE_RECORD_COUNT
dtoc: Scan drivers for available information
dtoc: Save scan information across test runs
dtoc: Ignore unwanted files when scanning for drivers
dtoc: Collect priv/plat struct info from drivers
dtoc: Support scanning of uclasses
dtoc: Support scanning of structs in header files
dtoc: Move test files into a test/ directory
dtoc: Rename sandbox_i2c_test and sandbox_pmic_test
dtoc: Add some extra properties to nodes
dtoc: Make use of node properties
dtoc: Process nodes to set up required properties
dtoc: Track nodes which are actually used
dtoc: Support tracking the phase of U-Boot
Makefile: Pass the U-Boot phase to dtoc
dtoc: Support headers needed for drivers
dtoc: Process driver aliases along with drivers
dtoc: Warn of duplicate drivers
dtoc: Read aliases for uclasses
dtoc: Detect drivers only at the start of start of line
dtoc: Assign a sequence number to each node
dtoc: Set up the uclasses that are used
dtoc: Support processing the root node
dtoc: Add an option for device instantiation
dm: of-platadata: Add option for device instantiation
dtoc: Add support for decl file
dtoc: Don't generate platform data with instantiation
sandbox: Make sandbox,emul more conventional
sandbox: i2c: Rename driver names to work with of-platdata
dtoc: Tidy up the list of supported phandle properties
dtoc: Generate a summary in the dt-plat.c file
dtoc: Generate uclass devices
dtoc: Generate device instances
arch/sandbox/dts/sandbox.dtsi | 6 +-
arch/sandbox/dts/test.dts | 4 +-
common/Kconfig.boot | 3 +
common/bootstage.c | 2 +-
doc/driver-model/of-plat.rst | 3 +-
doc/driver-model/pci-info.rst | 1 +
drivers/i2c/i2c-emul-uclass.c | 4 +-
drivers/misc/test_drv.c | 11 +-
drivers/rtc/i2c_rtc_emul.c | 2 +-
dts/Kconfig | 23 +-
include/dm/device.h | 34 +
include/dm/test.h | 5 +
scripts/Makefile.spl | 6 +-
test/dm/test-fdt.c | 6 +-
tools/dtoc/dtb_platdata.py | 620 +++++++++-
tools/dtoc/dtoc_test_scan_drivers.cxx | 1 -
tools/dtoc/main.py | 9 +-
tools/dtoc/src_scan.py | 597 +++++++++-
tools/dtoc/{ => test}/dtoc_test.dts | 0
tools/dtoc/{ => test}/dtoc_test_add_prop.dts | 0
tools/dtoc/{ => test}/dtoc_test_addr32.dts | 0
tools/dtoc/{ => test}/dtoc_test_addr32_64.dts | 0
tools/dtoc/{ => test}/dtoc_test_addr64.dts | 0
tools/dtoc/{ => test}/dtoc_test_addr64_32.dts | 0
tools/dtoc/test/dtoc_test_alias_bad.dts | 58 +
tools/dtoc/test/dtoc_test_alias_bad_path.dts | 58 +
tools/dtoc/test/dtoc_test_alias_bad_uc.dts | 58 +
tools/dtoc/{ => test}/dtoc_test_aliases.dts | 0
tools/dtoc/{ => test}/dtoc_test_bad_reg.dts | 0
tools/dtoc/{ => test}/dtoc_test_bad_reg2.dts | 0
.../{ => test}/dtoc_test_driver_alias.dts | 0
tools/dtoc/{ => test}/dtoc_test_empty.dts | 0
tools/dtoc/test/dtoc_test_inst.dts | 58 +
.../{ => test}/dtoc_test_invalid_driver.dts | 0
tools/dtoc/{ => test}/dtoc_test_phandle.dts | 0
.../dtoc/{ => test}/dtoc_test_phandle_bad.dts | 0
.../{ => test}/dtoc_test_phandle_bad2.dts | 0
.../{ => test}/dtoc_test_phandle_cd_gpios.dts | 0
.../{ => test}/dtoc_test_phandle_reorder.dts | 0
.../{ => test}/dtoc_test_phandle_single.dts | 0
tools/dtoc/test/dtoc_test_scan_drivers.cxx | 5 +
tools/dtoc/{ => test}/dtoc_test_simple.dts | 4 +-
tools/dtoc/test_dtoc.py | 1023 ++++++++++++++++-
tools/dtoc/test_fdt.py | 31 +-
tools/dtoc/test_src_scan.py | 397 ++++++-
45 files changed, 2847 insertions(+), 182 deletions(-)
delete mode 100644 tools/dtoc/dtoc_test_scan_drivers.cxx
rename tools/dtoc/{ => test}/dtoc_test.dts (100%)
rename tools/dtoc/{ => test}/dtoc_test_add_prop.dts (100%)
rename tools/dtoc/{ => test}/dtoc_test_addr32.dts (100%)
rename tools/dtoc/{ => test}/dtoc_test_addr32_64.dts (100%)
rename tools/dtoc/{ => test}/dtoc_test_addr64.dts (100%)
rename tools/dtoc/{ => test}/dtoc_test_addr64_32.dts (100%)
create mode 100644 tools/dtoc/test/dtoc_test_alias_bad.dts
create mode 100644 tools/dtoc/test/dtoc_test_alias_bad_path.dts
create mode 100644 tools/dtoc/test/dtoc_test_alias_bad_uc.dts
rename tools/dtoc/{ => test}/dtoc_test_aliases.dts (100%)
rename tools/dtoc/{ => test}/dtoc_test_bad_reg.dts (100%)
rename tools/dtoc/{ => test}/dtoc_test_bad_reg2.dts (100%)
rename tools/dtoc/{ => test}/dtoc_test_driver_alias.dts (100%)
rename tools/dtoc/{ => test}/dtoc_test_empty.dts (100%)
create mode 100644 tools/dtoc/test/dtoc_test_inst.dts
rename tools/dtoc/{ => test}/dtoc_test_invalid_driver.dts (100%)
rename tools/dtoc/{ => test}/dtoc_test_phandle.dts (100%)
rename tools/dtoc/{ => test}/dtoc_test_phandle_bad.dts (100%)
rename tools/dtoc/{ => test}/dtoc_test_phandle_bad2.dts (100%)
rename tools/dtoc/{ => test}/dtoc_test_phandle_cd_gpios.dts (100%)
rename tools/dtoc/{ => test}/dtoc_test_phandle_reorder.dts (100%)
rename tools/dtoc/{ => test}/dtoc_test_phandle_single.dts (100%)
create mode 100644 tools/dtoc/test/dtoc_test_scan_drivers.cxx
rename tools/dtoc/{ => test}/dtoc_test_simple.dts (93%)Signature · 1 line
2.30.0.365.g02bc693789-goog