Hello,
This series adds the cryptographic engine support to sun5i SoCs. This is
based on top of v4.12-rc1 and was tested on a CHIP. The series begins
with fixes and improvements. The series is available at:
https://github.com/atenart/linux v4.12-rc1/sun5i-crypto
The 8 first patches are reworks an
Add a node for the cryptographic engine that can be found on sun5i SoCs.
This cryptographic engine is compatible with the Allwinner cryptographic
accelerator driver.
Signed-off-by: Antoine Tenart
---
arch/arm/boot/dts/sun5i.dtsi | 9 +
1 file changed, 9 insertions(+)
diff --git a/arch/a
The CRYPTO_ALG_KERN_DRIVER_ONLY flag is set for hardware accelerated
ciphers accessible through a kernel driver only. This is the case for
ciphers exposed by the sun4i-ss driver. This patch sets this flag.
Signed-off-by: Antoine Tenart
Tested-by: Corentin Labbe
Acked-by: Corentin Labbe
---
dri
The run-time self-tests fail quite early, as soon as the input block
size is larger than 64 bytes:
alg: hash: Test 4 failed for sha1-sun4i-ss
: b9 c9 1e 52 c0 26 d8 39 81 ff f2 3c 99 b1 27 b2
0010: 30 d6 c9 85
One thing to notice is the value of the last word, which is the one
e
When sending the last block of data to the engine, it should be padded
so that the total length of the request can be given to the engine as
the last 2 words of the last 64 bytes block.
Simplify the calculation of this pad offset.
Signed-off-by: Antoine Tenart
Tested-by: Corentin Labbe
Acked-by
Do not use DMA is the request is 0 length.
Signed-off-by: Antoine Tenart
Tested-by: Corentin Labbe
Acked-by: Corentin Labbe
---
drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c
b/drivers/crypto/
Add SoC specific compatibles for all sunXi crypto nodes, in addition to
the one already used (allwinner,sun4i-a10-crypto).
Signed-off-by: Antoine Tenart
---
arch/arm/boot/dts/sun6i-a31.dtsi | 3 ++-
arch/arm/boot/dts/sun7i-a20.dtsi | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff
Update the sun4i-ss driver to use the skcipher API instead of the old
ablkcipher one. It's a bit more tricky than s/ablkcipher/skcipher/, but
still nothing special and the driver's logic stays the same.
Signed-off-by: Antoine Tenart
Tested-by: Corentin Labbe
Acked-by: Corentin Labbe
---
driver
Parts of the bf buffer were dynamically set to 0. Change this to set the
whole buffer to 0 by default to avoid any mistake.
Signed-off-by: Antoine Tenart
Tested-by: Corentin Labbe
Acked-by: Corentin Labbe
---
drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 3 +--
1 file changed, 1 insertion(+), 2 de
Use the GENMASK helper instead of custom calculations to generate masks,
It also helps the readability.
Signed-off-by: Antoine Tenart
Tested-by: Corentin Labbe
Acked-by: Corentin Labbe
---
drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
d
Replace custom bit shifts and masks with lower/upper_32_bits helpers.
Signed-off-by: Antoine Tenart
Tested-by: Corentin Labbe
Acked-by: Corentin Labbe
---
drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/crypto/sun
A bit is appended at the end of the input buffer for sha1. Simplify the
code assigning it.
Signed-off-by: Antoine Tenart
Tested-by: Corentin Labbe
Acked-by: Corentin Labbe
---
drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 8 ++--
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/dr
Cosmetic clean up if conditional checks on 0s values.
Signed-off-by: Antoine Tenart
Tested-by: Corentin Labbe
Acked-by: Corentin Labbe
---
drivers/crypto/sunxi-ss/sun4i-ss-cipher.c | 28 +++---
drivers/crypto/sunxi-ss/sun4i-ss-core.c | 10
drivers/crypto/sunxi-ss/sun
Cosmetic change to avoid having a full screen a variable definitions. It
also helps to see which variables share the same type.
Signed-off-by: Antoine Tenart
Tested-by: Corentin Labbe
Acked-by: Corentin Labbe
---
drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 31 +++
1 f
On Thu, 2017-06-01 at 04:20 -0700, Joe Perches wrote:
> On Thu, 2017-06-01 at 14:02 +0300, Gilad Ben-Yossef wrote:
> > Remove spurious blanks lines from cc_crypto_ctx.h file
>
> unrelated trivia:
>
> > diff --git a/drivers/staging/ccree/cc_crypto_ctx.h
> > b/drivers/staging/ccree/cc_crypto_ctx.h
On Thu, 2017-06-01 at 14:02 +0300, Gilad Ben-Yossef wrote:
> Remove spurious blanks lines from cc_crypto_ctx.h file
unrelated trivia:
> diff --git a/drivers/staging/ccree/cc_crypto_ctx.h
> b/drivers/staging/ccree/cc_crypto_ctx.h
[]
> @@ -208,7 +204,6 @@ struct drv_ctx_generic {
> enum drv_
Remove spurious blanks lines from cc_crypto_ctx.h file
Signed-off-by: Gilad Ben-Yossef
---
drivers/staging/ccree/cc_crypto_ctx.h | 6 --
1 file changed, 6 deletions(-)
diff --git a/drivers/staging/ccree/cc_crypto_ctx.h
b/drivers/staging/ccree/cc_crypto_ctx.h
index ac39d34..9bfadb21 100644
Clip longer than 80 chars lines in header files worked
on in the patch set.
Signed-off-by: Gilad Ben-Yossef
---
drivers/staging/ccree/cc_crypto_ctx.h | 3 ++-
drivers/staging/ccree/cc_regs.h | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/ccree/cc_cr
cc_crypto_ctx.h file had a few macro definitions with missing
spaces around operators. Add missing spaces.
Signed-off-by: Gilad Ben-Yossef
---
drivers/staging/ccree/cc_crypto_ctx.h | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/ccree/cc_crypto_ctx.
CC_CTX_SIZE was being defined using a hand rolled bit shift operation.
Replace with use of BIT macro.
Signed-off-by: Gilad Ben-Yossef
---
drivers/staging/ccree/cc_crypto_ctx.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/ccree/cc_crypto_ctx.h
b/drivers/sta
A few of the comments in cc_crypto_ctx.h where not formatted
correctly. Format according to coding style guidelines.
Signed-off-by: Gilad Ben-Yossef
---
drivers/staging/ccree/cc_crypto_ctx.h | 19 +++
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/
The Linked List Item descriptors were being programmed via
a set of macros which suffer a few problems:
- Use of macros rather than inline leaves out parameter type
checking and risks multiple macro parameter evaluation side
effects.
- Implemented via hand rolled versions of bitfield operations
Remove no longer needed code used to simulate 48 bit dma addresses
on 32 bit platforms for development purposes.
Signed-off-by: Gilad Ben-Yossef
---
drivers/staging/ccree/ssi_aead.c| 19
drivers/staging/ccree/ssi_buffer_mgr.c | 83 -
drivers/stag
The ccree driver had support for rough performance debugging
via cycle counting which has bit rotted and can easily be
replcaed with perf. Remove it from the driver.
Signed-off-by: Gilad Ben-Yossef
---
drivers/staging/ccree/cc_hw_queue_defs.h | 14
drivers/staging/ccree/ssi_aead.c
struct SepHashPrivateContext is not used anywhere in the code.
Remove it.
Signed-off-by: Gilad Ben-Yossef
---
drivers/staging/ccree/hash_defs.h | 17 -
1 file changed, 17 deletions(-)
diff --git a/drivers/staging/ccree/hash_defs.h
b/drivers/staging/ccree/hash_defs.h
index 61389
With all users removed or re-factored to use the standard
kernel bit fields ops we can now drop the custom
bit field macros.
Signed-off-by: Gilad Ben-Yossef
---
drivers/staging/ccree/cc_bitops.h| 39 ---
drivers/staging/ccree/cc_hw_queue_defs.h | 2 +-
drivers/staging/cc
Remove spurious blank line from cc_regs.h
Signed-off-by: Gilad Ben-Yossef
---
drivers/staging/ccree/cc_regs.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/staging/ccree/cc_regs.h b/drivers/staging/ccree/cc_regs.h
index e83938b..915c863 100644
--- a/drivers/staging/ccree/cc_regs.h
+
MSB64 macro is no longer used or needed. Drop it.
Signed-off-by: Gilad Ben-Yossef
---
drivers/staging/ccree/cc_hw_queue_defs.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/staging/ccree/cc_hw_queue_defs.h
b/drivers/staging/ccree/cc_hw_queue_defs.h
index 1cbd2e1..aaa56c8 100644
-
Hash enum were named using CamelCase, move over to snake_case.
Signed-off-by: Gilad Ben-Yossef
---
drivers/staging/ccree/cc_hw_queue_defs.h | 4 ++--
drivers/staging/ccree/hash_defs.h| 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/ccree/cc_hw_queu
Some of the register definition files had none
kernel coding style usage of tabs vs. spaces in macro
definitions. This patch fixes them.
Remove some unused macro definitions from hash definitions.
Signed-off-by: Gilad Ben-Yossef
---
drivers/staging/ccree/dx_crys_kernel.h | 308 -
Remove some unused macro definitions from hash definitions.
Signed-off-by: Gilad Ben-Yossef
---
drivers/staging/ccree/hash_defs.h | 31 +++
1 file changed, 3 insertions(+), 28 deletions(-)
diff --git a/drivers/staging/ccree/hash_defs.h
b/drivers/staging/ccree/hash_d
The DUMP_SGL() and DUMP_MLLI_TABLE() debug macros were
defined but not used anywhere and the difference of their
definitions for debug vs. none debug indicated this has
not being used in a while.
Remove the dead code.
Signed-off-by: Gilad Ben-Yossef
---
drivers/staging/ccree/ssi_buffer_mgr.c |
request_mgr was using custom bit field macros. move over to
standard kernel bitfield ops.
Signed-off-by: Gilad Ben-Yossef
---
drivers/staging/ccree/cc_regs.h | 5 +
drivers/staging/ccree/ssi_request_mgr.c | 25 +++--
2 files changed, 20 insertions(+), 10 deletion
Add parentheses around macro argument to guard against precedence
issues.
Signed-off-by: Gilad Ben-Yossef
---
drivers/staging/ccree/cc_crypto_ctx.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/ccree/cc_crypto_ctx.h
b/drivers/staging/ccree/cc_crypto_ctx.h
i
A bunch of macros used to define M/LLI descriptors where
being defined in the C file. Move them over to private
include file where other relevant definitions are stored.
Signed-off-by: Gilad Ben-Yossef
---
drivers/staging/ccree/cc_lli_defs.h| 8
drivers/staging/ccree/ssi_buffer_mgr.
This is another batch of clean ups for the ccree driver.
Mostly comprised of:
- Coding Style fixes
- Move to kernel infrastructure from custom constructs
- Replace macros with static inline functions
- Removal of dead code
Changes from v1:
- Break up patches better to "do one thing" as indicated b
It is better to propagate PTR_ERR value instead of a hardcoded
value(-ENOMEM here).
Signed-off-by: Zhang Shengju
---
crypto/842.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/crypto/842.c b/crypto/842.c
index bc26dc9..6d4f7c7 100644
--- a/crypto/842.c
+++ b/crypto/842.c
@@
37 matches
Mail list logo