virt: add MMIO region as unimpl device for r/w logging
This commit is contained in:
parent
7037504166
commit
a45d83e2ca
2 changed files with 9 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
config VIRT
|
||||
bool
|
||||
select UNIMP
|
||||
|
||||
config DE410
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#include "cpu-qom.h"
|
||||
#include "system/address-spaces.h"
|
||||
#include "hw/boards.h"
|
||||
#include "hw/misc/unimp.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/units.h"
|
||||
#include "qom/object.h"
|
||||
|
|
@ -10,6 +11,7 @@ typedef struct VirtMachineState {
|
|||
MachineState parent_obj;
|
||||
CR16CCPU cpu;
|
||||
MemoryRegion flash;
|
||||
MemoryRegion mmio_alias;
|
||||
} VirtMachineState;
|
||||
|
||||
typedef struct VirtMachineClass {
|
||||
|
|
@ -27,9 +29,14 @@ static void virt_init(MachineState* machine)
|
|||
object_initialize_child(OBJECT(machine), "cpu", &m_state->cpu, TYPE_CR16C_CPU);
|
||||
object_property_set_bool(OBJECT(&m_state->cpu), "realized", true, &error_abort);
|
||||
|
||||
memory_region_init_ram(&m_state->flash, NULL, "flash", 16*MiB, &error_fatal);
|
||||
memory_region_init_ram(&m_state->flash, NULL, "flash", 16*MiB - 64*KiB, &error_fatal);
|
||||
memory_region_add_subregion(get_system_memory(), 0, &m_state->flash);
|
||||
|
||||
create_unimplemented_device("mmio", 0xFF0000, 0xFFBFFF - 0xFF0000);
|
||||
//memory_region_init_alias(&m_state->mmio_alias, NULL, "mmio_alias", &m_state->flash, 0xF0000, 0xFFFFF - 0xF0000);
|
||||
|
||||
create_unimplemented_device("icu", 0xFFFC00, 0xFFFFFF - 0xFFFC00); // interrupt controller unit
|
||||
|
||||
if (machine->firmware) {
|
||||
if (!cr16c_load_firmware(&m_state->cpu, &m_state->flash, machine->firmware)) {
|
||||
exit(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue