Skip to contentSkip to conversation

hw/loongarch: Build fw_cfg.c as common object

PATCH Applied Philippe Mathieu-Daudé 3 participants 6 messages Sep 27, 2024 – Sep 30, 2024 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

cover hw/loongarch: Build fw_cfg.c as common object

LoongArch fw_cfg.c doesn't use target specific declarations, build it as common object.

Philippe Mathieu-Daudé (2):
hw/loongarch/virt: Remove unnecessary 'cpu.h' inclusion hw/loongarch/fw_cfg: Build in common_ss[]

 include/hw/loongarch/virt.h | 1 -
 hw/loongarch/meson.build    | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
Signature · 1 line
2.45.2
#1 lore raw

PATCH 1/2 hw/loongarch/virt: Remove unnecessary 'cpu.h' inclusion

---
 include/hw/loongarch/virt.h | 1 -
 1 file changed, 1 deletion(-)
include/hw/loongarch/virt.h +0 -1
index c373e48f27..9ba47793ef 100644
@@ -8,7 +8,6 @@
 #ifndef HW_LOONGARCH_H
 #define HW_LOONGARCH_H
 
-#include "target/loongarch/cpu.h"
 #include "hw/boards.h"
 #include "qemu/queue.h"
 #include "hw/block/flash.h"
Signature · 1 line
2.45.2
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] hw/loongarch/virt: Remove unnecessary 'cpu.h' inclusion

Quoted 10 lines · Philippe Mathieu-Daudé
---
  include/hw/loongarch/virt.h | 1 -
  1 file changed, 1 deletion(-)
include/hw/loongarch/virt.h +0 -0
index c373e48f27..9ba47793ef 100644

include/hw/loongarch/virt.h line 13

Quoted 7 lines
include/hw/loongarch/virt.h +0 -1
@@ -8,7 +8,6 @@
  #ifndef HW_LOONGARCH_H
  #define HW_LOONGARCH_H
 
-#include "target/loongarch/cpu.h"
  #include "hw/boards.h"
  #include "qemu/queue.h"
  #include "hw/block/flash.h"
#3 lore raw

PATCH 2/2 hw/loongarch/fw_cfg: Build in common_ss[]

In reply to Philippe Mathieu-Daudé

Nothing in LoongArch fw_cfg.c requires target specific definitions.

---
 hw/loongarch/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/loongarch/meson.build +1 -1
index bce7ebac97..005f017e21 100644
@@ -1,8 +1,8 @@
 loongarch_ss = ss.source_set()
 loongarch_ss.add(files(
-    'fw_cfg.c',
     'boot.c',
 ))
+common_ss.add(when: 'CONFIG_LOONGARCH_VIRT', if_true: files('fw_cfg.c'))
 loongarch_ss.add(when: 'CONFIG_LOONGARCH_VIRT', if_true: files('virt.c'))
 loongarch_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-build.c'))
 
Signature · 1 line
2.45.2
Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] hw/loongarch/fw_cfg: Build in common_ss[]

Quoted 12 lines · Philippe Mathieu-Daudé

Nothing in LoongArch fw_cfg.c requires target specific definitions.

---
  hw/loongarch/meson.build | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/loongarch/meson.build +0 -0
index bce7ebac97..005f017e21 100644

hw/loongarch/meson.build line 8

Quoted 9 lines
hw/loongarch/meson.build +1 -1
@@ -1,8 +1,8 @@
  loongarch_ss = ss.source_set()
  loongarch_ss.add(files(
-    'fw_cfg.c',
      'boot.c',
  ))
+common_ss.add(when: 'CONFIG_LOONGARCH_VIRT', if_true: files('fw_cfg.c'))
  loongarch_ss.add(when: 'CONFIG_LOONGARCH_VIRT', if_true: files('virt.c'))
  loongarch_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-build.c'))
 
Reviewed-by on the v1 series Applied
#5 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 11 lines · Philippe Mathieu-Daudé

LoongArch fw_cfg.c doesn't use target specific declarations, build it as common object.

Philippe Mathieu-Daudé (2):
hw/loongarch/virt: Remove unnecessary 'cpu.h' inclusion hw/loongarch/fw_cfg: Build in common_ss[]

  include/hw/loongarch/virt.h | 1 -
  hw/loongarch/meson.build    | 2 +-
  2 files changed, 1 insertion(+), 2 deletions(-)

Applied to loongarch-next.

Thanks.
Song Gao