Previously, the SSP memory was incorrectly modeled as "SRAM" with
a 32 MB size. This change introduces a new sdram field in
AspeedCoprocessorState and updates the realization logic accordingly.
Rename from SRAM to SDRAM and correct size from 32MB to 512MB to match
hardware.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
include/hw/arm/aspeed_coprocessor.h | 1 +
hw/arm/aspeed_ast27x0-ssp.c | 20 ++++++++++----------
2 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/include/hw/arm/aspeed_coprocessor.h b/include/hw/arm/aspeed_coprocessor.h
index d77655d659..0c7168a89c 100644
--- a/include/hw/arm/aspeed_coprocessor.h
+++ b/include/hw/arm/aspeed_coprocessor.h
@@ -16,6 +16,7 @@ struct AspeedCoprocessorState {
DeviceState parent;
MemoryRegion *memory;
+ MemoryRegion sdram;
MemoryRegion sram;
Clock *sysclk;
diff --git a/hw/arm/aspeed_ast27x0-ssp.c b/hw/arm/aspeed_ast27x0-ssp.c
index 936c7c72e8..9f3a1933a0 100644
--- a/hw/arm/aspeed_ast27x0-ssp.c
+++ b/hw/arm/aspeed_ast27x0-ssp.c
@@ -16,10 +16,10 @@
#include "hw/arm/aspeed_soc.h"
#include "hw/arm/aspeed_coprocessor.h"
-#define AST2700_SSP_RAM_SIZE (32 * MiB)
+#define AST2700_SSP_SDRAM_SIZE (512 * MiB)
static const hwaddr aspeed_soc_ast27x0ssp_memmap[] = {
- [ASPEED_DEV_SRAM] = 0x00000000,
+ [ASPEED_DEV_SDRAM] = 0x00000000,
[ASPEED_DEV_INTC] = 0x72100000,
[ASPEED_DEV_SCU] = 0x72C02000,
[ASPEED_DEV_SCUIO] = 0x74C02000,
@@ -165,7 +165,7 @@ static void aspeed_soc_ast27x0ssp_realize(DeviceState *dev_soc, Error **errp)
AspeedCoprocessorState *s = ASPEED_COPROCESSOR(dev_soc);
AspeedCoprocessorClass *sc = ASPEED_COPROCESSOR_GET_CLASS(s);
DeviceState *armv7m;
- g_autofree char *sram_name = NULL;
+ g_autofree char *sdram_name = NULL;
int uart;
int i;
@@ -184,16 +184,16 @@ static void aspeed_soc_ast27x0ssp_realize(DeviceState *dev_soc, Error **errp)
OBJECT(s->memory), &error_abort);
sysbus_realize(SYS_BUS_DEVICE(&a->armv7m), &error_abort);
- sram_name = g_strdup_printf("aspeed.dram.%d",
- CPU(a->armv7m.cpu)->cpu_index);
-
- if (!memory_region_init_ram(&s->sram, OBJECT(s), sram_name,
- AST2700_SSP_RAM_SIZE, errp)) {
+ /* SDRAM */
+ sdram_name = g_strdup_printf("aspeed.sdram.%d",
+ CPU(a->armv7m.cpu)->cpu_index);
+ if (!memory_region_init_ram(&s->sdram, OBJECT(s), sdram_name,
+ AST2700_SSP_SDRAM_SIZE, errp)) {
return;
}
memory_region_add_subregion(s->memory,
- sc->memmap[ASPEED_DEV_SRAM],
- &s->sram);
+ sc->memmap[ASPEED_DEV_SDRAM],
+ &s->sdram);
/* SCU */
if (!sysbus_realize(SYS_BUS_DEVICE(&s->scu), errp)) {
--
2.43.0