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 15*f25c0ae1SCé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 3367340990SCédric Le Goater #define ASPEED_MACS_NUM 2 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; 42*f25c0ae1SCé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]; 55fdcc7c06SRashmica Gupta AspeedGPIOState gpio; 56*f25c0ae1SCédric Le Goater AspeedGPIOState gpio_1_8v; 572bea128cSEddie James AspeedSDHCIState sdhci; 58ff90606fSCédric Le Goater } AspeedSoCState; 5900442402SCédric Le Goater 60ff90606fSCédric Le Goater #define TYPE_ASPEED_SOC "aspeed-soc" 61ff90606fSCédric Le Goater #define ASPEED_SOC(obj) OBJECT_CHECK(AspeedSoCState, (obj), TYPE_ASPEED_SOC) 6200442402SCédric Le Goater 6354ecafb7SCédric Le Goater typedef struct AspeedSoCClass { 6454ecafb7SCédric Le Goater DeviceClass parent_class; 6554ecafb7SCédric Le Goater 66b033271fSCédric Le Goater const char *name; 67ba1ba5ccSIgor Mammedov const char *cpu_type; 68b033271fSCédric Le Goater uint32_t silicon_rev; 6974af4eecSCédric Le Goater uint64_t sram_size; 70dbcabeebSCédric Le Goater int spis_num; 71f986ee1dSJoel Stanley int wdts_num; 72b456b113SCédric Le Goater const int *irqmap; 73d783d1feSCédric Le Goater const hwaddr *memmap; 74ece09beeSCédric Le Goater uint32_t num_cpus; 75b033271fSCédric Le Goater } AspeedSoCClass; 76b033271fSCédric Le Goater 77b033271fSCédric Le Goater #define ASPEED_SOC_CLASS(klass) \ 78b033271fSCédric Le Goater OBJECT_CLASS_CHECK(AspeedSoCClass, (klass), TYPE_ASPEED_SOC) 79b033271fSCédric Le Goater #define ASPEED_SOC_GET_CLASS(obj) \ 80b033271fSCédric Le Goater OBJECT_GET_CLASS(AspeedSoCClass, (obj), TYPE_ASPEED_SOC) 8100442402SCédric Le Goater 82b456b113SCédric Le Goater enum { 83b456b113SCédric Le Goater ASPEED_IOMEM, 84b456b113SCédric Le Goater ASPEED_UART1, 85b456b113SCédric Le Goater ASPEED_UART2, 86b456b113SCédric Le Goater ASPEED_UART3, 87b456b113SCédric Le Goater ASPEED_UART4, 88b456b113SCédric Le Goater ASPEED_UART5, 89b456b113SCédric Le Goater ASPEED_VUART, 90b456b113SCédric Le Goater ASPEED_FMC, 91b456b113SCédric Le Goater ASPEED_SPI1, 92b456b113SCédric Le Goater ASPEED_SPI2, 93b456b113SCédric Le Goater ASPEED_VIC, 94b456b113SCédric Le Goater ASPEED_SDMC, 95b456b113SCédric Le Goater ASPEED_SCU, 96b456b113SCédric Le Goater ASPEED_ADC, 97b456b113SCédric Le Goater ASPEED_SRAM, 982bea128cSEddie James ASPEED_SDHCI, 99b456b113SCédric Le Goater ASPEED_GPIO, 100*f25c0ae1SCédric Le Goater ASPEED_GPIO_1_8V, 101b456b113SCédric Le Goater ASPEED_RTC, 102b456b113SCédric Le Goater ASPEED_TIMER1, 103b456b113SCédric Le Goater ASPEED_TIMER2, 104b456b113SCédric Le Goater ASPEED_TIMER3, 105b456b113SCédric Le Goater ASPEED_TIMER4, 106b456b113SCédric Le Goater ASPEED_TIMER5, 107b456b113SCédric Le Goater ASPEED_TIMER6, 108b456b113SCédric Le Goater ASPEED_TIMER7, 109b456b113SCédric Le Goater ASPEED_TIMER8, 110b456b113SCédric Le Goater ASPEED_WDT, 111b456b113SCédric Le Goater ASPEED_PWM, 112b456b113SCédric Le Goater ASPEED_LPC, 113b456b113SCédric Le Goater ASPEED_IBT, 114b456b113SCédric Le Goater ASPEED_I2C, 115b456b113SCédric Le Goater ASPEED_ETH1, 116b456b113SCédric Le Goater ASPEED_ETH2, 117d783d1feSCédric Le Goater ASPEED_SDRAM, 118118c82e7SEddie James ASPEED_XDMA, 119b456b113SCédric Le Goater }; 120b456b113SCédric Le Goater 121ff90606fSCédric Le Goater #endif /* ASPEED_SOC_H */ 122