From: Max Filippov <jcmvbkbc@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 6/7] cmd/bdinfo: extract print_baudrate
Date: Thu, 28 Jul 2016 03:57:23 +0300 [thread overview]
Message-ID: <1469667444-4686-7-git-send-email-jcmvbkbc@gmail.com> (raw)
In-Reply-To: <1469667444-4686-1-git-send-email-jcmvbkbc@gmail.com>
print_baudrate outputs serial baud rate.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
cmd/bdinfo.c | 39 +++++++++++++++++++++++++--------------
1 file changed, 25 insertions(+), 14 deletions(-)
diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
index 4ffb757..403ed3e 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -146,6 +146,17 @@ static inline void print_eth_ip_addr(void)
#endif
}
+static inline void print_baudrate(void)
+{
+#if defined(CONFIG_PPC)
+ printf("baudrate = %6u bps\n", gd->baudrate);
+#elif defined(CONFIG_SPARC)
+ printf("baudrate = %6u bps\n", gd->baudrate);
+#else
+ printf("baudrate = %u bps\n", gd->baudrate);
+#endif
+}
+
#if defined(CONFIG_PPC)
void __weak board_detail(void)
{
@@ -204,7 +215,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#endif
print_eth_ip_addr();
- printf("baudrate = %6u bps\n", gd->baudrate);
+ print_baudrate();
print_num("relocaddr", gd->relocaddr);
board_detail();
return 0;
@@ -225,7 +236,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#endif
print_eth_ip_addr();
- printf("baudrate = %u bps\n", gd->baudrate);
+ print_baudrate();
return 0;
}
@@ -245,7 +256,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#if defined(CONFIG_CMD_NET) && !defined(CONFIG_DM_ETH)
print_eths();
#endif
- printf("baudrate = %u bps\n", gd->baudrate);
+ print_baudrate();
print_num("relocaddr", gd->relocaddr);
print_num("reloc off", gd->reloc_off);
print_num("fdt_blob", (ulong)gd->fdt_blob);
@@ -281,7 +292,7 @@ int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
GENERATED_GBL_DATA_SIZE);
print_eth_ip_addr();
- printf("baudrate = %6u bps\n", gd->baudrate);
+ print_baudrate();
return 0;
}
@@ -311,7 +322,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
print_mhz("vcofreq", bd->bi_vcofreq);
#endif
print_eth_ip_addr();
- printf("baudrate = %u bps\n", gd->baudrate);
+ print_baudrate();
return 0;
}
@@ -333,7 +344,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
print_bi_mem(bd);
print_bi_flash(bd);
print_eth_ip_addr();
- printf("baudrate = %u bps\n", gd->baudrate);
+ print_baudrate();
return 0;
}
@@ -348,7 +359,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
print_bi_mem(bd);
print_bi_flash(bd);
print_eth_ip_addr();
- printf("baudrate = %u bps\n", gd->baudrate);
+ print_baudrate();
print_num("relocaddr", gd->relocaddr);
print_num("reloc off", gd->reloc_off);
@@ -365,7 +376,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
print_bi_mem(bd);
print_bi_flash(bd);
print_eth_ip_addr();
- printf("baudrate = %u bps\n", gd->baudrate);
+ print_baudrate();
return 0;
}
@@ -390,7 +401,7 @@ static int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc,
#if defined(CONFIG_CMD_NET) && !defined(CONFIG_DM_ETH)
print_eths();
#endif
- printf("baudrate = %u bps\n", gd->baudrate);
+ print_baudrate();
#if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
print_num("TLB addr", gd->arch.tlb_addr);
#endif
@@ -425,7 +436,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
print_bi_mem(bd);
print_bi_flash(bd);
print_eth_ip_addr();
- printf("baudrate = %u bps\n", gd->baudrate);
+ print_baudrate();
return 0;
}
@@ -453,7 +464,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
print_eth_ip_addr();
print_mhz("ethspeed", bd->bi_ethspeed);
#endif
- printf("baudrate = %u bps\n", gd->baudrate);
+ print_baudrate();
return 0;
}
@@ -484,7 +495,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
print_bi_boot_params(bd);
print_bi_dram(bd);
print_eth_ip_addr();
- printf("baudrate = %u bps\n", gd->baudrate);
+ print_baudrate();
return 0;
}
@@ -498,7 +509,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
print_bi_mem(bd);
print_bi_flash(bd);
print_eth_ip_addr();
- printf("baudrate = %u bps\n", gd->baudrate);
+ print_baudrate();
return 0;
}
@@ -511,7 +522,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
print_bi_mem(bd);
print_eth_ip_addr();
- printf("baudrate = %d bps\n", gd->baudrate);
+ print_baudrate();
return 0;
}
--
2.1.4
next prev 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 ` [U-Boot] [PATCH v2 4/7] cmd/bdinfo: extract print_bi_flash 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,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 ` Max Filippov [this message]
2016-07-29 13:29 ` [U-Boot] [PATCH v2 6/7] cmd/bdinfo: extract print_baudrate 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-7-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