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

Philippe Mathieu-Daudé posted 8 patches 10 months, 1 week ago
Maintainers: "Cédric Le Goater" <clg@kaod.org>, Peter Maydell <peter.maydell@linaro.org>, Andrew Jeffery <andrew@codeconstruct.com.au>, Joel Stanley <joel@jms.id.au>, Igor Mitsyanko <i.mitsyanko@gmail.com>, Rob Herring <robh@kernel.org>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Alistair Francis <alistair@alistair23.me>
There is a newer version of this series
[PATCH 7/8] hw/arm/aspeed/1030: Check for CPU types in machine_run_board_init()
Posted by Philippe Mathieu-Daudé 10 months, 1 week ago
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 --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;
-- 
2.41.0