1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32#ifndef _FSL_DPMCP_CMD_H
33#define _FSL_DPMCP_CMD_H
34
35
36#define DPMCP_VER_MAJOR 2
37#define DPMCP_VER_MINOR 0
38
39
40#define DPMCP_CMDID_CLOSE 0x800
41#define DPMCP_CMDID_OPEN 0x80b
42#define DPMCP_CMDID_CREATE 0x90b
43#define DPMCP_CMDID_DESTROY 0x900
44
45#define DPMCP_CMDID_GET_ATTR 0x004
46#define DPMCP_CMDID_RESET 0x005
47
48#define DPMCP_CMDID_SET_IRQ 0x010
49#define DPMCP_CMDID_GET_IRQ 0x011
50#define DPMCP_CMDID_SET_IRQ_ENABLE 0x012
51#define DPMCP_CMDID_GET_IRQ_ENABLE 0x013
52#define DPMCP_CMDID_SET_IRQ_MASK 0x014
53#define DPMCP_CMDID_GET_IRQ_MASK 0x015
54#define DPMCP_CMDID_GET_IRQ_STATUS 0x016
55#define DPMCP_CMDID_CLEAR_IRQ_STATUS 0x017
56
57
58#define DPMCP_CMD_CREATE(cmd, cfg) \
59 MC_CMD_OP(cmd, 0, 0, 32, int, cfg->portal_id)
60
61
62#define DPMCP_CMD_SET_IRQ(cmd, irq_index, irq_addr, irq_val, user_irq_id) \
63do { \
64 MC_CMD_OP(cmd, 0, 0, 8, uint8_t, irq_index);\
65 MC_CMD_OP(cmd, 0, 32, 32, uint32_t, irq_val);\
66 MC_CMD_OP(cmd, 1, 0, 64, uint64_t, irq_addr); \
67 MC_CMD_OP(cmd, 2, 0, 32, int, user_irq_id); \
68} while (0)
69
70
71#define DPMCP_CMD_GET_IRQ(cmd, irq_index) \
72 MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index)
73
74
75#define DPMCP_RSP_GET_IRQ(cmd, type, irq_addr, irq_val, user_irq_id) \
76do { \
77 MC_RSP_OP(cmd, 0, 0, 32, uint32_t, irq_val); \
78 MC_RSP_OP(cmd, 1, 0, 64, uint64_t, irq_addr); \
79 MC_RSP_OP(cmd, 2, 0, 32, int, user_irq_id); \
80 MC_RSP_OP(cmd, 2, 32, 32, int, type); \
81} while (0)
82
83
84#define DPMCP_CMD_SET_IRQ_ENABLE(cmd, irq_index, en) \
85do { \
86 MC_CMD_OP(cmd, 0, 0, 8, uint8_t, en); \
87 MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index);\
88} while (0)
89
90
91#define DPMCP_CMD_GET_IRQ_ENABLE(cmd, irq_index) \
92 MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index)
93
94
95#define DPMCP_RSP_GET_IRQ_ENABLE(cmd, en) \
96 MC_RSP_OP(cmd, 0, 0, 8, uint8_t, en)
97
98
99#define DPMCP_CMD_SET_IRQ_MASK(cmd, irq_index, mask) \
100do { \
101 MC_CMD_OP(cmd, 0, 0, 32, uint32_t, mask);\
102 MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index);\
103} while (0)
104
105
106#define DPMCP_CMD_GET_IRQ_MASK(cmd, irq_index) \
107 MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index)
108
109
110#define DPMCP_RSP_GET_IRQ_MASK(cmd, mask) \
111 MC_RSP_OP(cmd, 0, 0, 32, uint32_t, mask)
112
113
114#define DPMCP_CMD_GET_IRQ_STATUS(cmd, irq_index) \
115 MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index)
116
117
118#define DPMCP_RSP_GET_IRQ_STATUS(cmd, status) \
119 MC_RSP_OP(cmd, 0, 0, 32, uint32_t, status)
120
121
122#define DPMCP_CMD_CLEAR_IRQ_STATUS(cmd, irq_index, status) \
123do { \
124 MC_CMD_OP(cmd, 0, 0, 32, uint32_t, status); \
125 MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index);\
126} while (0)
127
128
129#define DPMCP_RSP_GET_ATTRIBUTES(cmd, attr) \
130do { \
131 MC_RSP_OP(cmd, 0, 32, 32, int, attr->id);\
132 MC_RSP_OP(cmd, 1, 0, 16, uint16_t, attr->version.major);\
133 MC_RSP_OP(cmd, 1, 16, 16, uint16_t, attr->version.minor);\
134} while (0)
135
136#endif
137