Skip to contentSkip to conversation

MIPS: Octeon: fix CN6640 hang on XAUI init

PATCH Applied Stijn Tintel 2 participants 4 messages Apr 3, 2022 – Apr 26, 2022 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 MIPS: Octeon: fix CN6640 hang on XAUI init

Some CN66XX series Octeon II chips seem to hang if a reset is issued on XAUI initialization. Avoid the hang by disabling the reset.

Tested on SNIC10E.

---
 arch/mips/cavium-octeon/executive/cvmx-helper-xaui.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/mips/cavium-octeon/executive/cvmx-helper-xaui.c +3 -2
index fea71a85bb29..a92632223497 100644
@@ -156,8 +156,9 @@ int __cvmx_helper_xaui_enable(int interface)
 	xauiCtl.u64 = cvmx_read_csr(CVMX_PCSXX_CONTROL1_REG(interface));
 	xauiCtl.s.lo_pwr = 0;
 
-	/* Issuing a reset here seems to hang some CN68XX chips. */
-	if (!OCTEON_IS_MODEL(OCTEON_CN68XX_PASS1_X) &&
+	/* Issuing a reset here seems to hang some CN66XX/CN68XX chips. */
+	if (!OCTEON_IS_MODEL(OCTEON_CN66XX) &&
+	    !OCTEON_IS_MODEL(OCTEON_CN68XX_PASS1_X) &&
 	    !OCTEON_IS_MODEL(OCTEON_CN68XX_PASS2_X))
 		xauiCtl.s.reset = 1;
 
Signature · 1 line
2.35.1
#1 lore raw

PATCH 2/2 MIPS: Octeon: support all interfaces on CN66XX

CN66XX_PASS1_0 has 7 interfaces, other revisions have 8 interfaces.

---
 arch/mips/cavium-octeon/executive/cvmx-helper.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/mips/cavium-octeon/executive/cvmx-helper.c +6 -0
index b22f664e2d29..6f49fd9be1f3 100644
@@ -61,6 +61,12 @@ int cvmx_helper_get_number_of_interfaces(void)
 {
 	if (OCTEON_IS_MODEL(OCTEON_CN68XX))
 		return 9;
+	if (OCTEON_IS_MODEL(OCTEON_CN66XX)) {
+		if (OCTEON_IS_MODEL(OCTEON_CN66XX_PASS1_0))
+			return 7;
+		else
+			return 8;
+	}
 	if (OCTEON_IS_MODEL(OCTEON_CN56XX) || OCTEON_IS_MODEL(OCTEON_CN52XX))
 		return 4;
 	if (OCTEON_IS_MODEL(OCTEON_CN7XXX))
Signature · 1 line
2.35.1
maintainer Applied
#2 lore raw

Re: [PATCH 2/2] MIPS: Octeon: support all interfaces on CN66XX

Quoted 26 lines · Stijn Tintel

CN66XX_PASS1_0 has 7 interfaces, other revisions have 8 interfaces.

---
 arch/mips/cavium-octeon/executive/cvmx-helper.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/mips/cavium-octeon/executive/cvmx-helper.c +6 -0
index b22f664e2d29..6f49fd9be1f3 100644
@@ -61,6 +61,12 @@ int cvmx_helper_get_number_of_interfaces(void)
 {
 	if (OCTEON_IS_MODEL(OCTEON_CN68XX))
 		return 9;
+	if (OCTEON_IS_MODEL(OCTEON_CN66XX)) {
+		if (OCTEON_IS_MODEL(OCTEON_CN66XX_PASS1_0))
+			return 7;
+		else
+			return 8;
+	}
 	if (OCTEON_IS_MODEL(OCTEON_CN56XX) || OCTEON_IS_MODEL(OCTEON_CN52XX))
 		return 4;
 	if (OCTEON_IS_MODEL(OCTEON_CN7XXX))
Signature · 1 line
2.35.1

applied to mips-next.

Thomas.

Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]
maintainer Applied
#3 lore raw
In reply to Stijn Tintel
Quoted 28 lines · Stijn Tintel

Some CN66XX series Octeon II chips seem to hang if a reset is issued on XAUI initialization. Avoid the hang by disabling the reset.

Tested on SNIC10E.

---
 arch/mips/cavium-octeon/executive/cvmx-helper-xaui.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/mips/cavium-octeon/executive/cvmx-helper-xaui.c +3 -2
index fea71a85bb29..a92632223497 100644
@@ -156,8 +156,9 @@ int __cvmx_helper_xaui_enable(int interface)
 	xauiCtl.u64 = cvmx_read_csr(CVMX_PCSXX_CONTROL1_REG(interface));
 	xauiCtl.s.lo_pwr = 0;
 
-	/* Issuing a reset here seems to hang some CN68XX chips. */
-	if (!OCTEON_IS_MODEL(OCTEON_CN68XX_PASS1_X) &&
+	/* Issuing a reset here seems to hang some CN66XX/CN68XX chips. */
+	if (!OCTEON_IS_MODEL(OCTEON_CN66XX) &&
+	    !OCTEON_IS_MODEL(OCTEON_CN68XX_PASS1_X) &&
 	    !OCTEON_IS_MODEL(OCTEON_CN68XX_PASS2_X))
 		xauiCtl.s.reset = 1;
 
Signature · 1 line
2.35.1

applied to mips-next.

Thomas.

Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]