]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
crypto: caam - fix writing to JQCR_MS when using service interface
authorHoria Geant? <horia.geanta@freescale.com>
Fri, 21 Aug 2015 15:53:20 +0000 (18:53 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 24 Aug 2015 14:07:38 +0000 (22:07 +0800)
Most significant part of JQCR (Job Queue Control Register) contains
bits that control endianness: ILE - Immediate Little Endian,
DWS - Double Word Swap.
The bits are automatically set by the Job Queue Controller HW.

Unfortunately these bits are cleared in SW when submitting descriptors
via the register-based service interface.
>From LS1021A:
JQCR_MS = 08080100 - before writing: ILE | DWS | SRC (JR0)
JQCR_MS = 30000100 - after writing: WHL | FOUR | SRC (JR0)

This would cause problems on little endian caam for descriptors
containing immediata data or double-word pointers.
Currently there is no problem since the only descriptors ran through
this interface are the ones that (un)instantiate RNG.

Signed-off-by: Horia Geant? <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/ctrl.c

index 81b552d1ad912f5845f9b65861cd003a4b552bb0..09c16f5ea97d2a33e0ed8dc9ea9fb542f97e7009 100644 (file)
@@ -139,7 +139,7 @@ static inline int run_descriptor_deco0(struct device *ctrldev, u32 *desc,
                flags |= DECO_JQCR_FOUR;
 
        /* Instruct the DECO to execute it */
-       wr_reg32(&deco->jr_ctl_hi, flags);
+       setbits32(&deco->jr_ctl_hi, flags);
 
        timeout = 10000000;
        do {