1 From f5be11cd83a6d6d4de7bd7cbeb641bb1032c4f84 Mon Sep 17 00:00:00 2001
2 From: Calvin Johnson <calvin.johnson@nxp.com>
3 Date: Wed, 20 Jun 2018 10:22:50 +0530
4 Subject: [PATCH] staging: fsl_ppfe/eth: use mask for rx max frame len
6 Define and use PFE_RCR_MAX_FL_MASK to properly set Rx max frame
7 length of MAC Receive Control Register.
9 Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com>
11 drivers/staging/fsl_ppfe/pfe_hal.c | 10 ++++++----
12 1 file changed, 6 insertions(+), 4 deletions(-)
14 --- a/drivers/staging/fsl_ppfe/pfe_hal.c
15 +++ b/drivers/staging/fsl_ppfe/pfe_hal.c
20 +#define PFE_RCR_MAX_FL_MASK 0xC000FFFF
24 unsigned long ddr_phys_base_addr;
25 @@ -1011,8 +1013,8 @@ void gemac_no_broadcast(void *base)
26 void gemac_enable_1536_rx(void *base)
28 /* Set 1536 as Maximum frame length */
29 - writel(readl(base + EMAC_RCNTRL_REG) | (1536 << 16), base +
31 + writel((readl(base + EMAC_RCNTRL_REG) & PFE_RCR_MAX_FL_MASK)
32 + | (1536 << 16), base + EMAC_RCNTRL_REG);
35 /* GEMAC enable jumbo function.
36 @@ -1020,8 +1022,8 @@ void gemac_enable_1536_rx(void *base)
38 void gemac_enable_rx_jmb(void *base)
40 - writel(readl(base + EMAC_RCNTRL_REG) | (JUMBO_FRAME_SIZE << 16), base
42 + writel((readl(base + EMAC_RCNTRL_REG) & PFE_RCR_MAX_FL_MASK)
43 + | (JUMBO_FRAME_SIZE << 16), base + EMAC_RCNTRL_REG);
46 /* GEMAC enable stacked vlan function.