xref: /freebsd/sys/contrib/device-tree/Bindings/serial/nvidia,tegra20-hsuart.yaml (revision b2d2a78ad80ec68d4a17f5aef97d21686cb1e29b)
1aa1a8ff2SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2aa1a8ff2SEmmanuel Vadot%YAML 1.2
3aa1a8ff2SEmmanuel Vadot---
4aa1a8ff2SEmmanuel Vadot$id: http://devicetree.org/schemas/serial/nvidia,tegra20-hsuart.yaml#
5aa1a8ff2SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6aa1a8ff2SEmmanuel Vadot
7aa1a8ff2SEmmanuel Vadottitle: NVIDIA Tegra20/Tegra30 high speed (DMA based) UART controller driver
8aa1a8ff2SEmmanuel Vadot
9aa1a8ff2SEmmanuel Vadotmaintainers:
10aa1a8ff2SEmmanuel Vadot  - Thierry Reding <thierry.reding@gmail.com>
11aa1a8ff2SEmmanuel Vadot  - Jon Hunter <jonathanh@nvidia.com>
12aa1a8ff2SEmmanuel Vadot
13aa1a8ff2SEmmanuel Vadotproperties:
14aa1a8ff2SEmmanuel Vadot  compatible:
15aa1a8ff2SEmmanuel Vadot    oneOf:
16aa1a8ff2SEmmanuel Vadot      - enum:
17aa1a8ff2SEmmanuel Vadot          - nvidia,tegra20-hsuart
18aa1a8ff2SEmmanuel Vadot          - nvidia,tegra30-hsuart
19aa1a8ff2SEmmanuel Vadot          - nvidia,tegra186-hsuart
20aa1a8ff2SEmmanuel Vadot          - nvidia,tegra194-hsuart
21aa1a8ff2SEmmanuel Vadot      - items:
22aa1a8ff2SEmmanuel Vadot          - const: nvidia,tegra124-hsuart
23aa1a8ff2SEmmanuel Vadot          - const: nvidia,tegra30-hsuart
24aa1a8ff2SEmmanuel Vadot
25aa1a8ff2SEmmanuel Vadot  reg:
26aa1a8ff2SEmmanuel Vadot    maxItems: 1
27aa1a8ff2SEmmanuel Vadot
28aa1a8ff2SEmmanuel Vadot  interrupts:
29aa1a8ff2SEmmanuel Vadot    maxItems: 1
30aa1a8ff2SEmmanuel Vadot
31aa1a8ff2SEmmanuel Vadot  clocks:
32aa1a8ff2SEmmanuel Vadot    items:
33aa1a8ff2SEmmanuel Vadot      - description: module clock
34aa1a8ff2SEmmanuel Vadot
35aa1a8ff2SEmmanuel Vadot  resets:
36aa1a8ff2SEmmanuel Vadot    items:
37aa1a8ff2SEmmanuel Vadot      - description: module reset
38aa1a8ff2SEmmanuel Vadot
39aa1a8ff2SEmmanuel Vadot  reset-names:
40aa1a8ff2SEmmanuel Vadot    items:
41aa1a8ff2SEmmanuel Vadot      - const: serial
42aa1a8ff2SEmmanuel Vadot
43aa1a8ff2SEmmanuel Vadot  dmas:
44aa1a8ff2SEmmanuel Vadot    items:
45aa1a8ff2SEmmanuel Vadot      - description: DMA channel used for reception
46aa1a8ff2SEmmanuel Vadot      - description: DMA channel used for transmission
47aa1a8ff2SEmmanuel Vadot
48aa1a8ff2SEmmanuel Vadot  dma-names:
49aa1a8ff2SEmmanuel Vadot    items:
50aa1a8ff2SEmmanuel Vadot      - const: rx
51aa1a8ff2SEmmanuel Vadot      - const: tx
52aa1a8ff2SEmmanuel Vadot
53aa1a8ff2SEmmanuel Vadot  nvidia,enable-modem-interrupt:
54aa1a8ff2SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/flag
55aa1a8ff2SEmmanuel Vadot    description: Enable modem interrupts. Should be enable only if all 8 lines of UART controller
56aa1a8ff2SEmmanuel Vadot      are pinmuxed.
57aa1a8ff2SEmmanuel Vadot
58aa1a8ff2SEmmanuel Vadot  nvidia,adjust-baud-rates:
59aa1a8ff2SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-matrix
60aa1a8ff2SEmmanuel Vadot    description: |
61aa1a8ff2SEmmanuel Vadot      List of entries providing percentage of baud rate adjustment within a range. Each entry
62aa1a8ff2SEmmanuel Vadot      contains a set of 3 values: range low/high and adjusted rate. When the baud rate set on the
63aa1a8ff2SEmmanuel Vadot      controller falls within the range mentioned in this field, the baud rate will be adjusted by
64aa1a8ff2SEmmanuel Vadot      percentage mentioned here.
65aa1a8ff2SEmmanuel Vadot
66aa1a8ff2SEmmanuel Vadot      Example: <9600 115200 200>
67aa1a8ff2SEmmanuel Vadot
68aa1a8ff2SEmmanuel Vadot      Increase baud rate by 2% when set baud rate falls within range 9600 to 115200.
69aa1a8ff2SEmmanuel Vadot
70aa1a8ff2SEmmanuel Vadot      Standard UART devices are expected to have tolerance for baud rate error by -4 to +4 %. All
71aa1a8ff2SEmmanuel Vadot      Tegra devices till Tegra210 had this support. However, Tegra186 chip has a known hardware
72aa1a8ff2SEmmanuel Vadot      issue. UART RX baud rate tolerance level is 0% to +4% in 1-stop config. Otherwise, the
73aa1a8ff2SEmmanuel Vadot      received data will have corruption/invalid framing errors. Parker errata suggests adjusting
74aa1a8ff2SEmmanuel Vadot      baud rate to be higher than the deviations observed in TX.
75aa1a8ff2SEmmanuel Vadot
76aa1a8ff2SEmmanuel Vadot      TX deviation of connected device can be captured over scope (or noted from its spec) for
77aa1a8ff2SEmmanuel Vadot      valid range and Tegra baud rate has to be set above actual TX baud rate observed. To do this
78aa1a8ff2SEmmanuel Vadot      we use nvidia,adjust-baud-rates.
79aa1a8ff2SEmmanuel Vadot
80aa1a8ff2SEmmanuel Vadot      As an example, consider there is deviation observed in TX for baud rates as listed below. 0
81*b2d2a78aSEmmanuel Vadot      to 9600 has 1% deviation 9600 to 115200 2% deviation. This slight deviation is expected and
82aa1a8ff2SEmmanuel Vadot      Tegra UART is expected to handle it. Due to the issue stated above, baud rate on Tegra UART
83aa1a8ff2SEmmanuel Vadot      should be set equal to or above deviation observed for avoiding frame errors. Property
84aa1a8ff2SEmmanuel Vadot      should be set like this:
85aa1a8ff2SEmmanuel Vadot
86aa1a8ff2SEmmanuel Vadot        nvidia,adjust-baud-rates = <0 9600 100>,
87aa1a8ff2SEmmanuel Vadot                                   <9600 115200 200>;
88aa1a8ff2SEmmanuel Vadot    items:
89aa1a8ff2SEmmanuel Vadot      items:
90aa1a8ff2SEmmanuel Vadot        - description: range lower bound
91aa1a8ff2SEmmanuel Vadot        - description: range upper bound
92aa1a8ff2SEmmanuel Vadot        - description: adjustment (in permyriad, i.e. 0.01%)
93aa1a8ff2SEmmanuel Vadot
94aa1a8ff2SEmmanuel Vadotrequired:
95aa1a8ff2SEmmanuel Vadot  - compatible
96aa1a8ff2SEmmanuel Vadot  - reg
97aa1a8ff2SEmmanuel Vadot  - interrupts
98aa1a8ff2SEmmanuel Vadot  - clocks
99aa1a8ff2SEmmanuel Vadot  - resets
100aa1a8ff2SEmmanuel Vadot  - reset-names
101aa1a8ff2SEmmanuel Vadot  - dmas
102aa1a8ff2SEmmanuel Vadot  - dma-names
103aa1a8ff2SEmmanuel Vadot
10484943d6fSEmmanuel VadotallOf:
10584943d6fSEmmanuel Vadot  - $ref: serial.yaml
10684943d6fSEmmanuel Vadot
10784943d6fSEmmanuel VadotunevaluatedProperties: false
10884943d6fSEmmanuel Vadot
109aa1a8ff2SEmmanuel Vadotexamples:
110aa1a8ff2SEmmanuel Vadot  - |
111aa1a8ff2SEmmanuel Vadot    #include <dt-bindings/clock/tegra30-car.h>
112aa1a8ff2SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
113aa1a8ff2SEmmanuel Vadot
114aa1a8ff2SEmmanuel Vadot    serial@70006000 {
115aa1a8ff2SEmmanuel Vadot        compatible = "nvidia,tegra30-hsuart";
116aa1a8ff2SEmmanuel Vadot        reg = <0x70006000 0x40>;
117aa1a8ff2SEmmanuel Vadot        interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
118aa1a8ff2SEmmanuel Vadot        nvidia,enable-modem-interrupt;
119aa1a8ff2SEmmanuel Vadot        clocks = <&tegra_car TEGRA30_CLK_UARTA>;
120aa1a8ff2SEmmanuel Vadot        resets = <&tegra_car 6>;
121aa1a8ff2SEmmanuel Vadot        reset-names = "serial";
122aa1a8ff2SEmmanuel Vadot        dmas = <&apbdma 8>, <&apbdma 8>;
123aa1a8ff2SEmmanuel Vadot        dma-names = "rx", "tx";
124aa1a8ff2SEmmanuel Vadot        nvidia,adjust-baud-rates = <1000000 4000000 136>; /* 1.36% shift */
125aa1a8ff2SEmmanuel Vadot    };
126