xref: /openbmc/qemu/include/hw/nubus/nubus.h (revision 3616f424)
1 /*
2  * Copyright (c) 2013-2018 Laurent Vivier <laurent@vivier.eu>
3  *
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.
6  *
7  */
8 
9 #ifndef HW_NUBUS_NUBUS_H
10 #define HW_NUBUS_NUBUS_H
11 
12 #include "hw/qdev-properties.h"
13 #include "exec/address-spaces.h"
14 #include "qom/object.h"
15 #include "qemu/units.h"
16 
17 #define NUBUS_SUPER_SLOT_SIZE 0x10000000U
18 #define NUBUS_SUPER_SLOT_NB   0xe
19 
20 #define NUBUS_SLOT_SIZE       0x01000000
21 #define NUBUS_FIRST_SLOT      0x0
22 #define NUBUS_LAST_SLOT       0xf
23 #define NUBUS_SLOT_NB         (NUBUS_LAST_SLOT - NUBUS_FIRST_SLOT + 1)
24 
25 #define TYPE_NUBUS_DEVICE "nubus-device"
26 OBJECT_DECLARE_SIMPLE_TYPE(NubusDevice, NUBUS_DEVICE)
27 
28 #define TYPE_NUBUS_BUS "nubus-bus"
29 OBJECT_DECLARE_SIMPLE_TYPE(NubusBus, NUBUS_BUS)
30 
31 #define TYPE_NUBUS_BRIDGE "nubus-bridge"
32 
33 struct NubusBus {
34     BusState qbus;
35 
36     MemoryRegion super_slot_io;
37     MemoryRegion slot_io;
38 
39     uint16_t slot_available_mask;
40 };
41 
42 #define NUBUS_DECL_ROM_MAX_SIZE    (128 * KiB)
43 
44 struct NubusDevice {
45     DeviceState qdev;
46 
47     int32_t slot;
48     MemoryRegion super_slot_mem;
49     MemoryRegion slot_mem;
50 
51     char *romfile;
52     MemoryRegion decl_rom;
53 };
54 
55 #endif
56