aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-11-07 04:25:55 -0500
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2013-12-20 05:41:30 -0500
commit354e57f3a0a26120af3bcd6c92c355ad00a057c1 (patch)
tree6935c516167f34df47ebce43c579bbc8ce53f8d4 /arch
parent6a79799d5654bb7800614e8b7a009252be7ff90e (diff)
ARM/serial: at91: switch atmel serial to use gpiolib
This passes the errata fix using a GPIO to control the RTS pin on one of the AT91 chips to use gpiolib instead of the AT91-specific interfaces. Also remove the reliance on compile-time #defines and the cpu_* check and rely on the platform passing down the proper GPIO pin through platform data. This is a prerequisite for getting rid of the local GPIO implementation in the AT91 platform and move toward multiplatform. The patch also adds device tree support for getting the RTS GPIO pin from the device tree on DT boot paths. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-at91/at91rm9200_devices.c10
-rw-r--r--arch/arm/mach-at91/at91sam9260_devices.c7
-rw-r--r--arch/arm/mach-at91/at91sam9261_devices.c4
-rw-r--r--arch/arm/mach-at91/at91sam9263_devices.c4
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c5
-rw-r--r--arch/arm/mach-at91/at91sam9rl_devices.c5
6 files changed, 33 insertions, 2 deletions
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index 3ebc9792560c..605add05af7e 100644
--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -922,6 +922,7 @@ static struct resource dbgu_resources[] = {
922static struct atmel_uart_data dbgu_data = { 922static struct atmel_uart_data dbgu_data = {
923 .use_dma_tx = 0, 923 .use_dma_tx = 0,
924 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 924 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
925 .rts_gpio = -EINVAL,
925}; 926};
926 927
927static u64 dbgu_dmamask = DMA_BIT_MASK(32); 928static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -960,6 +961,7 @@ static struct resource uart0_resources[] = {
960static struct atmel_uart_data uart0_data = { 961static struct atmel_uart_data uart0_data = {
961 .use_dma_tx = 1, 962 .use_dma_tx = 1,
962 .use_dma_rx = 1, 963 .use_dma_rx = 1,
964 .rts_gpio = -EINVAL,
963}; 965};
964 966
965static u64 uart0_dmamask = DMA_BIT_MASK(32); 967static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -987,9 +989,10 @@ static inline void configure_usart0_pins(unsigned pins)
987 if (pins & ATMEL_UART_RTS) { 989 if (pins & ATMEL_UART_RTS) {
988 /* 990 /*
989 * AT91RM9200 Errata #39 - RTS0 is not internally connected to PA21. 991 * AT91RM9200 Errata #39 - RTS0 is not internally connected to PA21.
990 * We need to drive the pin manually. Default is off (RTS is active low). 992 * We need to drive the pin manually. The serial driver will driver
993 * this to high when initializing.
991 */ 994 */
992 at91_set_gpio_output(AT91_PIN_PA21, 1); 995 uart0_data.rts_gpio = AT91_PIN_PA21;
993 } 996 }
994} 997}
995 998
@@ -1009,6 +1012,7 @@ static struct resource uart1_resources[] = {
1009static struct atmel_uart_data uart1_data = { 1012static struct atmel_uart_data uart1_data = {
1010 .use_dma_tx = 1, 1013 .use_dma_tx = 1,
1011 .use_dma_rx = 1, 1014 .use_dma_rx = 1,
1015 .rts_gpio = -EINVAL,
1012}; 1016};
1013 1017
1014static u64 uart1_dmamask = DMA_BIT_MASK(32); 1018static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -1060,6 +1064,7 @@ static struct resource uart2_resources[] = {
1060static struct atmel_uart_data uart2_data = { 1064static struct atmel_uart_data uart2_data = {
1061 .use_dma_tx = 1, 1065 .use_dma_tx = 1,
1062 .use_dma_rx = 1, 1066 .use_dma_rx = 1,
1067 .rts_gpio = -EINVAL,
1063}; 1068};
1064 1069
1065static u64 uart2_dmamask = DMA_BIT_MASK(32); 1070static u64 uart2_dmamask = DMA_BIT_MASK(32);
@@ -1103,6 +1108,7 @@ static struct resource uart3_resources[] = {
1103static struct atmel_uart_data uart3_data = { 1108static struct atmel_uart_data uart3_data = {
1104 .use_dma_tx = 1, 1109 .use_dma_tx = 1,
1105 .use_dma_rx = 1, 1110 .use_dma_rx = 1,
1111 .rts_gpio = -EINVAL,
1106}; 1112};
1107 1113
1108static u64 uart3_dmamask = DMA_BIT_MASK(32); 1114static u64 uart3_dmamask = DMA_BIT_MASK(32);
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index eda8d1679d40..b52527c78b12 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -819,6 +819,7 @@ static struct resource dbgu_resources[] = {
819static struct atmel_uart_data dbgu_data = { 819static struct atmel_uart_data dbgu_data = {
820 .use_dma_tx = 0, 820 .use_dma_tx = 0,
821 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 821 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
822 .rts_gpio = -EINVAL,
822}; 823};
823 824
824static u64 dbgu_dmamask = DMA_BIT_MASK(32); 825static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -857,6 +858,7 @@ static struct resource uart0_resources[] = {
857static struct atmel_uart_data uart0_data = { 858static struct atmel_uart_data uart0_data = {
858 .use_dma_tx = 1, 859 .use_dma_tx = 1,
859 .use_dma_rx = 1, 860 .use_dma_rx = 1,
861 .rts_gpio = -EINVAL,
860}; 862};
861 863
862static u64 uart0_dmamask = DMA_BIT_MASK(32); 864static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -908,6 +910,7 @@ static struct resource uart1_resources[] = {
908static struct atmel_uart_data uart1_data = { 910static struct atmel_uart_data uart1_data = {
909 .use_dma_tx = 1, 911 .use_dma_tx = 1,
910 .use_dma_rx = 1, 912 .use_dma_rx = 1,
913 .rts_gpio = -EINVAL,
911}; 914};
912 915
913static u64 uart1_dmamask = DMA_BIT_MASK(32); 916static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -951,6 +954,7 @@ static struct resource uart2_resources[] = {
951static struct atmel_uart_data uart2_data = { 954static struct atmel_uart_data uart2_data = {
952 .use_dma_tx = 1, 955 .use_dma_tx = 1,
953 .use_dma_rx = 1, 956 .use_dma_rx = 1,
957 .rts_gpio = -EINVAL,
954}; 958};
955 959
956static u64 uart2_dmamask = DMA_BIT_MASK(32); 960static u64 uart2_dmamask = DMA_BIT_MASK(32);
@@ -994,6 +998,7 @@ static struct resource uart3_resources[] = {
994static struct atmel_uart_data uart3_data = { 998static struct atmel_uart_data uart3_data = {
995 .use_dma_tx = 1, 999 .use_dma_tx = 1,
996 .use_dma_rx = 1, 1000 .use_dma_rx = 1,
1001 .rts_gpio = -EINVAL,
997}; 1002};
998 1003
999static u64 uart3_dmamask = DMA_BIT_MASK(32); 1004static u64 uart3_dmamask = DMA_BIT_MASK(32);
@@ -1037,6 +1042,7 @@ static struct resource uart4_resources[] = {
1037static struct atmel_uart_data uart4_data = { 1042static struct atmel_uart_data uart4_data = {
1038 .use_dma_tx = 1, 1043 .use_dma_tx = 1,
1039 .use_dma_rx = 1, 1044 .use_dma_rx = 1,
1045 .rts_gpio = -EINVAL,
1040}; 1046};
1041 1047
1042static u64 uart4_dmamask = DMA_BIT_MASK(32); 1048static u64 uart4_dmamask = DMA_BIT_MASK(32);
@@ -1075,6 +1081,7 @@ static struct resource uart5_resources[] = {
1075static struct atmel_uart_data uart5_data = { 1081static struct atmel_uart_data uart5_data = {
1076 .use_dma_tx = 1, 1082 .use_dma_tx = 1,
1077 .use_dma_rx = 1, 1083 .use_dma_rx = 1,
1084 .rts_gpio = -EINVAL,
1078}; 1085};
1079 1086
1080static u64 uart5_dmamask = DMA_BIT_MASK(32); 1087static u64 uart5_dmamask = DMA_BIT_MASK(32);
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index b2a34740146a..6c1a2ecc306f 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -880,6 +880,7 @@ static struct resource dbgu_resources[] = {
880static struct atmel_uart_data dbgu_data = { 880static struct atmel_uart_data dbgu_data = {
881 .use_dma_tx = 0, 881 .use_dma_tx = 0,
882 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 882 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
883 .rts_gpio = -EINVAL,
883}; 884};
884 885
885static u64 dbgu_dmamask = DMA_BIT_MASK(32); 886static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -918,6 +919,7 @@ static struct resource uart0_resources[] = {
918static struct atmel_uart_data uart0_data = { 919static struct atmel_uart_data uart0_data = {
919 .use_dma_tx = 1, 920 .use_dma_tx = 1,
920 .use_dma_rx = 1, 921 .use_dma_rx = 1,
922 .rts_gpio = -EINVAL,
921}; 923};
922 924
923static u64 uart0_dmamask = DMA_BIT_MASK(32); 925static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -961,6 +963,7 @@ static struct resource uart1_resources[] = {
961static struct atmel_uart_data uart1_data = { 963static struct atmel_uart_data uart1_data = {
962 .use_dma_tx = 1, 964 .use_dma_tx = 1,
963 .use_dma_rx = 1, 965 .use_dma_rx = 1,
966 .rts_gpio = -EINVAL,
964}; 967};
965 968
966static u64 uart1_dmamask = DMA_BIT_MASK(32); 969static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -1004,6 +1007,7 @@ static struct resource uart2_resources[] = {
1004static struct atmel_uart_data uart2_data = { 1007static struct atmel_uart_data uart2_data = {
1005 .use_dma_tx = 1, 1008 .use_dma_tx = 1,
1006 .use_dma_rx = 1, 1009 .use_dma_rx = 1,
1010 .rts_gpio = -EINVAL,
1007}; 1011};
1008 1012
1009static u64 uart2_dmamask = DMA_BIT_MASK(32); 1013static u64 uart2_dmamask = DMA_BIT_MASK(32);
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index 4aeadddbc181..97cc2a0d6f90 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -1324,6 +1324,7 @@ static struct resource dbgu_resources[] = {
1324static struct atmel_uart_data dbgu_data = { 1324static struct atmel_uart_data dbgu_data = {
1325 .use_dma_tx = 0, 1325 .use_dma_tx = 0,
1326 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 1326 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
1327 .rts_gpio = -EINVAL,
1327}; 1328};
1328 1329
1329static u64 dbgu_dmamask = DMA_BIT_MASK(32); 1330static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -1362,6 +1363,7 @@ static struct resource uart0_resources[] = {
1362static struct atmel_uart_data uart0_data = { 1363static struct atmel_uart_data uart0_data = {
1363 .use_dma_tx = 1, 1364 .use_dma_tx = 1,
1364 .use_dma_rx = 1, 1365 .use_dma_rx = 1,
1366 .rts_gpio = -EINVAL,
1365}; 1367};
1366 1368
1367static u64 uart0_dmamask = DMA_BIT_MASK(32); 1369static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -1405,6 +1407,7 @@ static struct resource uart1_resources[] = {
1405static struct atmel_uart_data uart1_data = { 1407static struct atmel_uart_data uart1_data = {
1406 .use_dma_tx = 1, 1408 .use_dma_tx = 1,
1407 .use_dma_rx = 1, 1409 .use_dma_rx = 1,
1410 .rts_gpio = -EINVAL,
1408}; 1411};
1409 1412
1410static u64 uart1_dmamask = DMA_BIT_MASK(32); 1413static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -1448,6 +1451,7 @@ static struct resource uart2_resources[] = {
1448static struct atmel_uart_data uart2_data = { 1451static struct atmel_uart_data uart2_data = {
1449 .use_dma_tx = 1, 1452 .use_dma_tx = 1,
1450 .use_dma_rx = 1, 1453 .use_dma_rx = 1,
1454 .rts_gpio = -EINVAL,
1451}; 1455};
1452 1456
1453static u64 uart2_dmamask = DMA_BIT_MASK(32); 1457static u64 uart2_dmamask = DMA_BIT_MASK(32);
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index cb36fa872d30..c10149588e21 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -1587,6 +1587,7 @@ static struct resource dbgu_resources[] = {
1587static struct atmel_uart_data dbgu_data = { 1587static struct atmel_uart_data dbgu_data = {
1588 .use_dma_tx = 0, 1588 .use_dma_tx = 0,
1589 .use_dma_rx = 0, 1589 .use_dma_rx = 0,
1590 .rts_gpio = -EINVAL,
1590}; 1591};
1591 1592
1592static u64 dbgu_dmamask = DMA_BIT_MASK(32); 1593static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -1625,6 +1626,7 @@ static struct resource uart0_resources[] = {
1625static struct atmel_uart_data uart0_data = { 1626static struct atmel_uart_data uart0_data = {
1626 .use_dma_tx = 1, 1627 .use_dma_tx = 1,
1627 .use_dma_rx = 1, 1628 .use_dma_rx = 1,
1629 .rts_gpio = -EINVAL,
1628}; 1630};
1629 1631
1630static u64 uart0_dmamask = DMA_BIT_MASK(32); 1632static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -1668,6 +1670,7 @@ static struct resource uart1_resources[] = {
1668static struct atmel_uart_data uart1_data = { 1670static struct atmel_uart_data uart1_data = {
1669 .use_dma_tx = 1, 1671 .use_dma_tx = 1,
1670 .use_dma_rx = 1, 1672 .use_dma_rx = 1,
1673 .rts_gpio = -EINVAL,
1671}; 1674};
1672 1675
1673static u64 uart1_dmamask = DMA_BIT_MASK(32); 1676static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -1711,6 +1714,7 @@ static struct resource uart2_resources[] = {
1711static struct atmel_uart_data uart2_data = { 1714static struct atmel_uart_data uart2_data = {
1712 .use_dma_tx = 1, 1715 .use_dma_tx = 1,
1713 .use_dma_rx = 1, 1716 .use_dma_rx = 1,
1717 .rts_gpio = -EINVAL,
1714}; 1718};
1715 1719
1716static u64 uart2_dmamask = DMA_BIT_MASK(32); 1720static u64 uart2_dmamask = DMA_BIT_MASK(32);
@@ -1754,6 +1758,7 @@ static struct resource uart3_resources[] = {
1754static struct atmel_uart_data uart3_data = { 1758static struct atmel_uart_data uart3_data = {
1755 .use_dma_tx = 1, 1759 .use_dma_tx = 1,
1756 .use_dma_rx = 1, 1760 .use_dma_rx = 1,
1761 .rts_gpio = -EINVAL,
1757}; 1762};
1758 1763
1759static u64 uart3_dmamask = DMA_BIT_MASK(32); 1764static u64 uart3_dmamask = DMA_BIT_MASK(32);
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
index a698bdab2cce..4120af972b61 100644
--- a/arch/arm/mach-at91/at91sam9rl_devices.c
+++ b/arch/arm/mach-at91/at91sam9rl_devices.c
@@ -956,6 +956,7 @@ static struct resource dbgu_resources[] = {
956static struct atmel_uart_data dbgu_data = { 956static struct atmel_uart_data dbgu_data = {
957 .use_dma_tx = 0, 957 .use_dma_tx = 0,
958 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 958 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
959 .rts_gpio = -EINVAL,
959}; 960};
960 961
961static u64 dbgu_dmamask = DMA_BIT_MASK(32); 962static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -994,6 +995,7 @@ static struct resource uart0_resources[] = {
994static struct atmel_uart_data uart0_data = { 995static struct atmel_uart_data uart0_data = {
995 .use_dma_tx = 1, 996 .use_dma_tx = 1,
996 .use_dma_rx = 1, 997 .use_dma_rx = 1,
998 .rts_gpio = -EINVAL,
997}; 999};
998 1000
999static u64 uart0_dmamask = DMA_BIT_MASK(32); 1001static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -1045,6 +1047,7 @@ static struct resource uart1_resources[] = {
1045static struct atmel_uart_data uart1_data = { 1047static struct atmel_uart_data uart1_data = {
1046 .use_dma_tx = 1, 1048 .use_dma_tx = 1,
1047 .use_dma_rx = 1, 1049 .use_dma_rx = 1,
1050 .rts_gpio = -EINVAL,
1048}; 1051};
1049 1052
1050static u64 uart1_dmamask = DMA_BIT_MASK(32); 1053static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -1088,6 +1091,7 @@ static struct resource uart2_resources[] = {
1088static struct atmel_uart_data uart2_data = { 1091static struct atmel_uart_data uart2_data = {
1089 .use_dma_tx = 1, 1092 .use_dma_tx = 1,
1090 .use_dma_rx = 1, 1093 .use_dma_rx = 1,
1094 .rts_gpio = -EINVAL,
1091}; 1095};
1092 1096
1093static u64 uart2_dmamask = DMA_BIT_MASK(32); 1097static u64 uart2_dmamask = DMA_BIT_MASK(32);
@@ -1131,6 +1135,7 @@ static struct resource uart3_resources[] = {
1131static struct atmel_uart_data uart3_data = { 1135static struct atmel_uart_data uart3_data = {
1132 .use_dma_tx = 1, 1136 .use_dma_tx = 1,
1133 .use_dma_rx = 1, 1137 .use_dma_rx = 1,
1138 .rts_gpio = -EINVAL,
1134}; 1139};
1135 1140
1136static u64 uart3_dmamask = DMA_BIT_MASK(32); 1141static u64 uart3_dmamask = DMA_BIT_MASK(32);