mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 11:04:58 -06:00
aspeed: add support for the AST2500 SoC SMC controllers
The SMC controllers on the Aspeed AST2500 SoC are very similar to the ones found on the AST2400. The differences are on the number of supported flash modules and their default mappings in the SoC address space. The Aspeed AST2500 has one SPI controller for the BMC firmware and two for the host firmware. All controllers have now the same set of registers compatible with the AST2400 FMC controller and the legacy 'SMC' controller is fully gone. We keep the FMC object to act as the BMC SPI controller and add a new SPI controller for the host. We also have to introduce new type names to handle the differences in the flash modules memory mappping. Signed-off-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: Andrew Jeffery <andrew@aj.id.au> Message-id: 1474977462-28032-5-git-send-email-clg@kaod.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
dbcabeeb54
commit
6dc52326cc
3 changed files with 44 additions and 7 deletions
|
@ -130,6 +130,7 @@
|
|||
#define ASPEED_SOC_SMC_FLASH_BASE 0x10000000
|
||||
#define ASPEED_SOC_FMC_FLASH_BASE 0x20000000
|
||||
#define ASPEED_SOC_SPI_FLASH_BASE 0x30000000
|
||||
#define ASPEED_SOC_SPI2_FLASH_BASE 0x38000000
|
||||
|
||||
/*
|
||||
* Default segments mapping addresses and size for each slave per
|
||||
|
@ -142,7 +143,7 @@ static const AspeedSegments aspeed_segments_legacy[] = {
|
|||
};
|
||||
|
||||
static const AspeedSegments aspeed_segments_fmc[] = {
|
||||
{ 0x20000000, 64 * 1024 * 1024 },
|
||||
{ 0x20000000, 64 * 1024 * 1024 }, /* start address is readonly */
|
||||
{ 0x24000000, 32 * 1024 * 1024 },
|
||||
{ 0x26000000, 32 * 1024 * 1024 },
|
||||
{ 0x28000000, 32 * 1024 * 1024 },
|
||||
|
@ -153,6 +154,22 @@ static const AspeedSegments aspeed_segments_spi[] = {
|
|||
{ 0x30000000, 64 * 1024 * 1024 },
|
||||
};
|
||||
|
||||
static const AspeedSegments aspeed_segments_ast2500_fmc[] = {
|
||||
{ 0x20000000, 128 * 1024 * 1024 }, /* start address is readonly */
|
||||
{ 0x28000000, 32 * 1024 * 1024 },
|
||||
{ 0x2A000000, 32 * 1024 * 1024 },
|
||||
};
|
||||
|
||||
static const AspeedSegments aspeed_segments_ast2500_spi1[] = {
|
||||
{ 0x30000000, 32 * 1024 * 1024 }, /* start address is readonly */
|
||||
{ 0x32000000, 96 * 1024 * 1024 }, /* end address is readonly */
|
||||
};
|
||||
|
||||
static const AspeedSegments aspeed_segments_ast2500_spi2[] = {
|
||||
{ 0x38000000, 32 * 1024 * 1024 }, /* start address is readonly */
|
||||
{ 0x3A000000, 96 * 1024 * 1024 }, /* end address is readonly */
|
||||
};
|
||||
|
||||
static const AspeedSMCController controllers[] = {
|
||||
{ "aspeed.smc.smc", R_CONF, R_CE_CTRL, R_CTRL0, R_TIMINGS,
|
||||
CONF_ENABLE_W0, 5, aspeed_segments_legacy,
|
||||
|
@ -163,6 +180,15 @@ static const AspeedSMCController controllers[] = {
|
|||
{ "aspeed.smc.spi", R_SPI_CONF, 0xff, R_SPI_CTRL0, R_SPI_TIMINGS,
|
||||
SPI_CONF_ENABLE_W0, 1, aspeed_segments_spi,
|
||||
ASPEED_SOC_SPI_FLASH_BASE, 0x10000000 },
|
||||
{ "aspeed.smc.ast2500-fmc", R_CONF, R_CE_CTRL, R_CTRL0, R_TIMINGS,
|
||||
CONF_ENABLE_W0, 3, aspeed_segments_ast2500_fmc,
|
||||
ASPEED_SOC_FMC_FLASH_BASE, 0x10000000 },
|
||||
{ "aspeed.smc.ast2500-spi1", R_CONF, R_CE_CTRL, R_CTRL0, R_TIMINGS,
|
||||
CONF_ENABLE_W0, 2, aspeed_segments_ast2500_spi1,
|
||||
ASPEED_SOC_SPI_FLASH_BASE, 0x8000000 },
|
||||
{ "aspeed.smc.ast2500-spi2", R_CONF, R_CE_CTRL, R_CTRL0, R_TIMINGS,
|
||||
CONF_ENABLE_W0, 2, aspeed_segments_ast2500_spi2,
|
||||
ASPEED_SOC_SPI2_FLASH_BASE, 0x8000000 },
|
||||
};
|
||||
|
||||
static uint64_t aspeed_smc_flash_default_read(void *opaque, hwaddr addr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue