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