diff mbox series

[07/36] bdinfo: microblaze: Use the generic bd command

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

Commit Message

Simon Glass May 4, 2020, 11:17 p.m. UTC
Microblaze prints out ethernet and FDT information. This is useful to
most archs, so move it into the generic code and move microblaze over to
use it.

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

 cmd/bdinfo.c | 30 +++++++-----------------------
 1 file changed, 7 insertions(+), 23 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:
>
> Microblaze prints out ethernet and FDT information. This is useful to
> most archs, so move it into the generic code and move microblaze over to
> use it.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
>  cmd/bdinfo.c | 30 +++++++-----------------------
>  1 file changed, 7 insertions(+), 23 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
Daniel Schwierzeck May 6, 2020, 3:56 p.m. UTC | #2
Am 05.05.20 um 01:17 schrieb Simon Glass:
> Microblaze prints out ethernet and FDT information. This is useful to
> most archs, so move it into the generic code and move microblaze over to
> use it.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
> 
>  cmd/bdinfo.c | 30 +++++++-----------------------
>  1 file changed, 7 insertions(+), 23 deletions(-)
> 
> diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
> index 405a915861..dc5a09f8ce 100644
> --- a/cmd/bdinfo.c
> +++ b/cmd/bdinfo.c
> @@ -224,29 +224,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>  
>  #elif defined(CONFIG_MICROBLAZE)
>  
> -int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> -{
> -	bd_t *bd = gd->bd;
> -
> -	print_bi_dram(bd);
> -	print_bi_flash(bd);
> -#if defined(CONFIG_SYS_SRAM_BASE)
> -	print_num("sram start     ",	(ulong)bd->bi_sramstart);
> -	print_num("sram size      ",	(ulong)bd->bi_sramsize);
> -#endif
> -#if defined(CONFIG_CMD_NET) && !defined(CONFIG_DM_ETH)
> -	print_eths();
> -#endif
> -	print_baudrate();
> -	print_num("relocaddr", gd->relocaddr);
> -	print_num("reloc off", gd->reloc_off);
> -	print_num("fdt_blob", (ulong)gd->fdt_blob);
> -	print_num("new_fdt", (ulong)gd->new_fdt);
> -	print_num("fdt_size", (ulong)gd->fdt_size);
> -	print_cpu_word_size();
> -
> -	return 0;
> -}
> +#define USE_GENERIC
>  
>  #elif defined(CONFIG_M68K)
>  
> @@ -463,6 +441,12 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
>  	print_num("relocaddr", gd->relocaddr);
>  	print_num("reloc off", gd->reloc_off);
>  	print_cpu_word_size();
> +#if defined(CONFIG_CMD_NET) && !defined(CONFIG_DM_ETH)
> +	print_eths();
> +#endif
> +	print_num("fdt_blob", (ulong)gd->fdt_blob);
> +	print_num("new_fdt", (ulong)gd->new_fdt);
> +	print_num("fdt_size", (ulong)gd->fdt_size);

shouldn't that be guarded with CONFIG_IS_ENABLED(OF_LIBFDT) ?

>  
>  	return 0;
>  }
>
Simon Glass May 10, 2020, 8:36 p.m. UTC | #3
Hi Daniel,

On Wed, 6 May 2020 at 09:56, Daniel Schwierzeck
<daniel.schwierzeck at gmail.com> wrote:
>
>
>
> Am 05.05.20 um 01:17 schrieb Simon Glass:
> > Microblaze prints out ethernet and FDT information. This is useful to
> > most archs, so move it into the generic code and move microblaze over to
> > use it.
> >
> > Signed-off-by: Simon Glass <sjg at chromium.org>
> > ---
> >
> >  cmd/bdinfo.c | 30 +++++++-----------------------
> >  1 file changed, 7 insertions(+), 23 deletions(-)
> >
> > diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
> > index 405a915861..dc5a09f8ce 100644
> > --- a/cmd/bdinfo.c
> > +++ b/cmd/bdinfo.c
> > @@ -224,29 +224,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> >
> >  #elif defined(CONFIG_MICROBLAZE)
> >
> > -int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> > -{
> > -     bd_t *bd = gd->bd;
> > -
> > -     print_bi_dram(bd);
> > -     print_bi_flash(bd);
> > -#if defined(CONFIG_SYS_SRAM_BASE)
> > -     print_num("sram start     ",    (ulong)bd->bi_sramstart);
> > -     print_num("sram size      ",    (ulong)bd->bi_sramsize);
> > -#endif
> > -#if defined(CONFIG_CMD_NET) && !defined(CONFIG_DM_ETH)
> > -     print_eths();
> > -#endif
> > -     print_baudrate();
> > -     print_num("relocaddr", gd->relocaddr);
> > -     print_num("reloc off", gd->reloc_off);
> > -     print_num("fdt_blob", (ulong)gd->fdt_blob);
> > -     print_num("new_fdt", (ulong)gd->new_fdt);
> > -     print_num("fdt_size", (ulong)gd->fdt_size);
> > -     print_cpu_word_size();
> > -
> > -     return 0;
> > -}
> > +#define USE_GENERIC
> >
> >  #elif defined(CONFIG_M68K)
> >
> > @@ -463,6 +441,12 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
> >       print_num("relocaddr", gd->relocaddr);
> >       print_num("reloc off", gd->reloc_off);
> >       print_cpu_word_size();
> > +#if defined(CONFIG_CMD_NET) && !defined(CONFIG_DM_ETH)
> > +     print_eths();
> > +#endif
> > +     print_num("fdt_blob", (ulong)gd->fdt_blob);
> > +     print_num("new_fdt", (ulong)gd->new_fdt);
> > +     print_num("fdt_size", (ulong)gd->fdt_size);
>
> shouldn't that be guarded with CONFIG_IS_ENABLED(OF_LIBFDT) ?

No it doesn't need to be. The commands are not available in SPL, and
U-Boot proper is supposed to use device tree for all boards.

Regards,
Simon
diff mbox series

Patch

diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
index 405a915861..dc5a09f8ce 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -224,29 +224,7 @@  int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #elif defined(CONFIG_MICROBLAZE)
 
-int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-	bd_t *bd = gd->bd;
-
-	print_bi_dram(bd);
-	print_bi_flash(bd);
-#if defined(CONFIG_SYS_SRAM_BASE)
-	print_num("sram start     ",	(ulong)bd->bi_sramstart);
-	print_num("sram size      ",	(ulong)bd->bi_sramsize);
-#endif
-#if defined(CONFIG_CMD_NET) && !defined(CONFIG_DM_ETH)
-	print_eths();
-#endif
-	print_baudrate();
-	print_num("relocaddr", gd->relocaddr);
-	print_num("reloc off", gd->reloc_off);
-	print_num("fdt_blob", (ulong)gd->fdt_blob);
-	print_num("new_fdt", (ulong)gd->new_fdt);
-	print_num("fdt_size", (ulong)gd->fdt_size);
-	print_cpu_word_size();
-
-	return 0;
-}
+#define USE_GENERIC
 
 #elif defined(CONFIG_M68K)
 
@@ -463,6 +441,12 @@  int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 	print_num("relocaddr", gd->relocaddr);
 	print_num("reloc off", gd->reloc_off);
 	print_cpu_word_size();
+#if defined(CONFIG_CMD_NET) && !defined(CONFIG_DM_ETH)
+	print_eths();
+#endif
+	print_num("fdt_blob", (ulong)gd->fdt_blob);
+	print_num("new_fdt", (ulong)gd->new_fdt);
+	print_num("fdt_size", (ulong)gd->fdt_size);
 
 	return 0;
 }