aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-12-22 12:59:16 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-01-05 11:58:53 -0500
commit38d624361b2a82d6317c379aebf81b1b28210bb0 (patch)
treefca8b4acdba29a8550fc7e7d19de2d2228c36be8 /drivers
parent68b65f7305e54b822b2483c60de7d7b017526a92 (diff)
ARM: PL011: add DMA burst threshold support for ST variants
ST Micro variants has some specific dma burst threshold compensation, which allows them to make better use of a DMA controller. Add support to set this up. Based on a patch from Linus Walleij. Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/amba-pl011.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index ab025dc52fa4..e76d7d000128 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -74,6 +74,7 @@ struct vendor_data {
74 unsigned int lcrh_tx; 74 unsigned int lcrh_tx;
75 unsigned int lcrh_rx; 75 unsigned int lcrh_rx;
76 bool oversampling; 76 bool oversampling;
77 bool dma_threshold;
77}; 78};
78 79
79static struct vendor_data vendor_arm = { 80static struct vendor_data vendor_arm = {
@@ -82,6 +83,7 @@ static struct vendor_data vendor_arm = {
82 .lcrh_tx = UART011_LCRH, 83 .lcrh_tx = UART011_LCRH,
83 .lcrh_rx = UART011_LCRH, 84 .lcrh_rx = UART011_LCRH,
84 .oversampling = false, 85 .oversampling = false,
86 .dma_threshold = false,
85}; 87};
86 88
87static struct vendor_data vendor_st = { 89static struct vendor_data vendor_st = {
@@ -90,6 +92,7 @@ static struct vendor_data vendor_st = {
90 .lcrh_tx = ST_UART011_LCRH_TX, 92 .lcrh_tx = ST_UART011_LCRH_TX,
91 .lcrh_rx = ST_UART011_LCRH_RX, 93 .lcrh_rx = ST_UART011_LCRH_RX,
92 .oversampling = true, 94 .oversampling = true,
95 .dma_threshold = true,
93}; 96};
94 97
95/* Deals with DMA transactions */ 98/* Deals with DMA transactions */
@@ -527,6 +530,15 @@ static void pl011_dma_startup(struct uart_amba_port *uap)
527 /* Turn on DMA error (RX/TX will be enabled on demand) */ 530 /* Turn on DMA error (RX/TX will be enabled on demand) */
528 uap->dmacr |= UART011_DMAONERR; 531 uap->dmacr |= UART011_DMAONERR;
529 writew(uap->dmacr, uap->port.membase + UART011_DMACR); 532 writew(uap->dmacr, uap->port.membase + UART011_DMACR);
533
534 /*
535 * ST Micro variants has some specific dma burst threshold
536 * compensation. Set this to 16 bytes, so burst will only
537 * be issued above/below 16 bytes.
538 */
539 if (uap->vendor->dma_threshold)
540 writew(ST_UART011_DMAWM_RX_16 | ST_UART011_DMAWM_TX_16,
541 uap->port.membase + ST_UART011_DMAWM);
530} 542}
531 543
532static void pl011_dma_shutdown(struct uart_amba_port *uap) 544static void pl011_dma_shutdown(struct uart_amba_port *uap)