Skip to contentSkip to conversation

common/cmd_bdinfo.c: fix do_bdinfo() for AVR32

PATCH New Andreas Bießmann 4 participants 8 messages Nov 2, 2010 – Nov 3, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/cmd_bdinfo.c: fix do_bdinfo() for AVR32

There was a prototype change from do_bdinfo(.. char *) to do_bdinfo(.. char * const). This patch respect this change for AVR32 architecture.

---
 common/cmd_bdinfo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
common/cmd_bdinfo.c +1 -1
index bba7374..1d76ffa 100644
@@ -304,7 +304,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #elif defined(CONFIG_AVR32)
 
-int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	bd_t *bd = gd->bd;
 
Signature · 1 line
1.7.2.3
#1 lore raw

PATCH 1/1 common/cmd_bdinfo.c: fix do_bdinfo() for AVR32

Dear Andreas Bie?mann,

Your e-Mail is:
Content-Transfer-Encoding: quoted-printable

That means ' ' comes as =20, '=' comes as =3D

Quoted 13 lines

There was a prototype change from do_bdinfo(.. char *) to do_bdinfo(.. char * const). This patch respect this change for AVR32 architecture.

---
 common/cmd_bdinfo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
common/cmd_bdinfo.c +0 -0
index bba7374..1d76ffa 100644

common/cmd_bdinfo.c int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) · line 310

Quoted 8 lines
common/cmd_bdinfo.c +1 -1
@@ -304,7 +304,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #elif defined(CONFIG_AVR32)
 
-int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	bd_t *bd = gd->bd;
 

I see that cmd_bdinfo.c has lots of coding style violations, but some architectures have them fixed.
Could we at least fix them in the AVR32 part, if we touch it anyway? See the BLACKFIN example ;)

Or is it OK to leave it as is? Wolfgang?

Best Regards,
Reinhard

#2 lore raw

PATCH 1/1 common/cmd_bdinfo.c: fix do_bdinfo() for AVR32

Dear Reinhard Meyer,

Am 02.11.2010 um 17:34 schrieb Reinhard Meyer:

Quoted 6 lines

Dear Andreas Bie?mann,

Your e-Mail is:
Content-Transfer-Encoding: quoted-printable

That means ' ' comes as =20, '=' comes as =3D

grr .. I wonder which part of the chain it was, will fix that.

Quoted 4 lines

I see that cmd_bdinfo.c has lots of coding style violations, but some architectures have them fixed.
Could we at least fix them in the AVR32 part, if we touch it anyway? See the BLACKFIN example ;)

I see, will fix that too. I have one additional change (my board does not have network at all ;). Patch will follow tomorrow.

regards

Andreas Bie?mann

#3 lore raw

PATCH 1/1 common/cmd_bdinfo.c: fix do_bdinfo() for AVR32

Dear Reinhard Meyer,

Am 02.11.2010 18:01, schrieb Andreas Bie?mann:

Quoted 6 lines

Am 02.11.2010 um 17:34 schrieb Reinhard Meyer:

Quoted 4 lines

Your e-Mail is:
Content-Transfer-Encoding: quoted-printable

That means ' ' comes as =20, '=' comes as =3D

grr .. I wonder which part of the chain it was, will fix that.

I found it ... The mails on this system went through local exim which did some conversion. The v2 patches should be ok, are they?

regards

Andreas Bie?mann

#4 lore raw

PATCH 1/1 common/cmd_bdinfo.c: fix do_bdinfo() for AVR32

In reply to Reinhard Meyer

Dear Reinhard Meyer,

Quoted 7 lines · In message <[email protected]> you wrote:

I see that cmd_bdinfo.c has lots of coding style violations, but some architectures have them fixed.
Could we at least fix them in the AVR32 part, if we touch it anyway? See the BLACKFIN example ;)

Or is it OK to leave it as is? Wolfgang?

Coding style fixes are OK, but should be done on file scope, and independent from changed to the actual content of the file.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Whenever people agree with me, I always think I must be wrong.
- Oscar Wilde
#5 lore raw

PATCH v2 1/3 cmd_bdinfo.c: fix whitespace

In reply to Andreas Bießmann

---
introduced in v2

 common/cmd_bdinfo.c |  272 +++++++++++++++++++++++++-------------------------
 1 files changed, 136 insertions(+), 136 deletions(-)
common/cmd_bdinfo.c +136 -136
index bba7374..e990aa4 100644
@@ -42,56 +42,56 @@ static void print_lnum(const char *, u64);
 #if defined(CONFIG_PPC)
 static void print_str(const char *, const char *);
 
-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;
 	char buf[32];
 
 #ifdef DEBUG
-	print_num ("bd address",    (ulong)bd		);
-#endif
-	print_num ("memstart",	    bd->bi_memstart	);
-	print_lnum ("memsize", 	    bd->bi_memsize	);
-	print_num ("flashstart",    bd->bi_flashstart	);
-	print_num ("flashsize",	    bd->bi_flashsize	);
-	print_num ("flashoffset",   bd->bi_flashoffset	);
-	print_num ("sramstart",	    bd->bi_sramstart	);
-	print_num ("sramsize",	    bd->bi_sramsize	);
+	print_num("bd address", (ulong)bd);
+#endif
+	print_num("memstart", bd->bi_memstart);
+	print_lnum("memsize", bd->bi_memsize);
+	print_num("flashstart", bd->bi_flashstart);
+	print_num("flashsize", bd->bi_flashsize);
+	print_num("flashoffset", bd->bi_flashoffset);
+	print_num("sramstart", bd->bi_sramstart);
+	print_num("sramsize", bd->bi_sramsize);
 #if defined(CONFIG_5xx)  || defined(CONFIG_8xx) || \
     defined(CONFIG_8260) || defined(CONFIG_E500)
-	print_num ("immr_base",	    bd->bi_immr_base	);
+	print_num("immr_base", bd->bi_immr_base);
 #endif
-	print_num ("bootflags",	    bd->bi_bootflags	);
+	print_num("bootflags", bd->bi_bootflags);
 #if defined(CONFIG_405GP) || defined(CONFIG_405CR) || \
     defined(CONFIG_405EP) || defined(CONFIG_XILINX_405) || \
     defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
     defined(CONFIG_440EPX) || defined(CONFIG_440GRX) ||	\
     defined(CONFIG_440SP) || defined(CONFIG_440SPE)
-	print_str ("procfreq",	    strmhz(buf, bd->bi_procfreq));
-	print_str ("plb_busfreq",   strmhz(buf, bd->bi_plb_busfreq));
+	print_str("procfreq", strmhz(buf, bd->bi_procfreq));
+	print_str("plb_busfreq", strmhz(buf, bd->bi_plb_busfreq));
 #if defined(CONFIG_405GP) || defined(CONFIG_405EP) || defined(CONFIG_XILINX_405) || \
     defined(CONFIG_440EP) || defined(CONFIG_440GR) || defined(CONFIG_440SPE) || \
     defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
-	print_str ("pci_busfreq",   strmhz(buf, bd->bi_pci_busfreq));
+	print_str("pci_busfreq", strmhz(buf, bd->bi_pci_busfreq));
 #endif
 #else	/* ! CONFIG_405GP, CONFIG_405CR, CONFIG_405EP, CONFIG_XILINX_405, CONFIG_440EP CONFIG_440GR */
 #if defined(CONFIG_CPM2)
-	print_str ("vco",	    strmhz(buf, bd->bi_vco));
-	print_str ("sccfreq",	    strmhz(buf, bd->bi_sccfreq));
-	print_str ("brgfreq",	    strmhz(buf, bd->bi_brgfreq));
+	print_str("vco", strmhz(buf, bd->bi_vco));
+	print_str("sccfreq", strmhz(buf, bd->bi_sccfreq));
+	print_str("brgfreq", strmhz(buf, bd->bi_brgfreq));
 #endif
-	print_str ("intfreq",	    strmhz(buf, bd->bi_intfreq));
+	print_str("intfreq", strmhz(buf, bd->bi_intfreq));
 #if defined(CONFIG_CPM2)
-	print_str ("cpmfreq",	    strmhz(buf, bd->bi_cpmfreq));
+	print_str("cpmfreq", strmhz(buf, bd->bi_cpmfreq));
 #endif
-	print_str ("busfreq",	    strmhz(buf, bd->bi_busfreq));
+	print_str("busfreq", strmhz(buf, bd->bi_busfreq));
 #endif /* CONFIG_405GP, CONFIG_405CR, CONFIG_405EP, CONFIG_XILINX_405, CONFIG_440EP CONFIG_440GR */
 #if defined(CONFIG_MPC8220)
-	print_str ("inpfreq",	    strmhz(buf, bd->bi_inpfreq));
-	print_str ("flbfreq",	    strmhz(buf, bd->bi_flbfreq));
-	print_str ("pcifreq",	    strmhz(buf, bd->bi_pcifreq));
-	print_str ("vcofreq",	    strmhz(buf, bd->bi_vcofreq));
-	print_str ("pevfreq",	    strmhz(buf, bd->bi_pevfreq));
+	print_str("inpfreq", strmhz(buf, bd->bi_inpfreq));
+	print_str("flbfreq", strmhz(buf, bd->bi_flbfreq));
+	print_str("pcifreq", strmhz(buf, bd->bi_pcifreq));
+	print_str("vcofreq", strmhz(buf, bd->bi_vcofreq));
+	print_str("pevfreq", strmhz(buf, bd->bi_pevfreq));
 #endif
 
 	print_eth(0);
@@ -112,60 +112,60 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #endif
 
 #ifdef CONFIG_HERMES
-	print_str ("ethspeed",	    strmhz(buf, bd->bi_ethspeed));
+	print_str("ethspeed", strmhz(buf, bd->bi_ethspeed));
 #endif
-	printf ("IP addr     = %pI4\n", &bd->bi_ip_addr);
-	printf ("baudrate    = %6ld bps\n", bd->bi_baudrate   );
-	print_num ("relocaddr", gd->relocaddr);
+	printf("IP addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("baudrate    = %6ld bps\n", bd->bi_baudrate);
+	print_num("relocaddr", gd->relocaddr);
 	return 0;
 }
 
 #elif defined(CONFIG_NIOS2)
 
-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_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);
+	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_SYS_SRAM_BASE)
-	print_num ("sram start",	(ulong)bd->bi_sramstart);
-	print_num ("sram size",		(ulong)bd->bi_sramsize);
+	print_num("sram start", (ulong)bd->bi_sramstart);
+	print_num("sram size", (ulong)bd->bi_sramsize);
 #endif
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf ("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
 #endif
 
-	printf ("baudrate    = %ld bps\n", bd->bi_baudrate);
+	printf("baudrate    = %ld bps\n", bd->bi_baudrate);
 
 	return 0;
 }
 
 #elif defined(CONFIG_MICROBLAZE)
 
-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_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);
+	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_SYS_SRAM_BASE)
-	print_num ("sram start     ",	(ulong)bd->bi_sramstart);
-	print_num ("sram size      ",	(ulong)bd->bi_sramsize);
+	print_num("sram start     ", (ulong)bd->bi_sramstart);
+	print_num("sram size      ", (ulong)bd->bi_sramsize);
 #endif
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf ("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
 #endif
-	printf ("baudrate    = %ld bps\n", (ulong)bd->bi_baudrate);
+	printf("baudrate    = %ld bps\n", (ulong)bd->bi_baudrate);
 	return 0;
 }
 
@@ -206,32 +206,32 @@ int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 
 static void print_str(const char *, const char *);
 
-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;
 	char buf[32];
 
-	print_num ("memstart",		(ulong)bd->bi_memstart);
-	print_lnum ("memsize",		(u64)bd->bi_memsize);
-	print_num ("flashstart",	(ulong)bd->bi_flashstart);
-	print_num ("flashsize",		(ulong)bd->bi_flashsize);
-	print_num ("flashoffset",	(ulong)bd->bi_flashoffset);
+	print_num("memstart", (ulong)bd->bi_memstart);
+	print_lnum("memsize", (u64)bd->bi_memsize);
+	print_num("flashstart", (ulong)bd->bi_flashstart);
+	print_num("flashsize", (ulong)bd->bi_flashsize);
+	print_num("flashoffset", (ulong)bd->bi_flashoffset);
 #if defined(CONFIG_SYS_INIT_RAM_ADDR)
-	print_num ("sramstart",		(ulong)bd->bi_sramstart);
-	print_num ("sramsize",		(ulong)bd->bi_sramsize);
+	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);
+	print_num("mbar", bd->bi_mbar_base);
 #endif
-	print_str ("cpufreq",		strmhz(buf, bd->bi_intfreq));
-	print_str ("busfreq",		strmhz(buf, bd->bi_busfreq));
+	print_str("cpufreq", strmhz(buf, bd->bi_intfreq));
+	print_str("busfreq", strmhz(buf, bd->bi_busfreq));
 #ifdef CONFIG_PCI
-	print_str ("pcifreq",		strmhz(buf, bd->bi_pcifreq));
+	print_str("pcifreq", strmhz(buf, bd->bi_pcifreq));
 #endif
 #ifdef CONFIG_EXTRA_CLOCK
-	print_str ("flbfreq",		strmhz(buf, bd->bi_flbfreq));
-	print_str ("inpfreq",		strmhz(buf, bd->bi_inpfreq));
-	print_str ("vcofreq",		strmhz(buf, bd->bi_vcofreq));
+	print_str("flbfreq", strmhz(buf, bd->bi_flbfreq));
+	print_str("inpfreq", strmhz(buf, bd->bi_inpfreq));
+	print_str("vcofreq", strmhz(buf, bd->bi_vcofreq));
 #endif
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
@@ -245,9 +245,9 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	print_eth(3);
 #endif
 
-	printf ("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
 #endif
-	printf ("baudrate    = %ld bps\n", bd->bi_baudrate);
+	printf("baudrate    = %ld bps\n", bd->bi_baudrate);
 
 	return 0;
 }
@@ -264,15 +264,15 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	printf("U-Boot      = %s\n", bd->bi_r_version);
 	printf("CPU         = %s\n", bd->bi_cpu);
 	printf("Board       = %s\n", bd->bi_board_name);
-	print_str("VCO",         strmhz(buf, bd->bi_vco));
-	print_str("CCLK",        strmhz(buf, bd->bi_cclk));
-	print_str("SCLK",        strmhz(buf, bd->bi_sclk));
+	print_str("VCO", strmhz(buf, bd->bi_vco));
+	print_str("CCLK", strmhz(buf, bd->bi_cclk));
+	print_str("SCLK", strmhz(buf, bd->bi_sclk));
 
 	print_num("boot_params", (ulong)bd->bi_boot_params);
-	print_num("memstart",    (ulong)bd->bi_memstart);
-	print_lnum("memsize",    (u64)bd->bi_memsize);
-	print_num("flashstart",  (ulong)bd->bi_flashstart);
-	print_num("flashsize",   (ulong)bd->bi_flashsize);
+	print_num("memstart", (ulong)bd->bi_memstart);
+	print_lnum("memsize", (u64)bd->bi_memsize);
+	print_num("flashstart", (ulong)bd->bi_flashstart);
+	print_num("flashsize", (ulong)bd->bi_flashsize);
 	print_num("flashoffset", (ulong)bd->bi_flashoffset);
 
 	print_eth(0);
@@ -284,92 +284,92 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #elif defined(CONFIG_MIPS)
 
-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_num ("boot_params",	(ulong)bd->bi_boot_params);
-	print_num ("memstart",		(ulong)bd->bi_memstart);
-	print_lnum ("memsize",		(u64)bd->bi_memsize);
-	print_num ("flashstart",	(ulong)bd->bi_flashstart);
-	print_num ("flashsize",		(ulong)bd->bi_flashsize);
-	print_num ("flashoffset",	(ulong)bd->bi_flashoffset);
+	print_num("boot_params", (ulong)bd->bi_boot_params);
+	print_num("memstart", (ulong)bd->bi_memstart);
+	print_lnum("memsize", (u64)bd->bi_memsize);
+	print_num("flashstart", (ulong)bd->bi_flashstart);
+	print_num("flashsize", (ulong)bd->bi_flashsize);
+	print_num("flashoffset", (ulong)bd->bi_flashoffset);
 
 	print_eth(0);
-	printf ("ip_addr     = %pI4\n", &bd->bi_ip_addr);
-	printf ("baudrate    = %d bps\n", bd->bi_baudrate);
+	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("baudrate    = %d bps\n", bd->bi_baudrate);
 
 	return 0;
 }
 
 #elif defined(CONFIG_AVR32)
 
-int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
 	bd_t *bd = gd->bd;
 
-	print_num ("boot_params",	(ulong)bd->bi_boot_params);
-	print_num ("memstart",		(ulong)bd->bi_memstart);
-	print_lnum ("memsize",		(u64)bd->bi_memsize);
-	print_num ("flashstart",	(ulong)bd->bi_flashstart);
-	print_num ("flashsize",		(ulong)bd->bi_flashsize);
-	print_num ("flashoffset",	(ulong)bd->bi_flashoffset);
+	print_num("boot_params", (ulong)bd->bi_boot_params);
+	print_num("memstart", (ulong)bd->bi_memstart);
+	print_lnum("memsize", (u64)bd->bi_memsize);
+	print_num("flashstart", (ulong)bd->bi_flashstart);
+	print_num("flashsize", (ulong)bd->bi_flashsize);
+	print_num("flashoffset", (ulong)bd->bi_flashoffset);
 
 	print_eth(0);
-	printf ("ip_addr     = %pI4\n", &bd->bi_ip_addr);
-	printf ("baudrate    = %lu bps\n", bd->bi_baudrate);
+	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("baudrate    = %lu bps\n", bd->bi_baudrate);
 
 	return 0;
 }
 
 #elif defined(CONFIG_ARM)
 
-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[])
 {
 	int i;
 	bd_t *bd = gd->bd;
 
-	print_num ("arch_number",	bd->bi_arch_number);
-	print_num ("boot_params",	(ulong)bd->bi_boot_params);
+	print_num("arch_number", bd->bi_arch_number);
+	print_num("boot_params", (ulong)bd->bi_boot_params);
 
 	for (i=0; i<CONFIG_NR_DRAM_BANKS; ++i) {
-		print_num("DRAM bank",	i);
-		print_num("-> start",	bd->bi_dram[i].start);
-		print_num("-> size",	bd->bi_dram[i].size);
+		print_num("DRAM bank", i);
+		print_num("-> start", bd->bi_dram[i].start);
+		print_num("-> size", bd->bi_dram[i].size);
 	}
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf ("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
 #endif
-	printf ("baudrate    = %d bps\n", bd->bi_baudrate);
+	printf("baudrate    = %d bps\n", bd->bi_baudrate);
 #if !(defined(CONFIG_SYS_NO_ICACHE) && defined(CONFIG_SYS_NO_DCACHE))
-	print_num ("TLB addr", gd->tlb_addr);
+	print_num("TLB addr", gd->tlb_addr);
 #endif
-	print_num ("relocaddr", gd->relocaddr);
-	print_num ("reloc off", gd->reloc_off);
-	print_num ("irq_sp", gd->irq_sp);	/* irq stack pointer */
-	print_num ("sp start ", gd->start_addr_sp);
-	print_num ("FB base  ", gd->fb_base);
+	print_num("relocaddr", gd->relocaddr);
+	print_num("reloc off", gd->reloc_off);
+	print_num("irq_sp", gd->irq_sp);	/* irq stack pointer */
+	print_num("sp start ", gd->start_addr_sp);
+	print_num("FB base  ", gd->fb_base);
 	return 0;
 }
 
 #elif defined(CONFIG_SH)
 
-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_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);
+	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);
+	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
 #endif
-	printf ("baudrate    = %ld bps\n", (ulong)bd->bi_baudrate);
+	printf("baudrate    = %ld bps\n", (ulong)bd->bi_baudrate);
 	return 0;
 }
 
@@ -377,36 +377,36 @@ int do_bdinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 static void print_str(const char *, const char *);
 
-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[])
 {
 	int i;
 	bd_t *bd = gd->bd;
 	char buf[32];
 
-	print_num ("boot_params",	(ulong)bd->bi_boot_params);
-	print_num ("bi_memstart",	bd->bi_memstart);
-	print_num ("bi_memsize",	bd->bi_memsize);
-	print_num ("bi_flashstart",	bd->bi_flashstart);
-	print_num ("bi_flashsize",	bd->bi_flashsize);
-	print_num ("bi_flashoffset",	bd->bi_flashoffset);
-	print_num ("bi_sramstart",	bd->bi_sramstart);
-	print_num ("bi_sramsize",	bd->bi_sramsize);
-	print_num ("bi_bootflags",	bd->bi_bootflags);
-	print_str ("cpufreq",		strmhz(buf, bd->bi_intfreq));
-	print_str ("busfreq",		strmhz(buf, bd->bi_busfreq));
+	print_num("boot_params", (ulong)bd->bi_boot_params);
+	print_num("bi_memstart", bd->bi_memstart);
+	print_num("bi_memsize", bd->bi_memsize);
+	print_num("bi_flashstart", bd->bi_flashstart);
+	print_num("bi_flashsize", bd->bi_flashsize);
+	print_num("bi_flashoffset", bd->bi_flashoffset);
+	print_num("bi_sramstart", bd->bi_sramstart);
+	print_num("bi_sramsize", bd->bi_sramsize);
+	print_num("bi_bootflags", bd->bi_bootflags);
+	print_str("cpufreq", strmhz(buf, bd->bi_intfreq));
+	print_str("busfreq", strmhz(buf, bd->bi_busfreq));
 
 	for (i=0; i<CONFIG_NR_DRAM_BANKS; ++i) {
-		print_num("DRAM bank",	i);
-		print_num("-> start",	bd->bi_dram[i].start);
-		print_num("-> size",	bd->bi_dram[i].size);
+		print_num("DRAM bank", i);
+		print_num("-> start", bd->bi_dram[i].start);
+		print_num("-> size", bd->bi_dram[i].size);
 	}
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf ("ip_addr     = %pI4\n", &bd->bi_ip_addr);
-	print_str ("ethspeed",	    strmhz(buf, bd->bi_ethspeed));
+	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	print_str("ethspeed", strmhz(buf, bd->bi_ethspeed));
 #endif
-	printf ("baudrate    = %d bps\n", bd->bi_baudrate);
+	printf("baudrate    = %d bps\n", bd->bi_baudrate);
 
 	return 0;
 }
@@ -417,7 +417,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 static void print_num(const char *name, ulong value)
 {
-	printf ("%-12s= 0x%08lX\n", name, value);
+	printf("%-12s= 0x%08lX\n", name, value);
 }
 
 #if !(defined(CONFIG_ARM) || defined(CONFIG_M68K)) || defined(CONFIG_CMD_NET)
@@ -438,7 +438,7 @@ static void print_eth(int idx)
 #if (!defined(CONFIG_ARM) && !defined(CONFIG_X86))
 static void print_lnum(const char *name, u64 value)
 {
-	printf ("%-12s= 0x%.8llX\n", name, value);
+	printf("%-12s= 0x%.8llX\n", name, value);
 }
 #endif
 
@@ -448,7 +448,7 @@ static void print_lnum(const char *name, u64 value)
     defined(CONFIG_X86)
 static void print_str(const char *name, const char *str)
 {
-	printf ("%-12s= %6s MHz\n", name, str);
+	printf("%-12s= %6s MHz\n", name, str);
 }
 #endif	/* CONFIG_PPC */
 
@@ -456,7 +456,7 @@ static void print_str(const char *name, const char *str)
 /* -------------------------------------------------------------------- */
 
 U_BOOT_CMD(
-	bdinfo,	1,	1,	do_bdinfo,
+	bdinfo, 1, 1, do_bdinfo,
 	"print Board Info structure",
 	""
 );
Signature · 1 line
1.7.2.3
#6 lore raw

PATCH v2 2/3 cmd_bdinfo.c: fix long lines

In reply to Andreas Bießmann

---
introduced in v2

 common/cmd_bdinfo.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
common/cmd_bdinfo.c +10 -10
index e990aa4..ed7a362 100644
@@ -183,16 +183,16 @@ int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 	print_num("flashstart             ", bd->bi_flashstart);
 	print_num("CONFIG_SYS_MONITOR_BASE       ", CONFIG_SYS_MONITOR_BASE);
 	print_num("CONFIG_ENV_ADDR           ", CONFIG_ENV_ADDR);
-	printf("CONFIG_SYS_RELOC_MONITOR_BASE = 0x%lx (%d)\n", CONFIG_SYS_RELOC_MONITOR_BASE,
-	       CONFIG_SYS_MONITOR_LEN);
-	printf("CONFIG_SYS_MALLOC_BASE        = 0x%lx (%d)\n", CONFIG_SYS_MALLOC_BASE,
-	       CONFIG_SYS_MALLOC_LEN);
-	printf("CONFIG_SYS_INIT_SP_OFFSET     = 0x%lx (%d)\n", CONFIG_SYS_INIT_SP_OFFSET,
-	       CONFIG_SYS_STACK_SIZE);
-	printf("CONFIG_SYS_PROM_OFFSET        = 0x%lx (%d)\n", CONFIG_SYS_PROM_OFFSET,
-	       CONFIG_SYS_PROM_SIZE);
-	printf("CONFIG_SYS_GBL_DATA_OFFSET    = 0x%lx (%d)\n", CONFIG_SYS_GBL_DATA_OFFSET,
-	       GENERATED_GBL_DATA_SIZE);
+	printf("CONFIG_SYS_RELOC_MONITOR_BASE = 0x%lx (%d)\n",
+			CONFIG_SYS_RELOC_MONITOR_BASE, CONFIG_SYS_MONITOR_LEN);
+	printf("CONFIG_SYS_MALLOC_BASE        = 0x%lx (%d)\n",
+			CONFIG_SYS_MALLOC_BASE, CONFIG_SYS_MALLOC_LEN);
+	printf("CONFIG_SYS_INIT_SP_OFFSET     = 0x%lx (%d)\n",
+			CONFIG_SYS_INIT_SP_OFFSET, CONFIG_SYS_STACK_SIZE);
+	printf("CONFIG_SYS_PROM_OFFSET        = 0x%lx (%d)\n",
+			CONFIG_SYS_PROM_OFFSET, CONFIG_SYS_PROM_SIZE);
+	printf("CONFIG_SYS_GBL_DATA_OFFSET    = 0x%lx (%d)\n",
+			CONFIG_SYS_GBL_DATA_OFFSET, GENERATED_GBL_DATA_SIZE);
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
Signature · 1 line
1.7.2.3
#7 lore raw

PATCH v2 3/3 cmd_bdinfo.c: fix do_bdinfo() for AVR32

In reply to Andreas Bießmann

There was a prototype change from do_bdinfo(.. char *) to do_bdinfo(.. char * const). This patch respect this change for AVR32 architecture.

Additionally remove network information from printout if not available.

---
changes since v1:
- add conditional print of network information

 common/cmd_bdinfo.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
common/cmd_bdinfo.c +3 -1
index ed7a362..8a7483a 100644
@@ -304,7 +304,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #elif defined(CONFIG_AVR32)
 
-int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	bd_t *bd = gd->bd;
 
@@ -315,8 +315,10 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	print_num("flashsize", (ulong)bd->bi_flashsize);
 	print_num("flashoffset", (ulong)bd->bi_flashoffset);
 
+#if defined(CONFIG_CMD_NET)
 	print_eth(0);
 	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+#endif
 	printf("baudrate    = %lu bps\n", bd->bi_baudrate);
 
 	return 0;
Signature · 1 line
1.7.2.3