[U-Boot] [PATCH 6/6] cmd/bdinfo: extract print_std_bdinfo
Max Filippov
jcmvbkbc at gmail.com
Wed Jul 27 07:27:41 CEST 2016
print_std_bdinfo outputs typical set of board information entries:
boot params location, memory and flash addresses and sizes, network
interfaces information and configured serial baud rate.
Signed-off-by: Max Filippov <jcmvbkbc at gmail.com>
---
cmd/bdinfo.c | 32 ++++++++++++--------------------
1 file changed, 12 insertions(+), 20 deletions(-)
diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
index b4abb91..4210ae9 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -155,6 +155,15 @@ static inline void print_baudrate(void)
#endif
}
+static inline void print_std_bdinfo(const bd_t *bd)
+{
+ print_bi_boot_params(bd);
+ print_bi_mem(bd);
+ print_bi_flash(bd);
+ print_eth_ip_addr();
+ print_baudrate();
+}
+
#if defined(CONFIG_PPC)
void __weak board_detail(void)
{
@@ -338,11 +347,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
print_mhz("CCLK", bd->bi_cclk);
print_mhz("SCLK", bd->bi_sclk);
- print_bi_boot_params(bd);
- print_bi_mem(bd);
- print_bi_flash(bd);
- print_eth_ip_addr();
- print_baudrate();
+ print_std_bdinfo(bd);
return 0;
}
@@ -351,13 +356,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
- bd_t *bd = gd->bd;
-
- print_bi_boot_params(bd);
- print_bi_mem(bd);
- print_bi_flash(bd);
- print_eth_ip_addr();
- print_baudrate();
+ print_std_bdinfo(gd->bd);
print_num("relocaddr", gd->relocaddr);
print_num("reloc off", gd->reloc_off);
@@ -368,14 +367,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
- bd_t *bd = gd->bd;
-
- print_bi_boot_params(bd);
- print_bi_mem(bd);
- print_bi_flash(bd);
- print_eth_ip_addr();
- print_baudrate();
-
+ print_std_bdinfo(gd->bd);
return 0;
}
--
2.1.4
More information about the U-Boot
mailing list