From patchwork Tue Jun 11 14:50:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1113955 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="KrImql71"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45NYdk56txz9s5c for ; Wed, 12 Jun 2019 01:22:18 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 33A56C2215B; Tue, 11 Jun 2019 15:17:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 5E701C22108; Tue, 11 Jun 2019 15:17:02 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A2254C22113; Tue, 11 Jun 2019 14:54:48 +0000 (UTC) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by lists.denx.de (Postfix) with ESMTPS id A34ECC21D8A for ; Tue, 11 Jun 2019 14:54:44 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id w34so7097113pga.12 for ; Tue, 11 Jun 2019 07:54:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7B3tbjY3n0ai6z9ObJzMBT9vy+XRoJe3mWhFKoigG/c=; b=KrImql71xcFNb0WrCWlI/09YP9UfP6n2nqcuwop+HGO/7Kjf8gN174M1Hg6A2dS6/n TWSTO3bjEmmqk4sU+n5/k93fJU1LnnvNn0mK+isML89vPiduUYiaL7VA0ZyJGSQYWTp0 6/zgxAWRPWPY2WT1ok2R3EjzOXnT9HcVLhKSU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7B3tbjY3n0ai6z9ObJzMBT9vy+XRoJe3mWhFKoigG/c=; b=SltzI0CZ4oHbgAQ4XOiMZfAWrqw04Fzh1oYvtNGMH7I1GAaF3COAMYVVT1/IjMMCoV cJu1tYcgUm/1zgS4ZHCWT4NmhR94bX9BAns+mTlxESA/bB6ZlFssX9peLVnOCCmnZseu clf0J9W34Beej8n40ZOIcgz7lDMgQ/hkKwtCPWhRigPoiSbzE0okJ57irQ5/vOMCe7HI G2qGJfp0o670jTG+wax/csTCAQX6txczGPxr7SACe0/lOxHD/CJrMOpVw14X2wpqzr5S SqXy7uzBdTMFxnaGdkiYWH74DmYtzaqDIvRUGYk5GXxSe6ssNH3Nih55x0CW7btEs9QG gRKQ== X-Gm-Message-State: APjAAAX9N6Dj4X9T3UqRioymQYJOsZ9b/RF0Zj8Oj5lpHsuGupXs5XDR DeZ4enypXKKHuinuxxi6duMJTidMb0I= X-Google-Smtp-Source: APXvYqwW6OnI5GUa388tzpomITQPH3HaGtsstNL697ul74RNs+IlCQYMNNtiplg8wWQ0UkKkRsYofQ== X-Received: by 2002:aa7:8083:: with SMTP id v3mr1852563pff.69.1560264883270; Tue, 11 Jun 2019 07:54:43 -0700 (PDT) Received: from localhost.localdomain ([115.97.180.18]) by smtp.gmail.com with ESMTPSA id e9sm16206208pfn.154.2019.06.11.07.54.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 07:54:42 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang , YouMin Chen , u-boot@lists.denx.de Date: Tue, 11 Jun 2019 20:20:46 +0530 Message-Id: <20190611145135.21399-44-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190611145135.21399-1-jagan@amarulasolutions.com> References: <20190611145135.21399-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Cc: linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, gajjar04akash@gmail.com Subject: [U-Boot] [PATCH 43/92] debug_uart: Add printdec X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add printdec, this would help to print an output a decimalism value. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen --- include/debug_uart.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/debug_uart.h b/include/debug_uart.h index 34e8b2fc81..cd70ae1a04 100644 --- a/include/debug_uart.h +++ b/include/debug_uart.h @@ -104,6 +104,13 @@ void printhex4(uint value); */ void printhex8(uint value); +/** + * printdec() - Output a decimalism value + * + * @value: Value to output + */ +void printdec(uint value); + #ifdef CONFIG_DEBUG_UART_ANNOUNCE #define _DEBUG_UART_ANNOUNCE printascii(" "); #else @@ -170,6 +177,18 @@ void printhex8(uint value); { \ printhex(value, 8); \ } \ +\ + void printdec(uint value) \ + { \ + if (value > 10) { \ + printdec(value / 10); \ + value %= 10; \ + } else if (value == 10) { \ + _debug_uart_putc('1'); \ + value = 0; \ + } \ + _debug_uart_putc('0' + value); \ + } \ \ void debug_uart_init(void) \ { \