Sam Protsenko | c4e9df2 | 2024-01-10 21:08:57 -0600 | [diff] [blame] | 1 | # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) |
| 2 | %YAML 1.2 |
| 3 | --- |
| 4 | $id: http://devicetree.org/schemas/soc/samsung/exynos-usi.yaml# |
| 5 | $schema: http://devicetree.org/meta-schemas/core.yaml# |
| 6 | |
| 7 | title: Samsung's Exynos USI (Universal Serial Interface) |
| 8 | |
| 9 | maintainers: |
| 10 | - Sam Protsenko <semen.protsenko@linaro.org> |
| 11 | |
| 12 | description: | |
| 13 | USI IP-core provides selectable serial protocol (UART, SPI or High-Speed I2C). |
| 14 | USI shares almost all internal circuits within each protocol, so only one |
| 15 | protocol can be chosen at a time. USI is modeled as a node with zero or more |
| 16 | child nodes, each representing a serial sub-node device. The mode setting |
| 17 | selects which particular function will be used. |
| 18 | |
| 19 | properties: |
| 20 | $nodename: |
| 21 | pattern: "^usi@[0-9a-f]+$" |
| 22 | |
| 23 | compatible: |
| 24 | enum: |
| 25 | - samsung,exynos850-usi |
| 26 | |
| 27 | reg: true |
| 28 | |
| 29 | clocks: true |
| 30 | |
| 31 | clock-names: true |
| 32 | |
| 33 | ranges: true |
| 34 | |
| 35 | "#address-cells": |
| 36 | const: 1 |
| 37 | |
| 38 | "#size-cells": |
| 39 | const: 1 |
| 40 | |
| 41 | samsung,sysreg: |
| 42 | $ref: /schemas/types.yaml#/definitions/phandle-array |
| 43 | items: |
| 44 | - items: |
| 45 | - description: phandle to System Register syscon node |
| 46 | - description: offset of SW_CONF register for this USI controller |
| 47 | description: |
| 48 | Should be phandle/offset pair. The phandle to System Register syscon node |
| 49 | (for the same domain where this USI controller resides) and the offset |
| 50 | of SW_CONF register for this USI controller. |
| 51 | |
| 52 | samsung,mode: |
| 53 | $ref: /schemas/types.yaml#/definitions/uint32 |
| 54 | description: |
| 55 | Selects USI function (which serial protocol to use). Refer to |
| 56 | <include/dt-bindings/soc/samsung,exynos-usi.h> for valid USI mode values. |
| 57 | |
| 58 | samsung,clkreq-on: |
| 59 | type: boolean |
| 60 | description: |
| 61 | Enable this property if underlying protocol requires the clock to be |
| 62 | continuously provided without automatic gating. As suggested by SoC |
| 63 | manual, it should be set in case of SPI/I2C slave, UART Rx and I2C |
| 64 | multi-master mode. Usually this property is needed if USI mode is set |
| 65 | to "UART". |
| 66 | |
| 67 | This property is optional. |
| 68 | |
| 69 | patternProperties: |
| 70 | "^i2c@[0-9a-f]+$": |
| 71 | $ref: /schemas/i2c/i2c-exynos5.yaml |
| 72 | description: Child node describing underlying I2C |
| 73 | |
| 74 | "^serial@[0-9a-f]+$": |
| 75 | $ref: /schemas/serial/samsung_uart.yaml |
| 76 | description: Child node describing underlying UART/serial |
| 77 | |
| 78 | "^spi@[0-9a-f]+$": |
| 79 | $ref: /schemas/spi/samsung,spi.yaml |
| 80 | description: Child node describing underlying SPI |
| 81 | |
| 82 | required: |
| 83 | - compatible |
| 84 | - ranges |
| 85 | - "#address-cells" |
| 86 | - "#size-cells" |
| 87 | - samsung,sysreg |
| 88 | - samsung,mode |
| 89 | |
| 90 | if: |
| 91 | properties: |
| 92 | compatible: |
| 93 | contains: |
| 94 | enum: |
| 95 | - samsung,exynos850-usi |
| 96 | |
| 97 | then: |
| 98 | properties: |
| 99 | reg: |
| 100 | maxItems: 1 |
| 101 | |
| 102 | clocks: |
| 103 | items: |
| 104 | - description: Bus (APB) clock |
| 105 | - description: Operating clock for UART/SPI/I2C protocol |
| 106 | |
| 107 | clock-names: |
| 108 | items: |
| 109 | - const: pclk |
| 110 | - const: ipclk |
| 111 | |
| 112 | required: |
| 113 | - reg |
| 114 | - clocks |
| 115 | - clock-names |
| 116 | |
| 117 | else: |
| 118 | properties: |
| 119 | reg: false |
| 120 | clocks: false |
| 121 | clock-names: false |
| 122 | samsung,clkreq-on: false |
| 123 | |
| 124 | additionalProperties: false |
| 125 | |
| 126 | examples: |
| 127 | - | |
| 128 | #include <dt-bindings/interrupt-controller/arm-gic.h> |
| 129 | #include <dt-bindings/soc/samsung,exynos-usi.h> |
| 130 | |
| 131 | usi0: usi@138200c0 { |
| 132 | compatible = "samsung,exynos850-usi"; |
| 133 | reg = <0x138200c0 0x20>; |
| 134 | samsung,sysreg = <&sysreg_peri 0x1010>; |
| 135 | samsung,mode = <USI_V2_UART>; |
| 136 | samsung,clkreq-on; /* needed for UART mode */ |
| 137 | #address-cells = <1>; |
| 138 | #size-cells = <1>; |
| 139 | ranges; |
| 140 | clocks = <&cmu_peri 32>, <&cmu_peri 31>; |
| 141 | clock-names = "pclk", "ipclk"; |
| 142 | |
| 143 | serial_0: serial@13820000 { |
| 144 | compatible = "samsung,exynos850-uart"; |
| 145 | reg = <0x13820000 0xc0>; |
| 146 | interrupts = <GIC_SPI 227 IRQ_TYPE_LEVEL_HIGH>; |
| 147 | clocks = <&cmu_peri 32>, <&cmu_peri 31>; |
| 148 | clock-names = "uart", "clk_uart_baud0"; |
| 149 | status = "disabled"; |
| 150 | }; |
| 151 | |
| 152 | hsi2c_0: i2c@13820000 { |
| 153 | compatible = "samsung,exynosautov9-hsi2c"; |
| 154 | reg = <0x13820000 0xc0>; |
| 155 | interrupts = <GIC_SPI 227 IRQ_TYPE_LEVEL_HIGH>; |
| 156 | #address-cells = <1>; |
| 157 | #size-cells = <0>; |
| 158 | clocks = <&cmu_peri 31>, <&cmu_peri 32>; |
| 159 | clock-names = "hsi2c", "hsi2c_pclk"; |
| 160 | status = "disabled"; |
| 161 | }; |
| 162 | }; |