mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
hw/arm/aspeed_ast27x0-ssp: Add SDRAM region and fix naming and size to 512MB
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> Reviewed-by: Cédric Le Goater <clg@redhat.com> Link: https://lore.kernel.org/qemu-devel/20251015062210.3128710-2-jamin_lin@aspeedtech.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
committed by
Cédric Le Goater
parent
3c0b42c68f
commit
274e199ba0
+10
-10
@@ -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)) {
|
||||
|
||||
@@ -16,6 +16,7 @@ struct AspeedCoprocessorState {
|
||||
DeviceState parent;
|
||||
|
||||
MemoryRegion *memory;
|
||||
MemoryRegion sdram;
|
||||
MemoryRegion sram;
|
||||
Clock *sysclk;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user