Merge tag 'uml-for-linus-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / drivers / crypto / marvell / octeontx2 / cn10k_cpt.h
blob92be3ecf570fc34976c4f001a4a6617482c9ea9e
1 /* SPDX-License-Identifier: GPL-2.0-only
2 * Copyright (C) 2021 Marvell.
3 */
4 #ifndef __CN10K_CPT_H
5 #define __CN10K_CPT_H
7 #include "otx2_cpt_common.h"
8 #include "otx2_cptpf.h"
9 #include "otx2_cptvf.h"
11 #define CN10K_CPT_HW_CTX_SIZE 256
13 union cn10k_cpt_hw_ctx {
14 u64 u;
15 struct {
16 u64 reserved_0_47:48;
17 u64 ctx_push_sz:7;
18 u64 reserved_55:1;
19 u64 ctx_hdr_sz:2;
20 u64 aop_valid:1;
21 u64 reserved_59:1;
22 u64 ctx_sz:4;
23 } w0;
26 struct cn10k_cpt_errata_ctx {
27 union cn10k_cpt_hw_ctx *hw_ctx;
28 u64 cptr_dma;
31 static inline u8 cn10k_cpt_get_compcode(union otx2_cpt_res_s *result)
33 return ((struct cn10k_cpt_res_s *)result)->compcode;
36 static inline u8 cn10k_cpt_get_uc_compcode(union otx2_cpt_res_s *result)
38 return ((struct cn10k_cpt_res_s *)result)->uc_compcode;
41 static inline u8 otx2_cpt_get_compcode(union otx2_cpt_res_s *result)
43 return ((struct cn9k_cpt_res_s *)result)->compcode;
46 static inline u8 otx2_cpt_get_uc_compcode(union otx2_cpt_res_s *result)
48 return ((struct cn9k_cpt_res_s *)result)->uc_compcode;
51 int cn10k_cptpf_lmtst_init(struct otx2_cptpf_dev *cptpf);
52 int cn10k_cptvf_lmtst_init(struct otx2_cptvf_dev *cptvf);
53 void cn10k_cpt_ctx_flush(struct pci_dev *pdev, u64 cptr, bool inval);
54 int cn10k_cpt_hw_ctx_init(struct pci_dev *pdev,
55 struct cn10k_cpt_errata_ctx *er_ctx);
56 void cn10k_cpt_hw_ctx_clear(struct pci_dev *pdev,
57 struct cn10k_cpt_errata_ctx *er_ctx);
58 void cn10k_cpt_hw_ctx_set(union cn10k_cpt_hw_ctx *hctx, u16 ctx_sz);
59 void cptvf_hw_ops_get(struct otx2_cptvf_dev *cptvf);
61 #endif /* __CN10K_CPTLF_H */