From patchwork Wed Jul 27 05:31:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 653090 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 3rzkD205bWz9t1f for ; Wed, 27 Jul 2016 15:33:06 +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=Ws/SisrO; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A52ECB3836; Wed, 27 Jul 2016 07:32:50 +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 Bipu27QU9tOr; Wed, 27 Jul 2016 07:32:50 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 562E53A42; Wed, 27 Jul 2016 07:32:24 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DF83AA75F8 for ; Wed, 27 Jul 2016 07:32:12 +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 NRIUvyc3N0vA for ; Wed, 27 Jul 2016 07:32:12 +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-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by theia.denx.de (Postfix) with ESMTPS id A1461A78CF for ; Wed, 27 Jul 2016 07:32:11 +0200 (CEST) Received: by mail-lf0-f65.google.com with SMTP id l89so1449111lfi.2 for ; Tue, 26 Jul 2016 22:32:11 -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=Ws/SisrOErBnxiDRgczSBH7OqdKrPCJpGVIb+s0QzKH/cS324xadc4WPzdsxlUlzUP TKDjtVXpTvaE9CqjIoj0U3kP8WLVY+KqaBxNG6vfZS4+BG6+D4WbzPaYARR3+KxUO0ml JR90HE9+8IWxQkwcwhXp2tm57Zw8BAzuoH+UtEoEl0kchLHiSLWKvRwt1UimMzTMGDmj a9tUwIsUSvmRPxKzcmLtoKUvRaM/v9BtHoRpTF2nqnfBSUJPazL2/7Z6yu2RmRg1qnWR 7ZpvQ8anHtKbPgU2wKo4k8SzSSxvaGbDlGaUwqf4xdul0D+OiuFpgMmvrxcgcfW3zH2G 3lVQ== 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=lI0hVvlryIDAtoIN8yN77W3A5jPgY1M9lKDDcUfsgdpBEyk7IxQEMDXn0+JwoCyYwr fQ9aR0cVyX41jPvpEl8Nej/GhlRWpA2OnTMbbvLD+My6sUukiUXOPFxRCYBB5NMlqQy5 QYM+JqSqaL80EWK6TmgZm23PeuwzTqdmlAXvnbNopynZVS+pBba4AifSlKZbfv8KrWiB ZIv9Njdneiw7UV2AhB34h9xV9fNEKM9Y6CKaP1kh8a5ZNKvXF2FCZd9CIIuVuuXcMo8d TYPUKeP5H2hIM5ZAdjLkFL0WYR0FyrMgGEGbVLYmFPkyUHVYMIxwPwXCBk3+TgnaqCQK BO2w== X-Gm-Message-State: AEkoousPFbaiRST2AzGjkEknrWMNUxyh7/qcuje1ad7aWS7huct8EJgJPXJhZoJ7XenDAA== X-Received: by 10.25.159.205 with SMTP id i196mr10993929lfe.45.1469597531177; Tue, 26 Jul 2016 22:32:11 -0700 (PDT) Received: from octofox.metropolis ([5.19.183.212]) by smtp.gmail.com with ESMTPSA id d11sm667109lfe.13.2016.07.26.22.32.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Jul 2016 22:32:10 -0700 (PDT) From: Max Filippov To: u-boot@lists.denx.de Date: Wed, 27 Jul 2016 08:31:51 +0300 Message-Id: <1469597511-19760-8-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1469597511-19760-1-git-send-email-jcmvbkbc@gmail.com> References: <1469597511-19760-1-git-send-email-jcmvbkbc@gmail.com> Subject: [U-Boot] [PATCH 7/7] 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; }