From patchwork Mon Jul 15 18:28:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 739 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id BB2763F08F for ; Mon, 15 Jul 2019 20:29:41 +0200 (CEST) Received: by mail-pg1-f199.google.com with SMTP id x19sf10991724pgx.1 for ; Mon, 15 Jul 2019 11:29:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563215380; cv=pass; d=google.com; s=arc-20160816; b=oKlf7VPuUvGB1UPIsiLGJHPlqg4eDdpRl7+Vx/AbE0/3B5mmI+h8sFa4Vj1tZ3CEHi cKfxUBs+WrZevKsLEMKg83f/4HtnUj+IbnWPvfAZs28jdC7xE828QmF1N/p/pkOhhldV vbMf5Bop4GJmSWlfm0bozmuSF9l1qgm0qgL2BGnHyjF2dwF3+rsZoipb4InP1GPkze7J JEmJcTYEJBm4x0T6/W/Tk5jsiWTbekkjXlk1PTBOjog+7Wz07QbxPKk3AMbei0a+5m3R cMLPpRWife0hYqdfu34/u07XQl2XAiY1THxPoRTf974k8cUZeJwdc1aFKgcJn5RFKoUY pb/Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=jN2P/uIhjH9C4BBOXz3A5tK9gssgvHRdgDpeLs9Qp2E=; b=WzdzGCmrvy8pZDHMQfCCOgCrW87tmU7v5cupohzA3oqH7tSR3vBOVGlmhhhHeNZAad S5uAn/D+v2szUG4JMOgxLQzHPH//Hy+eEjls7q4VV4eqSB1ORSxjQYoxR+vureWEVetH uZZuDH0sQoVxT5lXt5BJKrSp4Pb5SrjCvJk9BGJjq2aX2U4KLnJX4oSnJkJMWJO8wqJP D0VmdUibKZX66smyC3HX9sNf2ChYIBP9v6wLA66YAuIn0PN8HM+rkw7ep3W8WEdrgymR RYJlsFN3c80+IikYQzoCNVRYKnUWcr1LwoWRuMf/2XTfUtBEiw+oXfXRXQ7BgJkhOcz5 PyNA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qkxC6tw9; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com 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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=jN2P/uIhjH9C4BBOXz3A5tK9gssgvHRdgDpeLs9Qp2E=; b=jqeTKJHMKZvoYmWmlNFW5DimHwIMrwfV33uemubl5PLc+YAmaolqApkNnicwfxAYmG Kn7ozRq7jkE6Pu7XZJyXDMT/p8BD4pQgUUctiLfIFxf5x79WIF9ZPpsIY+mO2lO4OJ1+ HxTF55+X3UGWMkBUTS+uhGCGghwfLERi9s7Lc= 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=jN2P/uIhjH9C4BBOXz3A5tK9gssgvHRdgDpeLs9Qp2E=; b=Xm3VyqfReSscLkoZt/1J7+pYVuLYV/VUKiUTt/S1ySZC4nPv9fH1frg4z5z3zMom3b qdgE6uDZXBGaB1QsY6UTtIH6JTwEEfmANQ32iH0UzUjlY5afDDLDBNfDrJDSI7xDGM39 LW2Np3WIzsxEJgBMcf6ly6E5caJkd/jaH9akR90U9afY9dCHrS4r4GlVa7+0LhpK+jGL eyJolaNxGkMw8fL7MwELLNCiw5s7PA82eAr5M7ZrZPykW4HCMy0bz1avTdWU2xvYv8nD p0iqOsxsIfEnu3D7szV4iPXdWKKaqGBKTG+xOqC+ztTwcJ9rRunSg/ylvEUZKVCGfnaC J5Aw== X-Gm-Message-State: APjAAAXwqoVoYakLzTnCTtrRJBIkThLcjg/Jq8IYQ1DmloqK31LqhfIJ dATGt2EiZHymKIrbqy6uFBSVc9W6 X-Google-Smtp-Source: APXvYqwg3XSnbx7OGpmnhev0wSGJIu3DBMVrEcQg5dwrO2uWLunFl7UxUbLWZwv+ir21m8kdneg+wA== X-Received: by 2002:a17:90a:26ef:: with SMTP id m102mr30402354pje.50.1563215380615; Mon, 15 Jul 2019 11:29:40 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:3467:: with SMTP id o94ls6198393pjb.2.gmail; Mon, 15 Jul 2019 11:29:40 -0700 (PDT) X-Received: by 2002:a17:902:9a84:: with SMTP id w4mr29187835plp.160.1563215380248; Mon, 15 Jul 2019 11:29:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563215380; cv=none; d=google.com; s=arc-20160816; b=zukg07+rtADEE4S+MQIJTv6gmSKlnVstop1yn4Bc5oidKiVAQqVKvBCgctq5nun7q1 S1M5f3g7SuZXQgaYl6M0Iw4sm49v+AueGBdyXIXGYebbTY0TUuI380dTHjLT82omrPmn CZBU3Y+m8GKIMBB5oOx0/G8Lht8JirOZoEC3POYeolHEX4qCMloQcDfuWoOWevvwry5g lSFktkCe5Ol8RbrcoTyA7yCaYK3b3u1E/ckWsyWsIjW3b3F6EvX9MPJnJIu3z9uz5J+C 5QRoHX1hJVz9Oy2eoCxTu1bF4TNzd2lf/Pf10w48iBgqO2ybi2ySQo4k/rlgV0IxsPwX YbhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=7B3tbjY3n0ai6z9ObJzMBT9vy+XRoJe3mWhFKoigG/c=; b=hYVxiyDWBmuML2pXZEqGPUOeYoKveA7SayNuIyyaj6tkMg1BmwDwB/2aAx8QpOn+li 4For5+X7XoWWn2Y//R1UZj7kYy6AJAAf/8oThJuREj+CvTTAXJxRu16b+hoDR6kZh5pq uEDRdxc5ozcOzt4Udm8SRfLnAXu9TVQKyFNSsoqai6TQHF8v/Tn2PH/kFD2+i5YfHcmB r7LE7N0wT33CQEloB4c3ptBYENUn+Zzv10jSbYq0tbf4RqkfrVt9F4tXb69Wb3RN7Pb5 enPZQs1IM9ZumPUUFC6AmKONX3Lah8uFxPNHQpMahyXlQ3+46kFOwEd3aEwFnXd0FPXB EIFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qkxC6tw9; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id h63sor22726649pjb.6.2019.07.15.11.29.40 for (Google Transport Security); Mon, 15 Jul 2019 11:29:40 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:90a:c58e:: with SMTP id l14mr30620239pjt.104.1563215379950; Mon, 15 Jul 2019 11:29:39 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id y133sm20250075pfb.28.2019.07.15.11.29.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:29:39 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang , YouMin Chen , u-boot@lists.denx.de Cc: Manivannan Sadhasivam , gajjar04akash@gmail.com, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v3 09/18] debug_uart: Add printdec Date: Mon, 15 Jul 2019 23:58:47 +0530 Message-Id: <20190715182856.21688-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182856.21688-1-jagan@amarulasolutions.com> References: <20190715182856.21688-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qkxC6tw9; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add printdec, this would help to print an output a decimalism value. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen Reviewed-by: Kever Yang --- 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) \ { \