public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 4/7] cmd/bdinfo: extract print_bi_flash
Date: Thu, 28 Jul 2016 03:57:21 +0300	[thread overview]
Message-ID: <1469667444-4686-5-git-send-email-jcmvbkbc@gmail.com> (raw)
In-Reply-To: <1469667444-4686-1-git-send-email-jcmvbkbc@gmail.com>

print_bi_flash outputs flashstart, flashsize and flashoffset lines.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 cmd/bdinfo.c | 54 +++++++++++++++++++++++++++---------------------------
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
index c8a0511..0bef930 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -105,6 +105,24 @@ static inline void print_bi_dram(const bd_t *bd)
 #endif
 }
 
+static inline void print_bi_flash(const bd_t *bd)
+{
+#if defined(CONFIG_MICROBLAZE) || defined(CONFIG_SH)
+	print_num("flash start    ",	(ulong)bd->bi_flashstart);
+	print_num("flash size     ",	(ulong)bd->bi_flashsize);
+	print_num("flash offset   ",	(ulong)bd->bi_flashoffset);
+
+#elif defined(CONFIG_NIOS2) || defined(CONFIG_OPENRISC)
+	print_num("flash start",	(ulong)bd->bi_flashstart);
+	print_num("flash size",		(ulong)bd->bi_flashsize);
+	print_num("flash offset",	(ulong)bd->bi_flashoffset);
+#else
+	print_num("flashstart",		(ulong)bd->bi_flashstart);
+	print_num("flashsize",		(ulong)bd->bi_flashsize);
+	print_num("flashoffset",	(ulong)bd->bi_flashoffset);
+#endif
+}
+
 #if defined(CONFIG_PPC)
 void __weak board_detail(void)
 {
@@ -119,9 +137,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	print_num("bd address",		(ulong)bd);
 #endif
 	print_bi_mem(bd);
-	print_num("flashstart",		bd->bi_flashstart);
-	print_num("flashsize",		bd->bi_flashsize);
-	print_num("flashoffset",	bd->bi_flashoffset);
+	print_bi_flash(bd);
 	print_num("sramstart",		bd->bi_sramstart);
 	print_num("sramsize",		bd->bi_sramsize);
 #if	defined(CONFIG_5xx)  || defined(CONFIG_8xx) || \
@@ -195,9 +211,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	bd_t *bd = gd->bd;
 
 	print_bi_dram(bd);
-	print_num("flash start",	(ulong)bd->bi_flashstart);
-	print_num("flash size",		(ulong)bd->bi_flashsize);
-	print_num("flash offset",	(ulong)bd->bi_flashoffset);
+	print_bi_flash(bd);
 
 #if defined(CONFIG_SYS_SRAM_BASE)
 	print_num ("sram start",	(ulong)bd->bi_sramstart);
@@ -221,9 +235,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	bd_t *bd = gd->bd;
 
 	print_bi_dram(bd);
-	print_num("flash start    ",	(ulong)bd->bi_flashstart);
-	print_num("flash size     ",	(ulong)bd->bi_flashsize);
-	print_num("flash offset   ",	(ulong)bd->bi_flashoffset);
+	print_bi_flash(bd);
 #if defined(CONFIG_SYS_SRAM_BASE)
 	print_num("sram start     ",	(ulong)bd->bi_sramstart);
 	print_num("sram size      ",	(ulong)bd->bi_sramsize);
@@ -281,9 +293,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	bd_t *bd = gd->bd;
 
 	print_bi_mem(bd);
-	print_num("flashstart",		(ulong)bd->bi_flashstart);
-	print_num("flashsize",		(ulong)bd->bi_flashsize);
-	print_num("flashoffset",	(ulong)bd->bi_flashoffset);
+	print_bi_flash(bd);
 #if defined(CONFIG_SYS_INIT_RAM_ADDR)
 	print_num("sramstart",		(ulong)bd->bi_sramstart);
 	print_num("sramsize",		(ulong)bd->bi_sramsize);
@@ -335,9 +345,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 	print_bi_boot_params(bd);
 	print_bi_mem(bd);
-	print_num("flashstart",		(ulong)bd->bi_flashstart);
-	print_num("flashsize",		(ulong)bd->bi_flashsize);
-	print_num("flashoffset",	(ulong)bd->bi_flashoffset);
+	print_bi_flash(bd);
 
 	print_eth(0);
 	printf("ip_addr     = %s\n", getenv("ipaddr"));
@@ -354,9 +362,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 	print_bi_boot_params(bd);
 	print_bi_mem(bd);
-	print_num("flashstart",		(ulong)bd->bi_flashstart);
-	print_num("flashsize",		(ulong)bd->bi_flashsize);
-	print_num("flashoffset",	(ulong)bd->bi_flashoffset);
+	print_bi_flash(bd);
 
 	print_eth(0);
 	printf("ip_addr     = %s\n", getenv("ipaddr"));
@@ -375,9 +381,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 	print_bi_boot_params(bd);
 	print_bi_mem(bd);
-	print_num("flashstart",		(ulong)bd->bi_flashstart);
-	print_num("flashsize",		(ulong)bd->bi_flashsize);
-	print_num("flashoffset",	(ulong)bd->bi_flashoffset);
+	print_bi_flash(bd);
 
 	print_eth(0);
 	printf("ip_addr     = %s\n", getenv("ipaddr"));
@@ -439,9 +443,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	bd_t *bd = gd->bd;
 
 	print_bi_mem(bd);
-	print_num("flash start    ",	(ulong)bd->bi_flashstart);
-	print_num("flash size     ",	(ulong)bd->bi_flashsize);
-	print_num("flash offset   ",	(ulong)bd->bi_flashoffset);
+	print_bi_flash(bd);
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
@@ -526,9 +528,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	bd_t *bd = gd->bd;
 
 	print_bi_mem(bd);
-	print_num("flash start",	(ulong)bd->bi_flashstart);
-	print_num("flash size",		(ulong)bd->bi_flashsize);
-	print_num("flash offset",	(ulong)bd->bi_flashoffset);
+	print_bi_flash(bd);
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-- 
2.1.4

  parent reply	other threads:[~2016-07-28  0:57 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-28  0:57 [U-Boot] [PATCH v2 0/7] cmd/bdinfo: extract common parts and reuse them Max Filippov
2016-07-28  0:57 ` [U-Boot] [PATCH v2 1/7] cmd/bdinfo: extract print_bi_boot_params Max Filippov
2016-07-29 13:29   ` Tom Rini
2016-08-01  1:02   ` Simon Glass
2016-08-06  0:59   ` [U-Boot] [U-Boot, v2, " Tom Rini
2016-07-28  0:57 ` [U-Boot] [PATCH v2 2/7] cmd/bdinfo: extract print_bi_mem Max Filippov
2016-07-29 13:29   ` Tom Rini
2016-08-01  1:02   ` Simon Glass
2016-08-06  0:59   ` [U-Boot] [U-Boot,v2,2/7] " Tom Rini
2016-07-28  0:57 ` [U-Boot] [PATCH v2 3/7] cmd/bdinfo: extract print_bi_dram Max Filippov
2016-07-29 13:29   ` Tom Rini
2016-08-01  1:02   ` Simon Glass
2016-08-06  0:59   ` [U-Boot] [U-Boot,v2,3/7] " Tom Rini
2016-07-28  0:57 ` Max Filippov [this message]
2016-07-29 13:29   ` [U-Boot] [PATCH v2 4/7] cmd/bdinfo: extract print_bi_flash Tom Rini
2016-08-01  1:03   ` Simon Glass
2016-08-06  0:59   ` [U-Boot] [U-Boot,v2,4/7] " Tom Rini
2016-07-28  0:57 ` [U-Boot] [PATCH v2 5/7] cmd/bdinfo: extract print_eth_ip_addr Max Filippov
2016-07-29 13:29   ` Tom Rini
2016-08-01  1:03   ` Simon Glass
2016-08-04 16:59   ` Joe Hershberger
2016-08-06  0:59   ` [U-Boot] [U-Boot,v2,5/7] " Tom Rini
2016-07-28  0:57 ` [U-Boot] [PATCH v2 6/7] cmd/bdinfo: extract print_baudrate Max Filippov
2016-07-29 13:29   ` Tom Rini
2016-08-01  1:03   ` Simon Glass
2016-08-06  0:59   ` [U-Boot] [U-Boot,v2,6/7] " Tom Rini
2016-07-28  0:57 ` [U-Boot] [PATCH v2 7/7] cmd/bdinfo: extract print_std_bdinfo Max Filippov
2016-07-29 13:29   ` Tom Rini
2016-08-01  1:03   ` Simon Glass
2016-08-01  1:10     ` Max Filippov
2016-08-01 21:11       ` Tom Rini
2016-08-06  0:59   ` [U-Boot] [U-Boot,v2,7/7] " Tom Rini

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=1469667444-4686-5-git-send-email-jcmvbkbc@gmail.com \
    --to=jcmvbkbc@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox