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