2 * Copyright (c) 2013-2018 Laurent Vivier <laurent@vivier.eu>
4 * This work is licensed under the terms of the GNU GPL, version 2 or later.
5 * See the COPYING file in the top-level directory.
9 #ifndef HW_NUBUS_NUBUS_H
10 #define HW_NUBUS_NUBUS_H
12 #include "hw/qdev-properties.h"
13 #include "hw/sysbus.h"
14 #include "exec/address-spaces.h"
15 #include "qom/object.h"
16 #include "qemu/units.h"
18 #define NUBUS_SUPER_SLOT_SIZE 0x10000000U
19 #define NUBUS_SUPER_SLOT_NB 0xe
21 #define NUBUS_SLOT_BASE (NUBUS_SUPER_SLOT_SIZE * \
22 (NUBUS_SUPER_SLOT_NB + 1))
24 #define NUBUS_SLOT_SIZE 0x01000000
25 #define NUBUS_FIRST_SLOT 0x0
26 #define NUBUS_LAST_SLOT 0xf
27 #define NUBUS_SLOT_NB (NUBUS_LAST_SLOT - NUBUS_FIRST_SLOT + 1)
31 #define TYPE_NUBUS_DEVICE "nubus-device"
32 OBJECT_DECLARE_SIMPLE_TYPE(NubusDevice
, NUBUS_DEVICE
)
34 #define TYPE_NUBUS_BUS "nubus-bus"
35 OBJECT_DECLARE_SIMPLE_TYPE(NubusBus
, NUBUS_BUS
)
37 #define TYPE_NUBUS_BRIDGE "nubus-bridge"
38 OBJECT_DECLARE_SIMPLE_TYPE(NubusBridge
, NUBUS_BRIDGE
);
43 AddressSpace nubus_as
;
44 MemoryRegion nubus_mr
;
46 MemoryRegion super_slot_io
;
49 uint16_t slot_available_mask
;
51 qemu_irq irqs
[NUBUS_IRQS
];
54 #define NUBUS_DECL_ROM_MAX_SIZE (1 * MiB)
60 MemoryRegion super_slot_mem
;
61 MemoryRegion slot_mem
;
64 MemoryRegion decl_rom
;
67 void nubus_set_irq(NubusDevice
*nd
, int level
);
70 SysBusDevice parent_obj
;