diff mbox series

[v2,15/22] Kconfig: sunxi: prepare for using drivers/ram/sunxi

Message ID 20230928215455.28094-16-andre.przywara@arm.com
State Accepted
Delegated to: Andre Przywara
Headers show
Series sunxi: Allwinner T113s support | expand

Commit Message

Andre Przywara Sept. 28, 2023, 9:54 p.m. UTC
At the moment all Allwinner DRAM initialisation routines are stored in
arch/arm/mach-sunxi, even though those "drivers" are just a giant
collection of writel's, without any architectural dependency.

The R528/T113-s SoC (with ARM cores) and the D1/D1s Soc (with RISC-V
cores) share the same die, so should share the same DRAM init routines as
well.

To prepare for this, add a new sunxi directory inside drivers/ram, and
add some stub entries to prepare for the addition of the share DRAM code
for those SoCs.

The RISC-V D1(s) SoCs will probably use SPL_DM, so make this entry
depend on that already.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 drivers/ram/Kconfig       |  3 ++-
 drivers/ram/sunxi/Kconfig | 14 ++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 drivers/ram/sunxi/Kconfig

Comments

Samuel Holland Oct. 22, 2023, 3:44 a.m. UTC | #1
Hi Andre,

On 9/28/23 16:54, Andre Przywara wrote:
> At the moment all Allwinner DRAM initialisation routines are stored in
> arch/arm/mach-sunxi, even though those "drivers" are just a giant
> collection of writel's, without any architectural dependency.
> 
> The R528/T113-s SoC (with ARM cores) and the D1/D1s Soc (with RISC-V
> cores) share the same die, so should share the same DRAM init routines as
> well.
> 
> To prepare for this, add a new sunxi directory inside drivers/ram, and
> add some stub entries to prepare for the addition of the share DRAM code
> for those SoCs.
> 
> The RISC-V D1(s) SoCs will probably use SPL_DM, so make this entry
> depend on that already.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  drivers/ram/Kconfig       |  3 ++-
>  drivers/ram/sunxi/Kconfig | 14 ++++++++++++++
>  2 files changed, 16 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/ram/sunxi/Kconfig
> 
> diff --git a/drivers/ram/Kconfig b/drivers/ram/Kconfig
> index bf999645774..5b07e920301 100644
> --- a/drivers/ram/Kconfig
> +++ b/drivers/ram/Kconfig
> @@ -109,8 +109,9 @@ config IMXRT_SDRAM
>  
>  source "drivers/ram/aspeed/Kconfig"
>  source "drivers/ram/cadence/Kconfig"
> +source "drivers/ram/octeon/Kconfig"
>  source "drivers/ram/rockchip/Kconfig"
>  source "drivers/ram/sifive/Kconfig"
>  source "drivers/ram/stm32mp1/Kconfig"
> -source "drivers/ram/octeon/Kconfig"
>  source "drivers/ram/starfive/Kconfig"
> +source "drivers/ram/sunxi/Kconfig"
> diff --git a/drivers/ram/sunxi/Kconfig b/drivers/ram/sunxi/Kconfig
> new file mode 100644
> index 00000000000..261d7f57409
> --- /dev/null
> +++ b/drivers/ram/sunxi/Kconfig
> @@ -0,0 +1,14 @@
> +config DRAM_SUN20I_D1
> +	bool "DM DRAM driver support for Allwinner D1"
> +	depends on RAM && ARCH_SUNXI
> +	default y
> +	help
> +	  This enables support for DRAM drivers using the driver model
> +	  for Allwinner SoCs.
> +
> +config DRAM_SUN8I_R528
> +	bool "DRAM driver support for Allwinner R528/T113s"
> +	depends on ARCH_SUNXI
> +	default y if MACH_SUN8I_R528
> +	help
> +	  Select this DRAM controller driver for the R528/T113s SoCs.

Please use a single Kconfig symbol for enabling the driver, whichever
name you choose. It doesn't need to depend on RAM -- you've already
#ifdef'd out the RAM parts. See my comments on the next patch.

Regards,
Samuel
diff mbox series

Patch

diff --git a/drivers/ram/Kconfig b/drivers/ram/Kconfig
index bf999645774..5b07e920301 100644
--- a/drivers/ram/Kconfig
+++ b/drivers/ram/Kconfig
@@ -109,8 +109,9 @@  config IMXRT_SDRAM
 
 source "drivers/ram/aspeed/Kconfig"
 source "drivers/ram/cadence/Kconfig"
+source "drivers/ram/octeon/Kconfig"
 source "drivers/ram/rockchip/Kconfig"
 source "drivers/ram/sifive/Kconfig"
 source "drivers/ram/stm32mp1/Kconfig"
-source "drivers/ram/octeon/Kconfig"
 source "drivers/ram/starfive/Kconfig"
+source "drivers/ram/sunxi/Kconfig"
diff --git a/drivers/ram/sunxi/Kconfig b/drivers/ram/sunxi/Kconfig
new file mode 100644
index 00000000000..261d7f57409
--- /dev/null
+++ b/drivers/ram/sunxi/Kconfig
@@ -0,0 +1,14 @@ 
+config DRAM_SUN20I_D1
+	bool "DM DRAM driver support for Allwinner D1"
+	depends on RAM && ARCH_SUNXI
+	default y
+	help
+	  This enables support for DRAM drivers using the driver model
+	  for Allwinner SoCs.
+
+config DRAM_SUN8I_R528
+	bool "DRAM driver support for Allwinner R528/T113s"
+	depends on ARCH_SUNXI
+	default y if MACH_SUN8I_R528
+	help
+	  Select this DRAM controller driver for the R528/T113s SoCs.