Re: [PATCH 0/6] MIPS: OCTEON: Patches to enable Little Endian

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 13, 2015 at 08:52:58PM +0200, Aaro Koskinen wrote:
> Which drivers did you test? Did you test e.g. octeon-md5?

octeon-md5 does fail.  The hardware seems to be expecting big-endian
values.  I have got it to work by doing this:

https://github.com/nowster/linux-ubnt-e200/commit/019411e18e943624aa61796e54aa933397f8fdca?diff=unified

(I know that cut-and-paste will destroy the tabs in this.  I provide
the patch for comments as to whether this approach is sane.)

diff --git a/arch/mips/cavium-octeon/crypto/octeon-crypto.h b/arch/mips/cavium-octeon/crypto/octeon-crypto.h
index e2a4aec..0e157f1 100644
--- a/arch/mips/cavium-octeon/crypto/octeon-crypto.h
+++ b/arch/mips/cavium-octeon/crypto/octeon-crypto.h
@@ -32,7 +32,7 @@ do {                                                  \
        __asm__ __volatile__ (                          \
        "dmtc2 %[rt],0x0048+" STR(index)                \
        :                                               \
-       : [rt] "d" (value));                            \
+       : [rt] "d" (cpu_to_be64(value)));               \
 } while (0)

 /*
@@ -47,7 +47,7 @@ do {                                                  \
        : [rt] "=d" (__value)                           \
        : );                                            \
                                                        \
-       __value;                                        \
+       be64_to_cpu(__value);                           \
 })

 /*
@@ -58,7 +58,7 @@ do {                                                  \
        __asm__ __volatile__ (                          \
        "dmtc2 %[rt],0x0040+" STR(index)                \
        :                                               \
-       : [rt] "d" (value));                            \
+       : [rt] "d" (cpu_to_be64(value)));               \
 } while (0)

 /*
@@ -69,7 +69,7 @@ do {                                                  \
        __asm__ __volatile__ (                          \
        "dmtc2 %[rt],0x4047"                            \
        :                                               \
-       : [rt] "d" (value));                            \
+       : [rt] "d" (cpu_to_be64(value)));               \
 } while (0)

 #endif /* __LINUX_OCTEON_CRYPTO_H */



-- 
Paul Martin                                  http://www.codethink.co.uk/
Senior Software Developer, Codethink Ltd.





[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux