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/cpu/a15mpcore.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/misc/aspeed_xdma.h" 20 #include "hw/timer/aspeed_timer.h" 21 #include "hw/rtc/aspeed_rtc.h" 22 #include "hw/i2c/aspeed_i2c.h" 23 #include "hw/ssi/aspeed_smc.h" 24 #include "hw/misc/aspeed_hace.h" 25 #include "hw/watchdog/wdt_aspeed.h" 26 #include "hw/net/ftgmac100.h" 27 #include "target/arm/cpu.h" 28 #include "hw/gpio/aspeed_gpio.h" 29 #include "hw/sd/aspeed_sdhci.h" 30 #include "hw/usb/hcd-ehci.h" 31 #include "qom/object.h" 32 #include "hw/misc/aspeed_lpc.h" 33 34 #define ASPEED_SPIS_NUM 2 35 #define ASPEED_EHCIS_NUM 2 36 #define ASPEED_WDTS_NUM 4 37 #define ASPEED_CPUS_NUM 2 38 #define ASPEED_MACS_NUM 4 39 40 struct AspeedSoCState { 41 /*< private >*/ 42 DeviceState parent; 43 44 /*< public >*/ 45 ARMCPU cpu[ASPEED_CPUS_NUM]; 46 A15MPPrivState a7mpcore; 47 MemoryRegion *dram_mr; 48 MemoryRegion sram; 49 AspeedVICState vic; 50 AspeedRtcState rtc; 51 AspeedTimerCtrlState timerctrl; 52 AspeedI2CState i2c; 53 AspeedSCUState scu; 54 AspeedHACEState hace; 55 AspeedXDMAState xdma; 56 AspeedSMCState fmc; 57 AspeedSMCState spi[ASPEED_SPIS_NUM]; 58 EHCISysBusState ehci[ASPEED_EHCIS_NUM]; 59 AspeedSDMCState sdmc; 60 AspeedWDTState wdt[ASPEED_WDTS_NUM]; 61 FTGMAC100State ftgmac100[ASPEED_MACS_NUM]; 62 AspeedMiiState mii[ASPEED_MACS_NUM]; 63 AspeedGPIOState gpio; 64 AspeedGPIOState gpio_1_8v; 65 AspeedSDHCIState sdhci; 66 AspeedSDHCIState emmc; 67 AspeedLPCState lpc; 68 uint32_t uart_default; 69 }; 70 71 #define TYPE_ASPEED_SOC "aspeed-soc" 72 OBJECT_DECLARE_TYPE(AspeedSoCState, AspeedSoCClass, ASPEED_SOC) 73 74 struct AspeedSoCClass { 75 DeviceClass parent_class; 76 77 const char *name; 78 const char *cpu_type; 79 uint32_t silicon_rev; 80 uint64_t sram_size; 81 int spis_num; 82 int ehcis_num; 83 int wdts_num; 84 int macs_num; 85 const int *irqmap; 86 const hwaddr *memmap; 87 uint32_t num_cpus; 88 }; 89 90 91 enum { 92 ASPEED_DEV_IOMEM, 93 ASPEED_DEV_UART1, 94 ASPEED_DEV_UART2, 95 ASPEED_DEV_UART3, 96 ASPEED_DEV_UART4, 97 ASPEED_DEV_UART5, 98 ASPEED_DEV_VUART, 99 ASPEED_DEV_FMC, 100 ASPEED_DEV_SPI1, 101 ASPEED_DEV_SPI2, 102 ASPEED_DEV_EHCI1, 103 ASPEED_DEV_EHCI2, 104 ASPEED_DEV_VIC, 105 ASPEED_DEV_SDMC, 106 ASPEED_DEV_SCU, 107 ASPEED_DEV_ADC, 108 ASPEED_DEV_VIDEO, 109 ASPEED_DEV_SRAM, 110 ASPEED_DEV_SDHCI, 111 ASPEED_DEV_GPIO, 112 ASPEED_DEV_GPIO_1_8V, 113 ASPEED_DEV_RTC, 114 ASPEED_DEV_TIMER1, 115 ASPEED_DEV_TIMER2, 116 ASPEED_DEV_TIMER3, 117 ASPEED_DEV_TIMER4, 118 ASPEED_DEV_TIMER5, 119 ASPEED_DEV_TIMER6, 120 ASPEED_DEV_TIMER7, 121 ASPEED_DEV_TIMER8, 122 ASPEED_DEV_WDT, 123 ASPEED_DEV_PWM, 124 ASPEED_DEV_LPC, 125 ASPEED_DEV_IBT, 126 ASPEED_DEV_I2C, 127 ASPEED_DEV_ETH1, 128 ASPEED_DEV_ETH2, 129 ASPEED_DEV_ETH3, 130 ASPEED_DEV_ETH4, 131 ASPEED_DEV_MII1, 132 ASPEED_DEV_MII2, 133 ASPEED_DEV_MII3, 134 ASPEED_DEV_MII4, 135 ASPEED_DEV_SDRAM, 136 ASPEED_DEV_XDMA, 137 ASPEED_DEV_EMMC, 138 ASPEED_DEV_KCS, 139 ASPEED_DEV_HACE, 140 }; 141 142 #endif /* ASPEED_SOC_H */ 143