Revisão | 32ef57effaaa609157f971c3aacc20c5237dfd66 (tree) |
---|---|
Hora | 2019-06-16 22:31:41 |
Autor | Philippe Mathieu-Daudé <philmd@redh...> |
Commiter | Yoshinori Sato |
hw/rx: Restrict the RX62N microcontroller to the RX62N CPU core
While the VIRT machine can use different microcontrollers,
the RX62N microcontroller is tied to the RX62N CPU core.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
@@ -17,6 +17,7 @@ | ||
17 | 17 | */ |
18 | 18 | |
19 | 19 | #include "qemu/osdep.h" |
20 | +#include "qemu/error-report.h" | |
20 | 21 | #include "qapi/error.h" |
21 | 22 | #include "qemu-common.h" |
22 | 23 | #include "cpu.h" |
@@ -56,6 +57,7 @@ static void rx_load_image(RXCPU *cpu, const char *filename, | ||
56 | 57 | |
57 | 58 | static void rxvirt_init(MachineState *machine) |
58 | 59 | { |
60 | + MachineClass *mc = MACHINE_GET_CLASS(machine); | |
59 | 61 | RX62NState *s = g_new(RX62NState, 1); |
60 | 62 | MemoryRegion *sysmem = get_system_memory(); |
61 | 63 | MemoryRegion *sdram = g_new(MemoryRegion, 1); |
@@ -64,6 +66,12 @@ static void rxvirt_init(MachineState *machine) | ||
64 | 66 | void *dtb = NULL; |
65 | 67 | int dtb_size; |
66 | 68 | |
69 | + if (strcmp(machine->cpu_type, mc->default_cpu_type) != 0) { | |
70 | + error_report("This board can only be used with CPU %s", | |
71 | + mc->default_cpu_type); | |
72 | + exit(1); | |
73 | + } | |
74 | + | |
67 | 75 | /* Allocate memory space */ |
68 | 76 | memory_region_init_ram(sdram, NULL, "sdram", 16 * MiB, |
69 | 77 | &error_fatal); |