On 4/17/26 05:28, Jamin Lin wrote:
The AST2700 SSP/TSP firmware accesses OTP MMIO regions that
are not yet implemented in QEMU.

This change adds unimplemented MMIO devices for the OTP and maps them to
their corresponding physical addresses in the SSP/TSP address space.
These stub devices allow QEMU to safely handle firmware
accesses and prevent spurious exceptions, while accurately reflecting
the hardware memory map.

No functional changes.

Signed-off-by: Jamin Lin <[email protected]>
---
  include/hw/arm/aspeed_coprocessor.h | 1 +
  include/hw/arm/aspeed_soc.h         | 1 +
  hw/arm/aspeed_ast27x0-ssp.c         | 6 ++++++
  hw/arm/aspeed_ast27x0-tsp.c         | 6 ++++++
  4 files changed, 14 insertions(+)

please send first.

Thanks,

C.


diff --git a/include/hw/arm/aspeed_coprocessor.h 
b/include/hw/arm/aspeed_coprocessor.h
index 084040bbed..7750569eed 100644
--- a/include/hw/arm/aspeed_coprocessor.h
+++ b/include/hw/arm/aspeed_coprocessor.h
@@ -47,6 +47,7 @@ struct Aspeed27x0CoprocessorState {
      UnimplementedDeviceState ipc[2];
      UnimplementedDeviceState scuio;
      UnimplementedDeviceState pric[2];
+    UnimplementedDeviceState otp;
ARMv7MState armv7m; diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h
index d39e4f7553..1df847b34d 100644
--- a/include/hw/arm/aspeed_soc.h
+++ b/include/hw/arm/aspeed_soc.h
@@ -299,6 +299,7 @@ enum {
      ASPEED_DEV_IOEXP1_I3C,
      ASPEED_DEV_PRIC0,
      ASPEED_DEV_PRIC1,
+    ASPEED_DEV_OTP,
  };
const char *aspeed_soc_cpu_type(const char * const *valid_cpu_types);
diff --git a/hw/arm/aspeed_ast27x0-ssp.c b/hw/arm/aspeed_ast27x0-ssp.c
index 467fdea9db..78bd6f342c 100644
--- a/hw/arm/aspeed_ast27x0-ssp.c
+++ b/hw/arm/aspeed_ast27x0-ssp.c
@@ -30,6 +30,7 @@ static const hwaddr aspeed_soc_ast27x0ssp_memmap[] = {
      [ASPEED_DEV_FMC]       =  0x74000000,
      [ASPEED_DEV_PRIC1]     =  0x74100000,
      [ASPEED_DEV_SCUIO]     =  0x74C02000,
+    [ASPEED_DEV_OTP]       =  0x74C07000,
      [ASPEED_DEV_INTCIO]    =  0x74C18000,
      [ASPEED_DEV_UART0]     =  0x74C33000,
      [ASPEED_DEV_UART1]     =  0x74C33100,
@@ -148,6 +149,8 @@ static void aspeed_soc_ast27x0ssp_init(Object *obj)
                              TYPE_UNIMPLEMENTED_DEVICE);
      object_initialize_child(obj, "pric1", &a->pric[1],
                              TYPE_UNIMPLEMENTED_DEVICE);
+    object_initialize_child(obj, "otp", &a->otp,
+                            TYPE_UNIMPLEMENTED_DEVICE);
  }
static void aspeed_soc_ast27x0ssp_realize(DeviceState *dev_soc, Error **errp)
@@ -288,6 +291,9 @@ static void aspeed_soc_ast27x0ssp_realize(DeviceState 
*dev_soc, Error **errp)
      aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&a->pric[1]),
                                    "aspeed.pric1",
                                    sc->memmap[ASPEED_DEV_PRIC1], 0x1000);
+    aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&a->otp),
+                                  "aspeed.otp",
+                                  sc->memmap[ASPEED_DEV_OTP], 0x800);
  }
static const Property aspeed_27x0_coprocessor_properties[] = {
diff --git a/hw/arm/aspeed_ast27x0-tsp.c b/hw/arm/aspeed_ast27x0-tsp.c
index 3a90bbec51..d6448d82f5 100644
--- a/hw/arm/aspeed_ast27x0-tsp.c
+++ b/hw/arm/aspeed_ast27x0-tsp.c
@@ -30,6 +30,7 @@ static const hwaddr aspeed_soc_ast27x0tsp_memmap[] = {
      [ASPEED_DEV_FMC]       =  0x74000000,
      [ASPEED_DEV_PRIC1]     =  0x74100000,
      [ASPEED_DEV_SCUIO]     =  0x74C02000,
+    [ASPEED_DEV_OTP]       =  0x74C07000,
      [ASPEED_DEV_INTCIO]    =  0x74C18000,
      [ASPEED_DEV_UART0]     =  0x74C33000,
      [ASPEED_DEV_UART1]     =  0x74C33100,
@@ -148,6 +149,8 @@ static void aspeed_soc_ast27x0tsp_init(Object *obj)
                              TYPE_UNIMPLEMENTED_DEVICE);
      object_initialize_child(obj, "pric1", &a->pric[1],
                              TYPE_UNIMPLEMENTED_DEVICE);
+    object_initialize_child(obj, "otp", &a->otp,
+                            TYPE_UNIMPLEMENTED_DEVICE);
  }
static void aspeed_soc_ast27x0tsp_realize(DeviceState *dev_soc, Error **errp)
@@ -285,6 +288,9 @@ static void aspeed_soc_ast27x0tsp_realize(DeviceState 
*dev_soc, Error **errp)
      aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&a->pric[1]),
                                    "aspeed.pric1",
                                    sc->memmap[ASPEED_DEV_PRIC1], 0x1000);
+    aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&a->otp),
+                                  "aspeed.otp",
+                                  sc->memmap[ASPEED_DEV_OTP], 0x800);
  }
static const Property aspeed_27x0_coprocessor_properties[] = {


Reply via email to