xref: /qemu/include/hw/arm/aspeed_soc.h (revision 289251b0)
100442402SCédric Le Goater /*
2ff90606fSCédric Le Goater  * ASPEED SoC family
300442402SCédric Le Goater  *
400442402SCédric Le Goater  * Andrew Jeffery <andrew@aj.id.au>
500442402SCédric Le Goater  *
600442402SCédric Le Goater  * Copyright 2016 IBM Corp.
700442402SCédric Le Goater  *
800442402SCédric Le Goater  * This code is licensed under the GPL version 2 or later.  See
900442402SCédric Le Goater  * the COPYING file in the top-level directory.
1000442402SCédric Le Goater  */
1100442402SCédric Le Goater 
12ff90606fSCédric Le Goater #ifndef ASPEED_SOC_H
13ff90606fSCédric Le Goater #define ASPEED_SOC_H
1400442402SCédric Le Goater 
15f25c0ae1SCédric Le Goater #include "hw/cpu/a15mpcore.h"
1600442402SCédric Le Goater #include "hw/intc/aspeed_vic.h"
1700442402SCédric Le Goater #include "hw/misc/aspeed_scu.h"
1800442402SCédric Le Goater #include "hw/misc/aspeed_sdmc.h"
19118c82e7SEddie James #include "hw/misc/aspeed_xdma.h"
2000442402SCédric Le Goater #include "hw/timer/aspeed_timer.h"
2175fb4577SJoel Stanley #include "hw/timer/aspeed_rtc.h"
2200442402SCédric Le Goater #include "hw/i2c/aspeed_i2c.h"
2300442402SCédric Le Goater #include "hw/ssi/aspeed_smc.h"
24013befe1SCédric Le Goater #include "hw/watchdog/wdt_aspeed.h"
25ea337c65SCédric Le Goater #include "hw/net/ftgmac100.h"
26ec150c7eSMarkus Armbruster #include "target/arm/cpu.h"
27fdcc7c06SRashmica Gupta #include "hw/gpio/aspeed_gpio.h"
282bea128cSEddie James #include "hw/sd/aspeed_sdhci.h"
2900442402SCédric Le Goater 
30dbcabeebSCédric Le Goater #define ASPEED_SPIS_NUM  2
316b2b2a70SJoel Stanley #define ASPEED_WDTS_NUM  4
32ece09beeSCédric Le Goater #define ASPEED_CPUS_NUM  2
33d300db02SJoel Stanley #define ASPEED_MACS_NUM  4
34dbcabeebSCédric Le Goater 
35ff90606fSCédric Le Goater typedef struct AspeedSoCState {
3600442402SCédric Le Goater     /*< private >*/
3700442402SCédric Le Goater     DeviceState parent;
3800442402SCédric Le Goater 
3900442402SCédric Le Goater     /*< public >*/
40ece09beeSCédric Le Goater     ARMCPU cpu[ASPEED_CPUS_NUM];
41ece09beeSCédric Le Goater     uint32_t num_cpus;
42f25c0ae1SCédric Le Goater     A15MPPrivState     a7mpcore;
4374af4eecSCédric Le Goater     MemoryRegion sram;
4400442402SCédric Le Goater     AspeedVICState vic;
4575fb4577SJoel Stanley     AspeedRtcState rtc;
4600442402SCédric Le Goater     AspeedTimerCtrlState timerctrl;
4700442402SCédric Le Goater     AspeedI2CState i2c;
4800442402SCédric Le Goater     AspeedSCUState scu;
49118c82e7SEddie James     AspeedXDMAState xdma;
500e5803dfSCédric Le Goater     AspeedSMCState fmc;
51dbcabeebSCédric Le Goater     AspeedSMCState spi[ASPEED_SPIS_NUM];
5200442402SCédric Le Goater     AspeedSDMCState sdmc;
53f986ee1dSJoel Stanley     AspeedWDTState wdt[ASPEED_WDTS_NUM];
5467340990SCédric Le Goater     FTGMAC100State ftgmac100[ASPEED_MACS_NUM];
55*289251b0SCédric Le Goater     AspeedMiiState mii[ASPEED_MACS_NUM];
56fdcc7c06SRashmica Gupta     AspeedGPIOState gpio;
57f25c0ae1SCédric Le Goater     AspeedGPIOState gpio_1_8v;
582bea128cSEddie James     AspeedSDHCIState sdhci;
59ff90606fSCédric Le Goater } AspeedSoCState;
6000442402SCédric Le Goater 
61ff90606fSCédric Le Goater #define TYPE_ASPEED_SOC "aspeed-soc"
62ff90606fSCédric Le Goater #define ASPEED_SOC(obj) OBJECT_CHECK(AspeedSoCState, (obj), TYPE_ASPEED_SOC)
6300442402SCédric Le Goater 
6454ecafb7SCédric Le Goater typedef struct AspeedSoCClass {
6554ecafb7SCédric Le Goater     DeviceClass parent_class;
6654ecafb7SCédric Le Goater 
67b033271fSCédric Le Goater     const char *name;
68ba1ba5ccSIgor Mammedov     const char *cpu_type;
69b033271fSCédric Le Goater     uint32_t silicon_rev;
7074af4eecSCédric Le Goater     uint64_t sram_size;
71dbcabeebSCédric Le Goater     int spis_num;
72f986ee1dSJoel Stanley     int wdts_num;
73d300db02SJoel Stanley     int macs_num;
74b456b113SCédric Le Goater     const int *irqmap;
75d783d1feSCédric Le Goater     const hwaddr *memmap;
76ece09beeSCédric Le Goater     uint32_t num_cpus;
77b033271fSCédric Le Goater } AspeedSoCClass;
78b033271fSCédric Le Goater 
79b033271fSCédric Le Goater #define ASPEED_SOC_CLASS(klass)                                         \
80b033271fSCédric Le Goater     OBJECT_CLASS_CHECK(AspeedSoCClass, (klass), TYPE_ASPEED_SOC)
81b033271fSCédric Le Goater #define ASPEED_SOC_GET_CLASS(obj)                               \
82b033271fSCédric Le Goater     OBJECT_GET_CLASS(AspeedSoCClass, (obj), TYPE_ASPEED_SOC)
8300442402SCédric Le Goater 
84b456b113SCédric Le Goater enum {
85b456b113SCédric Le Goater     ASPEED_IOMEM,
86b456b113SCédric Le Goater     ASPEED_UART1,
87b456b113SCédric Le Goater     ASPEED_UART2,
88b456b113SCédric Le Goater     ASPEED_UART3,
89b456b113SCédric Le Goater     ASPEED_UART4,
90b456b113SCédric Le Goater     ASPEED_UART5,
91b456b113SCédric Le Goater     ASPEED_VUART,
92b456b113SCédric Le Goater     ASPEED_FMC,
93b456b113SCédric Le Goater     ASPEED_SPI1,
94b456b113SCédric Le Goater     ASPEED_SPI2,
95b456b113SCédric Le Goater     ASPEED_VIC,
96b456b113SCédric Le Goater     ASPEED_SDMC,
97b456b113SCédric Le Goater     ASPEED_SCU,
98b456b113SCédric Le Goater     ASPEED_ADC,
99b456b113SCédric Le Goater     ASPEED_SRAM,
1002bea128cSEddie James     ASPEED_SDHCI,
101b456b113SCédric Le Goater     ASPEED_GPIO,
102f25c0ae1SCédric Le Goater     ASPEED_GPIO_1_8V,
103b456b113SCédric Le Goater     ASPEED_RTC,
104b456b113SCédric Le Goater     ASPEED_TIMER1,
105b456b113SCédric Le Goater     ASPEED_TIMER2,
106b456b113SCédric Le Goater     ASPEED_TIMER3,
107b456b113SCédric Le Goater     ASPEED_TIMER4,
108b456b113SCédric Le Goater     ASPEED_TIMER5,
109b456b113SCédric Le Goater     ASPEED_TIMER6,
110b456b113SCédric Le Goater     ASPEED_TIMER7,
111b456b113SCédric Le Goater     ASPEED_TIMER8,
112b456b113SCédric Le Goater     ASPEED_WDT,
113b456b113SCédric Le Goater     ASPEED_PWM,
114b456b113SCédric Le Goater     ASPEED_LPC,
115b456b113SCédric Le Goater     ASPEED_IBT,
116b456b113SCédric Le Goater     ASPEED_I2C,
117b456b113SCédric Le Goater     ASPEED_ETH1,
118b456b113SCédric Le Goater     ASPEED_ETH2,
119d300db02SJoel Stanley     ASPEED_ETH3,
120d300db02SJoel Stanley     ASPEED_ETH4,
121*289251b0SCédric Le Goater     ASPEED_MII1,
122*289251b0SCédric Le Goater     ASPEED_MII2,
123*289251b0SCédric Le Goater     ASPEED_MII3,
124*289251b0SCédric Le Goater     ASPEED_MII4,
125d783d1feSCédric Le Goater     ASPEED_SDRAM,
126118c82e7SEddie James     ASPEED_XDMA,
127b456b113SCédric Le Goater };
128b456b113SCédric Le Goater 
129ff90606fSCédric Le Goater #endif /* ASPEED_SOC_H */
130