Skip to contentSkip to conversation

aspeed/smc: Reintroduce "dram-base" property for AST2700

PATCH Applied Cédric Le Goater 4 participants 4 messages May 27, 2024 – Jun 10, 2024 Arm/Aspeed machine support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 aspeed/smc: Reintroduce "dram-base" property for AST2700

The Aspeed SMC device model use to have a 'sdram_base' property. It was removed by commit d177892d4a48 ("aspeed/smc: Remove unused "sdram-base" property") because previous changes simplified the DMA transaction model to use an offset in RAM and not the physical address.

The AST2700 SoC has larger address space (64-bit) and a new register DMA DRAM Side Address High Part (0x7C) is introduced to deal with the high bits of the DMA address. To be able to compute the offset of the DMA transaction, as done on the other SoCs, we will need to know where the DRAM is mapped in the address space. Re-introduce a "dram-base" property to hold this value.

---
 include/hw/ssi/aspeed_smc.h | 1 +
 hw/ssi/aspeed_smc.c         | 1 +
 2 files changed, 2 insertions(+)
include/hw/ssi/aspeed_smc.h +1 -0
index 8e1dda556b91..8791cc0ecb11 100644
@@ -76,6 +76,7 @@ struct AspeedSMCState {
     AddressSpace flash_as;
     MemoryRegion *dram_mr;
     AddressSpace dram_as;
+    uint64_t     dram_base;
 
     AspeedSMCFlash flashes[ASPEED_SMC_CS_MAX];
 
hw/ssi/aspeed_smc.c +1 -0
index 6e1a84c19713..7075bc9d61b0 100644
@@ -1220,6 +1220,7 @@ static const VMStateDescription vmstate_aspeed_smc = {
 
 static Property aspeed_smc_properties[] = {
     DEFINE_PROP_BOOL("inject-failure", AspeedSMCState, inject_failure, false),
+    DEFINE_PROP_UINT64("dram-base", AspeedSMCState, dram_base, 0),
     DEFINE_PROP_LINK("dram", AspeedSMCState, dram_mr,
                      TYPE_MEMORY_REGION, MemoryRegion *),
     DEFINE_PROP_END_OF_LIST(),
Signature · 1 line
2.45.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Cédric Le Goater

The Aspeed SMC device model use to have a 'sdram_base' property. It was removed by commit d177892d4a48 ("aspeed/smc: Remove unused "sdram-base" property") because previous changes simplified the DMA transaction model to use an offset in RAM and not the physical address.

The AST2700 SoC has larger address space (64-bit) and a new register DMA DRAM Side Address High Part (0x7C) is introduced to deal with the high bits of the DMA address. To be able to compute the offset of the DMA transaction, as done on the other SoCs, we will need to know where the DRAM is mapped in the address space. Re-introduce a "dram-base" property to hold this value.

Quoted 5 lines
---
  include/hw/ssi/aspeed_smc.h | 1 +
  hw/ssi/aspeed_smc.c         | 1 +
  2 files changed, 2 insertions(+)
Reviewed-by on v1 1/1
#2 lore raw
In reply to Cédric Le Goater
Quoted 43 lines

The Aspeed SMC device model use to have a 'sdram_base' property. It was removed by commit d177892d4a48 ("aspeed/smc: Remove unused "sdram-base" property") because previous changes simplified the DMA transaction model to use an offset in RAM and not the physical address.

The AST2700 SoC has larger address space (64-bit) and a new register DMA DRAM Side Address High Part (0x7C) is introduced to deal with the high bits of the DMA address. To be able to compute the offset of the DMA transaction, as done on the other SoCs, we will need to know where the DRAM is mapped in the address space. Re-introduce a "dram-base"
property to hold this value.

---
 include/hw/ssi/aspeed_smc.h | 1 +
 hw/ssi/aspeed_smc.c         | 1 +
 2 files changed, 2 insertions(+)
include/hw/ssi/aspeed_smc.h index renamed from include/hw/ssi/aspeed_smc.h +0 -0

8e1dda556b91..8791cc0ecb11 100644

include/hw/ssi/aspeed_smc.h +1 -0
@@ -76,6 +76,7 @@ struct AspeedSMCState {
     AddressSpace flash_as;
     MemoryRegion *dram_mr;
     AddressSpace dram_as;
+    uint64_t     dram_base;
 
     AspeedSMCFlash flashes[ASPEED_SMC_CS_MAX];
 
hw/ssi/aspeed_smc.c index renamed from hw/ssi/aspeed_smc.c +0 -0

6e1a84c19713..7075bc9d61b0 100644

hw/ssi/aspeed_smc.c +1 -0
@@ -1220,6 +1220,7 @@ static const VMStateDescription
 vmstate_aspeed_smc = {
 
 static Property aspeed_smc_properties[] = {
     DEFINE_PROP_BOOL("inject-failure", AspeedSMCState, inject_failure,
 false),
+    DEFINE_PROP_UINT64("dram-base", AspeedSMCState, dram_base, 0),
     DEFINE_PROP_LINK("dram", AspeedSMCState, dram_mr,
Quoted 4 lines

TYPE_MEMORY_REGION, MemoryRegion *),
DEFINE_PROP_END_OF_LIST(),
--
2.45.1

Thanks-Jamin

#3 lore raw
In reply to Cédric Le Goater
Quoted 13 lines · Cédric Le Goater

The Aspeed SMC device model use to have a 'sdram_base' property. It was removed by commit d177892d4a48 ("aspeed/smc: Remove unused "sdram-base" property") because previous changes simplified the DMA transaction model to use an offset in RAM and not the physical address.

The AST2700 SoC has larger address space (64-bit) and a new register DMA DRAM Side Address High Part (0x7C) is introduced to deal with the high bits of the DMA address. To be able to compute the offset of the DMA transaction, as done on the other SoCs, we will need to know where the DRAM is mapped in the address space. Re-introduce a "dram-base" property to hold this value.

Quoted 5 lines
---
  include/hw/ssi/aspeed_smc.h | 1 +
  hw/ssi/aspeed_smc.c         | 1 +
  2 files changed, 2 insertions(+)

Applied to aspeed-next.

Thanks,

C.