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: 494 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 0B29D3F08F for ; Tue, 11 Jun 2019 16:54:45 +0200 (CEST) Received: by mail-pg1-f198.google.com with SMTP id b10sf5012746pgb.22 for ; Tue, 11 Jun 2019 07:54:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560264883; cv=pass; d=google.com; s=arc-20160816; b=n9AKjoyf4au4NDj3gzFjH75LObyuhVgn547bkJJ4biUIHRmleDLGWHvwcgQCcWZAVt 302kJHOxW3mq8YmINpUoPK3keLRDNpN89earC9+9v9SFrt8eK/4W5KP7YDrmGgdrO+IS j1ifxFrObdoMagD9mIlEUNavykYSYUhcUUstt1qSsumahPJIG+3EgOzURIMQUp9iPJf6 vn8LPz7PG/1j84K7cpnIqfkUsqjSBuN4BWRLSDgodRgbqFDfSxblAT/NBujCZr8QoXaX xmd1QNZxI+RVK3x5CizOw4H0PZdAStNiMx0MEcPpPTW4NCW3z4S2jTFh+XTiwtKoXfcY foLQ== 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=TqyqQo8my5uHeJNevgPA8idh7C7Jz1v52zDhfmoh/poVwmdjQxqWfuD+2NavB92SwS Z8HGrZ8IaStLHqFalpnDaNnvVHxCEpUUgNA+KIrAKPl+JLlrz/hGKpi/H6QbD1GQlG8L dU7WR7WyFQ7wYiQH7IXfuBH2n0fxWjQT8pncNYNC4Oi+dST8Yv0wc/r6HukpL3MkHIic Hh5G9bV7dX/8wi51aU7+bIrvtHQ0D1F3/E+DXebCdlTbtA892OD6nbx/9IyVyzplAFKa zouVgJNh5nVBtYiHCLc8K5UVmCEfOYW87C/zxpbgdU3hTSSR+drHpGyNZb1n/fGn4buu X8cg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=KrImql71; 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=B2Z2nKUI1Zkr8Mo2Doh4DtvP/5/mQtZFFr87cocAfQUWKfyWIgmgRoUEZnl7Ql1s8V Mj6QoIQGWMwItpE22Nwv07JvAiEp35TcuW/Ps65IQKwndENNnXCGp+gsqnV2ljnYLNoq AGuX5ShIG1U5wsjHImQkkjjvStuJm/Wb12fWc= 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=FX2vxe6YlaLN0DxbQchaHq12hhTMsCU7Af4EAmFJcalOHDWR19kH2eS/hfqHOjuFaa ihkhgvIiT5+boTcy4bkwAh0FLhwCChGcuPzjRwXUVcuJjRzM3Bm81Xnn9TD/z+gnC3i7 p1KvvD64D37o0k06uh+dMvWYY/hqXDBynvPWOWibzkidqfQT+G+LfCVHv7Njr+KtfL7T kuLr4mEjzUZwQbMJ/itEEstigjz0W6BPUEo6px2QrXoqCj0lSUshgel+mNla/FliL1It DqkWkPhXLKNMgJSRjvCjnj6Gb8iRxhYedCS7tuypum1gpUp+DpO/ZLaOwdPyf2FDEXVM 1pzA== X-Gm-Message-State: APjAAAUIlVc9GK7+bGgv6OChES3K8rgiaHAijw92zqcHLL8dUVxqf/nL HCdwTUbtBtyNNJMFOyq2Ky/73I0S X-Google-Smtp-Source: APXvYqyPUxl6Hubmzt/lLL/ADPtMRg2y9uMXqdOJ8C3XrUHE8rA9LHxch/Pu2o0Gr2XcX0P8ura+vQ== X-Received: by 2002:a62:a509:: with SMTP id v9mr79308282pfm.82.1560264883874; Tue, 11 Jun 2019 07:54:43 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:8593:: with SMTP id m19ls861096pjn.2.canary-gmail; Tue, 11 Jun 2019 07:54:43 -0700 (PDT) X-Received: by 2002:a17:902:a5c5:: with SMTP id t5mr77742349plq.288.1560264883593; Tue, 11 Jun 2019 07:54:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560264883; cv=none; d=google.com; s=arc-20160816; b=gibRDLvpIL4MjR/dv8Jw4aXbvOOSlQXxG0ADgFhOY2PtZr2PBKfjjlV1Pc5Q1FefKI plUKIdN2eO8nLyo5gMVQ3ItoUcmfQEUiHDzhXeN1q/SgjcXhtmD3sY+OUqsMYj71UkOu gw2GmuHjSQieRzOGM6BpXZxqW0NM/r5fQsMXRDd4cn6Zk6nHku3Z+M5i0XBLvLU9WvmM x5XMXLcKS3HwMfNLI+hUoPz2A1XWAP+/QBF8ZOCuQ02TF59HmiUfvDdZDrPhdgbxApwW DrIIMS5cDGISG977PH48m2GYaVFhJF8lmVMnBqFXVNAWuHe8sia4bHSx3AhNLms4XuOu uB4g== 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=ptYsgbA5zMczBx0j9eW9BQMME/9rTXnoZ9Unf//WvUsv/4Kz06tMVIg2drElhe3k6E 6TCLOVWO5FZRvyIqQJmUdYL2fJNhqZfuA7etbZVcXoBhUdSE1p9UuNb05jsr5rL+fjgl E4hCzha5aZOanfu2Mnap1FJq5Y2P6V36J1aQDAZ9Xt3gAEVKJQbb+FEEHVvU1BYEtxei 3oD3Z8OgsJu3qth/Gpeh+jcz2geguqD/HmEIO9ql6Dbv+uY0X9G1M2t2E5HCNijQbvYB wNkecqsVjjgwLvjKOCKae0RzFFiYNLQtrnxIGeHinnm/WzP11jIKi4LPTqkqGXlPNiJN /O1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=KrImql71; 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 b65sor13296937pfa.19.2019.06.11.07.54.43 for (Google Transport Security); Tue, 11 Jun 2019 07:54:43 -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: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 Cc: gajjar04akash@gmail.com, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 43/92] debug_uart: Add printdec 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 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=KrImql71; 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) \ { \