diff options
author | Niek Linnenbank <nieklinnenbank@gmail.com> | 2020-03-05 16:09:19 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2020-03-05 16:09:19 +0000 |
commit | 17c7576263339f20d77964083704f3da4e4b8c91 (patch) | |
tree | 2b90a5ce88bb7794ef102b32b7bd38c4f497a07d /hw | |
parent | 2104df2a1fbf44b2564427aa72fd58d66ce290a7 (diff) | |
download | qemu-17c7576263339f20d77964083704f3da4e4b8c91.zip qemu-17c7576263339f20d77964083704f3da4e4b8c91.tar.gz qemu-17c7576263339f20d77964083704f3da4e4b8c91.tar.bz2 |
hw/arm/cubieboard: restrict allowed CPU type to ARM Cortex-A8
The Cubieboard has an ARM Cortex-A8. Instead of simply ignoring a
bogus -cpu option provided by the user, give them an error message so
they know their command line is wrong.
Signed-off-by: Niek Linnenbank <nieklinnenbank@gmail.com>
Message-id: 20200227220149.6845-3-nieklinnenbank@gmail.com
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
[PMM: tweaked commit message]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/arm/cubieboard.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/hw/arm/cubieboard.c b/hw/arm/cubieboard.c index 0195925..010375f 100644 --- a/hw/arm/cubieboard.c +++ b/hw/arm/cubieboard.c @@ -30,9 +30,17 @@ static struct arm_boot_info cubieboard_binfo = { static void cubieboard_init(MachineState *machine) { - AwA10State *a10 = AW_A10(object_new(TYPE_AW_A10)); + AwA10State *a10; Error *err = NULL; + /* Only allow Cortex-A8 for this board */ + if (strcmp(machine->cpu_type, ARM_CPU_TYPE_NAME("cortex-a8")) != 0) { + error_report("This board can only be used with cortex-a8 CPU"); + exit(1); + } + + a10 = AW_A10(object_new(TYPE_AW_A10)); + object_property_set_int(OBJECT(&a10->emac), 1, "phy-addr", &err); if (err != NULL) { error_reportf_err(err, "Couldn't set phy address: "); |