aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDavid Daney <ddaney@caviumnetworks.com>2009-05-05 20:35:19 -0400
committerRalf Baechle <ralf@linux-mips.org>2009-06-17 06:06:29 -0400
commitf1f1f5902be0cec3b5026610f360cd471765c157 (patch)
tree6e17e8a538a667d983382ed13ff62c07eafaaf94 /arch
parent2b1b62e841867326fa260a581d97941c32abc35b (diff)
MIPS: Cavium-Octeon: Add more chip specific feature tests.
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> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/include/asm/octeon/octeon-feature.h27
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 04fac684069..ef24a7b4ea5 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 {
57 OCTEON_FEATURE_RAID, 57 OCTEON_FEATURE_RAID,
58 /* Octeon has a builtin USB */ 58 /* Octeon has a builtin USB */
59 OCTEON_FEATURE_USB, 59 OCTEON_FEATURE_USB,
60 /* Octeon IPD can run without using work queue entries */
61 OCTEON_FEATURE_NO_WPTR,
62 /* Octeon has DFA state machines */
63 OCTEON_FEATURE_DFA,
64 /* Octeon MDIO block supports clause 45 transactions for 10
65 * Gig support */
66 OCTEON_FEATURE_MDIO_CLAUSE_45,
60}; 67};
61 68
62static inline int cvmx_fuse_read(int fuse); 69static inline int cvmx_fuse_read(int fuse);
@@ -112,6 +119,26 @@ static inline int octeon_has_feature(enum octeon_feature feature)
112 case OCTEON_FEATURE_USB: 119 case OCTEON_FEATURE_USB:
113 return !(OCTEON_IS_MODEL(OCTEON_CN38XX) 120 return !(OCTEON_IS_MODEL(OCTEON_CN38XX)
114 || OCTEON_IS_MODEL(OCTEON_CN58XX)); 121 || OCTEON_IS_MODEL(OCTEON_CN58XX));
122 case OCTEON_FEATURE_NO_WPTR:
123 return (OCTEON_IS_MODEL(OCTEON_CN56XX)
124 || OCTEON_IS_MODEL(OCTEON_CN52XX))
125 && !OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1_X)
126 && !OCTEON_IS_MODEL(OCTEON_CN52XX_PASS1_X);
127 case OCTEON_FEATURE_DFA:
128 if (!OCTEON_IS_MODEL(OCTEON_CN38XX)
129 && !OCTEON_IS_MODEL(OCTEON_CN31XX)
130 && !OCTEON_IS_MODEL(OCTEON_CN58XX))
131 return 0;
132 else if (OCTEON_IS_MODEL(OCTEON_CN3020))
133 return 0;
134 else if (OCTEON_IS_MODEL(OCTEON_CN38XX_PASS1))
135 return 1;
136 else
137 return !cvmx_fuse_read(120);
138 case OCTEON_FEATURE_MDIO_CLAUSE_45:
139 return !(OCTEON_IS_MODEL(OCTEON_CN3XXX)
140 || OCTEON_IS_MODEL(OCTEON_CN58XX)
141 || OCTEON_IS_MODEL(OCTEON_CN50XX));
115 } 142 }
116 return 0; 143 return 0;
117} 144}