From: Paul Barker Date: Tue, 4 Mar 2025 20:07:08 +0000 (+0000) Subject: net: ravb: Fix RX frame size limit X-Git-Tag: v2025.07-rc1~18^2~57^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4226433858318be5914688963436ad41cbe2298d;p=pandora-u-boot.git net: ravb: Fix RX frame size limit The value written to the RFLR register includes the length of the CRC data at the end of each Ethernet frame. So we need to increase the value written to this register to ensure that we can receive full size frames. While we're here we can also copy the improved comment from the Linux kernel. Fixes: 8ae51b6f324e ("net: ravb: Add Renesas Ethernet RAVB driver") Signed-off-by: Paul Barker Signed-off-by: Marek Vasut # Fix comment Reviewed-by: Marek Vasut --- diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c index 6129929568a..c39bef17b79 100644 --- a/drivers/net/ravb.c +++ b/drivers/net/ravb.c @@ -354,8 +354,15 @@ static int ravb_mac_init(struct ravb_priv *eth) /* Disable MAC Interrupt */ writel(0, eth->iobase + RAVB_REG_ECSIPR); - /* Recv frame limit set register */ - writel(RFLR_RFL_MIN, eth->iobase + RAVB_REG_RFLR); + /* + * Set receive frame length + * + * The length set here describes the frame from the destination address + * up to and including the CRC data. However only the frame data, + * excluding the CRC, are transferred to memory. To allow for the + * largest frames add the CRC length to the maximum Rx descriptor size. + */ + writel(RFLR_RFL_MIN + ETH_FCS_LEN, eth->iobase + RAVB_REG_RFLR); return 0; }