fdt: Make OF_BOARD a boolean option
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v8 Latest32 patches 3 repliesIn review
- v731 patches 28 repliesSuperseded
- v623 of 25 patches 112 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v5 | 24 of 26 patches | 71 replies | Superseded | |
| v1 | 16 patches | 74 replies | Superseded |
Changes in v8 from the cover letter
- Add a new patch to make it easier to debug u-boot.dtsi files
- Add an fdt: tag
- Add new patch to ensure that OF_BOARD is used when needed
- Drop documentation patches
- Drop the build-time warning, since people may ignore it
- Drop the devicetree docs in the README
- Enable the flash as suggested by Linus Walleij
- Fix devicetree logic so that just u-boot.dtb is omitted
- Mention that this is empty, rather than a dummy file
- Mention the follower patch
- Move board-config changes to a separate patch
- Rebase patch
- Reword commit message to mention the dynamic devicetree
- Use an empty tree due to maintainer objections
Patches in v8 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/32 | arm: qemu: Mention -nographic in the docsdoc/ | +4 | 1 reply | |
| 2/32 | arm: riscv: qemu: Explain how to extract the generated dtdoc/ doc/ doc/ +1 more | +55 | 0 replies | |
| 3/32 | arm: qemu: Add a devicetree file for qemu_armarch/ arch/ configs/ | +14 | 0 replies | |
| 4/32 | arm: qemu: Add a devicetree file for qemu_arm64 virtarch/ arch/ configs/ | +13 | 0 replies | |
| 5/32 | riscv: qemu: Split devicetree files for qemu_riscv32/64arch/ arch/ arch/ +6 more | +21 | 0 replies | |
| 6/32 | arm: rpi: Sync rpi dts files from Linuxarch/ arch/ arch/ +28 more | +1878 | 0 replies | |
| 7/32 | arm: vexpress: Add a devicetree files for junoarch/ arch/ arch/ +5 more | +1611 | 1 reply | |
| 8/32 | arm: xenguest_arm64: Add a empty devicetree filearch/ arch/ configs/ | +18 | 0 replies | |
| 9/32 | arm: octeontx: Add an empty devicetree filearch/ arch/ configs/ +3 more | +21 | 0 replies | |
| 10/32 | arm: xilinx_versal_virt: Add a devicetree filearch/ arch/ configs/ | +14 | 0 replies | |
| 11/32 | arm: bcm7xxx: Add a devicetree filearch/ arch/ configs/ +1 more | +19 | 0 replies | |
| 12/32 | arm: qemu-ppce500: Add a devicetree filearch/ arch/ configs/ | +12 | 0 replies | |
| 13/32 | arm: highbank: Add devicetree filesarch/ arch/ configs/ | +12 | 0 replies | |
| 14/32 | fdt: Make OF_BOARD a bool optionconfigs/ configs/ configs/ +1 more | +10 | 0 replies | |
| 15/32 | fdt: Drop CONFIG_BINMAN_STANDALONE_FDTMakefile dts/ tools/ | +1 | 0 replies | |
| 16/32 | fdt: Make it easier to debug u-boot.dtsi filesscripts/ tools/ | +11 | 0 replies | |
| 17/32 | fdt: Move MULTI_DTB_FIT handling out of fdtdec_setup()lib/ | +38 | 0 replies | |
| 18/32 | fdt: Drop #ifdefs with MULTI_DTB_FITdts/ include/ lib/ | +19 | 0 replies | |
| 19/32 | fdt: Drop CONFIG_SPL_BUILD check in fdtdec_setup()include/ lib/ | +15 | 0 replies | |
| 20/32 | fdt: Drop #ifdef around board_fdt_blob_setup()lib/ | +0 | 0 replies | |
| 21/32 | fdt: Use if() for fdtcontroladdr checklib/ | +4 | 0 replies | |
| 22/32 | fdt: Drop OF_CONTROL check in fdtdec_setup()lib/ | +3 | 0 replies | |
| 23/32 | fdt: Drop remaining preprocessor macros in fdtdec_setup()lib/ | +11 | 0 replies | |
| 24/32 | fdt: Don't call board_fdt_blob_setup() without OF_BOARDinclude/ lib/ | +17 | 0 replies | |
| 25/32 | dm: core: Allow getting some basic statsdrivers/ drivers/ drivers/ +4 more | +97 | 0 replies | |
| 26/32 | fdt: Record where the devicetree came frominclude/ include/ lib/ | +51 | 0 replies | |
| 27/32 | fdt: Report the devicetree sourcecmd/ common/ lib/ | +33 | 0 replies | |
| 28/32 | fdt: Add a Kconfig for boards with a prior stageREADME dts/ lib/ | +29 | 0 replies | |
| 29/32 | fdt: Enable OF_HAS_PRIOR_STAGE for most boards with OF_BOARDarch/ arch/ arch/ +28 more | +12 | 0 replies | |
| 30/32 | fdt: Makefile: Ensure that OF_BOARD is used when neededMakefile scripts/ scripts/ | +50 | 1 reply | |
| 31/32 | fdt: Avoid emitting an device tree when not neededMakefile dts/ | +14 | 0 replies | |
| 32/32 | fdt: Show a runtime warning based on devicetree sourcecommon/ | +6 | 0 replies |
Reviews trailers per patch
3 of 32 patches have a Reviewed-by or Acked-by.
| Patch | Heinrich Schuchardt | Ilias Apalodimas | Linus Walleij |
|---|---|---|---|
| 1/32 | R-b | ||
| 2/32 | |||
| 3/32 | T-b | ||
| 4/32 | T-b | ||
| 5/32 | T-b | ||
| 6/32 | |||
| 7/32 | A-b | ||
| 8/32 | |||
| 9/32 | |||
| 10/32 | |||
| 11/32 | |||
| 12/32 | |||
| 13/32 | |||
| 14/32 | |||
| 15/32 | |||
| 16/32 | |||
| 17/32 | R-b | ||
| 18/32 | |||
| 19/32 | |||
| 20/32 | |||
| 21/32 | |||
| 22/32 | |||
| 23/32 | |||
| 24/32 | |||
| 25/32 | |||
| 26/32 | |||
| 27/32 | |||
| 28/32 | |||
| 29/32 | |||
| 30/32 | |||
| 31/32 | |||
| 32/32 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v8 00/32] fdt: Make OF_BOARD a boolean option
With Ilias' efforts we have dropped OF_PRIOR_STAGE and OF_HOSTFILE so there are only three ways to obtain a devicetree:
- OF_SEPARATE - the normal way, where the devicetree is built and appended to U-Boot
- OF_EMBED - for development purposes, the devicetree is embedded in the ELF file (also used for EFI)
- OF_BOARD - the board figures it out on its own
The last one is currently set up so that no devicetree is needed at all in the U-Boot tree. Most boards do provide one, but some don't. Some don't even provide instructions on how to boot on the board.
The problems with this approach were covered in another patch[1], since removed from this series.
In practice, OF_BOARD is not really distinct from OF_SEPARATE. Any board can obtain its devicetree at runtime, even it is has a devicetree built in U-Boot. This is because U-Boot may be a second-stage bootloader and its caller may have a better idea about the hardware available in the machine. This is the case with a few QEMU boards, for example.
So it makes no sense to have OF_BOARD as a 'choice'. It should be an option, available with either OF_SEPARATE or OF_EMBED. This would allow rpi3, for example, to run with the devicetree provided by the prior bootloader.
This series makes this change, adding various missing devicetree files (and placeholders) to make the build work.
To make the 'prior stage' side of things more deterministic, a new OF_HAS_PRIOR_STAGE is added, which cannot be disabled by updated a board's defconfig. This should help to prevent mistakes.
It also adds a run-time message showing where the devicetree came from, as well as warnings if the board's expected flow is not being used. This comes originally from the 'standard passage' series, which depends on this series.
It also provides a few qemu clean-ups discovered along the way. The qemu-riscv64_spl problem is fixed.
Please see [2] for discussion on the v6 series.
I put Heinrich's Tested-by tag[3] for the series onto the three devicetree patches (ARM and RISC-V) that I think it most affects. It isn't possible to apply a tag to a whole series at present and in any case there are changes in v7.
This series is available at u-boot-dm/ofb-working
[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
[2] https://lore.kernel.org/u-boot/20211205133207.GW1220664@bill-the-cat/T/#mcd8c0258827fbc1bb3000b7ff9ba0929df1ddcb2
[3] https://lore.kernel.org/u-boot/[email protected]/raw
Changes in v8:
- Add a new patch to make it easier to debug u-boot.dtsi files
- Add an fdt: tag
- Add new patch to ensure that OF_BOARD is used when needed
- Drop documentation patches
- Drop the build-time warning, since people may ignore it
- Drop the devicetree docs in the README
- Enable the flash as suggested by Linus Walleij
- Fix devicetree logic so that just u-boot.dtb is omitted
- Mention that this is empty, rather than a dummy file
- Mention the follower patch
- Move board-config changes to a separate patch
- Rebase patch
- Reword commit message to mention the dynamic devicetree
- Use an empty tree due to maintainer objections
Changes in v7:
- Add new patch to add a Kconfig for boards with a prior stage
- Bring in files from Linux instead
- Drop FDTSRC_PASSAGE for now
- Fix 'Is' typo in commit message
- Reword commit message
- Rewrite the commit message
- Switch to using an empty file for qemu virt
- Use 'empty' instead of 'fake'
Changes in v6:
- Expand the commit message based on comments
Changes in v5:
- Add new patches to clean up fdtdec_setup() and surrounds
- Merge RISC-V and ARM patches since they are similar
Simon Glass (32):
arm: qemu: Mention -nographic in the docs
arm: riscv: qemu: Explain how to extract the generated dt
arm: qemu: Add a devicetree file for qemu_arm
arm: qemu: Add a devicetree file for qemu_arm64 virt
riscv: qemu: Split devicetree files for qemu_riscv32/64
arm: rpi: Sync rpi dts files from Linux
arm: vexpress: Add a devicetree files for juno
arm: xenguest_arm64: Add a empty devicetree file
arm: octeontx: Add an empty devicetree file
arm: xilinx_versal_virt: Add a devicetree file
arm: bcm7xxx: Add a devicetree file
arm: qemu-ppce500: Add a devicetree file
arm: highbank: Add devicetree files
fdt: Make OF_BOARD a bool option
fdt: Drop CONFIG_BINMAN_STANDALONE_FDT
fdt: Make it easier to debug u-boot.dtsi files
fdt: Move MULTI_DTB_FIT handling out of fdtdec_setup()
fdt: Drop #ifdefs with MULTI_DTB_FIT
fdt: Drop CONFIG_SPL_BUILD check in fdtdec_setup()
fdt: Drop #ifdef around board_fdt_blob_setup()
fdt: Use if() for fdtcontroladdr check
fdt: Drop OF_CONTROL check in fdtdec_setup()
fdt: Drop remaining preprocessor macros in fdtdec_setup()
fdt: Don't call board_fdt_blob_setup() without OF_BOARD
dm: core: Allow getting some basic stats
fdt: Record where the devicetree came from
fdt: Report the devicetree source
fdt: Add a Kconfig for boards with a prior stage
fdt: Enable OF_HAS_PRIOR_STAGE for most boards with OF_BOARD
fdt: Makefile: Ensure that OF_BOARD is used when needed
fdt: Avoid emitting an device tree when not needed
fdt: Show a runtime warning based on devicetree source
Makefile | 16 +-
README | 29 -
arch/arm/Kconfig | 12 +-
arch/arm/dts/Makefile | 20 +-
arch/arm/dts/bcm2711-rpi-4-b.dts | 262 ++++
arch/arm/dts/bcm2711-rpi.dtsi | 74 ++
arch/arm/dts/bcm2711.dtsi | 1100 +++++++++++++++++
arch/arm/dts/bcm2835-common.dtsi | 207 ++++
arch/arm/dts/bcm2835-rpi-a-plus.dts | 18 +-
arch/arm/dts/bcm2835-rpi-a.dts | 16 +-
arch/arm/dts/bcm2835-rpi-b-plus.dts | 18 +-
arch/arm/dts/bcm2835-rpi-b-rev2.dts | 16 +-
arch/arm/dts/bcm2835-rpi-b.dts | 16 +-
arch/arm/dts/bcm2835-rpi-cm1-io1.dts | 9 +
arch/arm/dts/bcm2835-rpi-cm1.dtsi | 7 +-
arch/arm/dts/bcm2835-rpi-common.dtsi | 12 +
arch/arm/dts/bcm2835-rpi-zero-w.dts | 20 +-
arch/arm/dts/bcm2835-rpi-zero.dts | 16 +-
arch/arm/dts/bcm2835-rpi.dtsi | 35 +-
arch/arm/dts/bcm2835.dtsi | 2 +
arch/arm/dts/bcm2836-rpi-2-b.dts | 14 +-
arch/arm/dts/bcm2836.dtsi | 2 +
arch/arm/dts/bcm2837-rpi-3-a-plus.dts | 9 +-
arch/arm/dts/bcm2837-rpi-3-b-plus.dts | 9 +-
arch/arm/dts/bcm2837-rpi-3-b.dts | 5 +-
arch/arm/dts/bcm2837-rpi-cm3-io3.dts | 9 +
arch/arm/dts/bcm2837-rpi-cm3.dtsi | 9 +
arch/arm/dts/bcm2837.dtsi | 2 +
arch/arm/dts/bcm283x-rpi-usb-peripheral.dtsi | 7 +
arch/arm/dts/bcm283x.dtsi | 224 +---
arch/arm/dts/bcm7xxx.dts | 15 +
arch/arm/dts/highbank.dts | 9 +
arch/arm/dts/juno-base.dtsi | 831 +++++++++++++
arch/arm/dts/juno-clocks.dtsi | 46 +
arch/arm/dts/juno-cs-r1r2.dtsi | 85 ++
arch/arm/dts/juno-motherboard.dtsi | 303 +++++
arch/arm/dts/juno-r2-u-boot.dtsi | 20 +
arch/arm/dts/juno-r2.dts | 322 +++++
arch/arm/dts/octeontx.dts | 14 +
arch/arm/dts/qemu-arm.dts | 11 +
arch/arm/dts/qemu-arm64.dts | 11 +
arch/arm/dts/xenguest-arm64.dts | 15 +
arch/arm/dts/xilinx-versal-virt.dts | 11 +
arch/arm/mach-bcm283x/Kconfig | 1 +
arch/powerpc/cpu/mpc85xx/Kconfig | 1 +
arch/powerpc/dts/Makefile | 1 +
arch/powerpc/dts/qemu-ppce500.dts | 10 +
arch/riscv/dts/Makefile | 2 +-
.../dts/{qemu-virt.dts => qemu-virt32.dts} | 3 +
arch/riscv/dts/qemu-virt64.dts | 11 +
board/emulation/qemu-riscv/Kconfig | 1 +
cmd/bdinfo.c | 2 +
common/board_r.c | 24 +
configs/ae350_rv32_defconfig | 1 -
configs/ae350_rv32_spl_defconfig | 1 -
configs/ae350_rv32_spl_xip_defconfig | 1 -
configs/ae350_rv64_defconfig | 1 -
configs/ae350_rv64_spl_defconfig | 1 -
configs/ae350_rv64_spl_xip_defconfig | 1 -
configs/bcm7260_defconfig | 2 +-
configs/bcm7445_defconfig | 2 +-
configs/highbank_defconfig | 2 +-
configs/octeontx2_95xx_defconfig | 2 +-
configs/octeontx2_96xx_defconfig | 2 +-
configs/octeontx_81xx_defconfig | 2 +-
configs/octeontx_83xx_defconfig | 2 +-
configs/qemu-ppce500_defconfig | 3 +-
configs/qemu-riscv32_defconfig | 2 +-
configs/qemu-riscv32_smode_defconfig | 2 +-
configs/qemu-riscv32_spl_defconfig | 5 +-
configs/qemu-riscv64_defconfig | 2 +-
configs/qemu-riscv64_smode_defconfig | 2 +-
configs/qemu-riscv64_spl_defconfig | 4 +-
configs/qemu_arm64_defconfig | 2 +-
configs/qemu_arm_defconfig | 2 +-
configs/rpi_4_32b_defconfig | 2 +-
configs/rpi_4_defconfig | 2 +-
configs/rpi_arm64_defconfig | 2 +-
configs/vexpress_aemv8a_juno_defconfig | 2 +-
configs/xenguest_arm64_defconfig | 3 +-
configs/xilinx_versal_virt_defconfig | 1 +
doc/board/emulation/qemu-arm.rst | 10 +-
doc/board/emulation/qemu-riscv.rst | 3 +
doc/develop/devicetree/dt_qemu.rst | 48 +
doc/develop/devicetree/index.rst | 1 +
drivers/core/device.c | 11 +
drivers/core/root.c | 7 +
drivers/core/uclass.c | 13 +
dts/Kconfig | 65 +-
include/asm-generic/global_data.h | 12 +
include/dm/device.h | 11 +-
include/dm/root.h | 8 +
include/dm/uclass-internal.h | 7 +
include/dt-bindings/clock/bcm2835.h | 2 +
include/fdtdec.h | 53 +-
lib/fdtdec.c | 141 ++-
scripts/Makefile.lib | 4 +-
scripts/check-of.sh | 42 +
scripts/of_whitelist.txt | 1 +
test/dm/core.c | 41 +
tools/binman/binman.rst | 34 +-
101 files changed, 4082 insertions(+), 432 deletions(-)
create mode 100644 arch/arm/dts/bcm2711-rpi-4-b.dts
create mode 100644 arch/arm/dts/bcm2711-rpi.dtsi
create mode 100644 arch/arm/dts/bcm2711.dtsi
create mode 100644 arch/arm/dts/bcm2835-common.dtsi
create mode 100644 arch/arm/dts/bcm2835-rpi-common.dtsi
create mode 100644 arch/arm/dts/bcm283x-rpi-usb-peripheral.dtsi
create mode 100644 arch/arm/dts/bcm7xxx.dts
create mode 100644 arch/arm/dts/highbank.dts
create mode 100644 arch/arm/dts/juno-base.dtsi
create mode 100644 arch/arm/dts/juno-clocks.dtsi
create mode 100644 arch/arm/dts/juno-cs-r1r2.dtsi
create mode 100644 arch/arm/dts/juno-motherboard.dtsi
create mode 100644 arch/arm/dts/juno-r2-u-boot.dtsi
create mode 100644 arch/arm/dts/juno-r2.dts
create mode 100644 arch/arm/dts/octeontx.dts
create mode 100644 arch/arm/dts/qemu-arm.dts
create mode 100644 arch/arm/dts/qemu-arm64.dts
create mode 100644 arch/arm/dts/xenguest-arm64.dts
create mode 100644 arch/arm/dts/xilinx-versal-virt.dts
create mode 100644 arch/powerpc/dts/qemu-ppce500.dts
rename arch/riscv/dts/{qemu-virt.dts => qemu-virt32.dts} (94%)
create mode 100644 arch/riscv/dts/qemu-virt64.dts
create mode 100644 doc/develop/devicetree/dt_qemu.rst
create mode 100755 scripts/check-of.sh
create mode 100644 scripts/of_whitelist.txtSignature · 1 line
2.34.1.173.g76aa8bc2d0-goog