11e218a91SThierry Reding# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 21e218a91SThierry Reding%YAML 1.2 31e218a91SThierry Reding--- 41e218a91SThierry Reding$id: http://devicetree.org/schemas/serial/nvidia,tegra20-hsuart.yaml# 51e218a91SThierry Reding$schema: http://devicetree.org/meta-schemas/core.yaml# 61e218a91SThierry Reding 71e218a91SThierry Redingtitle: NVIDIA Tegra20/Tegra30 high speed (DMA based) UART controller driver 81e218a91SThierry Reding 91e218a91SThierry Redingmaintainers: 101e218a91SThierry Reding - Thierry Reding <thierry.reding@gmail.com> 111e218a91SThierry Reding - Jon Hunter <jonathanh@nvidia.com> 121e218a91SThierry Reding 131e218a91SThierry Redingproperties: 141e218a91SThierry Reding compatible: 151e218a91SThierry Reding oneOf: 161e218a91SThierry Reding - enum: 171e218a91SThierry Reding - nvidia,tegra20-hsuart 181e218a91SThierry Reding - nvidia,tegra30-hsuart 191e218a91SThierry Reding - nvidia,tegra186-hsuart 201e218a91SThierry Reding - nvidia,tegra194-hsuart 211e218a91SThierry Reding - items: 221e218a91SThierry Reding - const: nvidia,tegra124-hsuart 231e218a91SThierry Reding - const: nvidia,tegra30-hsuart 241e218a91SThierry Reding 251e218a91SThierry Reding reg: 261e218a91SThierry Reding maxItems: 1 271e218a91SThierry Reding 281e218a91SThierry Reding interrupts: 291e218a91SThierry Reding maxItems: 1 301e218a91SThierry Reding 311e218a91SThierry Reding clocks: 321e218a91SThierry Reding items: 331e218a91SThierry Reding - description: module clock 341e218a91SThierry Reding 351e218a91SThierry Reding resets: 361e218a91SThierry Reding items: 371e218a91SThierry Reding - description: module reset 381e218a91SThierry Reding 391e218a91SThierry Reding reset-names: 401e218a91SThierry Reding items: 411e218a91SThierry Reding - const: serial 421e218a91SThierry Reding 431e218a91SThierry Reding dmas: 441e218a91SThierry Reding items: 451e218a91SThierry Reding - description: DMA channel used for reception 461e218a91SThierry Reding - description: DMA channel used for transmission 471e218a91SThierry Reding 481e218a91SThierry Reding dma-names: 491e218a91SThierry Reding items: 501e218a91SThierry Reding - const: rx 511e218a91SThierry Reding - const: tx 521e218a91SThierry Reding 531e218a91SThierry Reding nvidia,enable-modem-interrupt: 541e218a91SThierry Reding $ref: /schemas/types.yaml#/definitions/flag 551e218a91SThierry Reding description: Enable modem interrupts. Should be enable only if all 8 lines of UART controller 561e218a91SThierry Reding are pinmuxed. 571e218a91SThierry Reding 581e218a91SThierry Reding nvidia,adjust-baud-rates: 591e218a91SThierry Reding $ref: /schemas/types.yaml#/definitions/uint32-matrix 601e218a91SThierry Reding description: | 611e218a91SThierry Reding List of entries providing percentage of baud rate adjustment within a range. Each entry 621e218a91SThierry Reding contains a set of 3 values: range low/high and adjusted rate. When the baud rate set on the 631e218a91SThierry Reding controller falls within the range mentioned in this field, the baud rate will be adjusted by 641e218a91SThierry Reding percentage mentioned here. 651e218a91SThierry Reding 661e218a91SThierry Reding Example: <9600 115200 200> 671e218a91SThierry Reding 681e218a91SThierry Reding Increase baud rate by 2% when set baud rate falls within range 9600 to 115200. 691e218a91SThierry Reding 701e218a91SThierry Reding Standard UART devices are expected to have tolerance for baud rate error by -4 to +4 %. All 711e218a91SThierry Reding Tegra devices till Tegra210 had this support. However, Tegra186 chip has a known hardware 721e218a91SThierry Reding issue. UART RX baud rate tolerance level is 0% to +4% in 1-stop config. Otherwise, the 731e218a91SThierry Reding received data will have corruption/invalid framing errors. Parker errata suggests adjusting 741e218a91SThierry Reding baud rate to be higher than the deviations observed in TX. 751e218a91SThierry Reding 761e218a91SThierry Reding TX deviation of connected device can be captured over scope (or noted from its spec) for 771e218a91SThierry Reding valid range and Tegra baud rate has to be set above actual TX baud rate observed. To do this 781e218a91SThierry Reding we use nvidia,adjust-baud-rates. 791e218a91SThierry Reding 801e218a91SThierry Reding As an example, consider there is deviation observed in TX for baud rates as listed below. 0 811e218a91SThierry Reding to 9600 has 1% deviation 9600 to 115200 2% deviation. This slight deviation is expcted and 821e218a91SThierry Reding Tegra UART is expected to handle it. Due to the issue stated above, baud rate on Tegra UART 831e218a91SThierry Reding should be set equal to or above deviation observed for avoiding frame errors. Property 841e218a91SThierry Reding should be set like this: 851e218a91SThierry Reding 861e218a91SThierry Reding nvidia,adjust-baud-rates = <0 9600 100>, 871e218a91SThierry Reding <9600 115200 200>; 881e218a91SThierry Reding items: 891e218a91SThierry Reding items: 901e218a91SThierry Reding - description: range lower bound 911e218a91SThierry Reding - description: range upper bound 921e218a91SThierry Reding - description: adjustment (in permyriad, i.e. 0.01%) 931e218a91SThierry Reding 941e218a91SThierry Redingrequired: 951e218a91SThierry Reding - compatible 961e218a91SThierry Reding - reg 971e218a91SThierry Reding - interrupts 981e218a91SThierry Reding - clocks 991e218a91SThierry Reding - resets 1001e218a91SThierry Reding - reset-names 1011e218a91SThierry Reding - dmas 1021e218a91SThierry Reding - dma-names 1031e218a91SThierry Reding 104*22088bbbSKrzysztof KozlowskiallOf: 105*22088bbbSKrzysztof Kozlowski - $ref: serial.yaml 106*22088bbbSKrzysztof Kozlowski 107*22088bbbSKrzysztof KozlowskiunevaluatedProperties: false 108*22088bbbSKrzysztof Kozlowski 1091e218a91SThierry Redingexamples: 1101e218a91SThierry Reding - | 1111e218a91SThierry Reding #include <dt-bindings/clock/tegra30-car.h> 1121e218a91SThierry Reding #include <dt-bindings/interrupt-controller/arm-gic.h> 1131e218a91SThierry Reding 1141e218a91SThierry Reding serial@70006000 { 1151e218a91SThierry Reding compatible = "nvidia,tegra30-hsuart"; 1161e218a91SThierry Reding reg = <0x70006000 0x40>; 1171e218a91SThierry Reding interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; 1181e218a91SThierry Reding nvidia,enable-modem-interrupt; 1191e218a91SThierry Reding clocks = <&tegra_car TEGRA30_CLK_UARTA>; 1201e218a91SThierry Reding resets = <&tegra_car 6>; 1211e218a91SThierry Reding reset-names = "serial"; 1221e218a91SThierry Reding dmas = <&apbdma 8>, <&apbdma 8>; 1231e218a91SThierry Reding dma-names = "rx", "tx"; 1241e218a91SThierry Reding nvidia,adjust-baud-rates = <1000000 4000000 136>; /* 1.36% shift */ 1251e218a91SThierry Reding }; 126