1 From 35efc0f34b56ca9d5fb5d080d5de0833ded7e3b8 Mon Sep 17 00:00:00 2001
2 From: Anji J <anji.jagarlmudi@freescale.com>
3 Date: Tue, 21 Jun 2016 13:25:12 +0530
4 Subject: [PATCH 66/93] armv8:pfe Enable UDP checksum for proper tftp
7 1. Add CONFIG_UDP_CHECKSUM flag to perform UDP checksum in S/W
9 2. Rx descriptor model changed back to original
11 3. Send more than one dummy packets to bring HIF BD to idle state
13 Signed-off-by: Anji J <anji.jagarlmudi@freescale.com>
15 common/cmd_pfe_commands.c | 12 +++++++-----
16 drivers/net/pfe_eth/pfe_driver.c | 19 +++----------------
17 include/configs/ls1012a_common.h | 1 +
18 3 files changed, 11 insertions(+), 21 deletions(-)
20 diff --git a/common/cmd_pfe_commands.c b/common/cmd_pfe_commands.c
21 index 92917e0..3575ad4 100644
22 --- a/common/cmd_pfe_commands.c
23 +++ b/common/cmd_pfe_commands.c
24 @@ -929,7 +929,7 @@ static void send_dummy_pkt_to_hif(void)
26 static void pfe_command_stop(int argc, char * const argv[])
29 + int id, hif_stop_loop = 10;
31 printf("Stopping PFE... \n");
33 @@ -937,10 +937,12 @@ static void pfe_command_stop(int argc, char * const argv[])
34 hif_rx_desc_disable();
36 /*If HIF Rx BDP is busy send a dummy packet */
37 - rx_status = readl(HIF_RX_STATUS);
38 - if(rx_status & BDP_CSR_RX_DMA_ACTV)
39 - send_dummy_pkt_to_hif();
42 + rx_status = readl(HIF_RX_STATUS);
43 + if (rx_status & BDP_CSR_RX_DMA_ACTV)
44 + send_dummy_pkt_to_hif();
46 + } while (hif_stop_loop--);
48 if(readl(HIF_RX_STATUS) & BDP_CSR_RX_DMA_ACTV)
49 printf("Unable to stop HIF\n");
50 diff --git a/drivers/net/pfe_eth/pfe_driver.c b/drivers/net/pfe_eth/pfe_driver.c
51 index e252fcf..6774fb4 100644
52 --- a/drivers/net/pfe_eth/pfe_driver.c
53 +++ b/drivers/net/pfe_eth/pfe_driver.c
54 @@ -37,13 +37,8 @@ int pfe_recv(unsigned int *pkt_ptr, int *phy_port)
56 bd = rx_desc->rxBase + rx_desc->rxToRead;
58 - if (bd->ctrl & BD_CTRL_DESC_EN) {
59 - if(!(readl(HIF_RX_STATUS) & BDP_CSR_RX_DMA_ACTV)){
60 - /*If BDP is not active give write strobe */
61 - writel((readl(HIF_RX_CTRL) | HIF_CTRL_BDP_CH_START_WSTB), HIF_RX_CTRL);
63 + if (bd->ctrl & BD_CTRL_DESC_EN)
64 return len; //No pending Rx packet
67 /* this len include hif_header(8bytes) */
68 len = bd->ctrl & 0xFFFF;
69 @@ -72,15 +67,10 @@ int pfe_recv(unsigned int *pkt_ptr, int *phy_port)
70 *phy_port = hif_header->port_no;
71 len -= sizeof(struct hif_header_s);
73 -#if defined(PFE_LS1012A_RESET_WA)
74 - /* reset bd control field */
75 - ctrl = (MAX_FRAME_SIZE | BD_CTRL_LAST_BD | BD_CTRL_LIFM | BD_CTRL_DESC_EN | BD_CTRL_DIR);
77 /* reset bd control field */
78 ctrl = (MAX_FRAME_SIZE | BD_CTRL_LIFM | BD_CTRL_DESC_EN | BD_CTRL_DIR);
79 - /* If we use BD_CTRL_LAST_BD, rxToRead never changes */
80 rx_desc->rxToRead = (rx_desc->rxToRead + 1) & (rx_desc->rxRingSize - 1);
86 @@ -363,11 +353,8 @@ static int hif_rx_desc_init(struct pfe *pfe)
88 memset(bd_va, 0, sizeof(struct bufDesc) * rx_desc->rxRingSize);
90 -#if defined(PFE_LS1012A_RESET_WA)
91 - ctrl = (MAX_FRAME_SIZE | BD_CTRL_LAST_BD | BD_CTRL_DESC_EN | BD_CTRL_DIR | BD_CTRL_LIFM);
93 ctrl = (MAX_FRAME_SIZE | BD_CTRL_DESC_EN | BD_CTRL_DIR | BD_CTRL_LIFM);
96 for (i=0; i < rx_desc->rxRingSize; i++) {
97 bd_va->next = (unsigned long)(bd_pa + 1);
99 diff --git a/include/configs/ls1012a_common.h b/include/configs/ls1012a_common.h
100 index 4c7c697..47b8ec3 100644
101 --- a/include/configs/ls1012a_common.h
102 +++ b/include/configs/ls1012a_common.h
104 #ifdef CONFIG_FSL_PPFE
105 #define CONFIG_CMD_PFE_COMMANDS
106 #define CONFIG_UTIL_PE_DISABLED
107 +#define CONFIG_UDP_CHECKSUM