DTB build housekeeping
v2 cover DTB build housekeeping
This series removes the bundled device tree blobs from the repository which are redundant to the bundled device tree sources. To make this work, the device tree compiler 'dtc' is now required whenever libfdt is used. Furthermore, dtc can now be built from the bundled libfdt if needed.
v2:
* Allow building dtc from bundled libfdt (Paolo)
* Find dtc iff libfdt is used (Paolo)
* Remove dtc configure option (now obsolete)
Bernhard Beschow (3):
hw/microblaze: Add missing FDT dependency
configure: Ensure existance of dtc when libfdt is used pc-bios/dtb: Remove device tree blobs
MAINTAINERS | 2 +- meson.build | 16 +++-- hw/microblaze/Kconfig | 4 +- pc-bios/dtb/bamboo.dtb | Bin 3211 -> 0 bytes pc-bios/dtb/canyonlands.dtb | Bin 9779 -> 0 bytes pc-bios/dtb/meson.build | 17 ++--- pc-bios/dtb/petalogix-ml605.dtb | Bin 9882 -> 0 bytes pc-bios/dtb/petalogix-s3adsp1800.dtb | Bin 8161 -> 0 bytes subprojects/dtc.wrap | 1 + .../packagefiles/dtc-meson-override.patch | 62 ++++++++++++++++++ 10 files changed, 85 insertions(+), 17 deletions(-) delete mode 100644 pc-bios/dtb/bamboo.dtb delete mode 100644 pc-bios/dtb/canyonlands.dtb delete mode 100644 pc-bios/dtb/petalogix-ml605.dtb delete mode 100644 pc-bios/dtb/petalogix-s3adsp1800.dtb create mode 100644 subprojects/packagefiles/dtc-meson-override.patch
Signature · 1 line
2.50.0
PATCH v2 1/3 hw/microblaze: Add missing FDT dependency
These boards ship with a bundled DTB, and dtc will be required for generating these from device tree sources. Prepare for that by adding an FDT dependency.
--- hw/microblaze/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/microblaze/Kconfig +2 -2
@@ -1,7 +1,7 @@ config PETALOGIX_S3ADSP1800 bool default y - depends on MICROBLAZE + depends on MICROBLAZE && FDT select PFLASH_CFI01 select XILINX select XILINX_AXI
@@ -11,7 +11,7 @@ config PETALOGIX_S3ADSP1800 config PETALOGIX_ML605 bool default y - depends on MICROBLAZE + depends on MICROBLAZE && FDT select PFLASH_CFI01 select SERIAL_MM select SSI_M25P80
Signature · 1 line
2.50.0
Re: [PATCH v2 1/3] hw/microblaze: Add missing FDT dependency
Quoted 7 lines · Bernhard Beschow
These boards ship with a bundled DTB, and dtc will be required for generating these from device tree sources. Prepare for that by adding an FDT dependency.
Signed-off-by Bernhard Beschow <[email protected]>--- hw/microblaze/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
PATCH v2 2/3 configure: Ensure existance of dtc when libfdt is used
In reply to Bernhard BeschowThe next patch relies on dtc for boards with a bundled DTB. These boards depend on libfdt already. Make sure that there is a dtc iff libfdt is used such that the DTBs can be generated.
--- meson.build | 16 +++-- pc-bios/dtb/meson.build | 1 - subprojects/dtc.wrap | 1 + .../packagefiles/dtc-meson-override.patch | 62 +++++++++++++++++++ 4 files changed, 75 insertions(+), 5 deletions(-) create mode 100644 subprojects/packagefiles/dtc-meson-override.patch
meson.build +12 -4
@@ -2089,13 +2089,15 @@ if numa.found() and not cc.links(''' endif fdt = not_found +dtc = not_found fdt_opt = get_option('fdt') if fdt_opt == 'enabled' and get_option('wrap_mode') == 'nodownload' fdt_opt = 'system' endif if fdt_opt in ['enabled', 'system'] or (fdt_opt == 'auto' and have_system) fdt = cc.find_library('fdt', required: fdt_opt == 'system') - if fdt.found() and cc.links(''' + dtc = find_program('dtc', required: fdt_opt == 'system') + if dtc.found() and fdt.found() and cc.links(''' #include <libfdt.h> #include <libfdt_env.h> int main(void) { fdt_find_max_phandle(NULL, NULL); return 0; }''',
@@ -2104,16 +2106,22 @@ if fdt_opt in ['enabled', 'system'] or (fdt_opt == 'auto' and have_system) elif fdt_opt != 'system' fdt_opt = get_option('wrap_mode') == 'nodownload' ? 'disabled' : 'internal' fdt = not_found + dtc = not_found else - error('system libfdt is too old (1.5.1 or newer required)') + if dtc.found() + error('system libfdt is too old (1.5.1 or newer required)') + else + error('device tree compiler not found') + endif endif endif if fdt_opt == 'internal' assert(not fdt.found()) libfdt_proj = subproject('dtc', required: true, - default_options: ['tools=false', 'yaml=disabled', + default_options: ['tools=true', 'yaml=disabled', 'python=disabled', 'default_library=static']) - fdt = libfdt_proj.get_variable('libfdt_dep') + fdt = dependency('libfdt', required: true) + dtc = find_program('dtc', required: true) endif rdma = not_found
pc-bios/dtb/meson.build +0 -1
@@ -5,7 +5,6 @@ dtbs = [ 'petalogix-s3adsp1800.dtb', ] -dtc = find_program('dtc', required: false) if dtc.found() foreach out : dtbs f = fs.replace_suffix(out, '.dts')
subprojects/dtc.wrap +1 -0
@@ -2,3 +2,4 @@ url = https://gitlab.com/qemu-project/dtc.git revision = b6910bec11614980a21e46fbccc35934b671bd81 depth = 1 +diff_files = dtc-meson-override.patch
subprojects/packagefiles/dtc-meson-override.patch new file +62 -0
62 lines not on this page · raw message
Signature · 1 line
2.50.0
PATCH v2 3/3 pc-bios/dtb: Remove device tree blobs
In reply to Bernhard BeschowNow that the existance of a device tree compiler is enusred, it is possible to always generate the DTBs from sources. This avoids checked in DTBs to become inconsistent with their sources.
--- MAINTAINERS | 2 +- pc-bios/dtb/bamboo.dtb | Bin 3211 -> 0 bytes pc-bios/dtb/canyonlands.dtb | Bin 9779 -> 0 bytes pc-bios/dtb/meson.build | 16 +++++++--------- pc-bios/dtb/petalogix-ml605.dtb | Bin 9882 -> 0 bytes pc-bios/dtb/petalogix-s3adsp1800.dtb | Bin 8161 -> 0 bytes 6 files changed, 8 insertions(+), 10 deletions(-) delete mode 100644 pc-bios/dtb/bamboo.dtb delete mode 100644 pc-bios/dtb/canyonlands.dtb delete mode 100644 pc-bios/dtb/petalogix-ml605.dtb delete mode 100644 pc-bios/dtb/petalogix-s3adsp1800.dtb
MAINTAINERS +1 -1
@@ -1616,7 +1616,7 @@ F: hw/pci-host/ppc440_pcix.c F: hw/display/sm501* F: hw/ide/sii3112.c F: hw/rtc/m41t80.c -F: pc-bios/dtb/canyonlands.dt[sb] +F: pc-bios/dtb/canyonlands.dts F: pc-bios/u-boot-sam460ex-20100605.bin F: roms/u-boot-sam460ex F: docs/system/ppc/amigang.rst
pc-bios/dtb/bamboo.dtb deleted binary +0 -0
pc-bios/dtb/canyonlands.dtb deleted binary +0 -0
pc-bios/dtb/meson.build +7 -9
@@ -1,13 +1,13 @@ -dtbs = [ - 'bamboo.dtb', - 'canyonlands.dtb', - 'petalogix-ml605.dtb', - 'petalogix-s3adsp1800.dtb', +dts_sources = [ + 'bamboo.dts', + 'canyonlands.dts', + 'petalogix-s3adsp1800.dts', + 'petalogix-ml605.dts', ] if dtc.found() - foreach out : dtbs - f = fs.replace_suffix(out, '.dts') + foreach f : dts_sources + out = fs.replace_suffix(f, '.dtb') custom_target(out, build_by_default: have_system, input: files(f),
@@ -17,6 +17,4 @@ if dtc.found() command: [ dtc, '-q', '-I', 'dts', '-O', 'dtb', '-o', '@OUTPUT@', '@INPUT0@' ]) endforeach -else - install_data(dtbs, install_dir: qemu_datadir / 'dtb') endif
pc-bios/dtb/petalogix-ml605.dtb deleted binary +0 -0
pc-bios/dtb/petalogix-s3adsp1800.dtb deleted binary +0 -0
Signature · 1 line
2.50.0
Re: [PATCH v2 3/3] pc-bios/dtb: Remove device tree blobs
Quoted 1 line · Bernhard Beschow
Now that the existance of a device tree compiler is enusred, it is possible to
"ensured"
Quoted 12 lines
always generate the DTBs from sources. This avoids checked in DTBs to become inconsistent with their sources.
Signed-off-by Bernhard Beschow <[email protected]>--- MAINTAINERS | 2 +- pc-bios/dtb/bamboo.dtb | Bin 3211 -> 0 bytes pc-bios/dtb/canyonlands.dtb | Bin 9779 -> 0 bytes pc-bios/dtb/meson.build | 16 +++++++--------- pc-bios/dtb/petalogix-ml605.dtb | Bin 9882 -> 0 bytes pc-bios/dtb/petalogix-s3adsp1800.dtb | Bin 8161 -> 0 bytes 6 files changed, 8 insertions(+), 10 deletions(-)
Quoted 4 lines
delete mode 100644 pc-bios/dtb/bamboo.dtb delete mode 100644 pc-bios/dtb/canyonlands.dtb delete mode 100644 pc-bios/dtb/petalogix-ml605.dtb delete mode 100644 pc-bios/dtb/petalogix-s3adsp1800.dtb
Am 8. Juli 2025 20:48:03 UTC schrieb Bernhard Beschow <[email protected]>:
Quoted 9 lines
This series removes the bundled device tree blobs from the repository which are redundant to the bundled device tree sources. To make this work, the device tree compiler 'dtc' is now required whenever libfdt is used. Furthermore, dtc can now be built from the bundled libfdt if needed.
v2:
* Allow building dtc from bundled libfdt (Paolo)
* Find dtc iff libfdt is used (Paolo)
* Remove dtc configure option (now obsolete)
Ping
Quoted 23 lines
Bernhard Beschow (3):
hw/microblaze: Add missing FDT dependency
configure: Ensure existance of dtc when libfdt is used pc-bios/dtb: Remove device tree blobsMAINTAINERS | 2 +- meson.build | 16 +++-- hw/microblaze/Kconfig | 4 +- pc-bios/dtb/bamboo.dtb | Bin 3211 -> 0 bytes pc-bios/dtb/canyonlands.dtb | Bin 9779 -> 0 bytes pc-bios/dtb/meson.build | 17 ++--- pc-bios/dtb/petalogix-ml605.dtb | Bin 9882 -> 0 bytes pc-bios/dtb/petalogix-s3adsp1800.dtb | Bin 8161 -> 0 bytes subprojects/dtc.wrap | 1 + .../packagefiles/dtc-meson-override.patch | 62 ++++++++++++++++++ 10 files changed, 85 insertions(+), 17 deletions(-)delete mode 100644 pc-bios/dtb/bamboo.dtb
delete mode 100644 pc-bios/dtb/canyonlands.dtb
delete mode 100644 pc-bios/dtb/petalogix-ml605.dtb
delete mode 100644 pc-bios/dtb/petalogix-s3adsp1800.dtb create mode 100644subprojects/packagefiles/dtc-meson-override.patch
Quoted 15 lines · Bernhard Beschow
This series removes the bundled device tree blobs from the repository which are redundant to the bundled device tree sources. To make this work, the device tree compiler 'dtc' is now required whenever libfdt is used. Furthermore, dtc can now be built from the bundled libfdt if needed.
v2:
* Allow building dtc from bundled libfdt (Paolo)
* Find dtc iff libfdt is used (Paolo)
* Remove dtc configure option (now obsolete)Bernhard Beschow (3):
hw/microblaze: Add missing FDT dependency
configure: Ensure existance of dtc when libfdt is used pc-bios/dtb: Remove device tree blobs
Quoted 10 lines
MAINTAINERS | 2 +- meson.build | 16 +++-- hw/microblaze/Kconfig | 4 +- pc-bios/dtb/bamboo.dtb | Bin 3211 -> 0 bytes pc-bios/dtb/canyonlands.dtb | Bin 9779 -> 0 bytes pc-bios/dtb/meson.build | 17 ++--- pc-bios/dtb/petalogix-ml605.dtb | Bin 9882 -> 0 bytes pc-bios/dtb/petalogix-s3adsp1800.dtb | Bin 8161 -> 0 bytes subprojects/dtc.wrap | 1 + .../packagefiles/dtc-meson-override.patch | 62 ++++++++++++++++++
Being not familiar enough with this meson fu, I'm only queuing the first patch, being a good fix in its own.
Thanks,
Phil.
Quoted 27 lines · Philippe Mathieu-Daudé
Quoted 15 lines · Bernhard Beschow
This series removes the bundled device tree blobs from the repository which are redundant to the bundled device tree sources. To make this work, the device tree compiler 'dtc' is now required whenever libfdt is used. Furthermore, dtc can now be built from the bundled libfdt if needed.
v2:
* Allow building dtc from bundled libfdt (Paolo)
* Find dtc iff libfdt is used (Paolo)
* Remove dtc configure option (now obsolete)Bernhard Beschow (3):
hw/microblaze: Add missing FDT dependency
configure: Ensure existance of dtc when libfdt is used pc-bios/dtb: Remove device tree blobsQuoted 10 lines
MAINTAINERS | 2 +- meson.build | 16 +++-- hw/microblaze/Kconfig | 4 +- pc-bios/dtb/bamboo.dtb | Bin 3211 -> 0 bytes pc-bios/dtb/canyonlands.dtb | Bin 9779 -> 0 bytes pc-bios/dtb/meson.build | 17 ++--- pc-bios/dtb/petalogix-ml605.dtb | Bin 9882 -> 0 bytes pc-bios/dtb/petalogix-s3adsp1800.dtb | Bin 8161 -> 0 bytes subprojects/dtc.wrap | 1 + .../packagefiles/dtc-meson-override.patch | 62 ++++++++++++++++++
Quoted 2 lines
Being not familiar enough with this meson fu, I'm only queuing the first patch, being a good fix in its own.
I queued the rest for 10.2.
Paolo
Quoted 4 lines · Paolo Bonzini
Quoted 2 lines
Being not familiar enough with this meson fu, I'm only queuing the first patch, being a good fix in its own.
I queued the rest for 10.2.
Unfortunately this doesn't work because meson doesn't want to have dtc from the subproject and libfdt from the system. As a result, I need to add dtc to the containers, which I did, but then I have failures in macOS and FreeBSD because they cannot use the libfdt (from respectively homebrew or ports).
In both cases, dtc and libfdt should be packaged together though. For macOS, I even downloaded the dtc "bottle" and checked that it has both dtc and libfdt, but libfdt cannot be found.
So, the "simplest" way to get these patches unstuck is to remove support for bundled libfdt altogether (and add libfdt to all the CI environments).
Thanks for your understanding :)
Paolo