[PATCH 6/9] crypto: mediatek - fix error handling in mtk_aes_complete()

2017-02-20 Thread Ryder Lee
This patch fixes how errors should be handled by mtk_aes_complete(). Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-aes.c | 39 +++ 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/drivers/crypto/mediat

[PATCH 7/9] crypto: mediatek - add mtk_aes_gcm_tag_verify()

2017-02-20 Thread Ryder Lee
This patch adds mtk_aes_gcm_tag_verify() which is used to compare authenticated tag. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-aes.c | 24 ++-- drivers/crypto/mediatek/mtk-platform.h | 2 ++ 2 files changed, 24 insertions

[PATCH 5/9] crypto: mediatek - add queue_task tasklet

2017-02-20 Thread Ryder Lee
k". Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-aes.c | 20 drivers/crypto/mediatek/mtk-platform.h | 12 drivers/crypto/mediatek/mtk-sha.c | 19 +++ 3 files changed, 39 insertions(+), 12 deletion

[PATCH 8/9] crypto: mediatek - make hardware operation flow more efficient

2017-02-20 Thread Ryder Lee
information(key, IV,...) to info->state. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-aes.c | 263 ++ drivers/crypto/mediatek/mtk-sha.c | 90 ++--- 2 files changed, 165 insertions(+), 188 deletions(-) d

[PATCH 0/9] improve performances on mediatek crypto driver

2017-02-20 Thread Ryder Lee
Hi all, Some patches of this series improve the performances whereas others clean up code and refine data structure to make it more efficient. It also adds support to AES-OFB and AES-CFB128. The new mode has been tested by using the tcrypt Ryder Lee (9): crypto: mediatek - rework interrupt

[PATCH 2/9] crypto: mediatek - add MTK_* prefix and correct annotations.

2017-02-20 Thread Ryder Lee
Dummy patch to add MTK_* prefix to ring enum and fix incorrect annotations. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-aes.c | 12 ++-- drivers/crypto/mediatek/mtk-platform.c | 12 ++-- drivers/crypto/mediatek/mtk-platform.

[PATCH 4/9] crypto: mediatek - simplify descriptor ring management

2017-02-20 Thread Ryder Lee
pointers and check the boundaries of ring. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-aes.c | 14 -- drivers/crypto/mediatek/mtk-platform.c | 3 +++ drivers/crypto/mediatek/mtk-platform.h | 8 drivers/crypto/mediatek/mtk

[PATCH 3/9] crypto: mediatek - make mtk_sha_xmit() more generic

2017-02-20 Thread Ryder Lee
er to remove it. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-platform.h | 4 -- drivers/crypto/mediatek/mtk-sha.c | 116 ++--- 2 files changed, 34 insertions(+), 86 deletions(-) diff --git a/drivers/crypto/mediatek

[PATCH 9/9] crypto: mediatek - add support to OFB mode and CFB128 mode

2017-02-20 Thread Ryder Lee
This patch adds support to OFB mode and CFB128 mode. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-aes.c | 84 --- 1 file changed, 78 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/mediatek/mtk-aes.c b/d

[PATCH 1/9] crypto: mediatek - rework interrupt handler

2017-02-20 Thread Ryder Lee
This patch removes redundant task that used to handle interrupt from ring manager, so that the same task/handler can be shared. It also uses aes->id and sha-id to distinguish interrupt sources. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-aes.c

[PATCH 5/8] crypto: mediatek - regroup functions by usage

2017-01-19 Thread Ryder Lee
This patch only regroup functions by usage. This will help to integrate the GCM support patch later by adjusting some shared code section, such as common code which will be reused by GCM, AES mode setting, and DMA transfer. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/

[PATCH 4/8] crypto: mediatek - rework crypto request completion

2017-01-19 Thread Ryder Lee
-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-aes.c | 25 + drivers/crypto/mediatek/mtk-platform.h | 3 +++ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/drivers/crypto/mediatek/mtk-aes.c b/drivers/crypto/mediatek/mtk

[PATCH 8/8] crypto: mediatek - add support to GCM mode

2017-01-19 Thread Ryder Lee
This patch adds support to the GCM mode. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/Kconfig | 2 + drivers/crypto/mediatek/mtk-aes.c | 369 - drivers/crypto/mediatek/mtk-platform.h | 2 + 3 files change

[PATCH 6/8] crypto: mediatek - fix typo and indentation

2017-01-19 Thread Ryder Lee
Dummy patch to fix typo and indentation. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-aes.c | 90 +- drivers/crypto/mediatek/mtk-platform.h | 2 +- drivers/crypto/mediatek/mtk-sha.c | 40 +++ 3

[PATCH 2/8] crypto: mediatek - fix incorrect data transfer result

2017-01-19 Thread Ryder Lee
ops and uses cmd_pos and res_pos to record them respectively. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-aes.c | 44 -- drivers/crypto/mediatek/mtk-platform.h | 6 +++-- drivers/crypto/mediatek/mtk-sha.c

[PATCH 0/8] update mediatek crypto driver

2017-01-19 Thread Ryder Lee
with modes: - 211: rfc4106(gcm(aes)), gcm(aes) - 500: ecb(aes), cbc(aes), ctr(aes), rfc3686(ctr(aes)) - 403 ~ 406: sha1, sha2 family IxChariot multiple pairs throughput 24 hours test: - IPSec VPN - MACSec Ryder Lee (8): crypto: mediatek - move HW control data to transformation context crypto

[PATCH 3/8] crypto: mediatek - make crypto request queue management more generic

2017-01-19 Thread Ryder Lee
of all the transformation contexts. Hence the very same queue will be used to manage both block cipher and AEAD requests (such as gcm and authenc implemented in further patches). Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-aes.c

[PATCH 7/8] crypto: mediatek - add support to CTR mode

2017-01-19 Thread Ryder Lee
This patch adds support to the CTR mode. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-aes.c | 151 -- 1 file changed, 146 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/mediatek/mtk-aes.c b/drivers/

[PATCH 1/8] crypto: mediatek - move HW control data to transformation context

2017-01-19 Thread Ryder Lee
This patch moves hardware control block members from mtk_*_rec to transformation context and refines related definition. This makes operational context to manage its own control information easily for each DMA transfer. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/

Re: [PATCH v1 2/2] crypto: mediatek - add DT bindings documentation

2016-12-08 Thread Ryder Lee
Hello, On Mon, 2016-12-05 at 11:18 +0100, Matthias Brugger wrote: > > On 05/12/16 08:01, Ryder Lee wrote: > > Add DT bindings documentation for the crypto driver > > > > Signed-off-by: Ryder Lee <ryder@mediatek.com> > > --- > > .../devicetre

Re: [PATCH v1 1/2] Add crypto driver support for some MediaTek chips

2016-12-08 Thread Ryder Lee
Hello, On Mon, 2016-12-05 at 09:52 +0100, Corentin Labbe wrote: > Hello > > I have two minor comment. > > On Mon, Dec 05, 2016 at 03:01:23PM +0800, Ryder Lee wrote: > > This adds support for the MediaTek hardware accelerator on > > mt7623/mt2701/mt8521p SoC. >

[PATCH v2 0/2] Add MediaTek crypto accelerator driver

2016-12-12 Thread Ryder Lee
and function comment - add COMPILE_TEST in Kconfig Ryder Lee (2): Add crypto driver support for some MediaTek chips crypto: mediatek - add DT bindings documentation .../devicetree/bindings/crypto/mediatek-crypto.txt | 32 + drivers/crypto/Kconfig | 17 + drivers

[PATCH v2 1/2] Add crypto driver support for some MediaTek chips

2016-12-12 Thread Ryder Lee
This adds support for the MediaTek hardware accelerator on mt7623/mt2701/mt8521p SoC. This driver currently implement: - SHA1 and SHA2 family(HMAC) hash algorithms. - AES block cipher in CBC/ECB mode with 128/196/256 bits keys. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- d

[PATCH v2 2/2] crypto: mediatek - add DT bindings documentation

2016-12-12 Thread Ryder Lee
Add DT bindings documentation for the crypto driver Signed-off-by: Ryder Lee <ryder@mediatek.com> --- .../devicetree/bindings/crypto/mediatek-crypto.txt | 32 ++ 1 file changed, 32 insertions(+) create mode 100644 Documentation/devicetree/bindings/crypto/me

Re: [PATCH 1/2] Add crypto driver support for some MediaTek chips

2016-12-02 Thread Ryder Lee
Hello, On Fri, 2016-12-02 at 09:18 +0100, Corentin Labbe wrote: > Hello > > I have some minor comment inline > > On Fri, Dec 02, 2016 at 11:26:44AM +0800, Ryder Lee wrote: > > This adds support for the MediaTek hardware accelerator on > > mt7623/mt2701/mt8521

[PATCH 1/2] Add crypto driver support for some MediaTek chips

2016-12-01 Thread Ryder Lee
This adds support for the MediaTek hardware accelerator on mt7623/mt2701/mt8521p SoC. This driver currently implement: - SHA1 and SHA2 family(HMAC) hash alogrithms. - AES block cipher in CBC/ECB mode with 128/196/256 bits keys. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- d

[PATCH 2/2] crypto: mediatek - add DT bindings documentation

2016-12-01 Thread Ryder Lee
Add DT bindings documentation for the crypto driver Signed-off-by: Ryder Lee <ryder@mediatek.com> --- .../devicetree/bindings/crypto/mediatek-crypto.txt | 32 ++ 1 file changed, 32 insertions(+) create mode 100644 Documentation/devicetree/bindings/crypto/me

[PATCH 0/2] Add MediaTek crypto acclelrator driver

2016-12-01 Thread Ryder Lee
This adds support for the MediaTek hardware accelerator on mt7623 SoC. This driver currently implement: - SHA1 and SHA2 family(HMAC) hash alogrithms. - AES block cipher in CBC/ECB mode with 128/196/256 bits keys. Ryder Lee (2): Add crypto driver support for some MediaTek chips crypto

[PATCH v1 1/2] Add crypto driver support for some MediaTek chips

2016-12-04 Thread Ryder Lee
This adds support for the MediaTek hardware accelerator on mt7623/mt2701/mt8521p SoC. This driver currently implement: - SHA1 and SHA2 family(HMAC) hash alogrithms. - AES block cipher in CBC/ECB mode with 128/196/256 bits keys. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- d

[PATCH v1 2/2] crypto: mediatek - add DT bindings documentation

2016-12-04 Thread Ryder Lee
Add DT bindings documentation for the crypto driver Signed-off-by: Ryder Lee <ryder@mediatek.com> --- .../devicetree/bindings/crypto/mediatek-crypto.txt | 32 ++ 1 file changed, 32 insertions(+) create mode 100644 Documentation/devicetree/bindings/crypto/me

[PATCH v1 0/2] Add MediaTek crypto acclelrator driver

2016-12-04 Thread Ryder Lee
- sort headers in alphabetical order - add a definition for IRQ unmber - replace ambiguous definition - add more annotation and function comment - add COMPILE_TEST in Kconfig Ryder Lee (2): Add crypto driver support for some MediaTek chips crypto: mediatek - add DT bindings documentation

[PATCH v3 1/2] Add crypto driver support for some MediaTek chips

2016-12-18 Thread Ryder Lee
This adds support for the MediaTek hardware accelerator on mt7623/mt2701/mt8521p SoC. This driver currently implement: - SHA1 and SHA2 family(HMAC) hash algorithms. - AES block cipher in CBC/ECB mode with 128/196/256 bits keys. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- d

[PATCH v1 0/8] improve performances on mediatek crypto driver

2017-03-08 Thread Ryder Lee
Hi all, Some patches of this series improve the performances whereas others clean up code and refine data structure to make it more efficient Changes since v1: - drop OFB and CFB patch Ryder Lee (8): crypto: mediatek - rework interrupt handler crypto: mediatek - add MTK_* prefix and correct

[PATCH v1 7/8] crypto: mediatek - add mtk_aes_gcm_tag_verify()

2017-03-08 Thread Ryder Lee
This patch adds mtk_aes_gcm_tag_verify() which is used to compare authenticated tag. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-aes.c | 24 ++-- drivers/crypto/mediatek/mtk-platform.h | 2 ++ 2 files changed, 24 insertions

[PATCH v1 8/8] crypto: mediatek - make hardware operation flow more efficient

2017-03-08 Thread Ryder Lee
information(key, IV,...) to info->state. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-aes.c | 263 ++ drivers/crypto/mediatek/mtk-sha.c | 90 ++--- 2 files changed, 165 insertions(+), 188 deletions(-) d

[PATCH v1 2/8] crypto: mediatek - add MTK_* prefix and correct annotations.

2017-03-08 Thread Ryder Lee
Dummy patch to add MTK_* prefix to ring enum and fix incorrect annotations. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-aes.c | 12 ++-- drivers/crypto/mediatek/mtk-platform.c | 12 ++-- drivers/crypto/mediatek/mtk-platform.

[PATCH v1 4/8] crypto: mediatek - simplify descriptor ring management

2017-03-08 Thread Ryder Lee
pointers and check the boundaries of ring. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-aes.c | 14 -- drivers/crypto/mediatek/mtk-platform.c | 3 +++ drivers/crypto/mediatek/mtk-platform.h | 8 drivers/crypto/mediatek/mtk

[PATCH v1 1/8] crypto: mediatek - rework interrupt handler

2017-03-08 Thread Ryder Lee
This patch removes redundant task that used to handle interrupt from ring manager, so that the same task/handler can be shared. It also uses aes->id and sha-id to distinguish interrupt sources. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-aes.c

[PATCH v1 6/8] crypto: mediatek - fix error handling in mtk_aes_complete()

2017-03-08 Thread Ryder Lee
This patch fixes how errors should be handled by mtk_aes_complete(). Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-aes.c | 39 +++ 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/drivers/crypto/mediat

[PATCH v1 5/8] crypto: mediatek - add queue_task tasklet

2017-03-08 Thread Ryder Lee
k". Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-aes.c | 20 drivers/crypto/mediatek/mtk-platform.h | 12 drivers/crypto/mediatek/mtk-sha.c | 19 +++ 3 files changed, 39 insertions(+), 12 deletion

[PATCH v1 3/8] crypto: mediatek - make mtk_sha_xmit() more generic

2017-03-08 Thread Ryder Lee
er to remove it. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-platform.h | 4 -- drivers/crypto/mediatek/mtk-sha.c | 116 ++--- 2 files changed, 34 insertions(+), 86 deletions(-) diff --git a/drivers/crypto/mediatek

[PATCH] crypto: mediatek - Add empty messages check in GCM mode

2017-08-16 Thread Ryder Lee
Currently, empty messages are not supported in GCM mode, hence add a check to prevent producing incorrect results. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-aes.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/crypto/mediatek/mtk-ae

Re: [PATCH] crypto: mediatek - Add empty messages check in GCM mode

2017-08-16 Thread Ryder Lee
Hi, On Wed, 2017-08-16 at 14:18 +0200, Stephan Mueller wrote: > Am Mittwoch, 16. August 2017, 13:19:48 CEST schrieb Ryder Lee: > > Hi Ryder, > > > Currently, empty messages are not supported in GCM mode, hence add > > a check to prevent producing incorrect results. >

[PATCH 1/2] crypto: mediatek - remove redundant clock setting

2017-05-26 Thread Ryder Lee
This patch removes redundant clock setting for 'clk_ethif', which is the parent for 'clk_cryp'. Hence, we just need to handle its child. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-platform.c | 10 +- drivers/crypto/mediatek/mtk-platform.h | 2

[PATCH 2/2] crypto: mediatek - update DT binding documentation

2017-05-26 Thread Ryder Lee
This patch removes unnecessary clock in binding file. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- Documentation/devicetree/bindings/crypto/mediatek-crypto.txt | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/crypto/me

[PATCH v1 0/2] remove mediatek ethif clock in crypto driver

2017-05-31 Thread Ryder Lee
This patch series only remove redundant clock setting in mediatek crypto driver. Changes since v1: -rework the commit message. Ryder Lee (2): crypto: mediatek - remove redundant clock setting dt-bindings: crypto: remove mediatek ethif clock Documentation/devicetree/bindings/crypto/mediatek

[PATCH v1 2/2] dt-bindings: crypto: remove mediatek ethif clock

2017-05-31 Thread Ryder Lee
This patch removes the parent clock 'ethif' in bindings, since we don't need to control the parent of a clock in current clock framework. Moreover, the clocks are get by name in the driver, thus this change does not break backwards compatibility. Signed-off-by: Ryder Lee <ryder@mediatek.

[PATCH v1 1/2] crypto: mediatek - remove redundant clock setting

2017-05-31 Thread Ryder Lee
This patch removes redundant clock setting for 'clk_ethif', which is the parent of 'clk_cryp'. Hence, we just need to handle its child. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- drivers/crypto/mediatek/mtk-platform.c | 10 +- drivers/crypto/mediatek/mtk-platform.h | 2

Re: [PATCH 2/2] crypto: mediatek - update DT binding documentation

2017-05-31 Thread Ryder Lee
On Wed, 2017-05-31 at 13:46 -0500, Rob Herring wrote: > On Fri, May 26, 2017 at 05:43:09PM +0800, Ryder Lee wrote: > > This patch removes unnecessary clock in binding file. > > Why is the clock unnecessary? A h/w block either has a clock or doesn't. > > The subject needs s

Re: [PATCH] crypto: mediatek - Add empty messages check in GCM mode

2017-08-22 Thread Ryder Lee
Hi, On Tue, 2017-08-22 at 15:01 +0800, Herbert Xu wrote: > On Wed, Aug 16, 2017 at 07:19:48PM +0800, Ryder Lee wrote: > > Currently, empty messages are not supported in GCM mode, hence add > > a check to prevent producing incorrect results. > > > > Signed-off-by: Ryder

[PATCH v1] crypto: mediatek - Add empty messages check in GCM mode

2017-08-22 Thread Ryder Lee
Currently, empty messages are not supported in GCM mode, hence add a check to prevent producing incorrect results. Signed-off-by: Ryder Lee <ryder@mediatek.com> --- changes since v1: - fix build erro: add a missing semicolon. drivers/crypto/mediatek/mtk-aes.c | 5 + 1 file chan