From patchwork Wed Aug 31 09:38:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 112489 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 64046B6F7B for ; Wed, 31 Aug 2011 19:38:54 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1ABA42808C; Wed, 31 Aug 2011 11:38:44 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id t-p8G-HeaRnx; Wed, 31 Aug 2011 11:38:43 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9DD4028085; Wed, 31 Aug 2011 11:38:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D5EAC28085 for ; Wed, 31 Aug 2011 11:38:37 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YWH2hkYYsOWe for ; Wed, 31 Aug 2011 11:38:35 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-bw0-f44.google.com (mail-bw0-f44.google.com [209.85.214.44]) by theia.denx.de (Postfix) with ESMTPS id 2ED9F28084 for ; Wed, 31 Aug 2011 11:38:33 +0200 (CEST) Received: by bkar4 with SMTP id r4so552449bka.3 for ; Wed, 31 Aug 2011 02:38:33 -0700 (PDT) Received: by 10.204.135.18 with SMTP id l18mr134647bkt.341.1314783513349; Wed, 31 Aug 2011 02:38:33 -0700 (PDT) Received: from localhost ([178.23.216.97]) by mx.google.com with ESMTPS id b17sm290957bkd.32.2011.08.31.02.38.32 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 31 Aug 2011 02:38:32 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de Date: Wed, 31 Aug 2011 11:38:31 +0200 Message-Id: <1314783511-1480-1-git-send-email-monstr@monstr.eu> X-Mailer: git-send-email 1.5.5.1 Subject: [U-Boot] [PATCH] bdinfo: Fix bdinfo to show all MACs for Microblaze and ARM X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de - Show all ethernet MACs in the system. - Show current ethernet device Signed-off-by: Michal Simek --- common/cmd_bdinfo.c | 32 ++++++++++++++++++++++++++++++-- 1 files changed, 30 insertions(+), 2 deletions(-) diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 6051120..01441de 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -153,6 +153,11 @@ 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[]) { +#if defined(CONFIG_CMD_NET) + struct eth_device *dev; + int i; +#endif + bd_t *bd = gd->bd; print_num("mem start ", (ulong)bd->bi_memstart); print_lnum("mem size ", (u64)bd->bi_memsize); @@ -164,7 +169,17 @@ 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); + i = 0; + while (1) { + dev = eth_get_dev_by_index(i); + if (dev) { + printf("eth%dname = %s\n", i, dev->name); + print_eth(i); + } else + break; + i++; + } + printf("current eth = %s\n", eth_get_name()); printf("ip_addr = %pI4\n", &bd->bi_ip_addr); #endif printf("baudrate = %ld bps\n", (ulong)bd->bi_baudrate); @@ -330,6 +345,9 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int i; bd_t *bd = gd->bd; +#if defined(CONFIG_CMD_NET) + struct eth_device *dev; +#endif print_num("arch_number", bd->bi_arch_number); print_num("boot_params", (ulong)bd->bi_boot_params); @@ -341,7 +359,17 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } #if defined(CONFIG_CMD_NET) - print_eth(0); + i = 0; + while (1) { + dev = eth_get_dev_by_index(i) + if (dev) { + printf("eth%dname = %s\n", i, dev->name); + print_eth(i); + } else + break; + i++; + } + printf("current eth = %s\n", eth_get_name()); printf("ip_addr = %pI4\n", &bd->bi_ip_addr); #endif printf("baudrate = %d bps\n", bd->bi_baudrate);