All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Refactor ASPEED AST2500 DDR SDRAM driver structure
@ 2020-09-07  8:25 Dylan Hung
  2020-09-07  8:25 ` [PATCH 1/2] ram: move aspeed ram driver into drivers/ directory Dylan Hung
  2020-09-07  8:25 ` [PATCH 2/2] ram: add ddr4 dual x8 configuration Dylan Hung
  0 siblings, 2 replies; 8+ messages in thread
From: Dylan Hung @ 2020-09-07  8:25 UTC (permalink / raw)
  To: u-boot

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%)

-- 
2.17.1

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

* [PATCH 1/2] ram: move aspeed ram driver into drivers/ directory
  2020-09-07  8:25 [PATCH 0/2] Refactor ASPEED AST2500 DDR SDRAM driver structure Dylan Hung
@ 2020-09-07  8:25 ` Dylan Hung
  2020-09-21  2:42   ` Ryan Chen
  2020-10-09 13:00   ` Tom Rini
  2020-09-07  8:25 ` [PATCH 2/2] ram: add ddr4 dual x8 configuration Dylan Hung
  1 sibling, 2 replies; 8+ messages in thread
From: Dylan Hung @ 2020-09-07  8:25 UTC (permalink / raw)
  To: u-boot

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 <dylan_hung@aspeedtech.com>
---
 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%)

diff --git a/arch/arm/mach-aspeed/ast2500/Makefile b/arch/arm/mach-aspeed/ast2500/Makefile
index 4c27c8fc46..db70432ad0 100644
--- a/arch/arm/mach-aspeed/ast2500/Makefile
+++ b/arch/arm/mach-aspeed/ast2500/Makefile
@@ -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
diff --git a/drivers/ram/Makefile b/drivers/ram/Makefile
index 769c9d6218..a57d506752 100644
--- a/drivers/ram/Makefile
+++ b/drivers/ram/Makefile
@@ -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 --git a/drivers/ram/aspeed/Makefile b/drivers/ram/aspeed/Makefile
new file mode 100644
index 0000000000..af604f8a4b
--- /dev/null
+++ b/drivers/ram/aspeed/Makefile
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+obj-$(CONFIG_ASPEED_AST2500) += sdram_ast2500.o
\ No newline at end of file
diff --git a/arch/arm/mach-aspeed/ast2500/sdram_ast2500.c b/drivers/ram/aspeed/sdram_ast2500.c
similarity index 100%
rename from arch/arm/mach-aspeed/ast2500/sdram_ast2500.c
rename to drivers/ram/aspeed/sdram_ast2500.c
-- 
2.17.1

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

* [PATCH 2/2] ram: add ddr4 dual x8 configuration
  2020-09-07  8:25 [PATCH 0/2] Refactor ASPEED AST2500 DDR SDRAM driver structure Dylan Hung
  2020-09-07  8:25 ` [PATCH 1/2] ram: move aspeed ram driver into drivers/ directory Dylan Hung
@ 2020-09-07  8:25 ` Dylan Hung
  2020-09-21  2:42   ` Ryan Chen
  2020-10-09 13:00   ` Tom Rini
  1 sibling, 2 replies; 8+ messages in thread
From: Dylan Hung @ 2020-09-07  8:25 UTC (permalink / raw)
  To: u-boot

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 <dylan_hung@aspeedtech.com>
---
 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

diff --git a/drivers/ram/Kconfig b/drivers/ram/Kconfig
index 7e6e981897..d277237288 100644
--- a/drivers/ram/Kconfig
+++ b/drivers/ram/Kconfig
@@ -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"
diff --git a/drivers/ram/aspeed/Kconfig b/drivers/ram/aspeed/Kconfig
new file mode 100644
index 0000000000..020c913188
--- /dev/null
+++ b/drivers/ram/aspeed/Kconfig
@@ -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
diff --git a/drivers/ram/aspeed/sdram_ast2500.c b/drivers/ram/aspeed/sdram_ast2500.c
index a3adaa8a99..8bfbf562c3 100644
--- a/drivers/ram/aspeed/sdram_ast2500.c
+++ b/drivers/ram/aspeed/sdram_ast2500.c
@@ -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;
-- 
2.17.1

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

* [PATCH 2/2] ram: add ddr4 dual x8 configuration
  2020-09-07  8:25 ` [PATCH 2/2] ram: add ddr4 dual x8 configuration Dylan Hung
@ 2020-09-21  2:42   ` Ryan Chen
  2020-10-09 13:00   ` Tom Rini
  1 sibling, 0 replies; 8+ messages in thread
From: Ryan Chen @ 2020-09-21  2:42 UTC (permalink / raw)
  To: u-boot

> -----Original Message-----
> From: Dylan Hung <dylan_hung@aspeedtech.com>
> Sent: Monday, September 7, 2020 4:25 PM
> To: Ryan Chen <ryan_chen@aspeedtech.com>; u-boot at lists.denx.de
> Cc: BMC-SW <BMC-SW@aspeedtech.com>
> Subject: [PATCH 2/2] ram: add ddr4 dual x8 configuration
> 
> 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 <dylan_hung@aspeedtech.com>

Reviewed-by: Ryan Chen <ryan_chen@aspeedtech.com>

> ---
>  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
> 
> diff --git a/drivers/ram/Kconfig b/drivers/ram/Kconfig index
> 7e6e981897..d277237288 100644
> --- a/drivers/ram/Kconfig
> +++ b/drivers/ram/Kconfig
> @@ -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"
> diff --git a/drivers/ram/aspeed/Kconfig b/drivers/ram/aspeed/Kconfig new file
> mode 100644 index 0000000000..020c913188
> --- /dev/null
> +++ b/drivers/ram/aspeed/Kconfig
> @@ -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
> diff --git a/drivers/ram/aspeed/sdram_ast2500.c
> b/drivers/ram/aspeed/sdram_ast2500.c
> index a3adaa8a99..8bfbf562c3 100644
> --- a/drivers/ram/aspeed/sdram_ast2500.c
> +++ b/drivers/ram/aspeed/sdram_ast2500.c
> @@ -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;
> --
> 2.17.1

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

* [PATCH 1/2] ram: move aspeed ram driver into drivers/ directory
  2020-09-07  8:25 ` [PATCH 1/2] ram: move aspeed ram driver into drivers/ directory Dylan Hung
@ 2020-09-21  2:42   ` Ryan Chen
  2020-10-09 13:00   ` Tom Rini
  1 sibling, 0 replies; 8+ messages in thread
From: Ryan Chen @ 2020-09-21  2:42 UTC (permalink / raw)
  To: u-boot

> -----Original Message-----
> From: Dylan Hung <dylan_hung@aspeedtech.com>
> Sent: Monday, September 7, 2020 4:25 PM
> To: Ryan Chen <ryan_chen@aspeedtech.com>; u-boot at lists.denx.de
> Cc: BMC-SW <BMC-SW@aspeedtech.com>
> Subject: [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.
> 
> Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>

Reviewed-by: Ryan Chen <ryan_chen@aspeedtech.com>

> ---
>  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%)
> 
> diff --git a/arch/arm/mach-aspeed/ast2500/Makefile
> b/arch/arm/mach-aspeed/ast2500/Makefile
> index 4c27c8fc46..db70432ad0 100644
> --- a/arch/arm/mach-aspeed/ast2500/Makefile
> +++ b/arch/arm/mach-aspeed/ast2500/Makefile
> @@ -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
> diff --git a/drivers/ram/Makefile b/drivers/ram/Makefile index
> 769c9d6218..a57d506752 100644
> --- a/drivers/ram/Makefile
> +++ b/drivers/ram/Makefile
> @@ -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 --git
> a/drivers/ram/aspeed/Makefile b/drivers/ram/aspeed/Makefile new file mode
> 100644 index 0000000000..af604f8a4b
> --- /dev/null
> +++ b/drivers/ram/aspeed/Makefile
> @@ -0,0 +1,3 @@
> +# SPDX-License-Identifier: GPL-2.0+
> +#
> +obj-$(CONFIG_ASPEED_AST2500) += sdram_ast2500.o
> \ No newline at end of file
> diff --git a/arch/arm/mach-aspeed/ast2500/sdram_ast2500.c
> b/drivers/ram/aspeed/sdram_ast2500.c
> similarity index 100%
> rename from arch/arm/mach-aspeed/ast2500/sdram_ast2500.c
> rename to drivers/ram/aspeed/sdram_ast2500.c
> --
> 2.17.1

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

* [PATCH 1/2] ram: move aspeed ram driver into drivers/ directory
  2020-09-07  8:25 ` [PATCH 1/2] ram: move aspeed ram driver into drivers/ directory Dylan Hung
  2020-09-21  2:42   ` Ryan Chen
@ 2020-10-09 13:00   ` Tom Rini
  1 sibling, 0 replies; 8+ messages in thread
From: Tom Rini @ 2020-10-09 13:00 UTC (permalink / raw)
  To: u-boot

On Mon, Sep 07, 2020 at 04:25:06PM +0800, Dylan Hung wrote:

> 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 <dylan_hung@aspeedtech.com>
> Reviewed-by: Ryan Chen <ryan_chen@aspeedtech.com>

Applied to u-boot/master, thanks!

-- 
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>

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

* [PATCH 2/2] ram: add ddr4 dual x8 configuration
  2020-09-07  8:25 ` [PATCH 2/2] ram: add ddr4 dual x8 configuration Dylan Hung
  2020-09-21  2:42   ` Ryan Chen
@ 2020-10-09 13:00   ` Tom Rini
  1 sibling, 0 replies; 8+ messages in thread
From: Tom Rini @ 2020-10-09 13:00 UTC (permalink / raw)
  To: u-boot

On Mon, Sep 07, 2020 at 04:25:07PM +0800, Dylan Hung wrote:

> 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 <dylan_hung@aspeedtech.com>
> Reviewed-by: Ryan Chen <ryan_chen@aspeedtech.com>

Applied to u-boot/master, thanks!

-- 
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>

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

* [PATCH 2/2] ram: add ddr4 dual x8 configuration
  2020-09-07  5:23 [PATCH 0/2] Refactor ASPEED AST2500 DDR SDRAM driver structure Dylan Hung
@ 2020-09-07  5:23 ` Dylan Hung
  0 siblings, 0 replies; 8+ messages in thread
From: Dylan Hung @ 2020-09-07  5:23 UTC (permalink / raw)
  To: u-boot

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 <dylan_hung@aspeedtech.com>
---
 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

diff --git a/drivers/ram/Kconfig b/drivers/ram/Kconfig
index 7e6e981897..d277237288 100644
--- a/drivers/ram/Kconfig
+++ b/drivers/ram/Kconfig
@@ -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"
diff --git a/drivers/ram/aspeed/Kconfig b/drivers/ram/aspeed/Kconfig
new file mode 100644
index 0000000000..020c913188
--- /dev/null
+++ b/drivers/ram/aspeed/Kconfig
@@ -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
diff --git a/drivers/ram/aspeed/sdram_ast2500.c b/drivers/ram/aspeed/sdram_ast2500.c
index a3adaa8a99..8bfbf562c3 100644
--- a/drivers/ram/aspeed/sdram_ast2500.c
+++ b/drivers/ram/aspeed/sdram_ast2500.c
@@ -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;
-- 
2.17.1

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

end of thread, other threads:[~2020-10-09 13:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-07  8:25 [PATCH 0/2] Refactor ASPEED AST2500 DDR SDRAM driver structure Dylan Hung
2020-09-07  8:25 ` [PATCH 1/2] ram: move aspeed ram driver into drivers/ directory Dylan Hung
2020-09-21  2:42   ` Ryan Chen
2020-10-09 13:00   ` Tom Rini
2020-09-07  8:25 ` [PATCH 2/2] ram: add ddr4 dual x8 configuration Dylan Hung
2020-09-21  2:42   ` Ryan Chen
2020-10-09 13:00   ` Tom Rini
  -- strict thread matches above, loose matches on Subject: below --
2020-09-07  5:23 [PATCH 0/2] Refactor ASPEED AST2500 DDR SDRAM driver structure Dylan Hung
2020-09-07  5:23 ` [PATCH 2/2] ram: add ddr4 dual x8 configuration Dylan Hung

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.