2016-03-16 20:06:00 +03:00
|
|
|
/*
|
2016-09-22 20:13:05 +03:00
|
|
|
* ASPEED SoC family
|
2016-03-16 20:06:00 +03:00
|
|
|
*
|
|
|
|
* Andrew Jeffery <andrew@aj.id.au>
|
|
|
|
*
|
|
|
|
* Copyright 2016 IBM Corp.
|
|
|
|
*
|
|
|
|
* This code is licensed under the GPL version 2 or later. See
|
|
|
|
* the COPYING file in the top-level directory.
|
|
|
|
*/
|
|
|
|
|
2016-09-22 20:13:05 +03:00
|
|
|
#ifndef ASPEED_SOC_H
|
|
|
|
#define ASPEED_SOC_H
|
2016-03-16 20:06:00 +03:00
|
|
|
|
|
|
|
#include "hw/intc/aspeed_vic.h"
|
2016-06-27 17:37:33 +03:00
|
|
|
#include "hw/misc/aspeed_scu.h"
|
2016-09-06 21:52:17 +03:00
|
|
|
#include "hw/misc/aspeed_sdmc.h"
|
2019-07-01 19:26:18 +03:00
|
|
|
#include "hw/misc/aspeed_xdma.h"
|
2016-03-16 20:06:00 +03:00
|
|
|
#include "hw/timer/aspeed_timer.h"
|
2019-07-01 19:26:16 +03:00
|
|
|
#include "hw/timer/aspeed_rtc.h"
|
2016-06-06 18:59:29 +03:00
|
|
|
#include "hw/i2c/aspeed_i2c.h"
|
2016-07-04 15:06:37 +03:00
|
|
|
#include "hw/ssi/aspeed_smc.h"
|
2017-02-07 21:29:59 +03:00
|
|
|
#include "hw/watchdog/wdt_aspeed.h"
|
2017-04-14 11:35:02 +03:00
|
|
|
#include "hw/net/ftgmac100.h"
|
2019-08-12 08:23:31 +03:00
|
|
|
#include "target/arm/cpu.h"
|
2019-09-04 10:04:58 +03:00
|
|
|
#include "hw/gpio/aspeed_gpio.h"
|
2019-09-25 17:32:27 +03:00
|
|
|
#include "hw/sd/aspeed_sdhci.h"
|
2016-03-16 20:06:00 +03:00
|
|
|
|
2016-10-17 21:22:16 +03:00
|
|
|
#define ASPEED_SPIS_NUM 2
|
2019-09-25 17:32:36 +03:00
|
|
|
#define ASPEED_WDTS_NUM 4
|
2019-07-01 19:26:16 +03:00
|
|
|
#define ASPEED_CPUS_NUM 2
|
2019-07-01 19:26:16 +03:00
|
|
|
#define ASPEED_MACS_NUM 2
|
2016-10-17 21:22:16 +03:00
|
|
|
|
2016-09-22 20:13:05 +03:00
|
|
|
typedef struct AspeedSoCState {
|
2016-03-16 20:06:00 +03:00
|
|
|
/*< private >*/
|
|
|
|
DeviceState parent;
|
|
|
|
|
|
|
|
/*< public >*/
|
2019-07-01 19:26:16 +03:00
|
|
|
ARMCPU cpu[ASPEED_CPUS_NUM];
|
|
|
|
uint32_t num_cpus;
|
2016-12-27 17:59:27 +03:00
|
|
|
MemoryRegion sram;
|
2016-03-16 20:06:00 +03:00
|
|
|
AspeedVICState vic;
|
2019-07-01 19:26:16 +03:00
|
|
|
AspeedRtcState rtc;
|
2016-03-16 20:06:00 +03:00
|
|
|
AspeedTimerCtrlState timerctrl;
|
2016-06-06 18:59:29 +03:00
|
|
|
AspeedI2CState i2c;
|
2016-06-27 17:37:33 +03:00
|
|
|
AspeedSCUState scu;
|
2019-07-01 19:26:18 +03:00
|
|
|
AspeedXDMAState xdma;
|
2016-10-17 21:22:16 +03:00
|
|
|
AspeedSMCState fmc;
|
2016-10-17 21:22:16 +03:00
|
|
|
AspeedSMCState spi[ASPEED_SPIS_NUM];
|
2016-09-06 21:52:17 +03:00
|
|
|
AspeedSDMCState sdmc;
|
2017-07-11 13:21:26 +03:00
|
|
|
AspeedWDTState wdt[ASPEED_WDTS_NUM];
|
2019-07-01 19:26:16 +03:00
|
|
|
FTGMAC100State ftgmac100[ASPEED_MACS_NUM];
|
2019-09-04 10:04:58 +03:00
|
|
|
AspeedGPIOState gpio;
|
2019-09-25 17:32:27 +03:00
|
|
|
AspeedSDHCIState sdhci;
|
2016-09-22 20:13:05 +03:00
|
|
|
} AspeedSoCState;
|
2016-03-16 20:06:00 +03:00
|
|
|
|
2016-09-22 20:13:05 +03:00
|
|
|
#define TYPE_ASPEED_SOC "aspeed-soc"
|
|
|
|
#define ASPEED_SOC(obj) OBJECT_CHECK(AspeedSoCState, (obj), TYPE_ASPEED_SOC)
|
2016-03-16 20:06:00 +03:00
|
|
|
|
2016-09-22 20:13:05 +03:00
|
|
|
typedef struct AspeedSoCInfo {
|
|
|
|
const char *name;
|
2017-09-13 19:04:57 +03:00
|
|
|
const char *cpu_type;
|
2016-09-22 20:13:05 +03:00
|
|
|
uint32_t silicon_rev;
|
2016-12-27 17:59:27 +03:00
|
|
|
uint64_t sram_size;
|
2016-10-17 21:22:16 +03:00
|
|
|
int spis_num;
|
2017-07-11 13:21:26 +03:00
|
|
|
int wdts_num;
|
2019-07-01 19:26:15 +03:00
|
|
|
const int *irqmap;
|
2019-07-01 19:26:15 +03:00
|
|
|
const hwaddr *memmap;
|
2019-07-01 19:26:16 +03:00
|
|
|
uint32_t num_cpus;
|
2016-09-22 20:13:05 +03:00
|
|
|
} AspeedSoCInfo;
|
|
|
|
|
|
|
|
typedef struct AspeedSoCClass {
|
|
|
|
DeviceClass parent_class;
|
|
|
|
AspeedSoCInfo *info;
|
|
|
|
} AspeedSoCClass;
|
|
|
|
|
|
|
|
#define ASPEED_SOC_CLASS(klass) \
|
|
|
|
OBJECT_CLASS_CHECK(AspeedSoCClass, (klass), TYPE_ASPEED_SOC)
|
|
|
|
#define ASPEED_SOC_GET_CLASS(obj) \
|
|
|
|
OBJECT_GET_CLASS(AspeedSoCClass, (obj), TYPE_ASPEED_SOC)
|
2016-03-16 20:06:00 +03:00
|
|
|
|
2019-07-01 19:26:15 +03:00
|
|
|
enum {
|
|
|
|
ASPEED_IOMEM,
|
|
|
|
ASPEED_UART1,
|
|
|
|
ASPEED_UART2,
|
|
|
|
ASPEED_UART3,
|
|
|
|
ASPEED_UART4,
|
|
|
|
ASPEED_UART5,
|
|
|
|
ASPEED_VUART,
|
|
|
|
ASPEED_FMC,
|
|
|
|
ASPEED_SPI1,
|
|
|
|
ASPEED_SPI2,
|
|
|
|
ASPEED_VIC,
|
|
|
|
ASPEED_SDMC,
|
|
|
|
ASPEED_SCU,
|
|
|
|
ASPEED_ADC,
|
|
|
|
ASPEED_SRAM,
|
2019-09-25 17:32:27 +03:00
|
|
|
ASPEED_SDHCI,
|
2019-07-01 19:26:15 +03:00
|
|
|
ASPEED_GPIO,
|
|
|
|
ASPEED_RTC,
|
|
|
|
ASPEED_TIMER1,
|
|
|
|
ASPEED_TIMER2,
|
|
|
|
ASPEED_TIMER3,
|
|
|
|
ASPEED_TIMER4,
|
|
|
|
ASPEED_TIMER5,
|
|
|
|
ASPEED_TIMER6,
|
|
|
|
ASPEED_TIMER7,
|
|
|
|
ASPEED_TIMER8,
|
|
|
|
ASPEED_WDT,
|
|
|
|
ASPEED_PWM,
|
|
|
|
ASPEED_LPC,
|
|
|
|
ASPEED_IBT,
|
|
|
|
ASPEED_I2C,
|
|
|
|
ASPEED_ETH1,
|
|
|
|
ASPEED_ETH2,
|
2019-07-01 19:26:15 +03:00
|
|
|
ASPEED_SDRAM,
|
2019-07-01 19:26:18 +03:00
|
|
|
ASPEED_XDMA,
|
2019-07-01 19:26:15 +03:00
|
|
|
};
|
|
|
|
|
2016-09-22 20:13:05 +03:00
|
|
|
#endif /* ASPEED_SOC_H */
|