diff options
-rw-r--r-- | arch/mips/include/asm/octeon/cvmx.h | 43 | ||||
-rw-r--r-- | arch/mips/include/asm/octeon/octeon-feature.h | 52 |
2 files changed, 0 insertions, 95 deletions
diff --git a/arch/mips/include/asm/octeon/cvmx.h b/arch/mips/include/asm/octeon/cvmx.h index 6852dfa50010..b0b544f96b70 100644 --- a/arch/mips/include/asm/octeon/cvmx.h +++ b/arch/mips/include/asm/octeon/cvmx.h | |||
@@ -453,47 +453,4 @@ static inline uint32_t cvmx_octeon_num_cores(void) | |||
453 | 453 | ||
454 | uint8_t cvmx_fuse_read_byte(int byte_addr); | 454 | uint8_t cvmx_fuse_read_byte(int byte_addr); |
455 | 455 | ||
456 | /** | ||
457 | * Read a single fuse bit | ||
458 | * | ||
459 | * @fuse: Fuse number (0-1024) | ||
460 | * | ||
461 | * Returns fuse value: 0 or 1 | ||
462 | */ | ||
463 | static inline int cvmx_fuse_read(int fuse) | ||
464 | { | ||
465 | return (cvmx_fuse_read_byte(fuse >> 3) >> (fuse & 0x7)) & 1; | ||
466 | } | ||
467 | |||
468 | static inline int cvmx_octeon_model_CN36XX(void) | ||
469 | { | ||
470 | return OCTEON_IS_MODEL(OCTEON_CN38XX) | ||
471 | && !cvmx_octeon_is_pass1() | ||
472 | && cvmx_fuse_read(264); | ||
473 | } | ||
474 | |||
475 | static inline int cvmx_octeon_zip_present(void) | ||
476 | { | ||
477 | return octeon_has_feature(OCTEON_FEATURE_ZIP); | ||
478 | } | ||
479 | |||
480 | static inline int cvmx_octeon_dfa_present(void) | ||
481 | { | ||
482 | if (!OCTEON_IS_MODEL(OCTEON_CN38XX) | ||
483 | && !OCTEON_IS_MODEL(OCTEON_CN31XX) | ||
484 | && !OCTEON_IS_MODEL(OCTEON_CN58XX)) | ||
485 | return 0; | ||
486 | else if (OCTEON_IS_MODEL(OCTEON_CN3020)) | ||
487 | return 0; | ||
488 | else if (cvmx_octeon_is_pass1()) | ||
489 | return 1; | ||
490 | else | ||
491 | return !cvmx_fuse_read(120); | ||
492 | } | ||
493 | |||
494 | static inline int cvmx_octeon_crypto_present(void) | ||
495 | { | ||
496 | return octeon_has_feature(OCTEON_FEATURE_CRYPTO); | ||
497 | } | ||
498 | |||
499 | #endif /* __CVMX_H__ */ | 456 | #endif /* __CVMX_H__ */ |
diff --git a/arch/mips/include/asm/octeon/octeon-feature.h b/arch/mips/include/asm/octeon/octeon-feature.h index 90e05a8d4b15..c4fe81f47f53 100644 --- a/arch/mips/include/asm/octeon/octeon-feature.h +++ b/arch/mips/include/asm/octeon/octeon-feature.h | |||
@@ -86,8 +86,6 @@ enum octeon_feature { | |||
86 | OCTEON_MAX_FEATURE | 86 | OCTEON_MAX_FEATURE |
87 | }; | 87 | }; |
88 | 88 | ||
89 | static inline int cvmx_fuse_read(int fuse); | ||
90 | |||
91 | /** | 89 | /** |
92 | * Determine if the current Octeon supports a specific feature. These | 90 | * Determine if the current Octeon supports a specific feature. These |
93 | * checks have been optimized to be fairly quick, but they should still | 91 | * checks have been optimized to be fairly quick, but they should still |
@@ -105,33 +103,6 @@ static inline int octeon_has_feature(enum octeon_feature feature) | |||
105 | case OCTEON_FEATURE_SAAD: | 103 | case OCTEON_FEATURE_SAAD: |
106 | return !OCTEON_IS_MODEL(OCTEON_CN3XXX); | 104 | return !OCTEON_IS_MODEL(OCTEON_CN3XXX); |
107 | 105 | ||
108 | case OCTEON_FEATURE_ZIP: | ||
109 | if (OCTEON_IS_MODEL(OCTEON_CN30XX) | ||
110 | || OCTEON_IS_MODEL(OCTEON_CN50XX) | ||
111 | || OCTEON_IS_MODEL(OCTEON_CN52XX)) | ||
112 | return 0; | ||
113 | else if (OCTEON_IS_MODEL(OCTEON_CN38XX_PASS1)) | ||
114 | return 1; | ||
115 | else | ||
116 | return !cvmx_fuse_read(121); | ||
117 | |||
118 | case OCTEON_FEATURE_CRYPTO: | ||
119 | if (OCTEON_IS_MODEL(OCTEON_CN6XXX)) { | ||
120 | union cvmx_mio_fus_dat2 fus_2; | ||
121 | fus_2.u64 = cvmx_read_csr(CVMX_MIO_FUS_DAT2); | ||
122 | if (fus_2.s.nocrypto || fus_2.s.nomul) { | ||
123 | return 0; | ||
124 | } else if (!fus_2.s.dorm_crypto) { | ||
125 | return 1; | ||
126 | } else { | ||
127 | union cvmx_rnm_ctl_status st; | ||
128 | st.u64 = cvmx_read_csr(CVMX_RNM_CTL_STATUS); | ||
129 | return st.s.eer_val; | ||
130 | } | ||
131 | } else { | ||
132 | return !cvmx_fuse_read(90); | ||
133 | } | ||
134 | |||
135 | case OCTEON_FEATURE_DORM_CRYPTO: | 106 | case OCTEON_FEATURE_DORM_CRYPTO: |
136 | if (OCTEON_IS_MODEL(OCTEON_CN6XXX)) { | 107 | if (OCTEON_IS_MODEL(OCTEON_CN6XXX)) { |
137 | union cvmx_mio_fus_dat2 fus_2; | 108 | union cvmx_mio_fus_dat2 fus_2; |
@@ -188,29 +159,6 @@ static inline int octeon_has_feature(enum octeon_feature feature) | |||
188 | && !OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1_X) | 159 | && !OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1_X) |
189 | && !OCTEON_IS_MODEL(OCTEON_CN52XX_PASS1_X); | 160 | && !OCTEON_IS_MODEL(OCTEON_CN52XX_PASS1_X); |
190 | 161 | ||
191 | case OCTEON_FEATURE_DFA: | ||
192 | if (!OCTEON_IS_MODEL(OCTEON_CN38XX) | ||
193 | && !OCTEON_IS_MODEL(OCTEON_CN31XX) | ||
194 | && !OCTEON_IS_MODEL(OCTEON_CN58XX)) | ||
195 | return 0; | ||
196 | else if (OCTEON_IS_MODEL(OCTEON_CN3020)) | ||
197 | return 0; | ||
198 | else | ||
199 | return !cvmx_fuse_read(120); | ||
200 | |||
201 | case OCTEON_FEATURE_HFA: | ||
202 | if (!OCTEON_IS_MODEL(OCTEON_CN6XXX)) | ||
203 | return 0; | ||
204 | else | ||
205 | return !cvmx_fuse_read(90); | ||
206 | |||
207 | case OCTEON_FEATURE_DFM: | ||
208 | if (!(OCTEON_IS_MODEL(OCTEON_CN63XX) | ||
209 | || OCTEON_IS_MODEL(OCTEON_CN66XX))) | ||
210 | return 0; | ||
211 | else | ||
212 | return !cvmx_fuse_read(90); | ||
213 | |||
214 | case OCTEON_FEATURE_MDIO_CLAUSE_45: | 162 | case OCTEON_FEATURE_MDIO_CLAUSE_45: |
215 | return !(OCTEON_IS_MODEL(OCTEON_CN3XXX) | 163 | return !(OCTEON_IS_MODEL(OCTEON_CN3XXX) |
216 | || OCTEON_IS_MODEL(OCTEON_CN58XX) | 164 | || OCTEON_IS_MODEL(OCTEON_CN58XX) |