From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH v4 00/42] dm: Implement OF_PLATDATA_INST in driver model (part E)
Date: Mon, 15 Mar 2021 17:25:10 +1300 [thread overview]
Message-ID: <20210315042553.1932494-1-sjg@chromium.org> (raw)
This series builds on the recent dtoc implementation of build-time device
instantiation.
It adds the required driver model support, which is basically a few more
data structures.
With this, sandbox_spl and chromebook_coral both use the new feature.
For coral TPL there is a 1.5KB code-size reduction and a 1.75KB data-size
increase:
text data bss dec hex
18836 3080 12 21928 55a8 original
17229 4896 12 22137 5679 with OF_PLATDATA_INST
17277 4896 12 22185 56a9 with OF_PLATDATA_RT
The extra data size is due to the build-time devices which are now
included in the image instead of being built at runtime. Also the private
data for each device is allocated in the data region at present, even
through much of it is just zeroes.
The reduction in code size is due to not needing to bind devices at
runtime, as a well as a simplified probe() function. Coral requires that
data be copied out to RAM before being updated, so that adds a small
amount to size (shown in the third line).
Quite a lot of future work is possible, including reducing the size of
data structures. See [1] for more ideas. But this series implements the
basic feature.
To try this out on your board, define CONFIG_SPL_OF_PLATDATA_INST and see
what you get.
This series is available at u-boot-dm/tin-working
[1] https://lists.denx.de/pipermail/u-boot/2020-July/418433.html
Changes in v4:
- Rebase to -next
Changes in v3:
- Add new patch to drop DECL() macros from dtoc (to squash in)
- Drop the decl() variant since it is just as easy to use extern
- Drop the decl() versions of the macros
- Add full documentation for the macros
- Update the commit message to explain OF_PLATDATA_NO_BIND better
- Update OF_PLATDATA_NO_BIND help as well
- Drop DM_DRVINFO_GET() also
- Aew patch with warnings for private / platform setters
- Add documentation updates
- Add documentation for of-platdata-inst
- Don't drop 'ranges' since we use the full PCI driver in SPL
- Add new patch to drop coral's TPM and ACPI interrupts from TPL
- Use 'u-boot,dm-pre-proper' so these are not present in TPL/SPL
Changes in v2:
- Update to deal with test refactoring series
- Use separate OF_PLATDATA_DRIVER_RT Kconfigs for driver run-time data
- Update the condition for dm_test_of_plat_dev()
- Leave the flags_ memeber in the same struct position
Simon Glass (42):
dtoc: Drop use of DECL() macros
sandbox: Drop debug message in os_spl_to_uboot()
linker_lists: Allow use in data structures
dm: core: Add macros to access the new linker lists
dm: core: Allow dropping run-time binding of devices
dm: core: Adjust uclass setup with of-platdata
dm: core: Set up driver model for OF_PLATDATA_INST
dm: core: Skip adding uclasses with OF_PLATDATA_INST
dm: Add the new dtoc-generated files to the build
dm: core: Include dt-decl.h automatically
dm: test: Avoid destroying uclasses with of-platdata-inst
clk: sandbox: Move priv/plat data to a header file
clk: fixed-rate: Export driver parts for OF_PLATDATA_INST
clk: sandbox: Create a special fixed-rate driver
dm: core: Drop device_get_by_driver_info()
dm: core: Drop uclass_find_device_by_phandle() with of-platdata
sandbox: i2c: Move platdata structs to header files
dm: Rename device_get_by_driver_info_idx()
sandbox_spl: Increase SPL malloc() size
sandbox: i2c: Support i2c emulation with of-platdata
Revert "sandbox: Disable I2C emulators in SPL"
sandbox: Create a new sandbox_noinst build
test: Run sandbox_spl tests on sandbox_noinst
azure/gitlab: Add tests for sandbox_noinst
dm: core: Add an option to support SPL in read-only memory
dm: core: Create a struct for device runtime info
dm: core: Move flags to device-runtime info
dm: core: Allow storing priv/plat data separately
sandbox: Define a region for device priv/plat data
dm: core: Use separate priv/plat data region
dm: core: Add warnings to private / platform setters
dm: doc: Tidy up of-platdata docs
dm: doc: Add documentation for of-platdata-inst
x86: Define a region for device priv/plat data
x86: apl: Fix the header order in pmc
x86: apl: Tell of-platdata about a required header file
x86: itss: Tidy up bind() for of-platdata-inst
x86: Support a fake PCI device with of-platdata-inst
x86: Don't include reset driver in SPL
x86: coral: Drop ACPI properties from of-platdata
x86: coral: Drop TPM and ACPI interrupts from TPL
x86: apl: Use read-only SPL and new of-platdata
.azure-pipelines.yml | 3 +
.gitlab-ci.yml | 10 +-
arch/sandbox/cpu/os.c | 1 -
arch/sandbox/cpu/u-boot-spl.lds | 8 +
arch/sandbox/dts/sandbox.dtsi | 12 +-
arch/sandbox/include/asm/clk.h | 24 +
arch/sandbox/include/asm/i2c.h | 15 +
arch/sandbox/include/asm/rtc.h | 24 +
arch/x86/cpu/apollolake/Kconfig | 2 +
arch/x86/cpu/apollolake/pmc.c | 2 +-
arch/x86/cpu/apollolake/punit.c | 1 +
arch/x86/cpu/intel_common/itss.c | 5 +-
arch/x86/cpu/u-boot-spl.lds | 8 +
arch/x86/dts/chromebook_coral.dts | 10 +-
arch/x86/dts/reset.dtsi | 2 +-
arch/x86/lib/tpl.c | 1 +
board/sandbox/MAINTAINERS | 7 +
common/spl/Kconfig | 24 +
configs/chromebook_coral_defconfig | 1 +
configs/sandbox_noinst_defconfig | 231 +++++++++
configs/sandbox_spl_defconfig | 3 +
doc/driver-model/of-plat.rst | 725 +++++++++++++++++++++++++----
drivers/clk/clk-uclass.c | 2 +-
drivers/clk/clk_fixed_rate.c | 14 +-
drivers/clk/clk_sandbox.c | 40 +-
drivers/clk/clk_sandbox_test.c | 6 -
drivers/core/device.c | 111 +++--
drivers/core/root.c | 85 +++-
drivers/core/uclass.c | 7 +-
drivers/i2c/Makefile | 2 -
drivers/i2c/i2c-emul-uclass.c | 30 +-
drivers/misc/irq-uclass.c | 2 +-
drivers/mmc/fsl_esdhc_imx.c | 3 +-
drivers/rtc/i2c_rtc_emul.c | 19 -
drivers/rtc/sandbox_rtc.c | 13 +
dts/Kconfig | 60 +++
include/asm-generic/global_data.h | 26 +-
include/asm-generic/sections.h | 3 +
include/dm/device-internal.h | 93 ++++
include/dm/device.h | 74 ++-
include/dm/platdata.h | 15 -
include/dm/root.h | 3 +
include/dm/uclass-internal.h | 52 +++
include/dm/uclass.h | 31 ++
include/dm/util.h | 9 +
include/dt-structs.h | 2 +
include/i2c.h | 15 +
include/linker_lists.h | 12 +
include/linux/clk-provider.h | 5 +
scripts/Makefile.spl | 3 +-
test/dm/of_platdata.c | 32 +-
test/run | 4 +
test/test-main.c | 30 +-
tools/dtoc/dtb_platdata.py | 8 +-
tools/dtoc/test_dtoc.py | 64 +--
55 files changed, 1677 insertions(+), 317 deletions(-)
create mode 100644 configs/sandbox_noinst_defconfig
--
2.31.0.rc2.261.g7f71774620-goog
next reply other threads:[~2021-03-15 4:25 UTC|newest]
Thread overview: 85+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-15 4:25 Simon Glass [this message]
2021-03-15 4:25 ` [PATCH v4 01/42] dtoc: Drop use of DECL() macros Simon Glass
2021-03-15 4:25 ` [PATCH v4 02/42] sandbox: Drop debug message in os_spl_to_uboot() Simon Glass
2021-03-15 4:25 ` [PATCH v4 03/42] linker_lists: Allow use in data structures Simon Glass
2021-03-15 4:25 ` [PATCH v4 04/42] dm: core: Add macros to access the new linker lists Simon Glass
2021-03-15 4:25 ` [PATCH v4 05/42] dm: core: Allow dropping run-time binding of devices Simon Glass
2021-03-15 4:25 ` [PATCH v4 06/42] dm: core: Adjust uclass setup with of-platdata Simon Glass
2021-03-15 4:25 ` [PATCH v4 07/42] dm: core: Set up driver model for OF_PLATDATA_INST Simon Glass
2021-03-15 4:25 ` [PATCH v4 08/42] dm: core: Skip adding uclasses with OF_PLATDATA_INST Simon Glass
2021-03-15 4:25 ` [PATCH v4 09/42] dm: Add the new dtoc-generated files to the build Simon Glass
2021-03-15 4:25 ` [PATCH v4 10/42] dm: core: Include dt-decl.h automatically Simon Glass
2021-03-15 4:25 ` [PATCH v4 11/42] dm: test: Avoid destroying uclasses with of-platdata-inst Simon Glass
2021-03-15 4:25 ` [PATCH v4 12/42] clk: sandbox: Move priv/plat data to a header file Simon Glass
2021-03-15 4:25 ` [PATCH v4 13/42] clk: fixed-rate: Export driver parts for OF_PLATDATA_INST Simon Glass
2021-03-15 4:25 ` [PATCH v4 14/42] clk: sandbox: Create a special fixed-rate driver Simon Glass
2021-03-15 4:25 ` [PATCH v4 15/42] dm: core: Drop device_get_by_driver_info() Simon Glass
2021-03-15 4:25 ` [PATCH v4 16/42] dm: core: Drop uclass_find_device_by_phandle() with of-platdata Simon Glass
2021-03-15 4:25 ` [PATCH v4 17/42] sandbox: i2c: Move platdata structs to header files Simon Glass
2021-03-15 4:25 ` [PATCH v4 18/42] dm: Rename device_get_by_driver_info_idx() Simon Glass
2021-03-15 4:25 ` [PATCH v4 19/42] sandbox_spl: Increase SPL malloc() size Simon Glass
2021-03-15 4:25 ` [PATCH v4 20/42] sandbox: i2c: Support i2c emulation with of-platdata Simon Glass
2021-03-15 4:25 ` [PATCH v4 21/42] Revert "sandbox: Disable I2C emulators in SPL" Simon Glass
2021-03-15 4:25 ` [PATCH v4 22/42] sandbox: Create a new sandbox_noinst build Simon Glass
2021-03-15 4:25 ` [PATCH v4 23/42] test: Run sandbox_spl tests on sandbox_noinst Simon Glass
2021-03-15 4:25 ` [PATCH v4 24/42] azure/gitlab: Add tests for sandbox_noinst Simon Glass
2021-03-15 4:25 ` [PATCH v4 25/42] dm: core: Add an option to support SPL in read-only memory Simon Glass
2021-03-15 4:25 ` [PATCH v4 26/42] dm: core: Create a struct for device runtime info Simon Glass
2021-03-15 4:25 ` [PATCH v4 27/42] dm: core: Move flags to device-runtime info Simon Glass
2021-03-15 4:25 ` [PATCH v4 28/42] dm: core: Allow storing priv/plat data separately Simon Glass
2021-03-15 4:25 ` [PATCH v4 29/42] sandbox: Define a region for device priv/plat data Simon Glass
2021-03-15 4:25 ` [PATCH v4 30/42] dm: core: Use separate priv/plat data region Simon Glass
2021-03-15 4:25 ` [PATCH v4 31/42] dm: core: Add warnings to private / platform setters Simon Glass
2021-03-15 4:25 ` [PATCH v4 32/42] dm: doc: Tidy up of-platdata docs Simon Glass
2021-03-15 4:25 ` [PATCH v4 33/42] dm: doc: Add documentation for of-platdata-inst Simon Glass
2021-03-15 4:25 ` [PATCH v4 34/42] x86: Define a region for device priv/plat data Simon Glass
2021-03-15 4:25 ` [PATCH v4 35/42] x86: apl: Fix the header order in pmc Simon Glass
2021-03-15 4:25 ` [PATCH v4 36/42] x86: apl: Tell of-platdata about a required header file Simon Glass
2021-03-15 4:25 ` [PATCH v4 37/42] x86: itss: Tidy up bind() for of-platdata-inst Simon Glass
2021-03-15 4:25 ` [PATCH v4 38/42] x86: Support a fake PCI device with of-platdata-inst Simon Glass
2021-03-15 4:25 ` [PATCH v4 39/42] x86: Don't include reset driver in SPL Simon Glass
2021-03-15 4:25 ` [PATCH v4 40/42] x86: coral: Drop ACPI properties from of-platdata Simon Glass
2021-03-15 4:25 ` [PATCH v4 41/42] x86: coral: Drop TPM and ACPI interrupts from TPL Simon Glass
2021-03-15 4:25 ` [PATCH v4 42/42] x86: apl: Use read-only SPL and new of-platdata Simon Glass
2021-03-17 1:28 ` Simon Glass
2021-03-17 1:28 ` [PATCH v4 41/42] x86: coral: Drop TPM and ACPI interrupts from TPL Simon Glass
2021-03-17 1:28 ` [PATCH v4 39/42] x86: Don't include reset driver in SPL Simon Glass
2021-03-17 1:28 ` [PATCH v4 40/42] x86: coral: Drop ACPI properties from of-platdata Simon Glass
2021-03-17 1:28 ` [PATCH v4 38/42] x86: Support a fake PCI device with of-platdata-inst Simon Glass
2021-03-17 1:28 ` [PATCH v4 37/42] x86: itss: Tidy up bind() for of-platdata-inst Simon Glass
2021-03-17 1:28 ` [PATCH v4 36/42] x86: apl: Tell of-platdata about a required header file Simon Glass
2021-03-17 1:28 ` [PATCH v4 35/42] x86: apl: Fix the header order in pmc Simon Glass
2021-03-17 1:28 ` [PATCH v4 34/42] x86: Define a region for device priv/plat data Simon Glass
2021-03-17 1:28 ` [PATCH v4 32/42] dm: doc: Tidy up of-platdata docs Simon Glass
2021-03-17 1:28 ` [PATCH v4 33/42] dm: doc: Add documentation for of-platdata-inst Simon Glass
2021-03-17 1:28 ` [PATCH v4 31/42] dm: core: Add warnings to private / platform setters Simon Glass
2021-03-17 1:28 ` [PATCH v4 30/42] dm: core: Use separate priv/plat data region Simon Glass
2021-03-17 1:28 ` [PATCH v4 29/42] sandbox: Define a region for device priv/plat data Simon Glass
2021-03-17 1:28 ` [PATCH v4 28/42] dm: core: Allow storing priv/plat data separately Simon Glass
2021-03-17 1:28 ` [PATCH v4 27/42] dm: core: Move flags to device-runtime info Simon Glass
2021-03-17 1:28 ` [PATCH v4 26/42] dm: core: Create a struct for device runtime info Simon Glass
2021-03-17 1:28 ` [PATCH v4 25/42] dm: core: Add an option to support SPL in read-only memory Simon Glass
2021-03-17 1:28 ` [PATCH v4 24/42] azure/gitlab: Add tests for sandbox_noinst Simon Glass
2021-03-17 1:28 ` [PATCH v4 23/42] test: Run sandbox_spl tests on sandbox_noinst Simon Glass
2021-03-17 1:28 ` [PATCH v4 22/42] sandbox: Create a new sandbox_noinst build Simon Glass
2021-03-17 1:28 ` [PATCH v4 21/42] Revert "sandbox: Disable I2C emulators in SPL" Simon Glass
2021-03-17 1:28 ` [PATCH v4 20/42] sandbox: i2c: Support i2c emulation with of-platdata Simon Glass
2021-03-17 1:28 ` [PATCH v4 19/42] sandbox_spl: Increase SPL malloc() size Simon Glass
2021-03-17 1:28 ` [PATCH v4 18/42] dm: Rename device_get_by_driver_info_idx() Simon Glass
2021-03-17 1:28 ` [PATCH v4 17/42] sandbox: i2c: Move platdata structs to header files Simon Glass
2021-03-17 1:28 ` [PATCH v4 16/42] dm: core: Drop uclass_find_device_by_phandle() with of-platdata Simon Glass
2021-03-17 1:28 ` [PATCH v4 15/42] dm: core: Drop device_get_by_driver_info() Simon Glass
2021-03-17 1:28 ` [PATCH v4 14/42] clk: sandbox: Create a special fixed-rate driver Simon Glass
2021-03-17 1:28 ` [PATCH v4 13/42] clk: fixed-rate: Export driver parts for OF_PLATDATA_INST Simon Glass
2021-03-17 1:28 ` [PATCH v4 12/42] clk: sandbox: Move priv/plat data to a header file Simon Glass
2021-03-17 1:28 ` [PATCH v4 11/42] dm: test: Avoid destroying uclasses with of-platdata-inst Simon Glass
2021-03-17 1:28 ` [PATCH v4 10/42] dm: core: Include dt-decl.h automatically Simon Glass
2021-03-17 1:28 ` [PATCH v4 09/42] dm: Add the new dtoc-generated files to the build Simon Glass
2021-03-17 1:28 ` [PATCH v4 08/42] dm: core: Skip adding uclasses with OF_PLATDATA_INST Simon Glass
2021-03-17 1:28 ` [PATCH v4 07/42] dm: core: Set up driver model for OF_PLATDATA_INST Simon Glass
2021-03-17 1:28 ` [PATCH v4 06/42] dm: core: Adjust uclass setup with of-platdata Simon Glass
2021-03-17 1:28 ` [PATCH v4 05/42] dm: core: Allow dropping run-time binding of devices Simon Glass
2021-03-17 1:28 ` [PATCH v4 04/42] dm: core: Add macros to access the new linker lists Simon Glass
2021-03-17 1:29 ` [PATCH v4 03/42] linker_lists: Allow use in data structures Simon Glass
2021-03-17 1:29 ` [PATCH v4 02/42] sandbox: Drop debug message in os_spl_to_uboot() Simon Glass
2021-03-17 1:29 ` [PATCH v4 01/42] dtoc: Drop use of DECL() macros Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210315042553.1932494-1-sjg@chromium.org \
--to=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.