diff mbox series

[v2,15/39] bdinfo: m68k: Use the generic bd command

Message ID 20200510201702.196031-7-sjg@chromium.org
State Accepted
Commit 67145d19412695b3299f093a2d9d1b3feb028b23
Headers show
Series Tidy up the 'bd' command. | expand

Commit Message

Simon Glass May 10, 2020, 8:16 p.m. UTC
Unfortunately m68k has a lot of special stuff. Move it into the generic
function for now, so we can have it all in one place.

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

Changes in v2:
- Fix up inadvertent merge of PowerPC/ARM/m68k/arc patches

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

Comments

Bin Meng May 17, 2020, 2:03 p.m. UTC | #1
On Mon, May 11, 2020 at 4:17 AM Simon Glass <sjg at chromium.org> wrote:
>
> Unfortunately m68k has a lot of special stuff. Move it into the generic
> function for now, so we can have it all in one place.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
> Changes in v2:
> - Fix up inadvertent merge of PowerPC/ARM/m68k/arc patches
>
>  cmd/bdinfo.c | 49 +++++++++++++++++++------------------------------
>  1 file changed, 19 insertions(+), 30 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 05e4a05b77..646d8807bd 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -183,35 +183,7 @@  static inline void __maybe_unused print_std_bdinfo(const bd_t *bd)
 
 #elif defined(CONFIG_M68K)
 
-int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-	bd_t *bd = gd->bd;
-
-	print_bi_mem(bd);
-	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);
-#endif
-#if defined(CONFIG_SYS_MBAR)
-	print_num("mbar",		bd->bi_mbar_base);
-#endif
-	print_mhz("cpufreq",		bd->bi_intfreq);
-	print_mhz("busfreq",		bd->bi_busfreq);
-#ifdef CONFIG_PCI
-	print_mhz("pcifreq",		bd->bi_pcifreq);
-#endif
-#ifdef CONFIG_EXTRA_CLOCK
-	print_mhz("flbfreq",		bd->bi_flbfreq);
-	print_mhz("inpfreq",		bd->bi_inpfreq);
-	print_mhz("vcofreq",		bd->bi_vcofreq);
-#endif
-	print_eth_ip_addr();
-	print_baudrate();
-	print_cpu_word_size();
-
-	return 0;
-}
+#define USE_GENERIC
 
 #elif defined(CONFIG_MIPS)
 
@@ -359,7 +331,6 @@  int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 		else
 			puts("addressing  = 32-bit\n");
 #endif
-		print_mhz("busfreq", bd->bi_busfreq);
 		board_detail();
 	}
 #if defined(CONFIG_CPM2)
@@ -369,9 +340,27 @@  int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 	print_mhz("brgfreq", bd->bi_brgfreq);
 #endif
 
+	/* This is used by m68k and ppc */
 #if defined(CONFIG_SYS_INIT_RAM_ADDR)
 	print_num("sramstart", (ulong)bd->bi_sramstart);
 	print_num("sramsize", (ulong)bd->bi_sramsize);
+#endif
+	if (IS_ENABLED(CONFIG_PPC) || IS_ENABLED(CONFIG_M68K))
+		print_mhz("busfreq", bd->bi_busfreq);
+
+	/* The rest are used only by m68k */
+#ifdef CONFIG_M68K
+#if defined(CONFIG_SYS_MBAR)
+	print_num("mbar", bd->bi_mbar_base);
+#endif
+	print_mhz("cpufreq", bd->bi_intfreq);
+	if (IS_ENABLED(CONFIG_PCI))
+		print_mhz("pcifreq", bd->bi_pcifreq);
+#ifdef CONFIG_EXTRA_CLOCK
+	print_mhz("flbfreq", bd->bi_flbfreq);
+	print_mhz("inpfreq", bd->bi_inpfreq);
+	print_mhz("vcofreq", bd->bi_vcofreq);
+#endif
 #endif
 
 	return 0;