diff options
author | Paul Martin <paul.martin@codethink.co.uk> | 2015-03-30 12:01:00 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-04-01 11:22:15 -0400 |
commit | d2a948d2db68bda8780df636cf6390748953793f (patch) | |
tree | 58b14ab3d0390c9082a3796b69910f16debebe3b /arch/mips/cavium-octeon/crypto | |
parent | 8a5cc923af4298e7d40a434398743c03ef875fb1 (diff) |
MIPS: Octeon: Make octeon-md5 driver endian-agnostic
The octeon crypto co-processor expects values to be big endian.
Wrap the data transfers with cpu_to_be64() and be64_to_cpu()
transformations.
This passes for all the MD5 test vectors in crypto/testmgr.h
Signed-off-by: Paul Martin <paul.martin@codethink.co.uk>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9631/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/cavium-octeon/crypto')
-rw-r--r-- | arch/mips/cavium-octeon/crypto/octeon-crypto.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/mips/cavium-octeon/crypto/octeon-crypto.h b/arch/mips/cavium-octeon/crypto/octeon-crypto.h index 355072535110..df6912ec1f57 100644 --- a/arch/mips/cavium-octeon/crypto/octeon-crypto.h +++ b/arch/mips/cavium-octeon/crypto/octeon-crypto.h | |||
@@ -33,7 +33,7 @@ do { \ | |||
33 | __asm__ __volatile__ ( \ | 33 | __asm__ __volatile__ ( \ |
34 | "dmtc2 %[rt],0x0048+" STR(index) \ | 34 | "dmtc2 %[rt],0x0048+" STR(index) \ |
35 | : \ | 35 | : \ |
36 | : [rt] "d" (value)); \ | 36 | : [rt] "d" (cpu_to_be64(value))); \ |
37 | } while (0) | 37 | } while (0) |
38 | 38 | ||
39 | /* | 39 | /* |
@@ -48,7 +48,7 @@ do { \ | |||
48 | : [rt] "=d" (__value) \ | 48 | : [rt] "=d" (__value) \ |
49 | : ); \ | 49 | : ); \ |
50 | \ | 50 | \ |
51 | __value; \ | 51 | be64_to_cpu(__value); \ |
52 | }) | 52 | }) |
53 | 53 | ||
54 | /* | 54 | /* |
@@ -59,7 +59,7 @@ do { \ | |||
59 | __asm__ __volatile__ ( \ | 59 | __asm__ __volatile__ ( \ |
60 | "dmtc2 %[rt],0x0040+" STR(index) \ | 60 | "dmtc2 %[rt],0x0040+" STR(index) \ |
61 | : \ | 61 | : \ |
62 | : [rt] "d" (value)); \ | 62 | : [rt] "d" (cpu_to_be64(value))); \ |
63 | } while (0) | 63 | } while (0) |
64 | 64 | ||
65 | /* | 65 | /* |
@@ -70,7 +70,7 @@ do { \ | |||
70 | __asm__ __volatile__ ( \ | 70 | __asm__ __volatile__ ( \ |
71 | "dmtc2 %[rt],0x4047" \ | 71 | "dmtc2 %[rt],0x4047" \ |
72 | : \ | 72 | : \ |
73 | : [rt] "d" (value)); \ | 73 | : [rt] "d" (cpu_to_be64(value))); \ |
74 | } while (0) | 74 | } while (0) |
75 | 75 | ||
76 | /* | 76 | /* |