qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] aspeed/smc: Reintroduce "dram-base" property for AST2700
@ 2024-05-27 12:43 Cédric Le Goater
  2024-05-27 16:10 ` Philippe Mathieu-Daudé
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Cédric Le Goater @ 2024-05-27 12:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm, Peter Maydell, Jamin Lin, 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.

Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
 include/hw/ssi/aspeed_smc.h | 1 +
 hw/ssi/aspeed_smc.c         | 1 +
 2 files changed, 2 insertions(+)

diff --git a/include/hw/ssi/aspeed_smc.h b/include/hw/ssi/aspeed_smc.h
index 8e1dda556b91..8791cc0ecb11 100644
--- a/include/hw/ssi/aspeed_smc.h
+++ b/include/hw/ssi/aspeed_smc.h
@@ -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];
 
diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
index 6e1a84c19713..7075bc9d61b0 100644
--- a/hw/ssi/aspeed_smc.c
+++ b/hw/ssi/aspeed_smc.c
@@ -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(),
-- 
2.45.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] aspeed/smc: Reintroduce "dram-base" property for AST2700
  2024-05-27 12:43 [PATCH] aspeed/smc: Reintroduce "dram-base" property for AST2700 Cédric Le Goater
@ 2024-05-27 16:10 ` Philippe Mathieu-Daudé
  2024-05-28  1:31 ` Jamin Lin
  2024-06-10  9:23 ` Cédric Le Goater
  2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-05-27 16:10 UTC (permalink / raw)
  To: Cédric Le Goater, qemu-devel; +Cc: qemu-arm, Peter Maydell, Jamin Lin

On 27/5/24 14:43, Cédric Le Goater wrote:
> 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.
> 
> Signed-off-by: Cédric Le Goater <clg@redhat.com>
> ---
>   include/hw/ssi/aspeed_smc.h | 1 +
>   hw/ssi/aspeed_smc.c         | 1 +
>   2 files changed, 2 insertions(+)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] aspeed/smc: Reintroduce "dram-base" property for AST2700
  2024-05-27 12:43 [PATCH] aspeed/smc: Reintroduce "dram-base" property for AST2700 Cédric Le Goater
  2024-05-27 16:10 ` Philippe Mathieu-Daudé
@ 2024-05-28  1:31 ` Jamin Lin
  2024-06-10  9:23 ` Cédric Le Goater
  2 siblings, 0 replies; 4+ messages in thread
From: Jamin Lin @ 2024-05-28  1:31 UTC (permalink / raw)
  To: Cédric Le Goater, qemu-devel@nongnu.org
  Cc: qemu-arm@nongnu.org, Peter Maydell

> 
> 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.
> 
> Signed-off-by: Cédric Le Goater <clg@redhat.com>
> ---
>  include/hw/ssi/aspeed_smc.h | 1 +
>  hw/ssi/aspeed_smc.c         | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/include/hw/ssi/aspeed_smc.h b/include/hw/ssi/aspeed_smc.h index
> 8e1dda556b91..8791cc0ecb11 100644
> --- a/include/hw/ssi/aspeed_smc.h
> +++ b/include/hw/ssi/aspeed_smc.h
> @@ -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];
> 
> diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c index
> 6e1a84c19713..7075bc9d61b0 100644
> --- a/hw/ssi/aspeed_smc.c
> +++ b/hw/ssi/aspeed_smc.c
> @@ -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(),
> --
> 2.45.1

Reviewed-by: Jamin Lin <jamin_lin@aspeedtech.com>

Thanks-Jamin



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] aspeed/smc: Reintroduce "dram-base" property for AST2700
  2024-05-27 12:43 [PATCH] aspeed/smc: Reintroduce "dram-base" property for AST2700 Cédric Le Goater
  2024-05-27 16:10 ` Philippe Mathieu-Daudé
  2024-05-28  1:31 ` Jamin Lin
@ 2024-06-10  9:23 ` Cédric Le Goater
  2 siblings, 0 replies; 4+ messages in thread
From: Cédric Le Goater @ 2024-06-10  9:23 UTC (permalink / raw)
  To: Cédric Le Goater, qemu-devel; +Cc: qemu-arm, Peter Maydell, Jamin Lin

On 5/27/24 2:43 PM, Cédric Le Goater wrote:
> 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.
> 
> Signed-off-by: Cédric Le Goater <clg@redhat.com>
> ---
>   include/hw/ssi/aspeed_smc.h | 1 +
>   hw/ssi/aspeed_smc.c         | 1 +
>   2 files changed, 2 insertions(+)


Applied to aspeed-next.

Thanks,

C.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-06-10  9:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-27 12:43 [PATCH] aspeed/smc: Reintroduce "dram-base" property for AST2700 Cédric Le Goater
2024-05-27 16:10 ` Philippe Mathieu-Daudé
2024-05-28  1:31 ` Jamin Lin
2024-06-10  9:23 ` Cédric Le Goater

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).