qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Move device tree files in a subdir in pc-bios
@ 2025-04-23 10:02 BALATON Zoltan
  2025-04-23 10:02 ` [PATCH v2 1/2] system/datadir: Add new type constant for DTB files BALATON Zoltan
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: BALATON Zoltan @ 2025-04-23 10:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Edgar E. Iglesias, Paolo Bonzini, Stefan Weil, philmd

Simple series doing what the subject says.

v2:
- Added changes to qemu.nsi (Philippe)
- Changed order of enum to keep it sorted. This changes value of
existing define but the value is not relevant, always used by name.

BALATON Zoltan (2):
  system/datadir: Add new type constant for DTB files
  pc-bios: Move device tree files in their own subdir

 MAINTAINERS                                |   2 +-
 hw/microblaze/boot.c                       |   2 +-
 hw/ppc/ppc440_bamboo.c                     |   2 +-
 hw/ppc/sam460ex.c                          |   2 +-
 hw/ppc/virtex_ml507.c                      |   2 +-
 include/qemu/datadir.h                     |  11 +++++++---
 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 +-
 system/datadir.c                           |   5 ++++-
 18 files changed, 42 insertions(+), 32 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%)

-- 
2.41.3



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

* [PATCH v2 1/2] system/datadir: Add new type constant for DTB files
  2025-04-23 10:02 [PATCH v2 0/2] Move device tree files in a subdir in pc-bios BALATON Zoltan
@ 2025-04-23 10:02 ` BALATON Zoltan
  2025-04-23 11:18   ` Philippe Mathieu-Daudé
  2025-04-23 10:02 ` [PATCH v2 2/2] pc-bios: Move device tree files in their own subdir BALATON Zoltan
  2025-04-23 10:18 ` [PATCH v2 0/2] Move device tree files in a subdir in pc-bios Mark Cave-Ayland
  2 siblings, 1 reply; 14+ messages in thread
From: BALATON Zoltan @ 2025-04-23 10:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Edgar E. Iglesias, Paolo Bonzini, Stefan Weil, philmd

Currently DTB files are mixed with ROMs under BIOS type. Separate them
under a new type constant and turn defines into an enum while at it.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
 hw/microblaze/boot.c   |  2 +-
 hw/ppc/ppc440_bamboo.c |  2 +-
 hw/ppc/sam460ex.c      |  2 +-
 hw/ppc/virtex_ml507.c  |  2 +-
 include/qemu/datadir.h | 11 ++++++++---
 system/datadir.c       |  3 ++-
 6 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c
index 60b4ef0abe..4a9c9df318 100644
--- a/hw/microblaze/boot.c
+++ b/hw/microblaze/boot.c
@@ -130,7 +130,7 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, bool is_little_endian,
     dtb_arg = current_machine->dtb;
     /* default to pcbios dtb as passed by machine_init */
     if (!dtb_arg && dtb_filename) {
-        filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, dtb_filename);
+        filename = qemu_find_file(QEMU_FILE_TYPE_DTB, dtb_filename);
     }
 
     boot_info.machine_cpu_reset = machine_cpu_reset;
diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c
index 099fda3909..6fff0d8afb 100644
--- a/hw/ppc/ppc440_bamboo.c
+++ b/hw/ppc/ppc440_bamboo.c
@@ -64,7 +64,7 @@ static int bamboo_load_device_tree(MachineState *machine,
     uint32_t tb_freq = 400000000;
     uint32_t clock_freq = 400000000;
 
-    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE);
+    filename = qemu_find_file(QEMU_FILE_TYPE_DTB, BINARY_DEVICE_TREE_FILE);
     if (!filename) {
         return -1;
     }
diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c
index 7dc3b309c8..327fac440f 100644
--- a/hw/ppc/sam460ex.c
+++ b/hw/ppc/sam460ex.c
@@ -142,7 +142,7 @@ static int sam460ex_load_device_tree(MachineState *machine,
     uint32_t clock_freq = CPU_FREQ;
     int offset;
 
-    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE);
+    filename = qemu_find_file(QEMU_FILE_TYPE_DTB, BINARY_DEVICE_TREE_FILE);
     if (!filename) {
         error_report("Couldn't find dtb file `%s'", BINARY_DEVICE_TREE_FILE);
         exit(1);
diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c
index 17115be74d..c9969ae48a 100644
--- a/hw/ppc/virtex_ml507.c
+++ b/hw/ppc/virtex_ml507.c
@@ -146,7 +146,7 @@ static int xilinx_load_device_tree(MachineState *machine,
         /* Try the local "ppc.dtb" override.  */
         fdt = load_device_tree("ppc.dtb", &fdt_size);
         if (!fdt) {
-            path = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE);
+            path = qemu_find_file(QEMU_FILE_TYPE_DTB, BINARY_DEVICE_TREE_FILE);
             if (path) {
                 fdt = load_device_tree(path, &fdt_size);
                 g_free(path);
diff --git a/include/qemu/datadir.h b/include/qemu/datadir.h
index 21f9097f58..cca32af300 100644
--- a/include/qemu/datadir.h
+++ b/include/qemu/datadir.h
@@ -1,11 +1,16 @@
 #ifndef QEMU_DATADIR_H
 #define QEMU_DATADIR_H
 
-#define QEMU_FILE_TYPE_BIOS   0
-#define QEMU_FILE_TYPE_KEYMAP 1
+typedef enum {
+    QEMU_FILE_TYPE_BIOS,
+    QEMU_FILE_TYPE_DTB,
+    QEMU_FILE_TYPE_KEYMAP,
+} QemuFileType;
+
 /**
  * qemu_find_file:
  * @type: QEMU_FILE_TYPE_BIOS (for BIOS, VGA BIOS)
+ *        QEMU_FILE_TYPE_DTB (for device tree blobs)
  *        or QEMU_FILE_TYPE_KEYMAP (for keymaps).
  * @name: Relative or absolute file name
  *
@@ -20,7 +25,7 @@
  *
  * Returns: a path that can access @name, or NULL if no matching file exists.
  */
-char *qemu_find_file(int type, const char *name);
+char *qemu_find_file(QemuFileType type, const char *name);
 void qemu_add_default_firmwarepath(void);
 void qemu_add_data_dir(char *path);
 void qemu_list_data_dirs(void);
diff --git a/system/datadir.c b/system/datadir.c
index c9237cb5d4..e450b84ce9 100644
--- a/system/datadir.c
+++ b/system/datadir.c
@@ -30,7 +30,7 @@
 static const char *data_dir[16];
 static int data_dir_idx;
 
-char *qemu_find_file(int type, const char *name)
+char *qemu_find_file(QemuFileType type, const char *name)
 {
     int i;
     const char *subdir;
@@ -44,6 +44,7 @@ char *qemu_find_file(int type, const char *name)
 
     switch (type) {
     case QEMU_FILE_TYPE_BIOS:
+    case QEMU_FILE_TYPE_DTB:
         subdir = "";
         break;
     case QEMU_FILE_TYPE_KEYMAP:
-- 
2.41.3



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

* [PATCH v2 2/2] pc-bios: Move device tree files in their own subdir
  2025-04-23 10:02 [PATCH v2 0/2] Move device tree files in a subdir in pc-bios BALATON Zoltan
  2025-04-23 10:02 ` [PATCH v2 1/2] system/datadir: Add new type constant for DTB files BALATON Zoltan
@ 2025-04-23 10:02 ` BALATON Zoltan
  2025-04-23 11:19   ` Philippe Mathieu-Daudé
  2025-04-23 10:18 ` [PATCH v2 0/2] Move device tree files in a subdir in pc-bios Mark Cave-Ayland
  2 siblings, 1 reply; 14+ messages in thread
From: BALATON Zoltan @ 2025-04-23 10:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Edgar E. Iglesias, Paolo Bonzini, Stefan Weil, philmd

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 +--------------------
 qemu.nsi                                   |   2 +-
 system/datadir.c                           |   4 +++-
 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 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/qemu.nsi b/qemu.nsi
index b186f223e1..d419986ca0 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
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;
-- 
2.41.3



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

* Re: [PATCH v2 0/2] Move device tree files in a subdir in pc-bios
  2025-04-23 10:02 [PATCH v2 0/2] Move device tree files in a subdir in pc-bios BALATON Zoltan
  2025-04-23 10:02 ` [PATCH v2 1/2] system/datadir: Add new type constant for DTB files BALATON Zoltan
  2025-04-23 10:02 ` [PATCH v2 2/2] pc-bios: Move device tree files in their own subdir BALATON Zoltan
@ 2025-04-23 10:18 ` Mark Cave-Ayland
  2025-04-23 11:23   ` Philippe Mathieu-Daudé
  2 siblings, 1 reply; 14+ messages in thread
From: Mark Cave-Ayland @ 2025-04-23 10:18 UTC (permalink / raw)
  To: BALATON Zoltan, qemu-devel
  Cc: Edgar E.Iglesias, Paolo Bonzini, Stefan Weil, philmd

On 23/04/2025 11:02, BALATON Zoltan wrote:

> Simple series doing what the subject says.
> 
> v2:
> - Added changes to qemu.nsi (Philippe)
> - Changed order of enum to keep it sorted. This changes value of
> existing define but the value is not relevant, always used by name.
> 
> BALATON Zoltan (2):
>    system/datadir: Add new type constant for DTB files
>    pc-bios: Move device tree files in their own subdir
> 
>   MAINTAINERS                                |   2 +-
>   hw/microblaze/boot.c                       |   2 +-
>   hw/ppc/ppc440_bamboo.c                     |   2 +-
>   hw/ppc/sam460ex.c                          |   2 +-
>   hw/ppc/virtex_ml507.c                      |   2 +-
>   include/qemu/datadir.h                     |  11 +++++++---
>   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 +-
>   system/datadir.c                           |   5 ++++-
>   18 files changed, 42 insertions(+), 32 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%)

In previous discussions we've had around what to do with pc-bios, wasn't 
the consensus that we should aim towards dividing up the directory on a 
per-target basis? I'm wondering if this is going in right direction, as 
I can certainly see that a per-target split would be more useful to 
packagers.


ATB,

Mark.



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

* Re: [PATCH v2 1/2] system/datadir: Add new type constant for DTB files
  2025-04-23 10:02 ` [PATCH v2 1/2] system/datadir: Add new type constant for DTB files BALATON Zoltan
@ 2025-04-23 11:18   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-23 11:18 UTC (permalink / raw)
  To: BALATON Zoltan, qemu-devel; +Cc: Edgar E. Iglesias, Paolo Bonzini, Stefan Weil

On 23/4/25 12:02, BALATON Zoltan wrote:
> Currently DTB files are mixed with ROMs under BIOS type. Separate them
> under a new type constant and turn defines into an enum while at it.
> 
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
> ---
>   hw/microblaze/boot.c   |  2 +-
>   hw/ppc/ppc440_bamboo.c |  2 +-
>   hw/ppc/sam460ex.c      |  2 +-
>   hw/ppc/virtex_ml507.c  |  2 +-
>   include/qemu/datadir.h | 11 ++++++++---
>   system/datadir.c       |  3 ++-
>   6 files changed, 14 insertions(+), 8 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>



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

* Re: [PATCH v2 2/2] pc-bios: Move device tree files in their own subdir
  2025-04-23 10:02 ` [PATCH v2 2/2] pc-bios: Move device tree files in their own subdir BALATON Zoltan
@ 2025-04-23 11:19   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-23 11:19 UTC (permalink / raw)
  To: BALATON Zoltan, qemu-devel; +Cc: Edgar E. Iglesias, Paolo Bonzini, Stefan Weil

On 23/4/25 12:02, 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 +--------------------
>   qemu.nsi                                   |   2 +-
>   system/datadir.c                           |   4 +++-
>   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%)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>



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

* Re: [PATCH v2 0/2] Move device tree files in a subdir in pc-bios
  2025-04-23 10:18 ` [PATCH v2 0/2] Move device tree files in a subdir in pc-bios Mark Cave-Ayland
@ 2025-04-23 11:23   ` Philippe Mathieu-Daudé
  2025-04-23 11:47     ` Daniel P. Berrangé
  0 siblings, 1 reply; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-23 11:23 UTC (permalink / raw)
  To: Mark Cave-Ayland, BALATON Zoltan, qemu-devel
  Cc: Edgar E.Iglesias, Paolo Bonzini, Stefan Weil, Michael Tokarev,
	Thomas Huth, Daniel P. Berrangé

Hi Mark,

On 23/4/25 12:18, Mark Cave-Ayland wrote:
> On 23/04/2025 11:02, BALATON Zoltan wrote:
> 
>> Simple series doing what the subject says.
>>
>> v2:
>> - Added changes to qemu.nsi (Philippe)
>> - Changed order of enum to keep it sorted. This changes value of
>> existing define but the value is not relevant, always used by name.
>>
>> BALATON Zoltan (2):
>>    system/datadir: Add new type constant for DTB files
>>    pc-bios: Move device tree files in their own subdir
>>
>>   MAINTAINERS                                |   2 +-
>>   hw/microblaze/boot.c                       |   2 +-
>>   hw/ppc/ppc440_bamboo.c                     |   2 +-
>>   hw/ppc/sam460ex.c                          |   2 +-
>>   hw/ppc/virtex_ml507.c                      |   2 +-
>>   include/qemu/datadir.h                     |  11 +++++++---
>>   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 +-
>>   system/datadir.c                           |   5 ++++-
>>   18 files changed, 42 insertions(+), 32 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%)
> 
> In previous discussions we've had around what to do with pc-bios, wasn't 
> the consensus that we should aim towards dividing up the directory on a 
> per-target basis? I'm wondering if this is going in right direction, as 
> I can certainly see that a per-target split would be more useful to 
> packagers.

pc-bios/ is already a mess, packagers usually take it as a whole. This
series isn't making the current situation worse.

I don't recall a per-target split discussion, but one moving firmware
blobs out of tree in a more adapted storage like git-lfs.

My 2 cents...

Regards,

Phil.


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

* Re: [PATCH v2 0/2] Move device tree files in a subdir in pc-bios
  2025-04-23 11:23   ` Philippe Mathieu-Daudé
@ 2025-04-23 11:47     ` Daniel P. Berrangé
  2025-04-23 12:54       ` BALATON Zoltan
  0 siblings, 1 reply; 14+ messages in thread
From: Daniel P. Berrangé @ 2025-04-23 11:47 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Mark Cave-Ayland, BALATON Zoltan, qemu-devel, Edgar E.Iglesias,
	Paolo Bonzini, Stefan Weil, Michael Tokarev, Thomas Huth

On Wed, Apr 23, 2025 at 01:23:28PM +0200, Philippe Mathieu-Daudé wrote:
> Hi Mark,
> 
> On 23/4/25 12:18, Mark Cave-Ayland wrote:
> > On 23/04/2025 11:02, BALATON Zoltan wrote:
> > 
> > > Simple series doing what the subject says.
> > > 
> > > v2:
> > > - Added changes to qemu.nsi (Philippe)
> > > - Changed order of enum to keep it sorted. This changes value of
> > > existing define but the value is not relevant, always used by name.
> > > 
> > > BALATON Zoltan (2):
> > >    system/datadir: Add new type constant for DTB files
> > >    pc-bios: Move device tree files in their own subdir
> > > 
> > >   MAINTAINERS                                |   2 +-
> > >   hw/microblaze/boot.c                       |   2 +-
> > >   hw/ppc/ppc440_bamboo.c                     |   2 +-
> > >   hw/ppc/sam460ex.c                          |   2 +-
> > >   hw/ppc/virtex_ml507.c                      |   2 +-
> > >   include/qemu/datadir.h                     |  11 +++++++---
> > >   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 +-
> > >   system/datadir.c                           |   5 ++++-
> > >   18 files changed, 42 insertions(+), 32 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%)
> > 
> > In previous discussions we've had around what to do with pc-bios, wasn't
> > the consensus that we should aim towards dividing up the directory on a
> > per-target basis? I'm wondering if this is going in right direction, as
> > I can certainly see that a per-target split would be more useful to
> > packagers.
> 
> pc-bios/ is already a mess, packagers usually take it as a whole. This
> series isn't making the current situation worse.
> 
> I don't recall a per-target split discussion, but one moving firmware
> blobs out of tree in a more adapted storage like git-lfs.

Talking about the pc-bios dir in general is a bit of a can of worms
and we never make concrete progress historically :-(

Probably best to split up the problem to some extent.

The device tree files are conceptually quite different from the
3rd party pre-built firmware images, which are diffferent from
the keymaps.

IIUC, device tree files are tied to specific machine types, so
I wonder if they should not simply live alongside their machine
type .c impl file, completely outside of pc-bios ?

eg

  petalogix-ml605.{dts,dtb} live alongside hw/microblaze/petalogix_ml605_mmu.c
  babmboo.{dts,dtb} live alongside ./hw/ppc/ppc440_bamboo.c

For the keymaps it feels like an probable easy win to move them to a
ui/keymaps/ directory instead.

ie in general try to get 'pc-bios' to contain only 3rd party pre-built
binaries, as a first goal. A second goal might be merging pc-bios/
into roms/, and a final goal could be spinning off pre-built ROMs into
a separate release tarball, and/or separate git repos.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



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

* Re: [PATCH v2 0/2] Move device tree files in a subdir in pc-bios
  2025-04-23 11:47     ` Daniel P. Berrangé
@ 2025-04-23 12:54       ` BALATON Zoltan
  2025-04-23 13:03         ` Daniel P. Berrangé
  0 siblings, 1 reply; 14+ messages in thread
From: BALATON Zoltan @ 2025-04-23 12:54 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Philippe Mathieu-Daudé, Mark Cave-Ayland, qemu-devel,
	Edgar E.Iglesias, Paolo Bonzini, Stefan Weil, Michael Tokarev,
	Thomas Huth

[-- Attachment #1: Type: text/plain, Size: 6078 bytes --]

On Wed, 23 Apr 2025, Daniel P. Berrangé wrote:
> On Wed, Apr 23, 2025 at 01:23:28PM +0200, Philippe Mathieu-Daudé wrote:
>> Hi Mark,
>>
>> On 23/4/25 12:18, Mark Cave-Ayland wrote:
>>> On 23/04/2025 11:02, BALATON Zoltan wrote:
>>>
>>>> Simple series doing what the subject says.
>>>>
>>>> v2:
>>>> - Added changes to qemu.nsi (Philippe)
>>>> - Changed order of enum to keep it sorted. This changes value of
>>>> existing define but the value is not relevant, always used by name.
>>>>
>>>> BALATON Zoltan (2):
>>>>    system/datadir: Add new type constant for DTB files
>>>>    pc-bios: Move device tree files in their own subdir
>>>>
>>>>   MAINTAINERS                                |   2 +-
>>>>   hw/microblaze/boot.c                       |   2 +-
>>>>   hw/ppc/ppc440_bamboo.c                     |   2 +-
>>>>   hw/ppc/sam460ex.c                          |   2 +-
>>>>   hw/ppc/virtex_ml507.c                      |   2 +-
>>>>   include/qemu/datadir.h                     |  11 +++++++---
>>>>   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 +-
>>>>   system/datadir.c                           |   5 ++++-
>>>>   18 files changed, 42 insertions(+), 32 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%)
>>>
>>> In previous discussions we've had around what to do with pc-bios, wasn't
>>> the consensus that we should aim towards dividing up the directory on a
>>> per-target basis? I'm wondering if this is going in right direction, as
>>> I can certainly see that a per-target split would be more useful to
>>> packagers.

One problem is that pc-bios doesn't only contain machine firmware but also 
card ROMs which would belong to more targets (or archs) as e.g. PCI cards 
work on multiple archs. So it's not trivial to split by target, you'd 
still have a lot of files not easily assigned to any target.

This series is in preparation for another that will add a dtb for pegasos2 
and I did not want to increase the mess and took the opportunity to try to 
tidy it a bit. I don't intend to do any major refactoring of the pc-bios 
dir, that's out of scope of these patches.

>> pc-bios/ is already a mess, packagers usually take it as a whole. This
>> series isn't making the current situation worse.
>>
>> I don't recall a per-target split discussion, but one moving firmware
>> blobs out of tree in a more adapted storage like git-lfs.
>
> Talking about the pc-bios dir in general is a bit of a can of worms
> and we never make concrete progress historically :-(
>
> Probably best to split up the problem to some extent.
>
> The device tree files are conceptually quite different from the
> 3rd party pre-built firmware images, which are diffferent from
> the keymaps.
>
> IIUC, device tree files are tied to specific machine types, so
> I wonder if they should not simply live alongside their machine
> type .c impl file, completely outside of pc-bios ?
>
> eg
>
>  petalogix-ml605.{dts,dtb} live alongside hw/microblaze/petalogix_ml605_mmu.c
>  babmboo.{dts,dtb} live alongside ./hw/ppc/ppc440_bamboo.c

You need the dtbs at run time and the dir where we can look files up is 
the pc-bios. So these need to be installed there at the end. We could 
scatter them around in the source to put them next their machines but that 
would make installation of them more difficult than having it in one dir.

> For the keymaps it feels like an probable easy win to move them to a
> ui/keymaps/ directory instead.

Currently you can run a git build directly from build dir and it will find 
the roms/dtbs/keymaps. You can also run a binary copied elsewhere if you 
pass -L path/to/pc-bios. Moving things out of it would break this and may 
cause more problems than it would solve.

> ie in general try to get 'pc-bios' to contain only 3rd party pre-built
> binaries, as a first goal. A second goal might be merging pc-bios/
> into roms/, and a final goal could be spinning off pre-built ROMs into
> a separate release tarball, and/or separate git repos.

Maybe a less ambitious way could be just to tag files in pc-bios in some 
way so it's known which machines or devices need them then you could make 
a script or something to pick only the files that you need for the 
installed machines or config. That seems less work then moving everything 
off from pc-bios which I don't see how would work with the runtime search 
path which would still expect all of these to be at one place. Maybe this 
could be done in Kconfig?

But all that is beyond this series which just wanted to put the dtb files 
separate from roms like was already done for keymaps just to make it 
easier to edit them in the source at one place.

Regards,
BALATON Zoltan

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

* Re: [PATCH v2 0/2] Move device tree files in a subdir in pc-bios
  2025-04-23 12:54       ` BALATON Zoltan
@ 2025-04-23 13:03         ` Daniel P. Berrangé
  2025-04-23 14:07           ` BALATON Zoltan
  2025-04-25 10:47           ` Philippe Mathieu-Daudé
  0 siblings, 2 replies; 14+ messages in thread
From: Daniel P. Berrangé @ 2025-04-23 13:03 UTC (permalink / raw)
  To: BALATON Zoltan
  Cc: Philippe Mathieu-Daudé, Mark Cave-Ayland, qemu-devel,
	Edgar E.Iglesias, Paolo Bonzini, Stefan Weil, Michael Tokarev,
	Thomas Huth

On Wed, Apr 23, 2025 at 02:54:26PM +0200, BALATON Zoltan wrote:
> On Wed, 23 Apr 2025, Daniel P. Berrangé wrote:
> > On Wed, Apr 23, 2025 at 01:23:28PM +0200, Philippe Mathieu-Daudé wrote:
> > > Hi Mark,
> > > 
> > > On 23/4/25 12:18, Mark Cave-Ayland wrote:
> > > > On 23/04/2025 11:02, BALATON Zoltan wrote:
> > > > 
> > > > > Simple series doing what the subject says.
> > > > > 
> > > > > v2:
> > > > > - Added changes to qemu.nsi (Philippe)
> > > > > - Changed order of enum to keep it sorted. This changes value of
> > > > > existing define but the value is not relevant, always used by name.
> > > > > 
> > > > > BALATON Zoltan (2):
> > > > >    system/datadir: Add new type constant for DTB files
> > > > >    pc-bios: Move device tree files in their own subdir
> > > > > 
> > > > >   MAINTAINERS                                |   2 +-
> > > > >   hw/microblaze/boot.c                       |   2 +-
> > > > >   hw/ppc/ppc440_bamboo.c                     |   2 +-
> > > > >   hw/ppc/sam460ex.c                          |   2 +-
> > > > >   hw/ppc/virtex_ml507.c                      |   2 +-
> > > > >   include/qemu/datadir.h                     |  11 +++++++---
> > > > >   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 +-
> > > > >   system/datadir.c                           |   5 ++++-
> > > > >   18 files changed, 42 insertions(+), 32 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%)
> > > > 
> > > > In previous discussions we've had around what to do with pc-bios, wasn't
> > > > the consensus that we should aim towards dividing up the directory on a
> > > > per-target basis? I'm wondering if this is going in right direction, as
> > > > I can certainly see that a per-target split would be more useful to
> > > > packagers.
> 
> One problem is that pc-bios doesn't only contain machine firmware but also
> card ROMs which would belong to more targets (or archs) as e.g. PCI cards
> work on multiple archs. So it's not trivial to split by target, you'd still
> have a lot of files not easily assigned to any target.
> 
> This series is in preparation for another that will add a dtb for pegasos2
> and I did not want to increase the mess and took the opportunity to try to
> tidy it a bit. I don't intend to do any major refactoring of the pc-bios
> dir, that's out of scope of these patches.
> 
> > > pc-bios/ is already a mess, packagers usually take it as a whole. This
> > > series isn't making the current situation worse.
> > > 
> > > I don't recall a per-target split discussion, but one moving firmware
> > > blobs out of tree in a more adapted storage like git-lfs.
> > 
> > Talking about the pc-bios dir in general is a bit of a can of worms
> > and we never make concrete progress historically :-(
> > 
> > Probably best to split up the problem to some extent.
> > 
> > The device tree files are conceptually quite different from the
> > 3rd party pre-built firmware images, which are diffferent from
> > the keymaps.
> > 
> > IIUC, device tree files are tied to specific machine types, so
> > I wonder if they should not simply live alongside their machine
> > type .c impl file, completely outside of pc-bios ?
> > 
> > eg
> > 
> >  petalogix-ml605.{dts,dtb} live alongside hw/microblaze/petalogix_ml605_mmu.c
> >  babmboo.{dts,dtb} live alongside ./hw/ppc/ppc440_bamboo.c
> 
> You need the dtbs at run time and the dir where we can look files up is the
> pc-bios. So these need to be installed there at the end. We could scatter
> them around in the source to put them next their machines but that would
> make installation of them more difficult than having it in one dir.
> 
> > For the keymaps it feels like an probable easy win to move them to a
> > ui/keymaps/ directory instead.
> 
> Currently you can run a git build directly from build dir and it will find
> the roms/dtbs/keymaps. You can also run a binary copied elsewhere if you
> pass -L path/to/pc-bios. Moving things out of it would break this and may
> cause more problems than it would solve.


This is just describing a limitation of the current resource locating
implementation. For running in tree there's no reason why we can't
look in a different directory for keymaps/dtbs - we just took the
lazy option historically of putting them alongside firmware. That
can be fixed.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



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

* Re: [PATCH v2 0/2] Move device tree files in a subdir in pc-bios
  2025-04-23 13:03         ` Daniel P. Berrangé
@ 2025-04-23 14:07           ` BALATON Zoltan
  2025-04-23 15:38             ` Daniel P. Berrangé
  2025-04-25 10:47           ` Philippe Mathieu-Daudé
  1 sibling, 1 reply; 14+ messages in thread
From: BALATON Zoltan @ 2025-04-23 14:07 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Philippe Mathieu-Daudé, Mark Cave-Ayland, qemu-devel,
	Edgar E.Iglesias, Paolo Bonzini, Stefan Weil, Michael Tokarev,
	Thomas Huth

[-- Attachment #1: Type: text/plain, Size: 5987 bytes --]

On Wed, 23 Apr 2025, Daniel P. Berrangé wrote:
> On Wed, Apr 23, 2025 at 02:54:26PM +0200, BALATON Zoltan wrote:
>> On Wed, 23 Apr 2025, Daniel P. Berrangé wrote:
>>> On Wed, Apr 23, 2025 at 01:23:28PM +0200, Philippe Mathieu-Daudé wrote:
>>>> Hi Mark,
>>>>
>>>> On 23/4/25 12:18, Mark Cave-Ayland wrote:
>>>>> On 23/04/2025 11:02, BALATON Zoltan wrote:
>>>>>
>>>>>> Simple series doing what the subject says.
>>>>>>
>>>>>> v2:
>>>>>> - Added changes to qemu.nsi (Philippe)
>>>>>> - Changed order of enum to keep it sorted. This changes value of
>>>>>> existing define but the value is not relevant, always used by name.
>>>>>>
>>>>>> BALATON Zoltan (2):
>>>>>>    system/datadir: Add new type constant for DTB files
>>>>>>    pc-bios: Move device tree files in their own subdir
>>>>>>
>>>>>>   MAINTAINERS                                |   2 +-
>>>>>>   hw/microblaze/boot.c                       |   2 +-
>>>>>>   hw/ppc/ppc440_bamboo.c                     |   2 +-
>>>>>>   hw/ppc/sam460ex.c                          |   2 +-
>>>>>>   hw/ppc/virtex_ml507.c                      |   2 +-
>>>>>>   include/qemu/datadir.h                     |  11 +++++++---
>>>>>>   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 +-
>>>>>>   system/datadir.c                           |   5 ++++-
>>>>>>   18 files changed, 42 insertions(+), 32 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%)
>>>>>
>>>>> In previous discussions we've had around what to do with pc-bios, wasn't
>>>>> the consensus that we should aim towards dividing up the directory on a
>>>>> per-target basis? I'm wondering if this is going in right direction, as
>>>>> I can certainly see that a per-target split would be more useful to
>>>>> packagers.
>>
>> One problem is that pc-bios doesn't only contain machine firmware but also
>> card ROMs which would belong to more targets (or archs) as e.g. PCI cards
>> work on multiple archs. So it's not trivial to split by target, you'd still
>> have a lot of files not easily assigned to any target.
>>
>> This series is in preparation for another that will add a dtb for pegasos2
>> and I did not want to increase the mess and took the opportunity to try to
>> tidy it a bit. I don't intend to do any major refactoring of the pc-bios
>> dir, that's out of scope of these patches.
>>
>>>> pc-bios/ is already a mess, packagers usually take it as a whole. This
>>>> series isn't making the current situation worse.
>>>>
>>>> I don't recall a per-target split discussion, but one moving firmware
>>>> blobs out of tree in a more adapted storage like git-lfs.
>>>
>>> Talking about the pc-bios dir in general is a bit of a can of worms
>>> and we never make concrete progress historically :-(
>>>
>>> Probably best to split up the problem to some extent.
>>>
>>> The device tree files are conceptually quite different from the
>>> 3rd party pre-built firmware images, which are diffferent from
>>> the keymaps.
>>>
>>> IIUC, device tree files are tied to specific machine types, so
>>> I wonder if they should not simply live alongside their machine
>>> type .c impl file, completely outside of pc-bios ?
>>>
>>> eg
>>>
>>>  petalogix-ml605.{dts,dtb} live alongside hw/microblaze/petalogix_ml605_mmu.c
>>>  babmboo.{dts,dtb} live alongside ./hw/ppc/ppc440_bamboo.c
>>
>> You need the dtbs at run time and the dir where we can look files up is the
>> pc-bios. So these need to be installed there at the end. We could scatter
>> them around in the source to put them next their machines but that would
>> make installation of them more difficult than having it in one dir.
>>
>>> For the keymaps it feels like an probable easy win to move them to a
>>> ui/keymaps/ directory instead.
>>
>> Currently you can run a git build directly from build dir and it will find
>> the roms/dtbs/keymaps. You can also run a binary copied elsewhere if you
>> pass -L path/to/pc-bios. Moving things out of it would break this and may
>> cause more problems than it would solve.
>
>
> This is just describing a limitation of the current resource locating
> implementation. For running in tree there's no reason why we can't
> look in a different directory for keymaps/dtbs - we just took the
> lazy option historically of putting them alongside firmware. That
> can be fixed.

Yes but then you would need either two or more options for copied binary 
to point it to different directories for rom/dtb/keymap or make -L take a 
search path and list multiple directories. That's not too convenient for 
users.

Regards,
BALATON Zoltan

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

* Re: [PATCH v2 0/2] Move device tree files in a subdir in pc-bios
  2025-04-23 14:07           ` BALATON Zoltan
@ 2025-04-23 15:38             ` Daniel P. Berrangé
  2025-04-23 15:57               ` BALATON Zoltan
  0 siblings, 1 reply; 14+ messages in thread
From: Daniel P. Berrangé @ 2025-04-23 15:38 UTC (permalink / raw)
  To: BALATON Zoltan
  Cc: Philippe Mathieu-Daudé, Mark Cave-Ayland, qemu-devel,
	Edgar E.Iglesias, Paolo Bonzini, Stefan Weil, Michael Tokarev,
	Thomas Huth

On Wed, Apr 23, 2025 at 04:07:27PM +0200, BALATON Zoltan wrote:
> On Wed, 23 Apr 2025, Daniel P. Berrangé wrote:
> > On Wed, Apr 23, 2025 at 02:54:26PM +0200, BALATON Zoltan wrote:
> > > On Wed, 23 Apr 2025, Daniel P. Berrangé wrote:
> > > > On Wed, Apr 23, 2025 at 01:23:28PM +0200, Philippe Mathieu-Daudé wrote:
> > > > > Hi Mark,
> > > > > 
> > > > > On 23/4/25 12:18, Mark Cave-Ayland wrote:
> > > > > > On 23/04/2025 11:02, BALATON Zoltan wrote:
> > > > > > 
> > > > > > > Simple series doing what the subject says.
> > > > > > > 
> > > > > > > v2:
> > > > > > > - Added changes to qemu.nsi (Philippe)
> > > > > > > - Changed order of enum to keep it sorted. This changes value of
> > > > > > > existing define but the value is not relevant, always used by name.
> > > > > > > 
> > > > > > > BALATON Zoltan (2):
> > > > > > >    system/datadir: Add new type constant for DTB files
> > > > > > >    pc-bios: Move device tree files in their own subdir
> > > > > > > 
> > > > > > >   MAINTAINERS                                |   2 +-
> > > > > > >   hw/microblaze/boot.c                       |   2 +-
> > > > > > >   hw/ppc/ppc440_bamboo.c                     |   2 +-
> > > > > > >   hw/ppc/sam460ex.c                          |   2 +-
> > > > > > >   hw/ppc/virtex_ml507.c                      |   2 +-
> > > > > > >   include/qemu/datadir.h                     |  11 +++++++---
> > > > > > >   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 +-
> > > > > > >   system/datadir.c                           |   5 ++++-
> > > > > > >   18 files changed, 42 insertions(+), 32 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%)
> > > > > > 
> > > > > > In previous discussions we've had around what to do with pc-bios, wasn't
> > > > > > the consensus that we should aim towards dividing up the directory on a
> > > > > > per-target basis? I'm wondering if this is going in right direction, as
> > > > > > I can certainly see that a per-target split would be more useful to
> > > > > > packagers.
> > > 
> > > One problem is that pc-bios doesn't only contain machine firmware but also
> > > card ROMs which would belong to more targets (or archs) as e.g. PCI cards
> > > work on multiple archs. So it's not trivial to split by target, you'd still
> > > have a lot of files not easily assigned to any target.
> > > 
> > > This series is in preparation for another that will add a dtb for pegasos2
> > > and I did not want to increase the mess and took the opportunity to try to
> > > tidy it a bit. I don't intend to do any major refactoring of the pc-bios
> > > dir, that's out of scope of these patches.
> > > 
> > > > > pc-bios/ is already a mess, packagers usually take it as a whole. This
> > > > > series isn't making the current situation worse.
> > > > > 
> > > > > I don't recall a per-target split discussion, but one moving firmware
> > > > > blobs out of tree in a more adapted storage like git-lfs.
> > > > 
> > > > Talking about the pc-bios dir in general is a bit of a can of worms
> > > > and we never make concrete progress historically :-(
> > > > 
> > > > Probably best to split up the problem to some extent.
> > > > 
> > > > The device tree files are conceptually quite different from the
> > > > 3rd party pre-built firmware images, which are diffferent from
> > > > the keymaps.
> > > > 
> > > > IIUC, device tree files are tied to specific machine types, so
> > > > I wonder if they should not simply live alongside their machine
> > > > type .c impl file, completely outside of pc-bios ?
> > > > 
> > > > eg
> > > > 
> > > >  petalogix-ml605.{dts,dtb} live alongside hw/microblaze/petalogix_ml605_mmu.c
> > > >  babmboo.{dts,dtb} live alongside ./hw/ppc/ppc440_bamboo.c
> > > 
> > > You need the dtbs at run time and the dir where we can look files up is the
> > > pc-bios. So these need to be installed there at the end. We could scatter
> > > them around in the source to put them next their machines but that would
> > > make installation of them more difficult than having it in one dir.
> > > 
> > > > For the keymaps it feels like an probable easy win to move them to a
> > > > ui/keymaps/ directory instead.
> > > 
> > > Currently you can run a git build directly from build dir and it will find
> > > the roms/dtbs/keymaps. You can also run a binary copied elsewhere if you
> > > pass -L path/to/pc-bios. Moving things out of it would break this and may
> > > cause more problems than it would solve.
> > 
> > 
> > This is just describing a limitation of the current resource locating
> > implementation. For running in tree there's no reason why we can't
> > look in a different directory for keymaps/dtbs - we just took the
> > lazy option historically of putting them alongside firmware. That
> > can be fixed.
> 
> Yes but then you would need either two or more options for copied binary to
> point it to different directories for rom/dtb/keymap or make -L take a
> search path and list multiple directories. That's not too convenient for
> users.

I was only refering to changing the source tree location, which QEMU can
auto-detect relative to the binary being executed, and should need to involve
changes to -L.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



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

* Re: [PATCH v2 0/2] Move device tree files in a subdir in pc-bios
  2025-04-23 15:38             ` Daniel P. Berrangé
@ 2025-04-23 15:57               ` BALATON Zoltan
  0 siblings, 0 replies; 14+ messages in thread
From: BALATON Zoltan @ 2025-04-23 15:57 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Philippe Mathieu-Daudé, Mark Cave-Ayland, qemu-devel,
	Edgar E.Iglesias, Paolo Bonzini, Stefan Weil, Michael Tokarev,
	Thomas Huth

[-- Attachment #1: Type: text/plain, Size: 6937 bytes --]

On Wed, 23 Apr 2025, Daniel P. Berrangé wrote:
> On Wed, Apr 23, 2025 at 04:07:27PM +0200, BALATON Zoltan wrote:
>> On Wed, 23 Apr 2025, Daniel P. Berrangé wrote:
>>> On Wed, Apr 23, 2025 at 02:54:26PM +0200, BALATON Zoltan wrote:
>>>> On Wed, 23 Apr 2025, Daniel P. Berrangé wrote:
>>>>> On Wed, Apr 23, 2025 at 01:23:28PM +0200, Philippe Mathieu-Daudé wrote:
>>>>>> Hi Mark,
>>>>>>
>>>>>> On 23/4/25 12:18, Mark Cave-Ayland wrote:
>>>>>>> On 23/04/2025 11:02, BALATON Zoltan wrote:
>>>>>>>
>>>>>>>> Simple series doing what the subject says.
>>>>>>>>
>>>>>>>> v2:
>>>>>>>> - Added changes to qemu.nsi (Philippe)
>>>>>>>> - Changed order of enum to keep it sorted. This changes value of
>>>>>>>> existing define but the value is not relevant, always used by name.
>>>>>>>>
>>>>>>>> BALATON Zoltan (2):
>>>>>>>>    system/datadir: Add new type constant for DTB files
>>>>>>>>    pc-bios: Move device tree files in their own subdir
>>>>>>>>
>>>>>>>>   MAINTAINERS                                |   2 +-
>>>>>>>>   hw/microblaze/boot.c                       |   2 +-
>>>>>>>>   hw/ppc/ppc440_bamboo.c                     |   2 +-
>>>>>>>>   hw/ppc/sam460ex.c                          |   2 +-
>>>>>>>>   hw/ppc/virtex_ml507.c                      |   2 +-
>>>>>>>>   include/qemu/datadir.h                     |  11 +++++++---
>>>>>>>>   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 +-
>>>>>>>>   system/datadir.c                           |   5 ++++-
>>>>>>>>   18 files changed, 42 insertions(+), 32 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%)
>>>>>>>
>>>>>>> In previous discussions we've had around what to do with pc-bios, wasn't
>>>>>>> the consensus that we should aim towards dividing up the directory on a
>>>>>>> per-target basis? I'm wondering if this is going in right direction, as
>>>>>>> I can certainly see that a per-target split would be more useful to
>>>>>>> packagers.
>>>>
>>>> One problem is that pc-bios doesn't only contain machine firmware but also
>>>> card ROMs which would belong to more targets (or archs) as e.g. PCI cards
>>>> work on multiple archs. So it's not trivial to split by target, you'd still
>>>> have a lot of files not easily assigned to any target.
>>>>
>>>> This series is in preparation for another that will add a dtb for pegasos2
>>>> and I did not want to increase the mess and took the opportunity to try to
>>>> tidy it a bit. I don't intend to do any major refactoring of the pc-bios
>>>> dir, that's out of scope of these patches.
>>>>
>>>>>> pc-bios/ is already a mess, packagers usually take it as a whole. This
>>>>>> series isn't making the current situation worse.
>>>>>>
>>>>>> I don't recall a per-target split discussion, but one moving firmware
>>>>>> blobs out of tree in a more adapted storage like git-lfs.
>>>>>
>>>>> Talking about the pc-bios dir in general is a bit of a can of worms
>>>>> and we never make concrete progress historically :-(
>>>>>
>>>>> Probably best to split up the problem to some extent.
>>>>>
>>>>> The device tree files are conceptually quite different from the
>>>>> 3rd party pre-built firmware images, which are diffferent from
>>>>> the keymaps.
>>>>>
>>>>> IIUC, device tree files are tied to specific machine types, so
>>>>> I wonder if they should not simply live alongside their machine
>>>>> type .c impl file, completely outside of pc-bios ?
>>>>>
>>>>> eg
>>>>>
>>>>>  petalogix-ml605.{dts,dtb} live alongside hw/microblaze/petalogix_ml605_mmu.c
>>>>>  babmboo.{dts,dtb} live alongside ./hw/ppc/ppc440_bamboo.c
>>>>
>>>> You need the dtbs at run time and the dir where we can look files up is the
>>>> pc-bios. So these need to be installed there at the end. We could scatter
>>>> them around in the source to put them next their machines but that would
>>>> make installation of them more difficult than having it in one dir.
>>>>
>>>>> For the keymaps it feels like an probable easy win to move them to a
>>>>> ui/keymaps/ directory instead.
>>>>
>>>> Currently you can run a git build directly from build dir and it will find
>>>> the roms/dtbs/keymaps. You can also run a binary copied elsewhere if you
>>>> pass -L path/to/pc-bios. Moving things out of it would break this and may
>>>> cause more problems than it would solve.
>>>
>>>
>>> This is just describing a limitation of the current resource locating
>>> implementation. For running in tree there's no reason why we can't
>>> look in a different directory for keymaps/dtbs - we just took the
>>> lazy option historically of putting them alongside firmware. That
>>> can be fixed.
>>
>> Yes but then you would need either two or more options for copied binary to
>> point it to different directories for rom/dtb/keymap or make -L take a
>> search path and list multiple directories. That's not too convenient for
>> users.
>
> I was only refering to changing the source tree location, which QEMU can
> auto-detect relative to the binary being executed, and should need to involve
> changes to -L.

OK that implies they would still need to be installed in build/pc-bios/dtb 
or build/pc-bios/keymaps at the end from wherever they live in the source 
tree. I find having dts and dtb files in pc-bios/dtb better than having 
them mixed with C files in hw/ppc and installing them is also easier this 
way (or maybe it's not that difficult to install but I have no idea about 
Meson). Still it looks tidier to gather dtbs at one place.

Regards,
BALATON Zoltan

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

* Re: [PATCH v2 0/2] Move device tree files in a subdir in pc-bios
  2025-04-23 13:03         ` Daniel P. Berrangé
  2025-04-23 14:07           ` BALATON Zoltan
@ 2025-04-25 10:47           ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 10:47 UTC (permalink / raw)
  To: Daniel P. Berrangé, BALATON Zoltan
  Cc: Mark Cave-Ayland, qemu-devel, Edgar E.Iglesias, Paolo Bonzini,
	Stefan Weil, Michael Tokarev, Thomas Huth

On 23/4/25 15:03, Daniel P. Berrangé wrote:
> On Wed, Apr 23, 2025 at 02:54:26PM +0200, BALATON Zoltan wrote:
>> On Wed, 23 Apr 2025, Daniel P. Berrangé wrote:
>>> On Wed, Apr 23, 2025 at 01:23:28PM +0200, Philippe Mathieu-Daudé wrote:
>>>> Hi Mark,
>>>>
>>>> On 23/4/25 12:18, Mark Cave-Ayland wrote:
>>>>> On 23/04/2025 11:02, BALATON Zoltan wrote:
>>>>>
>>>>>> Simple series doing what the subject says.
>>>>>>
>>>>>> v2:
>>>>>> - Added changes to qemu.nsi (Philippe)
>>>>>> - Changed order of enum to keep it sorted. This changes value of
>>>>>> existing define but the value is not relevant, always used by name.
>>>>>>
>>>>>> BALATON Zoltan (2):
>>>>>>     system/datadir: Add new type constant for DTB files
>>>>>>     pc-bios: Move device tree files in their own subdir
>>>>>>
>>>>>>    MAINTAINERS                                |   2 +-
>>>>>>    hw/microblaze/boot.c                       |   2 +-
>>>>>>    hw/ppc/ppc440_bamboo.c                     |   2 +-
>>>>>>    hw/ppc/sam460ex.c                          |   2 +-
>>>>>>    hw/ppc/virtex_ml507.c                      |   2 +-
>>>>>>    include/qemu/datadir.h                     |  11 +++++++---
>>>>>>    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 +-
>>>>>>    system/datadir.c                           |   5 ++++-
>>>>>>    18 files changed, 42 insertions(+), 32 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%)
>>>>>
>>>>> In previous discussions we've had around what to do with pc-bios, wasn't
>>>>> the consensus that we should aim towards dividing up the directory on a
>>>>> per-target basis? I'm wondering if this is going in right direction, as
>>>>> I can certainly see that a per-target split would be more useful to
>>>>> packagers.
>>
>> One problem is that pc-bios doesn't only contain machine firmware but also
>> card ROMs which would belong to more targets (or archs) as e.g. PCI cards
>> work on multiple archs. So it's not trivial to split by target, you'd still
>> have a lot of files not easily assigned to any target.
>>
>> This series is in preparation for another that will add a dtb for pegasos2
>> and I did not want to increase the mess and took the opportunity to try to
>> tidy it a bit. I don't intend to do any major refactoring of the pc-bios
>> dir, that's out of scope of these patches.
>>
>>>> pc-bios/ is already a mess, packagers usually take it as a whole. This
>>>> series isn't making the current situation worse.
>>>>
>>>> I don't recall a per-target split discussion, but one moving firmware
>>>> blobs out of tree in a more adapted storage like git-lfs.
>>>
>>> Talking about the pc-bios dir in general is a bit of a can of worms
>>> and we never make concrete progress historically :-(
>>>
>>> Probably best to split up the problem to some extent.
>>>
>>> The device tree files are conceptually quite different from the
>>> 3rd party pre-built firmware images, which are diffferent from
>>> the keymaps.
>>>
>>> IIUC, device tree files are tied to specific machine types, so
>>> I wonder if they should not simply live alongside their machine
>>> type .c impl file, completely outside of pc-bios ?
>>>
>>> eg
>>>
>>>   petalogix-ml605.{dts,dtb} live alongside hw/microblaze/petalogix_ml605_mmu.c
>>>   babmboo.{dts,dtb} live alongside ./hw/ppc/ppc440_bamboo.c
>>
>> You need the dtbs at run time and the dir where we can look files up is the
>> pc-bios. So these need to be installed there at the end. We could scatter
>> them around in the source to put them next their machines but that would
>> make installation of them more difficult than having it in one dir.
>>
>>> For the keymaps it feels like an probable easy win to move them to a
>>> ui/keymaps/ directory instead.
>>
>> Currently you can run a git build directly from build dir and it will find
>> the roms/dtbs/keymaps. You can also run a binary copied elsewhere if you
>> pass -L path/to/pc-bios. Moving things out of it would break this and may
>> cause more problems than it would solve.
> 
> 
> This is just describing a limitation of the current resource locating
> implementation. For running in tree there's no reason why we can't
> look in a different directory for keymaps/dtbs - we just took the
> lazy option historically of putting them alongside firmware. That
> can be fixed.

That can still be fixed later ;) I'm queuing this series as it tidies
a bit the pc-bios/ directory.

Regards,

Phil.


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

end of thread, other threads:[~2025-04-25 10:48 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-23 10:02 [PATCH v2 0/2] Move device tree files in a subdir in pc-bios BALATON Zoltan
2025-04-23 10:02 ` [PATCH v2 1/2] system/datadir: Add new type constant for DTB files BALATON Zoltan
2025-04-23 11:18   ` Philippe Mathieu-Daudé
2025-04-23 10:02 ` [PATCH v2 2/2] pc-bios: Move device tree files in their own subdir BALATON Zoltan
2025-04-23 11:19   ` Philippe Mathieu-Daudé
2025-04-23 10:18 ` [PATCH v2 0/2] Move device tree files in a subdir in pc-bios Mark Cave-Ayland
2025-04-23 11:23   ` Philippe Mathieu-Daudé
2025-04-23 11:47     ` Daniel P. Berrangé
2025-04-23 12:54       ` BALATON Zoltan
2025-04-23 13:03         ` Daniel P. Berrangé
2025-04-23 14:07           ` BALATON Zoltan
2025-04-23 15:38             ` Daniel P. Berrangé
2025-04-23 15:57               ` BALATON Zoltan
2025-04-25 10:47           ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).