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>
This commit is contained in:
Thomas Huth 2020-08-19 08:52:01 +02:00 committed by Thomas Huth
parent 853b4baf30
commit 0bc6746e85
3 changed files with 49 additions and 14 deletions

View file

@ -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) {