4 * Andrew Jeffery <andrew@aj.id.au>
6 * Copyright 2016 IBM Corp.
8 * This code is licensed under the GPL version 2 or later. See
9 * the COPYING file in the top-level directory.
15 #include "hw/cpu/a15mpcore.h"
16 #include "hw/arm/armv7m.h"
17 #include "hw/intc/aspeed_vic.h"
18 #include "hw/misc/aspeed_scu.h"
19 #include "hw/adc/aspeed_adc.h"
20 #include "hw/misc/aspeed_sdmc.h"
21 #include "hw/misc/aspeed_xdma.h"
22 #include "hw/timer/aspeed_timer.h"
23 #include "hw/rtc/aspeed_rtc.h"
24 #include "hw/i2c/aspeed_i2c.h"
25 #include "hw/misc/aspeed_i3c.h"
26 #include "hw/ssi/aspeed_smc.h"
27 #include "hw/misc/aspeed_hace.h"
28 #include "hw/misc/aspeed_sbc.h"
29 #include "hw/watchdog/wdt_aspeed.h"
30 #include "hw/net/ftgmac100.h"
31 #include "target/arm/cpu.h"
32 #include "hw/gpio/aspeed_gpio.h"
33 #include "hw/sd/aspeed_sdhci.h"
34 #include "hw/usb/hcd-ehci.h"
35 #include "qom/object.h"
36 #include "hw/misc/aspeed_lpc.h"
37 #include "hw/misc/unimp.h"
38 #include "hw/misc/aspeed_peci.h"
40 #define ASPEED_SPIS_NUM 2
41 #define ASPEED_EHCIS_NUM 2
42 #define ASPEED_WDTS_NUM 4
43 #define ASPEED_CPUS_NUM 2
44 #define ASPEED_MACS_NUM 4
46 struct AspeedSoCState
{
51 ARMCPU cpu
[ASPEED_CPUS_NUM
];
52 A15MPPrivState a7mpcore
;
55 MemoryRegion
*dram_mr
;
56 MemoryRegion dram_container
;
60 AspeedTimerCtrlState timerctrl
;
68 AspeedSMCState spi
[ASPEED_SPIS_NUM
];
69 EHCISysBusState ehci
[ASPEED_EHCIS_NUM
];
71 UnimplementedDeviceState sbc_unimplemented
;
73 AspeedWDTState wdt
[ASPEED_WDTS_NUM
];
74 FTGMAC100State ftgmac100
[ASPEED_MACS_NUM
];
75 AspeedMiiState mii
[ASPEED_MACS_NUM
];
77 AspeedGPIOState gpio_1_8v
;
78 AspeedSDHCIState sdhci
;
79 AspeedSDHCIState emmc
;
82 uint32_t uart_default
;
84 UnimplementedDeviceState iomem
;
85 UnimplementedDeviceState video
;
86 UnimplementedDeviceState emmc_boot_controller
;
87 UnimplementedDeviceState dpmcu
;
90 #define TYPE_ASPEED_SOC "aspeed-soc"
91 OBJECT_DECLARE_TYPE(AspeedSoCState
, AspeedSoCClass
, ASPEED_SOC
)
93 struct AspeedSoCClass
{
94 DeviceClass parent_class
;
106 const hwaddr
*memmap
;
108 qemu_irq (*get_irq
)(AspeedSoCState
*s
, int dev
);
143 ASPEED_DEV_GPIO_1_8V
,
177 qemu_irq
aspeed_soc_get_irq(AspeedSoCState
*s
, int dev
);
178 void aspeed_soc_uart_init(AspeedSoCState
*s
);
179 bool aspeed_soc_dram_init(AspeedSoCState
*s
, Error
**errp
);
180 void aspeed_mmio_map(AspeedSoCState
*s
, SysBusDevice
*dev
, int n
, hwaddr addr
);
181 void aspeed_mmio_map_unimplemented(AspeedSoCState
*s
, SysBusDevice
*dev
,
182 const char *name
, hwaddr addr
,
185 #endif /* ASPEED_SOC_H */