global: Clean up arch/*/dts/Makefile
Subsystems (11)
PATCH 1/2 global: Clean up arch/*/dts/Makefile
With commit 3609e1dc ("dts: automatically build necessary .dtb files") we now have logic that will ensure that all device trees needed in the binary are built automatically. Any device tree that the developer needs while working can still be built normally via make arch/.../foo.dtb so we can simply drop the rest of this logic.
--- arch/arc/dts/Makefile | 8 - arch/arm/dts/Makefile | 1436 +--------------------------------- arch/m68k/dts/Makefile | 18 - arch/microblaze/dts/Makefile | 2 - arch/mips/dts/Makefile | 37 - arch/nios2/dts/Makefile | 2 - arch/powerpc/dts/Makefile | 32 - arch/riscv/dts/Makefile | 9 - arch/sandbox/dts/Makefile | 5 - arch/sh/dts/Makefile | 2 +- arch/x86/dts/Makefile | 22 - arch/xtensa/dts/Makefile | 2 - configs/iot2050_defconfig | 1 + 13 files changed, 6 insertions(+), 1570 deletions(-)
arch/arc/dts/Makefile +0 -8
@@ -1,13 +1,5 @@ # SPDX-License-Identifier: GPL-2.0+ -dtb-$(CONFIG_TARGET_AXS101) += axs101.dtb -dtb-$(CONFIG_TARGET_AXS103) += axs103.dtb -dtb-$(CONFIG_TARGET_NSIM) += nsim.dtb -dtb-$(CONFIG_TARGET_TB100) += abilis_tb100.dtb -dtb-$(CONFIG_TARGET_EMSDP) += emsdp.dtb -dtb-$(CONFIG_TARGET_HSDK) += hsdk.dtb hsdk-4xd.dtb -dtb-$(CONFIG_TARGET_IOT_DEVKIT) += iot_devkit.dtb - include $(srctree)/scripts/Makefile.dts targets += $(dtb-y)
arch/arm/dts/Makefile +4 -1432
1,480 lines not on this page · raw message
arch/m68k/dts/Makefile +0 -18
@@ -1,23 +1,5 @@ # SPDX-License-Identifier: GPL-2.0+ -dtb-$(CONFIG_TARGET_M5235EVB) += M5235EVB.dtb \ - M5235EVB_Flash32.dtb -dtb-$(CONFIG_TARGET_COBRA5272) += cobra5272.dtb -dtb-$(CONFIG_TARGET_EB_CPU5282) += eb_cpu5282.dtb \ - eb_cpu5282_internal.dtb -dtb-$(CONFIG_TARGET_M5208EVBE) += M5208EVBE.dtb -dtb-$(CONFIG_TARGET_M5249EVB) += M5249EVB.dtb -dtb-$(CONFIG_TARGET_M5253DEMO) += M5253DEMO.dtb -dtb-$(CONFIG_TARGET_M5272C3) += M5272C3.dtb -dtb-$(CONFIG_TARGET_M5275EVB) += M5275EVB.dtb -dtb-$(CONFIG_TARGET_M5282EVB) += M5282EVB.dtb -dtb-$(CONFIG_TARGET_ASTRO_MCF5373L) += astro_mcf5373l.dtb -dtb-$(CONFIG_TARGET_M53017EVB) += M53017EVB.dtb -dtb-$(CONFIG_TARGET_M5329EVB) += M5329AFEE.dtb M5329BFEE.dtb -dtb-$(CONFIG_TARGET_M5373EVB) += M5373EVB.dtb -dtb-$(CONFIG_TARGET_AMCORE) += amcore.dtb -dtb-$(CONFIG_TARGET_STMARK2) += stmark2.dtb - include $(srctree)/scripts/Makefile.dts targets += $(dtb-y)
arch/microblaze/dts/Makefile +0 -2
@@ -1,7 +1,5 @@ # SPDX-License-Identifier: GPL-2.0+ -dtb-y += $(shell echo $(CONFIG_DEFAULT_DEVICE_TREE)).dtb - include $(srctree)/scripts/Makefile.dts targets += $(dtb-y)
arch/mips/dts/Makefile +0 -37
@@ -1,42 +1,5 @@ # SPDX-License-Identifier: GPL-2.0+ -dtb-$(CONFIG_TARGET_AP121) += ap121.dtb -dtb-$(CONFIG_TARGET_AP143) += ap143.dtb -dtb-$(CONFIG_TARGET_AP152) += ap152.dtb -dtb-$(CONFIG_TARGET_BOSTON) += img,boston.dtb -dtb-$(CONFIG_TARGET_MALTA) += mti,malta.dtb -dtb-$(CONFIG_TARGET_PIC32MZDASK) += pic32mzda_sk.dtb -dtb-$(CONFIG_TARGET_XILFPGA) += nexys4ddr.dtb -dtb-$(CONFIG_BOARD_BROADCOM_BCM968380GERG) += brcm,bcm968380gerg.dtb -dtb-$(CONFIG_BOARD_COMTREND_AR5315U) += comtrend,ar-5315u.dtb -dtb-$(CONFIG_BOARD_COMTREND_AR5387UN) += comtrend,ar-5387un.dtb -dtb-$(CONFIG_BOARD_COMTREND_CT5361) += comtrend,ct-5361.dtb -dtb-$(CONFIG_BOARD_COMTREND_VR3032U) += comtrend,vr-3032u.dtb -dtb-$(CONFIG_BOARD_COMTREND_WAP5813N) += comtrend,wap-5813n.dtb -dtb-$(CONFIG_BOARD_HUAWEI_HG556A) += huawei,hg556a.dtb -dtb-$(CONFIG_BOARD_INTENO_XG6846) += inteno,xg6846.dtb -dtb-$(CONFIG_BOARD_MT7620_RFB) += mediatek,mt7620-rfb.dtb -dtb-$(CONFIG_BOARD_MT7620_MT7530_RFB) += mediatek,mt7620-mt7530-rfb.dtb -dtb-$(CONFIG_BOARD_MT7621_RFB) += mediatek,mt7621-rfb.dtb -dtb-$(CONFIG_BOARD_MT7621_NAND_RFB) += mediatek,mt7621-nand-rfb.dtb -dtb-$(CONFIG_BOARD_MT7628_RFB) += mediatek,mt7628-rfb.dtb -dtb-$(CONFIG_BOARD_GARDENA_SMART_GATEWAY_MT7688) += gardena-smart-gateway-mt7688.dtb -dtb-$(CONFIG_BOARD_LINKIT_SMART_7688) += linkit-smart-7688.dtb -dtb-$(CONFIG_TARGET_OCTEON_EBB7304) += mrvl,octeon-ebb7304.dtb -dtb-$(CONFIG_TARGET_OCTEON_NIC23) += mrvl,octeon-nic23.dtb -dtb-$(CONFIG_BOARD_NETGEAR_CG3100D) += netgear,cg3100d.dtb -dtb-$(CONFIG_BOARD_NETGEAR_DGND3700V2) += netgear,dgnd3700v2.dtb -dtb-$(CONFIG_BOARD_SAGEM_FAST1704) += sagem,[email protected] -dtb-$(CONFIG_BOARD_SFR_NB4_SER) += sfr,nb4-ser.dtb -dtb-$(CONFIG_BOARD_TPLINK_WDR4300) += tplink_wdr4300.dtb -dtb-$(CONFIG_BOARD_VOCORE2) += vocore_vocore2.dtb -dtb-$(CONFIG_TARGET_JZ4780_CI20) += ci20.dtb -dtb-$(CONFIG_SOC_LUTON) += luton_pcb090.dtb luton_pcb091.dtb -dtb-$(CONFIG_SOC_OCELOT) += ocelot_pcb120.dtb ocelot_pcb123.dtb -dtb-$(CONFIG_SOC_JR2) += jr2_pcb110.dtb jr2_pcb111.dtb serval2_pcb112.dtb -dtb-$(CONFIG_SOC_SERVALT) += servalt_pcb116.dtb -dtb-$(CONFIG_SOC_SERVAL) += serval_pcb105.dtb serval_pcb106.dtb - include $(srctree)/scripts/Makefile.dts targets += $(dtb-y)
arch/nios2/dts/Makefile +0 -2
@@ -1,7 +1,5 @@ # SPDX-License-Identifier: GPL-2.0+ -dtb-y += $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%).dtb - include $(srctree)/scripts/Makefile.dts targets += $(dtb-y)
arch/powerpc/dts/Makefile +0 -32
@@ -1,37 +1,5 @@ # SPDX-License-Identifier: GPL-2.0+ -dtb-$(CONFIG_TARGET_KMCENT2) += kmcent2.dtb -dtb-$(CONFIG_TARGET_KMCOGE5NE) += kmcoge5ne.dtb -dtb-$(CONFIG_TARGET_KMETER1) += kmeter1.dtb -dtb-$(CONFIG_TARGET_KMOPTI2) += kmopti2.dtb -dtb-$(CONFIG_TARGET_KMSUPX5) += kmsupc5.dtb kmsupm5.dtb -dtb-$(CONFIG_TARGET_KMTEGR1) += kmtegr1.dtb -dtb-$(CONFIG_TARGET_KMTEPR2) += kmtepr2.dtb -dtb-$(CONFIG_TARGET_MPC837XERDB) += mpc8379erdb.dtb -dtb-$(CONFIG_TARGET_MPC8548CDS) += mpc8548cds.dtb mpc8548cds_36b.dtb -dtb-$(CONFIG_TARGET_P1010RDB_PA) += p1010rdb-pa.dtb p1010rdb-pa_36b.dtb -dtb-$(CONFIG_TARGET_P1010RDB_PB) += p1010rdb-pb.dtb p1010rdb-pb_36b.dtb -dtb-$(CONFIG_TARGET_P1020RDB_PC) += p1020rdb-pc.dtb p1020rdb-pc_36b.dtb -dtb-$(CONFIG_TARGET_P1020RDB_PD) += p1020rdb-pd.dtb -dtb-$(CONFIG_TARGET_P2020RDB) += p2020rdb-pc.dtb p2020rdb-pc_36b.dtb -dtb-$(CONFIG_TARGET_P2041RDB) += p2041rdb.dtb -dtb-$(CONFIG_TARGET_P3041DS) += p3041ds.dtb -dtb-$(CONFIG_TARGET_P4080DS) += p4080ds.dtb -dtb-$(CONFIG_TARGET_P5040DS) += p5040ds.dtb -dtb-$(CONFIG_TARGET_QEMU_PPCE500) += qemu-ppce500.dtb -dtb-$(CONFIG_TARGET_SOCRATES) += socrates.dtb -dtb-$(CONFIG_TARGET_T1024RDB) += t1024rdb.dtb -dtb-$(CONFIG_TARGET_T1042D4RDB) += t1042d4rdb.dtb -dtb-$(CONFIG_TARGET_T2080QDS) += t2080qds.dtb -dtb-$(CONFIG_TARGET_T2080RDB) += t2080rdb.dtb -dtb-$(CONFIG_TARGET_T4240RDB) += t4240rdb.dtb -dtb-$(CONFIG_TARGET_TUGE1) += kmtuge1.dtb -dtb-$(CONFIG_TARGET_TUXX1) += kmtuxa1.dtb -dtb-$(CONFIG_TARGET_MCR3000) += mcr3000.dtb -dtb-$(CONFIG_TARGET_GAZERBEAM) += gazerbeam.dtb -dtb-$(CONFIG_TARGET_CMPC885) += cmpc885.dtb -dtb-$(CONFIG_TARGET_CMPCPRO) += cmpcpro.dtb - include $(srctree)/scripts/Makefile.dts targets += $(dtb-y)
arch/riscv/dts/Makefile +0 -9
@@ -1,14 +1,5 @@ # SPDX-License-Identifier: GPL-2.0+ -dtb-$(CONFIG_TARGET_ANDES_AE350) += ae350_32.dtb ae350_64.dtb -dtb-$(CONFIG_TARGET_MICROCHIP_ICICLE) += mpfs-icicle-kit.dtb -dtb-$(CONFIG_TARGET_QEMU_VIRT) += qemu-virt32.dtb qemu-virt64.dtb -dtb-$(CONFIG_TARGET_OPENPITON_RISCV64) += openpiton-riscv64.dtb -dtb-$(CONFIG_TARGET_SIFIVE_UNLEASHED) += hifive-unleashed-a00.dtb -dtb-$(CONFIG_TARGET_SIFIVE_UNMATCHED) += hifive-unmatched-a00.dtb -dtb-$(CONFIG_TARGET_SIPEED_MAIX) += k210-maix-bit.dtb -dtb-$(CONFIG_TARGET_STARFIVE_VISIONFIVE2) += jh7110-starfive-visionfive-2.dtb -dtb-$(CONFIG_TARGET_TH1520_LPI4A) += th1520-lichee-pi-4a.dtb include $(srctree)/scripts/Makefile.dts targets += $(dtb-y)
arch/sandbox/dts/Makefile +0 -5
@@ -1,10 +1,5 @@ # SPDX-License-Identifier: GPL-2.0+ -ifdef CONFIG_SANDBOX64 -dtb-$(CONFIG_SANDBOX) += sandbox64.dtb -else -dtb-$(CONFIG_SANDBOX) += sandbox.dtb -endif dtb-$(CONFIG_UT_DM) += test.dtb other.dtb dtb-$(CONFIG_CMD_EXTENSION) += overlay0.dtbo overlay1.dtbo
arch/sh/dts/Makefile +1 -1
@@ -1,4 +1,4 @@ -dtb-y += sh7751-r2dplus.dtb +# SPDX-License-Identifier: GPL-2.0+ include $(srctree)/scripts/Makefile.dts
arch/x86/dts/Makefile +0 -22
@@ -1,27 +1,5 @@ # SPDX-License-Identifier: GPL-2.0+ -dtb-y += bayleybay.dtb \ - cherryhill.dtb \ - chromebook_coral.dtb \ - chromebook_link.dtb \ - chromebox_panther.dtb \ - chromebook_samus.dtb \ - conga-qeval20-qa3-e3845.dtb \ - coreboot.dtb \ - cougarcanyon2.dtb \ - crownbay.dtb \ - dfi-bt700-q7x-151.dtb \ - edison.dtb \ - efi-x86_app.dtb \ - efi-x86_payload.dtb \ - galileo.dtb \ - minnowmax.dtb \ - qemu-x86_i440fx.dtb \ - qemu-x86_q35.dtb \ - theadorable-x86-dfi-bt700.dtb \ - slimbootloader.dtb \ - baytrail_som-db5800-som-6867.dtb - include $(srctree)/scripts/Makefile.dts targets += $(dtb-y)
arch/xtensa/dts/Makefile +0 -2
@@ -1,7 +1,5 @@ # SPDX-License-Identifier: GPL-2.0+ -dtb-$(CONFIG_XTENSA) += ml605.dtb ml605_nommu.dtb kc705.dtb kc705_nommu.dtb - include $(srctree)/scripts/Makefile.dts targets += $(dtb-y)
configs/iot2050_defconfig +1 -0
@@ -78,6 +78,7 @@ CONFIG_CMD_TIME=y # CONFIG_ISO_PARTITION is not set CONFIG_OF_CONTROL=y CONFIG_SPL_OF_CONTROL=y +CONFIG_OF_LIST="k3-am6528-iot2050-basic k3-am6548-iot2050-advanced k3-am6528-iot2050-basic-pg2 k3-am6548-iot2050-advanced-pg2 k3-am6548-iot2050-advanced-m2" CONFIG_SPL_MULTI_DTB_FIT=y CONFIG_SPL_OF_LIST="k3-am65-iot2050-spl" CONFIG_SPL_MULTI_DTB_FIT_NO_COMPRESSION=y
Signature · 1 line
2.34.1
PATCH 2/2 doc: Update board_best_practices.rst to talk about dts files
We do need to list device tree overlay files in a Makefile, to ensure they are built. However, everything else should be handled via one of the CONFIG options.
--- doc/develop/board_best_practices.rst | 4 ++++ 1 file changed, 4 insertions(+)
doc/develop/board_best_practices.rst +4 -0
@@ -24,3 +24,7 @@ which are specific to creating a new board port. Kconfig fragments should reside in the board directory itself rather than in the top-level `configs/` directory. + +* A board may list device tree overlay files in `arch/$(ARCH)/dts/Makfile` but + all device trees themselves should be listed in `CONFIG_DEFAULT_DEVICE_TREE` + or `CONFIG_OF_LIST`.
Signature · 1 line
2.34.1
Hi Tom,
Quoted 9 lines · Tom Rini
With commit
3609e1dc("dts: automatically build necessary .dtb files") we now have logic that will ensure that all device trees needed in the binary are built automatically. Any device tree that the developer needs while working can still be built normally via makearch/.../foo.dtbso we can simply drop the rest of this logic.Suggested-by Rasmus Villemoes <[email protected]>Signed-off-by Tom Rini <[email protected]>
Quoted 15 lines
--- arch/arc/dts/Makefile | 8 - arch/arm/dts/Makefile | 1436 +--------------------------------- arch/m68k/dts/Makefile | 18 - arch/microblaze/dts/Makefile | 2 - arch/mips/dts/Makefile | 37 - arch/nios2/dts/Makefile | 2 - arch/powerpc/dts/Makefile | 32 - arch/riscv/dts/Makefile | 9 - arch/sandbox/dts/Makefile | 5 - arch/sh/dts/Makefile | 2 +- arch/x86/dts/Makefile | 22 - arch/xtensa/dts/Makefile | 2 - configs/iot2050_defconfig | 1 + 13 files changed, 6 insertions(+), 1570 deletions(-)
I can see the motivation for this, but it ends up moving us away from driver model and devicetree, IMO. For example, rk3399 and other rockchip boards use DT for their init so the same U-Boot can be used for all, mostly. Ideally that is the way all boards would be, as they are in Linux.
But here I have to manually add all the rk3399 boards to OF_LIST for each board and enable SPL_LOAD_FIT (and SPL_FRAMEWORK but that is fine) to make this work.
So this is teaching people to use a board.c file, to use #ifdefs for device-specific differences, etc. It will be easier to do that than to do the right thing.
One day I predict distros will be updating U-Boot on boards as a matter of course, perhaps using fwupd. Having a full U-Boot build for every single board is going to take up a lot of space and create a lot of confusion for people trying to figure out which one to use to update.
Could we instead reduce it down to a rule for each SoC that lists all the DTs for that SoC? The consistent naming of these files (with the rk3399- prefix for example) might make this easier?
With Linux right now I can build an arm64 build which supports most of the boards...with about 990 devicetree files. Do we really want 990 U-Boot builds?
Regards,
Simon
Quoted 34 lines · Simon Glass
Hi Tom,
Quoted 9 lines · Tom Rini
With commit
3609e1dc("dts: automatically build necessary .dtb files") we now have logic that will ensure that all device trees needed in the binary are built automatically. Any device tree that the developer needs while working can still be built normally via makearch/.../foo.dtbso we can simply drop the rest of this logic.Suggested-by Rasmus Villemoes <[email protected]>Signed-off-by Tom Rini <[email protected]>Quoted 15 lines
--- arch/arc/dts/Makefile | 8 - arch/arm/dts/Makefile | 1436 +--------------------------------- arch/m68k/dts/Makefile | 18 - arch/microblaze/dts/Makefile | 2 - arch/mips/dts/Makefile | 37 - arch/nios2/dts/Makefile | 2 - arch/powerpc/dts/Makefile | 32 - arch/riscv/dts/Makefile | 9 - arch/sandbox/dts/Makefile | 5 - arch/sh/dts/Makefile | 2 +- arch/x86/dts/Makefile | 22 - arch/xtensa/dts/Makefile | 2 - configs/iot2050_defconfig | 1 + 13 files changed, 6 insertions(+), 1570 deletions(-)I can see the motivation for this, but it ends up moving us away from driver model and devicetree, IMO. For example, rk3399 and other rockchip boards use DT for their init so the same U-Boot can be used for all, mostly. Ideally that is the way all boards would be, as they are in Linux.
Quoted 3 lines
But here I have to manually add all the rk3399 boards to
OF_LISTfor each board and enableSPL_LOAD_FIT(andSPL_FRAMEWORKbut that is fine) to make this work.
How are you doing this today on N rk3399 boards if you aren't tweaking a CONFIG option to get the correct dtb in to the final binary? That I think is where we go back-and-forth on stuff like this. If there's deconfigs that can support N boards, but only list a, or only a few, dtb files in the right CONFIG variable how do you get it to run on the others? I know you noted some Exynos platforms it's a simple concat to make another platform work instead. But I really don't know how common that is in theory, and even less so in practice. Picking up rk3399, you need bl31 and op-tee and you can only get those so generic too.
And part of the issue is that with Linux, the "do board specific things" just gets pushed down a layer, to us. We have to just know X/Y/Z at build time so that someone else can know it at run time.
Signature · 1 line
Tom
Hi Tom,
Quoted 36 lines · Tom Rini
Quoted 34 lines · Simon Glass
Hi Tom,
Quoted 9 lines · Tom Rini
With commit
3609e1dc("dts: automatically build necessary .dtb files") we now have logic that will ensure that all device trees needed in the binary are built automatically. Any device tree that the developer needs while working can still be built normally via makearch/.../foo.dtbso we can simply drop the rest of this logic.Suggested-by Rasmus Villemoes <[email protected]>Signed-off-by Tom Rini <[email protected]>Quoted 15 lines
--- arch/arc/dts/Makefile | 8 - arch/arm/dts/Makefile | 1436 +--------------------------------- arch/m68k/dts/Makefile | 18 - arch/microblaze/dts/Makefile | 2 - arch/mips/dts/Makefile | 37 - arch/nios2/dts/Makefile | 2 - arch/powerpc/dts/Makefile | 32 - arch/riscv/dts/Makefile | 9 - arch/sandbox/dts/Makefile | 5 - arch/sh/dts/Makefile | 2 +- arch/x86/dts/Makefile | 22 - arch/xtensa/dts/Makefile | 2 - configs/iot2050_defconfig | 1 + 13 files changed, 6 insertions(+), 1570 deletions(-)I can see the motivation for this, but it ends up moving us away from driver model and devicetree, IMO. For example, rk3399 and other rockchip boards use DT for their init so the same U-Boot can be used for all, mostly. Ideally that is the way all boards would be, as they are in Linux.
Quoted 7 lines
Quoted 3 lines
But here I have to manually add all the rk3399 boards to
OF_LISTfor each board and enableSPL_LOAD_FIT(andSPL_FRAMEWORKbut that is fine) to make this work.How are you doing this today on N rk3399 boards if you aren't tweaking a CONFIG option to get the correct dtb in to the final binary? That I think is where we go back-and-forth on stuff like this.
Basically without SPL_FIT_LOAD it works by stuffing the correct DT into the final image just before it is flashed. But I do imagine in a world where (say) TPL is different for each board but SPL, TF-A, OP-TEE and U-Boot proper are the same for each board.
But really we need to encourage these complex SoCs to use runtime configuration from go to whoa. Where DT cannot be used (e.g. TPL) we can do the Zephyr trick or perhaps create a little SoC-specific config block which is provided separately and tacked onto the generic TPL image. Having said that, TPL images are small, so the impact of having one per board is not great.
Quoted 7 lines
If there's
deconfigs that can support N boards, but only list a, or only a few, dtb files in the right CONFIG variable how do you get it to run on the others? I know you noted some Exynos platforms it's a simple concat to make another platform work instead. But I really don't know how common that is in theory, and even less so in practice. Picking up rk3399, you need bl31 and op-tee and you can only get those so generic too.
I understand that they are 100% generic for rk3399. E.g. for TF-A you use PLAT=rk3399 and that is that.
Quoted 4 lines
And part of the issue is that with Linux, the "do board specific things" just gets pushed down a layer, to us. We have to just know X/Y/Z at build time so that someone else can know it at run time.
Sure, and naturally that gets pushed down from U-Boot proper (which I think is becoming quite generic) to SPL, TPL, etc.
If it would help, I could try out (say) rockpro64-rk3399 and firefly-rk3399 to show how this works?
I know it is tempting to build everything individually, but it won't be nice. Binman knows what is needed for each board and can be used (one day) to create update files for an SoC without duplication. As soon as you give up on the commonality, everything just explodes in size, complexity and user confusion.
Regards,
Simon
Quoted 78 lines · Simon Glass
Hi Tom,
Quoted 36 lines · Tom Rini
Quoted 34 lines · Simon Glass
Hi Tom,
Quoted 9 lines · Tom Rini
With commit
3609e1dc("dts: automatically build necessary .dtb files") we now have logic that will ensure that all device trees needed in the binary are built automatically. Any device tree that the developer needs while working can still be built normally via makearch/.../foo.dtbso we can simply drop the rest of this logic.Suggested-by Rasmus Villemoes <[email protected]>Signed-off-by Tom Rini <[email protected]>Quoted 15 lines
--- arch/arc/dts/Makefile | 8 - arch/arm/dts/Makefile | 1436 +--------------------------------- arch/m68k/dts/Makefile | 18 - arch/microblaze/dts/Makefile | 2 - arch/mips/dts/Makefile | 37 - arch/nios2/dts/Makefile | 2 - arch/powerpc/dts/Makefile | 32 - arch/riscv/dts/Makefile | 9 - arch/sandbox/dts/Makefile | 5 - arch/sh/dts/Makefile | 2 +- arch/x86/dts/Makefile | 22 - arch/xtensa/dts/Makefile | 2 - configs/iot2050_defconfig | 1 + 13 files changed, 6 insertions(+), 1570 deletions(-)I can see the motivation for this, but it ends up moving us away from driver model and devicetree, IMO. For example, rk3399 and other rockchip boards use DT for their init so the same U-Boot can be used for all, mostly. Ideally that is the way all boards would be, as they are in Linux.
Quoted 7 lines
Quoted 3 lines
But here I have to manually add all the rk3399 boards to
OF_LISTfor each board and enableSPL_LOAD_FIT(andSPL_FRAMEWORKbut that is fine) to make this work.How are you doing this today on N rk3399 boards if you aren't tweaking a CONFIG option to get the correct dtb in to the final binary? That I think is where we go back-and-forth on stuff like this.
Basically without
SPL_FIT_LOADit works by stuffing the correct DT into the final image just before it is flashed. But I do imagine in a world where (say) TPL is different for each board but SPL, TF-A, OP-TEE and U-Boot proper are the same for each board.But really we need to encourage these complex SoCs to use runtime configuration from go to whoa. Where DT cannot be used (e.g. TPL) we can do the Zephyr trick or perhaps create a little SoC-specific config block which is provided separately and tacked onto the generic TPL image. Having said that, TPL images are small, so the impact of having one per board is not great.
Quoted 7 lines
If there's
deconfigs that can support N boards, but only list a, or only a few, dtb files in the right CONFIG variable how do you get it to run on the others? I know you noted some Exynos platforms it's a simple concat to make another platform work instead. But I really don't know how common that is in theory, and even less so in practice. Picking up rk3399, you need bl31 and op-tee and you can only get those so generic too.I understand that they are 100% generic for rk3399. E.g. for TF-A you use PLAT=rk3399 and that is that.
Quoted 4 lines
And part of the issue is that with Linux, the "do board specific things" just gets pushed down a layer, to us. We have to just know X/Y/Z at build time so that someone else can know it at run time.
Sure, and naturally that gets pushed down from U-Boot proper (which I think is becoming quite generic) to SPL, TPL, etc.
Quoted 8 lines
If it would help, I could try out (say) rockpro64-rk3399 and firefly-rk3399 to show how this works?
I know it is tempting to build everything individually, but it won't be nice. Binman knows what is needed for each board and can be used (one day) to create update files for an SoC without duplication. As soon as you give up on the commonality, everything just explodes in size, complexity and user confusion.
I guess with all of what you said I still don't understand why we need the sometimes wrong and not really used lists of dtb files in arch/*/dts/Makefile. A rockpro64-rk3399-tpl-only_defconfig still needs to say CONFIG_DEFAULT_DEVICETREE="rk3399-rockpro64" so that you build the tree so that it's available to binman. We have configs today that build and support N boards, and so use SPL_LOAD_FIT and are as generic as they can be. The only thing that this patch here changes is that you're relying on an implicit CONFIG symbol to list whatever device trees you want to be built and this patch says that you need to use one of the explicit CONFIG symbols instead.
If you want to try and demonstrate a more generic way of doing things, sunxi is probably the best bet for that because there's no TARGET configs there, everything is SoC + device tree. But it's not making any use of the lists that get removed here.
Signature · 1 line
Tom
Hi Tom,
Quoted 89 lines · Tom Rini
Quoted 78 lines · Simon Glass
Hi Tom,
Quoted 36 lines · Tom Rini
Quoted 34 lines · Simon Glass
Hi Tom,
Quoted 9 lines · Tom Rini
With commit
3609e1dc("dts: automatically build necessary .dtb files") we now have logic that will ensure that all device trees needed in the binary are built automatically. Any device tree that the developer needs while working can still be built normally via makearch/.../foo.dtbso we can simply drop the rest of this logic.Suggested-by Rasmus Villemoes <[email protected]>Signed-off-by Tom Rini <[email protected]>Quoted 15 lines
--- arch/arc/dts/Makefile | 8 - arch/arm/dts/Makefile | 1436 +--------------------------------- arch/m68k/dts/Makefile | 18 - arch/microblaze/dts/Makefile | 2 - arch/mips/dts/Makefile | 37 - arch/nios2/dts/Makefile | 2 - arch/powerpc/dts/Makefile | 32 - arch/riscv/dts/Makefile | 9 - arch/sandbox/dts/Makefile | 5 - arch/sh/dts/Makefile | 2 +- arch/x86/dts/Makefile | 22 - arch/xtensa/dts/Makefile | 2 - configs/iot2050_defconfig | 1 + 13 files changed, 6 insertions(+), 1570 deletions(-)I can see the motivation for this, but it ends up moving us away from driver model and devicetree, IMO. For example, rk3399 and other rockchip boards use DT for their init so the same U-Boot can be used for all, mostly. Ideally that is the way all boards would be, as they are in Linux.
Quoted 7 lines
Quoted 3 lines
But here I have to manually add all the rk3399 boards to
OF_LISTfor each board and enableSPL_LOAD_FIT(andSPL_FRAMEWORKbut that is fine) to make this work.How are you doing this today on N rk3399 boards if you aren't tweaking a CONFIG option to get the correct dtb in to the final binary? That I think is where we go back-and-forth on stuff like this.
Basically without
SPL_FIT_LOADit works by stuffing the correct DT into the final image just before it is flashed. But I do imagine in a world where (say) TPL is different for each board but SPL, TF-A, OP-TEE and U-Boot proper are the same for each board.But really we need to encourage these complex SoCs to use runtime configuration from go to whoa. Where DT cannot be used (e.g. TPL) we can do the Zephyr trick or perhaps create a little SoC-specific config block which is provided separately and tacked onto the generic TPL image. Having said that, TPL images are small, so the impact of having one per board is not great.
Quoted 7 lines
If there's
deconfigs that can support N boards, but only list a, or only a few, dtb files in the right CONFIG variable how do you get it to run on the others? I know you noted some Exynos platforms it's a simple concat to make another platform work instead. But I really don't know how common that is in theory, and even less so in practice. Picking up rk3399, you need bl31 and op-tee and you can only get those so generic too.I understand that they are 100% generic for rk3399. E.g. for TF-A you use PLAT=rk3399 and that is that.
Quoted 4 lines
And part of the issue is that with Linux, the "do board specific things" just gets pushed down a layer, to us. We have to just know X/Y/Z at build time so that someone else can know it at run time.
Sure, and naturally that gets pushed down from U-Boot proper (which I think is becoming quite generic) to SPL, TPL, etc.
Quoted 8 lines
If it would help, I could try out (say) rockpro64-rk3399 and firefly-rk3399 to show how this works?
I know it is tempting to build everything individually, but it won't be nice. Binman knows what is needed for each board and can be used (one day) to create update files for an SoC without duplication. As soon as you give up on the commonality, everything just explodes in size, complexity and user confusion.
Quoted 10 lines
I guess with all of what you said I still don't understand why we need the sometimes wrong and not really used lists of dtb files in
arch/*/dts/Makefile. A rockpro64-rk3399-tpl-only_defconfig still needs to sayCONFIG_DEFAULT_DEVICETREE="rk3399-rockpro64" so that you build the tree so that it's available to binman. We have configs today that build and support N boards, and so useSPL_LOAD_FITand are as generic as they can be. The only thing that this patch here changes is that you're relying on an implicit CONFIG symbol to list whatever device trees you want to be built and this patch says that you need to use one of the explicit CONFIG symbols instead.
It's really just that this patch is making this very hard.
For example, all ROCKCHIP_RK3399 (should be ARCH_ROCKCHIP_RK3399?) should boot with just a DT change. We should be setting that as the standard, just as is done in Linux.
By splitting everything out into individual targets, there really is no chance that people will do the right thing, here.
Quoted 5 lines
If you want to try and demonstrate a more generic way of doing things, sunxi is probably the best bet for that because there's no TARGET configs there, everything is SoC + device tree. But it's not making any use of the lists that get removed here.
There is lots of ridiculous stuff in arch/arm/dts/Makefile - it is a real mess and I agree we should clean it up. I have not done a good job of reviewing it and I don't think people understand devicetree very well in firmware. I could take that on if that is what is needed here.
Looking at Linux arm32 now it has a subdir for each arch and inside that it has only ARCH (e.g. for rockchip) or MACH (for sunxi) or SOC (for some reason, microchip). For U-Boot we don't have a separate arm64 dir so would need to think about that, too.
OK I will take a look at sunxi and see what can be done there. There is an active maintainer there, which helps.
Regards,
Simon
Quoted 8 lines · Simon Glass
Quoted 6 lines · Tom Rini
With commit
3609e1dc("dts: automatically build necessary .dtb files") we now have logic that will ensure that all device trees needed in the binary are built automatically. Any device tree that the developer needs while working can still be built normally via makearch/.../foo.dtbso we can simply drop the rest of this logic.
Quoted 4 lines
Quoted 1 line
13 files changed, 6 insertions(+), 1570 deletions(-)I can see the motivation for this, but it ends up moving us away from driver model and devicetree, IMO.
No, it does not.
Quoted 3 lines
For example, rk3399 and other
rockchip boards use DT for their init so the same U-Boot can be used for all, mostly.
Huh? I just took a look at a few random _defconfigs that mention various rk3399-* as CONFIG_DEFAULT_DEVICE_TREE. And they vary _wildly_ beyond just that DEFAULT_DEVICE_TREE, so the U-Boot binary (as in the ELF file, before being concat'ed with a .dtb or wrapped in some container) that comes out of those must be similarly wildly different.
Quoted 2 lines
Ideally that is the way all boards would be, as they are in Linux.
As Tom notes, that's just not gonna happen, ever, not even within a single SOC. Something as simple as the amount of RAM may need to be hardcoded by _some_ stage of the boot process. (Not all, I'm sure you can find examples of SOCs where it is possible to actually build a quite generic u-boot binary, but how that binary is then going to figure out which .dtb is relevant either to itself or to the kernel its job is to load is then hard to know... something like a top-level compatible string would still need to be hard-coded somewhere in the binary).
Quoted 2 lines
But here I have to manually add all the rk3399 boards to
OF_LISTfor each board
No, why? If you want to create such a generic U-Boot, you create one single _defconfig that has all the options needed by all the various rk3399 variants it's supposed to support, and add all the relevant .dtbs to that defconfig's OF_LIST.
Quoted 3 lines
So this is teaching people to use a
board.cfile, to use #ifdefs for device-specific differences, etc. It will be easier to do that than to do the right thing.
I'm sorry, but I really don't see how that follows. All this does is eliminate duplication in our build system. Each defconfig already lists the dtbs it works with (/is supposed to work with), which can be a wide or narrow range of boards; some boards have multiple defconfigs simply because the users may choose to store U-Boot (or its environment, or...) in nand or emmc or SPI-NOR or... Sure, some of that info could come from a .dtb, and the .dtb could somehow be chosen at run-time or some earlier stage be tasked with figuring it out (which just leads to an elephants all the way down problem).
Quoted 2 lines
With Linux right now I can build an arm64 build which supports most of the boards...with about 990 devicetree files.
Well, the kernel can get away with a kitchen-sink defconfig build resulting in a 40+MB kernel image plus hundreds of MB of modules on top. And relying on an earlier stage picking the right .dtb for it. U-Boot simply doesn't have that luxury, because U-Boot is that earlier stage.
Rasmus