aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto/mediatek/mtk-platform.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner1-5/+1
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-10crypto: mediatek - remove redundant clock settingRyder Lee1-2/+0
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.lee@mediatek.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-03-16crypto: mediatek - add mtk_aes_gcm_tag_verify()Ryder Lee1-0/+2
This patch adds mtk_aes_gcm_tag_verify() which is used to compare authenticated tag. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-03-16crypto: mediatek - add queue_task taskletRyder Lee1-4/+8
This patch adds 'queue_task' to dequeue crypto requset. This will help to avoid directly calling mtk_aes_handle_queue() / mtk_sha_handle_queue() from done tasklet or error handler. In order to avoid confusion, the new code properly renames DMA completion "task" to "done_task". Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-03-16crypto: mediatek - simplify descriptor ring managementRyder Lee1-4/+4
This patch replaces cmd_pos/res_pos with pointer cmd_next/res_next. In old code, we must to add one to shift ring to the next segment, and then use this value to caculate current offset from ring base for each DMA operation. Now these pointers helps us to simplify flow, so we just need to move pointers and check the boundaries of ring. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-03-16crypto: mediatek - make mtk_sha_xmit() more genericRyder Lee1-4/+0
This is a transitional patch. It merges mtk_sha_xmit() and mtk_sha_xmit2() to make transmit function more generic. In addition, res->buf and cryp->tmp_dma in mtk_sha_xmit() are useless, since crypto engine writes the result digests into ctx->tfm.digest instead of res->buf. It's better to remove it. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-03-16crypto: mediatek - add MTK_* prefix and correct annotations.Ryder Lee1-13/+13
Dummy patch to add MTK_* prefix to ring enum and fix incorrect annotations. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-03-16crypto: mediatek - rework interrupt handlerRyder Lee1-0/+4
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.lee@mediatek.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-01-23crypto: mediatek - add support to GCM modeRyder Lee1-0/+2
This patch adds support to the GCM mode. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-01-23crypto: mediatek - fix typo and indentationRyder Lee1-1/+1
Dummy patch to fix typo and indentation. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-01-23crypto: mediatek - rework crypto request completionRyder Lee1-0/+3
This patch introduces a new callback 'resume' in the struct mtk_aes_rec. This callback is run to resume/complete the processing of the crypto request when woken up by AES interrupts when DMA completion. This callback will help implementing the GCM mode support in further patches. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-01-23crypto: mediatek - make crypto request queue management more genericRyder Lee1-5/+9
This patch changes mtk_aes_handle_queue() to make it more generic. The function argument is now a pointer to struct crypto_async_request, which is the common base of struct ablkcipher_request and struct aead_request. Also this patch introduces struct mtk_aes_base_ctx which will be the common base 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.lee@mediatek.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-01-23crypto: mediatek - fix incorrect data transfer resultRyder Lee1-2/+4
This patch fixes mtk_aes_xmit() data transfer bug. The original function uses the same loop and ring->pos to handle both command and result descriptors. But this produces incomplete results when src.sg_len != dst.sg_len. To solve the problem, we splits the descriptors into different loops and uses cmd_pos and res_pos to record them respectively. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-01-23crypto: mediatek - move HW control data to transformation contextRyder Lee1-22/+4
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.lee@mediatek.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2016-12-27crypto: mediatek - Add crypto driver support for some MediaTek chipsRyder Lee1-0/+238
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.lee@mediatek.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>