xref: /linux/Documentation/devicetree/bindings/serial/samsung_uart.yaml (revision 7f71507851fc7764b36a3221839607d3a45c2025)
1# SPDX-License-Identifier: GPL-2.0
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/serial/samsung_uart.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Samsung S3C, S5P, Exynos, and S5L (Apple SoC) SoC UART Controller
8
9maintainers:
10  - Krzysztof Kozlowski <krzk@kernel.org>
11  - Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12
13description: |+
14  Each Samsung UART should have an alias correctly numbered in the "aliases"
15  node, according to serialN format, where N is the port number (non-negative
16  decimal integer) as specified by User's Manual of respective SoC.
17
18properties:
19  compatible:
20    oneOf:
21      - enum:
22          - apple,s5l-uart
23          - axis,artpec8-uart
24          - google,gs101-uart
25          - samsung,s3c6400-uart
26          - samsung,s5pv210-uart
27          - samsung,exynos4210-uart
28          - samsung,exynos5433-uart
29          - samsung,exynos850-uart
30          - samsung,exynos8895-uart
31      - items:
32          - enum:
33              - samsung,exynos7-uart
34              - tesla,fsd-uart
35          - const: samsung,exynos4210-uart
36      - items:
37          - enum:
38              - samsung,exynos7885-uart
39          - const: samsung,exynos5433-uart
40      - items:
41          - enum:
42              - samsung,exynosautov9-uart
43              - samsung,exynosautov920-uart
44          - const: samsung,exynos850-uart
45
46  reg:
47    maxItems: 1
48
49  reg-io-width:
50    description: |
51      The size (in bytes) of the IO accesses that should be performed
52      on the device.
53    enum: [ 1, 4 ]
54
55  clocks:
56    minItems: 2
57    maxItems: 5
58
59  clock-names:
60    minItems: 2
61    maxItems: 5
62
63  dmas:
64    items:
65      - description: DMA controller phandle and request line for RX
66      - description: DMA controller phandle and request line for TX
67
68  dma-names:
69    items:
70      - const: rx
71      - const: tx
72
73  interrupts:
74    description: RX interrupt and optionally TX interrupt.
75    minItems: 1
76    maxItems: 2
77
78  power-domains:
79    maxItems: 1
80
81  samsung,uart-fifosize:
82    description: The fifo size supported by the UART channel.
83    $ref: /schemas/types.yaml#/definitions/uint32
84    enum: [16, 64, 256]
85
86required:
87  - compatible
88  - clocks
89  - clock-names
90  - interrupts
91  - reg
92
93allOf:
94  - $ref: serial.yaml#
95
96  - if:
97      properties:
98        compatible:
99          contains:
100            enum:
101              - samsung,s3c6400-uart
102    then:
103      properties:
104        clocks:
105          minItems: 3
106          maxItems: 3
107
108        clock-names:
109          items:
110            - const: uart
111            - const: clk_uart_baud2
112            - const: clk_uart_baud3
113
114    else:
115      properties:
116        clock-names:
117          minItems: 2
118          items:
119            - const: uart
120            - const: clk_uart_baud0
121            - const: clk_uart_baud1
122            - const: clk_uart_baud2
123            - const: clk_uart_baud3
124
125  - if:
126      properties:
127        compatible:
128          contains:
129            enum:
130              - samsung,s5pv210-uart
131    then:
132      properties:
133        clocks:
134          minItems: 3
135          maxItems: 3
136
137        clock-names:
138          minItems: 3
139          maxItems: 3
140
141  - if:
142      properties:
143        compatible:
144          contains:
145            enum:
146              - apple,s5l-uart
147              - axis,artpec8-uart
148              - samsung,exynos4210-uart
149              - samsung,exynos5433-uart
150    then:
151      properties:
152        clocks:
153          maxItems: 2
154
155        clock-names:
156          maxItems: 2
157
158  - if:
159      properties:
160        compatible:
161          contains:
162            enum:
163              - google,gs101-uart
164              - samsung,exynos8895-uart
165    then:
166      required:
167        - samsung,uart-fifosize
168      properties:
169        clocks:
170          maxItems: 2
171
172        clock-names:
173          maxItems: 2
174
175  - if:
176      properties:
177        compatible:
178          contains:
179            enum:
180              - google,gs101-uart
181    then:
182      properties:
183        reg-io-width: false
184
185unevaluatedProperties: false
186
187examples:
188  - |
189    #include <dt-bindings/clock/samsung,s3c64xx-clock.h>
190
191    uart0: serial@7f005000 {
192        compatible = "samsung,s3c6400-uart";
193        reg = <0x7f005000 0x100>;
194        interrupt-parent = <&vic1>;
195        interrupts = <5>;
196        clock-names = "uart", "clk_uart_baud2",
197                      "clk_uart_baud3";
198        clocks = <&clocks PCLK_UART0>, <&clocks PCLK_UART0>,
199                 <&clocks SCLK_UART>;
200        samsung,uart-fifosize = <16>;
201    };
202  - |
203    #include <dt-bindings/clock/google,gs101.h>
204    #include <dt-bindings/interrupt-controller/arm-gic.h>
205    #include <dt-bindings/interrupt-controller/irq.h>
206
207    serial_0: serial@10a00000 {
208      compatible = "google,gs101-uart";
209      reg = <0x10a00000 0xc0>;
210      clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PERIC0_TOP1_PCLK_0>,
211               <&cmu_peric0 CLK_GOUT_PERIC0_PERIC0_TOP1_IPCLK_0>;
212      clock-names = "uart", "clk_uart_baud0";
213      interrupts = <GIC_SPI 634 IRQ_TYPE_LEVEL_HIGH 0>;
214      pinctrl-0 = <&uart0_bus>;
215      pinctrl-names = "default";
216      samsung,uart-fifosize = <256>;
217    };
218