From patchwork Wed Jul 27 05:27:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 653083 X-Patchwork-Delegate: trini@ti.com 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 3rzk8c6L62z9t1c for ; Wed, 27 Jul 2016 15:30:08 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=ZbcR5XbM; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2AE903A66; Wed, 27 Jul 2016 07:29:26 +0200 (CEST) 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 jizWzzWQDR8e; Wed, 27 Jul 2016 07:29:25 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 738FF3A35; Wed, 27 Jul 2016 07:29:07 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D78323A2A for ; Wed, 27 Jul 2016 07:28:25 +0200 (CEST) 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 QbGV9xWjdPty for ; Wed, 27 Jul 2016 07:28:25 +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-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) by theia.denx.de (Postfix) with ESMTPS id 1EF4CA75BC for ; Wed, 27 Jul 2016 07:28:09 +0200 (CEST) Received: by mail-lf0-f68.google.com with SMTP id f93so1452217lfi.0 for ; Tue, 26 Jul 2016 22:28:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oo7rPFYFCNtu6DGw6OAXhTXKiUt8ewESte6AajSrvCM=; b=ZbcR5XbM56/lj98XtjILiLgcqEl9yJAoeI1H0VH09BirUMkFvTbrgX97QodDa05KxC X+1rR/ILLnyY3u6CfRr0CedlXJTHYzuY7HUWJnRr6qZG+yIU/MeHp7RftiRA7gn9dR1P 3yhfiVfNZIFXEbJ5d58rmym0tAXVswfD6s98MeLnb0Tv89NoNr3AVNEZu2hNhvvIqUda G0FFxFfzjAIHNtvcBhHoXM0H69zeGt0xeUCQ7vSlDsqxYLRzhy2yjCI76CQ3YgjLDDc/ YXmb4pH7vBTFcQmy3f8EAsnRWSzl/EncfubVYIjKyVZt+c0Z8pOZA0NcxFwwPkpK6jTa faWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=oo7rPFYFCNtu6DGw6OAXhTXKiUt8ewESte6AajSrvCM=; b=CBFVjW2UedCBfMJXaUlsbbd+IQtbbHHIXmGrvicZTUekhzYcm0x3NACgO63TX2Q+O5 1ojgTzpuN8v3sz56sFL3AyL1F71AnXOWPTX5Wm+od09hjA8GyuFldUG4zdYtWKSzM5Yb Uh0WT4BwKgqF+LC9USlOh71b3kiBH8xhZ34kFDARjGI6SLlD9wSk1lpPGCcj/3R2stMq MMNg3T4k5VBHwboIwMBZgLdPBaOZsdKbv/v/HhLnifca0355nwbut95CWo14PgeJ9T3i T8yxF2CwB4NROhrRCQJtTuZbfeq0clfHCNvM6nA++ODYXT2FMI7hItRGnD1cv0CxJMu2 dM7g== X-Gm-Message-State: AEkooutBffE2814zEpuAh/QSWPMtomrrl8mydvPl4IkrC22LUP0Q2YXyxU432sQf/0cOuA== X-Received: by 10.25.211.130 with SMTP id k124mr11553229lfg.175.1469597288599; Tue, 26 Jul 2016 22:28:08 -0700 (PDT) Received: from octofox.metropolis ([5.19.183.212]) by smtp.gmail.com with ESMTPSA id d11sm664839lfe.13.2016.07.26.22.28.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Jul 2016 22:28:08 -0700 (PDT) From: Max Filippov To: u-boot@lists.denx.de Date: Wed, 27 Jul 2016 08:27:41 +0300 Message-Id: <1469597262-19671-13-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1469597262-19671-1-git-send-email-jcmvbkbc@gmail.com> References: <1469597262-19671-1-git-send-email-jcmvbkbc@gmail.com> Subject: [U-Boot] [PATCH 6/6] cmd/bdinfo: extract print_std_bdinfo X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" print_std_bdinfo outputs typical set of board information entries: boot params location, memory and flash addresses and sizes, network interfaces information and configured serial baud rate. Signed-off-by: Max Filippov --- cmd/bdinfo.c | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c index b4abb91..4210ae9 100644 --- a/cmd/bdinfo.c +++ b/cmd/bdinfo.c @@ -155,6 +155,15 @@ static inline void print_baudrate(void) #endif } +static inline void print_std_bdinfo(const bd_t *bd) +{ + print_bi_boot_params(bd); + print_bi_mem(bd); + print_bi_flash(bd); + print_eth_ip_addr(); + print_baudrate(); +} + #if defined(CONFIG_PPC) void __weak board_detail(void) { @@ -338,11 +347,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_mhz("CCLK", bd->bi_cclk); print_mhz("SCLK", bd->bi_sclk); - print_bi_boot_params(bd); - print_bi_mem(bd); - print_bi_flash(bd); - print_eth_ip_addr(); - print_baudrate(); + print_std_bdinfo(bd); return 0; } @@ -351,13 +356,7 @@ 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_bi_boot_params(bd); - print_bi_mem(bd); - print_bi_flash(bd); - print_eth_ip_addr(); - print_baudrate(); + print_std_bdinfo(gd->bd); print_num("relocaddr", gd->relocaddr); print_num("reloc off", gd->reloc_off); @@ -368,14 +367,7 @@ 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_bi_boot_params(bd); - print_bi_mem(bd); - print_bi_flash(bd); - print_eth_ip_addr(); - print_baudrate(); - + print_std_bdinfo(gd->bd); return 0; }