forked from torvalds/linux
Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
drivers: crypto: add support for OCTEONTX2 CPT engine
Add support for the cryptographic acceleration unit (CPT) on OcteonTX2 CN96XX SoC. Signed-off-by: Suheil Chandran <schandran@marvell.com> Signed-off-by: Lukas Bartosik <lbartosik@marvell.com> Signed-off-by: Srujana Challa <schalla@marvell.com>
- Loading branch information
1 parent
8db1824
commit bc79b89570c07aabe9985f837486d3d7a0793136
Showing
15 changed files
with
5,088 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # SPDX-License-Identifier: GPL-2.0-only | ||
| obj-$(CONFIG_CRYPTO_DEV_OCTEONTX2_CPT) += octeontx2-cpt.o | ||
|
|
||
| octeontx2-cpt-objs := otx2_cptpf_main.o otx2_cptpf_mbox.o otx2_cptpf_ucode.o \ | ||
| otx2_cpt_mbox_common.o | ||
|
|
||
| ccflags-y += -I$(srctree)/drivers/net/ethernet/marvell/octeontx2/af |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0-only | ||
| * Copyright (C) 2020 Marvell. | ||
| */ | ||
|
|
||
| #ifndef __OTX2_CPT_COMMON_H | ||
| #define __OTX2_CPT_COMMON_H | ||
|
|
||
| #include <linux/pci.h> | ||
| #include <linux/types.h> | ||
| #include <linux/module.h> | ||
| #include <linux/delay.h> | ||
| #include <linux/crypto.h> | ||
| #include "otx2_cpt_hw_types.h" | ||
| #include "rvu.h" | ||
|
|
||
| #define OTX2_CPT_MAX_VFS_NUM 128 | ||
| #define OTX2_CPT_MAX_LFS_NUM 64 | ||
|
|
||
| #define OTX2_CPT_RVU_PFFUNC(pf, func) \ | ||
| ((((pf) & RVU_PFVF_PF_MASK) << RVU_PFVF_PF_SHIFT) | \ | ||
| (((func) & RVU_PFVF_FUNC_MASK) << RVU_PFVF_FUNC_SHIFT)) | ||
|
|
||
| #define OTX2_CPT_RVU_FUNC_ADDR_S(blk, slot, offs) \ | ||
| (((blk) << 20) | ((slot) << 12) | (offs)) | ||
|
|
||
| #define OTX2_CPT_DMA_MINALIGN 128 | ||
| #define OTX2_CPT_INVALID_CRYPTO_ENG_GRP 0xFF | ||
|
|
||
| #define OTX2_CPT_NAME_LENGTH 64 | ||
|
|
||
| #define BAD_OTX2_CPT_ENG_TYPE OTX2_CPT_MAX_ENG_TYPES | ||
|
|
||
| enum otx2_cpt_eng_type { | ||
| OTX2_CPT_AE_TYPES = 1, | ||
| OTX2_CPT_SE_TYPES = 2, | ||
| OTX2_CPT_IE_TYPES = 3, | ||
| OTX2_CPT_MAX_ENG_TYPES, | ||
| }; | ||
|
|
||
| static inline void otx2_cpt_write64(void __iomem *reg_base, u64 blk, u64 slot, | ||
| u64 offs, u64 val) | ||
| { | ||
| writeq_relaxed(val, reg_base + | ||
| OTX2_CPT_RVU_FUNC_ADDR_S(blk, slot, offs)); | ||
| } | ||
|
|
||
| static inline u64 otx2_cpt_read64(void __iomem *reg_base, u64 blk, u64 slot, | ||
| u64 offs) | ||
| { | ||
| return readq_relaxed(reg_base + | ||
| OTX2_CPT_RVU_FUNC_ADDR_S(blk, slot, offs)); | ||
| } | ||
| #endif /* __OTX2_CPT_COMMON_H */ |
Oops, something went wrong.