Skip to content

Commit cbef03f

Browse files
author
Radu Pirea
committed
dt-bindings: add binding for atmel-usart in SPI mode
This patch moves the bindings for serial from serial/atmel-usart.txt to mfd/atmel-usart.txt and adds bindings for USART in SPI mode. Signed-off-by: Radu Pirea <radu.pirea@microchip.com> Reviewed-by: Rob Herring <robh@kernel.org>
1 parent ee2796d commit cbef03f

2 files changed

Lines changed: 40 additions & 2 deletions

File tree

Documentation/devicetree/bindings/serial/atmel-usart.txt renamed to Documentation/devicetree/bindings/mfd/atmel-usart.txt

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
* Atmel Universal Synchronous Asynchronous Receiver/Transmitter (USART)
22

3-
Required properties:
3+
Required properties for USART:
44
- compatible: Should be "atmel,<chip>-usart" or "atmel,<chip>-dbgu"
55
The compatible <chip> indicated will be the first SoC to support an
66
additional mode or an USART new feature.
@@ -11,7 +11,13 @@ Required properties:
1111
Required elements: "usart"
1212
- clocks: phandles to input clocks.
1313

14-
Optional properties:
14+
Required properties for USART in SPI mode:
15+
- #size-cells : Must be <0>
16+
- #address-cells : Must be <1>
17+
- cs-gpios: chipselects (internal cs not supported)
18+
- atmel,usart-mode : Must be <AT91_USART_MODE_SPI> (found in dt-bindings/mfd/at91-usart.h)
19+
20+
Optional properties in serial mode:
1521
- atmel,use-dma-rx: use of PDC or DMA for receiving data
1622
- atmel,use-dma-tx: use of PDC or DMA for transmitting data
1723
- {rts,cts,dtr,dsr,rng,dcd}-gpios: specify a GPIO for RTS/CTS/DTR/DSR/RI/DCD line respectively.
@@ -61,3 +67,18 @@ Example:
6167
dma-names = "tx", "rx";
6268
atmel,fifo-size = <32>;
6369
};
70+
71+
- SPI mode:
72+
#include <dt-bindings/mfd/at91-usart.h>
73+
74+
spi0: spi@f001c000 {
75+
#address-cells = <1>;
76+
#size-cells = <0>;
77+
compatible = "atmel,at91rm9200-usart", "atmel,at91sam9260-usart";
78+
atmel,usart-mode = <AT91_USART_MODE_SPI>;
79+
reg = <0xf001c000 0x100>;
80+
interrupts = <12 IRQ_TYPE_LEVEL_HIGH>;
81+
clocks = <&usart0_clk>;
82+
clock-names = "usart";
83+
cs-gpios = <&pioB 3 0>;
84+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/*
3+
* This header provides macros for AT91 USART DT bindings.
4+
*
5+
* Copyright (C) 2018 Microchip Technology
6+
*
7+
* Author: Radu Pirea <radu.pirea@microchip.com>
8+
*
9+
*/
10+
11+
#ifndef __DT_BINDINGS_AT91_USART_H__
12+
#define __DT_BINDINGS_AT91_USART_H__
13+
14+
#define AT91_USART_MODE_SERIAL 0
15+
#define AT91_USART_MODE_SPI 1
16+
17+
#endif /* __DT_BINDINGS_AT91_USART_H__ */

0 commit comments

Comments
 (0)