xref: /openbmc/qemu/include/hw/fsi/aspeed_apb2opb.h (revision ab0c7fb2)
1 /*
2  * SPDX-License-Identifier: GPL-2.0-or-later
3  * Copyright (C) 2024 IBM Corp.
4  *
5  * ASPEED APB2OPB Bridge
6  * IBM On-Chip Peripheral Bus
7  */
8 #ifndef FSI_ASPEED_APB2OPB_H
9 #define FSI_ASPEED_APB2OPB_H
10 
11 #include "exec/memory.h"
12 #include "hw/fsi/fsi-master.h"
13 #include "hw/sysbus.h"
14 
15 #define TYPE_FSI_OPB "fsi.opb"
16 
17 #define TYPE_OP_BUS "opb"
18 OBJECT_DECLARE_SIMPLE_TYPE(OPBus, OP_BUS)
19 
20 typedef struct OPBus {
21     BusState bus;
22 
23     MemoryRegion mr;
24     AddressSpace as;
25 } OPBus;
26 
27 #define TYPE_ASPEED_APB2OPB "aspeed.apb2opb"
28 OBJECT_DECLARE_SIMPLE_TYPE(AspeedAPB2OPBState, ASPEED_APB2OPB)
29 
30 #define ASPEED_APB2OPB_NR_REGS ((0xe8 >> 2) + 1)
31 
32 #define ASPEED_FSI_NUM 2
33 
34 typedef struct AspeedAPB2OPBState {
35     SysBusDevice parent_obj;
36 
37     MemoryRegion iomem;
38 
39     uint32_t regs[ASPEED_APB2OPB_NR_REGS];
40     qemu_irq irq;
41 
42     OPBus opb[ASPEED_FSI_NUM];
43     FSIMasterState fsi[ASPEED_FSI_NUM];
44 } AspeedAPB2OPBState;
45 
46 #endif /* FSI_ASPEED_APB2OPB_H */
47