lkml.org 
[lkml]   [2019]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 11/14] serial: tegra: DT for Adjusted baud rates
Date
> -----Original Message-----
> From: Thierry Reding <thierry.reding@gmail.com>
> Sent: Tuesday, August 13, 2019 3:55 PM
> To: Krishna Yarlagadda <kyarlagadda@nvidia.com>
> Cc: gregkh@linuxfoundation.org; robh+dt@kernel.org;
> mark.rutland@arm.com; Jonathan Hunter <jonathanh@nvidia.com>; Laxman
> Dewangan <ldewangan@nvidia.com>; jslaby@suse.com; linux-
> serial@vger.kernel.org; devicetree@vger.kernel.org; linux-
> tegra@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH 11/14] serial: tegra: DT for Adjusted baud rates
>
> On Mon, Aug 12, 2019 at 04:58:20PM +0530, Krishna Yarlagadda wrote:
> > 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 <kyarlagadda@nvidia.com>
> > ---
> > .../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 187ec78..1ce3fd4 100644
> > ---
> > a/Documentation/devicetree/bindings/serial/nvidia,tegra20-hsuart.txt
> > +++ b/Documentation/devicetree/bindings/serial/nvidia,tegra20-hsuart.t
> > +++ xt
> > @@ -20,6 +20,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.
> > + <range_low range_high 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.
>
> The above sounds like the tolerance deviation is a characteristic of the
> Tegra186 chip. If the board design does not influence the deviation, why
> can't we encode this in the driver? Why do we need a description of this in
> device tree?
>
> Thierry
>
Tolerance is chip specific and info regarding this is part of chip data.
Explained it here to set context for adjusting baud rates based on slave device
as below. Slave device clock might not be accurate and if the actual clock of
slave device would end up out of tolernace range then we will see frame errors.

KY
> > +
> > + 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:
> >
> > @@ -34,4 +65,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
> >

\
 
 \ /
  Last update: 2019-08-27 11:32    [W:0.090 / U:19.072 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site