]>
Commit | Line | Data |
---|---|---|
fa2ba3b8 LV |
1 | /* |
2 | * Copyright (c) 2013-2018 Laurent Vivier <[email protected]> | |
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" | |
db1015e9 | 14 | #include "qom/object.h" |
fa2ba3b8 LV |
15 | |
16 | #define NUBUS_SUPER_SLOT_SIZE 0x10000000U | |
17 | #define NUBUS_SUPER_SLOT_NB 0x9 | |
18 | ||
19 | #define NUBUS_SLOT_SIZE 0x01000000 | |
20 | #define NUBUS_SLOT_NB 0xF | |
21 | ||
22 | #define NUBUS_FIRST_SLOT 0x9 | |
23 | #define NUBUS_LAST_SLOT 0xF | |
24 | ||
25 | #define TYPE_NUBUS_DEVICE "nubus-device" | |
db1015e9 | 26 | typedef struct NubusDevice NubusDevice; |
fa2ba3b8 LV |
27 | #define NUBUS_DEVICE(obj) \ |
28 | OBJECT_CHECK(NubusDevice, (obj), TYPE_NUBUS_DEVICE) | |
29 | ||
30 | #define TYPE_NUBUS_BUS "nubus-bus" | |
db1015e9 | 31 | typedef struct NubusBus NubusBus; |
fa2ba3b8 LV |
32 | #define NUBUS_BUS(obj) OBJECT_CHECK(NubusBus, (obj), TYPE_NUBUS_BUS) |
33 | ||
34 | #define TYPE_NUBUS_BRIDGE "nubus-bridge" | |
fa2ba3b8 | 35 | |
db1015e9 | 36 | struct NubusBus { |
fa2ba3b8 LV |
37 | BusState qbus; |
38 | ||
39 | MemoryRegion super_slot_io; | |
40 | MemoryRegion slot_io; | |
41 | ||
42 | int current_slot; | |
db1015e9 | 43 | }; |
fa2ba3b8 | 44 | |
db1015e9 | 45 | struct NubusDevice { |
fa2ba3b8 LV |
46 | DeviceState qdev; |
47 | ||
48 | int slot_nb; | |
49 | MemoryRegion slot_mem; | |
50 | ||
51 | /* Format Block */ | |
52 | ||
53 | MemoryRegion fblock_io; | |
54 | ||
55 | uint32_t rom_length; | |
56 | uint32_t rom_crc; | |
57 | uint8_t rom_rev; | |
58 | uint8_t rom_format; | |
59 | uint8_t byte_lanes; | |
60 | int32_t directory_offset; | |
61 | ||
62 | /* ROM */ | |
63 | ||
64 | MemoryRegion rom_io; | |
65 | const uint8_t *rom; | |
db1015e9 | 66 | }; |
fa2ba3b8 LV |
67 | |
68 | void nubus_register_rom(NubusDevice *dev, const uint8_t *rom, uint32_t size, | |
69 | int revision, int format, uint8_t byte_lanes); | |
70 | ||
71 | #endif |