1 The octeon-ethernet driver needs to check for additional chip specific
2 features, we add them to the octeon_has_feature() framework.
4 Signed-off-by: David Daney <ddaney@caviumnetworks.com>
6 arch/mips/include/asm/octeon/octeon-feature.h | 27 +++++++++++++++++++++++++
7 1 files changed, 27 insertions(+), 0 deletions(-)
9 diff --git a/arch/mips/include/asm/octeon/octeon-feature.h b/arch/mips/include/asm/octeon/octeon-feature.h
10 index 04fac68..ef24a7b 100644
11 --- a/arch/mips/include/asm/octeon/octeon-feature.h
12 +++ b/arch/mips/include/asm/octeon/octeon-feature.h
13 @@ -57,6 +57,13 @@ enum octeon_feature {
15 /* Octeon has a builtin USB */
17 + /* Octeon IPD can run without using work queue entries */
18 + OCTEON_FEATURE_NO_WPTR,
19 + /* Octeon has DFA state machines */
21 + /* Octeon MDIO block supports clause 45 transactions for 10
23 + OCTEON_FEATURE_MDIO_CLAUSE_45,
26 static inline int cvmx_fuse_read(int fuse);
27 @@ -112,6 +119,26 @@ static inline int octeon_has_feature(enum octeon_feature feature)
28 case OCTEON_FEATURE_USB:
29 return !(OCTEON_IS_MODEL(OCTEON_CN38XX)
30 || OCTEON_IS_MODEL(OCTEON_CN58XX));
31 + case OCTEON_FEATURE_NO_WPTR:
32 + return (OCTEON_IS_MODEL(OCTEON_CN56XX)
33 + || OCTEON_IS_MODEL(OCTEON_CN52XX))
34 + && !OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1_X)
35 + && !OCTEON_IS_MODEL(OCTEON_CN52XX_PASS1_X);
36 + case OCTEON_FEATURE_DFA:
37 + if (!OCTEON_IS_MODEL(OCTEON_CN38XX)
38 + && !OCTEON_IS_MODEL(OCTEON_CN31XX)
39 + && !OCTEON_IS_MODEL(OCTEON_CN58XX))
41 + else if (OCTEON_IS_MODEL(OCTEON_CN3020))
43 + else if (OCTEON_IS_MODEL(OCTEON_CN38XX_PASS1))
46 + return !cvmx_fuse_read(120);
47 + case OCTEON_FEATURE_MDIO_CLAUSE_45:
48 + return !(OCTEON_IS_MODEL(OCTEON_CN3XXX)
49 + || OCTEON_IS_MODEL(OCTEON_CN58XX)
50 + || OCTEON_IS_MODEL(OCTEON_CN50XX));