xref: /linux/Documentation/devicetree/bindings/serial/samsung_uart.yaml (revision 5f5598d945e2a69f764aa5c2074dad73e23bcfcb)
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,exynos2200-uart
34          - const: google,gs101-uart
35      - items:
36          - enum:
37              - samsung,exynos7-uart
38              - tesla,fsd-uart
39          - const: samsung,exynos4210-uart
40      - items:
41          - enum:
42              - samsung,exynos7885-uart
43          - const: samsung,exynos5433-uart
44      - items:
45          - enum:
46              - samsung,exynosautov9-uart
47              - samsung,exynosautov920-uart
48          - const: samsung,exynos850-uart
49      - items:
50          - enum:
51              - samsung,exynos7870-uart
52          - const: samsung,exynos8895-uart
53
54  reg:
55    maxItems: 1
56
57  reg-io-width:
58    description: |
59      The size (in bytes) of the IO accesses that should be performed
60      on the device.
61    enum: [ 1, 4 ]
62
63  clocks:
64    minItems: 2
65    maxItems: 5
66
67  clock-names:
68    minItems: 2
69    maxItems: 5
70
71  dmas:
72    items:
73      - description: DMA controller phandle and request line for RX
74      - description: DMA controller phandle and request line for TX
75
76  dma-names:
77    items:
78      - const: rx
79      - const: tx
80
81  interrupts:
82    description: RX interrupt and optionally TX interrupt.
83    minItems: 1
84    maxItems: 2
85
86  power-domains:
87    maxItems: 1
88
89  samsung,uart-fifosize:
90    description: The fifo size supported by the UART channel.
91    $ref: /schemas/types.yaml#/definitions/uint32
92    enum: [16, 64, 256]
93
94required:
95  - compatible
96  - clocks
97  - clock-names
98  - interrupts
99  - reg
100
101allOf:
102  - $ref: serial.yaml#
103
104  - if:
105      properties:
106        compatible:
107          contains:
108            enum:
109              - samsung,s3c6400-uart
110    then:
111      properties:
112        clocks:
113          minItems: 3
114          maxItems: 3
115
116        clock-names:
117          items:
118            - const: uart
119            - const: clk_uart_baud2
120            - const: clk_uart_baud3
121
122    else:
123      properties:
124        clock-names:
125          minItems: 2
126          items:
127            - const: uart
128            - const: clk_uart_baud0
129            - const: clk_uart_baud1
130            - const: clk_uart_baud2
131            - const: clk_uart_baud3
132
133  - if:
134      properties:
135        compatible:
136          contains:
137            enum:
138              - samsung,s5pv210-uart
139    then:
140      properties:
141        clocks:
142          minItems: 3
143          maxItems: 3
144
145        clock-names:
146          minItems: 3
147          maxItems: 3
148
149  - if:
150      properties:
151        compatible:
152          contains:
153            enum:
154              - apple,s5l-uart
155              - axis,artpec8-uart
156              - samsung,exynos4210-uart
157              - samsung,exynos5433-uart
158    then:
159      properties:
160        clocks:
161          maxItems: 2
162
163        clock-names:
164          maxItems: 2
165
166  - if:
167      properties:
168        compatible:
169          contains:
170            enum:
171              - google,gs101-uart
172              - samsung,exynos8895-uart
173    then:
174      required:
175        - samsung,uart-fifosize
176      properties:
177        clocks:
178          maxItems: 2
179
180        clock-names:
181          maxItems: 2
182
183  - if:
184      properties:
185        compatible:
186          contains:
187            enum:
188              - google,gs101-uart
189    then:
190      properties:
191        reg-io-width: false
192
193unevaluatedProperties: false
194
195examples:
196  - |
197    #include <dt-bindings/clock/samsung,s3c64xx-clock.h>
198
199    uart0: serial@7f005000 {
200        compatible = "samsung,s3c6400-uart";
201        reg = <0x7f005000 0x100>;
202        interrupt-parent = <&vic1>;
203        interrupts = <5>;
204        clock-names = "uart", "clk_uart_baud2",
205                      "clk_uart_baud3";
206        clocks = <&clocks PCLK_UART0>, <&clocks PCLK_UART0>,
207                 <&clocks SCLK_UART>;
208        samsung,uart-fifosize = <16>;
209    };
210  - |
211    #include <dt-bindings/clock/google,gs101.h>
212    #include <dt-bindings/interrupt-controller/arm-gic.h>
213    #include <dt-bindings/interrupt-controller/irq.h>
214
215    serial_0: serial@10a00000 {
216      compatible = "google,gs101-uart";
217      reg = <0x10a00000 0xc0>;
218      clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PERIC0_TOP1_PCLK_0>,
219               <&cmu_peric0 CLK_GOUT_PERIC0_PERIC0_TOP1_IPCLK_0>;
220      clock-names = "uart", "clk_uart_baud0";
221      interrupts = <GIC_SPI 634 IRQ_TYPE_LEVEL_HIGH 0>;
222      pinctrl-0 = <&uart0_bus>;
223      pinctrl-names = "default";
224      samsung,uart-fifosize = <256>;
225    };
226