All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/33] dm: Add dtoc implementation of device instantiation (part D)
@ 2021-02-03 13:00 Simon Glass
  2021-02-03 13:00 ` [PATCH v2 01/33] bootstage: Fix dependency for BOOTSTAGE_RECORD_COUNT Simon Glass
                   ` (65 more replies)
  0 siblings, 66 replies; 70+ messages in thread
From: Simon Glass @ 2021-02-03 13:00 UTC (permalink / raw)
  To: u-boot

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%)

-- 
2.30.0.365.g02bc693789-goog

^ permalink raw reply	[flat|nested] 70+ messages in thread

end of thread, other threads:[~2021-07-04 18:18 UTC | newest]

Thread overview: 70+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03 13:00 [PATCH v2 00/33] dm: Add dtoc implementation of device instantiation (part D) Simon Glass
2021-02-03 13:00 ` [PATCH v2 01/33] bootstage: Fix dependency for BOOTSTAGE_RECORD_COUNT Simon Glass
2021-02-03 13:00 ` [PATCH v2 02/33] dtoc: Scan drivers for available information Simon Glass
2021-02-03 13:00 ` [PATCH v2 03/33] dtoc: Save scan information across test runs Simon Glass
2021-02-03 13:00 ` [PATCH v2 04/33] dtoc: Ignore unwanted files when scanning for drivers Simon Glass
2021-02-03 13:00 ` [PATCH v2 05/33] dtoc: Collect priv/plat struct info from drivers Simon Glass
2021-02-03 13:00 ` [PATCH v2 06/33] dtoc: Support scanning of uclasses Simon Glass
2021-02-03 13:00 ` [PATCH v2 07/33] dtoc: Support scanning of structs in header files Simon Glass
2021-02-03 13:00 ` [PATCH v2 08/33] dtoc: Move test files into a test/ directory Simon Glass
2021-02-03 13:00 ` [PATCH v2 09/33] dtoc: Rename sandbox_i2c_test and sandbox_pmic_test Simon Glass
2021-02-03 13:00 ` [PATCH v2 10/33] dtoc: Add some extra properties to nodes Simon Glass
2021-02-03 13:00 ` [PATCH v2 11/33] dtoc: Make use of node properties Simon Glass
2021-02-03 13:01 ` [PATCH v2 12/33] dtoc: Process nodes to set up required properties Simon Glass
2021-02-03 13:01 ` [PATCH v2 13/33] dtoc: Track nodes which are actually used Simon Glass
2021-02-03 13:01 ` [PATCH v2 14/33] dtoc: Support tracking the phase of U-Boot Simon Glass
2021-02-03 13:01 ` [PATCH v2 15/33] Makefile: Pass the U-Boot phase to dtoc Simon Glass
2021-02-03 13:01 ` [PATCH v2 16/33] dtoc: Support headers needed for drivers Simon Glass
2021-02-03 13:01 ` [PATCH v2 17/33] dtoc: Process driver aliases along with drivers Simon Glass
2021-06-21 18:39   ` Johan Jonker
2021-06-26 18:32     ` Simon Glass
2021-07-04 18:18       ` Simon Glass
2021-02-03 13:01 ` [PATCH v2 18/33] dtoc: Warn of duplicate drivers Simon Glass
2021-02-03 13:01 ` [PATCH v2 19/33] dtoc: Read aliases for uclasses Simon Glass
2021-02-03 13:01 ` [PATCH v2 20/33] dtoc: Detect drivers only at the start of start of line Simon Glass
2021-02-03 13:01 ` [PATCH v2 21/33] dtoc: Assign a sequence number to each node Simon Glass
2021-02-03 13:01 ` [PATCH v2 22/33] dtoc: Set up the uclasses that are used Simon Glass
2021-02-03 13:01 ` [PATCH v2 23/33] dtoc: Support processing the root node Simon Glass
2021-02-03 13:01 ` [PATCH v2 24/33] dtoc: Add an option for device instantiation Simon Glass
2021-02-03 13:01 ` [PATCH v2 25/33] dm: of-platadata: Add " Simon Glass
2021-02-03 13:01 ` [PATCH v2 26/33] dtoc: Add support for decl file Simon Glass
2021-02-03 13:01 ` [PATCH v2 27/33] dtoc: Don't generate platform data with instantiation Simon Glass
2021-02-03 13:01 ` [PATCH v2 28/33] sandbox: Make sandbox,emul more conventional Simon Glass
2021-02-03 13:01 ` [PATCH v2 29/33] sandbox: i2c: Rename driver names to work with of-platdata Simon Glass
2021-02-03 13:01 ` [PATCH v2 30/33] dtoc: Tidy up the list of supported phandle properties Simon Glass
2021-02-03 13:01 ` [PATCH v2 31/33] dtoc: Generate a summary in the dt-plat.c file Simon Glass
2021-02-03 13:01 ` [PATCH v2 32/33] dtoc: Generate uclass devices Simon Glass
2021-02-03 13:01 ` [PATCH v2 33/33] dtoc: Generate device instances Simon Glass
2021-02-07  0:16 ` Simon Glass
2021-02-07  0:16 ` [PATCH v2 32/33] dtoc: Generate uclass devices Simon Glass
2021-02-07  0:16 ` [PATCH v2 31/33] dtoc: Generate a summary in the dt-plat.c file Simon Glass
2021-02-07  0:16 ` [PATCH v2 30/33] dtoc: Tidy up the list of supported phandle properties Simon Glass
2021-02-07  0:16 ` [PATCH v2 29/33] sandbox: i2c: Rename driver names to work with of-platdata Simon Glass
2021-02-07  0:16 ` [PATCH v2 28/33] sandbox: Make sandbox,emul more conventional Simon Glass
2021-02-07  0:16 ` [PATCH v2 27/33] dtoc: Don't generate platform data with instantiation Simon Glass
2021-02-07  0:16 ` [PATCH v2 26/33] dtoc: Add support for decl file Simon Glass
2021-02-07  0:16 ` [PATCH v2 25/33] dm: of-platadata: Add option for device instantiation Simon Glass
2021-02-07  0:17 ` [PATCH v2 24/33] dtoc: Add an " Simon Glass
2021-02-07  0:17 ` [PATCH v2 23/33] dtoc: Support processing the root node Simon Glass
2021-02-07  0:17 ` [PATCH v2 22/33] dtoc: Set up the uclasses that are used Simon Glass
2021-02-07  0:17 ` [PATCH v2 21/33] dtoc: Assign a sequence number to each node Simon Glass
2021-02-07  0:17 ` [PATCH v2 20/33] dtoc: Detect drivers only at the start of start of line Simon Glass
2021-02-07  0:17 ` [PATCH v2 19/33] dtoc: Read aliases for uclasses Simon Glass
2021-02-07  0:17 ` [PATCH v2 18/33] dtoc: Warn of duplicate drivers Simon Glass
2021-02-07  0:17 ` [PATCH v2 17/33] dtoc: Process driver aliases along with drivers Simon Glass
2021-02-07  0:17 ` [PATCH v2 16/33] dtoc: Support headers needed for drivers Simon Glass
2021-02-07  0:17 ` [PATCH v2 15/33] Makefile: Pass the U-Boot phase to dtoc Simon Glass
2021-02-07  0:17 ` [PATCH v2 14/33] dtoc: Support tracking the phase of U-Boot Simon Glass
2021-02-07  0:17 ` [PATCH v2 13/33] dtoc: Track nodes which are actually used Simon Glass
2021-02-07  0:17 ` [PATCH v2 12/33] dtoc: Process nodes to set up required properties Simon Glass
2021-02-07  0:17 ` [PATCH v2 11/33] dtoc: Make use of node properties Simon Glass
2021-02-07  0:17 ` [PATCH v2 10/33] dtoc: Add some extra properties to nodes Simon Glass
2021-02-07  0:17 ` [PATCH v2 09/33] dtoc: Rename sandbox_i2c_test and sandbox_pmic_test Simon Glass
2021-02-07  0:17 ` [PATCH v2 08/33] dtoc: Move test files into a test/ directory Simon Glass
2021-02-07  0:17 ` [PATCH v2 07/33] dtoc: Support scanning of structs in header files Simon Glass
2021-02-07  0:17 ` [PATCH v2 06/33] dtoc: Support scanning of uclasses Simon Glass
2021-02-07  0:17 ` [PATCH v2 05/33] dtoc: Collect priv/plat struct info from drivers Simon Glass
2021-02-07  0:17 ` [PATCH v2 04/33] dtoc: Ignore unwanted files when scanning for drivers Simon Glass
2021-02-07  0:17 ` [PATCH v2 03/33] dtoc: Save scan information across test runs Simon Glass
2021-02-07  0:17 ` [PATCH v2 02/33] dtoc: Scan drivers for available information Simon Glass
2021-02-07  0:17 ` [PATCH v2 01/33] bootstage: Fix dependency for BOOTSTAGE_RECORD_COUNT Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.