diff options
author | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2021-09-24 08:37:51 +0100 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2021-09-29 10:45:19 +0200 |
commit | 90be1dea5017e518076f2a0d3ad26e158b92a1da (patch) | |
tree | 929b618c0d62c716031f3cf901e457324bb5b5c9 /hw/nubus | |
parent | e2c49c0515f5995b267a9795d88733865d2d0ced (diff) |
nubus-device: expose separate super slot memory region
According to "Designing Cards and Drivers for the Macintosh Family" each physical
nubus slot can access 2 separate address ranges: a super slot memory region which
is 256MB and a standard slot memory region which is 16MB.
Currently a Nubus device uses the physical slot number to determine whether it is
using a standard slot memory region or a super slot memory region rather than
exposing both memory regions for use as required.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210924073808.1041-4-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'hw/nubus')
-rw-r--r-- | hw/nubus/nubus-device.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/hw/nubus/nubus-device.c b/hw/nubus/nubus-device.c index be01269563..4e23df1280 100644 --- a/hw/nubus/nubus-device.c +++ b/hw/nubus/nubus-device.c @@ -168,26 +168,26 @@ static void nubus_device_realize(DeviceState *dev, Error **errp) } nd->slot = nubus->current_slot++; - name = g_strdup_printf("nubus-slot-%d", nd->slot); - - if (nd->slot < NUBUS_FIRST_SLOT) { - /* Super */ - slot_offset = (nd->slot - 6) * NUBUS_SUPER_SLOT_SIZE; - - memory_region_init(&nd->slot_mem, OBJECT(dev), name, - NUBUS_SUPER_SLOT_SIZE); - memory_region_add_subregion(&nubus->super_slot_io, slot_offset, - &nd->slot_mem); - } else { - /* Normal */ - slot_offset = nd->slot * NUBUS_SLOT_SIZE; - - memory_region_init(&nd->slot_mem, OBJECT(dev), name, NUBUS_SLOT_SIZE); - memory_region_add_subregion(&nubus->slot_io, slot_offset, - &nd->slot_mem); - } + /* Super */ + slot_offset = nd->slot * NUBUS_SUPER_SLOT_SIZE; + + name = g_strdup_printf("nubus-super-slot-%x", nd->slot); + memory_region_init(&nd->super_slot_mem, OBJECT(dev), name, + NUBUS_SUPER_SLOT_SIZE); + memory_region_add_subregion(&nubus->super_slot_io, slot_offset, + &nd->super_slot_mem); + g_free(name); + + /* Normal */ + slot_offset = nd->slot * NUBUS_SLOT_SIZE; + + name = g_strdup_printf("nubus-slot-%x", nd->slot); + memory_region_init(&nd->slot_mem, OBJECT(dev), name, NUBUS_SLOT_SIZE); + memory_region_add_subregion(&nubus->slot_io, slot_offset, + &nd->slot_mem); g_free(name); + nubus_register_format_block(nd); } |