hw/arm/raspi: Build objects once
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 and TYPE_BCM2838 types to qemu-system-arm, but they are not user-creatable, so not an issue. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Acked-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20260526203722.79463-3-philmd@linaro.org>
Philippe Mathieu-Daudé committed
Mar 23, 2025 at 22:48 UTC
0c7b3beb4b99947a234762eca3506a573934fe66
3 files changed
+6
-10
hw/arm/bcm2836.c
-4
@@ -195,7 +195,6 @@ static void bcm2836_class_init(ObjectClass *oc, const void *data)
195
dc->realize = bcm2836_realize;
196
};
197
198
-#ifdef TARGET_AARCH64
198
static void bcm2837_class_init(ObjectClass *oc, const void *data)
199
{
200
DeviceClass *dc = DEVICE_CLASS(oc);
@@ -208,7 +207,6 @@ static void bcm2837_class_init(ObjectClass *oc, const void *data)
207
bc->clusterid = 0x0;
208
dc->realize = bcm2836_realize;
209
};
211
-#endif
210
211
static const TypeInfo bcm283x_types[] = {
212
{
@@ -219,12 +217,10 @@ static const TypeInfo bcm283x_types[] = {
217
.name = TYPE_BCM2836,
218
.parent = TYPE_BCM283X,
219
.class_init = bcm2836_class_init,
222
-#ifdef TARGET_AARCH64
220
}, {
221
.name = TYPE_BCM2837,
222
.parent = TYPE_BCM283X,
223
.class_init = bcm2837_class_init,
227
-#endif
224
}, {
225
.name = TYPE_BCM283X,
226
.parent = TYPE_BCM283X_BASE,
hw/arm/meson.build
+6
-2
@@ -27,8 +27,12 @@ arm_common_ss.add(when: 'CONFIG_ALLWINNER_A10', if_true: files('allwinner-a10.c'
27
arm_common_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3.c', 'orangepi.c'))
28
arm_common_ss.add(when: 'CONFIG_ALLWINNER_R40', if_true: files('allwinner-r40.c', 'bananapi_m2u.c'))
29
arm_common_ss.add(when: 'CONFIG_MAX78000_SOC', if_true: files('max78000_soc.c'))
30
-arm_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2836.c', 'raspi.c'))
31
-arm_common_ss.add(when: ['CONFIG_RASPI', 'TARGET_AARCH64'], if_true: files('bcm2838.c', 'raspi4b.c'))
30
+arm_common_ss.add(when: 'CONFIG_RASPI', if_true: files(
31
+ 'bcm2836.c',
32
+ 'bcm2838.c',
33
+ 'raspi.c',
34
+ 'raspi4b.c'
35
+))
36
arm_common_ss.add(when: 'CONFIG_STM32F100_SOC', if_true: files('stm32f100_soc.c'))
37
arm_common_ss.add(when: 'CONFIG_STM32F205_SOC', if_true: files('stm32f205_soc.c'))
38
arm_common_ss.add(when: 'CONFIG_STM32F405_SOC', if_true: files('stm32f405_soc.c'))
hw/arm/raspi.c
-4
@@ -367,7 +367,6 @@ static void raspi2b_machine_class_init(ObjectClass *oc, const void *data)
367
raspi_machine_class_init(mc, rmc->board_rev);
368
};
369
370
-#ifdef TARGET_AARCH64
370
static void raspi3ap_machine_class_init(ObjectClass *oc, const void *data)
371
{
372
MachineClass *mc = MACHINE_CLASS(oc);
@@ -387,7 +386,6 @@ static void raspi3b_machine_class_init(ObjectClass *oc, const void *data)
386
rmc->board_rev = 0xa02082;
387
raspi_machine_class_init(mc, rmc->board_rev);
388
};
390
-#endif /* TARGET_AARCH64 */
389
390
static const TypeInfo raspi_machine_types[] = {
391
{
@@ -405,7 +403,6 @@ static const TypeInfo raspi_machine_types[] = {
403
.parent = TYPE_RASPI_MACHINE,
404
.class_init = raspi2b_machine_class_init,
405
.interfaces = arm_machine_interfaces,
408
-#ifdef TARGET_AARCH64
406
}, {
407
.name = MACHINE_TYPE_NAME("raspi3ap"),
408
.parent = TYPE_RASPI_MACHINE,
@@ -416,7 +413,6 @@ static const TypeInfo raspi_machine_types[] = {
413
.parent = TYPE_RASPI_MACHINE,
414
.class_init = raspi3b_machine_class_init,
415
.interfaces = aarch64_machine_interfaces,
419
-#endif
416
}, {
417
.name = TYPE_RASPI_MACHINE,
418
.parent = TYPE_RASPI_BASE_MACHINE,