diff mbox series

[v3,02/11] rockchip: NR_DRAM_BANKS now defaults to 10 when Rockchip TPL blob is used

Message ID 20240415-rk35xx-dram-atags-v3-2-5bc5475b3c0d@theobroma-systems.com
State Accepted
Delegated to: Kever Yang
Headers show
Series rockchip: sdram: Support getting banks from TPL for rk3568 and rk3588 | expand

Commit Message

Quentin Schulz April 15, 2024, 2:16 p.m. UTC
From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

When Rockchip TPL blob is used, the memory areas that can be used for
DRAM is gotten from ATAGS passed through the DRAM at a specific address.

The DDR_MEM tag contains at most 10 areas, so we should default to 10 if
Rockchip TPL blob is used. Note that it is technically possible we need
more if one of those 10 areas overlaps with reserved memory area,
forcing us to split it in two. But a default doesn't need to handle all
cases, only most.

Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 arch/arm/mach-rockchip/Kconfig | 3 +++
 1 file changed, 3 insertions(+)

Comments

Kever Yang April 22, 2024, 8:33 a.m. UTC | #1
On 2024/4/15 22:16, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
>
> When Rockchip TPL blob is used, the memory areas that can be used for
> DRAM is gotten from ATAGS passed through the DRAM at a specific address.
>
> The DDR_MEM tag contains at most 10 areas, so we should default to 10 if
> Rockchip TPL blob is used. Note that it is technically possible we need
> more if one of those 10 areas overlaps with reserved memory area,
> forcing us to split it in two. But a default doesn't need to handle all
> cases, only most.
>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

Thanks,
- Kever
> ---
>   arch/arm/mach-rockchip/Kconfig | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
> index f68a0a48949..b7a6f100d41 100644
> --- a/arch/arm/mach-rockchip/Kconfig
> +++ b/arch/arm/mach-rockchip/Kconfig
> @@ -573,6 +573,9 @@ config ROCKCHIP_COMMON_STACK_ADDR
>   	imply TPL_SYS_MALLOC_F if TPL
>   	imply TPL_SYS_MALLOC_SIMPLE if TPL
>   
> +config NR_DRAM_BANKS
> +	default 10 if ROCKCHIP_EXTERNAL_TPL
> +
>   source "arch/arm/mach-rockchip/px30/Kconfig"
>   source "arch/arm/mach-rockchip/rk3036/Kconfig"
>   source "arch/arm/mach-rockchip/rk3066/Kconfig"
>
diff mbox series

Patch

diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index f68a0a48949..b7a6f100d41 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -573,6 +573,9 @@  config ROCKCHIP_COMMON_STACK_ADDR
 	imply TPL_SYS_MALLOC_F if TPL
 	imply TPL_SYS_MALLOC_SIMPLE if TPL
 
+config NR_DRAM_BANKS
+	default 10 if ROCKCHIP_EXTERNAL_TPL
+
 source "arch/arm/mach-rockchip/px30/Kconfig"
 source "arch/arm/mach-rockchip/rk3036/Kconfig"
 source "arch/arm/mach-rockchip/rk3066/Kconfig"