mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
next-cube: move en ethernet MMIO to separate memory region on next-pc device
Move the en ethernet MMIO accesses to a separate memory region on the next-pc device instead of being part of the next.scr MMIO memory region. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Thomas Huth <huth@tuxfamily.org> Message-ID: <20241222130012.1013374-14-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth <huth@tuxfamily.org>
This commit is contained in:
parent
71936afe41
commit
292ab2faa7
1 changed files with 40 additions and 8 deletions
|
@ -110,6 +110,7 @@ struct NeXTPC {
|
|||
|
||||
MemoryRegion floppy_mem;
|
||||
MemoryRegion timer_mem;
|
||||
MemoryRegion dummyen_mem;
|
||||
MemoryRegion mmiomem;
|
||||
MemoryRegion scrmem;
|
||||
|
||||
|
@ -372,11 +373,6 @@ static uint64_t next_scr_readfn(void *opaque, hwaddr addr, unsigned size)
|
|||
uint64_t val;
|
||||
|
||||
switch (addr) {
|
||||
/* For now return dummy byte to allow the Ethernet test to timeout */
|
||||
case 0x6000:
|
||||
val = 0xff;
|
||||
break;
|
||||
|
||||
default:
|
||||
DPRINTF("BMAP Read @ 0x%x size %u\n", (unsigned int)addr, size);
|
||||
val = 0;
|
||||
|
@ -1012,6 +1008,38 @@ static const MemoryRegionOps next_timer_ops = {
|
|||
.endianness = DEVICE_BIG_ENDIAN,
|
||||
};
|
||||
|
||||
static void next_dummy_en_write(void *opaque, hwaddr addr, uint64_t val,
|
||||
unsigned size)
|
||||
{
|
||||
/* Do nothing */
|
||||
return;
|
||||
}
|
||||
|
||||
static uint64_t next_dummy_en_read(void *opaque, hwaddr addr, unsigned size)
|
||||
{
|
||||
uint64_t val;
|
||||
|
||||
switch (addr) {
|
||||
case 0:
|
||||
/* For now return dummy byte to allow the Ethernet test to timeout */
|
||||
val = 0xff;
|
||||
break;
|
||||
|
||||
default:
|
||||
val = 0;
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static const MemoryRegionOps next_dummy_en_ops = {
|
||||
.read = next_dummy_en_read,
|
||||
.write = next_dummy_en_write,
|
||||
.valid.min_access_size = 1,
|
||||
.valid.max_access_size = 4,
|
||||
.endianness = DEVICE_BIG_ENDIAN,
|
||||
};
|
||||
|
||||
static void next_pc_reset(DeviceState *dev)
|
||||
{
|
||||
NeXTPC *s = NEXT_PC(dev);
|
||||
|
@ -1034,6 +1062,10 @@ static void next_pc_realize(DeviceState *dev, Error **errp)
|
|||
SysBusDevice *sbd;
|
||||
DeviceState *d;
|
||||
|
||||
/* en network (dummy) */
|
||||
memory_region_add_subregion(&s->scrmem, 0x6000,
|
||||
&s->dummyen_mem);
|
||||
|
||||
/* SCSI */
|
||||
sbd = SYS_BUS_DEVICE(&s->next_scsi);
|
||||
if (!sysbus_realize(sbd, errp)) {
|
||||
|
@ -1093,6 +1125,9 @@ static void next_pc_init(Object *obj)
|
|||
sysbus_init_mmio(sbd, &s->mmiomem);
|
||||
sysbus_init_mmio(sbd, &s->scrmem);
|
||||
|
||||
memory_region_init_io(&s->dummyen_mem, OBJECT(s), &next_dummy_en_ops, s,
|
||||
"next.en", 0x20);
|
||||
|
||||
object_initialize_child(obj, "next-scsi", &s->next_scsi, TYPE_NEXT_SCSI);
|
||||
|
||||
memory_region_init_io(&s->floppy_mem, OBJECT(s), &next_floppy_ops, s,
|
||||
|
@ -1238,9 +1273,6 @@ static void next_cube_init(MachineState *machine)
|
|||
}
|
||||
}
|
||||
|
||||
/* TODO: */
|
||||
/* Network */
|
||||
|
||||
/* DMA */
|
||||
memory_region_init_io(&m->dmamem, NULL, &next_dma_ops, machine,
|
||||
"next.dma", 0x5000);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue