summaryrefslogtreecommitdiff
path: root/target/linux/cavium-octeon/patches/009-more_chip_specific_feature_tests.patch
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2009-05-06 18:12:49 +0000
committerFlorian Fainelli <florian@openwrt.org>2009-05-06 18:12:49 +0000
commit70f94ae2ab0e5460b817ad7b670f071d904d8bab (patch)
tree89145ffa8eb280689e41008eacbd8057e3ac0dc7 /target/linux/cavium-octeon/patches/009-more_chip_specific_feature_tests.patch
parent731a0e4791eafdb464c13b02383fae6711e72813 (diff)
downloadmtk-20170518-70f94ae2ab0e5460b817ad7b670f071d904d8bab.zip
mtk-20170518-70f94ae2ab0e5460b817ad7b670f071d904d8bab.tar.gz
mtk-20170518-70f94ae2ab0e5460b817ad7b670f071d904d8bab.tar.bz2
add support for the Cavium Octeon SoC, tested on a Mototech evaluation board
SVN-Revision: 15640
Diffstat (limited to 'target/linux/cavium-octeon/patches/009-more_chip_specific_feature_tests.patch')
-rw-r--r--target/linux/cavium-octeon/patches/009-more_chip_specific_feature_tests.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/target/linux/cavium-octeon/patches/009-more_chip_specific_feature_tests.patch b/target/linux/cavium-octeon/patches/009-more_chip_specific_feature_tests.patch
new file mode 100644
index 0000000..f4a06f2
--- /dev/null
+++ b/target/linux/cavium-octeon/patches/009-more_chip_specific_feature_tests.patch
@@ -0,0 +1,56 @@
+The octeon-ethernet driver needs to check for additional chip specific
+features, we add them to the octeon_has_feature() framework.
+
+Signed-off-by: David Daney <ddaney@caviumnetworks.com>
+---
+ arch/mips/include/asm/octeon/octeon-feature.h | 27 +++++++++++++++++++++++++
+ 1 files changed, 27 insertions(+), 0 deletions(-)
+
+diff --git a/arch/mips/include/asm/octeon/octeon-feature.h b/arch/mips/include/asm/octeon/octeon-feature.h
+index 04fac68..ef24a7b 100644
+--- a/arch/mips/include/asm/octeon/octeon-feature.h
++++ b/arch/mips/include/asm/octeon/octeon-feature.h
+@@ -57,6 +57,13 @@ enum octeon_feature {
+ OCTEON_FEATURE_RAID,
+ /* Octeon has a builtin USB */
+ OCTEON_FEATURE_USB,
++ /* Octeon IPD can run without using work queue entries */
++ OCTEON_FEATURE_NO_WPTR,
++ /* Octeon has DFA state machines */
++ OCTEON_FEATURE_DFA,
++ /* Octeon MDIO block supports clause 45 transactions for 10
++ * Gig support */
++ OCTEON_FEATURE_MDIO_CLAUSE_45,
+ };
+
+ static inline int cvmx_fuse_read(int fuse);
+@@ -112,6 +119,26 @@ static inline int octeon_has_feature(enum octeon_feature feature)
+ case OCTEON_FEATURE_USB:
+ return !(OCTEON_IS_MODEL(OCTEON_CN38XX)
+ || OCTEON_IS_MODEL(OCTEON_CN58XX));
++ case OCTEON_FEATURE_NO_WPTR:
++ return (OCTEON_IS_MODEL(OCTEON_CN56XX)
++ || OCTEON_IS_MODEL(OCTEON_CN52XX))
++ && !OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1_X)
++ && !OCTEON_IS_MODEL(OCTEON_CN52XX_PASS1_X);
++ case OCTEON_FEATURE_DFA:
++ if (!OCTEON_IS_MODEL(OCTEON_CN38XX)
++ && !OCTEON_IS_MODEL(OCTEON_CN31XX)
++ && !OCTEON_IS_MODEL(OCTEON_CN58XX))
++ return 0;
++ else if (OCTEON_IS_MODEL(OCTEON_CN3020))
++ return 0;
++ else if (OCTEON_IS_MODEL(OCTEON_CN38XX_PASS1))
++ return 1;
++ else
++ return !cvmx_fuse_read(120);
++ case OCTEON_FEATURE_MDIO_CLAUSE_45:
++ return !(OCTEON_IS_MODEL(OCTEON_CN3XXX)
++ || OCTEON_IS_MODEL(OCTEON_CN58XX)
++ || OCTEON_IS_MODEL(OCTEON_CN50XX));
+ }
+ return 0;
+ }
+--
+1.6.0.6
+