From 62437f90cf90d1a0fda855f17ca6d9e7c0204f92 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Fri, 24 Sep 2021 08:38:00 +0100 Subject: nubus: move nubus to its own 32-bit address space MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to "Designing Cards and Drivers for the Macintosh Family" the Nubus has its own 32-bit address space based upon physical slot addressing. Move Nubus to its own 32-bit address space and then use memory region aliases to map available slot and super slot ranges into the q800 system address space via the Macintosh Nubus bridge. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Laurent Vivier Message-Id: <20210924073808.1041-13-mark.cave-ayland@ilande.co.uk> Signed-off-by: Laurent Vivier --- include/hw/nubus/mac-nubus-bridge.h | 2 ++ include/hw/nubus/nubus.h | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'include/hw/nubus') diff --git a/include/hw/nubus/mac-nubus-bridge.h b/include/hw/nubus/mac-nubus-bridge.h index 118d672..04451d3 100644 --- a/include/hw/nubus/mac-nubus-bridge.h +++ b/include/hw/nubus/mac-nubus-bridge.h @@ -23,6 +23,8 @@ struct MacNubusState { SysBusDevice sysbus_dev; NubusBus *bus; + MemoryRegion super_slot_alias; + MemoryRegion slot_alias; }; #endif diff --git a/include/hw/nubus/nubus.h b/include/hw/nubus/nubus.h index 343be95..9f9386a 100644 --- a/include/hw/nubus/nubus.h +++ b/include/hw/nubus/nubus.h @@ -17,6 +17,9 @@ #define NUBUS_SUPER_SLOT_SIZE 0x10000000U #define NUBUS_SUPER_SLOT_NB 0xe +#define NUBUS_SLOT_BASE (NUBUS_SUPER_SLOT_SIZE * \ + (NUBUS_SUPER_SLOT_NB + 1)) + #define NUBUS_SLOT_SIZE 0x01000000 #define NUBUS_FIRST_SLOT 0x0 #define NUBUS_LAST_SLOT 0xf @@ -33,6 +36,9 @@ OBJECT_DECLARE_SIMPLE_TYPE(NubusBus, NUBUS_BUS) struct NubusBus { BusState qbus; + AddressSpace nubus_as; + MemoryRegion nubus_mr; + MemoryRegion super_slot_io; MemoryRegion slot_io; -- cgit v1.1