All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
To: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	Philipp Tomsich
	<philipp.tomsich-SN7IsUiht6C/RdPyistoZJqQE7yCjDx5@public.gmane.org>,
	Kever Yang <kever.yang-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
	YouMin Chen <cym-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
	u-boot-0aAXYlwwYIKGBzrmiIFOJg@public.gmane.org
Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	gajjar04akash-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-amarula-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org,
	Jagan Teki
	<jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>,
	Manivannan Sadhasivam
	<manivannan.sadhasivam-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Subject: [PATCH v3 10/18] ram: rockchip: Add debug sdram driver
Date: Mon, 15 Jul 2019 23:58:48 +0530	[thread overview]
Message-ID: <20190715182856.21688-11-jagan@amarulasolutions.com> (raw)
In-Reply-To: <20190715182856.21688-1-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>

Add sdram driver to handle debug across rockchip SoCs.

This would help to improve code debugging feature for
sdram drivers in rockchip family, whoever wants to
debug the driver should call these core debug code on
their respective platform sdram drivers.

Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
Signed-off-by: YouMin Chen <cym-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
---
 .../include/asm/arch-rockchip/sdram_common.h  |  9 +++++
 drivers/ram/rockchip/Kconfig                  |  9 +++++
 drivers/ram/rockchip/Makefile                 |  1 +
 drivers/ram/rockchip/sdram_debug.c            | 34 +++++++++++++++++++
 4 files changed, 53 insertions(+)
 create mode 100644 drivers/ram/rockchip/sdram_debug.c

diff --git a/arch/arm/include/asm/arch-rockchip/sdram_common.h b/arch/arm/include/asm/arch-rockchip/sdram_common.h
index 7ac25af327..171b233f95 100644
--- a/arch/arm/include/asm/arch-rockchip/sdram_common.h
+++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h
@@ -92,4 +92,13 @@ size_t rockchip_sdram_size(phys_addr_t reg);
 
 /* Called by U-Boot board_init_r for Rockchip SoCs */
 int dram_init(void);
+
+#if !defined(CONFIG_RAM_ROCKCHIP_DEBUG)
+inline void sdram_print_dram_type(unsigned char dramtype)
+{
+}
+#else
+void sdram_print_dram_type(unsigned char dramtype);
+#endif /* CONFIG_RAM_ROCKCHIP_DEBUG */
+
 #endif
diff --git a/drivers/ram/rockchip/Kconfig b/drivers/ram/rockchip/Kconfig
index 995cb487b8..151ffb684d 100644
--- a/drivers/ram/rockchip/Kconfig
+++ b/drivers/ram/rockchip/Kconfig
@@ -7,6 +7,15 @@ config RAM_ROCKCHIP
 
 if RAM_ROCKCHIP
 
+config RAM_ROCKCHIP_DEBUG
+	bool "Rockchip ram drivers debugging"
+	help
+	  This enables debugging ram driver API's for the platforms
+	  based on Rockchip SoCs.
+
+	  This is an option for developers to understand the ram drivers
+	  initialization, configurations and etc.
+
 config RAM_RK3399
 	bool "Ram driver for Rockchip RK3399"
 	default ROCKCHIP_RK3399
diff --git a/drivers/ram/rockchip/Makefile b/drivers/ram/rockchip/Makefile
index 07d4b62a9d..feb1f82d00 100644
--- a/drivers/ram/rockchip/Makefile
+++ b/drivers/ram/rockchip/Makefile
@@ -3,6 +3,7 @@
 # Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH
 #
 
+obj-$(CONFIG_RAM_ROCKCHIP_DEBUG) += sdram_debug.o
 obj-$(CONFIG_ROCKCHIP_RK3368) = dmc-rk3368.o
 obj-$(CONFIG_ROCKCHIP_RK3128) = sdram_rk3128.o
 obj-$(CONFIG_ROCKCHIP_RK3188) = sdram_rk3188.o
diff --git a/drivers/ram/rockchip/sdram_debug.c b/drivers/ram/rockchip/sdram_debug.c
new file mode 100644
index 0000000000..c13e140fa5
--- /dev/null
+++ b/drivers/ram/rockchip/sdram_debug.c
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * (C) Copyright 2019 Rockchip Electronics Co., Ltd
+ * (C) Copyright 2019 Amarula Solutions.
+ * Author: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
+ */
+
+#include <common.h>
+#include <debug_uart.h>
+#include <asm/arch-rockchip/sdram_common.h>
+
+void sdram_print_dram_type(unsigned char dramtype)
+{
+	switch (dramtype) {
+	case DDR3:
+		printascii("DDR3");
+		break;
+	case DDR4:
+		printascii("DDR4");
+		break;
+	case LPDDR2:
+		printascii("LPDDR2");
+		break;
+	case LPDDR3:
+		printascii("LPDDR3");
+		break;
+	case LPDDR4:
+		printascii("LPDDR4");
+		break;
+	default:
+		printascii("Unknown Device");
+		break;
+	}
+}
-- 
2.18.0.321.gffc6fa0e3

WARNING: multiple messages have this Message-ID (diff)
From: Jagan Teki <jagan@amarulasolutions.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 10/18] ram: rockchip: Add debug sdram driver
Date: Mon, 15 Jul 2019 23:58:48 +0530	[thread overview]
Message-ID: <20190715182856.21688-11-jagan@amarulasolutions.com> (raw)
In-Reply-To: <20190715182856.21688-1-jagan@amarulasolutions.com>

Add sdram driver to handle debug across rockchip SoCs.

This would help to improve code debugging feature for
sdram drivers in rockchip family, whoever wants to
debug the driver should call these core debug code on
their respective platform sdram drivers.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: YouMin Chen <cym@rock-chips.com>
---
 .../include/asm/arch-rockchip/sdram_common.h  |  9 +++++
 drivers/ram/rockchip/Kconfig                  |  9 +++++
 drivers/ram/rockchip/Makefile                 |  1 +
 drivers/ram/rockchip/sdram_debug.c            | 34 +++++++++++++++++++
 4 files changed, 53 insertions(+)
 create mode 100644 drivers/ram/rockchip/sdram_debug.c

diff --git a/arch/arm/include/asm/arch-rockchip/sdram_common.h b/arch/arm/include/asm/arch-rockchip/sdram_common.h
index 7ac25af327..171b233f95 100644
--- a/arch/arm/include/asm/arch-rockchip/sdram_common.h
+++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h
@@ -92,4 +92,13 @@ size_t rockchip_sdram_size(phys_addr_t reg);
 
 /* Called by U-Boot board_init_r for Rockchip SoCs */
 int dram_init(void);
+
+#if !defined(CONFIG_RAM_ROCKCHIP_DEBUG)
+inline void sdram_print_dram_type(unsigned char dramtype)
+{
+}
+#else
+void sdram_print_dram_type(unsigned char dramtype);
+#endif /* CONFIG_RAM_ROCKCHIP_DEBUG */
+
 #endif
diff --git a/drivers/ram/rockchip/Kconfig b/drivers/ram/rockchip/Kconfig
index 995cb487b8..151ffb684d 100644
--- a/drivers/ram/rockchip/Kconfig
+++ b/drivers/ram/rockchip/Kconfig
@@ -7,6 +7,15 @@ config RAM_ROCKCHIP
 
 if RAM_ROCKCHIP
 
+config RAM_ROCKCHIP_DEBUG
+	bool "Rockchip ram drivers debugging"
+	help
+	  This enables debugging ram driver API's for the platforms
+	  based on Rockchip SoCs.
+
+	  This is an option for developers to understand the ram drivers
+	  initialization, configurations and etc.
+
 config RAM_RK3399
 	bool "Ram driver for Rockchip RK3399"
 	default ROCKCHIP_RK3399
diff --git a/drivers/ram/rockchip/Makefile b/drivers/ram/rockchip/Makefile
index 07d4b62a9d..feb1f82d00 100644
--- a/drivers/ram/rockchip/Makefile
+++ b/drivers/ram/rockchip/Makefile
@@ -3,6 +3,7 @@
 # Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH
 #
 
+obj-$(CONFIG_RAM_ROCKCHIP_DEBUG) += sdram_debug.o
 obj-$(CONFIG_ROCKCHIP_RK3368) = dmc-rk3368.o
 obj-$(CONFIG_ROCKCHIP_RK3128) = sdram_rk3128.o
 obj-$(CONFIG_ROCKCHIP_RK3188) = sdram_rk3188.o
diff --git a/drivers/ram/rockchip/sdram_debug.c b/drivers/ram/rockchip/sdram_debug.c
new file mode 100644
index 0000000000..c13e140fa5
--- /dev/null
+++ b/drivers/ram/rockchip/sdram_debug.c
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * (C) Copyright 2019 Rockchip Electronics Co., Ltd
+ * (C) Copyright 2019 Amarula Solutions.
+ * Author: Jagan Teki <jagan@amarulasolutions.com>
+ */
+
+#include <common.h>
+#include <debug_uart.h>
+#include <asm/arch-rockchip/sdram_common.h>
+
+void sdram_print_dram_type(unsigned char dramtype)
+{
+	switch (dramtype) {
+	case DDR3:
+		printascii("DDR3");
+		break;
+	case DDR4:
+		printascii("DDR4");
+		break;
+	case LPDDR2:
+		printascii("LPDDR2");
+		break;
+	case LPDDR3:
+		printascii("LPDDR3");
+		break;
+	case LPDDR4:
+		printascii("LPDDR4");
+		break;
+	default:
+		printascii("Unknown Device");
+		break;
+	}
+}
-- 
2.18.0.321.gffc6fa0e3

  parent reply	other threads:[~2019-07-15 18:28 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 18:28 [PATCH v3 00/18] ram: rk3399: Add rank detection Jagan Teki
2019-07-15 18:28 ` [U-Boot] " Jagan Teki
     [not found] ` <20190715182856.21688-1-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2019-07-15 18:28   ` [PATCH v3 01/18] ram: rk3399: Handle data training return types Jagan Teki
2019-07-15 18:28     ` [U-Boot] " Jagan Teki
     [not found]     ` <20190715182856.21688-2-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2019-07-16  7:36       ` Kever Yang
2019-07-16  7:36         ` [U-Boot] " Kever Yang
2019-07-15 18:28   ` [PATCH v3 02/18] ram: rk3399: Clear PI_175 interrupts in data training Jagan Teki
2019-07-15 18:28     ` [U-Boot] " Jagan Teki
     [not found]     ` <20190715182856.21688-3-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2019-07-16  7:36       ` Kever Yang
2019-07-16  7:36         ` [U-Boot] " Kever Yang
2019-07-15 18:28   ` [PATCH v3 03/18] ram: rk3399: Use rank mask in ca " Jagan Teki
2019-07-15 18:28     ` [U-Boot] " Jagan Teki
     [not found]     ` <20190715182856.21688-4-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2019-07-16  7:38       ` Kever Yang
2019-07-16  7:38         ` [U-Boot] " Kever Yang
2019-07-15 18:28   ` [PATCH v3 04/18] ram: rk3399: Use rank mask in wdql " Jagan Teki
2019-07-15 18:28     ` [U-Boot] " Jagan Teki
     [not found]     ` <20190715182856.21688-5-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2019-07-16  7:38       ` Kever Yang
2019-07-16  7:38         ` [U-Boot] " Kever Yang
2019-07-15 18:28   ` [PATCH v3 05/18] ram: rk3399: Add phy pctrl reset support Jagan Teki
2019-07-15 18:28     ` [U-Boot] " Jagan Teki
     [not found]     ` <20190715182856.21688-6-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2019-07-16  7:39       ` Kever Yang
2019-07-16  7:39         ` [U-Boot] " Kever Yang
2019-07-15 18:28   ` [PATCH v3 06/18] ram: rk3399: Move pwrup_srefresh_exit to dram_info Jagan Teki
2019-07-15 18:28     ` [U-Boot] " Jagan Teki
     [not found]     ` <20190715182856.21688-7-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2019-07-16  7:39       ` Kever Yang
2019-07-16  7:39         ` [U-Boot] " Kever Yang
2019-07-15 18:28   ` [PATCH v3 07/18] ram: rk3399: Add pctl start support Jagan Teki
2019-07-15 18:28     ` [U-Boot] " Jagan Teki
     [not found]     ` <20190715182856.21688-8-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2019-07-16  7:40       ` Kever Yang
2019-07-16  7:40         ` [U-Boot] " Kever Yang
2019-07-15 18:28   ` [PATCH v3 08/18] ram: rockchip: Add initial Kconfig Jagan Teki
2019-07-15 18:28     ` [U-Boot] " Jagan Teki
     [not found]     ` <20190715182856.21688-9-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2019-07-16  7:41       ` Kever Yang
2019-07-16  7:41         ` [U-Boot] " Kever Yang
2019-07-15 18:28   ` [PATCH v3 09/18] debug_uart: Add printdec Jagan Teki
2019-07-15 18:28     ` [U-Boot] " Jagan Teki
     [not found]     ` <20190715182856.21688-10-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2019-07-16  7:41       ` Kever Yang
2019-07-16  7:41         ` [U-Boot] " Kever Yang
2019-07-15 18:28   ` Jagan Teki [this message]
2019-07-15 18:28     ` [U-Boot] [PATCH v3 10/18] ram: rockchip: Add debug sdram driver Jagan Teki
     [not found]     ` <20190715182856.21688-11-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2019-07-16  7:42       ` Kever Yang
2019-07-16  7:42         ` [U-Boot] " Kever Yang
2019-07-15 18:28   ` [PATCH v3 11/18] ram: rockchip: debug: Add sdram_print_ddr_info Jagan Teki
2019-07-15 18:28     ` [U-Boot] " Jagan Teki
     [not found]     ` <20190715182856.21688-12-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2019-07-16  7:42       ` Kever Yang
2019-07-16  7:42         ` [U-Boot] " Kever Yang
2019-07-15 18:28   ` [PATCH v3 12/18] ram: rockchip: debug: Get the cs capacity Jagan Teki
2019-07-15 18:28     ` [U-Boot] " Jagan Teki
     [not found]     ` <20190715182856.21688-13-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2019-07-16  7:43       ` Kever Yang
2019-07-16  7:43         ` [U-Boot] " Kever Yang
2019-07-15 18:28   ` [PATCH v3 13/18] ram: rk3399: debug: Add sdram_print_stride Jagan Teki
2019-07-15 18:28     ` [U-Boot] " Jagan Teki
     [not found]     ` <20190715182856.21688-14-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2019-07-16  7:43       ` Kever Yang
2019-07-16  7:43         ` [U-Boot] " Kever Yang
2019-07-15 18:28   ` [PATCH v3 14/18] ram: rk3399: Compute stride for 2 channels Jagan Teki
2019-07-15 18:28     ` [U-Boot] " Jagan Teki
     [not found]     ` <20190715182856.21688-15-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2019-07-16  7:44       ` Kever Yang
2019-07-16  7:44         ` [U-Boot] " Kever Yang
2019-07-15 18:28   ` [PATCH v3 15/18] ram: rk3399: Compute stride for 1 channel a Jagan Teki
2019-07-15 18:28     ` [U-Boot] " Jagan Teki
     [not found]     ` <20190715182856.21688-16-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2019-07-16  7:44       ` Kever Yang
2019-07-16  7:44         ` [U-Boot] " Kever Yang
2019-07-15 18:28   ` [PATCH v3 16/18] ram: rk3399: Add rank detection support Jagan Teki
2019-07-15 18:28     ` [U-Boot] " Jagan Teki
     [not found]     ` <20190715182856.21688-17-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2019-07-16  7:45       ` Kever Yang
2019-07-16  7:45         ` [U-Boot] " Kever Yang
2019-07-17 12:53     ` Kever Yang
2019-07-17 12:53       ` [U-Boot] " Kever Yang
2019-07-18  9:30       ` Jagan Teki
2019-07-18  9:30         ` [U-Boot] " Jagan Teki
2019-07-15 18:28   ` [PATCH v3 17/18] ram: rk3399: Enable sdram debug functions Jagan Teki
2019-07-15 18:28     ` [U-Boot] " Jagan Teki
     [not found]     ` <20190715182856.21688-18-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2019-07-16  7:49       ` Kever Yang
2019-07-16  7:49         ` [U-Boot] " Kever Yang
2019-07-15 18:28   ` [PATCH v3 18/18] rockchip: dts: rk3399: nanopi-neo4: Use DDR3-1866 dtsi Jagan Teki
2019-07-15 18:28     ` [U-Boot] " Jagan Teki
     [not found]     ` <20190715182856.21688-19-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2019-07-16  7:47       ` Kever Yang
2019-07-16  7:47         ` [U-Boot] " Kever Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190715182856.21688-11-jagan@amarulasolutions.com \
    --to=jagan-dyjbcgdgk7pe9whmmfpqlfatqe2ktcn/@public.gmane.org \
    --cc=cym-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
    --cc=gajjar04akash-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=kever.yang-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
    --cc=linux-amarula-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org \
    --cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=manivannan.sadhasivam-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=philipp.tomsich-SN7IsUiht6C/RdPyistoZJqQE7yCjDx5@public.gmane.org \
    --cc=sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=u-boot-0aAXYlwwYIKGBzrmiIFOJg@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.