diff mbox series

[09/36] bdinfo: x86: Use the generic bd command

Message ID 20200504171638.9.Ib8756a4661f954fd16fa53af900524e54b228fde@changeid
State Superseded
Headers show
Series Tidy up the 'bd' command. | expand

Commit Message

Simon Glass May 4, 2020, 11:17 p.m. UTC
This arch shows 'ethspeed' info but only the freescale drivers use it, so
it can be dropped.

It also calls print_bi_dram() which is safe to call from any arch since it
has an #ifdef inside it. Add this to the generic do_bdinfo() and move x86
over to use it. Put it first since pytests rely on seeing it before
memstart in find_ram_base().

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 cmd/bdinfo.c | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)

Comments

Bin Meng May 6, 2020, 8:07 a.m. UTC | #1
On Tue, May 5, 2020 at 7:19 AM Simon Glass <sjg at chromium.org> wrote:
>
> This arch shows 'ethspeed' info but only the freescale drivers use it, so
> it can be dropped.
>
> It also calls print_bi_dram() which is safe to call from any arch since it
> has an #ifdef inside it. Add this to the generic do_bdinfo() and move x86
> over to use it. Put it first since pytests rely on seeing it before
> memstart in find_ram_base().
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
>  cmd/bdinfo.c | 21 ++-------------------
>  1 file changed, 2 insertions(+), 19 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
diff mbox series

Patch

diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
index 0b9ac21848..0b903d234e 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -329,25 +329,7 @@  static int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc,
 
 #elif defined(CONFIG_X86)
 
-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_dram(bd);
-
-	print_num("relocaddr", gd->relocaddr);
-	print_num("reloc off", gd->reloc_off);
-#if defined(CONFIG_CMD_NET)
-	print_eth_ip_addr();
-	print_mhz("ethspeed",	    bd->bi_ethspeed);
-#endif
-	print_baudrate();
-	print_cpu_word_size();
-
-	return 0;
-}
+#define USE_GENERIC
 
 #elif defined(CONFIG_SANDBOX)
 
@@ -426,6 +408,7 @@  int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #ifdef USE_GENERIC
 int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 {
+	print_bi_dram(gd->bd);
 	print_std_bdinfo(gd->bd);
 	print_num("relocaddr", gd->relocaddr);
 	print_num("reloc off", gd->reloc_off);