All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 00/26] fdt: Make OF_BOARD a boolean option
@ 2021-10-26  0:23 ` Simon Glass
  0 siblings, 0 replies; 144+ messages in thread
From: Simon Glass @ 2021-10-26  0:23 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Mark Kettenis, Heinrich Schuchardt, Ilias Apalodimas, Tom Rini,
	Sean Anderson, Simon Glass, Aaron Williams, Albert Aribaud,
	Alexander Graf, Anastasiia Lukianenko, Andre Przywara, Bin Meng,
	Jerry Van Baren, Linus Walleij, Matthias Brugger, Michal Simek,
	Oleksandr Andrushchenko, Stephen Warren, Stephen Warren,
	Thomas Fitzsimmons, Tuomas Tynkkynen, qemu-devel

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 are documented in another patch in this
series: "doc: Add documentation about devicetree usage"

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 series makes this change, adding various missing devicetree files
(and placeholders) to make the build work.

Note: If board maintainers are able to add their own patch to add the
files, some patches in this series can be dropped.

It also provides a few qemu clean-ups discovered along the way.

Note: This breaks the qemu-riscv64_spl test, which still needs
investigation.

[1] https://patchwork.ozlabs.org/project/uboot/patch/20210919215111.3830278-3-sjg@chromium.org/

Changes in v5:
- Bring into the OF_BOARD series
- Rebase to master and drop mention of OF_PRIOR_STAGE, since removed
- Refer to the 'control' DTB in the first paragraph
- Use QEMU instead of qemu
- Merge RISC-V and ARM patches since they are similar
- Add new patches to clean up fdtdec_setup() and surrounds

Changes in v3:
- Clarify the 'bug' refered to at the top
- Reword 'This means that there' paragraph to explain U-Boot-specific things
- Move to doc/develop/devicetree now that OF_CONTROL is in the docs

Changes in v2:
- Fix typos per Sean (thank you!) and a few others
- Add a 'Use of U-Boot /config node' section
- Drop mention of dm-verity since that actually uses the kernel cmdline
- Explain that OF_BOARD will still work after these changes (in
  'Once this bug is fixed...' paragraph)
- Expand a bit on the reason why the 'Current situation' is bad
- Clarify in a second place that Linux and U-Boot use the same devicetree
  in 'To be clear, while U-Boot...'
- Expand on why we should have rules for other projects in
  'Devicetree in another project'
- Add a comment as to why devicetree in U-Boot is not 'bad design'
- Reword 'in-tree U-Boot devicetree' to 'devicetree source in U-Boot'
- Rewrite 'Devicetree generated on-the-fly in another project' to cover
  points raised on v1
- Add 'Why does U-Boot have its nodes and properties?'
- Add 'Why not have two devicetrees?'

Ilias Apalodimas (1):
  sandbox: Remove OF_HOSTFILE

Simon Glass (25):
  doc: Add documentation about devicetree usage
  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
  riscv: qemu: Add devicetree files for qemu_riscv32/64
  arm: rpi: Add a devicetree file for rpi_4
  arm: vexpress: Add a devicetree file for juno
  arm: xenguest_arm64: Add a fake devicetree file
  arm: octeontx: Add a fake 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 a fake devicetree file
  fdt: Make OF_BOARD a bool option
  Drop CONFIG_BINMAN_STANDALONE_FDT
  doc: Update info on devicetree update
  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

 Makefile                                  |    7 +-
 arch/arm/dts/Makefile                     |   20 +-
 arch/arm/dts/bcm2711-rpi-4-b.dts          | 1958 +++++++++++++++++++++
 arch/arm/dts/bcm7xxx.dts                  |   15 +
 arch/arm/dts/highbank.dts                 |   14 +
 arch/arm/dts/juno-r2.dts                  | 1038 +++++++++++
 arch/arm/dts/octeontx.dts                 |   14 +
 arch/arm/dts/qemu-arm.dts                 |  402 +++++
 arch/arm/dts/qemu-arm64.dts               |  381 ++++
 arch/arm/dts/xenguest-arm64.dts           |   15 +
 arch/arm/dts/xilinx-versal-virt.dts       |  307 ++++
 arch/powerpc/dts/Makefile                 |    1 +
 arch/powerpc/dts/qemu-ppce500.dts         |  264 +++
 arch/riscv/dts/Makefile                   |    2 +-
 arch/riscv/dts/qemu-virt.dts              |    8 -
 arch/riscv/dts/qemu-virt32.dts            |  217 +++
 arch/riscv/dts/qemu-virt64.dts            |  217 +++
 arch/sandbox/cpu/cpu.c                    |   21 +-
 arch/sandbox/include/asm/u-boot-sandbox.h |    8 -
 configs/bcm7260_defconfig                 |    1 +
 configs/bcm7445_defconfig                 |    1 +
 configs/highbank_defconfig                |    2 +-
 configs/octeontx2_95xx_defconfig          |    1 +
 configs/octeontx2_96xx_defconfig          |    1 +
 configs/octeontx_81xx_defconfig           |    1 +
 configs/octeontx_83xx_defconfig           |    1 +
 configs/qemu-ppce500_defconfig            |    2 +
 configs/qemu-riscv32_defconfig            |    1 +
 configs/qemu-riscv32_smode_defconfig      |    1 +
 configs/qemu-riscv32_spl_defconfig        |    4 +-
 configs/qemu-riscv64_defconfig            |    1 +
 configs/qemu-riscv64_smode_defconfig      |    1 +
 configs/qemu-riscv64_spl_defconfig        |    3 +-
 configs/qemu_arm64_defconfig              |    1 +
 configs/qemu_arm_defconfig                |    1 +
 configs/rpi_4_32b_defconfig               |    1 +
 configs/rpi_4_defconfig                   |    1 +
 configs/rpi_arm64_defconfig               |    1 +
 configs/sandbox64_defconfig               |    2 +-
 configs/sandbox_defconfig                 |    2 +-
 configs/sandbox_flattree_defconfig        |    2 +-
 configs/sandbox_noinst_defconfig          |    2 +-
 configs/sandbox_spl_defconfig             |    2 +-
 configs/tools-only_defconfig              |    2 +-
 configs/vexpress_aemv8a_juno_defconfig    |    1 +
 configs/xenguest_arm64_defconfig          |    1 +
 configs/xilinx_versal_virt_defconfig      |    1 +
 doc/board/emulation/qemu-arm.rst          |   10 +-
 doc/board/emulation/qemu-riscv.rst        |    3 +
 doc/develop/devicetree/control.rst        |    7 +-
 doc/develop/devicetree/dt_qemu.rst        |   48 +
 doc/develop/devicetree/dt_update.rst      |  498 ++++++
 doc/develop/devicetree/index.rst          |    2 +
 dts/Kconfig                               |   37 +-
 include/asm-generic/global_data.h         |    8 +
 include/fdtdec.h                          |   21 +-
 lib/fdtdec.c                              |  116 +-
 scripts/Makefile.spl                      |    4 +-
 tools/binman/binman.rst                   |   20 -
 59 files changed, 5560 insertions(+), 164 deletions(-)
 create mode 100644 arch/arm/dts/bcm2711-rpi-4-b.dts
 create mode 100644 arch/arm/dts/bcm7xxx.dts
 create mode 100644 arch/arm/dts/highbank.dts
 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
 delete mode 100644 arch/riscv/dts/qemu-virt.dts
 create mode 100644 arch/riscv/dts/qemu-virt32.dts
 create mode 100644 arch/riscv/dts/qemu-virt64.dts
 create mode 100644 doc/develop/devicetree/dt_qemu.rst
 create mode 100644 doc/develop/devicetree/dt_update.rst

-- 
2.33.0.1079.g6e70778dc9-goog


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

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

Thread overview: 144+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-26  0:23 [PATCH v5 00/26] fdt: Make OF_BOARD a boolean option Simon Glass
2021-10-26  0:23 ` Simon Glass
2021-10-26  0:23 ` [PATCH v5 01/26] sandbox: Remove OF_HOSTFILE Simon Glass
2021-10-26  0:23 ` [PATCH v5 02/26] doc: Add documentation about devicetree usage Simon Glass
2021-10-26 14:06   ` Ilias Apalodimas
2021-10-26 15:27     ` Simon Glass
2021-10-27  9:29       ` Ilias Apalodimas
2021-10-26 14:31   ` François Ozog
2021-10-26 15:27     ` Simon Glass
2021-10-26 15:57       ` François Ozog
2021-10-27 14:13         ` Simon Glass
2021-10-27 15:38           ` François Ozog
2021-10-27 18:32             ` Simon Glass
2021-10-27 19:12               ` Ilias Apalodimas
2021-10-27 19:52                 ` Simon Glass
2021-10-29 10:20                   ` Ilias Apalodimas
2021-11-01 15:19                     ` Tom Rini
2021-11-02 14:53                     ` Simon Glass
2021-11-02 15:38                       ` Ilias Apalodimas
2021-11-03  3:29                         ` Simon Glass
2021-10-29 17:07                   ` François Ozog
2021-11-02 14:53                     ` Simon Glass
2021-10-27 19:46               ` François Ozog
2021-10-27 19:48             ` Tom Rini
2021-10-27 20:13               ` François Ozog
2021-10-26  0:23 ` [PATCH v5 03/26] arm: qemu: Mention -nographic in the docs Simon Glass
2021-10-26  0:23   ` Simon Glass
2021-10-26  0:23 ` [PATCH v5 04/26] arm: riscv: qemu: Explain how to extract the generated dt Simon Glass
2021-10-26  0:23   ` Simon Glass
2021-10-26  0:23 ` [PATCH v5 05/26] arm: qemu: Add a devicetree file for qemu_arm Simon Glass
2021-10-26  0:23   ` Simon Glass
2021-10-26  0:23 ` [PATCH v5 06/26] arm: qemu: Add a devicetree file for qemu_arm64 Simon Glass
2021-10-26  0:23   ` Simon Glass
2021-11-01 10:48   ` Peter Maydell
2021-11-01 10:48     ` Peter Maydell
2021-11-01 16:58     ` Simon Glass
2021-11-01 16:58       ` Simon Glass
2021-11-01 17:33       ` François Ozog
2021-11-01 17:33         ` François Ozog
2021-11-01 18:07         ` Tom Rini
2021-11-01 18:07           ` Tom Rini
2021-11-02 15:00           ` Simon Glass
2021-11-02 15:00             ` Simon Glass
2021-11-02 17:28             ` Tom Rini
2021-11-02 17:28               ` Tom Rini
2021-11-03  1:29               ` Simon Glass
2021-11-03  1:29                 ` Simon Glass
2021-11-03  5:29                 ` François Ozog
2021-11-03  5:29                   ` François Ozog
2021-11-03 14:41                   ` Tom Rini
2021-11-03 14:41                     ` Tom Rini
2021-11-04 11:09                     ` Peter Maydell
2021-11-04 11:09                       ` Peter Maydell
2021-11-04 11:22                       ` François Ozog
2021-11-04 11:22                         ` François Ozog
2021-11-04 11:41                         ` Peter Maydell
2021-11-04 11:41                           ` Peter Maydell
2021-11-04 11:48                           ` François Ozog
2021-11-04 11:48                             ` François Ozog
2021-11-03 14:44                   ` François Ozog
2021-11-03 14:44                     ` François Ozog
2021-11-03 14:39                 ` Tom Rini
2021-11-03 14:39                   ` Tom Rini
2021-11-02 14:59         ` Simon Glass
2021-11-02 14:59           ` Simon Glass
2021-11-02 16:57           ` Tom Rini
2021-11-02 16:57             ` Tom Rini
2021-11-03  1:32             ` Simon Glass
2021-11-03  1:32               ` Simon Glass
2021-11-03 14:39               ` Tom Rini
2021-11-03 14:39                 ` Tom Rini
2021-10-26  0:23 ` [PATCH v5 07/26] riscv: qemu: Add devicetree files for qemu_riscv32/64 Simon Glass
2021-10-26  0:23   ` Simon Glass
2021-10-26  0:23 ` [PATCH v5 08/26] arm: rpi: Add a devicetree file for rpi_4 Simon Glass
2021-10-26  0:23 ` [PATCH v5 09/26] arm: vexpress: Add a devicetree file for juno Simon Glass
2021-10-26  0:23 ` [PATCH v5 10/26] arm: xenguest_arm64: Add a fake devicetree file Simon Glass
2021-10-26  0:23 ` [PATCH v5 11/26] arm: octeontx: " Simon Glass
2021-10-26  0:23 ` [PATCH v5 12/26] arm: xilinx_versal_virt: Add a " Simon Glass
2021-10-26  0:23 ` [PATCH v5 13/26] arm: bcm7xxx: " Simon Glass
2021-10-26  0:23 ` [PATCH v5 14/26] arm: qemu-ppce500: " Simon Glass
2021-10-26  0:23 ` [PATCH v5 15/26] arm: highbank: Add a fake " Simon Glass
2021-10-26  0:23 ` [PATCH v5 16/26] fdt: Make OF_BOARD a bool option Simon Glass
2021-10-26  0:23 ` [PATCH v5 17/26] Drop CONFIG_BINMAN_STANDALONE_FDT Simon Glass
2021-10-26  0:23 ` [PATCH v5 18/26] doc: Update info on devicetree update Simon Glass
2021-10-26  0:23 ` [PATCH v5 19/26] fdt: Move MULTI_DTB_FIT handling out of fdtdec_setup() Simon Glass
2021-10-29  5:49   ` Ilias Apalodimas
2021-10-26  0:23 ` [PATCH v5 20/26] fdt: Drop #ifdefs with MULTI_DTB_FIT Simon Glass
2021-10-29  5:55   ` Ilias Apalodimas
2021-10-26  0:23 ` [PATCH v5 21/26] fdt: Drop CONFIG_SPL_BUILD check in fdtdec_setup() Simon Glass
2021-10-26  0:23 ` [PATCH v5 22/26] fdt: Drop #ifdef around board_fdt_blob_setup() Simon Glass
2021-10-26  0:23 ` [PATCH v5 25/26] fdt: Drop remaining preprocessor macros in fdtdec_setup() Simon Glass
2021-10-26  0:23 ` [PATCH v5 26/26] fdt: Don't call board_fdt_blob_setup() without OF_BOARD Simon Glass
2021-10-26 13:55   ` Ilias Apalodimas
2021-10-26 15:27     ` Simon Glass
2021-10-27  7:17       ` Ilias Apalodimas
2021-10-27 19:12         ` Tom Rini
2021-10-27 21:33           ` François Ozog
2021-10-27 21:44             ` Tom Rini
2021-10-26  6:07 ` [PATCH v5 00/26] fdt: Make OF_BOARD a boolean option François Ozog
2021-10-26  6:07   ` François Ozog
2021-10-27 14:08   ` Simon Glass
2021-10-27 14:08     ` Simon Glass
2021-10-27 15:14     ` François Ozog
2021-10-27 15:14       ` François Ozog
2021-10-27 18:23       ` Simon Glass
2021-10-27 18:23         ` Simon Glass
2021-10-27 19:25         ` Tom Rini
2021-10-27 19:25           ` Tom Rini
2021-11-03 16:45           ` Simon Glass
2021-11-03 16:45             ` Simon Glass
2021-11-03 17:21             ` Tom Rini
2021-11-03 17:21               ` Tom Rini
2021-10-27 20:07         ` François Ozog
2021-10-27 20:07           ` François Ozog
2021-11-03  1:20           ` Simon Glass
2021-11-03  1:20             ` Simon Glass
2021-11-03  4:45             ` François Ozog
2021-11-03  4:45               ` François Ozog
2021-10-27 22:30         ` Mark Kettenis
2021-10-27 22:30           ` Mark Kettenis
2021-11-03  1:20           ` Simon Glass
2021-11-03  1:20             ` Simon Glass
2021-11-03  8:22             ` Mark Kettenis
2021-11-03  8:22               ` Mark Kettenis
2021-11-03 16:02               ` Tom Rini
2021-11-03 16:02                 ` Tom Rini
2021-11-03 16:45                 ` Simon Glass
2021-11-03 16:45                   ` Simon Glass
2021-11-03 17:36                   ` Mark Kettenis
2021-11-03 17:36                     ` Mark Kettenis
2021-11-03 15:56             ` Tom Rini
2021-11-03 15:56               ` Tom Rini
2021-11-03 16:45               ` Simon Glass
2021-11-03 16:45                 ` Simon Glass
2021-10-27 15:36     ` Tuomas Tynkkynen
2021-10-27 15:36       ` Tuomas Tynkkynen
2021-10-27 19:13       ` Tom Rini
2021-10-27 19:13         ` Tom Rini
2021-10-27 18:16     ` Tom Rini
2021-10-27 18:16       ` Tom Rini
2021-10-27 18:24     ` Tom Rini
2021-10-27 18:24       ` Tom Rini
2021-11-03 17:13 ` François Ozog
2021-11-03 17:13   ` François Ozog

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.