Skip to contentSkip to conversation

hw/ssi/aspeed_smc: Allow 64-bit wide flash accesses

PATCH Applied Joe Komlodi 2 participants 3 messages Apr 22, 2025 – Apr 23, 2025 Arm/Aspeed machine support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/ssi/aspeed_smc: Allow 64-bit wide flash accesses

cde3247651dc998da5dc1005148302a90d72f21f fixed atomicity for LDRD, which ends up making accesses 64-bits wide. However, the AST2600 bootloader can sometimes compile with LDRD instructions, which causes the acceses to fail when accessing the memory-mapped SPI flash.

To fix this, increase the MMIO region valid access size to allow for 64-bit accesses.

---
 hw/ssi/aspeed_smc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/ssi/aspeed_smc.c +2 -2
index faef1a8e5b..a1160187a4 100644
@@ -359,7 +359,7 @@ static const MemoryRegionOps aspeed_smc_flash_default_ops = {
     .endianness = DEVICE_LITTLE_ENDIAN,
     .valid = {
         .min_access_size = 1,
-        .max_access_size = 4,
+        .max_access_size = 8,
     },
 };
 
@@ -670,7 +670,7 @@ static const MemoryRegionOps aspeed_smc_flash_ops = {
     .endianness = DEVICE_LITTLE_ENDIAN,
     .valid = {
         .min_access_size = 1,
-        .max_access_size = 4,
+        .max_access_size = 8,
     },
 };
 
Signature · 1 line
2.49.0.805.g082f7c87e0-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Joe Komlodi

cde3247651dc998da5dc1005148302a90d72f21f fixed atomicity for LDRD, which ends up making accesses 64-bits wide. However, the AST2600 bootloader can sometimes compile with LDRD instructions, which causes the acceses to fail when accessing the memory-mapped SPI flash.

To fix this, increase the MMIO region valid access size to allow for 64-bit accesses.

To backport on stable-10.0 when merged.

Thanks,

C.

Quoted 26 lines
---
  hw/ssi/aspeed_smc.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
hw/ssi/aspeed_smc.c +2 -2
index faef1a8e5b..a1160187a4 100644
@@ -359,7 +359,7 @@ static const MemoryRegionOps aspeed_smc_flash_default_ops = {
      .endianness = DEVICE_LITTLE_ENDIAN,
      .valid = {
          .min_access_size = 1,
-        .max_access_size = 4,
+        .max_access_size = 8,
      },
  };
 
@@ -670,7 +670,7 @@ static const MemoryRegionOps aspeed_smc_flash_ops = {
      .endianness = DEVICE_LITTLE_ENDIAN,
      .valid = {
          .min_access_size = 1,
-        .max_access_size = 4,
+        .max_access_size = 8,
      },
  };
 
#2 lore raw
In reply to Joe Komlodi
Quoted 9 lines · Joe Komlodi

cde3247651dc998da5dc1005148302a90d72f21f fixed atomicity for LDRD, which ends up making accesses 64-bits wide. However, the AST2600 bootloader can sometimes compile with LDRD instructions, which causes the acceses to fail when accessing the memory-mapped SPI flash.

To fix this, increase the MMIO region valid access size to allow for 64-bit accesses.

Applied to aspeed-next.

Thanks,

C.