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    items:
21      - enum:
22          - apple,s5l-uart
23          - samsung,s3c2410-uart
24          - samsung,s3c2412-uart
25          - samsung,s3c2440-uart
26          - samsung,s3c6400-uart
27          - samsung,s5pv210-uart
28          - samsung,exynos4210-uart
29
30  reg:
31    maxItems: 1
32
33  reg-io-width:
34    description: |
35      The size (in bytes) of the IO accesses that should be performed
36      on the device.
37    $ref: /schemas/types.yaml#/definitions/uint32
38    enum: [ 1, 4 ]
39
40  clocks:
41    minItems: 2
42    maxItems: 5
43
44  clock-names:
45    description: N = 0 is allowed for SoCs without internal baud clock mux.
46    minItems: 2
47    items:
48      - const: uart
49      - pattern: '^clk_uart_baud[0-3]$'
50      - pattern: '^clk_uart_baud[0-3]$'
51      - pattern: '^clk_uart_baud[0-3]$'
52      - pattern: '^clk_uart_baud[0-3]$'
53
54  dmas:
55    items:
56      - description: DMA controller phandle and request line for RX
57      - description: DMA controller phandle and request line for TX
58
59  dma-names:
60    items:
61      - const: rx
62      - const: tx
63
64  interrupts:
65    description: RX interrupt and optionally TX interrupt.
66    minItems: 1
67    maxItems: 2
68
69  samsung,uart-fifosize:
70    description: The fifo size supported by the UART channel.
71    $ref: /schemas/types.yaml#/definitions/uint32
72    enum: [16, 64, 256]
73
74required:
75  - compatible
76  - clocks
77  - clock-names
78  - interrupts
79  - reg
80
81unevaluatedProperties: false
82
83allOf:
84  - $ref: serial.yaml#
85
86  - if:
87      properties:
88        compatible:
89          contains:
90            enum:
91              - samsung,s3c2410-uart
92              - samsung,s5pv210-uart
93    then:
94      properties:
95        clocks:
96          minItems: 2
97          maxItems: 3
98        clock-names:
99          minItems: 2
100          maxItems: 3
101          items:
102            - const: uart
103            - pattern: '^clk_uart_baud[0-1]$'
104            - pattern: '^clk_uart_baud[0-1]$'
105
106  - if:
107      properties:
108        compatible:
109          contains:
110            enum:
111              - apple,s5l-uart
112              - samsung,exynos4210-uart
113    then:
114      properties:
115        clocks:
116          minItems: 2
117          maxItems: 2
118        clock-names:
119          minItems: 2
120          maxItems: 2
121          items:
122            - const: uart
123            - const: clk_uart_baud0
124
125examples:
126  - |
127    #include <dt-bindings/clock/samsung,s3c64xx-clock.h>
128
129    uart0: serial@7f005000 {
130        compatible = "samsung,s3c6400-uart";
131        reg = <0x7f005000 0x100>;
132        interrupt-parent = <&vic1>;
133        interrupts = <5>;
134        clock-names = "uart", "clk_uart_baud2",
135                      "clk_uart_baud3";
136        clocks = <&clocks PCLK_UART0>, <&clocks PCLK_UART0>,
137                 <&clocks SCLK_UART>;
138        samsung,uart-fifosize = <16>;
139    };
140