18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 28c2ecf20Sopenharmony_ci * Marvell OcteonTX CPT driver 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Copyright (C) 2019 Marvell International Ltd. 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or modify 78c2ecf20Sopenharmony_ci * it under the terms of the GNU General Public License version 2 as 88c2ecf20Sopenharmony_ci * published by the Free Software Foundation. 98c2ecf20Sopenharmony_ci */ 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#ifndef __OTX_CPT_COMMON_H 128c2ecf20Sopenharmony_ci#define __OTX_CPT_COMMON_H 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#include <linux/types.h> 158c2ecf20Sopenharmony_ci#include <linux/delay.h> 168c2ecf20Sopenharmony_ci#include <linux/device.h> 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci#define OTX_CPT_MAX_MBOX_DATA_STR_SIZE 64 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_cienum otx_cptpf_type { 218c2ecf20Sopenharmony_ci OTX_CPT_AE = 2, 228c2ecf20Sopenharmony_ci OTX_CPT_SE = 3, 238c2ecf20Sopenharmony_ci BAD_OTX_CPTPF_TYPE, 248c2ecf20Sopenharmony_ci}; 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_cienum otx_cptvf_type { 278c2ecf20Sopenharmony_ci OTX_CPT_AE_TYPES = 1, 288c2ecf20Sopenharmony_ci OTX_CPT_SE_TYPES = 2, 298c2ecf20Sopenharmony_ci BAD_OTX_CPTVF_TYPE, 308c2ecf20Sopenharmony_ci}; 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci/* VF-PF message opcodes */ 338c2ecf20Sopenharmony_cienum otx_cpt_mbox_opcode { 348c2ecf20Sopenharmony_ci OTX_CPT_MSG_VF_UP = 1, 358c2ecf20Sopenharmony_ci OTX_CPT_MSG_VF_DOWN, 368c2ecf20Sopenharmony_ci OTX_CPT_MSG_READY, 378c2ecf20Sopenharmony_ci OTX_CPT_MSG_QLEN, 388c2ecf20Sopenharmony_ci OTX_CPT_MSG_QBIND_GRP, 398c2ecf20Sopenharmony_ci OTX_CPT_MSG_VQ_PRIORITY, 408c2ecf20Sopenharmony_ci OTX_CPT_MSG_PF_TYPE, 418c2ecf20Sopenharmony_ci OTX_CPT_MSG_ACK, 428c2ecf20Sopenharmony_ci OTX_CPT_MSG_NACK 438c2ecf20Sopenharmony_ci}; 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ci/* OcteonTX CPT mailbox structure */ 468c2ecf20Sopenharmony_cistruct otx_cpt_mbox { 478c2ecf20Sopenharmony_ci u64 msg; /* Message type MBOX[0] */ 488c2ecf20Sopenharmony_ci u64 data;/* Data MBOX[1] */ 498c2ecf20Sopenharmony_ci}; 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_ci#endif /* __OTX_CPT_COMMON_H */ 52