Refactor ASPEED AST2500 DDR SDRAM driver structure
Subsystems (3)
cover Refactor ASPEED AST2500 DDR SDRAM driver structure
This patch series improves the maintainability of the ASPEED DDR SDRAM driver. It moves the source code files from arch/arm/mach-aspeed to drives/ram/aspeed and so that it is more easier to add configurations such as dual-x8-die configs.
Dylan Hung (2):
ram: move aspeed ram driver into drivers/ directory
ram: add ddr4 dual x8 configuration
arch/arm/mach-aspeed/ast2500/Makefile | 2 +-
drivers/ram/Kconfig | 1 +
drivers/ram/Makefile | 1 +
drivers/ram/aspeed/Kconfig | 10 ++++++++++
drivers/ram/aspeed/Makefile | 3 +++
.../ast2500 => drivers/ram/aspeed}/sdram_ast2500.c | 2 +-
6 files changed, 17 insertions(+), 2 deletions(-)
create mode 100644 drivers/ram/aspeed/Kconfig
create mode 100644 drivers/ram/aspeed/Makefile
rename {arch/arm/mach-aspeed/ast2500 => drivers/ram/aspeed}/sdram_ast2500.c (99%)Signature · 1 line
2.17.1
PATCH 1/2 ram: move aspeed ram driver into drivers/ directory
to improve the maintainability. It is more easier to modify and add configurations of the driver in the centralized ram driver directory.
---
arch/arm/mach-aspeed/ast2500/Makefile | 2 +-
drivers/ram/Makefile | 1 +
drivers/ram/aspeed/Makefile | 3 +++
.../mach-aspeed/ast2500 => drivers/ram/aspeed}/sdram_ast2500.c | 0
4 files changed, 5 insertions(+), 1 deletion(-)
create mode 100644 drivers/ram/aspeed/Makefile
rename {arch/arm/mach-aspeed/ast2500 => drivers/ram/aspeed}/sdram_ast2500.c (100%)arch/arm/mach-aspeed/ast2500/Makefile +1 -1
@@ -1,3 +1,3 @@ obj-y += lowlevel_init.o obj-y += board_common.o -obj-y += clk_ast2500.o sdram_ast2500.o +obj-y += clk_ast2500.o
drivers/ram/Makefile +1 -0
@@ -14,6 +14,7 @@ obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/ obj-$(CONFIG_K3_AM654_DDRSS) += k3-am654-ddrss.o obj-$(CONFIG_ARCH_MEDIATEK) += mediatek/ +obj-$(CONFIG_ARCH_ASPEED) += aspeed/ obj-$(CONFIG_K3_J721E_DDRSS) += k3-j721e/ obj-$(CONFIG_IMXRT_SDRAM) += imxrt_sdram.o
drivers/ram/aspeed/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +obj-$(CONFIG_ASPEED_AST2500) += sdram_ast2500.o
drivers/ram/aspeed/sdram_ast2500.c renamed from arch/arm/mach-aspeed/ast2500/sdram_ast2500.c +0 -0
Signature · 1 line
2.17.1
Ryan Chen
reviewerPATCH 1/2 ram: move aspeed ram driver into drivers/ directory
Quoted 11 lines
-----Original Message-----
From: Dylan Hung <[email protected]>
Sent: Monday, September 7, 2020 4:25 PM
To: Ryan Chen <[email protected]>; u-boot at lists.denx.de
Cc: BMC-SW <[email protected]>
Subject: [PATCH 1/2] ram: move aspeed ram driver intodrivers/directoryto improve the maintainability. It is more easier to modify and add configurations of the driver in the centralized ram driver directory.
Signed-off-by Dylan Hung <[email protected]>
Quoted 50 lines
--- arch/arm/mach-aspeed/ast2500/Makefile | 2 +- drivers/ram/Makefile | 1 + drivers/ram/aspeed/Makefile | 3 +++ .../mach-aspeed/ast2500 => drivers/ram/aspeed}/sdram_ast2500.c | 0 4 files changed, 5 insertions(+), 1 deletion(-) create mode 100644
drivers/ram/aspeed/Makefilerename {arch/arm/mach-aspeed/ast2500=>drivers/ram/aspeed}/sdram_ast2500.c(100%)arch/arm/mach-aspeed/ast2500/Makefile +1
-1@@ -1,3 +1,3 @@ obj-y += lowlevel_init.o obj-y += board_common.o -obj-y += clk_ast2500.o sdram_ast2500.o +obj-y += clk_ast2500.odrivers/ram/Makefile index renamed from drivers/ram/Makefile +0
-0
769c9d6218..a57d506752100644drivers/ram/Makefile +1
-0@@ -14,6 +14,7 @@ obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/ obj-$(CONFIG_K3_AM654_DDRSS) += k3-am654-ddrss.o obj-$(CONFIG_ARCH_MEDIATEK) += mediatek/ +obj-$(CONFIG_ARCH_ASPEED) += aspeed/ obj-$(CONFIG_K3_J721E_DDRSS) += k3-j721e/ obj-$(CONFIG_IMXRT_SDRAM) += imxrt_sdram.o diff --gita/drivers/ram/aspeed/Makefile b/drivers/ram/aspeed/Makefile new file mode 100644 index 0000000000..af604f8a4b
drivers/ram/aspeed/Makefile new file +3
-0@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +obj-$(CONFIG_ASPEED_AST2500) += sdram_ast2500.odrivers/ram/aspeed/sdram_ast2500.c renamed from arch/arm/mach-aspeed/ast2500/sdram_ast2500.c +0
-1--2.17.1
PATCH 1/2 ram: move aspeed ram driver into drivers/ directory
In reply to Dylan HungQuoted 5 lines · Dylan Hung
to improve the maintainability. It is more easier to modify and add configurations of the driver in the centralized ram driver directory.
Signed-off-by Dylan Hung <[email protected]>Reviewed-by Ryan Chen <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201009/7ebcafc0/attachment.sig>
PATCH 2/2 ram: add ddr4 dual x8 configuration
In reply to Dylan Hungthe aspeed ddr sdram controller needs to know if the memory chip mounted on the board is dual x8 die or not. Or it may get the wrong size of the memory space.
--- drivers/ram/Kconfig | 1 + drivers/ram/aspeed/Kconfig | 10 ++++++++++ drivers/ram/aspeed/sdram_ast2500.c | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 drivers/ram/aspeed/Kconfig
drivers/ram/Kconfig +1 -0
@@ -76,3 +76,4 @@ config IMXRT_SDRAM source "drivers/ram/rockchip/Kconfig" source "drivers/ram/sifive/Kconfig" source "drivers/ram/stm32mp1/Kconfig" +source "drivers/ram/aspeed/Kconfig"
drivers/ram/aspeed/Kconfig new file +10 -0
@@ -0,0 +1,10 @@ +if RAM || SPL_RAM +config ASPEED_DDR4_DUALX8 + bool "Enable Dual X8 DDR4 die" + depends on DM && OF_CONTROL && ARCH_ASPEED + default n + help + Say Y if dual X8 DDR4 die is used on the board. The aspeed ddr sdram + controller needs to know if the memory chip mounted on the board is dual + x8 die or not. Or it may get the wrong size of the memory space. +endif
drivers/ram/aspeed/sdram_ast2500.c +1 -1
@@ -247,7 +247,7 @@ static int ast2500_sdrammc_init_ddr4(struct dram_info *info) | SDRAM_PCR_RESETN_DIS |SDRAM_PCR_RGAP_CTRL_EN |SDRAM_PCR_ODT_EN |SDRAM_PCR_ODT_EXT_EN ; const u32 conf = (SDRAM_CONF_CAP_1024M << SDRAM_CONF_CAP_SHIFT) -#ifdef CONFIG_DUALX8_RAM +#ifdef CONFIG_ASPEED_DDR4_DUALX8 |SDRAM_CONF_DUALX8 #endif |SDRAM_CONF_SCRAMBLE |SDRAM_CONF_SCRAMBLE_PAT2 |SDRAM_CONF_DDR4 ;
Signature · 1 line
2.17.1
Ryan Chen
reviewerPATCH 2/2 ram: add ddr4 dual x8 configuration
Quoted 7 lines
-----Original Message-----
From: Dylan Hung <[email protected]>
Sent: Monday, September 7, 2020 4:25 PM
To: Ryan Chen <[email protected]>; u-boot at lists.denx.de
Cc: BMC-SW <[email protected]>
Subject: [PATCH 2/2] ram: add ddr4 dual x8 configuration
Quoted 5 lines
the aspeed ddr sdram controller needs to know if the memory chip mounted on the board is dual x8 die or not. Or it may get the wrong size of the memory space.
Signed-off-by Dylan Hung <[email protected]>
Quoted 52 lines
--- drivers/ram/Kconfig | 1 + drivers/ram/aspeed/Kconfig | 10 ++++++++++ drivers/ram/aspeed/sdram_ast2500.c | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644
drivers/ram/aspeed/Kconfigdrivers/ram/Kconfig index renamed from drivers/ram/Kconfig +0
-0
7e6e981897..d277237288100644drivers/ram/Kconfig +1
-0@@ -76,3 +76,4 @@ config IMXRT_SDRAM source "drivers/ram/rockchip/Kconfig" source "drivers/ram/sifive/Kconfig" source "drivers/ram/stm32mp1/Kconfig" +source "drivers/ram/aspeed/Kconfig"drivers/ram/aspeed/Kconfig new file renamed from drivers/ram/aspeed/Kconfig +0
-0mode 100644 index 0000000000..020c913188
drivers/ram/aspeed/Kconfig new file +7
-0@@ -0,0 +1,10 @@ +if RAM || SPL_RAM +config ASPEED_DDR4_DUALX8 + bool "Enable Dual X8 DDR4 die" + depends on DM && OF_CONTROL && ARCH_ASPEED + default n + help + Say Y if dual X8 DDR4 die is used on the board. The aspeed ddrsdram
drivers/ram/aspeed/Kconfig new file +1
-0+ controller needs to know if the memory chip mounted on the boardis dual
drivers/ram/aspeed/Kconfig new file +2
-0+ x8 die or not. Or it may get the wrong size of the memory space. +endifdrivers/ram/aspeed/sdram_ast2500.c +0
-0@@ -247,7 +247,7 @@ static int ast2500_sdrammc_init_ddr4(struct dram_info *info) | SDRAM_PCR_RESETN_DIS | SDRAM_PCR_RGAP_CTRL_EN | SDRAM_PCR_ODT_EN |SDRAM_PCR_ODT_EXT_EN ; const u32 conf = (SDRAM_CONF_CAP_1024M <<
SDRAM_CONF_CAP_SHIFT) -#ifdefCONFIG_DUALX8_RAMdrivers/ram/aspeed/sdram_ast2500.c +1
-0+#ifdef CONFIG_ASPEED_DDR4_DUALX8 | SDRAM_CONF_DUALX8 #endif | SDRAM_CONF_SCRAMBLE | SDRAM_CONF_SCRAMBLE_PAT2 |
SDRAM_CONF_DDR4;
--
2.17.1
PATCH 2/2 ram: add ddr4 dual x8 configuration
In reply to Dylan HungQuoted 6 lines · Dylan Hung
the aspeed ddr sdram controller needs to know if the memory chip mounted on the board is dual x8 die or not. Or it may get the wrong size of the memory space.
Signed-off-by Dylan Hung <[email protected]>Reviewed-by Ryan Chen <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201009/def67dc5/attachment.sig>