[processor-sdk/pdk.git] / packages / ti / drv / sciclient / soc / sysfw / include / tisci / tisci_protocol.h
1 /*
2 * Copyright (C) 2017-2020 Texas Instruments Incorporated
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 *
11 * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the
14 * distribution.
15 *
16 * Neither the name of Texas Instruments Incorporated nor the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 */
33 /**
34 * \ingroup TISCI
35 * \defgroup tisci_protocol tisci_protocol
36 *
37 * DMSC controls the power management, security and resource management
38 * of the device.
39 *
40 *
41 * @{
42 */
43 /**
44 *
45 * \brief This file contains:
46 *
47 * WARNING!!: Autogenerated file from SYSFW. DO NOT MODIFY!!
48 * System Firmware TISCI Messaging Core
49 *
50 * TISCI Protocol Definitions
51 *
52 */
54 #ifndef TISCI_PROTOCOL_H
55 #define TISCI_PROTOCOL_H
58 /**
59 * This flag is reserved and not to be used.
60 */
61 #define TISCI_MSG_FLAG_RESERVED0 TISCI_BIT(0)
63 /**
64 * ACK on Processed: Send a response to a message after it has been processed
65 * with TISCI_MSG_FLAG_ACK set if the processing succeeded, or a NAK otherwise.
66 * This response contains the complete response to the message with the result
67 * of the actual action that was requested.
68 */
69 #define TISCI_MSG_FLAG_AOP TISCI_BIT(1)
71 /** Indicate that this message is marked secure */
72 #define TISCI_MSG_FLAG_SEC TISCI_BIT(2)
74 /**
75 * Response flag for a message that indicates success. If this flag is NOT
76 * set then that is to be interpreted as a NAK.
77 */
78 #define TISCI_MSG_FLAG_ACK TISCI_BIT(1)
80 /**
81 * \brief Header that prefixes all TISCI messages.
82 *
83 * \param type Type of message identified by a TISCI_MSG_* ID
84 * \param host Host of the message.
85 * \param seq Message identifier indicating a transfer sequence.
86 * \param flags TISCI_MSG_FLAG_* for the message.
87 * \param payload Placeholder pointer that can be used to access the raw message body.
88 */
89 struct tisci_header {
90 uint16_t type;
91 uint8_t host;
92 uint8_t seq;
93 uint32_t flags;
94 /* Windows Visual Studio build has issues with payload[], changing it only for visual studio build */
95 #ifdef _MSC_VER
96 uint8_t payload;
97 #else
98 uint8_t payload[];
99 #endif
100 };
102 /*
103 * Messages sent via secure transport need an additional field for integrity
104 * check in addition to the fields of a TISCI message. The below data structure
105 * is used to enhance the standard TISCI message header with a field for
106 * integrity check and a reserved field for future use.
107 *
108 * The below defined header is placed before the \ref tisci_header when
109 * transmitting a message via a secure transport.
110 *
111 * For more information, please refer to the TISCI documentation.
112 */
114 /**
115 * \brief Header that prefixes all TISCI messages sent via secure transport.
116 *
117 * \param integ_check This field should always be initialized to zero on GP
118 * devices. The mechanism to calculate the integrity check for HS devices
119 * is under definition.
120 *
121 * \param rsvd Reserved field for future use. Initialize to zero.
122 *
123 */
124 struct tisci_sec_header {
125 uint16_t integ_check;
126 uint16_t rsvd;
127 };
129 /* TISCI Message IDs */
130 #define TISCI_MSG_VERSION (0x0002U)
131 #define TISCI_MSG_BOOT_NOTIFICATION (0x000AU)
132 #define TISCI_MSG_BOARD_CONFIG (0x000BU)
133 #define TISCI_MSG_BOARD_CONFIG_RM (0x000CU)
134 #define TISCI_MSG_BOARD_CONFIG_SECURITY (0x000DU)
135 #define TISCI_MSG_BOARD_CONFIG_PM (0x000EU)
137 #define TISCI_MSG_ENABLE_WDT (0x0000U)
138 #define TISCI_MSG_WAKE_RESET (0x0001U)
139 #define TISCI_MSG_WAKE_REASON (0x0003U)
140 #define TISCI_MSG_GOODBYE (0x0004U)
141 #define TISCI_MSG_SYS_RESET (0x0005U)
143 #define TISCI_MSG_QUERY_MSMC (0x0020U)
145 #define TISCI_MSG_SET_CLOCK (0x0100U)
146 #define TISCI_MSG_GET_CLOCK (0x0101U)
147 #define TISCI_MSG_SET_CLOCK_PARENT (0x0102U)
148 #define TISCI_MSG_GET_CLOCK_PARENT (0x0103U)
149 #define TISCI_MSG_GET_NUM_CLOCK_PARENTS (0x0104U)
150 #define TISCI_MSG_SET_FREQ (0x010cU)
151 #define TISCI_MSG_QUERY_FREQ (0x010dU)
152 #define TISCI_MSG_GET_FREQ (0x010eU)
154 #define TISCI_MSG_SET_DEVICE (0x0200U)
155 #define TISCI_MSG_GET_DEVICE (0x0201U)
156 #define TISCI_MSG_SET_DEVICE_RESETS (0x0202U)
157 #define TISCI_MSG_DEVICE_DROP_POWERUP_REF (0x0203U)
159 /** Message to set a firewall region configuration */
160 #define TISCI_MSG_SET_FWL_REGION (0x9000U)
161 /** Message to get a firewall region configuration */
162 #define TISCI_MSG_GET_FWL_REGION (0x9001U)
163 /** Message to change firewall region owner */
164 #define TISCI_MSG_CHANGE_FWL_OWNER (0x9002U)
165 /** Message to derive a KEK and set SA2UL DKEK register */
166 #define TISCI_MSG_SA2UL_SET_DKEK (0x9003U)
167 /** Message to erase the DKEK register */
168 #define TISCI_MSG_SA2UL_RELEASE_DKEK (0x9004U)
169 /** Message to import a symmetric key to the keystore */
170 #define TISCI_MSG_KEYSTORE_IMPORT_SKEY (0x9005U)
171 /** Message to erase a imported symmetric key in the keystore */
172 #define TISCI_MSG_KEYSTORE_ERASE_SKEY (0x9006U)
173 /* Reserved ID not for (re)use */
174 #define TISCI_MSG_SEC_RESERVED_9007 (0x9007U)
175 /* Reserved ID not for (re)use */
176 #define TISCI_MSG_SEC_RESERVED_9008 (0x9008U)
177 /** Message to set a ISC region configuration */
178 #define TISCI_MSG_SET_ISC_REGION (0x9009U)
179 /** Message to get a ISC region configuration */
180 #define TISCI_MSG_GET_ISC_REGION (0x900AU)
181 /** Notification for firewall exception */
182 #define TISCI_MSG_FWL_EXCP_NOTIFICATION (0x900BU)
183 /** Message to open debug firewalls using a certificate */
184 #define TISCI_MSG_OPEN_DEBUG_FWLS (0x900CU)
185 /**
186 * Message to write partitioning data and provisioned keys to the keystore
187 * memory
188 */
189 #define TISCI_MSG_KEYSTORE_WRITE (0x900DU)
190 /**
191 * Message to encrypt and export the full keystore contents for saving to
192 * external storage
193 */
194 #define TISCI_MSG_KEYSTORE_EXPORT_ALL (0x900EU)
195 /** Message to import and decrypt a previously exported keystore blob */
196 #define TISCI_MSG_KEYSTORE_IMPORT_ALL (0x900FU)
197 /* Reserved ID not for (re)use */
198 #define TISCI_MSG_SEC_RESERVED_9010 (0x9010U)
199 /* Reserved ID not for (re)use */
200 #define TISCI_MSG_SEC_RESERVED_9011 (0x9011U)
201 /* Reserved ID not for (re)use */
202 #define TISCI_MSG_SEC_RESERVED_9012 (0x9012U)
203 /* Reserved ID not for (re)use */
204 #define TISCI_MSG_SEC_RESERVED_9013 (0x9013U)
205 /* Reserved ID not for (re)use */
206 #define TISCI_MSG_SEC_RESERVED_9014 (0x9014U)
207 /* Reserved ID not for (re)use */
208 #define TISCI_MSG_SEC_RESERVED_9015 (0x9015U)
210 /* Reserved ID not for (re)use */
211 #define TISCI_MSG_SEC_RESERVED_9016 (0x9016U)
213 /** Message to acquire authentication resources from sysfw */
214 #define TISCI_MSG_SA2UL_AUTH_RES_ACQUIRE (0x9017U)
216 /** Message to release authentication resources back to sysfw */
217 #define TISCI_MSG_SA2UL_AUTH_RES_RELEASE (0x9018U)
219 /* Reserved ID not for (re)use */
220 #define TISCI_MSG_SEC_RESERVED_9020 (0x9020U)
222 /** Message to get SOC UID */
223 #define TISCI_MSG_GET_SOC_UID (0x9021U)
225 /*********************************************************/
226 /* Messages for handling extended OTP area */
228 /** Message to read 32 bit OTP MMR by register number */
229 #define TISCI_MSG_READ_OTP_MMR (0x9022U)
231 /** Message to write to non-secure OTP Row */
232 #define TISCI_MSG_WRITE_OTP_ROW (0x9023U)
234 /** Message to lock OTP Row */
235 #define TISCI_MSG_LOCK_OTP_ROW (0x9024U)
237 /** Message to perform a global lock on OTP writes */
238 #define TISCI_MSG_SOFT_LOCK_OTP_WRITE_GLOBAL (0x9025U)
240 /** Message to get the lock status of a row */
241 #define TISCI_MSG_GET_OTP_ROW_LOCK_STATUS (0x9026U)
243 /** Message ID reserved for row level soft lock on OTP writes */
244 #define TISCI_MSG_RSVD_OTP_1 (0x9027U)
246 /** Message ID reserved for write to secure OTP row */
247 #define TISCI_MSG_RSVD_OTP_2 (0x9028U)
249 /** Message to derive a KEK and return it via TISCI */
250 #define TISCI_MSG_SA2UL_GET_DKEK (0x9029U)
252 /** Message for handing over subset of security functionality to
253 * another core. Only available on certain platforms.
254 */
255 #define TISCI_MSG_SEC_HANDOVER (0x9030U)
257 /******************************************************/
259 /* Keywriter TISCI message to write keys from a certificate */
260 #define TISCI_MSG_KEY_WRITER (0x9031U)
262 /* Processor Control APIs */
264 /** Message to get a Processor */
265 #define TISCI_MSG_PROC_REQUEST (0xC000U)
266 /** Message to release a Processor */
267 #define TISCI_MSG_PROC_RELEASE (0xC001U)
268 /** Message to handover a Processor */
269 #define TISCI_MSG_PROC_HANDOVER (0xC005U)
271 /** Message to Set the processor configuration */
272 #define TISCI_MSG_PROC_SET_CONFIG (0xC100U)
273 /** Message to Set the processor control */
274 #define TISCI_MSG_PROC_SET_CONTROL (0xC101U)
276 /** Message to Get the processor status */
277 #define TISCI_MSG_PROC_GET_STATUS (0xC400U)
279 /** Message to Wait for processor status */
280 #define TISCI_MSG_PROC_WAIT_STATUS (0xC401U)
282 /** Message to do authenticated boot configuration of a processor */
283 #define TISCI_MSG_PROC_AUTH_BOOT (0xC120U)
285 /* RM IDs */
287 /**
288 * RM TISCI message to request a resource range assignment for a host
289 */
290 #define TISCI_MSG_RM_GET_RESOURCE_RANGE (0x1500U)
291 /**
292 * RM TISCI message to set an IRQ between a peripheral and host processor
293 */
294 #define TISCI_MSG_RM_IRQ_SET (0x1000U)
295 /**
296 * RM TISCI message to release a configured IRQ
297 */
298 #define TISCI_MSG_RM_IRQ_RELEASE (0x1001U)
299 /* Reserved ID not for (re)use */
300 #define TISCI_MSG_RM_RESERVED_1100 (0x1100U)
301 /* Reserved ID not for (re)use */
302 #define TISCI_MSG_RM_RESERVED_1101 (0x1101U)
303 /* Reserved ID not for (re)use */
304 #define TISCI_MSG_RM_RESERVED_1102 (0x1102U)
305 /* Reserved ID not for (re)use */
306 #define TISCI_MSG_RM_RESERVED_1103 (0x1103U)
307 /**
308 * RM TISCI message to configure a Navigator Subsystem ring
309 */
310 #define TISCI_MSG_RM_RING_CFG (0x1110U)
311 /* Reserved ID not for (re)use */
312 #define TISCI_MSG_RM_RESERVED_1111 (0x1111U)
313 /**
314 * RM TISCI message to configure a Navigator Subsystem ring monitor
315 */
316 #define TISCI_MSG_RM_RING_MON_CFG (0x1120U)
317 /* Reserved ID not for (re)use */
318 #define TISCI_MSG_RM_RESERVED_1200 (0x1200U)
319 /* Reserved ID not for (re)use */
320 #define TISCI_MSG_RM_RESERVED_1201 (0x1201U)
321 /**
322 * RM TISCI message to configure a Navigator Subsystem UDMAP transmit channel
323 */
324 #define TISCI_MSG_RM_UDMAP_TX_CH_CFG (0x1205U)
325 /* Reserved ID not for (re)use */
326 #define TISCI_MSG_RM_RESERVED_1206 (0x1206U)
327 /* Reserved ID not for (re)use */
328 #define TISCI_MSG_RM_RESERVED_1210 (0x1210U)
329 /* Reserved ID not for (re)use */
330 #define TISCI_MSG_RM_RESERVED_1211 (0x1211U)
331 /**
332 * RM TISCI message to configure a Navigator Subsystem UDMAP receive channel
333 */
334 #define TISCI_MSG_RM_UDMAP_RX_CH_CFG (0x1215U)
335 #define TISCI_MSG_RM_RESERVED_1216 (0x1216U)
336 /* Reserved ID not for (re)use */
337 #define TISCI_MSG_RM_RESERVED_1220 (0x1220U)
338 /* Reserved ID not for (re)use */
339 #define TISCI_MSG_RM_RESERVED_1221 (0x1221U)
340 /**
341 * RM TISCI message to configure a Navigator Subsystem UDMAP receive flow
342 */
343 #define TISCI_MSG_RM_UDMAP_FLOW_CFG (0x1230U)
344 /**
345 * RM TISCI message to configure a Navigator Subsystem UDMAP receive flow's
346 * optional, size based free descriptor queue registers
347 */
348 #define TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_CFG (0x1231U)
349 /* Reserved ID not for (re)use */
350 #define TISCI_MSG_RM_RESERVED_1232 (0x1232U)
351 /* Reserved ID not for (re)use */
352 #define TISCI_MSG_RM_RESERVED_1233 (0x1233U)
353 /**
354 * RM TISCI message to delegate a DMA flow to another host for configuration
355 */
356 #define TISCI_MSG_RM_UDMAP_FLOW_DELEGATE (0x1234U)
357 /**
358 * RM TISCI message to configure a Navigator Subsystem UDMAP global
359 * configuration
360 */
361 #define TISCI_MSG_RM_UDMAP_GCFG_CFG (0x1240U)
362 /* Reserved ID not for (re)use */
363 #define TISCI_MSG_RM_RESERVED_1241 (0x1241U)
364 /**
365 * RM TISCI message to pair PSI-L source and destination threads
366 */
367 #define TISCI_MSG_RM_PSIL_PAIR (0x1280U)
368 /**
369 * RM TISCI message to unpair PSI-L source and destination threads
370 */
371 #define TISCI_MSG_RM_PSIL_UNPAIR (0x1281U)
372 /**
373 * RM TISCI message to read PSI-L thread RT registers via the PSI-L proxy
374 */
375 #define TISCI_MSG_RM_PSIL_READ (0x1282U)
376 /**
377 * RM TISCI message to write PSI-L thread RT registers via the PSI-L proxy
378 */
379 #define TISCI_MSG_RM_PSIL_WRITE (0x1283U)
380 /**
381 * RM TISCI message to setup a Navigator Subsystem proxy for
382 * configuration
383 */
384 #define TISCI_MSG_RM_PROXY_CFG (0x1300U)
386 #endif /* TISCI_PROTOCOL_H */
388 /* @} */