Merge tag 'pull-loongarch-20241016' of https://gitlab.com/gaosong/qemu into staging
[qemu/armbru.git] / include / hw / misc / aspeed_i3c.h
blob39679dfa1ae1675511e959f16bce56443e7b0631
1 /*
2 * ASPEED I3C Controller
4 * Copyright (C) 2021 ASPEED Technology Inc.
6 * This code is licensed under the GPL version 2 or later. See
7 * the COPYING file in the top-level directory.
8 */
10 #ifndef ASPEED_I3C_H
11 #define ASPEED_I3C_H
13 #include "hw/sysbus.h"
15 #define TYPE_ASPEED_I3C "aspeed.i3c"
16 #define TYPE_ASPEED_I3C_DEVICE "aspeed.i3c.device"
17 OBJECT_DECLARE_TYPE(AspeedI3CState, AspeedI3CClass, ASPEED_I3C)
19 #define ASPEED_I3C_NR_REGS (0x70 >> 2)
20 #define ASPEED_I3C_DEVICE_NR_REGS (0x300 >> 2)
21 #define ASPEED_I3C_NR_DEVICES 6
23 OBJECT_DECLARE_SIMPLE_TYPE(AspeedI3CDevice, ASPEED_I3C_DEVICE)
24 typedef struct AspeedI3CDevice {
25 /* <private> */
26 SysBusDevice parent;
28 /* <public> */
29 MemoryRegion mr;
30 qemu_irq irq;
32 uint8_t id;
33 uint32_t regs[ASPEED_I3C_DEVICE_NR_REGS];
34 } AspeedI3CDevice;
36 typedef struct AspeedI3CState {
37 /* <private> */
38 SysBusDevice parent;
40 /* <public> */
41 MemoryRegion iomem;
42 MemoryRegion iomem_container;
43 qemu_irq irq;
45 uint32_t regs[ASPEED_I3C_NR_REGS];
46 AspeedI3CDevice devices[ASPEED_I3C_NR_DEVICES];
47 } AspeedI3CState;
48 #endif /* ASPEED_I3C_H */