All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers: net: Soft reset felix switch core
@ 2021-11-27 12:52 Radu Bulie
  2021-11-27 15:06 ` Vladimir Oltean
  0 siblings, 1 reply; 4+ messages in thread
From: Radu Bulie @ 2021-11-27 12:52 UTC (permalink / raw)
  To: joe.hershberger
  Cc: u-boot, rfried.dev, alexandru.marginean, vladimir.oltean,
	claudiu.manoil, Radu Bulie

It turns out that in custom designs if the system is reset
multiple times in conjunction with a slight increase in external
temperature, the felix  switch starts to behave in a strange way:
packets are no longer received on the ENECT interface connected
to the L2switch internal port (the TX side of internal port stops working
or the packets do not reach there. It is not very clear where
the packets remain blocked. None of the counters points to a disruption
in the L2switch)
The issue is not reproducible on NXP reference designs.

It was observed that by adding the switch core reset, the problem
goes aways, even if intensive testing in temperature chambers
is applied.

The current patch performs soft reset on the switch core to ensure proper
operation of the L2switch.

Signed-off-by: Radu Bulie <radu-andrei.bulie@nxp.com>
---
 drivers/net/mscc_eswitch/felix_switch.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mscc_eswitch/felix_switch.c b/drivers/net/mscc_eswitch/felix_switch.c
index 2df8dde55f..60b2e8f32d 100644
--- a/drivers/net/mscc_eswitch/felix_switch.c
+++ b/drivers/net/mscc_eswitch/felix_switch.c
@@ -40,7 +40,9 @@
 #define FELIX_IS2			0x060000
 #define FELIX_GMII(port)		(0x100000 + (port) * 0x10000)
 #define FELIX_QSYS			0x200000
-
+#define FELIX_DEVCPU_GCB		0x070000
+#define FELIX_DEVCPU_GCB_SOFT_RST	(FELIX_DEVCPU_GCB + 0x00000004)
+#define SOFT_SWC_RST			BIT(0)
 #define FELIX_SYS_SYSTEM		(FELIX_SYS + 0x00000E00)
 #define  FELIX_SYS_SYSTEM_EN		BIT(0)
 #define FELIX_SYS_RAM_CTRL		(FELIX_SYS + 0x00000F24)
@@ -237,6 +239,15 @@ static void felix_init(struct udevice *dev)
 	void *base = priv->regs_base;
 	int timeout = 100;
 
+	/* Switch core reset */
+	out_le32(base + FELIX_DEVCPU_GCB_SOFT_RST, SOFT_SWC_RST);
+	while (in_le32(base + FELIX_DEVCPU_GCB_SOFT_RST) & SOFT_SWC_RST &&
+	       --timeout)
+		udelay(10);
+	if (in_le32(base + FELIX_DEVCPU_GCB_SOFT_RST) & SOFT_SWC_RST)
+		dev_err(dev, "Timeout waiting for switch core reset\n");
+	timeout = 100;
+
 	/* Init core memories */
 	out_le32(base + FELIX_SYS_RAM_CTRL, FELIX_SYS_RAM_CTRL_INIT);
 	while (in_le32(base + FELIX_SYS_RAM_CTRL) & FELIX_SYS_RAM_CTRL_INIT &&
-- 
2.17.1


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

* Re: [PATCH] drivers: net: Soft reset felix switch core
  2021-11-27 12:52 [PATCH] drivers: net: Soft reset felix switch core Radu Bulie
@ 2021-11-27 15:06 ` Vladimir Oltean
  2021-11-27 19:36   ` Ramon Fried
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Oltean @ 2021-11-27 15:06 UTC (permalink / raw)
  To: Radu-Andrei Bulie
  Cc: joe.hershberger, u-boot, rfried.dev, Alexandru Marginean, Claudiu Manoil

On Sat, Nov 27, 2021 at 02:52:35PM +0200, Radu Bulie wrote:
> It turns out that in custom designs if the system is reset
> multiple times in conjunction with a slight increase in external
> temperature, the felix  switch starts to behave in a strange way:
> packets are no longer received on the ENECT interface connected
> to the L2switch internal port (the TX side of internal port stops working
> or the packets do not reach there. It is not very clear where
> the packets remain blocked. None of the counters points to a disruption
> in the L2switch)
> The issue is not reproducible on NXP reference designs.
> 
> It was observed that by adding the switch core reset, the problem
> goes aways, even if intensive testing in temperature chambers
> is applied.
> 
> The current patch performs soft reset on the switch core to ensure proper
> operation of the L2switch.
> 
> Signed-off-by: Radu Bulie <radu-andrei.bulie@nxp.com>
> ---

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Thanks!

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

* Re: [PATCH] drivers: net: Soft reset felix switch core
  2021-11-27 15:06 ` Vladimir Oltean
@ 2021-11-27 19:36   ` Ramon Fried
  2021-12-02  5:13     ` Ramon Fried
  0 siblings, 1 reply; 4+ messages in thread
From: Ramon Fried @ 2021-11-27 19:36 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: Radu-Andrei Bulie, joe.hershberger, u-boot, Alexandru Marginean,
	Claudiu Manoil

On Sat, Nov 27, 2021 at 5:06 PM Vladimir Oltean <vladimir.oltean@nxp.com> wrote:
>
> On Sat, Nov 27, 2021 at 02:52:35PM +0200, Radu Bulie wrote:
> > It turns out that in custom designs if the system is reset
> > multiple times in conjunction with a slight increase in external
> > temperature, the felix  switch starts to behave in a strange way:
> > packets are no longer received on the ENECT interface connected
> > to the L2switch internal port (the TX side of internal port stops working
> > or the packets do not reach there. It is not very clear where
> > the packets remain blocked. None of the counters points to a disruption
> > in the L2switch)
> > The issue is not reproducible on NXP reference designs.
> >
> > It was observed that by adding the switch core reset, the problem
> > goes aways, even if intensive testing in temperature chambers
> > is applied.
> >
> > The current patch performs soft reset on the switch core to ensure proper
> > operation of the L2switch.
> >
> > Signed-off-by: Radu Bulie <radu-andrei.bulie@nxp.com>
> > ---
>
> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
>
> Thanks!
Reviewed-by: Ramon  Fried <rfried.dev@gmail.com>

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

* Re: [PATCH] drivers: net: Soft reset felix switch core
  2021-11-27 19:36   ` Ramon Fried
@ 2021-12-02  5:13     ` Ramon Fried
  0 siblings, 0 replies; 4+ messages in thread
From: Ramon Fried @ 2021-12-02  5:13 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: Radu-Andrei Bulie, joe.hershberger, u-boot, Alexandru Marginean,
	Claudiu Manoil

On Sat, Nov 27, 2021 at 9:36 PM Ramon Fried <rfried.dev@gmail.com> wrote:
>
> On Sat, Nov 27, 2021 at 5:06 PM Vladimir Oltean <vladimir.oltean@nxp.com> wrote:
> >
> > On Sat, Nov 27, 2021 at 02:52:35PM +0200, Radu Bulie wrote:
> > > It turns out that in custom designs if the system is reset
> > > multiple times in conjunction with a slight increase in external
> > > temperature, the felix  switch starts to behave in a strange way:
> > > packets are no longer received on the ENECT interface connected
> > > to the L2switch internal port (the TX side of internal port stops working
> > > or the packets do not reach there. It is not very clear where
> > > the packets remain blocked. None of the counters points to a disruption
> > > in the L2switch)
> > > The issue is not reproducible on NXP reference designs.
> > >
> > > It was observed that by adding the switch core reset, the problem
> > > goes aways, even if intensive testing in temperature chambers
> > > is applied.
> > >
> > > The current patch performs soft reset on the switch core to ensure proper
> > > operation of the L2switch.
> > >
> > > Signed-off-by: Radu Bulie <radu-andrei.bulie@nxp.com>
> > > ---
> >
> > Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> >
> > Thanks!
> Reviewed-by: Ramon  Fried <rfried.dev@gmail.com>
Applied to u-boot-net/next,
Thanks.

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

end of thread, other threads:[~2021-12-02  5:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-27 12:52 [PATCH] drivers: net: Soft reset felix switch core Radu Bulie
2021-11-27 15:06 ` Vladimir Oltean
2021-11-27 19:36   ` Ramon Fried
2021-12-02  5:13     ` Ramon Fried

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.