1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2017 Cavium, Inc
5 #ifndef __OCTEONTX_MBOX_H__
6 #define __OCTEONTX_MBOX_H__
8 #include <rte_common.h>
9 #include <rte_spinlock.h>
11 #define SSOW_BAR4_LEN (64 * 1024)
12 #define SSO_VHGRP_PF_MBOX(x) (0x200ULL | ((x) << 3))
14 #define MBOX_LOG(level, fmt, args...) \
15 rte_log(RTE_LOG_ ## level, octeontx_logtype_mbox,\
16 "%s() line %u: " fmt "\n", __func__, __LINE__, ## args)
18 #define mbox_log_info(fmt, ...) MBOX_LOG(INFO, fmt, ##__VA_ARGS__)
19 #define mbox_log_dbg(fmt, ...) MBOX_LOG(DEBUG, fmt, ##__VA_ARGS__)
20 #define mbox_log_err(fmt, ...) MBOX_LOG(ERR, fmt, ##__VA_ARGS__)
21 #define mbox_func_trace mbox_log_dbg
23 extern int octeontx_logtype_mbox;
25 struct octeontx_mbox_hdr {
26 uint16_t vfid; /* VF index or pf resource index local to the domain */
27 uint8_t coproc; /* Coprocessor id */
28 uint8_t msg; /* Message id */
29 uint8_t res_code; /* Functional layer response code */
32 int octeontx_mbox_set_ram_mbox_base(uint8_t *ram_mbox_base);
33 int octeontx_mbox_set_reg(uint8_t *reg);
34 int octeontx_mbox_send(struct octeontx_mbox_hdr *hdr,
35 void *txdata, uint16_t txlen, void *rxdata, uint16_t rxlen);
37 #endif /* __OCTEONTX_MBOX_H__ */