summaryrefslogtreecommitdiff
path: root/hw/m68k/an5206.c
diff options
context:
space:
mode:
authorThomas Huth <huth@tuxfamily.org>2020-08-19 08:52:01 +0200
committerThomas Huth <thuth@redhat.com>2020-09-03 12:47:33 +0200
commit0bc6746e855621398940b51d9bae1827026ea672 (patch)
tree307644a0ecabc6e467e9219e8918481a2bdaed19 /hw/m68k/an5206.c
parent853b4baf30a515d87229ee94f89f4b3ad376c9d2 (diff)
downloadqemu-0bc6746e855621398940b51d9bae1827026ea672.zip
hw/m68k: QOMify the mcf5206 system integration module
The mcf5206 system integration module should be a proper device. Let's finally QOMify it. Signed-off-by: Thomas Huth <huth@tuxfamily.org> Message-Id: <20200819065201.4045-1-huth@tuxfamily.org>
Diffstat (limited to 'hw/m68k/an5206.c')
-rw-r--r--hw/m68k/an5206.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/hw/m68k/an5206.c b/hw/m68k/an5206.c
index 846f4e40c6..673898b0ea 100644
--- a/hw/m68k/an5206.c
+++ b/hw/m68k/an5206.c
@@ -21,7 +21,17 @@
#define AN5206_MBAR_ADDR 0x10000000
#define AN5206_RAMBAR_ADDR 0x20000000
-/* Board init. */
+static void mcf5206_init(MemoryRegion *sysmem, uint32_t base)
+{
+ DeviceState *dev;
+ SysBusDevice *s;
+
+ dev = qdev_new(TYPE_MCF5206_MBAR);
+ s = SYS_BUS_DEVICE(dev);
+ sysbus_realize_and_unref(s, &error_fatal);
+
+ memory_region_add_subregion(sysmem, base, sysbus_mmio_get_region(s, 0));
+}
static void an5206_init(MachineState *machine)
{
@@ -51,7 +61,7 @@ static void an5206_init(MachineState *machine)
memory_region_init_ram(sram, NULL, "an5206.sram", 512, &error_fatal);
memory_region_add_subregion(address_space_mem, AN5206_RAMBAR_ADDR, sram);
- mcf5206_init(address_space_mem, AN5206_MBAR_ADDR, cpu);
+ mcf5206_init(address_space_mem, AN5206_MBAR_ADDR);
/* Load kernel. */
if (!kernel_filename) {