xref: /freebsd/sys/contrib/device-tree/Bindings/mfd/atmel-usart.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel Vadot* Atmel Universal Synchronous Asynchronous Receiver/Transmitter (USART)
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotRequired properties for USART:
4*c66ec88fSEmmanuel Vadot- compatible: Should be one of the following:
5*c66ec88fSEmmanuel Vadot	- "atmel,at91rm9200-usart"
6*c66ec88fSEmmanuel Vadot	- "atmel,at91sam9260-usart"
7*c66ec88fSEmmanuel Vadot	- "microchip,sam9x60-usart"
8*c66ec88fSEmmanuel Vadot	- "atmel,at91rm9200-dbgu", "atmel,at91rm9200-usart"
9*c66ec88fSEmmanuel Vadot	- "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"
10*c66ec88fSEmmanuel Vadot	- "microchip,sam9x60-dbgu", "microchip,sam9x60-usart"
11*c66ec88fSEmmanuel Vadot- reg: Should contain registers location and length
12*c66ec88fSEmmanuel Vadot- interrupts: Should contain interrupt
13*c66ec88fSEmmanuel Vadot- clock-names: tuple listing input clock names.
14*c66ec88fSEmmanuel Vadot	Required elements: "usart"
15*c66ec88fSEmmanuel Vadot- clocks: phandles to input clocks.
16*c66ec88fSEmmanuel Vadot
17*c66ec88fSEmmanuel VadotRequired properties for USART in SPI mode:
18*c66ec88fSEmmanuel Vadot- #size-cells      : Must be <0>
19*c66ec88fSEmmanuel Vadot- #address-cells   : Must be <1>
20*c66ec88fSEmmanuel Vadot- cs-gpios: chipselects (internal cs not supported)
21*c66ec88fSEmmanuel Vadot- atmel,usart-mode : Must be <AT91_USART_MODE_SPI> (found in dt-bindings/mfd/at91-usart.h)
22*c66ec88fSEmmanuel Vadot
23*c66ec88fSEmmanuel VadotOptional properties in serial and SPI mode:
24*c66ec88fSEmmanuel Vadot- dma bindings for dma transfer:
25*c66ec88fSEmmanuel Vadot	- dmas: DMA specifier, consisting of a phandle to DMA controller node,
26*c66ec88fSEmmanuel Vadot		memory peripheral interface and USART DMA channel ID, FIFO configuration.
27*c66ec88fSEmmanuel Vadot		The order of DMA channels is fixed. The first DMA channel must be TX
28*c66ec88fSEmmanuel Vadot		associated channel and the second one must be RX associated channel.
29*c66ec88fSEmmanuel Vadot		Refer to dma.txt and atmel-dma.txt for details.
30*c66ec88fSEmmanuel Vadot	- dma-names: "tx" for TX channel.
31*c66ec88fSEmmanuel Vadot		     "rx" for RX channel.
32*c66ec88fSEmmanuel Vadot		     The order of dma-names is also fixed. The first name must be "tx"
33*c66ec88fSEmmanuel Vadot		     and the second one must be "rx" as in the examples below.
34*c66ec88fSEmmanuel Vadot
35*c66ec88fSEmmanuel VadotOptional properties in serial mode:
36*c66ec88fSEmmanuel Vadot- atmel,use-dma-rx: use of PDC or DMA for receiving data
37*c66ec88fSEmmanuel Vadot- atmel,use-dma-tx: use of PDC or DMA for transmitting data
38*c66ec88fSEmmanuel Vadot- {rts,cts,dtr,dsr,rng,dcd}-gpios: specify a GPIO for RTS/CTS/DTR/DSR/RI/DCD line respectively.
39*c66ec88fSEmmanuel Vadot  It will use specified PIO instead of the peripheral function pin for the USART feature.
40*c66ec88fSEmmanuel Vadot  If unsure, don't specify this property.
41*c66ec88fSEmmanuel Vadot- atmel,fifo-size: maximum number of data the RX and TX FIFOs can store for FIFO
42*c66ec88fSEmmanuel Vadot  capable USARTs.
43*c66ec88fSEmmanuel Vadot- rs485-rts-delay, rs485-rx-during-tx, linux,rs485-enabled-at-boot-time: see rs485.txt
44*c66ec88fSEmmanuel Vadot
45*c66ec88fSEmmanuel Vadot<chip> compatible description:
46*c66ec88fSEmmanuel Vadot- at91rm9200:  legacy USART support
47*c66ec88fSEmmanuel Vadot- at91sam9260: generic USART implementation for SAM9 SoCs
48*c66ec88fSEmmanuel Vadot
49*c66ec88fSEmmanuel VadotExample:
50*c66ec88fSEmmanuel Vadot- use PDC:
51*c66ec88fSEmmanuel Vadot	usart0: serial@fff8c000 {
52*c66ec88fSEmmanuel Vadot		compatible = "atmel,at91sam9260-usart";
53*c66ec88fSEmmanuel Vadot		reg = <0xfff8c000 0x4000>;
54*c66ec88fSEmmanuel Vadot		interrupts = <7>;
55*c66ec88fSEmmanuel Vadot		clocks = <&usart0_clk>;
56*c66ec88fSEmmanuel Vadot		clock-names = "usart";
57*c66ec88fSEmmanuel Vadot		atmel,use-dma-rx;
58*c66ec88fSEmmanuel Vadot		atmel,use-dma-tx;
59*c66ec88fSEmmanuel Vadot		rts-gpios = <&pioD 15 GPIO_ACTIVE_LOW>;
60*c66ec88fSEmmanuel Vadot		cts-gpios = <&pioD 16 GPIO_ACTIVE_LOW>;
61*c66ec88fSEmmanuel Vadot		dtr-gpios = <&pioD 17 GPIO_ACTIVE_LOW>;
62*c66ec88fSEmmanuel Vadot		dsr-gpios = <&pioD 18 GPIO_ACTIVE_LOW>;
63*c66ec88fSEmmanuel Vadot		dcd-gpios = <&pioD 20 GPIO_ACTIVE_LOW>;
64*c66ec88fSEmmanuel Vadot		rng-gpios = <&pioD 19 GPIO_ACTIVE_LOW>;
65*c66ec88fSEmmanuel Vadot	};
66*c66ec88fSEmmanuel Vadot
67*c66ec88fSEmmanuel Vadot- use DMA:
68*c66ec88fSEmmanuel Vadot	usart0: serial@f001c000 {
69*c66ec88fSEmmanuel Vadot		compatible = "atmel,at91sam9260-usart";
70*c66ec88fSEmmanuel Vadot		reg = <0xf001c000 0x100>;
71*c66ec88fSEmmanuel Vadot		interrupts = <12 4 5>;
72*c66ec88fSEmmanuel Vadot		clocks = <&usart0_clk>;
73*c66ec88fSEmmanuel Vadot		clock-names = "usart";
74*c66ec88fSEmmanuel Vadot		atmel,use-dma-rx;
75*c66ec88fSEmmanuel Vadot		atmel,use-dma-tx;
76*c66ec88fSEmmanuel Vadot		dmas = <&dma0 2 0x3>,
77*c66ec88fSEmmanuel Vadot		       <&dma0 2 0x204>;
78*c66ec88fSEmmanuel Vadot		dma-names = "tx", "rx";
79*c66ec88fSEmmanuel Vadot		atmel,fifo-size = <32>;
80*c66ec88fSEmmanuel Vadot	};
81*c66ec88fSEmmanuel Vadot
82*c66ec88fSEmmanuel Vadot- SPI mode:
83*c66ec88fSEmmanuel Vadot	#include <dt-bindings/mfd/at91-usart.h>
84*c66ec88fSEmmanuel Vadot
85*c66ec88fSEmmanuel Vadot	spi0: spi@f001c000 {
86*c66ec88fSEmmanuel Vadot		#address-cells = <1>;
87*c66ec88fSEmmanuel Vadot		#size-cells = <0>;
88*c66ec88fSEmmanuel Vadot		compatible = "atmel,at91rm9200-usart", "atmel,at91sam9260-usart";
89*c66ec88fSEmmanuel Vadot		atmel,usart-mode = <AT91_USART_MODE_SPI>;
90*c66ec88fSEmmanuel Vadot		reg = <0xf001c000 0x100>;
91*c66ec88fSEmmanuel Vadot		interrupts = <12 IRQ_TYPE_LEVEL_HIGH 5>;
92*c66ec88fSEmmanuel Vadot		clocks = <&usart0_clk>;
93*c66ec88fSEmmanuel Vadot		clock-names = "usart";
94*c66ec88fSEmmanuel Vadot		dmas = <&dma0 2 AT91_DMA_CFG_PER_ID(3)>,
95*c66ec88fSEmmanuel Vadot		       <&dma0 2 (AT91_DMA_CFG_PER_ID(4) | AT91_DMA_CFG_FIFOCFG_ASAP)>;
96*c66ec88fSEmmanuel Vadot		dma-names = "tx", "rx";
97*c66ec88fSEmmanuel Vadot		cs-gpios = <&pioB 3 0>;
98*c66ec88fSEmmanuel Vadot	};
99