All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] rockchip: ARM64: puma-rk3399: get DRAM size from DMC init
@ 2017-04-28 15:31 Philipp Tomsich
  2017-04-30  3:48 ` Simon Glass
  0 siblings, 1 reply; 3+ messages in thread
From: Philipp Tomsich @ 2017-04-28 15:31 UTC (permalink / raw)
  To: u-boot

With the RK3399 DRAM controller (DMC) driver providing all the
infrastructure, retrieve the DRAM size from the DMC init in the
board-specific code (instead of hard-coding) for the RK3399-Q7 (Puma).

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
---

 board/theobroma-systems/puma_rk3399/puma-rk3399.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
index fb4d31e..27386dd 100644
--- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c
+++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
@@ -9,6 +9,7 @@
 #include <dm/uclass-internal.h>
 #include <asm/arch/periph.h>
 #include <power/regulator.h>
+#include <ram.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -57,7 +58,23 @@ out:
 
 int dram_init(void)
 {
-	gd->ram_size = 0x80000000;
+	struct ram_info ram;
+	struct udevice *dev;
+	int ret;
+
+	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
+	if (ret) {
+		debug("DRAM init failed: %d\n", ret);
+		return ret;
+	}
+	ret = ram_get_info(dev, &ram);
+	if (ret) {
+		debug("Cannot get DRAM size: %d\n", ret);
+		return ret;
+	}
+	debug("SDRAM base=%llx, size=%x\n", ram.base, (unsigned int)ram.size);
+	gd->ram_size = ram.size;
+
 	return 0;
 }
 
-- 
1.9.1

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

* [U-Boot] [PATCH] rockchip: ARM64: puma-rk3399: get DRAM size from DMC init
  2017-04-28 15:31 [U-Boot] [PATCH] rockchip: ARM64: puma-rk3399: get DRAM size from DMC init Philipp Tomsich
@ 2017-04-30  3:48 ` Simon Glass
  2017-05-02 11:12   ` sjg at google.com
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Glass @ 2017-04-30  3:48 UTC (permalink / raw)
  To: u-boot

On 28 April 2017 at 09:31, Philipp Tomsich
<philipp.tomsich@theobroma-systems.com> wrote:
> With the RK3399 DRAM controller (DMC) driver providing all the
> infrastructure, retrieve the DRAM size from the DMC init in the
> board-specific code (instead of hard-coding) for the RK3399-Q7 (Puma).
>
> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
>
>  board/theobroma-systems/puma_rk3399/puma-rk3399.c | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

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

* [U-Boot] [PATCH] rockchip: ARM64: puma-rk3399: get DRAM size from DMC init
  2017-04-30  3:48 ` Simon Glass
@ 2017-05-02 11:12   ` sjg at google.com
  0 siblings, 0 replies; 3+ messages in thread
From: sjg at google.com @ 2017-05-02 11:12 UTC (permalink / raw)
  To: u-boot

On 28 April 2017 at 09:31, Philipp Tomsich
<philipp.tomsich@theobroma-systems.com> wrote:
> With the RK3399 DRAM controller (DMC) driver providing all the
> infrastructure, retrieve the DRAM size from the DMC init in the
> board-specific code (instead of hard-coding) for the RK3399-Q7 (Puma).
>
> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
>
>  board/theobroma-systems/puma_rk3399/puma-rk3399.c | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-rockchip/next, thanks!

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

end of thread, other threads:[~2017-05-02 11:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-28 15:31 [U-Boot] [PATCH] rockchip: ARM64: puma-rk3399: get DRAM size from DMC init Philipp Tomsich
2017-04-30  3:48 ` Simon Glass
2017-05-02 11:12   ` sjg at google.com

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.