Skip to content

Commit 5e8ce83

Browse files
SruChallaherbertx
authored andcommitted
crypto: marvell - add Marvell OcteonTX2 CPT PF driver
Adds skeleton for the Marvell OcteonTX2 CPT physical function driver which includes probe, PCI specific initialization and hardware register defines. RVU defines are present in AF driver (drivers/net/ethernet/marvell/octeontx2/af), header files from AF driver are included here to avoid duplication. Signed-off-by: Suheil Chandran <schandran@marvell.com> Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com> Signed-off-by: Srujana Challa <schalla@marvell.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 0df07d8 commit 5e8ce83

File tree

7 files changed

+633
-0
lines changed

7 files changed

+633
-0
lines changed

drivers/crypto/marvell/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,13 @@ config CRYPTO_DEV_OCTEONTX_CPT
3535

3636
To compile this driver as module, choose M here:
3737
the modules will be called octeontx-cpt and octeontx-cptvf
38+
39+
config CRYPTO_DEV_OCTEONTX2_CPT
40+
tristate "Marvell OcteonTX2 CPT driver"
41+
depends on ARM64 || COMPILE_TEST
42+
depends on PCI_MSI && 64BIT
43+
select OCTEONTX2_MBOX
44+
select CRYPTO_DEV_MARVELL
45+
help
46+
This driver allows you to utilize the Marvell Cryptographic
47+
Accelerator Unit(CPT) found in OcteonTX2 series of processors.

drivers/crypto/marvell/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
obj-$(CONFIG_CRYPTO_DEV_MARVELL_CESA) += cesa/
44
obj-$(CONFIG_CRYPTO_DEV_OCTEONTX_CPT) += octeontx/
5+
obj-$(CONFIG_CRYPTO_DEV_OCTEONTX2_CPT) += octeontx2/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
obj-$(CONFIG_CRYPTO_DEV_OCTEONTX2_CPT) += octeontx2-cpt.o
3+
4+
octeontx2-cpt-objs := otx2_cptpf_main.o
5+
6+
ccflags-y += -I$(srctree)/drivers/net/ethernet/marvell/octeontx2/af
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only
2+
* Copyright (C) 2020 Marvell.
3+
*/
4+
5+
#ifndef __OTX2_CPT_COMMON_H
6+
#define __OTX2_CPT_COMMON_H
7+
8+
#include <linux/pci.h>
9+
#include <linux/types.h>
10+
#include <linux/module.h>
11+
#include <linux/delay.h>
12+
#include <linux/crypto.h>
13+
#include "otx2_cpt_hw_types.h"
14+
#include "rvu.h"
15+
16+
#define OTX2_CPT_RVU_FUNC_ADDR_S(blk, slot, offs) \
17+
(((blk) << 20) | ((slot) << 12) | (offs))
18+
19+
static inline void otx2_cpt_write64(void __iomem *reg_base, u64 blk, u64 slot,
20+
u64 offs, u64 val)
21+
{
22+
writeq_relaxed(val, reg_base +
23+
OTX2_CPT_RVU_FUNC_ADDR_S(blk, slot, offs));
24+
}
25+
26+
static inline u64 otx2_cpt_read64(void __iomem *reg_base, u64 blk, u64 slot,
27+
u64 offs)
28+
{
29+
return readq_relaxed(reg_base +
30+
OTX2_CPT_RVU_FUNC_ADDR_S(blk, slot, offs));
31+
}
32+
#endif /* __OTX2_CPT_COMMON_H */

0 commit comments

Comments
 (0)