diff mbox series

[7/8] hw/arm/aspeed/1030: Check for CPU types in machine_run_board_init()

Message ID 20240123063842.35255-8-philmd@linaro.org
State New
Headers show
Series hw/arm/cortex-a: Check for CPU types in machine_run_board_init() | expand

Commit Message

Philippe Mathieu-Daudé Jan. 23, 2024, 6:38 a.m. UTC
Restrict MachineClass::valid_cpu_types[] to the single
valid CPU type.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/arm/aspeed.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 393c97d55e..62d08899d8 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -1162,6 +1162,11 @@  static const char * const ast2600_a3_valid_cpu_types[] = {
     NULL
 };
 
+static const char * const ast1030_a1_valid_cpu_types[] = {
+    ARM_CPU_TYPE_NAME("cortex-m4"), /* TODO cortex-m4f */
+    NULL
+};
+
 static void aspeed_machine_class_init(ObjectClass *oc, void *data)
 {
     MachineClass *mc = MACHINE_CLASS(oc);
@@ -1613,6 +1618,7 @@  static void aspeed_minibmc_machine_ast1030_evb_class_init(ObjectClass *oc,
     AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc);
 
     mc->desc = "Aspeed AST1030 MiniBMC (Cortex-M4)";
+    mc->valid_cpu_types = ast1030_a1_valid_cpu_types;
     amc->soc_name = "ast1030-a1";
     amc->hw_strap1 = 0;
     amc->hw_strap2 = 0;