Patchwork [U-Boot,5/9] openrisc: Add board info printout to cmd_bdinfo

login
register
mail settings
Submitter Stefan Kristiansson
Date Nov. 19, 2011, 5:21 a.m.
Message ID <1321680098-31121-6-git-send-email-stefan.kristiansson@saunalahti.fi>
Download mbox | patch
Permalink /patch/126522/
State Accepted
Commit 2be9fdbfcc4d41e3a7f7d6b1b1b21a39ce5aa6e9
Headers show

Comments

Stefan Kristiansson - Nov. 19, 2011, 5:21 a.m.
Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
---
 common/cmd_bdinfo.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
Marek Vasut - Nov. 21, 2011, 10:53 p.m.
> Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
> ---
>  common/cmd_bdinfo.c |   22 ++++++++++++++++++++++
>  1 files changed, 22 insertions(+), 0 deletions(-)
> 
> diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c
> index 688b238..1cd69b5 100644
> --- a/common/cmd_bdinfo.c
> +++ b/common/cmd_bdinfo.c
> @@ -460,6 +460,28 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc,
> char * const argv[]) return 0;
>  }
> 
> +#elif defined(CONFIG_OPENRISC)
> +
> +int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> +{
> +	bd_t *bd = gd->bd;
> +
> +	print_num("mem start",		(ulong)bd->bi_memstart);
> +	print_lnum("mem size",		(u64)bd->bi_memsize);
> +	print_num("flash start",	(ulong)bd->bi_flashstart);
> +	print_num("flash size",		(ulong)bd->bi_flashsize);
> +	print_num("flash offset",	(ulong)bd->bi_flashoffset);
> +
> +#if defined(CONFIG_CMD_NET)
> +	print_eth(0);
> +	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
> +#endif
> +
> +	printf("baudrate    = %ld bps\n", bd->bi_baudrate);

Would consistent format of the printed data be a problem ? ;-)

> +
> +	return 0;
> +}
> +
>  #else
>   #error "a case for this architecture does not exist!"
>  #endif
Stefan Kristiansson - Nov. 22, 2011, 4:30 a.m.
On Mon, Nov 21, 2011 at 11:53:32PM +0100, Marek Vasut wrote:
> > +int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> > +{
> > +	bd_t *bd = gd->bd;
> > +
> > +	print_num("mem start",		(ulong)bd->bi_memstart);
> > +	print_lnum("mem size",		(u64)bd->bi_memsize);
> > +	print_num("flash start",	(ulong)bd->bi_flashstart);
> > +	print_num("flash size",		(ulong)bd->bi_flashsize);
> > +	print_num("flash offset",	(ulong)bd->bi_flashoffset);
> > +
> > +#if defined(CONFIG_CMD_NET)
> > +	print_eth(0);
> > +	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
> > +#endif
> > +
> > +	printf("baudrate    = %ld bps\n", bd->bi_baudrate);
> 
> Would consistent format of the printed data be a problem ? ;-)
> 

I'm sorry, I don't think I understand what you are referring to here.
When printed, they are all lined up.
If I haven't missed something, every arch does the printing like that.

Stefan
Marek Vasut - Nov. 22, 2011, 4:49 a.m.
> On Mon, Nov 21, 2011 at 11:53:32PM +0100, Marek Vasut wrote:
> > > +int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const
> > > argv[]) +{
> > > +	bd_t *bd = gd->bd;
> > > +
> > > +	print_num("mem start",		(ulong)bd->bi_memstart);
> > > +	print_lnum("mem size",		(u64)bd->bi_memsize);
> > > +	print_num("flash start",	(ulong)bd->bi_flashstart);
> > > +	print_num("flash size",		(ulong)bd->bi_flashsize);
> > > +	print_num("flash offset",	(ulong)bd->bi_flashoffset);
> > > +
> > > +#if defined(CONFIG_CMD_NET)
> > > +	print_eth(0);
> > > +	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
> > > +#endif
> > > +
> > > +	printf("baudrate    = %ld bps\n", bd->bi_baudrate);
> > 
> > Would consistent format of the printed data be a problem ? ;-)
> 
> I'm sorry, I don't think I understand what you are referring to here.
> When printed, they are all lined up.
> If I haven't missed something, every arch does the printing like that.

Ok, then that's good.

> 
> Stefan

Patch

diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c
index 688b238..1cd69b5 100644
--- a/common/cmd_bdinfo.c
+++ b/common/cmd_bdinfo.c
@@ -460,6 +460,28 @@  int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	return 0;
 }
 
+#elif defined(CONFIG_OPENRISC)
+
+int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+	bd_t *bd = gd->bd;
+
+	print_num("mem start",		(ulong)bd->bi_memstart);
+	print_lnum("mem size",		(u64)bd->bi_memsize);
+	print_num("flash start",	(ulong)bd->bi_flashstart);
+	print_num("flash size",		(ulong)bd->bi_flashsize);
+	print_num("flash offset",	(ulong)bd->bi_flashoffset);
+
+#if defined(CONFIG_CMD_NET)
+	print_eth(0);
+	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+#endif
+
+	printf("baudrate    = %ld bps\n", bd->bi_baudrate);
+
+	return 0;
+}
+
 #else
  #error "a case for this architecture does not exist!"
 #endif