From patchwork Wed Jul 27 05:27:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 653079 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 3rzk7t2TnYz9t1l for ; Wed, 27 Jul 2016 15:29:30 +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=Kvgbf1YR; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AFB09B3834; Wed, 27 Jul 2016 07:28:58 +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 PxaEiaDGrCrw; Wed, 27 Jul 2016 07:28:58 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2EE75B3865; Wed, 27 Jul 2016 07:28:38 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A986CB3840 for ; Wed, 27 Jul 2016 07:28:14 +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 Qf862Adl2IsT for ; Wed, 27 Jul 2016 07:28:14 +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-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) by theia.denx.de (Postfix) with ESMTPS id 44533B380D for ; Wed, 27 Jul 2016 07:28:06 +0200 (CEST) Received: by mail-lf0-f67.google.com with SMTP id l89so1445657lfi.2 for ; Tue, 26 Jul 2016 22:28:06 -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=tzI4I+jZWOGV9JCChk7t1MAbKcgo9RuaSEI6hij3Nak=; b=Kvgbf1YRQ3D8XSDiB/99TIf2sOw9TGCcFM8ertC2tm8K7S+Xktw6MrYSCs0mt3wjRL xCGjwFOewybR5LBcflnKnAJ8baOLKeyivdJDz4Q/CqkYH9/PReRIuxGzC/mrI6KqcfMK 8hPWS61odTqfSlTdtoqLzkPn4BA6L+5p1hsBfozU7VcIIWCoavX+PlsRpHx9ozJxF8ct xk+M81j5+UIH8OlXtQpuF4w012n+/7okYLG5bwYLrkJWeBDVk51JNvYXIEsxJNdZ012B 8vKvevHX+xfFIfYgvjfDTPAGi6pr0jbf38/R+0+qXfqrfgwcecQsJDDd1O5uCjiI964k 5xIg== 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=tzI4I+jZWOGV9JCChk7t1MAbKcgo9RuaSEI6hij3Nak=; b=aytB4FZz6KTlwwMQEqFHJ9MR8ROraGDB89C2y5UFjQDcxA8anb68esaeaZhR/oCf4y WtQueAm5PNFMAYt9qLRUOqzetA8lq9CUmyEML5d3ZAvZoKf7gnmerIINM6+rb1EMroBb cQT8UtE9LoUlkaNemFmhGYHE1EEonSUhkahphZuIaqTyc7gz5BsJgkD71pkT5ETx4Jr7 BnbfianwS2zl0J5HhW3AC+mGrZPLEbPN1qyRuCrbgsqiHO/jn5okPzvYZj6fbLJYTf61 Fj+fT3qID1XsOR5lOHzmqDI7MY4f/csHCEnVNaKBuu1Dwl592oNSaQE5vq8BPIoOdONo CWRw== X-Gm-Message-State: AEkooutZ3b41IrPyaq1UAPFNcq8yvqCuRZNy4GfD0r5Bma1D/2z89yvRczfglNeQ7tUp0A== X-Received: by 10.25.215.35 with SMTP id o35mr11095164lfg.40.1469597285704; Tue, 26 Jul 2016 22:28:05 -0700 (PDT) Received: from octofox.metropolis ([5.19.183.212]) by smtp.gmail.com with ESMTPSA id d11sm664839lfe.13.2016.07.26.22.28.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Jul 2016 22:28:04 -0700 (PDT) From: Max Filippov To: u-boot@lists.denx.de Date: Wed, 27 Jul 2016 08:27:38 +0300 Message-Id: <1469597262-19671-10-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 5/6] cmd/bdinfo: extract print_baudrate 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_baudrate outputs serial baud rate. Signed-off-by: Max Filippov --- cmd/bdinfo.c | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c index ab56ea5..b4abb91 100644 --- a/cmd/bdinfo.c +++ b/cmd/bdinfo.c @@ -144,6 +144,17 @@ static inline void print_eth_ip_addr(void) #endif } +static inline void print_baudrate(void) +{ +#if defined(CONFIG_PPC) + printf("baudrate = %6u bps\n", gd->baudrate); +#elif defined(CONFIG_SPARC) + printf("baudrate = %6u bps\n", gd->baudrate); +#else + printf("baudrate = %u bps\n", gd->baudrate); +#endif +} + #if defined(CONFIG_PPC) void __weak board_detail(void) { @@ -202,7 +213,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) #endif print_eth_ip_addr(); - printf("baudrate = %6u bps\n", gd->baudrate); + print_baudrate(); print_num("relocaddr", gd->relocaddr); board_detail(); return 0; @@ -223,7 +234,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) #endif print_eth_ip_addr(); - printf("baudrate = %u bps\n", gd->baudrate); + print_baudrate(); return 0; } @@ -243,7 +254,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) #if defined(CONFIG_CMD_NET) && !defined(CONFIG_DM_ETH) print_eths(); #endif - printf("baudrate = %u bps\n", gd->baudrate); + print_baudrate(); print_num("relocaddr", gd->relocaddr); print_num("reloc off", gd->reloc_off); print_num("fdt_blob", (ulong)gd->fdt_blob); @@ -279,7 +290,7 @@ int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) GENERATED_GBL_DATA_SIZE); print_eth_ip_addr(); - printf("baudrate = %6u bps\n", gd->baudrate); + print_baudrate(); return 0; } @@ -309,7 +320,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_mhz("vcofreq", bd->bi_vcofreq); #endif print_eth_ip_addr(); - printf("baudrate = %u bps\n", gd->baudrate); + print_baudrate(); return 0; } @@ -331,7 +342,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_bi_mem(bd); print_bi_flash(bd); print_eth_ip_addr(); - printf("baudrate = %u bps\n", gd->baudrate); + print_baudrate(); return 0; } @@ -346,7 +357,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_bi_mem(bd); print_bi_flash(bd); print_eth_ip_addr(); - printf("baudrate = %u bps\n", gd->baudrate); + print_baudrate(); print_num("relocaddr", gd->relocaddr); print_num("reloc off", gd->reloc_off); @@ -363,7 +374,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_bi_mem(bd); print_bi_flash(bd); print_eth_ip_addr(); - printf("baudrate = %u bps\n", gd->baudrate); + print_baudrate(); return 0; } @@ -388,7 +399,7 @@ static int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, #if defined(CONFIG_CMD_NET) && !defined(CONFIG_DM_ETH) print_eths(); #endif - printf("baudrate = %u bps\n", gd->baudrate); + print_baudrate(); #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) print_num("TLB addr", gd->arch.tlb_addr); #endif @@ -423,7 +434,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_bi_mem(bd); print_bi_flash(bd); print_eth_ip_addr(); - printf("baudrate = %u bps\n", gd->baudrate); + print_baudrate(); return 0; } @@ -451,7 +462,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_eth_ip_addr(); print_mhz("ethspeed", bd->bi_ethspeed); #endif - printf("baudrate = %u bps\n", gd->baudrate); + print_baudrate(); return 0; } @@ -482,7 +493,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_bi_boot_params(bd); print_bi_dram(bd); print_eth_ip_addr(); - printf("baudrate = %u bps\n", gd->baudrate); + print_baudrate(); return 0; } @@ -496,7 +507,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_bi_mem(bd); print_bi_flash(bd); print_eth_ip_addr(); - printf("baudrate = %u bps\n", gd->baudrate); + print_baudrate(); return 0; } @@ -509,7 +520,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_bi_mem(bd); print_eth_ip_addr(); - printf("baudrate = %d bps\n", gd->baudrate); + print_baudrate(); return 0; }