From 0461033f67b4168142d39f4a55b944b5fcfb5a80 Mon Sep 17 00:00:00 2001 From: Giuseppe CAVALLARO Date: Tue, 13 Apr 2010 20:21:13 +0000 Subject: [PATCH] --- yaml --- r: 194063 b: refs/heads/master c: 688911c2f5e5e4f33b5a1c32839184f1fdf814ee h: refs/heads/master i: 194061: c353c34b7cec9119d8fd4495dac93495611bfd38 194059: 82fb288d4cb45e79a899a4a2fdad3d701ede65fb 194055: ca1e1cf9698d126cb900ded7b5287d5d7010add3 194047: 012cb600ca78513c17e0414df71d4836b087dba1 v: v3 --- [refs] | 2 +- trunk/drivers/net/stmmac/common.h | 1 + trunk/drivers/net/stmmac/dwmac1000.h | 1 - trunk/drivers/net/stmmac/dwmac1000_dma.c | 9 --------- trunk/drivers/net/stmmac/dwmac_dma.h | 1 + trunk/drivers/net/stmmac/dwmac_lib.c | 7 +++++++ trunk/drivers/net/stmmac/enh_desc.c | 6 +++--- 7 files changed, 13 insertions(+), 14 deletions(-) diff --git a/[refs] b/[refs] index 83686cf1e17c..08c36f4a487d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 56b106ae7b1f6b7cef4ef7e79a03b59cfc940923 +refs/heads/master: 688911c2f5e5e4f33b5a1c32839184f1fdf814ee diff --git a/trunk/drivers/net/stmmac/common.h b/trunk/drivers/net/stmmac/common.h index bd3b78510706..27a05b443ec3 100644 --- a/trunk/drivers/net/stmmac/common.h +++ b/trunk/drivers/net/stmmac/common.h @@ -244,3 +244,4 @@ extern void stmmac_set_mac_addr(unsigned long ioaddr, u8 addr[6], unsigned int high, unsigned int low); extern void stmmac_get_mac_addr(unsigned long ioaddr, unsigned char *addr, unsigned int high, unsigned int low); +extern void dwmac_dma_flush_tx_fifo(unsigned long ioaddr); diff --git a/trunk/drivers/net/stmmac/dwmac1000.h b/trunk/drivers/net/stmmac/dwmac1000.h index 3b784fc9320b..d8d0f3553770 100644 --- a/trunk/drivers/net/stmmac/dwmac1000.h +++ b/trunk/drivers/net/stmmac/dwmac1000.h @@ -172,7 +172,6 @@ enum rfd { deac_full_minus_4 = 0x00401800, }; #define DMA_CONTROL_TSF 0x00200000 /* Transmit Store and Forward */ -#define DMA_CONTROL_FTF 0x00100000 /* Flush transmit FIFO */ enum ttc_control { DMA_CONTROL_TTC_64 = 0x00000000, diff --git a/trunk/drivers/net/stmmac/dwmac1000_dma.c b/trunk/drivers/net/stmmac/dwmac1000_dma.c index 8d3ea99d8adf..a547aa99e114 100644 --- a/trunk/drivers/net/stmmac/dwmac1000_dma.c +++ b/trunk/drivers/net/stmmac/dwmac1000_dma.c @@ -58,15 +58,6 @@ static int dwmac1000_dma_init(unsigned long ioaddr, int pbl, u32 dma_tx, return 0; } -/* Transmit FIFO flush operation */ -static void dwmac1000_flush_tx_fifo(unsigned long ioaddr) -{ - u32 csr6 = readl(ioaddr + DMA_CONTROL); - writel((csr6 | DMA_CONTROL_FTF), ioaddr + DMA_CONTROL); - - do {} while ((readl(ioaddr + DMA_CONTROL) & DMA_CONTROL_FTF)); -} - static void dwmac1000_dma_operation_mode(unsigned long ioaddr, int txmode, int rxmode) { diff --git a/trunk/drivers/net/stmmac/dwmac_dma.h b/trunk/drivers/net/stmmac/dwmac_dma.h index de848d9f6060..7b815a1b7b8c 100644 --- a/trunk/drivers/net/stmmac/dwmac_dma.h +++ b/trunk/drivers/net/stmmac/dwmac_dma.h @@ -95,6 +95,7 @@ #define DMA_STATUS_TU 0x00000004 /* Transmit Buffer Unavailable */ #define DMA_STATUS_TPS 0x00000002 /* Transmit Process Stopped */ #define DMA_STATUS_TI 0x00000001 /* Transmit Interrupt */ +#define DMA_CONTROL_FTF 0x00100000 /* Flush transmit FIFO */ extern void dwmac_enable_dma_transmission(unsigned long ioaddr); extern void dwmac_enable_dma_irq(unsigned long ioaddr); diff --git a/trunk/drivers/net/stmmac/dwmac_lib.c b/trunk/drivers/net/stmmac/dwmac_lib.c index d4adb1eaa447..0a504adb7eb3 100644 --- a/trunk/drivers/net/stmmac/dwmac_lib.c +++ b/trunk/drivers/net/stmmac/dwmac_lib.c @@ -227,6 +227,13 @@ int dwmac_dma_interrupt(unsigned long ioaddr, return ret; } +void dwmac_dma_flush_tx_fifo(unsigned long ioaddr) +{ + u32 csr6 = readl(ioaddr + DMA_CONTROL); + writel((csr6 | DMA_CONTROL_FTF), ioaddr + DMA_CONTROL); + + do {} while ((readl(ioaddr + DMA_CONTROL) & DMA_CONTROL_FTF)); +} void stmmac_set_mac_addr(unsigned long ioaddr, u8 addr[6], unsigned int high, unsigned int low) diff --git a/trunk/drivers/net/stmmac/enh_desc.c b/trunk/drivers/net/stmmac/enh_desc.c index e5ac2593dc68..eb5684a1f713 100644 --- a/trunk/drivers/net/stmmac/enh_desc.c +++ b/trunk/drivers/net/stmmac/enh_desc.c @@ -40,7 +40,7 @@ static int enh_desc_get_tx_status(void *data, struct stmmac_extra_stats *x, if (unlikely(p->des01.etx.frame_flushed)) { CHIP_DBG(KERN_ERR "\tframe_flushed error\n"); x->tx_frame_flushed++; - /*enh_desc_flush_tx_fifo(ioaddr);*/ + dwmac_dma_flush_tx_fifo(ioaddr); } if (unlikely(p->des01.etx.loss_carrier)) { @@ -68,7 +68,7 @@ static int enh_desc_get_tx_status(void *data, struct stmmac_extra_stats *x, if (unlikely(p->des01.etx.underflow_error)) { CHIP_DBG(KERN_ERR "\tunderflow error\n"); - /*enh_desc_flush_tx_fifo(ioaddr);*/ + dwmac_dma_flush_tx_fifo(ioaddr); x->tx_underflow++; } @@ -80,7 +80,7 @@ static int enh_desc_get_tx_status(void *data, struct stmmac_extra_stats *x, if (unlikely(p->des01.etx.payload_error)) { CHIP_DBG(KERN_ERR "\tAddr/Payload csum error\n"); x->tx_payload_error++; - /*enh_desc_flush_tx_fifo(ioaddr);*/ + dwmac_dma_flush_tx_fifo(ioaddr); } ret = -1;