New upstream version 18.02
[deb_dpdk.git] / drivers / mempool / octeontx / octeontx_mbox.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2017 Cavium, Inc
3  */
4
5 #ifndef __OCTEONTX_MBOX_H__
6 #define __OCTEONTX_MBOX_H__
7
8 #include <rte_common.h>
9
10 #define SSOW_BAR4_LEN                   (64 * 1024)
11 #define SSO_VHGRP_PF_MBOX(x)            (0x200ULL | ((x) << 3))
12
13 struct octeontx_ssovf_info {
14         uint16_t domain; /* Domain id */
15         uint8_t total_ssovfs; /* Total sso groups available in domain */
16         uint8_t total_ssowvfs;/* Total sso hws available in domain */
17 };
18
19 enum octeontx_ssovf_type {
20         OCTEONTX_SSO_GROUP, /* SSO group vf */
21         OCTEONTX_SSO_HWS,  /* SSO hardware workslot vf */
22 };
23
24 struct octeontx_mbox_hdr {
25         uint16_t vfid;  /* VF index or pf resource index local to the domain */
26         uint8_t coproc; /* Coprocessor id */
27         uint8_t msg;    /* Message id */
28         uint8_t res_code; /* Functional layer response code */
29 };
30
31 int octeontx_ssovf_info(struct octeontx_ssovf_info *info);
32 void *octeontx_ssovf_bar(enum octeontx_ssovf_type, uint8_t id, uint8_t bar);
33 int octeontx_ssovf_mbox_send(struct octeontx_mbox_hdr *hdr,
34                 void *txdata, uint16_t txlen, void *rxdata, uint16_t rxlen);
35
36 #endif /* __OCTEONTX_MBOX_H__ */