xref: /dpdk/drivers/dma/odm/odm_priv.h (revision 6f741dbc220162ea01b5d747b8944e99349648b5)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2024 Marvell.
3  */
4 
5 #ifndef _ODM_PRIV_H_
6 #define _ODM_PRIV_H_
7 
8 #define ODM_MAX_VFS    16
9 #define ODM_MAX_QUEUES 32
10 
11 #define ODM_CMD_QUEUE_SIZE 4096
12 
13 #define ODM_DEV_INIT	0x1
14 #define ODM_DEV_CLOSE	0x2
15 #define ODM_QUEUE_OPEN	0x3
16 #define ODM_QUEUE_CLOSE 0x4
17 #define ODM_REG_DUMP	0x5
18 
19 struct odm_mbox_dev_msg {
20 	/* Response code */
21 	uint64_t rsp : 8;
22 	/* Number of VFs */
23 	uint64_t nvfs : 2;
24 	/* Error code */
25 	uint64_t err : 6;
26 	/* Reserved */
27 	uint64_t rsvd_16_63 : 48;
28 };
29 
30 struct odm_mbox_queue_msg {
31 	/* Command code */
32 	uint64_t cmd : 8;
33 	/* VF ID to configure */
34 	uint64_t vfid : 8;
35 	/* Queue index in the VF */
36 	uint64_t qidx : 8;
37 	/* Reserved */
38 	uint64_t rsvd_24_63 : 40;
39 };
40 
41 union odm_mbox_msg {
42 	uint64_t u[2];
43 	struct {
44 		struct odm_mbox_dev_msg d;
45 		struct odm_mbox_queue_msg q;
46 	};
47 };
48 
49 #endif /* _ODM_PRIV_H_ */
50