[PULL 36/58] pc-bios: Move device tree files in their own subdir

Philippe Mathieu-Daudé posted 58 patches 9 months, 2 weeks ago
[PULL 36/58] pc-bios: Move device tree files in their own subdir
Posted by Philippe Mathieu-Daudé 9 months, 2 weeks ago
From: BALATON Zoltan <balaton@eik.bme.hu>

We have several device tree files already and may have more in the
future so add a new dtb subdirectory and move device tree files there
so they are not mixed with ROM binaries.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 MAINTAINERS                                |   2 +-
 system/datadir.c                           |   4 +++-
 pc-bios/{ => dtb}/bamboo.dtb               | Bin
 pc-bios/{ => dtb}/bamboo.dts               |   0
 pc-bios/{ => dtb}/canyonlands.dtb          | Bin
 pc-bios/{ => dtb}/canyonlands.dts          |   0
 pc-bios/dtb/meson.build                    |  23 +++++++++++++++++++++
 pc-bios/{ => dtb}/petalogix-ml605.dtb      | Bin
 pc-bios/{ => dtb}/petalogix-ml605.dts      |   0
 pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb | Bin
 pc-bios/{ => dtb}/petalogix-s3adsp1800.dts |   0
 pc-bios/meson.build                        |  23 +--------------------
 qemu.nsi                                   |   2 +-
 13 files changed, 29 insertions(+), 25 deletions(-)
 rename pc-bios/{ => dtb}/bamboo.dtb (100%)
 rename pc-bios/{ => dtb}/bamboo.dts (100%)
 rename pc-bios/{ => dtb}/canyonlands.dtb (100%)
 rename pc-bios/{ => dtb}/canyonlands.dts (100%)
 create mode 100644 pc-bios/dtb/meson.build
 rename pc-bios/{ => dtb}/petalogix-ml605.dtb (100%)
 rename pc-bios/{ => dtb}/petalogix-ml605.dts (100%)
 rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb (100%)
 rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dts (100%)

diff --git a/MAINTAINERS b/MAINTAINERS
index 661a47db5ac..d82d962f1a4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1581,7 +1581,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/canyonlands.dt[sb]
+F: pc-bios/dtb/canyonlands.dt[sb]
 F: pc-bios/u-boot-sam460ex-20100605.bin
 F: roms/u-boot-sam460ex
 F: docs/system/ppc/amigang.rst
diff --git a/system/datadir.c b/system/datadir.c
index e450b84ce91..f96f8fc2646 100644
--- a/system/datadir.c
+++ b/system/datadir.c
@@ -44,9 +44,11 @@ char *qemu_find_file(QemuFileType type, const char *name)
 
     switch (type) {
     case QEMU_FILE_TYPE_BIOS:
-    case QEMU_FILE_TYPE_DTB:
         subdir = "";
         break;
+    case QEMU_FILE_TYPE_DTB:
+        subdir = "dtb/";
+        break;
     case QEMU_FILE_TYPE_KEYMAP:
         subdir = "keymaps/";
         break;
diff --git a/pc-bios/bamboo.dtb b/pc-bios/dtb/bamboo.dtb
similarity index 100%
rename from pc-bios/bamboo.dtb
rename to pc-bios/dtb/bamboo.dtb
diff --git a/pc-bios/bamboo.dts b/pc-bios/dtb/bamboo.dts
similarity index 100%
rename from pc-bios/bamboo.dts
rename to pc-bios/dtb/bamboo.dts
diff --git a/pc-bios/canyonlands.dtb b/pc-bios/dtb/canyonlands.dtb
similarity index 100%
rename from pc-bios/canyonlands.dtb
rename to pc-bios/dtb/canyonlands.dtb
diff --git a/pc-bios/canyonlands.dts b/pc-bios/dtb/canyonlands.dts
similarity index 100%
rename from pc-bios/canyonlands.dts
rename to pc-bios/dtb/canyonlands.dts
diff --git a/pc-bios/dtb/meson.build b/pc-bios/dtb/meson.build
new file mode 100644
index 00000000000..7a71835bca7
--- /dev/null
+++ b/pc-bios/dtb/meson.build
@@ -0,0 +1,23 @@
+dtbs = [
+  'bamboo.dtb',
+  'canyonlands.dtb',
+  'petalogix-ml605.dtb',
+  'petalogix-s3adsp1800.dtb',
+]
+
+dtc = find_program('dtc', required: false)
+if dtc.found()
+  foreach out : dtbs
+    f = fs.replace_suffix(out, '.dts')
+    custom_target(f,
+        build_by_default: have_system,
+        input: files(f),
+        output: out,
+        install: get_option('install_blobs'),
+        install_dir: qemu_datadir / 'dtb',
+        command: [ dtc, '-q', '-I', 'dts', '-O', 'dtb',
+                        '-o', '@OUTPUT@', '@INPUT0@' ])
+  endforeach
+else
+    install_data(dtbs, install_dir: qemu_datadir / 'dtb')
+endif
diff --git a/pc-bios/petalogix-ml605.dtb b/pc-bios/dtb/petalogix-ml605.dtb
similarity index 100%
rename from pc-bios/petalogix-ml605.dtb
rename to pc-bios/dtb/petalogix-ml605.dtb
diff --git a/pc-bios/petalogix-ml605.dts b/pc-bios/dtb/petalogix-ml605.dts
similarity index 100%
rename from pc-bios/petalogix-ml605.dts
rename to pc-bios/dtb/petalogix-ml605.dts
diff --git a/pc-bios/petalogix-s3adsp1800.dtb b/pc-bios/dtb/petalogix-s3adsp1800.dtb
similarity index 100%
rename from pc-bios/petalogix-s3adsp1800.dtb
rename to pc-bios/dtb/petalogix-s3adsp1800.dtb
diff --git a/pc-bios/petalogix-s3adsp1800.dts b/pc-bios/dtb/petalogix-s3adsp1800.dts
similarity index 100%
rename from pc-bios/petalogix-s3adsp1800.dts
rename to pc-bios/dtb/petalogix-s3adsp1800.dts
diff --git a/pc-bios/meson.build b/pc-bios/meson.build
index 34d6616c32b..34d8cc4f338 100644
--- a/pc-bios/meson.build
+++ b/pc-bios/meson.build
@@ -86,31 +86,10 @@ blobs = [
   'vof-nvram.bin',
 ]
 
-dtc = find_program('dtc', required: false)
-foreach f : [
-  'bamboo.dts',
-  'canyonlands.dts',
-  'petalogix-s3adsp1800.dts',
-  'petalogix-ml605.dts',
-]
-  out = fs.replace_suffix(f, '.dtb')
-  if dtc.found()
-    custom_target(f,
-        build_by_default: have_system,
-        input: files(f),
-        output: out,
-        install: get_option('install_blobs'),
-        install_dir: qemu_datadir,
-        command: [ dtc, '-q', '-I', 'dts', '-O', 'dtb',
-                        '-o', '@OUTPUT@', '@INPUT0@' ])
-  else
-    blobs += out
-  endif
-endforeach
-
 if get_option('install_blobs')
   install_data(blobs, install_dir: qemu_datadir)
 endif
 
 subdir('descriptors')
+subdir('dtb')
 subdir('keymaps')
diff --git a/qemu.nsi b/qemu.nsi
index b186f223e14..d419986ca06 100644
--- a/qemu.nsi
+++ b/qemu.nsi
@@ -204,7 +204,6 @@ Section "Uninstall"
     Delete "$INSTDIR\*.bmp"
     Delete "$INSTDIR\*.bin"
     Delete "$INSTDIR\*.dll"
-    Delete "$INSTDIR\*.dtb"
     Delete "$INSTDIR\*.fd"
     Delete "$INSTDIR\*.img"
     Delete "$INSTDIR\*.lid"
@@ -215,6 +214,7 @@ Section "Uninstall"
     Delete "$INSTDIR\qemu-io.exe"
     Delete "$INSTDIR\qemu.exe"
     Delete "$INSTDIR\qemu-system-*.exe"
+    RMDir /r "$INSTDIR\dtb"
     RMDir /r "$INSTDIR\doc"
     RMDir /r "$INSTDIR\share"
     ; Remove generated files
-- 
2.47.1


Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir
Posted by Bernhard Beschow 8 months, 2 weeks ago

Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>From: BALATON Zoltan <balaton@eik.bme.hu>
>
>We have several device tree files already and may have more in the
>future so add a new dtb subdirectory and move device tree files there
>so they are not mixed with ROM binaries.
>
>Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>
>Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>---
> MAINTAINERS                                |   2 +-
> system/datadir.c                           |   4 +++-
> pc-bios/{ => dtb}/bamboo.dtb               | Bin
> pc-bios/{ => dtb}/bamboo.dts               |   0
> pc-bios/{ => dtb}/canyonlands.dtb          | Bin
> pc-bios/{ => dtb}/canyonlands.dts          |   0
> pc-bios/dtb/meson.build                    |  23 +++++++++++++++++++++
> pc-bios/{ => dtb}/petalogix-ml605.dtb      | Bin
> pc-bios/{ => dtb}/petalogix-ml605.dts      |   0
> pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb | Bin
> pc-bios/{ => dtb}/petalogix-s3adsp1800.dts |   0
> pc-bios/meson.build                        |  23 +--------------------
> qemu.nsi                                   |   2 +-
> 13 files changed, 29 insertions(+), 25 deletions(-)
> rename pc-bios/{ => dtb}/bamboo.dtb (100%)
> rename pc-bios/{ => dtb}/bamboo.dts (100%)
> rename pc-bios/{ => dtb}/canyonlands.dtb (100%)
> rename pc-bios/{ => dtb}/canyonlands.dts (100%)
> create mode 100644 pc-bios/dtb/meson.build
> rename pc-bios/{ => dtb}/petalogix-ml605.dtb (100%)
> rename pc-bios/{ => dtb}/petalogix-ml605.dts (100%)
> rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb (100%)
> rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dts (100%)
>
>diff --git a/MAINTAINERS b/MAINTAINERS
>index 661a47db5ac..d82d962f1a4 100644
>--- a/MAINTAINERS
>+++ b/MAINTAINERS
>@@ -1581,7 +1581,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/canyonlands.dt[sb]
>+F: pc-bios/dtb/canyonlands.dt[sb]
> F: pc-bios/u-boot-sam460ex-20100605.bin
> F: roms/u-boot-sam460ex
> F: docs/system/ppc/amigang.rst
>diff --git a/system/datadir.c b/system/datadir.c
>index e450b84ce91..f96f8fc2646 100644
>--- a/system/datadir.c
>+++ b/system/datadir.c
>@@ -44,9 +44,11 @@ char *qemu_find_file(QemuFileType type, const char *name)
> 
>     switch (type) {
>     case QEMU_FILE_TYPE_BIOS:
>-    case QEMU_FILE_TYPE_DTB:
>         subdir = "";
>         break;
>+    case QEMU_FILE_TYPE_DTB:
>+        subdir = "dtb/";
>+        break;
>     case QEMU_FILE_TYPE_KEYMAP:
>         subdir = "keymaps/";
>         break;
>diff --git a/pc-bios/bamboo.dtb b/pc-bios/dtb/bamboo.dtb
>similarity index 100%
>rename from pc-bios/bamboo.dtb
>rename to pc-bios/dtb/bamboo.dtb
>diff --git a/pc-bios/bamboo.dts b/pc-bios/dtb/bamboo.dts
>similarity index 100%
>rename from pc-bios/bamboo.dts
>rename to pc-bios/dtb/bamboo.dts
>diff --git a/pc-bios/canyonlands.dtb b/pc-bios/dtb/canyonlands.dtb
>similarity index 100%
>rename from pc-bios/canyonlands.dtb
>rename to pc-bios/dtb/canyonlands.dtb
>diff --git a/pc-bios/canyonlands.dts b/pc-bios/dtb/canyonlands.dts
>similarity index 100%
>rename from pc-bios/canyonlands.dts
>rename to pc-bios/dtb/canyonlands.dts
>diff --git a/pc-bios/dtb/meson.build b/pc-bios/dtb/meson.build
>new file mode 100644
>index 00000000000..7a71835bca7
>--- /dev/null
>+++ b/pc-bios/dtb/meson.build
>@@ -0,0 +1,23 @@
>+dtbs = [
>+  'bamboo.dtb',
>+  'canyonlands.dtb',
>+  'petalogix-ml605.dtb',
>+  'petalogix-s3adsp1800.dtb',

Was it intended that the suffix changed from .dts to .dtb? This change isn't motivated in the commit message and usually source files rather than generated artifacts are listed in build files.

Best regards,
Bernhard

>+]
>+
>+dtc = find_program('dtc', required: false)
>+if dtc.found()
>+  foreach out : dtbs
>+    f = fs.replace_suffix(out, '.dts')
>+    custom_target(f,
>+        build_by_default: have_system,
>+        input: files(f),
>+        output: out,
>+        install: get_option('install_blobs'),
>+        install_dir: qemu_datadir / 'dtb',
>+        command: [ dtc, '-q', '-I', 'dts', '-O', 'dtb',
>+                        '-o', '@OUTPUT@', '@INPUT0@' ])
>+  endforeach
>+else
>+    install_data(dtbs, install_dir: qemu_datadir / 'dtb')
>+endif
>diff --git a/pc-bios/petalogix-ml605.dtb b/pc-bios/dtb/petalogix-ml605.dtb
>similarity index 100%
>rename from pc-bios/petalogix-ml605.dtb
>rename to pc-bios/dtb/petalogix-ml605.dtb
>diff --git a/pc-bios/petalogix-ml605.dts b/pc-bios/dtb/petalogix-ml605.dts
>similarity index 100%
>rename from pc-bios/petalogix-ml605.dts
>rename to pc-bios/dtb/petalogix-ml605.dts
>diff --git a/pc-bios/petalogix-s3adsp1800.dtb b/pc-bios/dtb/petalogix-s3adsp1800.dtb
>similarity index 100%
>rename from pc-bios/petalogix-s3adsp1800.dtb
>rename to pc-bios/dtb/petalogix-s3adsp1800.dtb
>diff --git a/pc-bios/petalogix-s3adsp1800.dts b/pc-bios/dtb/petalogix-s3adsp1800.dts
>similarity index 100%
>rename from pc-bios/petalogix-s3adsp1800.dts
>rename to pc-bios/dtb/petalogix-s3adsp1800.dts
>diff --git a/pc-bios/meson.build b/pc-bios/meson.build
>index 34d6616c32b..34d8cc4f338 100644
>--- a/pc-bios/meson.build
>+++ b/pc-bios/meson.build
>@@ -86,31 +86,10 @@ blobs = [
>   'vof-nvram.bin',
> ]
> 
>-dtc = find_program('dtc', required: false)
>-foreach f : [
>-  'bamboo.dts',
>-  'canyonlands.dts',
>-  'petalogix-s3adsp1800.dts',
>-  'petalogix-ml605.dts',
>-]
>-  out = fs.replace_suffix(f, '.dtb')
>-  if dtc.found()
>-    custom_target(f,
>-        build_by_default: have_system,
>-        input: files(f),
>-        output: out,
>-        install: get_option('install_blobs'),
>-        install_dir: qemu_datadir,
>-        command: [ dtc, '-q', '-I', 'dts', '-O', 'dtb',
>-                        '-o', '@OUTPUT@', '@INPUT0@' ])
>-  else
>-    blobs += out
>-  endif
>-endforeach
>-
> if get_option('install_blobs')
>   install_data(blobs, install_dir: qemu_datadir)
> endif
> 
> subdir('descriptors')
>+subdir('dtb')
> subdir('keymaps')
>diff --git a/qemu.nsi b/qemu.nsi
>index b186f223e14..d419986ca06 100644
>--- a/qemu.nsi
>+++ b/qemu.nsi
>@@ -204,7 +204,6 @@ Section "Uninstall"
>     Delete "$INSTDIR\*.bmp"
>     Delete "$INSTDIR\*.bin"
>     Delete "$INSTDIR\*.dll"
>-    Delete "$INSTDIR\*.dtb"
>     Delete "$INSTDIR\*.fd"
>     Delete "$INSTDIR\*.img"
>     Delete "$INSTDIR\*.lid"
>@@ -215,6 +214,7 @@ Section "Uninstall"
>     Delete "$INSTDIR\qemu-io.exe"
>     Delete "$INSTDIR\qemu.exe"
>     Delete "$INSTDIR\qemu-system-*.exe"
>+    RMDir /r "$INSTDIR\dtb"
>     RMDir /r "$INSTDIR\doc"
>     RMDir /r "$INSTDIR\share"
>     ; Remove generated files
Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir
Posted by BALATON Zoltan 8 months, 2 weeks ago
On Thu, 29 May 2025, Bernhard Beschow wrote:
> Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>> From: BALATON Zoltan <balaton@eik.bme.hu>
>>
>> We have several device tree files already and may have more in the
>> future so add a new dtb subdirectory and move device tree files there
>> so they are not mixed with ROM binaries.
>>
>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> MAINTAINERS                                |   2 +-
>> system/datadir.c                           |   4 +++-
>> pc-bios/{ => dtb}/bamboo.dtb               | Bin
>> pc-bios/{ => dtb}/bamboo.dts               |   0
>> pc-bios/{ => dtb}/canyonlands.dtb          | Bin
>> pc-bios/{ => dtb}/canyonlands.dts          |   0
>> pc-bios/dtb/meson.build                    |  23 +++++++++++++++++++++
>> pc-bios/{ => dtb}/petalogix-ml605.dtb      | Bin
>> pc-bios/{ => dtb}/petalogix-ml605.dts      |   0
>> pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb | Bin
>> pc-bios/{ => dtb}/petalogix-s3adsp1800.dts |   0
>> pc-bios/meson.build                        |  23 +--------------------
>> qemu.nsi                                   |   2 +-
>> 13 files changed, 29 insertions(+), 25 deletions(-)
>> rename pc-bios/{ => dtb}/bamboo.dtb (100%)
>> rename pc-bios/{ => dtb}/bamboo.dts (100%)
>> rename pc-bios/{ => dtb}/canyonlands.dtb (100%)
>> rename pc-bios/{ => dtb}/canyonlands.dts (100%)
>> create mode 100644 pc-bios/dtb/meson.build
>> rename pc-bios/{ => dtb}/petalogix-ml605.dtb (100%)
>> rename pc-bios/{ => dtb}/petalogix-ml605.dts (100%)
>> rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb (100%)
>> rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dts (100%)
>>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index 661a47db5ac..d82d962f1a4 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -1581,7 +1581,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/canyonlands.dt[sb]
>> +F: pc-bios/dtb/canyonlands.dt[sb]
>> F: pc-bios/u-boot-sam460ex-20100605.bin
>> F: roms/u-boot-sam460ex
>> F: docs/system/ppc/amigang.rst
>> diff --git a/system/datadir.c b/system/datadir.c
>> index e450b84ce91..f96f8fc2646 100644
>> --- a/system/datadir.c
>> +++ b/system/datadir.c
>> @@ -44,9 +44,11 @@ char *qemu_find_file(QemuFileType type, const char *name)
>>
>>     switch (type) {
>>     case QEMU_FILE_TYPE_BIOS:
>> -    case QEMU_FILE_TYPE_DTB:
>>         subdir = "";
>>         break;
>> +    case QEMU_FILE_TYPE_DTB:
>> +        subdir = "dtb/";
>> +        break;
>>     case QEMU_FILE_TYPE_KEYMAP:
>>         subdir = "keymaps/";
>>         break;
>> diff --git a/pc-bios/bamboo.dtb b/pc-bios/dtb/bamboo.dtb
>> similarity index 100%
>> rename from pc-bios/bamboo.dtb
>> rename to pc-bios/dtb/bamboo.dtb
>> diff --git a/pc-bios/bamboo.dts b/pc-bios/dtb/bamboo.dts
>> similarity index 100%
>> rename from pc-bios/bamboo.dts
>> rename to pc-bios/dtb/bamboo.dts
>> diff --git a/pc-bios/canyonlands.dtb b/pc-bios/dtb/canyonlands.dtb
>> similarity index 100%
>> rename from pc-bios/canyonlands.dtb
>> rename to pc-bios/dtb/canyonlands.dtb
>> diff --git a/pc-bios/canyonlands.dts b/pc-bios/dtb/canyonlands.dts
>> similarity index 100%
>> rename from pc-bios/canyonlands.dts
>> rename to pc-bios/dtb/canyonlands.dts
>> diff --git a/pc-bios/dtb/meson.build b/pc-bios/dtb/meson.build
>> new file mode 100644
>> index 00000000000..7a71835bca7
>> --- /dev/null
>> +++ b/pc-bios/dtb/meson.build
>> @@ -0,0 +1,23 @@
>> +dtbs = [
>> +  'bamboo.dtb',
>> +  'canyonlands.dtb',
>> +  'petalogix-ml605.dtb',
>> +  'petalogix-s3adsp1800.dtb',
>
> Was it intended that the suffix changed from .dts to .dtb? This change 
> isn't motivated in the commit message and usually source files rather 
> than generated artifacts are listed in build files.

I think I either found similar python code somewhere and followed that 
because meson and python is not something I understand well. Or changed it 
because we always need the list of dtbs to install but only need the dts 
when compiling so this way we don't need another list or replacing suffix 
twice.

Regards,
BALATON Zoltan
Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir
Posted by Philippe Mathieu-Daudé 8 months, 1 week ago
On 30/5/25 02:54, BALATON Zoltan wrote:
> On Thu, 29 May 2025, Bernhard Beschow wrote:
>> Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" 
>> <philmd@linaro.org>:
>>> From: BALATON Zoltan <balaton@eik.bme.hu>
>>>
>>> We have several device tree files already and may have more in the
>>> future so add a new dtb subdirectory and move device tree files there
>>> so they are not mixed with ROM binaries.
>>>
>>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>> Message-ID: 
>>> <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>> ---
>>> MAINTAINERS                                |   2 +-
>>> system/datadir.c                           |   4 +++-
>>> pc-bios/{ => dtb}/bamboo.dtb               | Bin
>>> pc-bios/{ => dtb}/bamboo.dts               |   0
>>> pc-bios/{ => dtb}/canyonlands.dtb          | Bin
>>> pc-bios/{ => dtb}/canyonlands.dts          |   0
>>> pc-bios/dtb/meson.build                    |  23 +++++++++++++++++++++
>>> pc-bios/{ => dtb}/petalogix-ml605.dtb      | Bin
>>> pc-bios/{ => dtb}/petalogix-ml605.dts      |   0
>>> pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb | Bin
>>> pc-bios/{ => dtb}/petalogix-s3adsp1800.dts |   0
>>> pc-bios/meson.build                        |  23 +--------------------
>>> qemu.nsi                                   |   2 +-
>>> 13 files changed, 29 insertions(+), 25 deletions(-)
>>> rename pc-bios/{ => dtb}/bamboo.dtb (100%)
>>> rename pc-bios/{ => dtb}/bamboo.dts (100%)
>>> rename pc-bios/{ => dtb}/canyonlands.dtb (100%)
>>> rename pc-bios/{ => dtb}/canyonlands.dts (100%)
>>> create mode 100644 pc-bios/dtb/meson.build
>>> rename pc-bios/{ => dtb}/petalogix-ml605.dtb (100%)
>>> rename pc-bios/{ => dtb}/petalogix-ml605.dts (100%)
>>> rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb (100%)
>>> rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dts (100%)
>>>
>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>> index 661a47db5ac..d82d962f1a4 100644
>>> --- a/MAINTAINERS
>>> +++ b/MAINTAINERS
>>> @@ -1581,7 +1581,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/canyonlands.dt[sb]
>>> +F: pc-bios/dtb/canyonlands.dt[sb]
>>> F: pc-bios/u-boot-sam460ex-20100605.bin
>>> F: roms/u-boot-sam460ex
>>> F: docs/system/ppc/amigang.rst
>>> diff --git a/system/datadir.c b/system/datadir.c
>>> index e450b84ce91..f96f8fc2646 100644
>>> --- a/system/datadir.c
>>> +++ b/system/datadir.c
>>> @@ -44,9 +44,11 @@ char *qemu_find_file(QemuFileType type, const char 
>>> *name)
>>>
>>>     switch (type) {
>>>     case QEMU_FILE_TYPE_BIOS:
>>> -    case QEMU_FILE_TYPE_DTB:
>>>         subdir = "";
>>>         break;
>>> +    case QEMU_FILE_TYPE_DTB:
>>> +        subdir = "dtb/";
>>> +        break;
>>>     case QEMU_FILE_TYPE_KEYMAP:
>>>         subdir = "keymaps/";
>>>         break;
>>> diff --git a/pc-bios/bamboo.dtb b/pc-bios/dtb/bamboo.dtb
>>> similarity index 100%
>>> rename from pc-bios/bamboo.dtb
>>> rename to pc-bios/dtb/bamboo.dtb
>>> diff --git a/pc-bios/bamboo.dts b/pc-bios/dtb/bamboo.dts
>>> similarity index 100%
>>> rename from pc-bios/bamboo.dts
>>> rename to pc-bios/dtb/bamboo.dts
>>> diff --git a/pc-bios/canyonlands.dtb b/pc-bios/dtb/canyonlands.dtb
>>> similarity index 100%
>>> rename from pc-bios/canyonlands.dtb
>>> rename to pc-bios/dtb/canyonlands.dtb
>>> diff --git a/pc-bios/canyonlands.dts b/pc-bios/dtb/canyonlands.dts
>>> similarity index 100%
>>> rename from pc-bios/canyonlands.dts
>>> rename to pc-bios/dtb/canyonlands.dts
>>> diff --git a/pc-bios/dtb/meson.build b/pc-bios/dtb/meson.build
>>> new file mode 100644
>>> index 00000000000..7a71835bca7
>>> --- /dev/null
>>> +++ b/pc-bios/dtb/meson.build
>>> @@ -0,0 +1,23 @@
>>> +dtbs = [
>>> +  'bamboo.dtb',
>>> +  'canyonlands.dtb',
>>> +  'petalogix-ml605.dtb',
>>> +  'petalogix-s3adsp1800.dtb',
>>
>> Was it intended that the suffix changed from .dts to .dtb? This change 
>> isn't motivated in the commit message and usually source files rather 
>> than generated artifacts are listed in build files.
> 
> I think I either found similar python code somewhere and followed that 
> because meson and python is not something I understand well. Or changed 
> it because we always need the list of dtbs to install but only need the 
> dts when compiling so this way we don't need another list or replacing 
> suffix twice.

Should we revert?

Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir
Posted by Bernhard Beschow 8 months, 1 week ago

Am 2. Juni 2025 08:12:39 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>On 30/5/25 02:54, BALATON Zoltan wrote:
>> On Thu, 29 May 2025, Bernhard Beschow wrote:
>>> Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>>>> From: BALATON Zoltan <balaton@eik.bme.hu>
>>>> 
>>>> We have several device tree files already and may have more in the
>>>> future so add a new dtb subdirectory and move device tree files there
>>>> so they are not mixed with ROM binaries.
>>>> 
>>>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>> Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>
>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>> ---
>>>> MAINTAINERS                                |   2 +-
>>>> system/datadir.c                           |   4 +++-
>>>> pc-bios/{ => dtb}/bamboo.dtb               | Bin
>>>> pc-bios/{ => dtb}/bamboo.dts               |   0
>>>> pc-bios/{ => dtb}/canyonlands.dtb          | Bin
>>>> pc-bios/{ => dtb}/canyonlands.dts          |   0
>>>> pc-bios/dtb/meson.build                    |  23 +++++++++++++++++++++
>>>> pc-bios/{ => dtb}/petalogix-ml605.dtb      | Bin
>>>> pc-bios/{ => dtb}/petalogix-ml605.dts      |   0
>>>> pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb | Bin
>>>> pc-bios/{ => dtb}/petalogix-s3adsp1800.dts |   0
>>>> pc-bios/meson.build                        |  23 +--------------------
>>>> qemu.nsi                                   |   2 +-
>>>> 13 files changed, 29 insertions(+), 25 deletions(-)
>>>> rename pc-bios/{ => dtb}/bamboo.dtb (100%)
>>>> rename pc-bios/{ => dtb}/bamboo.dts (100%)
>>>> rename pc-bios/{ => dtb}/canyonlands.dtb (100%)
>>>> rename pc-bios/{ => dtb}/canyonlands.dts (100%)
>>>> create mode 100644 pc-bios/dtb/meson.build
>>>> rename pc-bios/{ => dtb}/petalogix-ml605.dtb (100%)
>>>> rename pc-bios/{ => dtb}/petalogix-ml605.dts (100%)
>>>> rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb (100%)
>>>> rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dts (100%)
>>>> 
>>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>>> index 661a47db5ac..d82d962f1a4 100644
>>>> --- a/MAINTAINERS
>>>> +++ b/MAINTAINERS
>>>> @@ -1581,7 +1581,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/canyonlands.dt[sb]
>>>> +F: pc-bios/dtb/canyonlands.dt[sb]
>>>> F: pc-bios/u-boot-sam460ex-20100605.bin
>>>> F: roms/u-boot-sam460ex
>>>> F: docs/system/ppc/amigang.rst
>>>> diff --git a/system/datadir.c b/system/datadir.c
>>>> index e450b84ce91..f96f8fc2646 100644
>>>> --- a/system/datadir.c
>>>> +++ b/system/datadir.c
>>>> @@ -44,9 +44,11 @@ char *qemu_find_file(QemuFileType type, const char *name)
>>>> 
>>>>     switch (type) {
>>>>     case QEMU_FILE_TYPE_BIOS:
>>>> -    case QEMU_FILE_TYPE_DTB:
>>>>         subdir = "";
>>>>         break;
>>>> +    case QEMU_FILE_TYPE_DTB:
>>>> +        subdir = "dtb/";
>>>> +        break;
>>>>     case QEMU_FILE_TYPE_KEYMAP:
>>>>         subdir = "keymaps/";
>>>>         break;
>>>> diff --git a/pc-bios/bamboo.dtb b/pc-bios/dtb/bamboo.dtb
>>>> similarity index 100%
>>>> rename from pc-bios/bamboo.dtb
>>>> rename to pc-bios/dtb/bamboo.dtb
>>>> diff --git a/pc-bios/bamboo.dts b/pc-bios/dtb/bamboo.dts
>>>> similarity index 100%
>>>> rename from pc-bios/bamboo.dts
>>>> rename to pc-bios/dtb/bamboo.dts
>>>> diff --git a/pc-bios/canyonlands.dtb b/pc-bios/dtb/canyonlands.dtb
>>>> similarity index 100%
>>>> rename from pc-bios/canyonlands.dtb
>>>> rename to pc-bios/dtb/canyonlands.dtb
>>>> diff --git a/pc-bios/canyonlands.dts b/pc-bios/dtb/canyonlands.dts
>>>> similarity index 100%
>>>> rename from pc-bios/canyonlands.dts
>>>> rename to pc-bios/dtb/canyonlands.dts
>>>> diff --git a/pc-bios/dtb/meson.build b/pc-bios/dtb/meson.build
>>>> new file mode 100644
>>>> index 00000000000..7a71835bca7
>>>> --- /dev/null
>>>> +++ b/pc-bios/dtb/meson.build
>>>> @@ -0,0 +1,23 @@
>>>> +dtbs = [
>>>> +  'bamboo.dtb',
>>>> +  'canyonlands.dtb',
>>>> +  'petalogix-ml605.dtb',
>>>> +  'petalogix-s3adsp1800.dtb',
>>> 
>>> Was it intended that the suffix changed from .dts to .dtb? This change isn't motivated in the commit message and usually source files rather than generated artifacts are listed in build files.
>> 
>> I think I either found similar python code somewhere and followed that because meson and python is not something I understand well. Or changed it because we always need the list of dtbs to install but only need the dts when compiling so this way we don't need another list or replacing suffix twice.
>
>Should we revert?

What's the idea behind having dtbs in the repository instead of making dtc mandatory? If there is any perspective that we could remove the dtbs in the future I vote for restoring the original logic. I could send a patch since I have further dtb fixes for the e500 and arm.

Best regards,
Bernhard
Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir
Posted by BALATON Zoltan 8 months, 1 week ago
On Tue, 3 Jun 2025, Bernhard Beschow wrote:
> Am 2. Juni 2025 08:12:39 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>> On 30/5/25 02:54, BALATON Zoltan wrote:
>>> On Thu, 29 May 2025, Bernhard Beschow wrote:
>>>> Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>>>>> From: BALATON Zoltan <balaton@eik.bme.hu>
>>>>>
>>>>> We have several device tree files already and may have more in the
>>>>> future so add a new dtb subdirectory and move device tree files there
>>>>> so they are not mixed with ROM binaries.
>>>>>
>>>>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>>>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>>> Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>
>>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>>> ---
>>>>> MAINTAINERS                                |   2 +-
>>>>> system/datadir.c                           |   4 +++-
>>>>> pc-bios/{ => dtb}/bamboo.dtb               | Bin
>>>>> pc-bios/{ => dtb}/bamboo.dts               |   0
>>>>> pc-bios/{ => dtb}/canyonlands.dtb          | Bin
>>>>> pc-bios/{ => dtb}/canyonlands.dts          |   0
>>>>> pc-bios/dtb/meson.build                    |  23 +++++++++++++++++++++
>>>>> pc-bios/{ => dtb}/petalogix-ml605.dtb      | Bin
>>>>> pc-bios/{ => dtb}/petalogix-ml605.dts      |   0
>>>>> pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb | Bin
>>>>> pc-bios/{ => dtb}/petalogix-s3adsp1800.dts |   0
>>>>> pc-bios/meson.build                        |  23 +--------------------
>>>>> qemu.nsi                                   |   2 +-
>>>>> 13 files changed, 29 insertions(+), 25 deletions(-)
>>>>> rename pc-bios/{ => dtb}/bamboo.dtb (100%)
>>>>> rename pc-bios/{ => dtb}/bamboo.dts (100%)
>>>>> rename pc-bios/{ => dtb}/canyonlands.dtb (100%)
>>>>> rename pc-bios/{ => dtb}/canyonlands.dts (100%)
>>>>> create mode 100644 pc-bios/dtb/meson.build
>>>>> rename pc-bios/{ => dtb}/petalogix-ml605.dtb (100%)
>>>>> rename pc-bios/{ => dtb}/petalogix-ml605.dts (100%)
>>>>> rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb (100%)
>>>>> rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dts (100%)
>>>>>
>>>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>>>> index 661a47db5ac..d82d962f1a4 100644
>>>>> --- a/MAINTAINERS
>>>>> +++ b/MAINTAINERS
>>>>> @@ -1581,7 +1581,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/canyonlands.dt[sb]
>>>>> +F: pc-bios/dtb/canyonlands.dt[sb]
>>>>> F: pc-bios/u-boot-sam460ex-20100605.bin
>>>>> F: roms/u-boot-sam460ex
>>>>> F: docs/system/ppc/amigang.rst
>>>>> diff --git a/system/datadir.c b/system/datadir.c
>>>>> index e450b84ce91..f96f8fc2646 100644
>>>>> --- a/system/datadir.c
>>>>> +++ b/system/datadir.c
>>>>> @@ -44,9 +44,11 @@ char *qemu_find_file(QemuFileType type, const char *name)
>>>>>
>>>>>     switch (type) {
>>>>>     case QEMU_FILE_TYPE_BIOS:
>>>>> -    case QEMU_FILE_TYPE_DTB:
>>>>>         subdir = "";
>>>>>         break;
>>>>> +    case QEMU_FILE_TYPE_DTB:
>>>>> +        subdir = "dtb/";
>>>>> +        break;
>>>>>     case QEMU_FILE_TYPE_KEYMAP:
>>>>>         subdir = "keymaps/";
>>>>>         break;
>>>>> diff --git a/pc-bios/bamboo.dtb b/pc-bios/dtb/bamboo.dtb
>>>>> similarity index 100%
>>>>> rename from pc-bios/bamboo.dtb
>>>>> rename to pc-bios/dtb/bamboo.dtb
>>>>> diff --git a/pc-bios/bamboo.dts b/pc-bios/dtb/bamboo.dts
>>>>> similarity index 100%
>>>>> rename from pc-bios/bamboo.dts
>>>>> rename to pc-bios/dtb/bamboo.dts
>>>>> diff --git a/pc-bios/canyonlands.dtb b/pc-bios/dtb/canyonlands.dtb
>>>>> similarity index 100%
>>>>> rename from pc-bios/canyonlands.dtb
>>>>> rename to pc-bios/dtb/canyonlands.dtb
>>>>> diff --git a/pc-bios/canyonlands.dts b/pc-bios/dtb/canyonlands.dts
>>>>> similarity index 100%
>>>>> rename from pc-bios/canyonlands.dts
>>>>> rename to pc-bios/dtb/canyonlands.dts
>>>>> diff --git a/pc-bios/dtb/meson.build b/pc-bios/dtb/meson.build
>>>>> new file mode 100644
>>>>> index 00000000000..7a71835bca7
>>>>> --- /dev/null
>>>>> +++ b/pc-bios/dtb/meson.build
>>>>> @@ -0,0 +1,23 @@
>>>>> +dtbs = [
>>>>> +  'bamboo.dtb',
>>>>> +  'canyonlands.dtb',
>>>>> +  'petalogix-ml605.dtb',
>>>>> +  'petalogix-s3adsp1800.dtb',
>>>>
>>>> Was it intended that the suffix changed from .dts to .dtb? This change isn't motivated in the commit message and usually source files rather than generated artifacts are listed in build files.
>>>
>>> I think I either found similar python code somewhere and followed that because meson and python is not something I understand well. Or changed it because we always need the list of dtbs to install but only need the dts when compiling so this way we don't need another list or replacing suffix twice.
>>
>> Should we revert?
>
> What's the idea behind having dtbs in the repository instead of making 
> dtc mandatory? If there is any perspective that we could remove the dtbs 
> in the future I vote for restoring the original logic. I could send a 
> patch since I have further dtb fixes for the e500 and arm.

This patch did not change that, dtbs were already there so this is a 
proposed unrelated further change. Reverting the patch leaves you with dtb 
and dts files mixed with rom binaries. This patch only aimed to separate 
device tree files from rom binaries. So you're nitpicking if the array in 
the makefile should list dts or dtb files while both of them are there so 
I don't think it matters much which are listed. Dtbs are used when dtc is 
not found and only installing pre-built files while list of dts is only 
needed when building from dts and it is easy to replace the extension so 
if you want we can change it to list dts at the expense of adding one 
extra line to make the dtb array without dtc. I saved that one line by 
listing dtbs.

Now you propose another change to drop dtbs and always build from dts. I'm 
not against that but that's not related to this patch. I think dtbs were 
included for convenience so we don't need dtc.

Regards,
BALATON Zoltan
Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir
Posted by Thomas Huth 8 months, 1 week ago
On 03/06/2025 08.39, Bernhard Beschow wrote:
> 
> 
> Am 2. Juni 2025 08:12:39 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>> On 30/5/25 02:54, BALATON Zoltan wrote:
>>> On Thu, 29 May 2025, Bernhard Beschow wrote:
>>>> Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>>>>> From: BALATON Zoltan <balaton@eik.bme.hu>
>>>>>
>>>>> We have several device tree files already and may have more in the
>>>>> future so add a new dtb subdirectory and move device tree files there
>>>>> so they are not mixed with ROM binaries.
>>>>>
>>>>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>>>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>>> Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>
>>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>>> ---
>>>>> MAINTAINERS                                |   2 +-
>>>>> system/datadir.c                           |   4 +++-
>>>>> pc-bios/{ => dtb}/bamboo.dtb               | Bin
>>>>> pc-bios/{ => dtb}/bamboo.dts               |   0
>>>>> pc-bios/{ => dtb}/canyonlands.dtb          | Bin
>>>>> pc-bios/{ => dtb}/canyonlands.dts          |   0
>>>>> pc-bios/dtb/meson.build                    |  23 +++++++++++++++++++++
>>>>> pc-bios/{ => dtb}/petalogix-ml605.dtb      | Bin
>>>>> pc-bios/{ => dtb}/petalogix-ml605.dts      |   0
>>>>> pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb | Bin
>>>>> pc-bios/{ => dtb}/petalogix-s3adsp1800.dts |   0
>>>>> pc-bios/meson.build                        |  23 +--------------------
>>>>> qemu.nsi                                   |   2 +-
>>>>> 13 files changed, 29 insertions(+), 25 deletions(-)
>>>>> rename pc-bios/{ => dtb}/bamboo.dtb (100%)
>>>>> rename pc-bios/{ => dtb}/bamboo.dts (100%)
>>>>> rename pc-bios/{ => dtb}/canyonlands.dtb (100%)
>>>>> rename pc-bios/{ => dtb}/canyonlands.dts (100%)
>>>>> create mode 100644 pc-bios/dtb/meson.build
>>>>> rename pc-bios/{ => dtb}/petalogix-ml605.dtb (100%)
>>>>> rename pc-bios/{ => dtb}/petalogix-ml605.dts (100%)
>>>>> rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb (100%)
>>>>> rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dts (100%)
>>>>>
>>>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>>>> index 661a47db5ac..d82d962f1a4 100644
>>>>> --- a/MAINTAINERS
>>>>> +++ b/MAINTAINERS
>>>>> @@ -1581,7 +1581,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/canyonlands.dt[sb]
>>>>> +F: pc-bios/dtb/canyonlands.dt[sb]
>>>>> F: pc-bios/u-boot-sam460ex-20100605.bin
>>>>> F: roms/u-boot-sam460ex
>>>>> F: docs/system/ppc/amigang.rst
>>>>> diff --git a/system/datadir.c b/system/datadir.c
>>>>> index e450b84ce91..f96f8fc2646 100644
>>>>> --- a/system/datadir.c
>>>>> +++ b/system/datadir.c
>>>>> @@ -44,9 +44,11 @@ char *qemu_find_file(QemuFileType type, const char *name)
>>>>>
>>>>>      switch (type) {
>>>>>      case QEMU_FILE_TYPE_BIOS:
>>>>> -    case QEMU_FILE_TYPE_DTB:
>>>>>          subdir = "";
>>>>>          break;
>>>>> +    case QEMU_FILE_TYPE_DTB:
>>>>> +        subdir = "dtb/";
>>>>> +        break;
>>>>>      case QEMU_FILE_TYPE_KEYMAP:
>>>>>          subdir = "keymaps/";
>>>>>          break;
>>>>> diff --git a/pc-bios/bamboo.dtb b/pc-bios/dtb/bamboo.dtb
>>>>> similarity index 100%
>>>>> rename from pc-bios/bamboo.dtb
>>>>> rename to pc-bios/dtb/bamboo.dtb
>>>>> diff --git a/pc-bios/bamboo.dts b/pc-bios/dtb/bamboo.dts
>>>>> similarity index 100%
>>>>> rename from pc-bios/bamboo.dts
>>>>> rename to pc-bios/dtb/bamboo.dts
>>>>> diff --git a/pc-bios/canyonlands.dtb b/pc-bios/dtb/canyonlands.dtb
>>>>> similarity index 100%
>>>>> rename from pc-bios/canyonlands.dtb
>>>>> rename to pc-bios/dtb/canyonlands.dtb
>>>>> diff --git a/pc-bios/canyonlands.dts b/pc-bios/dtb/canyonlands.dts
>>>>> similarity index 100%
>>>>> rename from pc-bios/canyonlands.dts
>>>>> rename to pc-bios/dtb/canyonlands.dts
>>>>> diff --git a/pc-bios/dtb/meson.build b/pc-bios/dtb/meson.build
>>>>> new file mode 100644
>>>>> index 00000000000..7a71835bca7
>>>>> --- /dev/null
>>>>> +++ b/pc-bios/dtb/meson.build
>>>>> @@ -0,0 +1,23 @@
>>>>> +dtbs = [
>>>>> +  'bamboo.dtb',
>>>>> +  'canyonlands.dtb',
>>>>> +  'petalogix-ml605.dtb',
>>>>> +  'petalogix-s3adsp1800.dtb',
>>>>
>>>> Was it intended that the suffix changed from .dts to .dtb? This change isn't motivated in the commit message and usually source files rather than generated artifacts are listed in build files.
>>>
>>> I think I either found similar python code somewhere and followed that because meson and python is not something I understand well. Or changed it because we always need the list of dtbs to install but only need the dts when compiling so this way we don't need another list or replacing suffix twice.
>>
>> Should we revert?
> 
> What's the idea behind having dtbs in the repository instead of making dtc mandatory? If there is any perspective that we could remove the dtbs in the future I vote for restoring the original logic. I could send a patch since I have further dtb fixes for the e500 and arm.

IMHO since we require libfdt for many boards already anyway, we could also 
require dtc for these boards that need a dtb (and disable them if dtc is not 
available) ... we just might need some additional Kconfig symbol for that 
case since dtc and libfdt are sometimes shipped in different packages on the 
various distros and thus could be installed independently from each other.

  Thomas


Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir
Posted by BALATON Zoltan 8 months, 1 week ago
On Mon, 2 Jun 2025, Philippe Mathieu-Daudé wrote:
> On 30/5/25 02:54, BALATON Zoltan wrote:
>> On Thu, 29 May 2025, Bernhard Beschow wrote:
>>> Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" 
>>> <philmd@linaro.org>:
>>>> From: BALATON Zoltan <balaton@eik.bme.hu>
>>>> 
>>>> We have several device tree files already and may have more in the
>>>> future so add a new dtb subdirectory and move device tree files there
>>>> so they are not mixed with ROM binaries.
>>>> 
>>>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>> Message-ID: 
>>>> <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>
>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>> ---
>>>> MAINTAINERS                                |   2 +-
>>>> system/datadir.c                           |   4 +++-
>>>> pc-bios/{ => dtb}/bamboo.dtb               | Bin
>>>> pc-bios/{ => dtb}/bamboo.dts               |   0
>>>> pc-bios/{ => dtb}/canyonlands.dtb          | Bin
>>>> pc-bios/{ => dtb}/canyonlands.dts          |   0
>>>> pc-bios/dtb/meson.build                    |  23 +++++++++++++++++++++
>>>> pc-bios/{ => dtb}/petalogix-ml605.dtb      | Bin
>>>> pc-bios/{ => dtb}/petalogix-ml605.dts      |   0
>>>> pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb | Bin
>>>> pc-bios/{ => dtb}/petalogix-s3adsp1800.dts |   0
>>>> pc-bios/meson.build                        |  23 +--------------------
>>>> qemu.nsi                                   |   2 +-
>>>> 13 files changed, 29 insertions(+), 25 deletions(-)
>>>> rename pc-bios/{ => dtb}/bamboo.dtb (100%)
>>>> rename pc-bios/{ => dtb}/bamboo.dts (100%)
>>>> rename pc-bios/{ => dtb}/canyonlands.dtb (100%)
>>>> rename pc-bios/{ => dtb}/canyonlands.dts (100%)
>>>> create mode 100644 pc-bios/dtb/meson.build
>>>> rename pc-bios/{ => dtb}/petalogix-ml605.dtb (100%)
>>>> rename pc-bios/{ => dtb}/petalogix-ml605.dts (100%)
>>>> rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb (100%)
>>>> rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dts (100%)
>>>> 
>>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>>> index 661a47db5ac..d82d962f1a4 100644
>>>> --- a/MAINTAINERS
>>>> +++ b/MAINTAINERS
>>>> @@ -1581,7 +1581,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/canyonlands.dt[sb]
>>>> +F: pc-bios/dtb/canyonlands.dt[sb]
>>>> F: pc-bios/u-boot-sam460ex-20100605.bin
>>>> F: roms/u-boot-sam460ex
>>>> F: docs/system/ppc/amigang.rst
>>>> diff --git a/system/datadir.c b/system/datadir.c
>>>> index e450b84ce91..f96f8fc2646 100644
>>>> --- a/system/datadir.c
>>>> +++ b/system/datadir.c
>>>> @@ -44,9 +44,11 @@ char *qemu_find_file(QemuFileType type, const char 
>>>> *name)
>>>> 
>>>>     switch (type) {
>>>>     case QEMU_FILE_TYPE_BIOS:
>>>> -    case QEMU_FILE_TYPE_DTB:
>>>>         subdir = "";
>>>>         break;
>>>> +    case QEMU_FILE_TYPE_DTB:
>>>> +        subdir = "dtb/";
>>>> +        break;
>>>>     case QEMU_FILE_TYPE_KEYMAP:
>>>>         subdir = "keymaps/";
>>>>         break;
>>>> diff --git a/pc-bios/bamboo.dtb b/pc-bios/dtb/bamboo.dtb
>>>> similarity index 100%
>>>> rename from pc-bios/bamboo.dtb
>>>> rename to pc-bios/dtb/bamboo.dtb
>>>> diff --git a/pc-bios/bamboo.dts b/pc-bios/dtb/bamboo.dts
>>>> similarity index 100%
>>>> rename from pc-bios/bamboo.dts
>>>> rename to pc-bios/dtb/bamboo.dts
>>>> diff --git a/pc-bios/canyonlands.dtb b/pc-bios/dtb/canyonlands.dtb
>>>> similarity index 100%
>>>> rename from pc-bios/canyonlands.dtb
>>>> rename to pc-bios/dtb/canyonlands.dtb
>>>> diff --git a/pc-bios/canyonlands.dts b/pc-bios/dtb/canyonlands.dts
>>>> similarity index 100%
>>>> rename from pc-bios/canyonlands.dts
>>>> rename to pc-bios/dtb/canyonlands.dts
>>>> diff --git a/pc-bios/dtb/meson.build b/pc-bios/dtb/meson.build
>>>> new file mode 100644
>>>> index 00000000000..7a71835bca7
>>>> --- /dev/null
>>>> +++ b/pc-bios/dtb/meson.build
>>>> @@ -0,0 +1,23 @@
>>>> +dtbs = [
>>>> +  'bamboo.dtb',
>>>> +  'canyonlands.dtb',
>>>> +  'petalogix-ml605.dtb',
>>>> +  'petalogix-s3adsp1800.dtb',
>>> 
>>> Was it intended that the suffix changed from .dts to .dtb? This change 
>>> isn't motivated in the commit message and usually source files rather than 
>>> generated artifacts are listed in build files.
>> 
>> I think I either found similar python code somewhere and followed that 
>> because meson and python is not something I understand well. Or changed it 
>> because we always need the list of dtbs to install but only need the dts 
>> when compiling so this way we don't need another list or replacing suffix 
>> twice.
>
> Should we revert?

Why? It works just lists the build targets instead of source files to 
avoid converting between the two twice. So what it does was not contested 
only the way it was implemented had a nit. I don't think this is worth 
changing because of that.

Regards,
BALATON Zoltan
Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir
Posted by Philippe Mathieu-Daudé 8 months, 1 week ago
On 2/6/25 13:56, BALATON Zoltan wrote:
> On Mon, 2 Jun 2025, Philippe Mathieu-Daudé wrote:
>> On 30/5/25 02:54, BALATON Zoltan wrote:
>>> On Thu, 29 May 2025, Bernhard Beschow wrote:
>>>> Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" 
>>>> <philmd@linaro.org>:
>>>>> From: BALATON Zoltan <balaton@eik.bme.hu>
>>>>>
>>>>> We have several device tree files already and may have more in the
>>>>> future so add a new dtb subdirectory and move device tree files there
>>>>> so they are not mixed with ROM binaries.
>>>>>
>>>>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>>>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>>> Message-ID: 
>>>>> <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>
>>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>>> ---
>>>>> MAINTAINERS                                |   2 +-
>>>>> system/datadir.c                           |   4 +++-
>>>>> pc-bios/{ => dtb}/bamboo.dtb               | Bin
>>>>> pc-bios/{ => dtb}/bamboo.dts               |   0
>>>>> pc-bios/{ => dtb}/canyonlands.dtb          | Bin
>>>>> pc-bios/{ => dtb}/canyonlands.dts          |   0
>>>>> pc-bios/dtb/meson.build                    |  23 +++++++++++++++++++++
>>>>> pc-bios/{ => dtb}/petalogix-ml605.dtb      | Bin
>>>>> pc-bios/{ => dtb}/petalogix-ml605.dts      |   0
>>>>> pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb | Bin
>>>>> pc-bios/{ => dtb}/petalogix-s3adsp1800.dts |   0
>>>>> pc-bios/meson.build                        |  23 +--------------------
>>>>> qemu.nsi                                   |   2 +-
>>>>> 13 files changed, 29 insertions(+), 25 deletions(-)
>>>>> rename pc-bios/{ => dtb}/bamboo.dtb (100%)
>>>>> rename pc-bios/{ => dtb}/bamboo.dts (100%)
>>>>> rename pc-bios/{ => dtb}/canyonlands.dtb (100%)
>>>>> rename pc-bios/{ => dtb}/canyonlands.dts (100%)
>>>>> create mode 100644 pc-bios/dtb/meson.build
>>>>> rename pc-bios/{ => dtb}/petalogix-ml605.dtb (100%)
>>>>> rename pc-bios/{ => dtb}/petalogix-ml605.dts (100%)
>>>>> rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb (100%)
>>>>> rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dts (100%)
>>>>>
>>>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>>>> index 661a47db5ac..d82d962f1a4 100644
>>>>> --- a/MAINTAINERS
>>>>> +++ b/MAINTAINERS
>>>>> @@ -1581,7 +1581,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/canyonlands.dt[sb]
>>>>> +F: pc-bios/dtb/canyonlands.dt[sb]
>>>>> F: pc-bios/u-boot-sam460ex-20100605.bin
>>>>> F: roms/u-boot-sam460ex
>>>>> F: docs/system/ppc/amigang.rst
>>>>> diff --git a/system/datadir.c b/system/datadir.c
>>>>> index e450b84ce91..f96f8fc2646 100644
>>>>> --- a/system/datadir.c
>>>>> +++ b/system/datadir.c
>>>>> @@ -44,9 +44,11 @@ char *qemu_find_file(QemuFileType type, const 
>>>>> char *name)
>>>>>
>>>>>     switch (type) {
>>>>>     case QEMU_FILE_TYPE_BIOS:
>>>>> -    case QEMU_FILE_TYPE_DTB:
>>>>>         subdir = "";
>>>>>         break;
>>>>> +    case QEMU_FILE_TYPE_DTB:
>>>>> +        subdir = "dtb/";
>>>>> +        break;
>>>>>     case QEMU_FILE_TYPE_KEYMAP:
>>>>>         subdir = "keymaps/";
>>>>>         break;
>>>>> diff --git a/pc-bios/bamboo.dtb b/pc-bios/dtb/bamboo.dtb
>>>>> similarity index 100%
>>>>> rename from pc-bios/bamboo.dtb
>>>>> rename to pc-bios/dtb/bamboo.dtb
>>>>> diff --git a/pc-bios/bamboo.dts b/pc-bios/dtb/bamboo.dts
>>>>> similarity index 100%
>>>>> rename from pc-bios/bamboo.dts
>>>>> rename to pc-bios/dtb/bamboo.dts
>>>>> diff --git a/pc-bios/canyonlands.dtb b/pc-bios/dtb/canyonlands.dtb
>>>>> similarity index 100%
>>>>> rename from pc-bios/canyonlands.dtb
>>>>> rename to pc-bios/dtb/canyonlands.dtb
>>>>> diff --git a/pc-bios/canyonlands.dts b/pc-bios/dtb/canyonlands.dts
>>>>> similarity index 100%
>>>>> rename from pc-bios/canyonlands.dts
>>>>> rename to pc-bios/dtb/canyonlands.dts
>>>>> diff --git a/pc-bios/dtb/meson.build b/pc-bios/dtb/meson.build
>>>>> new file mode 100644
>>>>> index 00000000000..7a71835bca7
>>>>> --- /dev/null
>>>>> +++ b/pc-bios/dtb/meson.build
>>>>> @@ -0,0 +1,23 @@
>>>>> +dtbs = [
>>>>> +  'bamboo.dtb',
>>>>> +  'canyonlands.dtb',
>>>>> +  'petalogix-ml605.dtb',
>>>>> +  'petalogix-s3adsp1800.dtb',
>>>>
>>>> Was it intended that the suffix changed from .dts to .dtb? This 
>>>> change isn't motivated in the commit message and usually source 
>>>> files rather than generated artifacts are listed in build files.
>>>
>>> I think I either found similar python code somewhere and followed 
>>> that because meson and python is not something I understand well. Or 
>>> changed it because we always need the list of dtbs to install but 
>>> only need the dts when compiling so this way we don't need another 
>>> list or replacing suffix twice.
>>
>> Should we revert?
> 
> Why? It works just lists the build targets instead of source files to 
> avoid converting between the two twice. So what it does was not 
> contested only the way it was implemented had a nit. I don't think this 
> is worth changing because of that.

Well, it is a hidden change that wasn't noticed during review.