2016-03-16 18:06:00 +01:00
|
|
|
/*
|
2016-09-22 19:13:05 +02:00
|
|
|
* ASPEED SoC family
|
2016-03-16 18:06:00 +01: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 19:13:05 +02:00
|
|
|
#ifndef ASPEED_SOC_H
|
|
|
|
#define ASPEED_SOC_H
|
2016-03-16 18:06:00 +01:00
|
|
|
|
|
|
|
#include "hw/arm/arm.h"
|
|
|
|
#include "hw/intc/aspeed_vic.h"
|
2016-06-27 16:37:33 +02:00
|
|
|
#include "hw/misc/aspeed_scu.h"
|
2016-09-06 20:52:17 +02:00
|
|
|
#include "hw/misc/aspeed_sdmc.h"
|
2016-03-16 18:06:00 +01:00
|
|
|
#include "hw/timer/aspeed_timer.h"
|
2016-06-06 17:59:29 +02:00
|
|
|
#include "hw/i2c/aspeed_i2c.h"
|
2016-07-04 14:06:37 +02:00
|
|
|
#include "hw/ssi/aspeed_smc.h"
|
2017-02-07 19:29:59 +01:00
|
|
|
#include "hw/watchdog/wdt_aspeed.h"
|
2017-04-14 10:35:02 +02:00
|
|
|
#include "hw/net/ftgmac100.h"
|
2016-03-16 18:06:00 +01:00
|
|
|
|
2016-10-17 20:22:16 +02:00
|
|
|
#define ASPEED_SPIS_NUM 2
|
2017-07-11 12:21:26 +02:00
|
|
|
#define ASPEED_WDTS_NUM 3
|
2016-10-17 20:22:16 +02:00
|
|
|
|
2016-09-22 19:13:05 +02:00
|
|
|
typedef struct AspeedSoCState {
|
2016-03-16 18:06:00 +01:00
|
|
|
/*< private >*/
|
|
|
|
DeviceState parent;
|
|
|
|
|
|
|
|
/*< public >*/
|
2016-12-27 15:59:26 +01:00
|
|
|
ARMCPU cpu;
|
2016-12-27 15:59:27 +01:00
|
|
|
MemoryRegion sram;
|
2016-03-16 18:06:00 +01:00
|
|
|
AspeedVICState vic;
|
|
|
|
AspeedTimerCtrlState timerctrl;
|
2016-06-06 17:59:29 +02:00
|
|
|
AspeedI2CState i2c;
|
2016-06-27 16:37:33 +02:00
|
|
|
AspeedSCUState scu;
|
2016-10-17 20:22:16 +02:00
|
|
|
AspeedSMCState fmc;
|
2016-10-17 20:22:16 +02:00
|
|
|
AspeedSMCState spi[ASPEED_SPIS_NUM];
|
2016-09-06 20:52:17 +02:00
|
|
|
AspeedSDMCState sdmc;
|
2017-07-11 12:21:26 +02:00
|
|
|
AspeedWDTState wdt[ASPEED_WDTS_NUM];
|
2017-04-14 10:35:02 +02:00
|
|
|
FTGMAC100State ftgmac100;
|
2016-09-22 19:13:05 +02:00
|
|
|
} AspeedSoCState;
|
2016-03-16 18:06:00 +01:00
|
|
|
|
2016-09-22 19:13:05 +02:00
|
|
|
#define TYPE_ASPEED_SOC "aspeed-soc"
|
|
|
|
#define ASPEED_SOC(obj) OBJECT_CHECK(AspeedSoCState, (obj), TYPE_ASPEED_SOC)
|
2016-03-16 18:06:00 +01:00
|
|
|
|
2016-09-22 19:13:05 +02:00
|
|
|
typedef struct AspeedSoCInfo {
|
|
|
|
const char *name;
|
2017-09-13 18:04:57 +02:00
|
|
|
const char *cpu_type;
|
2016-09-22 19:13:05 +02:00
|
|
|
uint32_t silicon_rev;
|
|
|
|
hwaddr sdram_base;
|
2016-12-27 15:59:27 +01:00
|
|
|
uint64_t sram_size;
|
2016-10-17 20:22:16 +02:00
|
|
|
int spis_num;
|
|
|
|
const hwaddr *spi_bases;
|
2016-10-17 20:22:16 +02:00
|
|
|
const char *fmc_typename;
|
|
|
|
const char **spi_typename;
|
2017-07-11 12:21:26 +02:00
|
|
|
int wdts_num;
|
2016-09-22 19:13:05 +02: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 18:06:00 +01:00
|
|
|
|
2016-09-22 19:13:05 +02:00
|
|
|
#endif /* ASPEED_SOC_H */
|