]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/arm/aspeed: Introduce aspeed_soc_cpu_type() helper
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Thu, 25 Jan 2024 05:55:43 +0000 (06:55 +0100)
committerCédric Le Goater <clg@kaod.org>
Thu, 1 Feb 2024 07:13:30 +0000 (08:13 +0100)
In order to alter AspeedSoCClass::cpu_type in the next
commit, introduce the aspeed_soc_cpu_type() helper to
retrieve the per-SoC CPU type from AspeedSoCClass.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
hw/arm/aspeed_ast10x0.c
hw/arm/aspeed_ast2400.c
hw/arm/aspeed_ast2600.c
hw/arm/aspeed_soc_common.c
include/hw/arm/aspeed_soc.h

index 8becb146a8df5a7bca9f7120a2ea29f7185d53d0..dca601a3f9b6c2a4100bcd8ccbb8aae781005211 100644 (file)
@@ -211,7 +211,7 @@ static void aspeed_soc_ast1030_realize(DeviceState *dev_soc, Error **errp)
     /* AST1030 CPU Core */
     armv7m = DEVICE(&a->armv7m);
     qdev_prop_set_uint32(armv7m, "num-irq", 256);
-    qdev_prop_set_string(armv7m, "cpu-type", sc->cpu_type);
+    qdev_prop_set_string(armv7m, "cpu-type", aspeed_soc_cpu_type(sc));
     qdev_connect_clock_in(armv7m, "cpuclk", s->sysclk);
     object_property_set_link(OBJECT(&a->armv7m), "memory",
                              OBJECT(s->memory), &error_abort);
index ad76035528fd1d7c33535f1d03a1f3c02811d697..3baf95916d469d2a41a160dd8e3a81b4c93eb982 100644 (file)
@@ -156,7 +156,8 @@ static void aspeed_ast2400_soc_init(Object *obj)
     }
 
     for (i = 0; i < sc->num_cpus; i++) {
-        object_initialize_child(obj, "cpu[*]", &a->cpu[i], sc->cpu_type);
+        object_initialize_child(obj, "cpu[*]", &a->cpu[i],
+                                aspeed_soc_cpu_type(sc));
     }
 
     snprintf(typename, sizeof(typename), "aspeed.scu-%s", socname);
index 386a88d4e0f9b6bef91132538f05ad02d750189d..b264433cf0951b8c30573dec34a87acebc14f243 100644 (file)
@@ -158,7 +158,8 @@ static void aspeed_soc_ast2600_init(Object *obj)
     }
 
     for (i = 0; i < sc->num_cpus; i++) {
-        object_initialize_child(obj, "cpu[*]", &a->cpu[i], sc->cpu_type);
+        object_initialize_child(obj, "cpu[*]", &a->cpu[i],
+                                aspeed_soc_cpu_type(sc));
     }
 
     snprintf(typename, sizeof(typename), "aspeed.scu-%s", socname);
index 828f61093bfa1e82dfd13fffbf3d71e9c19d629e..36ca189ce960dc0ac6565e00379aa59c00717e44 100644 (file)
 #include "hw/char/serial.h"
 
 
+const char *aspeed_soc_cpu_type(AspeedSoCClass *sc)
+{
+    return sc->cpu_type;
+}
+
 qemu_irq aspeed_soc_get_irq(AspeedSoCState *s, int dev)
 {
     return ASPEED_SOC_GET_CLASS(s)->get_irq(s, dev);
index cb832bc1ee142c08fad48c8a854e430b6fcefe1c..a060a59918749fbf4cf02d239599d1668f64417f 100644 (file)
@@ -143,6 +143,7 @@ struct AspeedSoCClass {
     qemu_irq (*get_irq)(AspeedSoCState *s, int dev);
 };
 
+const char *aspeed_soc_cpu_type(AspeedSoCClass *sc);
 
 enum {
     ASPEED_DEV_SPI_BOOT,