From patchwork Wed Jul 27 05:27:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 653084 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 3rzk8q4lX5z9t1c for ; Wed, 27 Jul 2016 15:30:19 +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=Cn2PDaz+; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7DEADA75F2; Wed, 27 Jul 2016 07:29:31 +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 vDbHF73Qji_K; Wed, 27 Jul 2016 07:29:31 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A4B5F3A42; Wed, 27 Jul 2016 07:29:09 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2600E3A36 for ; Wed, 27 Jul 2016 07:28: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 2HIHbEIVwMmr for ; Wed, 27 Jul 2016 07:28:26 +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 1A858A755F for ; Wed, 27 Jul 2016 07:28:08 +0200 (CEST) Received: by mail-lf0-f65.google.com with SMTP id 33so1446263lfw.3 for ; Tue, 26 Jul 2016 22:28:08 -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=Cn2PDaz+3k7PQw7rgOpeMIscx5wpEC4rwgcWow0EjMh6T8Q8kkbHK4tTngVGOYp1tY dErcyGtGfrKby65INU+ngbfm0oEgMl+E/TkywXzopXibs4JHj6J+DgnY9HIGy2Otz9W0 CRhtdSGfaIbFYkqli6Ys4+mu4SRDXIBE++Hw4psCttEtQwI7w55EFNSP7ou74yAzz0Cd yMBJ6is/aUxuQlzXYCObMXpkSZ5XzICRrrBH2sGScw8KqBpen+87GYOtpGoQUkyW8wMh mAjf23J9AFaTMc4TkLdZf9VkllCjpX3d2g50FVGFTBZWdQ3cNPk+7uHUcNK4RKQrKTa+ QFeA== 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=gpJESpo116DvTIDBDLD/p/hz9YAKfmVVKNv7/LzTxZ4UFeEEhObWeSigFaXa/Fr+af OsnEt4ebi7BXSJNKJk48no5751VwFR2wm5ZxDkVfH4MwYs86jUiacKkwrYCS1+0SG03M sGiA/+gD2r2yvrpmh9zlgXx5l5S1XQ6FM6e9az29UBl65D/AYXBI9JFWHyZ8uqdU8QVm IU0eakPHTT8JTnyPcJZocCamlWmvOqvgeFMyMwBCrYNrcMri3VhA/anoIhfvU42VrSb5 +zeMf3g2d2PnoK5zviPrornEfZwjtF8vtkk933nEQjxq/a0VFhv5KWWMwebc1lbSqjIY B0DA== X-Gm-Message-State: AEkoouu/EKnbXt1mww2S8Y55RzbZehfHSWs4tYsIs4pTuVnU0Fdfl4VTQbuU08ylO/lm2g== X-Received: by 10.25.138.5 with SMTP id m5mr9629941lfd.213.1469597287574; Tue, 26 Jul 2016 22:28:07 -0700 (PDT) Received: from octofox.metropolis ([5.19.183.212]) by smtp.gmail.com with ESMTPSA id d11sm664839lfe.13.2016.07.26.22.28.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Jul 2016 22:28:06 -0700 (PDT) From: Max Filippov To: u-boot@lists.denx.de Date: Wed, 27 Jul 2016 08:27:40 +0300 Message-Id: <1469597262-19671-12-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/7] 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; }