diff mbox series

[04/10] net/enetc: erratum wa for Rx lock-up issue

Message ID 20200302143209.11854-5-hemant.agrawal@nxp.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show
Series net/enetc: optimization and cleanup | expand

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Hemant Agrawal March 2, 2020, 2:32 p.m. UTC
From: Alex Marginean <alexandru.marginean@nxp.com>

The default value in hardware for the Rx MAC FIFO (@) is higher than it
should be and can lead to Rx lock-up under traffic.
Set it to the value recommended by hardware team, 1.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
 drivers/net/enetc/base/enetc_hw.h | 3 ++-
 drivers/net/enetc/enetc_ethdev.c  | 5 ++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/enetc/base/enetc_hw.h b/drivers/net/enetc/base/enetc_hw.h
index 2fe7ccb5b..00813284e 100644
--- a/drivers/net/enetc/base/enetc_hw.h
+++ b/drivers/net/enetc/base/enetc_hw.h
@@ -1,5 +1,5 @@ 
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright 2018-2019 NXP
+ * Copyright 2018-2020 NXP
  */
 
 #ifndef _ENETC_HW_H_
@@ -86,6 +86,7 @@  enum enetc_bdr_type {TX, RX};
 #define ENETC_PSIPMAR1(n)		(0x00104 + (n) * 0x20)
 #define ENETC_PCAPR0			0x00900
 #define ENETC_PCAPR1			0x00904
+#define ENETC_PM0_RX_FIFO		0x801C
 #define ENETC_PM0_IF_MODE		0x8300
 #define ENETC_PM1_IF_MODE		0x9300
 #define ENETC_PMO_IFM_RG		BIT(2)
diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c
index 20b77c006..eb637d030 100644
--- a/drivers/net/enetc/enetc_ethdev.c
+++ b/drivers/net/enetc/enetc_ethdev.c
@@ -1,5 +1,5 @@ 
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright 2018-2019 NXP
+ * Copyright 2018-2020 NXP
  */
 
 #include <stdbool.h>
@@ -147,6 +147,9 @@  enetc_hardware_init(struct enetc_eth_hw *hw)
 	hw->hw.port = (void *)((size_t)hw->hw.reg + ENETC_PORT_BASE);
 	hw->hw.global = (void *)((size_t)hw->hw.reg + ENETC_GLOBAL_BASE);
 
+	/* WA for Rx lock-up HW erratum */
+	enetc_port_wr(enetc_hw, ENETC_PM0_RX_FIFO, 1);
+
 	/* Enabling Station Interface */
 	enetc_wr(enetc_hw, ENETC_SIMR, ENETC_SIMR_EN);