mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v1 1/2] net: designware: eqos: fix receive issue with external switch
@ 2022-04-07  9:02 Oleksij Rempel
  2022-04-07  9:02 ` [PATCH v1 2/2] net: designware: eqos: do not try to talk to not existing PHY Oleksij Rempel
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Oleksij Rempel @ 2022-04-07  9:02 UTC (permalink / raw)
  To: barebox; +Cc: Oleksij Rempel

Do not drop packets with error status (CRC error, receive error, watchdog
timeout, or overflow) otherwise we wont be able to receive packets from
a switch with enabled tagging.

In case we have switch with tagging enabled, ingress packets will be
modified by the switch. Most probably this will affect CRC calculation,
so all incoming packets are dropped.

Setting FEP and FUP is recommended programming model described in
STM32MP157 reference manual. See "64.9.2 MTL initialization":

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/net/designware_eqos.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/designware_eqos.c b/drivers/net/designware_eqos.c
index 8d2a21c220..1f97d84880 100644
--- a/drivers/net/designware_eqos.c
+++ b/drivers/net/designware_eqos.c
@@ -112,6 +112,8 @@ struct eqos_mtl_regs {
 #define EQOS_MTL_RXQ0_OPERATION_MODE_RFA_MASK		0x3f
 #define EQOS_MTL_RXQ0_OPERATION_MODE_EHFC		BIT(7)
 #define EQOS_MTL_RXQ0_OPERATION_MODE_RSF		BIT(5)
+#define EQOS_MTL_RXQ0_OPERATION_MODE_FEP		BIT(4)
+#define EQOS_MTL_RXQ0_OPERATION_MODE_FUP		BIT(3)
 
 #define EQOS_MTL_RXQ0_DEBUG_PRXQ_SHIFT			16
 #define EQOS_MTL_RXQ0_DEBUG_PRXQ_MASK			0x7fff
@@ -433,7 +435,9 @@ static int eqos_start(struct eth_device *edev)
 
 	/* Enable Store and Forward mode for RX, since no jumbo frame */
 	setbits_le32(&eqos->mtl_regs->rxq0_operation_mode,
-		     EQOS_MTL_RXQ0_OPERATION_MODE_RSF);
+		     EQOS_MTL_RXQ0_OPERATION_MODE_RSF |
+		     EQOS_MTL_RXQ0_OPERATION_MODE_FEP |
+		     EQOS_MTL_RXQ0_OPERATION_MODE_FUP);
 
 	/* Transmit/Receive queue fifo size; use all RAM for 1 queue */
 	val = readl(&eqos->mac_regs->hw_feature1);
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-12  8:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-07  9:02 [PATCH v1 1/2] net: designware: eqos: fix receive issue with external switch Oleksij Rempel
2022-04-07  9:02 ` [PATCH v1 2/2] net: designware: eqos: do not try to talk to not existing PHY Oleksij Rempel
2022-04-07 12:23   ` Ahmad Fatoum
2022-04-07 12:39     ` Oleksij Rempel
2022-04-07 12:23 ` [PATCH v1 1/2] net: designware: eqos: fix receive issue with external switch Ahmad Fatoum
2022-04-12  8:55 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox