[linux] 03/03: [mips*/octeon] Backport Octeon III CN7xxx interface detection from 4.7 queue.

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Mon Apr 4 22:12:49 UTC 2016


This is an automated email from the git hooks/post-receive script.

aurel32 pushed a commit to branch master
in repository linux.

commit 24993989ff42d14d495531baf168197792a2186f
Author: Aurelien Jarno <aurelien at aurel32.net>
Date:   Mon Apr 4 22:20:30 2016 +0200

    [mips*/octeon] Backport Octeon III CN7xxx interface detection from 4.7 queue.
---
 ...Add-Octeon-III-CN7xxx-interface-detection.patch | 89 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 90 insertions(+)

diff --git a/debian/patches/features/mips/MIPS-Octeon-Add-Octeon-III-CN7xxx-interface-detection.patch b/debian/patches/features/mips/MIPS-Octeon-Add-Octeon-III-CN7xxx-interface-detection.patch
new file mode 100644
index 0000000..744b528
--- /dev/null
+++ b/debian/patches/features/mips/MIPS-Octeon-Add-Octeon-III-CN7xxx-interface-detection.patch
@@ -0,0 +1,89 @@
+From: Zubair Lutfullah Kakakhel <Zubair.Kakakhel at imgtec.com>
+Date: Wed, 3 Feb 2016 18:01:36 +0000
+Subject: MIPS: Octeon: Add Octeon III CN7xxx interface detection
+Origin: https://patchwork.linux-mips.org/patch/12376/
+
+Add basic CN7XXX interface detection.
+
+This allows the kernel to boot with ethernet working as it initializes
+the ethernet ports with SGMII instead of defaulting to RGMII routines.
+
+Tested on the utm8 from Rhino Labs with a CN7130.
+
+Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel at imgtec.com>
+Acked-by: David Daney <david.daney at cavium.com>
+---
+ arch/mips/cavium-octeon/executive/cvmx-helper.c | 43 +++++++++++++++++++++++++
+ 1 file changed, 43 insertions(+)
+
+diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper.c b/arch/mips/cavium-octeon/executive/cvmx-helper.c
+index 376701f..ff26d02 100644
+--- a/arch/mips/cavium-octeon/executive/cvmx-helper.c
++++ b/arch/mips/cavium-octeon/executive/cvmx-helper.c
+@@ -87,6 +87,8 @@ int cvmx_helper_get_number_of_interfaces(void)
+ 		return 9;
+ 	if (OCTEON_IS_MODEL(OCTEON_CN56XX) || OCTEON_IS_MODEL(OCTEON_CN52XX))
+ 		return 4;
++	if (OCTEON_IS_MODEL(OCTEON_CN7XXX))
++		return 5;
+ 	else
+ 		return 3;
+ }
+@@ -260,6 +262,41 @@ static cvmx_helper_interface_mode_t __cvmx_get_mode_octeon2(int interface)
+ }
+ 
+ /**
++ * @INTERNAL
++ * Return interface mode for CN7XXX.
++ */
++static cvmx_helper_interface_mode_t __cvmx_get_mode_cn7xxx(int interface)
++{
++	union cvmx_gmxx_inf_mode mode;
++
++	mode.u64 = cvmx_read_csr(CVMX_GMXX_INF_MODE(interface));
++
++	switch (interface) {
++	case 0:
++	case 1:
++		switch (mode.cn68xx.mode) {
++		case 0:
++			return CVMX_HELPER_INTERFACE_MODE_DISABLED;
++		case 1:
++		case 2:
++			return CVMX_HELPER_INTERFACE_MODE_SGMII;
++		case 3:
++			return CVMX_HELPER_INTERFACE_MODE_XAUI;
++		default:
++			return CVMX_HELPER_INTERFACE_MODE_SGMII;
++		}
++	case 2:
++		return CVMX_HELPER_INTERFACE_MODE_NPI;
++	case 3:
++		return CVMX_HELPER_INTERFACE_MODE_LOOP;
++	case 4:
++		return CVMX_HELPER_INTERFACE_MODE_RGMII;
++	default:
++		return CVMX_HELPER_INTERFACE_MODE_DISABLED;
++	}
++}
++
++/**
+  * Get the operating mode of an interface. Depending on the Octeon
+  * chip and configuration, this function returns an enumeration
+  * of the type of packet I/O supported by an interface.
+@@ -278,6 +315,12 @@ cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode(int interface)
+ 		return CVMX_HELPER_INTERFACE_MODE_DISABLED;
+ 
+ 	/*
++	 * OCTEON III models
++	 */
++	if (OCTEON_IS_MODEL(OCTEON_CN7XXX))
++		return __cvmx_get_mode_cn7xxx(interface);
++
++	/*
+ 	 * Octeon II models
+ 	 */
+ 	if (OCTEON_IS_MODEL(OCTEON_CN6XXX) || OCTEON_IS_MODEL(OCTEON_CNF71XX))
+-- 
+2.8.0.rc3
+
diff --git a/debian/patches/series b/debian/patches/series
index 2fe9bc2..7aa6e87 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -51,6 +51,7 @@ features/mips/MIPS-increase-MAX-PHYSMEM-BITS-on-Loongson-3-only.patch
 features/mips/MIPS-Loongson-3-Add-Loongson-LS3A-RS780E-1-way-machi.patch
 features/mips/MIPS-octeon-Add-support-for-the-UBNT-E200-board.patch
 features/mips/libata-support-AHCI-on-OCTEON-platform.patch
+features/mips/MIPS-Octeon-Add-Octeon-III-CN7xxx-interface-detection.patch
 features/x86/x86-memtest-WARN-if-bad-RAM-found.patch
 features/x86/x86-make-x32-syscall-support-conditional.patch
 features/sparc/hwrng-n2-attach-on-t5-m5-t7-m7-sparc-cpus.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list