From patchwork Mon Jun 17 07:31:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 615 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id DA5EA3F353 for ; Mon, 17 Jun 2019 09:38:52 +0200 (CEST) Received: by mail-pf1-f199.google.com with SMTP id 145sf6538721pfv.18 for ; Mon, 17 Jun 2019 00:38:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560757131; cv=pass; d=google.com; s=arc-20160816; b=P27NGJqpUKPXH/U41mcJVthdXwasfoLPhNZdmPKoonmJYgLpl+/sv2XKQaX6oXLDF9 FVudRrePv32YosBQreKvGBFSPdHgwyzBpNrTztynUF/zdr8h5UZMJSkY0FobKYbdU/jZ +mYBnETKgB2u9zMOx0Y0z6RFe8o4loOIfcMdzL8EaSmWDNQG6lM8QQpk/IP6wWOpoNky PHc6QXcag3Fv1yG2GG1+nHpG16MxEJ/ErWipYG2tUNmSZz6QTOQMHZBKZjWpUOz77yW7 InoI1SFBwnDN3CZKRhmqNvhxlQrRjrIrjumbk+2H/aHpTeQVzqK4NI0zXvS5EAvuKB9N ptfw== 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=nqjim3+SS3L8iqxT5FMueXkw4uPorWKbeEXvEOulkpdI29uK56nZ4xNqjebcl0bi7Q RYludK4hip6Q0w99QwGEs4OJ/UJiNl3K8wZbnd5uZF+02TjwJ5nB2vLLhaYe2kxOhqbP RfPc1BSIXY/T7f4vfB/qDmH1yIbiS5eIzpKy3Dw41tkCmSxVkIjWABwWrbrmv8QYRxYm MtWsNCqZuuqeFw3HsNjePrnTCkGM8vzt1woBA4YLk/dYlDDzvQJ0MOC2OiXXG7B5Ea2G om4CsE7E+kJjJtdJlrme3slW2ixy0iHEHUFdyhbrY6YPHVEii84jXuYiYvjfvjQISXut /QMQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=fJLZyOKv; 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=a9smgNE2iPptREx5noym7kqTNpX2eyiNX6TqC7T7t7kMhXfLZHUyr5WfGqH7ZiH17m e2Pn+832EJ3eLfZrH99BJi3Uk0VaOybgEE69sFrJsYRcjLSzqqezwla2bk9gUDvv5wpU pucL+h5ADf475YQjNjOsgeTIMd239n0haswiY= 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=nAUDkyuljVgVKlqSTdT5lcEYSdAkKagysjrzuja+j/hknFzq6PBYveeDgyyICdoyx6 UunPktSaUJP2PKWfxZCQT2oKeaQX2mHA1gZwOfRN1j62S6e/pCAat/QUEnZYCgmet0Ps IaBRJW9fL67DTLCoJZLfTmv6KDZBdnagXlqhi2SydLmKo5x9RQM+9HSZOoU4Ep6yMGXX XNm6U5fVuMfYhvEZZjke++W6200UFV5tAG2FWJkLevFn4EgJwpTKSFd4sLdbrKMunSvR Snv8XZEs/GP9lIDi8Lh00ioh13hQmSFvdhPZC5kTRSMFi9CJ1rhZZiZMwfQEik3293dh 65ng== X-Gm-Message-State: APjAAAUeiP3oI1ObabCKqzA/05ObczMJe/dfEP4q7tv4dcjUEuhJoCCR wGAYnJILqoTjvmuJK2ZvZElv+HE4 X-Google-Smtp-Source: APXvYqzXunA7zEwkN1fy5qvoknA9I2edlDiA8baTG/oAnlzXzwR8tsPHsQeLxn+RnaDVlE5OPKikSA== X-Received: by 2002:a17:902:f01:: with SMTP id 1mr105769886ply.170.1560757131742; Mon, 17 Jun 2019 00:38:51 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:e444:: with SMTP id i4ls3587062pgk.13.gmail; Mon, 17 Jun 2019 00:38:51 -0700 (PDT) X-Received: by 2002:a63:140c:: with SMTP id u12mr47889370pgl.378.1560757128157; Mon, 17 Jun 2019 00:38:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560757128; cv=none; d=google.com; s=arc-20160816; b=PL9yWyPu7oDcgV1NLi9kpSj21/KYY/kfA+BKcHIoYxZG7iStPoRDLOSHuoj4+2p2dy qr6NzI7Z/dJZe9Ksv8pXtcEm+vZ/qvZ249gIne5MsVQmbfqdLZz9OnGsV2Rk3YKnLa4o VIvm+nvyHpQkVmSj7FTwh238f9uB7+jQB5P9jTW1WOQ3H28awAupL2Nc+caJWIKsAZo+ 8z47i0w42d2PreQLUHu2n0vLTdzpx/aT7mDRo0k8hZdICGyKHBy1+MgJaNgpxVY6qycC GBSrml1peGg8yOGFrPw12KP3Va3GJqLinSlIS/kTaNkgKrXHE0hRVaCQlm0CSgPyZZ1V Q4GA== 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=Xhx7j6K5B63BovaQ33ijHRPGXfe6JSHKnBmKuvzERhih8yq3DtkLBdLiUWyP2VgSMF BXTr4ZG3WIRYI1yqNoDQReOWJasvf/y+qrGfVgDF7IfCWVr4KrMpfrvfIZBTXYrlRZHK W43pQJFx79uL9nm1v9z5DxYP3On+1T5kG+oflYSfkNXMiSA0Oy3IdA05nLCVV1ITxFYN iyNVFPUg7cjvFgLbqtnMsrxts/26zlQZgmIHZY0bgzh+6pGHYVwsARMg5u5bj4uzOLDX 6WRS/QSlrI1dG37ssRSNQSlK/tyQMlGlvweRrOaMkviZygf/NRh93CzROjZVVNDrHtit gcgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=fJLZyOKv; 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 m65sor11066928pfm.66.2019.06.17.00.38.48 for (Google Transport Security); Mon, 17 Jun 2019 00:38:48 -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:a63:5961:: with SMTP id j33mr30677877pgm.89.1560757127788; Mon, 17 Jun 2019 00:38:47 -0700 (PDT) Received: from localhost.localdomain ([49.206.203.245]) by smtp.gmail.com with ESMTPSA id m41sm15205998pje.18.2019.06.17.00.38.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jun 2019 00:38:47 -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 v2 44/99] debug_uart: Add printdec Date: Mon, 17 Jun 2019 13:01:57 +0530 Message-Id: <20190617073252.27810-45-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190617073252.27810-1-jagan@amarulasolutions.com> References: <20190617073252.27810-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=fJLZyOKv; 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 --- 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) \ { \