Switchtec Userspace  PROJECT_NUMBER = PROJECT_NUMBER=PROJECT_NUMBER = 2.2
mrpc.h
1 /*
2  * Microsemi Switchtec(tm) PCIe Management Library
3  * Copyright (c) 2017, Microsemi Corporation
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included
13  * in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21  * OTHER DEALINGS IN THE SOFTWARE.
22  *
23  */
24 
25 #ifndef LIBSWITCHTEC_MRPC_H
26 #define LIBSWITCHTEC_MRPC_H
27 
28 #define MRPC_MAX_DATA_LEN 1024
29 
30 enum mrpc_cmd {
31  MRPC_DIAG_PMC_START = 0,
32  MRPC_TWI = 1,
33  MRPC_VGPIO = 2,
34  MRPC_PWM = 3,
35  MRPC_DIETEMP = 4,
36  MRPC_FWDNLD = 5,
37  MRPC_FWLOGRD = 6,
38  MRPC_PMON = 7,
39  MRPC_PORTLN = 8,
40  MRPC_PORTARB = 9,
41  MRPC_MCOVRLY = 10,
42  MRPC_STACKBIF = 11,
43  MRPC_PORTPARTP2P = 12,
44  MRPC_DIAG_TLP_INJECT = 13,
45  MRPC_DIAG_TLP_GEN = 14,
46  MRPC_DIAG_PORT_EYE = 15,
47  MRPC_DIAG_POT_VHIST = 16,
48  MRPC_DIAG_PORT_LTSSM_LOG = 17,
49  MRPC_DIAG_PORT_TLP_ANL = 18,
50  MRPC_DIAG_PORT_LN_ADPT = 19,
51  MRPC_SRDS_PCIE_PEAK = 20,
52  MRPC_SRDS_EQ_CTRL = 21,
53  MRPC_SRDS_LN_TUNING_MODE = 22,
54  MRPC_NT_MCG_CAPABLE_CONFIG = 23,
55  MRPC_TCH = 24,
56  MRPC_ARB = 25,
57  MRPC_SMBUS = 26,
58  MRPC_RESET = 27,
59  MRPC_LNKSTAT = 28,
60  MRPC_MULTI_CFG = 29,
61  MRPC_SES = 30,
62  MRPC_RD_FLASH = 31,
63  MRPC_GAS_READ = 41,
64  MRPC_PART_INFO = 43,
65  MRPC_GAS_WRITE = 52,
66  MRPC_ECHO = 65,
67  MRPC_GET_PAX_ID = 129,
68 
69  MRPC_TOPO_INFO_DUMP = 0x82,
70  MRPC_GFMS_DB_DUMP = 0x83,
71  MRPC_GFMS_BIND_UNBIND = 0x84,
72  MRPC_PORT_CONFIG = 0x88,
73  MRPC_GFMS_EVENT = 0x89,
74  MRPC_PORT_CONTROL = 0x8D,
75 
76  MRPC_GET_DEV_INFO = 256,
77  MRPC_SECURITY_CONFIG_GET = 257,
78  MRPC_SECURITY_CONFIG_SET = 258,
79  MRPC_KMSK_ENTRY_SET = 259,
80  MRPC_SECURE_STATE_SET = 260,
81  MRPC_ACT_IMG_IDX_GET = 261,
82  MRPC_ACT_IMG_IDX_SET = 262,
83  MRPC_FW_TX = 263,
84  MRPC_MAILBOX_GET = 264,
85  MRPC_SN_VER_GET = 265,
86  MRPC_DBG_UNLOCK = 266,
87  MRPC_BOOTUP_RESUME = 267,
88 };
89 
90 enum mrpc_bg_status {
91  MRPC_BG_STAT_IDLE = 0,
92  MRPC_BG_STAT_INPROGRESS = 1,
93  MRPC_BG_STAT_DONE = 2,
94  MRPC_BG_STAT_ERROR = 0xFF,
95 };
96 
97 enum mrpc_sub_cmd {
98  MRPC_FWDNLD_GET_STATUS = 0,
99  MRPC_FWDNLD_DOWNLOAD = 1,
100  MRPC_FWDNLD_TOGGLE = 2,
101  MRPC_FWDNLD_BOOT_RO = 4,
102  MRPC_FWDNLD_SET_REDUNDANCY = 5,
103 
104  MRPC_PMON_SETUP_EV_COUNTER = 0,
105  MRPC_PMON_GET_BW_COUNTER = 1,
106  MRPC_PMON_GET_EV_COUNTER = 2,
107  MRPC_PMON_GET_EV_COUNTER_SETUP = 3,
108  MRPC_PMON_SETUP_LAT_COUNTER = 4,
109  MRPC_PMON_GET_LAT_COUNTER_SETUP = 5,
110  MRPC_PMON_GET_LAT_COUNTER = 6,
111  MRPC_PMON_RULE_ERROR_TLP = 8,
112  MRPC_PMON_RULE_TLP_MATCH = 9,
113  MRPC_PMON_RULE_TLP_TO_USP = 10,
114  MRPC_PMON_RULE_TLP_TO_DSP = 11,
115  MRPC_PMON_SET_BW_COUNTER = 12,
116 
117  MRPC_FWLOGRD_RAM = 0,
118  MRPC_FWLOGRD_FLASH = 1,
119  MRPC_FWLOGRD_MEMLOG = 2,
120  MRPC_FWLOGRD_REGS = 3,
121  MRPC_FWLOGRD_SYS_STACK = 4,
122  MRPC_FWLOGRD_THRD_STACK = 5,
123  MRPC_FWLOGRD_THRD = 6,
124  MRPC_FWLOGRD_INVAL = 7,
125  MRPC_FWLOGRD_NVHDR = 10,
126 
127  MRPC_DIETEMP_SET_CLOCK = 0,
128  MRPC_DIETEMP_SET_MEAS = 1,
129  MRPC_DIETEMP_GET = 2,
130  MRPC_DIETEMP_STOP = 3,
131  MRPC_DIETEMP_GET_GEN4 = 2,
132 
133  MRPC_MULTI_CFG_SUPPORTED = 0,
134  MRPC_MULTI_CFG_COUNT = 1,
135  MRPC_MULTI_CFG_ACTIVE = 2,
136  MRPC_MULTI_CFG_START_ADDR = 3,
137  MRPC_MULTI_CFG_LENGTH = 4,
138 
139  MRPC_PORT_BIND = 0,
140  MRPC_PORT_UNBIND = 1,
141  MRPC_PORT_INFO = 2,
142 
143  MRPC_PART_INFO_GET_ALL_INFO = 0,
144  MRPC_PART_INFO_GET_METADATA = 1,
145 
146  MRPC_GFMS_BIND = 1,
147  MRPC_GFMS_UNBIND = 2,
148 
149  MRPC_PORT_CONFIG_SET = 0,
150  MRPC_PORT_CONFIG_GET = 1,
151 
152  MRPC_TOPO_INFO_DUMP_START = 1,
153  MRPC_TOPO_INFO_DUMP_STATUS_GET = 2,
154  MRPC_TOPO_INFO_DUMP_DATA_GET = 3,
155  MRPC_TOPO_INFO_DUMP_FINISH = 4,
156 
157  MRPC_GFMS_DB_DUMP_FABRIC = 0,
158  MRPC_GFMS_DB_DUMP_PAX_ALL,
159  MRPC_GFMS_DB_DUMP_PAX,
160  MRPC_GFMS_DB_DUMP_HVD,
161  MRPC_GFMS_DB_DUMP_FAB_PORT,
162  MRPC_GFMS_DB_DUMP_EP_PORT,
163  MRPC_GFMS_DB_DUMP_HVD_DETAIL,
164 
165  MRPC_FW_TX_EXEC = 2,
166  MRPC_FW_TX_FLASH = 3,
167  MRPC_FW_TX_TOGGLE = 4,
168 
169  MRPC_DBG_UNLOCK_PKEY = 0,
170  MRPC_DBG_UNLOCK_DATA = 1,
171  MRPC_DBG_UNLOCK_UPDATE = 2,
172 
173  MRPC_KMSK_ENTRY_SET_PKEY = 0,
174  MRPC_KMSK_ENTRY_SET_SIG = 1,
175  MRPC_KMSK_ENTRY_SET_KMSK = 2,
176 };
177 
178 #endif