U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] cmd_mem: Decode the mtest start and end values from fdt
@ 2013-03-01 14:32 Jagannadha Sutradharudu Teki
  2013-03-01 16:06 ` Wolfgang Denk
  2013-03-08 19:08 ` [U-Boot] [PATCH] Feature Removal: disable "mtest" command by default Wolfgang Denk
  0 siblings, 2 replies; 11+ messages in thread
From: Jagannadha Sutradharudu Teki @ 2013-03-01 14:32 UTC (permalink / raw)
  To: u-boot

This patch provides a support to decode the mtest start
and end values from fdt config node.

Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
Tested-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
---
 common/cmd_mem.c |    6 ++++--
 common/main.c    |   18 ++++++++++++++++++
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index d44aa1d..b41e182 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -642,12 +642,14 @@ static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc,
 	if (argc > 1)
 		start = (ulong *)simple_strtoul(argv[1], NULL, 16);
 	else
-		start = (ulong *)CONFIG_SYS_MEMTEST_START;
+		start = (ulong *)getenv_ulong("mteststart", 16,
+				CONFIG_SYS_MEMTEST_START);
 
 	if (argc > 2)
 		end = (ulong *)simple_strtoul(argv[2], NULL, 16);
 	else
-		end = (ulong *)(CONFIG_SYS_MEMTEST_END);
+		end = (ulong *)getenv_ulong("mtestend", 16,
+				CONFIG_SYS_MEMTEST_END);
 
 	if (argc > 3)
 		pattern = (ulong)simple_strtoul(argv[3], NULL, 16);
diff --git a/common/main.c b/common/main.c
index e2d2e09..d6613aa 100644
--- a/common/main.c
+++ b/common/main.c
@@ -345,6 +345,21 @@ static void process_fdt_options(const void *blob)
 	if (addr)
 		setenv_addr("rootaddr", (void *)(CONFIG_SYS_TEXT_BASE + addr));
 }
+
+static void process_fdt_mem_options(const void *blob)
+{
+	ulong addr;
+
+	/* Add an env variable to point to a mtest start, if available */
+	addr = fdtdec_get_config_int(gd->fdt_blob, "mtest-start", 0);
+	if (addr)
+		setenv_addr("mteststart", (void *)addr);
+
+	/* Add an env variable to point to a mtest end, if available */
+	addr = fdtdec_get_config_int(gd->fdt_blob, "mtest-end", 0);
+	if (addr)
+		setenv_addr("mtestend", (void *)addr);
+}
 #endif /* CONFIG_OF_CONTROL */
 
 
@@ -475,6 +490,9 @@ void main_loop (void)
 	if (fdtdec_get_config_int(gd->fdt_blob, "bootsecure", 0))
 		secure_boot_cmd(env);
 
+	/* Get the mtest start and end from fdt */
+	process_fdt_mem_options(gd->fdt_blob);
+
 #endif /* CONFIG_OF_CONTROL */
 
 	debug ("### main_loop: bootcmd=\"%s\"\n", s ? s : "<UNDEFINED>");
-- 
1.7.4

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

end of thread, other threads:[~2013-03-11 19:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-01 14:32 [U-Boot] [PATCH] cmd_mem: Decode the mtest start and end values from fdt Jagannadha Sutradharudu Teki
2013-03-01 16:06 ` Wolfgang Denk
2013-03-01 19:15   ` Tom Rini
2013-03-01 19:24     ` Simon Glass
     [not found]   ` <ff1257d2-b332-477f-915d-0851e5ef944f@CO9EHSMHS030.ehs.local>
2013-03-01 22:48     ` Wolfgang Denk
     [not found]       ` <51f05678-4118-4be8-bb94-ad295c407602@DB3EHSMHS015.ehs.local>
2013-03-04  9:44         ` Wolfgang Denk
2013-03-08 19:08 ` [U-Boot] [PATCH] Feature Removal: disable "mtest" command by default Wolfgang Denk
2013-03-08 19:41   ` Ira W. Snyder
2013-03-08 20:50     ` Wolfgang Denk
2013-03-08 20:51   ` [U-Boot] [PATCH v2] " Wolfgang Denk
2013-03-11 19:57     ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox