1fa2ba3b8SLaurent Vivier /* 2fa2ba3b8SLaurent Vivier * Copyright (c) 2013-2018 Laurent Vivier <laurent@vivier.eu> 3fa2ba3b8SLaurent Vivier * 4fa2ba3b8SLaurent Vivier * This work is licensed under the terms of the GNU GPL, version 2 or later. 5fa2ba3b8SLaurent Vivier * See the COPYING file in the top-level directory. 6fa2ba3b8SLaurent Vivier * 7fa2ba3b8SLaurent Vivier */ 8fa2ba3b8SLaurent Vivier 9fa2ba3b8SLaurent Vivier #ifndef HW_NUBUS_NUBUS_H 10fa2ba3b8SLaurent Vivier #define HW_NUBUS_NUBUS_H 11fa2ba3b8SLaurent Vivier 12fa2ba3b8SLaurent Vivier #include "hw/qdev-properties.h" 13fa2ba3b8SLaurent Vivier #include "exec/address-spaces.h" 14db1015e9SEduardo Habkost #include "qom/object.h" 15*3616f424SMark Cave-Ayland #include "qemu/units.h" 16fa2ba3b8SLaurent Vivier 17fa2ba3b8SLaurent Vivier #define NUBUS_SUPER_SLOT_SIZE 0x10000000U 1803deab99SMark Cave-Ayland #define NUBUS_SUPER_SLOT_NB 0xe 19fa2ba3b8SLaurent Vivier 20fa2ba3b8SLaurent Vivier #define NUBUS_SLOT_SIZE 0x01000000 2103deab99SMark Cave-Ayland #define NUBUS_FIRST_SLOT 0x0 2203deab99SMark Cave-Ayland #define NUBUS_LAST_SLOT 0xf 2303deab99SMark Cave-Ayland #define NUBUS_SLOT_NB (NUBUS_LAST_SLOT - NUBUS_FIRST_SLOT + 1) 24fa2ba3b8SLaurent Vivier 25fa2ba3b8SLaurent Vivier #define TYPE_NUBUS_DEVICE "nubus-device" 268063396bSEduardo Habkost OBJECT_DECLARE_SIMPLE_TYPE(NubusDevice, NUBUS_DEVICE) 27fa2ba3b8SLaurent Vivier 28fa2ba3b8SLaurent Vivier #define TYPE_NUBUS_BUS "nubus-bus" 298063396bSEduardo Habkost OBJECT_DECLARE_SIMPLE_TYPE(NubusBus, NUBUS_BUS) 30fa2ba3b8SLaurent Vivier 31fa2ba3b8SLaurent Vivier #define TYPE_NUBUS_BRIDGE "nubus-bridge" 32fa2ba3b8SLaurent Vivier 33db1015e9SEduardo Habkost struct NubusBus { 34fa2ba3b8SLaurent Vivier BusState qbus; 35fa2ba3b8SLaurent Vivier 36fa2ba3b8SLaurent Vivier MemoryRegion super_slot_io; 37fa2ba3b8SLaurent Vivier MemoryRegion slot_io; 38fa2ba3b8SLaurent Vivier 3903deab99SMark Cave-Ayland uint16_t slot_available_mask; 40db1015e9SEduardo Habkost }; 41fa2ba3b8SLaurent Vivier 42*3616f424SMark Cave-Ayland #define NUBUS_DECL_ROM_MAX_SIZE (128 * KiB) 43*3616f424SMark Cave-Ayland 44db1015e9SEduardo Habkost struct NubusDevice { 45fa2ba3b8SLaurent Vivier DeviceState qdev; 46fa2ba3b8SLaurent Vivier 4703deab99SMark Cave-Ayland int32_t slot; 4890be1deaSMark Cave-Ayland MemoryRegion super_slot_mem; 49fa2ba3b8SLaurent Vivier MemoryRegion slot_mem; 50*3616f424SMark Cave-Ayland 51*3616f424SMark Cave-Ayland char *romfile; 52*3616f424SMark Cave-Ayland MemoryRegion decl_rom; 53db1015e9SEduardo Habkost }; 54fa2ba3b8SLaurent Vivier 55fa2ba3b8SLaurent Vivier #endif 56