[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-for-9.0 6/6] hw/arm/musca: Simplify setting MachineClass::valid_c
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH-for-9.0 6/6] hw/arm/musca: Simplify setting MachineClass::valid_cpu_types[] |
Date: |
Thu, 16 Nov 2023 00:21:53 +0100 |
Musca boards use the embedded subsystems (SSE) tied to a specific
Cortex core. Our models only use the Cortex-M33.
Use the common code introduced in commit c9cf636d48 ("machine: Add
a valid_cpu_types property") to check for valid CPU type at the
board level.
Remove the now unused MachineClass::default_cpu_type field.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/arm/musca.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/hw/arm/musca.c b/hw/arm/musca.c
index 6eeee57c9d..d3658354ba 100644
--- a/hw/arm/musca.c
+++ b/hw/arm/musca.c
@@ -355,7 +355,6 @@ static void musca_init(MachineState *machine)
{
MuscaMachineState *mms = MUSCA_MACHINE(machine);
MuscaMachineClass *mmc = MUSCA_MACHINE_GET_CLASS(mms);
- MachineClass *mc = MACHINE_GET_CLASS(machine);
MemoryRegion *system_memory = get_system_memory();
DeviceState *ssedev;
DeviceState *dev_splitter;
@@ -366,12 +365,6 @@ static void musca_init(MachineState *machine)
assert(mmc->num_irqs <= MUSCA_NUMIRQ_MAX);
assert(mmc->num_mpcs <= MUSCA_MPC_MAX);
- if (strcmp(machine->cpu_type, mc->default_cpu_type) != 0) {
- error_report("This board can only be used with CPU %s",
- mc->default_cpu_type);
- exit(1);
- }
-
mms->sysclk = clock_new(OBJECT(machine), "SYSCLK");
clock_set_hz(mms->sysclk, SYSCLK_FRQ);
mms->s32kclk = clock_new(OBJECT(machine), "S32KCLK");
@@ -603,12 +596,16 @@ static void musca_init(MachineState *machine)
static void musca_class_init(ObjectClass *oc, void *data)
{
+ static const char *machine_valid_cpu_types[] = {
+ ARM_CPU_TYPE_NAME("cortex-m33"),
+ NULL
+ };
MachineClass *mc = MACHINE_CLASS(oc);
mc->default_cpus = 2;
mc->min_cpus = mc->default_cpus;
mc->max_cpus = mc->default_cpus;
- mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-m33");
+ mc->valid_cpu_types = machine_valid_cpu_types;
mc->init = musca_init;
}
--
2.41.0
- [PATCH-for-8.2? 0/6] hw/arm/stm32xxx: Report error when incorrect CPU is used, Philippe Mathieu-Daudé, 2023/11/15
- [PATCH-for-8.2? 2/6] hw/arm/stm32f205: Report error when incorrect CPU is used, Philippe Mathieu-Daudé, 2023/11/15
- [PATCH-for-8.2? 3/6] hw/arm/stm32f100: Report error when incorrect CPU is used, Philippe Mathieu-Daudé, 2023/11/15
- [PATCH-for-8.2? 1/6] hw/arm/stm32f405: Report error when incorrect CPU is used, Philippe Mathieu-Daudé, 2023/11/15
- [PATCH-for-9.0 4/6] hw/arm/msf2: Simplify setting MachineClass::valid_cpu_types[], Philippe Mathieu-Daudé, 2023/11/15
- [PATCH-for-9.0 5/6] hw/arm/npcm7xx_boards: Simplify setting MachineClass::valid_cpu_types[], Philippe Mathieu-Daudé, 2023/11/15
- [PATCH-for-9.0 6/6] hw/arm/musca: Simplify setting MachineClass::valid_cpu_types[],
Philippe Mathieu-Daudé <=