xref: /dpdk/drivers/bus/fslmc/mc/fsl_dpcon_cmd.h (revision 131a75b6e4df60586103d71defb85dcf9f77fb17)
1 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
2  *
3  * Copyright 2013-2016 Freescale Semiconductor Inc.
4  * Copyright 2016-2017 NXP
5  *
6  */
7 #ifndef _FSL_DPCON_CMD_H
8 #define _FSL_DPCON_CMD_H
9 
10 /* DPCON Version */
11 #define DPCON_VER_MAJOR			3
12 #define DPCON_VER_MINOR			3
13 
14 
15 /* Command versioning */
16 #define DPCON_CMD_BASE_VERSION		1
17 #define DPCON_CMD_ID_OFFSET		4
18 
19 #define DPCON_CMD(id)	((id << DPCON_CMD_ID_OFFSET) | DPCON_CMD_BASE_VERSION)
20 
21 /* Command IDs */
22 #define DPCON_CMDID_CLOSE		DPCON_CMD(0x800)
23 #define DPCON_CMDID_OPEN		DPCON_CMD(0x808)
24 #define DPCON_CMDID_CREATE		DPCON_CMD(0x908)
25 #define DPCON_CMDID_DESTROY		DPCON_CMD(0x988)
26 #define DPCON_CMDID_GET_API_VERSION	DPCON_CMD(0xa08)
27 
28 #define DPCON_CMDID_ENABLE		DPCON_CMD(0x002)
29 #define DPCON_CMDID_DISABLE		DPCON_CMD(0x003)
30 #define DPCON_CMDID_GET_ATTR		DPCON_CMD(0x004)
31 #define DPCON_CMDID_RESET		DPCON_CMD(0x005)
32 #define DPCON_CMDID_IS_ENABLED		DPCON_CMD(0x006)
33 
34 #define DPCON_CMDID_SET_NOTIFICATION	DPCON_CMD(0x100)
35 
36 #pragma pack(push, 1)
37 struct dpcon_cmd_open {
38 	uint32_t dpcon_id;
39 };
40 
41 struct dpcon_cmd_create {
42 	uint8_t num_priorities;
43 };
44 
45 struct dpcon_cmd_destroy {
46 	uint32_t object_id;
47 };
48 
49 #define DPCON_ENABLE			1
50 
51 struct dpcon_rsp_is_enabled {
52 	uint8_t enabled;
53 };
54 
55 struct dpcon_rsp_get_attr {
56 	uint32_t id;
57 	uint16_t qbman_ch_id;
58 	uint8_t num_priorities;
59 	uint8_t pad;
60 };
61 
62 struct dpcon_cmd_set_notification {
63 	uint32_t dpio_id;
64 	uint8_t priority;
65 	uint8_t pad[3];
66 	uint64_t user_ctx;
67 };
68 
69 struct dpcon_rsp_get_api_version {
70 	uint16_t major;
71 	uint16_t minor;
72 };
73 
74 #pragma pack(pop)
75 #endif /* _FSL_DPCON_CMD_H */
76