From 9fc6a06ad36994db21ca77013a8ba1c2a88e359c Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Wed, 23 Jan 2013 12:21:18 +0100 Subject: common: cmd_bdinfo: Fix bdinfo to show all MACs for Microblaze and ARM - Show all ethernet MACs in the system. - Show current ethernet device Signed-off-by: Michal Simek --- common/cmd_bdinfo.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'common/cmd_bdinfo.c') diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 48cdd16..65a5e08 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -51,6 +51,25 @@ static void print_eth(int idx) } __maybe_unused +static void print_eths(void) +{ + struct eth_device *dev; + int i = 0; + + do { + dev = eth_get_dev_by_index(i); + if (dev) { + printf("eth%dname = %s\n", i, dev->name); + print_eth(i); + i++; + } + } while (dev); + + printf("current eth = %s\n", eth_get_name()); + printf("ip_addr = %s\n", getenv("ipaddr")); +} + +__maybe_unused static void print_lnum(const char *name, unsigned long long value) { printf("%-12s= 0x%.8llX\n", name, value); @@ -195,8 +214,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_num("sram size ", (ulong)bd->bi_sramsize); #endif #if defined(CONFIG_CMD_NET) - print_eth(0); - printf("ip_addr = %s\n", getenv("ipaddr")); + print_eths(); #endif printf("baudrate = %u bps\n", (ulong)bd->bi_baudrate); return 0; @@ -366,8 +384,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } #if defined(CONFIG_CMD_NET) - print_eth(0); - printf("ip_addr = %s\n", getenv("ipaddr")); + print_eths(); #endif printf("baudrate = %u bps\n", bd->bi_baudrate); #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) -- cgit v1.1 From 82b6a4764c4ff0ea9b23875b99452a230cbb75db Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Wed, 23 Jan 2013 14:15:35 +0100 Subject: common: cmd_bdinfo: Fix compilation warning for microblaze Fix one printf compilation warning in microblaze bdinfo part. Warning log: cmd_bdinfo.c: In function 'do_bdinfo': cmd_bdinfo.c:219:2: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] Signed-off-by: Michal Simek --- common/cmd_bdinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/cmd_bdinfo.c') diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 65a5e08..28b5241 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -216,7 +216,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) #if defined(CONFIG_CMD_NET) print_eths(); #endif - printf("baudrate = %u bps\n", (ulong)bd->bi_baudrate); + printf("baudrate = %u bps\n", bd->bi_baudrate); return 0; } -- cgit v1.1