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/arm/arm.h"
|
|
|
|
#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"
|
2016-03-16 20:06:00 +03:00
|
|
|
#include "hw/timer/aspeed_timer.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"
|
2016-03-16 20:06:00 +03:00
|
|
|
|
2016-10-17 21:22:16 +03:00
|
|
|
#define ASPEED_SPIS_NUM 2
|
|
|
|
|
2016-09-22 20:13:05 +03:00
|
|
|
typedef struct AspeedSoCState {
|
2016-03-16 20:06:00 +03:00
|
|
|
/*< private >*/
|
|
|
|
DeviceState parent;
|
|
|
|
|
|
|
|
/*< public >*/
|
|
|
|
ARMCPU *cpu;
|
|
|
|
MemoryRegion iomem;
|
|
|
|
AspeedVICState vic;
|
|
|
|
AspeedTimerCtrlState timerctrl;
|
2016-06-06 18:59:29 +03:00
|
|
|
AspeedI2CState i2c;
|
2016-06-27 17:37:33 +03:00
|
|
|
AspeedSCUState scu;
|
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;
|
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;
|
|
|
|
const char *cpu_model;
|
|
|
|
uint32_t silicon_rev;
|
|
|
|
hwaddr sdram_base;
|
2016-10-17 21:22:16 +03:00
|
|
|
int spis_num;
|
|
|
|
const hwaddr *spi_bases;
|
2016-10-17 21:22:16 +03:00
|
|
|
const char *fmc_typename;
|
|
|
|
const char **spi_typename;
|
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
|
|
|
|
2016-09-22 20:13:05 +03:00
|
|
|
#endif /* ASPEED_SOC_H */
|