18c2ecf20Sopenharmony_ciNVIDIA Tegra20/Tegra30 high speed (DMA based) UART controller driver.
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciRequired properties:
48c2ecf20Sopenharmony_ci- compatible : should be,
58c2ecf20Sopenharmony_ci  "nvidia,tegra20-hsuart" for Tegra20,
68c2ecf20Sopenharmony_ci  "nvidia,tegra30-hsuart" for Tegra30,
78c2ecf20Sopenharmony_ci  "nvidia,tegra186-hsuart" for Tegra186,
88c2ecf20Sopenharmony_ci  "nvidia,tegra194-hsuart" for Tegra194.
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci- reg: Should contain UART controller registers location and length.
118c2ecf20Sopenharmony_ci- interrupts: Should contain UART controller interrupts.
128c2ecf20Sopenharmony_ci- clocks: Must contain one entry, for the module clock.
138c2ecf20Sopenharmony_ci  See ../clocks/clock-bindings.txt for details.
148c2ecf20Sopenharmony_ci- resets : Must contain an entry for each entry in reset-names.
158c2ecf20Sopenharmony_ci  See ../reset/reset.txt for details.
168c2ecf20Sopenharmony_ci- reset-names : Must include the following entries:
178c2ecf20Sopenharmony_ci  - serial
188c2ecf20Sopenharmony_ci- dmas : Must contain an entry for each entry in dma-names.
198c2ecf20Sopenharmony_ci  See ../dma/dma.txt for details.
208c2ecf20Sopenharmony_ci- dma-names : Must include the following entries:
218c2ecf20Sopenharmony_ci  - rx
228c2ecf20Sopenharmony_ci  - tx
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ciOptional properties:
258c2ecf20Sopenharmony_ci- nvidia,enable-modem-interrupt: Enable modem interrupts. Should be enable
268c2ecf20Sopenharmony_ci		only if all 8 lines of UART controller are pinmuxed.
278c2ecf20Sopenharmony_ci- nvidia,adjust-baud-rates: List of entries providing percentage of baud rate
288c2ecf20Sopenharmony_ci  adjustment within a range.
298c2ecf20Sopenharmony_ci  Each entry contains sets of 3 values. Range low/high and adjusted rate.
308c2ecf20Sopenharmony_ci  <range_low range_high adjusted_rate>
318c2ecf20Sopenharmony_ci  When baud rate set on controller falls within the range mentioned in this
328c2ecf20Sopenharmony_ci  field, baud rate will be adjusted by percentage mentioned here.
338c2ecf20Sopenharmony_ci  Ex: <9600 115200 200>
348c2ecf20Sopenharmony_ci  Increase baud rate by 2% when set baud rate falls within range 9600 to 115200
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ciBaud Rate tolerance:
378c2ecf20Sopenharmony_ci  Standard UART devices are expected to have tolerance for baud rate error by
388c2ecf20Sopenharmony_ci  -4 to +4 %. All Tegra devices till Tegra210 had this support. However,
398c2ecf20Sopenharmony_ci  Tegra186 chip has a known hardware issue. UART Rx baud rate tolerance level
408c2ecf20Sopenharmony_ci  is 0% to +4% in 1-stop config. Otherwise, the received data will have
418c2ecf20Sopenharmony_ci  corruption/invalid framing errors. Parker errata suggests adjusting baud
428c2ecf20Sopenharmony_ci  rate to be higher than the deviations observed in Tx.
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci  Tx deviation of connected device can be captured over scope (or noted from
458c2ecf20Sopenharmony_ci  its spec) for valid range and Tegra baud rate has to be set above actual
468c2ecf20Sopenharmony_ci  Tx baud rate observed. To do this we use nvidia,adjust-baud-rates
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci  As an example, consider there is deviation observed in Tx for baud rates as
498c2ecf20Sopenharmony_ci  listed below.
508c2ecf20Sopenharmony_ci  0 to 9600 has 1% deviation
518c2ecf20Sopenharmony_ci  9600 to 115200 2% deviation
528c2ecf20Sopenharmony_ci  This slight deviation is expcted and Tegra UART is expected to handle it. Due
538c2ecf20Sopenharmony_ci  to the issue stated above, baud rate on Tegra UART should be set equal to or
548c2ecf20Sopenharmony_ci  above deviation observed for avoiding frame errors.
558c2ecf20Sopenharmony_ci  Property should be set like this
568c2ecf20Sopenharmony_ci  nvidia,adjust-baud-rates = <0 9600 100>,
578c2ecf20Sopenharmony_ci  			     <9600 115200 200>;
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ciExample:
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ciserial@70006000 {
628c2ecf20Sopenharmony_ci	compatible = "nvidia,tegra30-hsuart", "nvidia,tegra20-hsuart";
638c2ecf20Sopenharmony_ci	reg = <0x70006000 0x40>;
648c2ecf20Sopenharmony_ci	reg-shift = <2>;
658c2ecf20Sopenharmony_ci	interrupts = <0 36 0x04>;
668c2ecf20Sopenharmony_ci	nvidia,enable-modem-interrupt;
678c2ecf20Sopenharmony_ci	clocks = <&tegra_car 6>;
688c2ecf20Sopenharmony_ci	resets = <&tegra_car 6>;
698c2ecf20Sopenharmony_ci	reset-names = "serial";
708c2ecf20Sopenharmony_ci	dmas = <&apbdma 8>, <&apbdma 8>;
718c2ecf20Sopenharmony_ci	dma-names = "rx", "tx";
728c2ecf20Sopenharmony_ci	nvidia,adjust-baud-rates = <1000000 4000000 136>; /* 1.36% shift */
738c2ecf20Sopenharmony_ci};
74