Documentation / devicetree / bindings / serial / samsung_uart.yaml


Based on kernel version 6.12.4. Page generated on 2024-12-12 21:01 EST.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/serial/samsung_uart.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Samsung S3C, S5P, Exynos, and S5L (Apple SoC) SoC UART Controller

maintainers:
  - Krzysztof Kozlowski <krzk@kernel.org>
  - Greg Kroah-Hartman <gregkh@linuxfoundation.org>

description: |+
  Each Samsung UART should have an alias correctly numbered in the "aliases"
  node, according to serialN format, where N is the port number (non-negative
  decimal integer) as specified by User's Manual of respective SoC.

properties:
  compatible:
    oneOf:
      - enum:
          - apple,s5l-uart
          - axis,artpec8-uart
          - google,gs101-uart
          - samsung,s3c6400-uart
          - samsung,s5pv210-uart
          - samsung,exynos4210-uart
          - samsung,exynos5433-uart
          - samsung,exynos850-uart
      - items:
          - enum:
              - samsung,exynos7-uart
              - tesla,fsd-uart
          - const: samsung,exynos4210-uart
      - items:
          - enum:
              - samsung,exynos7885-uart
          - const: samsung,exynos5433-uart
      - items:
          - enum:
              - samsung,exynosautov9-uart
              - samsung,exynosautov920-uart
          - const: samsung,exynos850-uart

  reg:
    maxItems: 1

  reg-io-width:
    description: |
      The size (in bytes) of the IO accesses that should be performed
      on the device.
    enum: [ 1, 4 ]

  clocks:
    minItems: 2
    maxItems: 5

  clock-names:
    minItems: 2
    maxItems: 5

  dmas:
    items:
      - description: DMA controller phandle and request line for RX
      - description: DMA controller phandle and request line for TX

  dma-names:
    items:
      - const: rx
      - const: tx

  interrupts:
    description: RX interrupt and optionally TX interrupt.
    minItems: 1
    maxItems: 2

  power-domains:
    maxItems: 1

  samsung,uart-fifosize:
    description: The fifo size supported by the UART channel.
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [16, 64, 256]

required:
  - compatible
  - clocks
  - clock-names
  - interrupts
  - reg

allOf:
  - $ref: serial.yaml#

  - if:
      properties:
        compatible:
          contains:
            enum:
              - samsung,s3c6400-uart
    then:
      properties:
        clocks:
          minItems: 3
          maxItems: 3

        clock-names:
          items:
            - const: uart
            - const: clk_uart_baud2
            - const: clk_uart_baud3

    else:
      properties:
        clock-names:
          minItems: 2
          items:
            - const: uart
            - const: clk_uart_baud0
            - const: clk_uart_baud1
            - const: clk_uart_baud2
            - const: clk_uart_baud3

  - if:
      properties:
        compatible:
          contains:
            enum:
              - samsung,s5pv210-uart
    then:
      properties:
        clocks:
          minItems: 3
          maxItems: 3

        clock-names:
          minItems: 3
          maxItems: 3

  - if:
      properties:
        compatible:
          contains:
            enum:
              - apple,s5l-uart
              - axis,artpec8-uart
              - samsung,exynos4210-uart
              - samsung,exynos5433-uart
    then:
      properties:
        clocks:
          maxItems: 2

        clock-names:
          maxItems: 2

  - if:
      properties:
        compatible:
          contains:
            enum:
              - google,gs101-uart
    then:
      required:
        - samsung,uart-fifosize
      properties:
        reg-io-width: false

        clocks:
          maxItems: 2

        clock-names:
          maxItems: 2

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/clock/samsung,s3c64xx-clock.h>
 
    uart0: serial@7f005000 {
        compatible = "samsung,s3c6400-uart";
        reg = <0x7f005000 0x100>;
        interrupt-parent = <&vic1>;
        interrupts = <5>;
        clock-names = "uart", "clk_uart_baud2",
                      "clk_uart_baud3";
        clocks = <&clocks PCLK_UART0>, <&clocks PCLK_UART0>,
                 <&clocks SCLK_UART>;
        samsung,uart-fifosize = <16>;
    };
  - |
    #include <dt-bindings/clock/google,gs101.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/interrupt-controller/irq.h>
 
    serial_0: serial@10a00000 {
      compatible = "google,gs101-uart";
      reg = <0x10a00000 0xc0>;
      clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PERIC0_TOP1_PCLK_0>,
               <&cmu_peric0 CLK_GOUT_PERIC0_PERIC0_TOP1_IPCLK_0>;
      clock-names = "uart", "clk_uart_baud0";
      interrupts = <GIC_SPI 634 IRQ_TYPE_LEVEL_HIGH 0>;
      pinctrl-0 = <&uart0_bus>;
      pinctrl-names = "default";
      samsung,uart-fifosize = <256>;
    };