summaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/octeon
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@iki.fi>2014-12-21 22:54:00 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2014-12-24 08:14:22 +1100
commit011f3c6cbb97859860e451f2a75767cd4c1ffc03 (patch)
tree6662ed497e584d9de3caec1447c13115c9bdc2b6 /arch/mips/include/asm/octeon
parent1e585ef51c3fdcf296d2ce5cb8c9e74b1a36cfb4 (diff)
downloadlinux-011f3c6cbb97859860e451f2a75767cd4c1ffc03.tar.gz
linux-011f3c6cbb97859860e451f2a75767cd4c1ffc03.tar.bz2
linux-011f3c6cbb97859860e451f2a75767cd4c1ffc03.zip
MIPS: OCTEON: reintroduce crypto features check
Reintroduce run-time check for crypto features. The old one was deleted because it was unreliable, now decide the crypto availability on early boot when the model string is constructed. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/mips/include/asm/octeon')
-rw-r--r--arch/mips/include/asm/octeon/octeon-feature.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/mips/include/asm/octeon/octeon-feature.h b/arch/mips/include/asm/octeon/octeon-feature.h
index c4fe81f47f53..8ebd3f579b84 100644
--- a/arch/mips/include/asm/octeon/octeon-feature.h
+++ b/arch/mips/include/asm/octeon/octeon-feature.h
@@ -46,8 +46,6 @@ enum octeon_feature {
OCTEON_FEATURE_SAAD,
/* Does this Octeon support the ZIP offload engine? */
OCTEON_FEATURE_ZIP,
- /* Does this Octeon support crypto acceleration using COP2? */
- OCTEON_FEATURE_CRYPTO,
OCTEON_FEATURE_DORM_CRYPTO,
/* Does this Octeon support PCI express? */
OCTEON_FEATURE_PCIE,
@@ -86,6 +84,21 @@ enum octeon_feature {
OCTEON_MAX_FEATURE
};
+enum octeon_feature_bits {
+ OCTEON_HAS_CRYPTO = 0x0001, /* Crypto acceleration using COP2 */
+};
+extern enum octeon_feature_bits __octeon_feature_bits;
+
+/**
+ * octeon_has_crypto() - Check if this OCTEON has crypto acceleration support.
+ *
+ * Returns: Non-zero if the feature exists. Zero if the feature does not exist.
+ */
+static inline int octeon_has_crypto(void)
+{
+ return __octeon_feature_bits & OCTEON_HAS_CRYPTO;
+}
+
/**
* Determine if the current Octeon supports a specific feature. These
* checks have been optimized to be fairly quick, but they should still