2011-10-13 00:06:56 +08:00
|
|
|
* Atmel Universal Synchronous Asynchronous Receiver/Transmitter (USART)
|
|
|
|
|
2018-07-14 00:47:32 +08:00
|
|
|
Required properties for USART:
|
2015-03-12 22:54:26 +08:00
|
|
|
- compatible: Should be "atmel,<chip>-usart" or "atmel,<chip>-dbgu"
|
2011-10-13 00:06:56 +08:00
|
|
|
The compatible <chip> indicated will be the first SoC to support an
|
|
|
|
additional mode or an USART new feature.
|
2015-03-12 22:54:26 +08:00
|
|
|
For the dbgu UART, use "atmel,<chip>-dbgu", "atmel,<chip>-usart"
|
2011-10-13 00:06:56 +08:00
|
|
|
- reg: Should contain registers location and length
|
|
|
|
- interrupts: Should contain interrupt
|
2013-12-18 00:22:20 +08:00
|
|
|
- clock-names: tuple listing input clock names.
|
|
|
|
Required elements: "usart"
|
|
|
|
- clocks: phandles to input clocks.
|
2011-10-13 00:06:56 +08:00
|
|
|
|
2018-07-14 00:47:32 +08:00
|
|
|
Required properties for USART in SPI mode:
|
|
|
|
- #size-cells : Must be <0>
|
|
|
|
- #address-cells : Must be <1>
|
|
|
|
- cs-gpios: chipselects (internal cs not supported)
|
|
|
|
- atmel,usart-mode : Must be <AT91_USART_MODE_SPI> (found in dt-bindings/mfd/at91-usart.h)
|
|
|
|
|
2019-05-06 02:06:45 +08:00
|
|
|
Optional properties in serial and SPI mode:
|
|
|
|
- dma bindings for dma transfer:
|
|
|
|
- dmas: DMA specifier, consisting of a phandle to DMA controller node,
|
|
|
|
memory peripheral interface and USART DMA channel ID, FIFO configuration.
|
|
|
|
The order of DMA channels is fixed. The first DMA channel must be TX
|
|
|
|
associated channel and the second one must be RX associated channel.
|
|
|
|
Refer to dma.txt and atmel-dma.txt for details.
|
|
|
|
- dma-names: "tx" for TX channel.
|
|
|
|
"rx" for RX channel.
|
|
|
|
The order of dma-names is also fixed. The first name must be "tx"
|
|
|
|
and the second one must be "rx" as in the examples below.
|
|
|
|
|
2018-07-14 00:47:32 +08:00
|
|
|
Optional properties in serial mode:
|
2011-10-13 00:06:56 +08:00
|
|
|
- atmel,use-dma-rx: use of PDC or DMA for receiving data
|
|
|
|
- atmel,use-dma-tx: use of PDC or DMA for transmitting data
|
2014-05-14 02:20:44 +08:00
|
|
|
- {rts,cts,dtr,dsr,rng,dcd}-gpios: specify a GPIO for RTS/CTS/DTR/DSR/RI/DCD line respectively.
|
|
|
|
It will use specified PIO instead of the peripheral function pin for the USART feature.
|
|
|
|
If unsure, don't specify this property.
|
ARM: at91/dt: add a new DT property to support FIFOs on Atmel USARTs
This patch adds a new DT property, "atmel,fifo-size", to enable and set
the maximum number of data the RX and TX FIFOs can store on FIFO capable
USARTs.
Please be aware that the VERSION register can not be used to guess the
size of FIFOs. Indeed, for a given hardware version, the USARTs can be
integrated on Atmel SoCs with different FIFO sizes. Also the
"atmel,fifo-size" property is optional as older USARTs don't embed FIFO at
all.
Besides, the FIFO size can not be read or guessed from other registers:
When designing the FIFO feature, no dedicated registers were added to
store this size. Unsed spaces in the I/O register range are limited and
better reserved for future usages. Instead, the FIFO size of each
peripheral is documented in the programmer datasheet.
Finally, on a given SoC, there can be several instances of USART with
different FIFO sizes. This explain why we'd rather use a dedicated DT
property than use the "compatible" property.
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-02 21:18:09 +08:00
|
|
|
- atmel,fifo-size: maximum number of data the RX and TX FIFOs can store for FIFO
|
|
|
|
capable USARTs.
|
2017-09-20 20:29:36 +08:00
|
|
|
- rs485-rts-delay, rs485-rx-during-tx, linux,rs485-enabled-at-boot-time: see rs485.txt
|
2011-10-13 00:06:56 +08:00
|
|
|
|
|
|
|
<chip> compatible description:
|
|
|
|
- at91rm9200: legacy USART support
|
|
|
|
- at91sam9260: generic USART implementation for SAM9 SoCs
|
|
|
|
|
|
|
|
Example:
|
2013-07-22 16:30:31 +08:00
|
|
|
- use PDC:
|
2011-10-13 00:06:56 +08:00
|
|
|
usart0: serial@fff8c000 {
|
|
|
|
compatible = "atmel,at91sam9260-usart";
|
|
|
|
reg = <0xfff8c000 0x4000>;
|
|
|
|
interrupts = <7>;
|
2013-12-18 00:22:20 +08:00
|
|
|
clocks = <&usart0_clk>;
|
|
|
|
clock-names = "usart";
|
2011-10-13 00:06:56 +08:00
|
|
|
atmel,use-dma-rx;
|
|
|
|
atmel,use-dma-tx;
|
2014-05-14 02:20:41 +08:00
|
|
|
rts-gpios = <&pioD 15 GPIO_ACTIVE_LOW>;
|
2014-05-14 02:20:44 +08:00
|
|
|
cts-gpios = <&pioD 16 GPIO_ACTIVE_LOW>;
|
|
|
|
dtr-gpios = <&pioD 17 GPIO_ACTIVE_LOW>;
|
|
|
|
dsr-gpios = <&pioD 18 GPIO_ACTIVE_LOW>;
|
|
|
|
dcd-gpios = <&pioD 20 GPIO_ACTIVE_LOW>;
|
|
|
|
rng-gpios = <&pioD 19 GPIO_ACTIVE_LOW>;
|
2011-10-13 00:06:56 +08:00
|
|
|
};
|
|
|
|
|
2013-07-22 16:30:31 +08:00
|
|
|
- use DMA:
|
|
|
|
usart0: serial@f001c000 {
|
|
|
|
compatible = "atmel,at91sam9260-usart";
|
|
|
|
reg = <0xf001c000 0x100>;
|
|
|
|
interrupts = <12 4 5>;
|
2013-12-18 00:22:20 +08:00
|
|
|
clocks = <&usart0_clk>;
|
|
|
|
clock-names = "usart";
|
2013-07-22 16:30:31 +08:00
|
|
|
atmel,use-dma-rx;
|
|
|
|
atmel,use-dma-tx;
|
|
|
|
dmas = <&dma0 2 0x3>,
|
|
|
|
<&dma0 2 0x204>;
|
|
|
|
dma-names = "tx", "rx";
|
ARM: at91/dt: add a new DT property to support FIFOs on Atmel USARTs
This patch adds a new DT property, "atmel,fifo-size", to enable and set
the maximum number of data the RX and TX FIFOs can store on FIFO capable
USARTs.
Please be aware that the VERSION register can not be used to guess the
size of FIFOs. Indeed, for a given hardware version, the USARTs can be
integrated on Atmel SoCs with different FIFO sizes. Also the
"atmel,fifo-size" property is optional as older USARTs don't embed FIFO at
all.
Besides, the FIFO size can not be read or guessed from other registers:
When designing the FIFO feature, no dedicated registers were added to
store this size. Unsed spaces in the I/O register range are limited and
better reserved for future usages. Instead, the FIFO size of each
peripheral is documented in the programmer datasheet.
Finally, on a given SoC, there can be several instances of USART with
different FIFO sizes. This explain why we'd rather use a dedicated DT
property than use the "compatible" property.
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-02 21:18:09 +08:00
|
|
|
atmel,fifo-size = <32>;
|
2013-07-22 16:30:31 +08:00
|
|
|
};
|
2018-07-14 00:47:32 +08:00
|
|
|
|
|
|
|
- SPI mode:
|
|
|
|
#include <dt-bindings/mfd/at91-usart.h>
|
|
|
|
|
|
|
|
spi0: spi@f001c000 {
|
|
|
|
#address-cells = <1>;
|
|
|
|
#size-cells = <0>;
|
|
|
|
compatible = "atmel,at91rm9200-usart", "atmel,at91sam9260-usart";
|
|
|
|
atmel,usart-mode = <AT91_USART_MODE_SPI>;
|
|
|
|
reg = <0xf001c000 0x100>;
|
2018-09-11 18:38:30 +08:00
|
|
|
interrupts = <12 IRQ_TYPE_LEVEL_HIGH 5>;
|
2018-07-14 00:47:32 +08:00
|
|
|
clocks = <&usart0_clk>;
|
|
|
|
clock-names = "usart";
|
2019-05-06 02:06:45 +08:00
|
|
|
dmas = <&dma0 2 AT91_DMA_CFG_PER_ID(3)>,
|
|
|
|
<&dma0 2 (AT91_DMA_CFG_PER_ID(4) | AT91_DMA_CFG_FIFOCFG_ASAP)>;
|
|
|
|
dma-names = "tx", "rx";
|
2018-07-14 00:47:32 +08:00
|
|
|
cs-gpios = <&pioB 3 0>;
|
|
|
|
};
|