diff options
author | Fugang Duan <b38611@freescale.com> | 2014-11-24 09:35:43 +0800 |
---|---|---|
committer | Fugang Duan <b38611@freescale.com> | 2014-11-24 10:16:22 +0800 |
commit | eb733b07223649d186edd78b52f271edb66645ec (patch) | |
tree | d5ceebcb5044b690508a4ea0c82af51fddc93ebc /drivers | |
parent | d2cc5a4f15ceddb7a322ca01d75378d06d85a0ad (diff) |
MLK-9467 net: fec: init maximum receive buffer size for ring1 and ring2
i.MX6SX fec support three rx ring1, the current driver lost to init
ring1 and ring2 maximum receive buffer size, that cause receving
frame date length error. The driver reports "rcv is not +last" error
log in user case.
(cherry-picked from commit: 302693524e4efed489cf1dfa676b654e2ad68088)
Signed-off-by: Fugang Duan <B38611@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/freescale/fec.h | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h index 1317c72bfc11..f8e9d5763b9e 100644 --- a/drivers/net/ethernet/freescale/fec.h +++ b/drivers/net/ethernet/freescale/fec.h @@ -56,8 +56,10 @@ #define FEC_R_FSTART 0x150 /* FIFO receive start reg */ #define FEC_R_DES_START_1 0x160 /* Receive descriptor ring 1 */ #define FEC_X_DES_START_1 0x164 /* Transmit descriptor ring 1 */ +#define FEC_R_BUFF_SIZE_1 0x168 /* Maximum receive buff ring1 size */ #define FEC_R_DES_START_2 0x16c /* Receive descriptor ring 2 */ #define FEC_X_DES_START_2 0x170 /* Transmit descriptor ring 2 */ +#define FEC_R_BUFF_SIZE_2 0x174 /* Maximum receive buff ring2 size */ #define FEC_R_DES_START_0 0x180 /* Receive descriptor ring */ #define FEC_X_DES_START_0 0x184 /* Transmit descriptor ring */ #define FEC_R_BUFF_SIZE 0x188 /* Maximum receive buff size */ @@ -327,6 +329,7 @@ struct bufdesc_ex { ((X == 2) ? FEC_X_DES_ACTIVE_2 : FEC_X_DES_ACTIVE_0)) #define FEC_DMA_CFG(X) ((X == 2) ? FEC_DMA_CFG_2 : FEC_DMA_CFG_1) #define FEC_RCMR(X) ((X == 2) ? FEC_RCMR_2 : FEC_RCMR_1) +#define FEC_MRBR(X) ((X == 2) ? FEC_R_BUFF_SIZE_2 : FEC_R_BUFF_SIZE_1) #define DMA_CLASS_EN (1 << 16) #define IDLE_SLOPE_MASK 0xFFFF #define IDLE_SLOPE_1 0x200 /* BW fraction: 0.5 */ diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 39068571e97a..b9e4a46291a9 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -882,9 +882,11 @@ static void fec_enet_enable_ring(struct net_device *ndev) writel(rx_queue->bd_dma, fep->hwp + FEC_R_DES_START(i)); /* enable DMA1/2 */ - if (i) + if (i) { writel(RCMR_MATCHEN | RCMR_CMP(i), fep->hwp + FEC_RCMR(i)); + writel(PKT_MAXBLR_SIZE, fep->hwp + FEC_MRBR(i)); + } } for (i = 0; i < fep->num_tx_queues; i++) { |