]> git.sur5r.net Git - u-boot/commitdiff
cmd/bdinfo: extract print_std_bdinfo
authorMax Filippov <jcmvbkbc@gmail.com>
Thu, 28 Jul 2016 00:57:24 +0000 (03:57 +0300)
committerTom Rini <trini@konsulko.com>
Fri, 5 Aug 2016 11:27:28 +0000 (07:27 -0400)
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@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
cmd/bdinfo.c

index c48ad831b103aac40f95b76046b8ba01dee9ad64..637463ed028e37e234721bc438b1936d9e599327 100644 (file)
@@ -157,6 +157,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)
 {
@@ -340,11 +349,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;
 }
@@ -353,13 +358,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);
 
@@ -370,14 +369,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;
 }