xref: /qemu/include/hw/arm/aspeed_soc.h (revision ec150c7e)
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"
18118c82e7SEddie James #include "hw/misc/aspeed_xdma.h"
1900442402SCédric Le Goater #include "hw/timer/aspeed_timer.h"
2075fb4577SJoel Stanley #include "hw/timer/aspeed_rtc.h"
2100442402SCédric Le Goater #include "hw/i2c/aspeed_i2c.h"
2200442402SCédric Le Goater #include "hw/ssi/aspeed_smc.h"
23013befe1SCédric Le Goater #include "hw/watchdog/wdt_aspeed.h"
24ea337c65SCédric Le Goater #include "hw/net/ftgmac100.h"
25*ec150c7eSMarkus Armbruster #include "target/arm/cpu.h"
2600442402SCédric Le Goater 
27dbcabeebSCédric Le Goater #define ASPEED_SPIS_NUM  2
28f986ee1dSJoel Stanley #define ASPEED_WDTS_NUM  3
29ece09beeSCédric Le Goater #define ASPEED_CPUS_NUM  2
3067340990SCédric Le Goater #define ASPEED_MACS_NUM  2
31dbcabeebSCédric Le Goater 
32ff90606fSCédric Le Goater typedef struct AspeedSoCState {
3300442402SCédric Le Goater     /*< private >*/
3400442402SCédric Le Goater     DeviceState parent;
3500442402SCédric Le Goater 
3600442402SCédric Le Goater     /*< public >*/
37ece09beeSCédric Le Goater     ARMCPU cpu[ASPEED_CPUS_NUM];
38ece09beeSCédric Le Goater     uint32_t num_cpus;
3974af4eecSCédric Le Goater     MemoryRegion sram;
4000442402SCédric Le Goater     AspeedVICState vic;
4175fb4577SJoel Stanley     AspeedRtcState rtc;
4200442402SCédric Le Goater     AspeedTimerCtrlState timerctrl;
4300442402SCédric Le Goater     AspeedI2CState i2c;
4400442402SCédric Le Goater     AspeedSCUState scu;
45118c82e7SEddie James     AspeedXDMAState xdma;
460e5803dfSCédric Le Goater     AspeedSMCState fmc;
47dbcabeebSCédric Le Goater     AspeedSMCState spi[ASPEED_SPIS_NUM];
4800442402SCédric Le Goater     AspeedSDMCState sdmc;
49f986ee1dSJoel Stanley     AspeedWDTState wdt[ASPEED_WDTS_NUM];
5067340990SCédric Le Goater     FTGMAC100State ftgmac100[ASPEED_MACS_NUM];
51ff90606fSCédric Le Goater } AspeedSoCState;
5200442402SCédric Le Goater 
53ff90606fSCédric Le Goater #define TYPE_ASPEED_SOC "aspeed-soc"
54ff90606fSCédric Le Goater #define ASPEED_SOC(obj) OBJECT_CHECK(AspeedSoCState, (obj), TYPE_ASPEED_SOC)
5500442402SCédric Le Goater 
56b033271fSCédric Le Goater typedef struct AspeedSoCInfo {
57b033271fSCédric Le Goater     const char *name;
58ba1ba5ccSIgor Mammedov     const char *cpu_type;
59b033271fSCédric Le Goater     uint32_t silicon_rev;
6074af4eecSCédric Le Goater     uint64_t sram_size;
61dbcabeebSCédric Le Goater     int spis_num;
626dc52326SCédric Le Goater     const char *fmc_typename;
636dc52326SCédric Le Goater     const char **spi_typename;
64f986ee1dSJoel Stanley     int wdts_num;
65b456b113SCédric Le Goater     const int *irqmap;
66d783d1feSCédric Le Goater     const hwaddr *memmap;
67ece09beeSCédric Le Goater     uint32_t num_cpus;
68b033271fSCédric Le Goater } AspeedSoCInfo;
69b033271fSCédric Le Goater 
70b033271fSCédric Le Goater typedef struct AspeedSoCClass {
71b033271fSCédric Le Goater     DeviceClass parent_class;
72b033271fSCédric Le Goater     AspeedSoCInfo *info;
73b033271fSCédric Le Goater } AspeedSoCClass;
74b033271fSCédric Le Goater 
75b033271fSCédric Le Goater #define ASPEED_SOC_CLASS(klass)                                         \
76b033271fSCédric Le Goater     OBJECT_CLASS_CHECK(AspeedSoCClass, (klass), TYPE_ASPEED_SOC)
77b033271fSCédric Le Goater #define ASPEED_SOC_GET_CLASS(obj)                               \
78b033271fSCédric Le Goater     OBJECT_GET_CLASS(AspeedSoCClass, (obj), TYPE_ASPEED_SOC)
7900442402SCédric Le Goater 
80b456b113SCédric Le Goater enum {
81b456b113SCédric Le Goater     ASPEED_IOMEM,
82b456b113SCédric Le Goater     ASPEED_UART1,
83b456b113SCédric Le Goater     ASPEED_UART2,
84b456b113SCédric Le Goater     ASPEED_UART3,
85b456b113SCédric Le Goater     ASPEED_UART4,
86b456b113SCédric Le Goater     ASPEED_UART5,
87b456b113SCédric Le Goater     ASPEED_VUART,
88b456b113SCédric Le Goater     ASPEED_FMC,
89b456b113SCédric Le Goater     ASPEED_SPI1,
90b456b113SCédric Le Goater     ASPEED_SPI2,
91b456b113SCédric Le Goater     ASPEED_VIC,
92b456b113SCédric Le Goater     ASPEED_SDMC,
93b456b113SCédric Le Goater     ASPEED_SCU,
94b456b113SCédric Le Goater     ASPEED_ADC,
95b456b113SCédric Le Goater     ASPEED_SRAM,
96b456b113SCédric Le Goater     ASPEED_GPIO,
97b456b113SCédric Le Goater     ASPEED_RTC,
98b456b113SCédric Le Goater     ASPEED_TIMER1,
99b456b113SCédric Le Goater     ASPEED_TIMER2,
100b456b113SCédric Le Goater     ASPEED_TIMER3,
101b456b113SCédric Le Goater     ASPEED_TIMER4,
102b456b113SCédric Le Goater     ASPEED_TIMER5,
103b456b113SCédric Le Goater     ASPEED_TIMER6,
104b456b113SCédric Le Goater     ASPEED_TIMER7,
105b456b113SCédric Le Goater     ASPEED_TIMER8,
106b456b113SCédric Le Goater     ASPEED_WDT,
107b456b113SCédric Le Goater     ASPEED_PWM,
108b456b113SCédric Le Goater     ASPEED_LPC,
109b456b113SCédric Le Goater     ASPEED_IBT,
110b456b113SCédric Le Goater     ASPEED_I2C,
111b456b113SCédric Le Goater     ASPEED_ETH1,
112b456b113SCédric Le Goater     ASPEED_ETH2,
113d783d1feSCédric Le Goater     ASPEED_SDRAM,
114118c82e7SEddie James     ASPEED_XDMA,
115b456b113SCédric Le Goater };
116b456b113SCédric Le Goater 
117ff90606fSCédric Le Goater #endif /* ASPEED_SOC_H */
118