xref: /openbmc/qemu/include/hw/arm/aspeed_soc.h (revision 0bdb12c7)
1 /*
2  * ASPEED SoC family
3  *
4  * Andrew Jeffery <andrew@aj.id.au>
5  *
6  * Copyright 2016 IBM Corp.
7  *
8  * This code is licensed under the GPL version 2 or later.  See
9  * the COPYING file in the top-level directory.
10  */
11 
12 #ifndef ASPEED_SOC_H
13 #define ASPEED_SOC_H
14 
15 #include "hw/arm/arm.h"
16 #include "hw/intc/aspeed_vic.h"
17 #include "hw/misc/aspeed_scu.h"
18 #include "hw/misc/aspeed_sdmc.h"
19 #include "hw/timer/aspeed_timer.h"
20 #include "hw/i2c/aspeed_i2c.h"
21 #include "hw/ssi/aspeed_smc.h"
22 
23 typedef struct AspeedSoCState {
24     /*< private >*/
25     DeviceState parent;
26 
27     /*< public >*/
28     ARMCPU *cpu;
29     MemoryRegion iomem;
30     AspeedVICState vic;
31     AspeedTimerCtrlState timerctrl;
32     AspeedI2CState i2c;
33     AspeedSCUState scu;
34     AspeedSMCState smc;
35     AspeedSMCState spi;
36     AspeedSDMCState sdmc;
37 } AspeedSoCState;
38 
39 #define TYPE_ASPEED_SOC "aspeed-soc"
40 #define ASPEED_SOC(obj) OBJECT_CHECK(AspeedSoCState, (obj), TYPE_ASPEED_SOC)
41 
42 typedef struct AspeedSoCInfo {
43     const char *name;
44     const char *cpu_model;
45     uint32_t silicon_rev;
46     hwaddr sdram_base;
47 } AspeedSoCInfo;
48 
49 typedef struct AspeedSoCClass {
50     DeviceClass parent_class;
51     AspeedSoCInfo *info;
52 } AspeedSoCClass;
53 
54 #define ASPEED_SOC_CLASS(klass)                                         \
55     OBJECT_CLASS_CHECK(AspeedSoCClass, (klass), TYPE_ASPEED_SOC)
56 #define ASPEED_SOC_GET_CLASS(obj)                               \
57     OBJECT_GET_CLASS(AspeedSoCClass, (obj), TYPE_ASPEED_SOC)
58 
59 #endif /* ASPEED_SOC_H */
60