From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Pierrick Bouvier <pierrick.bouvier@linaro.org>, qemu-devel@nongnu.org
Cc: Anton Johansson <anjo@rev.ng>,
Richard Henderson <richard.henderson@linaro.org>
Subject: [RFC PATCH v2 11/11] hw/arm/raspi: Build objects once
Date: Fri, 18 Apr 2025 02:50:59 +0200 [thread overview]
Message-ID: <20250418005059.4436-12-philmd@linaro.org> (raw)
In-Reply-To: <20250418005059.4436-1-philmd@linaro.org>
Now than Raspi machines can be filtered when running a
qemu-system-arm or qemu-system-aarch64 binary, we can
remove the TARGET_AARCH64 #ifdef'ry and compile the
aspeed.c file once, moving it from arm_ss[] source set
to arm_common_ss[]. Note, we expose the TYPE_BCM2837
type to qemu-system-arm, but it is not user-creatable,
so not an issue.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/arm/bcm2836.c | 4 ----
hw/arm/raspi.c | 4 ----
hw/arm/meson.build | 8 ++++++--
3 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c
index 95e16806fa1..7dd81e8e0f9 100644
--- a/hw/arm/bcm2836.c
+++ b/hw/arm/bcm2836.c
@@ -195,7 +195,6 @@ static void bcm2836_class_init(ObjectClass *oc, void *data)
dc->realize = bcm2836_realize;
};
-#ifdef TARGET_AARCH64
static void bcm2837_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
@@ -208,7 +207,6 @@ static void bcm2837_class_init(ObjectClass *oc, void *data)
bc->clusterid = 0x0;
dc->realize = bcm2836_realize;
};
-#endif
static const TypeInfo bcm283x_types[] = {
{
@@ -219,12 +217,10 @@ static const TypeInfo bcm283x_types[] = {
.name = TYPE_BCM2836,
.parent = TYPE_BCM283X,
.class_init = bcm2836_class_init,
-#ifdef TARGET_AARCH64
}, {
.name = TYPE_BCM2837,
.parent = TYPE_BCM283X,
.class_init = bcm2837_class_init,
-#endif
}, {
.name = TYPE_BCM283X,
.parent = TYPE_BCM283X_BASE,
diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c
index 8a2da650087..980e4a14793 100644
--- a/hw/arm/raspi.c
+++ b/hw/arm/raspi.c
@@ -367,7 +367,6 @@ static void raspi2b_machine_class_init(ObjectClass *oc, void *data)
raspi_machine_class_init(mc, rmc->board_rev);
};
-#ifdef TARGET_AARCH64
static void raspi3ap_machine_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
@@ -387,7 +386,6 @@ static void raspi3b_machine_class_init(ObjectClass *oc, void *data)
rmc->board_rev = 0xa02082;
raspi_machine_class_init(mc, rmc->board_rev);
};
-#endif /* TARGET_AARCH64 */
static const TypeInfo raspi_machine_types[] = {
{
@@ -417,7 +415,6 @@ static const TypeInfo raspi_machine_types[] = {
{ TYPE_TARGET_AARCH64_MACHINE },
{ },
},
-#ifdef TARGET_AARCH64
}, {
.name = MACHINE_TYPE_NAME("raspi3ap"),
.parent = TYPE_RASPI_MACHINE,
@@ -434,7 +431,6 @@ static const TypeInfo raspi_machine_types[] = {
{ TYPE_TARGET_AARCH64_MACHINE },
{ },
},
-#endif
}, {
.name = TYPE_RASPI_MACHINE,
.parent = TYPE_RASPI_BASE_MACHINE,
diff --git a/hw/arm/meson.build b/hw/arm/meson.build
index f76e7fb229f..f52034ff6a2 100644
--- a/hw/arm/meson.build
+++ b/hw/arm/meson.build
@@ -27,8 +27,12 @@ arm_common_ss.add(when: 'CONFIG_OMAP', if_true: files('omap1.c'))
arm_common_ss.add(when: 'CONFIG_ALLWINNER_A10', if_true: files('allwinner-a10.c', 'cubieboard.c'))
arm_common_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3.c', 'orangepi.c'))
arm_common_ss.add(when: 'CONFIG_ALLWINNER_R40', if_true: files('allwinner-r40.c', 'bananapi_m2u.c'))
-arm_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2836.c', 'raspi.c'))
-arm_common_ss.add(when: ['CONFIG_RASPI', 'TARGET_AARCH64'], if_true: files('bcm2838.c', 'raspi4b.c'))
+arm_common_ss.add(when: 'CONFIG_RASPI', if_true: files(
+ 'bcm2836.c',
+ 'bcm2838.c',
+ 'raspi.c',
+ 'raspi4b.c',
+))
arm_common_ss.add(when: 'CONFIG_STM32F100_SOC', if_true: files('stm32f100_soc.c'))
arm_common_ss.add(when: 'CONFIG_STM32F205_SOC', if_true: files('stm32f205_soc.c'))
arm_common_ss.add(when: 'CONFIG_STM32F405_SOC', if_true: files('stm32f405_soc.c'))
--
2.47.1
next prev parent reply other threads:[~2025-04-18 0:53 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-18 0:50 [RFC PATCH v2 00/11] single-binary: Make hw/arm/ common Philippe Mathieu-Daudé
2025-04-18 0:50 ` [RFC PATCH v2 01/11] qapi: Rename TargetInfo structure as BinaryTargetInfo Philippe Mathieu-Daudé
2025-04-18 2:55 ` Pierrick Bouvier
2025-04-18 0:50 ` [RFC PATCH v2 02/11] qemu: Convert target_name() to TargetInfo API Philippe Mathieu-Daudé
2025-04-18 3:01 ` Pierrick Bouvier
2025-04-18 14:02 ` Philippe Mathieu-Daudé
2025-04-18 16:23 ` Pierrick Bouvier
2025-04-18 17:15 ` Philippe Mathieu-Daudé
2025-04-18 0:50 ` [RFC PATCH v2 03/11] system/vl: Filter machine list available for a particular target binary Philippe Mathieu-Daudé
2025-04-18 3:06 ` Pierrick Bouvier
2025-04-18 14:14 ` Philippe Mathieu-Daudé
2025-04-18 0:50 ` [RFC PATCH v2 04/11] hw/arm: Register TYPE_TARGET_ARM/AARCH64_CPU QOM interfaces Philippe Mathieu-Daudé
2025-04-18 3:07 ` Pierrick Bouvier
2025-04-18 14:07 ` Philippe Mathieu-Daudé
2025-04-18 16:30 ` Pierrick Bouvier
2025-04-18 17:04 ` Philippe Mathieu-Daudé
2025-04-18 17:07 ` Pierrick Bouvier
2025-04-18 17:10 ` Philippe Mathieu-Daudé
2025-04-18 17:23 ` Pierrick Bouvier
2025-04-18 17:32 ` Philippe Mathieu-Daudé
2025-04-19 1:17 ` Pierrick Bouvier
2025-04-18 0:50 ` [RFC PATCH v2 05/11] hw/arm: Filter machine types for qemu-system-aarch64 binary Philippe Mathieu-Daudé
2025-04-18 0:50 ` [RFC PATCH v2 06/11] hw/arm: Filter machine types for qemu-system-arm binary Philippe Mathieu-Daudé
2025-04-18 3:08 ` Pierrick Bouvier
2025-04-18 0:50 ` [RFC PATCH v2 07/11] hw/core: Allow ARM/Aarch64 binaries to use the 'none' machine Philippe Mathieu-Daudé
2025-04-18 3:32 ` Pierrick Bouvier
2025-04-18 0:50 ` [RFC PATCH v2 08/11] config/target: Implement per-binary TargetInfo structure (ARM) Philippe Mathieu-Daudé
2025-04-18 3:39 ` Pierrick Bouvier
2025-04-18 4:02 ` Pierrick Bouvier
2025-04-18 11:20 ` Philippe Mathieu-Daudé
2025-04-18 0:50 ` [RFC PATCH v2 09/11] config/target: Implement per-binary TargetInfo structure (Aarch64) Philippe Mathieu-Daudé
2025-04-18 3:34 ` Pierrick Bouvier
2025-04-18 0:50 ` [RFC PATCH v2 10/11] hw/arm/aspeed: Build objects once Philippe Mathieu-Daudé
2025-04-18 4:02 ` Pierrick Bouvier
2025-04-18 0:50 ` Philippe Mathieu-Daudé [this message]
2025-04-18 4:03 ` [RFC PATCH v2 11/11] hw/arm/raspi: " Pierrick Bouvier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250418005059.4436-12-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=anjo@rev.ng \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).