200 lines · yaml
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)2# Copyright (C) 2022 Microchip Technology, Inc. and its subsidiaries3%YAML 1.24---5$id: http://devicetree.org/schemas/serial/atmel,at91-usart.yaml#6$schema: http://devicetree.org/meta-schemas/core.yaml#7 8title: Atmel Universal Synchronous Asynchronous Receiver/Transmitter (USART)9 10maintainers:11 - Richard Genoud <richard.genoud@bootlin.com>12 13properties:14 compatible:15 oneOf:16 - enum:17 - atmel,at91rm9200-usart18 - atmel,at91sam9260-usart19 - items:20 - const: atmel,at91rm9200-dbgu21 - const: atmel,at91rm9200-usart22 - items:23 - const: atmel,at91sam9260-dbgu24 - const: atmel,at91sam9260-usart25 - items:26 - enum:27 - microchip,sam9x60-usart28 - microchip,sam9x7-usart29 - const: atmel,at91sam9260-usart30 - items:31 - const: microchip,sam9x60-dbgu32 - const: microchip,sam9x60-usart33 - const: atmel,at91sam9260-dbgu34 - const: atmel,at91sam9260-usart35 - items:36 - const: microchip,sam9x7-dbgu37 - const: atmel,at91sam9260-dbgu38 - const: microchip,sam9x7-usart39 - const: atmel,at91sam9260-usart40 41 reg:42 maxItems: 143 44 interrupts:45 maxItems: 146 47 clock-names:48 minItems: 149 items:50 - const: usart51 - const: gclk52 53 clocks:54 minItems: 155 items:56 - description: USART Peripheral Clock57 - description: USART Generic Clock58 59 dmas:60 items:61 - description: TX DMA Channel62 - description: RX DMA Channel63 64 dma-names:65 items:66 - const: tx67 - const: rx68 69 atmel,usart-mode:70 $ref: /schemas/types.yaml#/definitions/uint3271 description:72 Must be either <AT91_USART_MODE_SPI> for SPI or73 <AT91_USART_MODE_SERIAL> for USART (found in dt-bindings/mfd/at91-usart.h).74 enum: [ 0, 1 ]75 76 atmel,use-dma-rx:77 type: boolean78 description: use of PDC or DMA for receiving data79 80 atmel,use-dma-tx:81 type: boolean82 description: use of PDC or DMA for transmitting data83 84 atmel,fifo-size:85 $ref: /schemas/types.yaml#/definitions/uint3286 description:87 Maximum number of data the RX and TX FIFOs can store for FIFO88 capable USARTS.89 enum: [ 16, 32 ]90 91required:92 - compatible93 - reg94 - interrupts95 - clock-names96 - clocks97 - atmel,usart-mode98 99allOf:100 - if:101 properties:102 atmel,usart-mode:103 const: 1104 then:105 allOf:106 - $ref: /schemas/spi/spi-controller.yaml#107 108 properties:109 atmel,use-dma-rx: false110 111 atmel,use-dma-tx: false112 113 atmel,fifo-size: false114 115 "#size-cells":116 const: 0117 118 "#address-cells":119 const: 1120 121 required:122 - "#size-cells"123 - "#address-cells"124 125 else:126 allOf:127 - $ref: /schemas/serial/serial.yaml#128 - $ref: /schemas/serial/rs485.yaml#129 130unevaluatedProperties: false131 132examples:133 - |134 #include <dt-bindings/gpio/gpio.h>135 #include <dt-bindings/interrupt-controller/irq.h>136 #include <dt-bindings/mfd/at91-usart.h>137 #include <dt-bindings/dma/at91.h>138 139 /* use PDC */140 usart0: serial@fff8c000 {141 compatible = "atmel,at91sam9260-usart";142 reg = <0xfff8c000 0x4000>;143 atmel,usart-mode = <AT91_USART_MODE_SERIAL>;144 interrupts = <7>;145 clocks = <&usart0_clk>;146 clock-names = "usart";147 atmel,use-dma-rx;148 atmel,use-dma-tx;149 rts-gpios = <&pioD 15 GPIO_ACTIVE_LOW>;150 cts-gpios = <&pioD 16 GPIO_ACTIVE_LOW>;151 dtr-gpios = <&pioD 17 GPIO_ACTIVE_LOW>;152 dsr-gpios = <&pioD 18 GPIO_ACTIVE_LOW>;153 dcd-gpios = <&pioD 20 GPIO_ACTIVE_LOW>;154 rng-gpios = <&pioD 19 GPIO_ACTIVE_LOW>;155 };156 157 - |158 #include <dt-bindings/gpio/gpio.h>159 #include <dt-bindings/interrupt-controller/irq.h>160 #include <dt-bindings/mfd/at91-usart.h>161 #include <dt-bindings/dma/at91.h>162 163 /* use DMA */164 usart1: serial@f001c000 {165 compatible = "atmel,at91sam9260-usart";166 reg = <0xf001c000 0x100>;167 atmel,usart-mode = <AT91_USART_MODE_SERIAL>;168 interrupts = <12 IRQ_TYPE_LEVEL_HIGH 5>;169 clocks = <&usart0_clk>;170 clock-names = "usart";171 atmel,use-dma-rx;172 atmel,use-dma-tx;173 dmas = <&dma0 2 AT91_DMA_CFG_PER_ID(3)>,174 <&dma0 2 (AT91_DMA_CFG_PER_ID(4) | AT91_DMA_CFG_FIFOCFG_ASAP)>;175 dma-names = "tx", "rx";176 atmel,fifo-size = <32>;177 };178 179 - |180 #include <dt-bindings/gpio/gpio.h>181 #include <dt-bindings/interrupt-controller/irq.h>182 #include <dt-bindings/mfd/at91-usart.h>183 #include <dt-bindings/dma/at91.h>184 185 /* SPI mode */186 spi0: spi@f001c000 {187 compatible = "atmel,at91sam9260-usart";188 reg = <0xf001c000 0x100>;189 #address-cells = <1>;190 #size-cells = <0>;191 atmel,usart-mode = <AT91_USART_MODE_SPI>;192 interrupts = <12 IRQ_TYPE_LEVEL_HIGH 5>;193 clocks = <&usart0_clk>;194 clock-names = "usart";195 dmas = <&dma0 2 AT91_DMA_CFG_PER_ID(3)>,196 <&dma0 2 (AT91_DMA_CFG_PER_ID(4) | AT91_DMA_CFG_FIFOCFG_ASAP)>;197 dma-names = "tx", "rx";198 cs-gpios = <&pioB 3 GPIO_ACTIVE_HIGH>;199 };200