99fe3cfef7678f090c569a93fa0b333b64688b8e
[dpdk.git] / drivers / crypto / octeontx / otx_cryptodev_hw_access.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 Cavium, Inc
3  */
4 #include <string.h>
5
6 #include <rte_common.h>
7
8 #include "otx_cryptodev_hw_access.h"
9
10 #include "cpt_pmd_logs.h"
11
12 static int
13 otx_cpt_vf_init(struct cpt_vf *cptvf)
14 {
15         int ret = 0;
16
17         CPT_LOG_DP_DEBUG("%s: %s done", cptvf->dev_name, __func__);
18
19         return ret;
20 }
21
22 void
23 otx_cpt_poll_misc(struct cpt_vf *cptvf)
24 {
25         RTE_SET_USED(cptvf);
26 }
27
28 int
29 otx_cpt_hw_init(struct cpt_vf *cptvf, void *pdev, void *reg_base, char *name)
30 {
31         memset(cptvf, 0, sizeof(struct cpt_vf));
32
33         /* Bar0 base address */
34         cptvf->reg_base = reg_base;
35         strncpy(cptvf->dev_name, name, 32);
36
37         cptvf->pdev = pdev;
38
39         /* To clear if there are any pending mbox msgs */
40         otx_cpt_poll_misc(cptvf);
41
42         if (otx_cpt_vf_init(cptvf)) {
43                 CPT_LOG_ERR("Failed to initialize CPT VF device");
44                 return -1;
45         }
46
47         return 0;
48 }