summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2014-05-15 16:44:05 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2014-05-15 16:44:05 +0200
commit768d4af538e6d1fbc3f3342d6179427fa3e22bfe (patch)
tree88b33e595162cfcc6e337a3ded520d5134da5592
parenta0b49113b02cf13c3d5079f7f6ae1fcf63c9a953 (diff)
parentb2faeb5472fe71b505a103388b8a8540dbd47134 (diff)
Merge tag '3.0-vybrid-ts2.16' into colibri_vfColibri_VF_LinuxImageV2.2Beta1_20140603
3.0-vybrid-ts2.16 Conflicts: drivers/tty/serial/mvf.c
-rw-r--r--arch/arm/mach-mvf/board-twr-vf700.c4
-rw-r--r--arch/arm/mach-mvf/mvf_fec.c12
-rw-r--r--drivers/tty/serial/mvf.c46
3 files changed, 33 insertions, 29 deletions
diff --git a/arch/arm/mach-mvf/board-twr-vf700.c b/arch/arm/mach-mvf/board-twr-vf700.c
index 3c19b1c70ec9..576233588dde 100644
--- a/arch/arm/mach-mvf/board-twr-vf700.c
+++ b/arch/arm/mach-mvf/board-twr-vf700.c
@@ -249,13 +249,13 @@ static struct platform_device mvf_twr_audio_device = {
};
static struct imxuart_platform_data mvf_uart1_pdata = {
- .flags = IMXUART_FIFO | IMXUART_EDMA,
+ .flags = IMXUART_FIFO,
.dma_req_rx = DMA_MUX03_UART1_RX,
.dma_req_tx = DMA_MUX03_UART1_TX,
};
static struct imxuart_platform_data mvf_uart0_pdata = {
- .flags = IMXUART_FIFO | IMXUART_EDMA,
+ .flags = IMXUART_FIFO,
.dma_req_rx = DMA_MUX03_UART0_RX,
.dma_req_tx = DMA_MUX03_UART0_TX,
};
diff --git a/arch/arm/mach-mvf/mvf_fec.c b/arch/arm/mach-mvf/mvf_fec.c
index 5cbed27ba9aa..0ded64ebed13 100644
--- a/arch/arm/mach-mvf/mvf_fec.c
+++ b/arch/arm/mach-mvf/mvf_fec.c
@@ -35,13 +35,13 @@ static int fec_get_mac_addr(unsigned char *mac)
unsigned int value;
value = readl(MVF_IO_ADDRESS(MVF_FEC_BASE_ADDR) + ENET_PALR);
- mac[2] = value & 0xff;
- mac[3] = (value >> 8) & 0xff;
- mac[4] = (value >> 16) & 0xff;
- mac[5] = (value >> 24) & 0xff;
+ mac[3] = value & 0xff;
+ mac[2] = (value >> 8) & 0xff;
+ mac[1] = (value >> 16) & 0xff;
+ mac[0] = (value >> 24) & 0xff;
value = readl(MVF_IO_ADDRESS(MVF_FEC_BASE_ADDR) + ENET_PAUR);
- mac[0] = (value >> 16) & 0xff;
- mac[1] = (value >> 24) & 0xff;
+ mac[5] = (value >> 16) & 0xff;
+ mac[4] = (value >> 24) & 0xff;
return 0;
}
diff --git a/drivers/tty/serial/mvf.c b/drivers/tty/serial/mvf.c
index e539e46b59cb..a174b63e2225 100644
--- a/drivers/tty/serial/mvf.c
+++ b/drivers/tty/serial/mvf.c
@@ -84,22 +84,22 @@ struct imx_port {
unsigned int format_9bits:1; /* 9bits data format */
unsigned short trcv_delay; /* transceiver delay */
unsigned char ma_addr; /* Match address */
- struct clk *clk;
+ struct clk *clk;
unsigned int tx_fifo_size, rx_fifo_size;
/* DMA fields */
- int enable_dma;
+ int enable_dma;
unsigned long dma_tx_ch; /* configured eDMA channel */
struct imx_dma_data dma_data;
struct dma_chan *dma_chan_rx, *dma_chan_tx;
struct scatterlist rx_sgl, tx_sgl;
- void *rx_buf;
+ void *rx_buf;
unsigned char *tx_buf;
unsigned int rx_bytes, tx_bytes;
struct work_struct tsk_dma_tx;
unsigned int dma_tx_nents;
- bool dma_is_rxing, dma_is_txing;
+ bool dma_is_rxing, dma_is_txing;
wait_queue_head_t dma_wait;
};
@@ -226,21 +226,21 @@ static void tx_uart_dmarun(struct imx_port *sport)
if (sport->dma_tx_nents == 0)
return;
- mcf_edma_set_tcd_params(sport->dma_tx_ch,
- (u32)sg_phys(&sport->tx_sgl),
- (u32)(sport->port.mapbase + MXC_UARTDR),
+ mcf_edma_set_tcd_params(sport->dma_tx_ch, /* channel number */
+ (u32)sg_phys(&sport->tx_sgl), /* source */
+ (u32)(sport->port.mapbase + MXC_UARTDR), /* dest */
MCF_EDMA_TCD_ATTR_SSIZE_8BIT |
- MCF_EDMA_TCD_ATTR_DSIZE_8BIT,
- 1,
- 1,
- 0,
- sport->tx_bytes,
- 0,
- 0,
- 0,
+ MCF_EDMA_TCD_ATTR_DSIZE_8BIT, /* attr */
+ 1, /* soff */
+ 1, /* nbytes */
+ 0, /* slast */
+ sport->tx_bytes, /* citer */
+ 0, /* biter */
+ 0, /* doff */
+ 0, /* dlast_sga */
1, /* major_int */
1, /* disable_req */
- 0
+ 0 /* enabled sg */
);
sport->dma_is_txing = 1;
mcf_edma_enable_transfer(sport->dma_tx_ch);
@@ -304,7 +304,7 @@ static void dma_tx_work(struct work_struct *w)
{
if (sport->port.state->port.tty)
{
- uart_write_wakeup(&sport->port);
+ uart_write_wakeup(&sport->port);
}
}
@@ -359,7 +359,7 @@ static irqreturn_t imx_txint(int irq, void *dev_id)
{
if (sport->port.state->port.tty)
{
- uart_write_wakeup(&sport->port);
+ uart_write_wakeup(&sport->port);
}
}
@@ -435,7 +435,11 @@ static irqreturn_t imx_rxint(int irq, void *dev_id)
out:
spin_unlock_irqrestore(&sport->port.lock, flags);
- tty_flip_buffer_push(tty);
+ if (sport->rx_bytes) {
+ tty_flip_buffer_push(tty);
+ sport->rx_bytes = 0;
+ }
+
return IRQ_HANDLED;
}
@@ -634,10 +638,10 @@ static void imx_shutdown(struct uart_port *port)
if (sport->enable_dma) {
/* We have to wait for the DMA to finish. */
- if (sport->dma_tx_ch) {
+ if (sport->dma_tx_ch >= 0) {
mcf_edma_stop_transfer(sport->dma_tx_ch);
mcf_edma_free_channel(sport->dma_tx_ch, sport);
- sport->dma_tx_ch = 0;
+ sport->dma_tx_ch = -1;
}
}