Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp237420ybe; Tue, 3 Sep 2019 21:45:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwY1jubIulzo4jw+nwJxfCB/eniYjR6PgrTjfUMOpjiglXo52RJV6G9vJfYVikDkMtZg5zi X-Received: by 2002:aa7:8b46:: with SMTP id i6mr3629383pfd.190.1567572331293; Tue, 03 Sep 2019 21:45:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567572331; cv=none; d=google.com; s=arc-20160816; b=QgZow5S36ON80RZpekzDu1eypkBwZggG6EiM/1tzfalqLNtP/MimvUjpuCgdOJbaGU +oUmwXkvVQXXy+3+RHjdBnlcGrrbMvfTDHcFxB8n0D34SusVnUsUlxnHBPlrZsSdYszi YaC1x0Eiq0Dce9rQx2yVXmF0YlacW5RUc2nyq0MXvXI1oNKEdGbYDxbiwUeD3uXloVBp J5x2RyFrC4RPjj7NSLuWC41Ba728iWKWDMKgDR3imc09eMk10dSRcOyUcmRYxT0GghK/ 3NT1uOpBgchvUYx+a6eo/SEK0zkFOa/4+ABl78djQhIY6vdt9JxAEKOGZRAtWMSODtJ5 UUhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=37tpwjXHTaTmogSk3nHKTY+jDF6q184QLDv1MAycH/g=; b=PH4++EQwuOBNawnrwA3jfk+4DKetjuJTO+fPqe9OFLRNt4k/DKL7bIDBi80KRPwkFy 936b9xHfZ1Z/qa5podC6u1HhH7VcP0UzxeU/CPCZJ0c5LbHx/vkGL0jVXQghmQmfFT4f iDp7fmqMD15PJEMwA52wLc9hQVd4Dsyh6C4Iqqv+rsXrkP9q+oKC8h29sXqRdeeeGxEw LRFdE33r8vrQEhoOhy83Rv5QfV8yGVSATe9RIY1Lcg3acuFJELcDpl7NH0HdZE8tTAYv rH1H7md5lFjKuxJn6BuQcG01H5fF/nAwW2rzr9eq7DxKuzhAS1zgiSjaOCwMxyUC45iM 09Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=kIcYNNhA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q10si110001pll.186.2019.09.03.21.45.15; Tue, 03 Sep 2019 21:45:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=kIcYNNhA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728836AbfIDEnx (ORCPT + 99 others); Wed, 4 Sep 2019 00:43:53 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:7342 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728744AbfIDEnv (ORCPT ); Wed, 4 Sep 2019 00:43:51 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 03 Sep 2019 21:43:53 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 03 Sep 2019 21:43:50 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 03 Sep 2019 21:43:50 -0700 Received: from HQMAIL110.nvidia.com (172.18.146.15) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 4 Sep 2019 04:43:50 +0000 Received: from HQMAIL101.nvidia.com (172.20.187.10) by hqmail110.nvidia.com (172.18.146.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 4 Sep 2019 04:43:49 +0000 Received: from hqnvemgw02.nvidia.com (172.16.227.111) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Wed, 4 Sep 2019 04:43:49 +0000 Received: from kyarlagadda-linux.nvidia.com (Not Verified[10.19.64.169]) by hqnvemgw02.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Tue, 03 Sep 2019 21:43:49 -0700 From: Krishna Yarlagadda To: , , , , , , CC: , , , , "Krishna Yarlagadda" Subject: [PATCH V2 09/12] serial: tegra: DT for Adjusted baud rates Date: Wed, 4 Sep 2019 10:13:04 +0530 Message-ID: <1567572187-29820-10-git-send-email-kyarlagadda@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1567572187-29820-1-git-send-email-kyarlagadda@nvidia.com> References: <1567572187-29820-1-git-send-email-kyarlagadda@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1567572234; bh=37tpwjXHTaTmogSk3nHKTY+jDF6q184QLDv1MAycH/g=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=kIcYNNhAit+pLMJ+oUE8VswIDw2QtLsUdws2HFXIPhQr6YKSaugYFhErdR8FSK3wq UBRQXCo8xvViaX3v77pGQl1YGjbt38EbV/Vjck5Ig1SDBTQ/kXavoGalwQ4qMZ+m4+ szu7yihRyN9rBpexUD0lqNMkHCdd9eRRCFtbaQ3lGyVIsu2fkwXdjEfIIA1SS5BQID Kc371UmAzPTNp33gQz3iYHLDw2VtUUVGV/MAzypD39Rs9ajMUBgsUkRqwd2A2Ggbp+ 4HSsPIRF4lss3EPaxPsAzQaW9mMUffofSSTOpZNDyPAnhNkxGXhUul1Eg0Wh8J4k4C xU8i5H6Oaq4FA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tegra186 chip has a hardware issue resulting in frame errors when tolerance level for baud rate is negative. Provided entries to adjust baud rate to be within acceptable range and work with devices that can send negative baud rate. Also report error when baud rate set is out of tolerance range of controller updated in device tree. Signed-off-by: Krishna Yarlagadda --- .../bindings/serial/nvidia,tegra20-hsuart.txt | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Documentation/devicetree/bindings/serial/nvidia,tegra20-hsuart.txt b/Documentation/devicetree/bindings/serial/nvidia,tegra20-hsuart.txt index dab31d4..f709304 100644 --- a/Documentation/devicetree/bindings/serial/nvidia,tegra20-hsuart.txt +++ b/Documentation/devicetree/bindings/serial/nvidia,tegra20-hsuart.txt @@ -24,6 +24,37 @@ Required properties: Optional properties: - nvidia,enable-modem-interrupt: Enable modem interrupts. Should be enable only if all 8 lines of UART controller are pinmuxed. +- nvidia,adjust-baud-rates: List of entries providing percentage of baud rate + adjustment within a range. + Each entry contains sets of 3 values. Range low/high and adjusted rate. + + When baud rate set on controller falls within the range mentioned in this + field, baud rate will be adjusted by percentage mentioned here. + Ex: <9600 115200 200> + Increase baud rate by 2% when set baud rate falls within range 9600 to 115200 + +Baud Rate tolerance: + Standard UART devices are expected to have tolerance for baud rate error by + -4 to +4 %. All Tegra devices till Tegra210 had this support. However, + Tegra186 chip has a known hardware issue. UART Rx baud rate tolerance level + is 0% to +4% in 1-stop config. Otherwise, the received data will have + corruption/invalid framing errors. Parker errata suggests adjusting baud + rate to be higher than the deviations observed in Tx. + + Tx deviation of connected device can be captured over scope (or noted from + its spec) for valid range and Tegra baud rate has to be set above actual + Tx baud rate observed. To do this we use nvidia,adjust-baud-rates + + As an example, consider there is deviation observed in Tx for baud rates as + listed below. + 0 to 9600 has 1% deviation + 9600 to 115200 2% deviation + This slight deviation is expcted and Tegra UART is expected to handle it. Due + to the issue stated above, baud rate on Tegra UART should be set equal to or + above deviation observed for avoiding frame errors. + Property should be set like this + nvidia,adjust-baud-rates = <0 9600 100>, + <9600 115200 200>; Example: @@ -38,4 +69,5 @@ serial@70006000 { reset-names = "serial"; dmas = <&apbdma 8>, <&apbdma 8>; dma-names = "rx", "tx"; + nvidia,adjust-baud-rates = <1000000 4000000 136>; /* 1.36% shift */ }; -- 2.7.4