xref: /qemu/include/hw/arm/aspeed_soc.h (revision b456b113)
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 
1500442402SCédric Le Goater #include "hw/intc/aspeed_vic.h"
1600442402SCédric Le Goater #include "hw/misc/aspeed_scu.h"
1700442402SCédric Le Goater #include "hw/misc/aspeed_sdmc.h"
1800442402SCédric Le Goater #include "hw/timer/aspeed_timer.h"
1900442402SCédric Le Goater #include "hw/i2c/aspeed_i2c.h"
2000442402SCédric Le Goater #include "hw/ssi/aspeed_smc.h"
21013befe1SCédric Le Goater #include "hw/watchdog/wdt_aspeed.h"
22ea337c65SCédric Le Goater #include "hw/net/ftgmac100.h"
2300442402SCédric Le Goater 
24dbcabeebSCédric Le Goater #define ASPEED_SPIS_NUM  2
25f986ee1dSJoel Stanley #define ASPEED_WDTS_NUM  3
26dbcabeebSCédric Le Goater 
27ff90606fSCédric Le Goater typedef struct AspeedSoCState {
2800442402SCédric Le Goater     /*< private >*/
2900442402SCédric Le Goater     DeviceState parent;
3000442402SCédric Le Goater 
3100442402SCédric Le Goater     /*< public >*/
322d105bd6SCédric Le Goater     ARMCPU cpu;
3374af4eecSCédric Le Goater     MemoryRegion sram;
3400442402SCédric Le Goater     AspeedVICState vic;
3500442402SCédric Le Goater     AspeedTimerCtrlState timerctrl;
3600442402SCédric Le Goater     AspeedI2CState i2c;
3700442402SCédric Le Goater     AspeedSCUState scu;
380e5803dfSCédric Le Goater     AspeedSMCState fmc;
39dbcabeebSCédric Le Goater     AspeedSMCState spi[ASPEED_SPIS_NUM];
4000442402SCédric Le Goater     AspeedSDMCState sdmc;
41f986ee1dSJoel Stanley     AspeedWDTState wdt[ASPEED_WDTS_NUM];
42ea337c65SCédric Le Goater     FTGMAC100State ftgmac100;
43ff90606fSCédric Le Goater } AspeedSoCState;
4400442402SCédric Le Goater 
45ff90606fSCédric Le Goater #define TYPE_ASPEED_SOC "aspeed-soc"
46ff90606fSCédric Le Goater #define ASPEED_SOC(obj) OBJECT_CHECK(AspeedSoCState, (obj), TYPE_ASPEED_SOC)
4700442402SCédric Le Goater 
48b033271fSCédric Le Goater typedef struct AspeedSoCInfo {
49b033271fSCédric Le Goater     const char *name;
50ba1ba5ccSIgor Mammedov     const char *cpu_type;
51b033271fSCédric Le Goater     uint32_t silicon_rev;
52b033271fSCédric Le Goater     hwaddr sdram_base;
5374af4eecSCédric Le Goater     uint64_t sram_size;
54dbcabeebSCédric Le Goater     int spis_num;
55dbcabeebSCédric Le Goater     const hwaddr *spi_bases;
566dc52326SCédric Le Goater     const char *fmc_typename;
576dc52326SCédric Le Goater     const char **spi_typename;
58f986ee1dSJoel Stanley     int wdts_num;
59*b456b113SCédric Le Goater     const int *irqmap;
60b033271fSCédric Le Goater } AspeedSoCInfo;
61b033271fSCédric Le Goater 
62b033271fSCédric Le Goater typedef struct AspeedSoCClass {
63b033271fSCédric Le Goater     DeviceClass parent_class;
64b033271fSCédric Le Goater     AspeedSoCInfo *info;
65b033271fSCédric Le Goater } AspeedSoCClass;
66b033271fSCédric Le Goater 
67b033271fSCédric Le Goater #define ASPEED_SOC_CLASS(klass)                                         \
68b033271fSCédric Le Goater     OBJECT_CLASS_CHECK(AspeedSoCClass, (klass), TYPE_ASPEED_SOC)
69b033271fSCédric Le Goater #define ASPEED_SOC_GET_CLASS(obj)                               \
70b033271fSCédric Le Goater     OBJECT_GET_CLASS(AspeedSoCClass, (obj), TYPE_ASPEED_SOC)
7100442402SCédric Le Goater 
72*b456b113SCédric Le Goater enum {
73*b456b113SCédric Le Goater     ASPEED_IOMEM,
74*b456b113SCédric Le Goater     ASPEED_UART1,
75*b456b113SCédric Le Goater     ASPEED_UART2,
76*b456b113SCédric Le Goater     ASPEED_UART3,
77*b456b113SCédric Le Goater     ASPEED_UART4,
78*b456b113SCédric Le Goater     ASPEED_UART5,
79*b456b113SCédric Le Goater     ASPEED_VUART,
80*b456b113SCédric Le Goater     ASPEED_FMC,
81*b456b113SCédric Le Goater     ASPEED_SPI1,
82*b456b113SCédric Le Goater     ASPEED_SPI2,
83*b456b113SCédric Le Goater     ASPEED_VIC,
84*b456b113SCédric Le Goater     ASPEED_SDMC,
85*b456b113SCédric Le Goater     ASPEED_SCU,
86*b456b113SCédric Le Goater     ASPEED_ADC,
87*b456b113SCédric Le Goater     ASPEED_SRAM,
88*b456b113SCédric Le Goater     ASPEED_GPIO,
89*b456b113SCédric Le Goater     ASPEED_RTC,
90*b456b113SCédric Le Goater     ASPEED_TIMER1,
91*b456b113SCédric Le Goater     ASPEED_TIMER2,
92*b456b113SCédric Le Goater     ASPEED_TIMER3,
93*b456b113SCédric Le Goater     ASPEED_TIMER4,
94*b456b113SCédric Le Goater     ASPEED_TIMER5,
95*b456b113SCédric Le Goater     ASPEED_TIMER6,
96*b456b113SCédric Le Goater     ASPEED_TIMER7,
97*b456b113SCédric Le Goater     ASPEED_TIMER8,
98*b456b113SCédric Le Goater     ASPEED_WDT,
99*b456b113SCédric Le Goater     ASPEED_PWM,
100*b456b113SCédric Le Goater     ASPEED_LPC,
101*b456b113SCédric Le Goater     ASPEED_IBT,
102*b456b113SCédric Le Goater     ASPEED_I2C,
103*b456b113SCédric Le Goater     ASPEED_ETH1,
104*b456b113SCédric Le Goater     ASPEED_ETH2,
105*b456b113SCédric Le Goater };
106*b456b113SCédric Le Goater 
107ff90606fSCédric Le Goater #endif /* ASPEED_SOC_H */
108