diff mbox series

[2/2] pc-bios: Move device tree files in their own subdir

Message ID bb208aab670cc59bdb1f7ea67239e2b72884f317.1743262839.git.balaton@eik.bme.hu (mailing list archive)
State New
Headers show
Series Move device tree files in a subdir in pc-bios | expand

Commit Message

BALATON Zoltan March 29, 2025, 3:43 p.m. UTC
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>
---
 MAINTAINERS                                |   2 +-
 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 +--------------------
 system/datadir.c                           |   4 +++-
 12 files changed, 28 insertions(+), 24 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%)

Comments

Philippe Mathieu-Daudé March 31, 2025, 7:31 p.m. UTC | #1
+Stefan

On 29/3/25 16:43, BALATON Zoltan wrote:
> 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>
> ---
>   MAINTAINERS                                |   2 +-
>   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 +--------------------
>   system/datadir.c                           |   4 +++-
>   12 files changed, 28 insertions(+), 24 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 d54b5578f8..9349950527 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1569,7 +1569,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/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 0000000000..7a71835bca
> --- /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 34d6616c32..34d8cc4f33 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/system/datadir.c b/system/datadir.c
> index e450b84ce9..f96f8fc264 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;

Apparently we also need:

-- >8 --
diff --git a/qemu.nsi b/qemu.nsi
index b186f223e14..d419986ca06 100644
--- a/qemu.nsi
+++ b/qemu.nsi
@@ -206,3 +206,2 @@ Section "Uninstall"
      Delete "$INSTDIR\*.dll"
-    Delete "$INSTDIR\*.dtb"
      Delete "$INSTDIR\*.fd"
@@ -217,2 +216,3 @@ Section "Uninstall"
      Delete "$INSTDIR\qemu-system-*.exe"
+    RMDir /r "$INSTDIR\dtb"
      RMDir /r "$INSTDIR\doc"
---

Stefan, WDYT?
diff mbox series

Patch

diff --git a/MAINTAINERS b/MAINTAINERS
index d54b5578f8..9349950527 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1569,7 +1569,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/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 0000000000..7a71835bca
--- /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 34d6616c32..34d8cc4f33 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/system/datadir.c b/system/datadir.c
index e450b84ce9..f96f8fc264 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;