blob: ce50bf6800eb1fee70a872d8ae648b1a9582b681 [file] [log] [blame]
Lokesh Vutla5af02db2018-08-27 15:57:32 +05301/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Texas Instruments System Control Interface (TISCI) Protocol
4 *
5 * Communication protocol with TI SCI hardware
6 * The system works in a message response protocol
7 * See: http://processors.wiki.ti.com/index.php/TISCI for details
8 *
Nishanth Menoneaa39c62023-11-01 15:56:03 -05009 * Copyright (C) 2018 Texas Instruments Incorporated - https://www.ti.com/
Lokesh Vutla5af02db2018-08-27 15:57:32 +053010 * Based on drivers/firmware/ti_sci.h from Linux.
11 *
12 */
13
14#ifndef __TI_SCI_H
15#define __TI_SCI_H
16
17/* Generic Messages */
Simon Glass4dcacfc2020-05-10 11:40:13 -060018#include <linux/bitops.h>
Lokesh Vutla5af02db2018-08-27 15:57:32 +053019#define TI_SCI_MSG_ENABLE_WDT 0x0000
20#define TI_SCI_MSG_WAKE_RESET 0x0001
21#define TI_SCI_MSG_VERSION 0x0002
22#define TI_SCI_MSG_WAKE_REASON 0x0003
23#define TI_SCI_MSG_GOODBYE 0x0004
24#define TI_SCI_MSG_SYS_RESET 0x0005
25#define TI_SCI_MSG_BOARD_CONFIG 0x000b
Andreas Dannenberg5299c4c2018-08-27 15:57:33 +053026#define TI_SCI_MSG_BOARD_CONFIG_RM 0x000c
27#define TI_SCI_MSG_BOARD_CONFIG_SECURITY 0x000d
28#define TI_SCI_MSG_BOARD_CONFIG_PM 0x000e
Moteen Shah9cd3a972025-06-09 13:44:30 +053029#define TI_SCI_MSG_DM_VERSION 0x000f
Lokesh Vutla032dce82019-03-08 11:47:32 +053030#define TISCI_MSG_QUERY_MSMC 0x0020
Moteen Shahfba850c2025-06-09 13:44:29 +053031#define TI_SCI_MSG_QUERY_FW_CAPS 0x0022
Lokesh Vutla5af02db2018-08-27 15:57:32 +053032
Andreas Dannenberg24a4d5e2018-08-27 15:57:34 +053033/* Device requests */
34#define TI_SCI_MSG_SET_DEVICE_STATE 0x0200
35#define TI_SCI_MSG_GET_DEVICE_STATE 0x0201
36#define TI_SCI_MSG_SET_DEVICE_RESETS 0x0202
37
Lokesh Vutlad10c80c2018-08-27 15:57:35 +053038/* Clock requests */
39#define TI_SCI_MSG_SET_CLOCK_STATE 0x0100
40#define TI_SCI_MSG_GET_CLOCK_STATE 0x0101
41#define TI_SCI_MSG_SET_CLOCK_PARENT 0x0102
42#define TI_SCI_MSG_GET_CLOCK_PARENT 0x0103
43#define TI_SCI_MSG_GET_NUM_CLOCK_PARENTS 0x0104
44#define TI_SCI_MSG_SET_CLOCK_FREQ 0x010c
45#define TI_SCI_MSG_QUERY_CLOCK_FREQ 0x010d
46#define TI_SCI_MSG_GET_CLOCK_FREQ 0x010e
47
Lokesh Vutlab8856af2018-08-27 15:57:37 +053048/* Processor Control Messages */
49#define TISCI_MSG_PROC_REQUEST 0xc000
50#define TISCI_MSG_PROC_RELEASE 0xc001
51#define TISCI_MSG_PROC_HANDOVER 0xc005
52#define TISCI_MSG_SET_PROC_BOOT_CONFIG 0xc100
53#define TISCI_MSG_SET_PROC_BOOT_CTRL 0xc101
Jorge Ramirez-Ortizb0373282023-01-10 18:29:48 +010054#define TISCI_MSG_PROC_AUTH_BOOT_IMAGE 0xc120
Lokesh Vutlab8856af2018-08-27 15:57:37 +053055#define TISCI_MSG_GET_PROC_BOOT_STATUS 0xc400
Andreas Dannenbergca08cb32019-06-07 19:24:40 +053056#define TISCI_MSG_WAIT_PROC_BOOT_STATUS 0xc401
Lokesh Vutlab8856af2018-08-27 15:57:37 +053057
Grygorii Strashkod64c5b22019-02-05 17:31:21 +053058/* Resource Management Requests */
59#define TI_SCI_MSG_GET_RESOURCE_RANGE 0x1500
60
61/* NAVSS resource management */
62/* Ringacc requests */
63#define TI_SCI_MSG_RM_RING_CFG 0x1110
Grygorii Strashkod64c5b22019-02-05 17:31:21 +053064
65/* PSI-L requests */
66#define TI_SCI_MSG_RM_PSIL_PAIR 0x1280
67#define TI_SCI_MSG_RM_PSIL_UNPAIR 0x1281
68
69#define TI_SCI_MSG_RM_UDMAP_TX_ALLOC 0x1200
70#define TI_SCI_MSG_RM_UDMAP_TX_FREE 0x1201
71#define TI_SCI_MSG_RM_UDMAP_RX_ALLOC 0x1210
72#define TI_SCI_MSG_RM_UDMAP_RX_FREE 0x1211
73#define TI_SCI_MSG_RM_UDMAP_FLOW_CFG 0x1220
74#define TI_SCI_MSG_RM_UDMAP_OPT_FLOW_CFG 0x1221
75
76#define TISCI_MSG_RM_UDMAP_TX_CH_CFG 0x1205
Grygorii Strashkod64c5b22019-02-05 17:31:21 +053077#define TISCI_MSG_RM_UDMAP_RX_CH_CFG 0x1215
Grygorii Strashkod64c5b22019-02-05 17:31:21 +053078#define TISCI_MSG_RM_UDMAP_FLOW_CFG 0x1230
79#define TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_CFG 0x1231
Grygorii Strashkod64c5b22019-02-05 17:31:21 +053080
Andrew F. Davis2aafc0c2019-04-12 12:54:43 -040081#define TISCI_MSG_FWL_SET 0x9000
82#define TISCI_MSG_FWL_GET 0x9001
83#define TISCI_MSG_FWL_CHANGE_OWNER 0x9002
84
Lokesh Vutla5af02db2018-08-27 15:57:32 +053085/**
86 * struct ti_sci_msg_hdr - Generic Message Header for All messages and responses
87 * @type: Type of messages: One of TI_SCI_MSG* values
88 * @host: Host of the message
89 * @seq: Message identifier indicating a transfer sequence
90 * @flags: Flag for the message
91 */
92struct ti_sci_msg_hdr {
93 u16 type;
94 u8 host;
95 u8 seq;
96#define TI_SCI_MSG_FLAG(val) (1 << (val))
97#define TI_SCI_FLAG_REQ_GENERIC_NORESPONSE 0x0
98#define TI_SCI_FLAG_REQ_ACK_ON_RECEIVED TI_SCI_MSG_FLAG(0)
99#define TI_SCI_FLAG_REQ_ACK_ON_PROCESSED TI_SCI_MSG_FLAG(1)
100#define TI_SCI_FLAG_RESP_GENERIC_NACK 0x0
101#define TI_SCI_FLAG_RESP_GENERIC_ACK TI_SCI_MSG_FLAG(1)
102 /* Additional Flags */
103 u32 flags;
104} __packed;
105
106/**
107 * struct ti_sci_secure_msg_hdr - Header that prefixes all TISCI messages sent
108 * via secure transport.
109 * @checksum: crc16 checksum for the entire message
110 * @reserved: Reserved for future use.
111 */
112struct ti_sci_secure_msg_hdr {
113 u16 checksum;
114 u16 reserved;
115} __packed;
116
117/**
118 * struct ti_sci_msg_resp_version - Response for a message
119 * @hdr: Generic header
120 * @firmware_description: String describing the firmware
121 * @firmware_revision: Firmware revision
122 * @abi_major: Major version of the ABI that firmware supports
123 * @abi_minor: Minor version of the ABI that firmware supports
124 *
125 * In general, ABI version changes follow the rule that minor version increments
126 * are backward compatible. Major revision changes in ABI may not be
127 * backward compatible.
128 *
129 * Response to a generic message with message type TI_SCI_MSG_VERSION
130 */
131struct ti_sci_msg_resp_version {
132 struct ti_sci_msg_hdr hdr;
133 char firmware_description[32];
134 u16 firmware_revision;
135 u8 abi_major;
136 u8 abi_minor;
137} __packed;
138
Andreas Dannenberg5299c4c2018-08-27 15:57:33 +0530139/**
Moteen Shah9cd3a972025-06-09 13:44:30 +0530140 * struct ti_sci_msg_dm_resp_version - Response for a message
141 * @hdr: Generic header
142 * @version: Version number of the firmware
143 * @sub_version: Sub-version number of the firmware
144 * @patch_version: Patch version number of the firmware
145 * @abi_major: Major version of the ABI that firmware supports
146 * @abi_minor: Minor version of the ABI that firmware supports
147 * @sci_server_version: String describing the SCI server version
148 * @rm_pm_hal_version: String describing the RM PM HAL version
149 *
150 * In general, ABI version changes follow the rule that minor version increments
151 * are backward compatible. Major revision changes in ABI may not be
152 * backward compatible.
153 *
154 * Response to a message with message type TI_SCI_MSG_DM_VERSION
155 */
156struct ti_sci_msg_dm_resp_version {
157 struct ti_sci_msg_hdr hdr;
158 u16 version;
159 u8 sub_version;
160 u8 patch_version;
161 u8 abi_major;
162 u8 abi_minor;
163 char rm_pm_hal_version[12];
164 char sci_server_version[26];
165} __packed;
166
167/**
Moteen Shahfba850c2025-06-09 13:44:29 +0530168 * struct ti_sci_query_fw_caps_resp - Response for a message
169 * @hdr: Generic header
170 * @fw_caps: 64-bit value representing the FW/SOC capabilities.
171 *
172 * Response to a message with message type TI_SCI_MSG_QUERY_FW_CAPS
173 */
174struct ti_sci_query_fw_caps_resp {
175 struct ti_sci_msg_hdr hdr;
176 u64 fw_caps;
177} __packed;
178
179/**
Andreas Dannenberg5bd08372018-08-27 15:57:36 +0530180 * struct ti_sci_msg_req_reboot - Reboot the SoC
181 * @hdr: Generic Header
Dave Gerlach366df4e2021-05-13 20:10:55 -0500182 * @domain: Domain to be reset, 0 for full SoC reboot.
Andreas Dannenberg5bd08372018-08-27 15:57:36 +0530183 *
184 * Request type is TI_SCI_MSG_SYS_RESET, responded with a generic
185 * ACK/NACK message.
186 */
187struct ti_sci_msg_req_reboot {
188 struct ti_sci_msg_hdr hdr;
Dave Gerlach366df4e2021-05-13 20:10:55 -0500189 u8 domain;
Andreas Dannenberg5bd08372018-08-27 15:57:36 +0530190} __packed;
191
192/**
Andreas Dannenberg5299c4c2018-08-27 15:57:33 +0530193 * struct ti_sci_msg_board_config - Board configuration message
194 * @hdr: Generic Header
195 * @boardcfgp_low: Lower 32 bit of the pointer pointing to the board
196 * configuration data
197 * @boardcfgp_high: Upper 32 bit of the pointer pointing to the board
198 * configuration data
199 * @boardcfg_size: Size of board configuration data object
200 * Request type is TI_SCI_MSG_BOARD_CONFIG, responded with a generic
201 * ACK/NACK message.
202 */
203struct ti_sci_msg_board_config {
204 struct ti_sci_msg_hdr hdr;
205 u32 boardcfgp_low;
206 u32 boardcfgp_high;
207 u16 boardcfg_size;
208} __packed;
209
Andreas Dannenberg24a4d5e2018-08-27 15:57:34 +0530210/**
Lokesh Vutla032dce82019-03-08 11:47:32 +0530211 * struct ti_sci_msg_resp_query_msmc - Query msmc message response structure
212 * @hdr: Generic Header
213 * @msmc_start_low: Lower 32 bit of msmc start
214 * @msmc_start_high: Upper 32 bit of msmc start
215 * @msmc_end_low: Lower 32 bit of msmc end
216 * @msmc_end_high: Upper 32 bit of msmc end
217 *
218 * Response to a generic message with message type TISCI_MSG_QUERY_MSMC
219 */
220struct ti_sci_msg_resp_query_msmc {
221 struct ti_sci_msg_hdr hdr;
222 u32 msmc_start_low;
223 u32 msmc_start_high;
224 u32 msmc_end_low;
225 u32 msmc_end_high;
226} __packed;
227
228/**
Andreas Dannenberg24a4d5e2018-08-27 15:57:34 +0530229 * struct ti_sci_msg_req_set_device_state - Set the desired state of the device
230 * @hdr: Generic header
231 * @id: Indicates which device to modify
232 * @reserved: Reserved space in message, must be 0 for backward compatibility
233 * @state: The desired state of the device.
234 *
235 * Certain flags can also be set to alter the device state:
236 * + MSG_FLAG_DEVICE_WAKE_ENABLED - Configure the device to be a wake source.
237 * The meaning of this flag will vary slightly from device to device and from
238 * SoC to SoC but it generally allows the device to wake the SoC out of deep
239 * suspend states.
240 * + MSG_FLAG_DEVICE_RESET_ISO - Enable reset isolation for this device.
241 * + MSG_FLAG_DEVICE_EXCLUSIVE - Claim this device exclusively. When passed
242 * with STATE_RETENTION or STATE_ON, it will claim the device exclusively.
243 * If another host already has this device set to STATE_RETENTION or STATE_ON,
244 * the message will fail. Once successful, other hosts attempting to set
245 * STATE_RETENTION or STATE_ON will fail.
246 *
247 * Request type is TI_SCI_MSG_SET_DEVICE_STATE, responded with a generic
248 * ACK/NACK message.
249 */
250struct ti_sci_msg_req_set_device_state {
251 /* Additional hdr->flags options */
252#define MSG_FLAG_DEVICE_WAKE_ENABLED TI_SCI_MSG_FLAG(8)
253#define MSG_FLAG_DEVICE_RESET_ISO TI_SCI_MSG_FLAG(9)
254#define MSG_FLAG_DEVICE_EXCLUSIVE TI_SCI_MSG_FLAG(10)
255 struct ti_sci_msg_hdr hdr;
256 u32 id;
257 u32 reserved;
258
259#define MSG_DEVICE_SW_STATE_AUTO_OFF 0
260#define MSG_DEVICE_SW_STATE_RETENTION 1
261#define MSG_DEVICE_SW_STATE_ON 2
262 u8 state;
263} __packed;
264
265/**
266 * struct ti_sci_msg_req_get_device_state - Request to get device.
267 * @hdr: Generic header
268 * @id: Device Identifier
269 *
270 * Request type is TI_SCI_MSG_GET_DEVICE_STATE, responded device state
271 * information
272 */
273struct ti_sci_msg_req_get_device_state {
274 struct ti_sci_msg_hdr hdr;
275 u32 id;
276} __packed;
277
278/**
279 * struct ti_sci_msg_resp_get_device_state - Response to get device request.
280 * @hdr: Generic header
281 * @context_loss_count: Indicates how many times the device has lost context. A
282 * driver can use this monotonic counter to determine if the device has
283 * lost context since the last time this message was exchanged.
284 * @resets: Programmed state of the reset lines.
285 * @programmed_state: The state as programmed by set_device.
286 * - Uses the MSG_DEVICE_SW_* macros
287 * @current_state: The actual state of the hardware.
288 *
289 * Response to request TI_SCI_MSG_GET_DEVICE_STATE.
290 */
291struct ti_sci_msg_resp_get_device_state {
292 struct ti_sci_msg_hdr hdr;
293 u32 context_loss_count;
294 u32 resets;
295 u8 programmed_state;
296#define MSG_DEVICE_HW_STATE_OFF 0
297#define MSG_DEVICE_HW_STATE_ON 1
298#define MSG_DEVICE_HW_STATE_TRANS 2
299 u8 current_state;
300} __packed;
301
302/**
303 * struct ti_sci_msg_req_set_device_resets - Set the desired resets
304 * configuration of the device
305 * @hdr: Generic header
306 * @id: Indicates which device to modify
307 * @resets: A bit field of resets for the device. The meaning, behavior,
308 * and usage of the reset flags are device specific. 0 for a bit
309 * indicates releasing the reset represented by that bit while 1
310 * indicates keeping it held.
311 *
312 * Request type is TI_SCI_MSG_SET_DEVICE_RESETS, responded with a generic
313 * ACK/NACK message.
314 */
315struct ti_sci_msg_req_set_device_resets {
316 struct ti_sci_msg_hdr hdr;
317 u32 id;
318 u32 resets;
319} __packed;
320
Lokesh Vutlad10c80c2018-08-27 15:57:35 +0530321/**
322 * struct ti_sci_msg_req_set_clock_state - Request to setup a Clock state
323 * @hdr: Generic Header, Certain flags can be set specific to the clocks:
324 * MSG_FLAG_CLOCK_ALLOW_SSC: Allow this clock to be modified
325 * via spread spectrum clocking.
326 * MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE: Allow this clock's
327 * frequency to be changed while it is running so long as it
328 * is within the min/max limits.
329 * MSG_FLAG_CLOCK_INPUT_TERM: Enable input termination, this
330 * is only applicable to clock inputs on the SoC pseudo-device.
331 * @dev_id: Device identifier this request is for
332 * @clk_id: Clock identifier for the device for this request.
333 * Each device has it's own set of clock inputs. This indexes
334 * which clock input to modify.
335 * @request_state: Request the state for the clock to be set to.
336 * MSG_CLOCK_SW_STATE_UNREQ: The IP does not require this clock,
337 * it can be disabled, regardless of the state of the device
338 * MSG_CLOCK_SW_STATE_AUTO: Allow the System Controller to
339 * automatically manage the state of this clock. If the device
340 * is enabled, then the clock is enabled. If the device is set
341 * to off or retention, then the clock is internally set as not
342 * being required by the device.(default)
343 * MSG_CLOCK_SW_STATE_REQ: Configure the clock to be enabled,
344 * regardless of the state of the device.
345 *
346 * Normally, all required clocks are managed by TISCI entity, this is used
347 * only for specific control *IF* required. Auto managed state is
348 * MSG_CLOCK_SW_STATE_AUTO, in other states, TISCI entity assume remote
349 * will explicitly control.
350 *
351 * Request type is TI_SCI_MSG_SET_CLOCK_STATE, response is a generic
352 * ACK or NACK message.
353 */
354struct ti_sci_msg_req_set_clock_state {
355 /* Additional hdr->flags options */
356#define MSG_FLAG_CLOCK_ALLOW_SSC TI_SCI_MSG_FLAG(8)
357#define MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE TI_SCI_MSG_FLAG(9)
358#define MSG_FLAG_CLOCK_INPUT_TERM TI_SCI_MSG_FLAG(10)
359 struct ti_sci_msg_hdr hdr;
360 u32 dev_id;
361 u8 clk_id;
362#define MSG_CLOCK_SW_STATE_UNREQ 0
363#define MSG_CLOCK_SW_STATE_AUTO 1
364#define MSG_CLOCK_SW_STATE_REQ 2
365 u8 request_state;
366} __packed;
367
368/**
369 * struct ti_sci_msg_req_get_clock_state - Request for clock state
370 * @hdr: Generic Header
371 * @dev_id: Device identifier this request is for
372 * @clk_id: Clock identifier for the device for this request.
373 * Each device has it's own set of clock inputs. This indexes
374 * which clock input to get state of.
375 *
376 * Request type is TI_SCI_MSG_GET_CLOCK_STATE, response is state
377 * of the clock
378 */
379struct ti_sci_msg_req_get_clock_state {
380 struct ti_sci_msg_hdr hdr;
381 u32 dev_id;
382 u8 clk_id;
383} __packed;
384
385/**
386 * struct ti_sci_msg_resp_get_clock_state - Response to get clock state
387 * @hdr: Generic Header
388 * @programmed_state: Any programmed state of the clock. This is one of
389 * MSG_CLOCK_SW_STATE* values.
390 * @current_state: Current state of the clock. This is one of:
391 * MSG_CLOCK_HW_STATE_NOT_READY: Clock is not ready
392 * MSG_CLOCK_HW_STATE_READY: Clock is ready
393 *
394 * Response to TI_SCI_MSG_GET_CLOCK_STATE.
395 */
396struct ti_sci_msg_resp_get_clock_state {
397 struct ti_sci_msg_hdr hdr;
398 u8 programmed_state;
399#define MSG_CLOCK_HW_STATE_NOT_READY 0
400#define MSG_CLOCK_HW_STATE_READY 1
401 u8 current_state;
402} __packed;
403
404/**
405 * struct ti_sci_msg_req_set_clock_parent - Set the clock parent
406 * @hdr: Generic Header
407 * @dev_id: Device identifier this request is for
408 * @clk_id: Clock identifier for the device for this request.
409 * Each device has it's own set of clock inputs. This indexes
410 * which clock input to modify.
411 * @parent_id: The new clock parent is selectable by an index via this
412 * parameter.
413 *
414 * Request type is TI_SCI_MSG_SET_CLOCK_PARENT, response is generic
415 * ACK / NACK message.
416 */
417struct ti_sci_msg_req_set_clock_parent {
418 struct ti_sci_msg_hdr hdr;
419 u32 dev_id;
420 u8 clk_id;
421 u8 parent_id;
422} __packed;
423
424/**
425 * struct ti_sci_msg_req_get_clock_parent - Get the clock parent
426 * @hdr: Generic Header
427 * @dev_id: Device identifier this request is for
428 * @clk_id: Clock identifier for the device for this request.
429 * Each device has it's own set of clock inputs. This indexes
430 * which clock input to get the parent for.
431 *
432 * Request type is TI_SCI_MSG_GET_CLOCK_PARENT, response is parent information
433 */
434struct ti_sci_msg_req_get_clock_parent {
435 struct ti_sci_msg_hdr hdr;
436 u32 dev_id;
437 u8 clk_id;
438} __packed;
439
440/**
441 * struct ti_sci_msg_resp_get_clock_parent - Response with clock parent
442 * @hdr: Generic Header
443 * @parent_id: The current clock parent
444 *
445 * Response to TI_SCI_MSG_GET_CLOCK_PARENT.
446 */
447struct ti_sci_msg_resp_get_clock_parent {
448 struct ti_sci_msg_hdr hdr;
449 u8 parent_id;
450} __packed;
451
452/**
453 * struct ti_sci_msg_req_get_clock_num_parents - Request to get clock parents
454 * @hdr: Generic header
455 * @dev_id: Device identifier this request is for
456 * @clk_id: Clock identifier for the device for this request.
457 *
458 * This request provides information about how many clock parent options
459 * are available for a given clock to a device. This is typically used
460 * for input clocks.
461 *
462 * Request type is TI_SCI_MSG_GET_NUM_CLOCK_PARENTS, response is appropriate
463 * message, or NACK in case of inability to satisfy request.
464 */
465struct ti_sci_msg_req_get_clock_num_parents {
466 struct ti_sci_msg_hdr hdr;
467 u32 dev_id;
468 u8 clk_id;
469} __packed;
470
471/**
472 * struct ti_sci_msg_resp_get_clock_num_parents - Response for get clk parents
473 * @hdr: Generic header
474 * @num_parents: Number of clock parents
475 *
476 * Response to TI_SCI_MSG_GET_NUM_CLOCK_PARENTS
477 */
478struct ti_sci_msg_resp_get_clock_num_parents {
479 struct ti_sci_msg_hdr hdr;
480 u8 num_parents;
481} __packed;
482
483/**
484 * struct ti_sci_msg_req_query_clock_freq - Request to query a frequency
485 * @hdr: Generic Header
486 * @dev_id: Device identifier this request is for
487 * @min_freq_hz: The minimum allowable frequency in Hz. This is the minimum
488 * allowable programmed frequency and does not account for clock
489 * tolerances and jitter.
490 * @target_freq_hz: The target clock frequency. A frequency will be found
491 * as close to this target frequency as possible.
492 * @max_freq_hz: The maximum allowable frequency in Hz. This is the maximum
493 * allowable programmed frequency and does not account for clock
494 * tolerances and jitter.
495 * @clk_id: Clock identifier for the device for this request.
496 *
497 * NOTE: Normally clock frequency management is automatically done by TISCI
498 * entity. In case of specific requests, TISCI evaluates capability to achieve
499 * requested frequency within provided range and responds with
500 * result message.
501 *
502 * Request type is TI_SCI_MSG_QUERY_CLOCK_FREQ, response is appropriate message,
503 * or NACK in case of inability to satisfy request.
504 */
505struct ti_sci_msg_req_query_clock_freq {
506 struct ti_sci_msg_hdr hdr;
507 u32 dev_id;
508 u64 min_freq_hz;
509 u64 target_freq_hz;
510 u64 max_freq_hz;
511 u8 clk_id;
512} __packed;
513
514/**
515 * struct ti_sci_msg_resp_query_clock_freq - Response to a clock frequency query
516 * @hdr: Generic Header
517 * @freq_hz: Frequency that is the best match in Hz.
518 *
519 * Response to request type TI_SCI_MSG_QUERY_CLOCK_FREQ. NOTE: if the request
520 * cannot be satisfied, the message will be of type NACK.
521 */
522struct ti_sci_msg_resp_query_clock_freq {
523 struct ti_sci_msg_hdr hdr;
524 u64 freq_hz;
525} __packed;
526
527/**
528 * struct ti_sci_msg_req_set_clock_freq - Request to setup a clock frequency
529 * @hdr: Generic Header
530 * @dev_id: Device identifier this request is for
531 * @min_freq_hz: The minimum allowable frequency in Hz. This is the minimum
532 * allowable programmed frequency and does not account for clock
533 * tolerances and jitter.
534 * @target_freq_hz: The target clock frequency. The clock will be programmed
535 * at a rate as close to this target frequency as possible.
536 * @max_freq_hz: The maximum allowable frequency in Hz. This is the maximum
537 * allowable programmed frequency and does not account for clock
538 * tolerances and jitter.
539 * @clk_id: Clock identifier for the device for this request.
540 *
541 * NOTE: Normally clock frequency management is automatically done by TISCI
542 * entity. In case of specific requests, TISCI evaluates capability to achieve
543 * requested range and responds with success/failure message.
544 *
545 * This sets the desired frequency for a clock within an allowable
546 * range. This message will fail on an enabled clock unless
547 * MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE is set for the clock. Additionally,
548 * if other clocks have their frequency modified due to this message,
549 * they also must have the MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE or be disabled.
550 *
551 * Calling set frequency on a clock input to the SoC pseudo-device will
552 * inform the PMMC of that clock's frequency. Setting a frequency of
553 * zero will indicate the clock is disabled.
554 *
555 * Calling set frequency on clock outputs from the SoC pseudo-device will
556 * function similarly to setting the clock frequency on a device.
557 *
558 * Request type is TI_SCI_MSG_SET_CLOCK_FREQ, response is a generic ACK/NACK
559 * message.
560 */
561struct ti_sci_msg_req_set_clock_freq {
562 struct ti_sci_msg_hdr hdr;
563 u32 dev_id;
564 u64 min_freq_hz;
565 u64 target_freq_hz;
566 u64 max_freq_hz;
567 u8 clk_id;
568} __packed;
569
570/**
571 * struct ti_sci_msg_req_get_clock_freq - Request to get the clock frequency
572 * @hdr: Generic Header
573 * @dev_id: Device identifier this request is for
574 * @clk_id: Clock identifier for the device for this request.
575 *
576 * NOTE: Normally clock frequency management is automatically done by TISCI
577 * entity. In some cases, clock frequencies are configured by host.
578 *
579 * Request type is TI_SCI_MSG_GET_CLOCK_FREQ, responded with clock frequency
580 * that the clock is currently at.
581 */
582struct ti_sci_msg_req_get_clock_freq {
583 struct ti_sci_msg_hdr hdr;
584 u32 dev_id;
585 u8 clk_id;
586} __packed;
587
588/**
589 * struct ti_sci_msg_resp_get_clock_freq - Response of clock frequency request
590 * @hdr: Generic Header
591 * @freq_hz: Frequency that the clock is currently on, in Hz.
592 *
593 * Response to request type TI_SCI_MSG_GET_CLOCK_FREQ.
594 */
595struct ti_sci_msg_resp_get_clock_freq {
596 struct ti_sci_msg_hdr hdr;
597 u64 freq_hz;
598} __packed;
599
Grygorii Strashkod64c5b22019-02-05 17:31:21 +0530600#define TI_SCI_IRQ_SECONDARY_HOST_INVALID 0xff
601
602/**
603 * struct ti_sci_msg_req_get_resource_range - Request to get a host's assigned
604 * range of resources.
605 * @hdr: Generic Header
606 * @type: Unique resource assignment type
607 * @subtype: Resource assignment subtype within the resource type.
608 * @secondary_host: Host processing entity to which the resources are
609 * allocated. This is required only when the destination
610 * host id id different from ti sci interface host id,
611 * else TI_SCI_IRQ_SECONDARY_HOST_INVALID can be passed.
612 *
613 * Request type is TI_SCI_MSG_GET_RESOURCE_RANGE. Responded with requested
614 * resource range which is of type TI_SCI_MSG_GET_RESOURCE_RANGE.
615 */
616struct ti_sci_msg_req_get_resource_range {
617 struct ti_sci_msg_hdr hdr;
618#define MSG_RM_RESOURCE_TYPE_MASK GENMASK(9, 0)
619#define MSG_RM_RESOURCE_SUBTYPE_MASK GENMASK(5, 0)
620 u16 type;
621 u8 subtype;
622 u8 secondary_host;
623} __packed;
624
625/**
626 * struct ti_sci_msg_resp_get_resource_range - Response to resource get range.
627 * @hdr: Generic Header
628 * @range_start: Start index of the resource range.
629 * @range_num: Number of resources in the range.
630 *
631 * Response to request TI_SCI_MSG_GET_RESOURCE_RANGE.
632 */
633struct ti_sci_msg_resp_get_resource_range {
634 struct ti_sci_msg_hdr hdr;
635 u16 range_start;
636 u16 range_num;
637} __packed;
638
Lokesh Vutlab8856af2018-08-27 15:57:37 +0530639#define TISCI_ADDR_LOW_MASK GENMASK_ULL(31, 0)
640#define TISCI_ADDR_HIGH_MASK GENMASK_ULL(63, 32)
641#define TISCI_ADDR_HIGH_SHIFT 32
642
643/**
644 * struct ti_sci_msg_req_proc_request - Request a processor
645 *
646 * @hdr: Generic Header
647 * @processor_id: ID of processor
648 *
649 * Request type is TISCI_MSG_PROC_REQUEST, response is a generic ACK/NACK
650 * message.
651 */
652struct ti_sci_msg_req_proc_request {
653 struct ti_sci_msg_hdr hdr;
654 u8 processor_id;
655} __packed;
656
657/**
658 * struct ti_sci_msg_req_proc_release - Release a processor
659 *
660 * @hdr: Generic Header
661 * @processor_id: ID of processor
662 *
663 * Request type is TISCI_MSG_PROC_RELEASE, response is a generic ACK/NACK
664 * message.
665 */
666struct ti_sci_msg_req_proc_release {
667 struct ti_sci_msg_hdr hdr;
668 u8 processor_id;
669} __packed;
670
671/**
672 * struct ti_sci_msg_req_proc_handover - Handover a processor to a host
673 *
674 * @hdr: Generic Header
675 * @processor_id: ID of processor
676 * @host_id: New Host we want to give control to
677 *
678 * Request type is TISCI_MSG_PROC_HANDOVER, response is a generic ACK/NACK
679 * message.
680 */
681struct ti_sci_msg_req_proc_handover {
682 struct ti_sci_msg_hdr hdr;
683 u8 processor_id;
684 u8 host_id;
685} __packed;
686
687/* A53 Config Flags */
688#define PROC_BOOT_CFG_FLAG_ARMV8_DBG_EN 0x00000001
689#define PROC_BOOT_CFG_FLAG_ARMV8_DBG_NIDEN 0x00000002
690#define PROC_BOOT_CFG_FLAG_ARMV8_DBG_SPIDEN 0x00000004
691#define PROC_BOOT_CFG_FLAG_ARMV8_DBG_SPNIDEN 0x00000008
692#define PROC_BOOT_CFG_FLAG_ARMV8_AARCH32 0x00000100
693
694/* R5 Config Flags */
695#define PROC_BOOT_CFG_FLAG_R5_DBG_EN 0x00000001
696#define PROC_BOOT_CFG_FLAG_R5_DBG_NIDEN 0x00000002
697#define PROC_BOOT_CFG_FLAG_R5_LOCKSTEP 0x00000100
698#define PROC_BOOT_CFG_FLAG_R5_TEINIT 0x00000200
699#define PROC_BOOT_CFG_FLAG_R5_NMFI_EN 0x00000400
700#define PROC_BOOT_CFG_FLAG_R5_TCM_RSTBASE 0x00000800
701#define PROC_BOOT_CFG_FLAG_R5_BTCM_EN 0x00001000
702#define PROC_BOOT_CFG_FLAG_R5_ATCM_EN 0x00002000
703
704/**
705 * struct ti_sci_msg_req_set_proc_boot_config - Set Processor boot configuration
706 * @hdr: Generic Header
707 * @processor_id: ID of processor
708 * @bootvector_low: Lower 32bit (Little Endian) of boot vector
709 * @bootvector_high: Higher 32bit (Little Endian) of boot vector
710 * @config_flags_set: Optional Processor specific Config Flags to set.
711 * Setting a bit here implies required bit sets to 1.
712 * @config_flags_clear: Optional Processor specific Config Flags to clear.
713 * Setting a bit here implies required bit gets cleared.
714 *
715 * Request type is TISCI_MSG_SET_PROC_BOOT_CONFIG, response is a generic
716 * ACK/NACK message.
717 */
718struct ti_sci_msg_req_set_proc_boot_config {
719 struct ti_sci_msg_hdr hdr;
720 u8 processor_id;
721 u32 bootvector_low;
722 u32 bootvector_high;
723 u32 config_flags_set;
724 u32 config_flags_clear;
725} __packed;
726
727/* R5 Control Flags */
728#define PROC_BOOT_CTRL_FLAG_R5_CORE_HALT 0x00000001
729
730/**
731 * struct ti_sci_msg_req_set_proc_boot_ctrl - Set Processor boot control flags
732 * @hdr: Generic Header
733 * @processor_id: ID of processor
734 * @control_flags_set: Optional Processor specific Control Flags to set.
735 * Setting a bit here implies required bit sets to 1.
736 * @control_flags_clear:Optional Processor specific Control Flags to clear.
737 * Setting a bit here implies required bit gets cleared.
738 *
739 * Request type is TISCI_MSG_SET_PROC_BOOT_CTRL, response is a generic ACK/NACK
740 * message.
741 */
742struct ti_sci_msg_req_set_proc_boot_ctrl {
743 struct ti_sci_msg_hdr hdr;
744 u8 processor_id;
745 u32 control_flags_set;
746 u32 control_flags_clear;
747} __packed;
748
749/**
750 * struct ti_sci_msg_req_proc_auth_start_image - Authenticate and start image
751 * @hdr: Generic Header
Lokesh Vutlab8856af2018-08-27 15:57:37 +0530752 * @cert_addr_low: Lower 32bit (Little Endian) of certificate
753 * @cert_addr_high: Higher 32bit (Little Endian) of certificate
754 *
755 * Request type is TISCI_MSG_PROC_AUTH_BOOT_IMAGE, response is a generic
756 * ACK/NACK message.
757 */
758struct ti_sci_msg_req_proc_auth_boot_image {
759 struct ti_sci_msg_hdr hdr;
Lokesh Vutlab8856af2018-08-27 15:57:37 +0530760 u32 cert_addr_low;
761 u32 cert_addr_high;
762} __packed;
763
Andrew F. Davis7aa9a082019-04-12 12:54:44 -0400764struct ti_sci_msg_resp_proc_auth_boot_image {
765 struct ti_sci_msg_hdr hdr;
766 u32 image_addr_low;
767 u32 image_addr_high;
768 u32 image_size;
769} __packed;
770
Lokesh Vutlab8856af2018-08-27 15:57:37 +0530771/**
772 * struct ti_sci_msg_req_get_proc_boot_status - Get processor boot status
773 * @hdr: Generic Header
774 * @processor_id: ID of processor
775 *
776 * Request type is TISCI_MSG_GET_PROC_BOOT_STATUS, response is appropriate
777 * message, or NACK in case of inability to satisfy request.
778 */
779struct ti_sci_msg_req_get_proc_boot_status {
780 struct ti_sci_msg_hdr hdr;
781 u8 processor_id;
782} __packed;
783
784/* ARMv8 Status Flags */
785#define PROC_BOOT_STATUS_FLAG_ARMV8_WFE 0x00000001
786#define PROC_BOOT_STATUS_FLAG_ARMV8_WFI 0x00000002
787
788/* R5 Status Flags */
789#define PROC_BOOT_STATUS_FLAG_R5_WFE 0x00000001
790#define PROC_BOOT_STATUS_FLAG_R5_WFI 0x00000002
791#define PROC_BOOT_STATUS_FLAG_R5_CLK_GATED 0x00000004
792#define PROC_BOOT_STATUS_FLAG_R5_LOCKSTEP_PERMITTED 0x00000100
793
794/**
795 * struct ti_sci_msg_resp_get_proc_boot_status - Processor boot status response
796 * @hdr: Generic Header
797 * @processor_id: ID of processor
798 * @bootvector_low: Lower 32bit (Little Endian) of boot vector
799 * @bootvector_high: Higher 32bit (Little Endian) of boot vector
800 * @config_flags: Optional Processor specific Config Flags set.
801 * @control_flags: Optional Processor specific Control Flags.
802 * @status_flags: Optional Processor specific Status Flags set.
803 *
804 * Response to TISCI_MSG_GET_PROC_BOOT_STATUS.
805 */
806struct ti_sci_msg_resp_get_proc_boot_status {
807 struct ti_sci_msg_hdr hdr;
808 u8 processor_id;
809 u32 bootvector_low;
810 u32 bootvector_high;
811 u32 config_flags;
812 u32 control_flags;
813 u32 status_flags;
814} __packed;
815
Grygorii Strashkod64c5b22019-02-05 17:31:21 +0530816/**
Andreas Dannenbergca08cb32019-06-07 19:24:40 +0530817 * struct ti_sci_msg_req_wait_proc_boot_status - Wait for a processor
818 * boot status
819 * @hdr: Generic Header
820 * @processor_id: ID of processor
821 * @num_wait_iterations: Total number of iterations we will check before
822 * we will timeout and give up
823 * @num_match_iterations: How many iterations should we have continued
824 * status to account for status bits glitching.
825 * This is to make sure that match occurs for
826 * consecutive checks. This implies that the
827 * worst case should consider that the stable
828 * time should at the worst be num_wait_iterations
829 * num_match_iterations to prevent timeout.
830 * @delay_per_iteration_us: Specifies how long to wait (in micro seconds)
831 * between each status checks. This is the minimum
832 * duration, and overhead of register reads and
833 * checks are on top of this and can vary based on
834 * varied conditions.
835 * @delay_before_iterations_us: Specifies how long to wait (in micro seconds)
836 * before the very first check in the first
837 * iteration of status check loop. This is the
838 * minimum duration, and overhead of register
839 * reads and checks are.
840 * @status_flags_1_set_all_wait:If non-zero, Specifies that all bits of the
841 * status matching this field requested MUST be 1.
842 * @status_flags_1_set_any_wait:If non-zero, Specifies that at least one of the
843 * bits matching this field requested MUST be 1.
844 * @status_flags_1_clr_all_wait:If non-zero, Specifies that all bits of the
845 * status matching this field requested MUST be 0.
846 * @status_flags_1_clr_any_wait:If non-zero, Specifies that at least one of the
847 * bits matching this field requested MUST be 0.
848 *
849 * Request type is TISCI_MSG_WAIT_PROC_BOOT_STATUS, response is appropriate
850 * message, or NACK in case of inability to satisfy request.
851 */
852struct ti_sci_msg_req_wait_proc_boot_status {
853 struct ti_sci_msg_hdr hdr;
854 u8 processor_id;
855 u8 num_wait_iterations;
856 u8 num_match_iterations;
857 u8 delay_per_iteration_us;
858 u8 delay_before_iterations_us;
859 u32 status_flags_1_set_all_wait;
860 u32 status_flags_1_set_any_wait;
861 u32 status_flags_1_clr_all_wait;
862 u32 status_flags_1_clr_any_wait;
863} __packed;
864
865/**
Grygorii Strashkod64c5b22019-02-05 17:31:21 +0530866 * struct ti_sci_msg_rm_ring_cfg_req - Configure a Navigator Subsystem ring
867 *
868 * Configures the non-real-time registers of a Navigator Subsystem ring.
869 * @hdr: Generic Header
870 * @valid_params: Bitfield defining validity of ring configuration parameters.
871 * The ring configuration fields are not valid, and will not be used for
872 * ring configuration, if their corresponding valid bit is zero.
873 * Valid bit usage:
874 * 0 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_lo
875 * 1 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_hi
876 * 2 - Valid bit for @tisci_msg_rm_ring_cfg_req count
877 * 3 - Valid bit for @tisci_msg_rm_ring_cfg_req mode
878 * 4 - Valid bit for @tisci_msg_rm_ring_cfg_req size
879 * 5 - Valid bit for @tisci_msg_rm_ring_cfg_req order_id
880 * @nav_id: Device ID of Navigator Subsystem from which the ring is allocated
881 * @index: ring index to be configured.
882 * @addr_lo: 32 LSBs of ring base address to be programmed into the ring's
883 * RING_BA_LO register
884 * @addr_hi: 16 MSBs of ring base address to be programmed into the ring's
885 * RING_BA_HI register.
886 * @count: Number of ring elements. Must be even if mode is CREDENTIALS or QM
887 * modes.
888 * @mode: Specifies the mode the ring is to be configured.
889 * @size: Specifies encoded ring element size. To calculate the encoded size use
890 * the formula (log2(size_bytes) - 2), where size_bytes cannot be
891 * greater than 256.
892 * @order_id: Specifies the ring's bus order ID.
893 */
894struct ti_sci_msg_rm_ring_cfg_req {
895 struct ti_sci_msg_hdr hdr;
896 u32 valid_params;
897 u16 nav_id;
898 u16 index;
899 u32 addr_lo;
900 u32 addr_hi;
901 u32 count;
902 u8 mode;
903 u8 size;
904 u8 order_id;
905} __packed;
906
907/**
908 * struct ti_sci_msg_rm_ring_cfg_resp - Response to configuring a ring.
909 *
910 * @hdr: Generic Header
911 */
912struct ti_sci_msg_rm_ring_cfg_resp {
913 struct ti_sci_msg_hdr hdr;
914} __packed;
915
916/**
917 * struct ti_sci_msg_rm_ring_get_cfg_req - Get RA ring's configuration
918 *
919 * Gets the configuration of the non-real-time register fields of a ring. The
920 * host, or a supervisor of the host, who owns the ring must be the requesting
921 * host. The values of the non-real-time registers are returned in
922 * @ti_sci_msg_rm_ring_get_cfg_resp.
923 *
924 * @hdr: Generic Header
925 * @nav_id: Device ID of Navigator Subsystem from which the ring is allocated
926 * @index: ring index.
927 */
928struct ti_sci_msg_rm_ring_get_cfg_req {
929 struct ti_sci_msg_hdr hdr;
930 u16 nav_id;
931 u16 index;
932} __packed;
933
934/**
935 * struct ti_sci_msg_rm_ring_get_cfg_resp - Ring get configuration response
936 *
937 * Response received by host processor after RM has handled
938 * @ti_sci_msg_rm_ring_get_cfg_req. The response contains the ring's
939 * non-real-time register values.
940 *
941 * @hdr: Generic Header
942 * @addr_lo: Ring 32 LSBs of base address
943 * @addr_hi: Ring 16 MSBs of base address.
944 * @count: Ring number of elements.
945 * @mode: Ring mode.
946 * @size: encoded Ring element size
947 * @order_id: ing order ID.
948 */
949struct ti_sci_msg_rm_ring_get_cfg_resp {
950 struct ti_sci_msg_hdr hdr;
951 u32 addr_lo;
952 u32 addr_hi;
953 u32 count;
954 u8 mode;
955 u8 size;
956 u8 order_id;
957} __packed;
958
959/**
960 * struct ti_sci_msg_psil_pair - Pairs a PSI-L source thread to a destination
961 * thread
962 * @hdr: Generic Header
963 * @nav_id: SoC Navigator Subsystem device ID whose PSI-L config proxy is
964 * used to pair the source and destination threads.
965 * @src_thread: PSI-L source thread ID within the PSI-L System thread map.
966 *
967 * UDMAP transmit channels mapped to source threads will have their
968 * TCHAN_THRD_ID register programmed with the destination thread if the pairing
969 * is successful.
970
971 * @dst_thread: PSI-L destination thread ID within the PSI-L System thread map.
972 * PSI-L destination threads start at index 0x8000. The request is NACK'd if
973 * the destination thread is not greater than or equal to 0x8000.
974 *
975 * UDMAP receive channels mapped to destination threads will have their
976 * RCHAN_THRD_ID register programmed with the source thread if the pairing
977 * is successful.
978 *
979 * Request type is TI_SCI_MSG_RM_PSIL_PAIR, response is a generic ACK or NACK
980 * message.
981 */
982struct ti_sci_msg_psil_pair {
983 struct ti_sci_msg_hdr hdr;
984 u32 nav_id;
985 u32 src_thread;
986 u32 dst_thread;
987} __packed;
988
989/**
990 * struct ti_sci_msg_psil_unpair - Unpairs a PSI-L source thread from a
991 * destination thread
992 * @hdr: Generic Header
993 * @nav_id: SoC Navigator Subsystem device ID whose PSI-L config proxy is
994 * used to unpair the source and destination threads.
995 * @src_thread: PSI-L source thread ID within the PSI-L System thread map.
996 *
997 * UDMAP transmit channels mapped to source threads will have their
998 * TCHAN_THRD_ID register cleared if the unpairing is successful.
999 *
1000 * @dst_thread: PSI-L destination thread ID within the PSI-L System thread map.
1001 * PSI-L destination threads start at index 0x8000. The request is NACK'd if
1002 * the destination thread is not greater than or equal to 0x8000.
1003 *
1004 * UDMAP receive channels mapped to destination threads will have their
1005 * RCHAN_THRD_ID register cleared if the unpairing is successful.
1006 *
1007 * Request type is TI_SCI_MSG_RM_PSIL_UNPAIR, response is a generic ACK or NACK
1008 * message.
1009 */
1010struct ti_sci_msg_psil_unpair {
1011 struct ti_sci_msg_hdr hdr;
1012 u32 nav_id;
1013 u32 src_thread;
1014 u32 dst_thread;
1015} __packed;
1016
1017/**
1018 * Configures a Navigator Subsystem UDMAP transmit channel
1019 *
1020 * Configures the non-real-time registers of a Navigator Subsystem UDMAP
1021 * transmit channel. The channel index must be assigned to the host defined
1022 * in the TISCI header via the RM board configuration resource assignment
1023 * range list.
1024 *
1025 * @hdr: Generic Header
1026 *
1027 * @valid_params: Bitfield defining validity of tx channel configuration
1028 * parameters. The tx channel configuration fields are not valid, and will not
1029 * be used for ch configuration, if their corresponding valid bit is zero.
1030 * Valid bit usage:
1031 * 0 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_pause_on_err
1032 * 1 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_atype
1033 * 2 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_chan_type
1034 * 3 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_fetch_size
1035 * 4 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::txcq_qnum
1036 * 5 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_priority
1037 * 6 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_qos
1038 * 7 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_orderid
1039 * 8 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_sched_priority
1040 * 9 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_einfo
1041 * 10 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_pswords
1042 * 11 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_supr_tdpkt
1043 * 12 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_credit_count
1044 * 13 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::fdepth
Vignesh Raghavendraa8a2b8a2021-05-10 20:06:02 +05301045 * 14 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_burst_size
1046 * 15 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_tdtype
1047 * 16 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::extended_ch_type
Grygorii Strashkod64c5b22019-02-05 17:31:21 +05301048 *
1049 * @nav_id: SoC device ID of Navigator Subsystem where tx channel is located
1050 *
1051 * @index: UDMAP transmit channel index.
1052 *
1053 * @tx_pause_on_err: UDMAP transmit channel pause on error configuration to
1054 * be programmed into the tx_pause_on_err field of the channel's TCHAN_TCFG
1055 * register.
1056 *
1057 * @tx_filt_einfo: UDMAP transmit channel extended packet information passing
1058 * configuration to be programmed into the tx_filt_einfo field of the
1059 * channel's TCHAN_TCFG register.
1060 *
1061 * @tx_filt_pswords: UDMAP transmit channel protocol specific word passing
1062 * configuration to be programmed into the tx_filt_pswords field of the
1063 * channel's TCHAN_TCFG register.
1064 *
1065 * @tx_atype: UDMAP transmit channel non Ring Accelerator access pointer
1066 * interpretation configuration to be programmed into the tx_atype field of
1067 * the channel's TCHAN_TCFG register.
1068 *
1069 * @tx_chan_type: UDMAP transmit channel functional channel type and work
1070 * passing mechanism configuration to be programmed into the tx_chan_type
1071 * field of the channel's TCHAN_TCFG register.
1072 *
1073 * @tx_supr_tdpkt: UDMAP transmit channel teardown packet generation suppression
1074 * configuration to be programmed into the tx_supr_tdpkt field of the channel's
1075 * TCHAN_TCFG register.
1076 *
1077 * @tx_fetch_size: UDMAP transmit channel number of 32-bit descriptor words to
1078 * fetch configuration to be programmed into the tx_fetch_size field of the
1079 * channel's TCHAN_TCFG register. The user must make sure to set the maximum
1080 * word count that can pass through the channel for any allowed descriptor type.
1081 *
1082 * @tx_credit_count: UDMAP transmit channel transfer request credit count
1083 * configuration to be programmed into the count field of the TCHAN_TCREDIT
1084 * register. Specifies how many credits for complete TRs are available.
1085 *
1086 * @txcq_qnum: UDMAP transmit channel completion queue configuration to be
1087 * programmed into the txcq_qnum field of the TCHAN_TCQ register. The specified
1088 * completion queue must be assigned to the host, or a subordinate of the host,
1089 * requesting configuration of the transmit channel.
1090 *
1091 * @tx_priority: UDMAP transmit channel transmit priority value to be programmed
1092 * into the priority field of the channel's TCHAN_TPRI_CTRL register.
1093 *
1094 * @tx_qos: UDMAP transmit channel transmit qos value to be programmed into the
1095 * qos field of the channel's TCHAN_TPRI_CTRL register.
1096 *
1097 * @tx_orderid: UDMAP transmit channel bus order id value to be programmed into
1098 * the orderid field of the channel's TCHAN_TPRI_CTRL register.
1099 *
1100 * @fdepth: UDMAP transmit channel FIFO depth configuration to be programmed
1101 * into the fdepth field of the TCHAN_TFIFO_DEPTH register. Sets the number of
1102 * Tx FIFO bytes which are allowed to be stored for the channel. Check the UDMAP
1103 * section of the TRM for restrictions regarding this parameter.
1104 *
1105 * @tx_sched_priority: UDMAP transmit channel tx scheduling priority
1106 * configuration to be programmed into the priority field of the channel's
1107 * TCHAN_TST_SCHED register.
Vignesh Raghavendraa8a2b8a2021-05-10 20:06:02 +05301108 *
1109 * @tx_burst_size: UDMAP transmit channel burst size configuration to be
1110 * programmed into the tx_burst_size field of the TCHAN_TCFG register.
1111 *
1112 * @tx_tdtype: UDMAP transmit channel teardown type configuration to be
1113 * programmed into the tdtype field of the TCHAN_TCFG register:
1114 * 0 - Return immediately
1115 * 1 - Wait for completion message from remote peer
1116 *
1117 * @extended_ch_type: Valid for BCDMA.
1118 * 0 - the channel is split tx channel (tchan)
1119 * 1 - the channel is block copy channel (bchan)
Grygorii Strashkod64c5b22019-02-05 17:31:21 +05301120 */
1121struct ti_sci_msg_rm_udmap_tx_ch_cfg_req {
1122 struct ti_sci_msg_hdr hdr;
1123 u32 valid_params;
1124 u16 nav_id;
1125 u16 index;
1126 u8 tx_pause_on_err;
1127 u8 tx_filt_einfo;
1128 u8 tx_filt_pswords;
1129 u8 tx_atype;
1130 u8 tx_chan_type;
1131 u8 tx_supr_tdpkt;
1132 u16 tx_fetch_size;
1133 u8 tx_credit_count;
1134 u16 txcq_qnum;
1135 u8 tx_priority;
1136 u8 tx_qos;
1137 u8 tx_orderid;
1138 u16 fdepth;
1139 u8 tx_sched_priority;
Vignesh Raghavendraa8a2b8a2021-05-10 20:06:02 +05301140 u8 tx_burst_size;
1141 u8 tx_tdtype;
1142 u8 extended_ch_type;
Grygorii Strashkod64c5b22019-02-05 17:31:21 +05301143} __packed;
1144
1145/**
1146 * Response to configuring a UDMAP transmit channel.
1147 *
1148 * @hdr: Standard TISCI header
1149 */
1150struct ti_sci_msg_rm_udmap_tx_ch_cfg_resp {
1151 struct ti_sci_msg_hdr hdr;
1152} __packed;
1153
1154/**
1155 * Configures a Navigator Subsystem UDMAP receive channel
1156 *
1157 * Configures the non-real-time registers of a Navigator Subsystem UDMAP
1158 * receive channel. The channel index must be assigned to the host defined
1159 * in the TISCI header via the RM board configuration resource assignment
1160 * range list.
1161 *
1162 * @hdr: Generic Header
1163 *
1164 * @valid_params: Bitfield defining validity of rx channel configuration
1165 * parameters.
1166 * The rx channel configuration fields are not valid, and will not be used for
1167 * ch configuration, if their corresponding valid bit is zero.
1168 * Valid bit usage:
1169 * 0 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_pause_on_err
1170 * 1 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_atype
1171 * 2 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_chan_type
1172 * 3 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_fetch_size
1173 * 4 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rxcq_qnum
1174 * 5 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_priority
1175 * 6 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_qos
1176 * 7 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_orderid
1177 * 8 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_sched_priority
1178 * 9 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_start
1179 * 10 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_cnt
1180 * 11 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_short
1181 * 12 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_long
1182 *
1183 * @nav_id: SoC device ID of Navigator Subsystem where rx channel is located
1184 *
1185 * @index: UDMAP receive channel index.
1186 *
1187 * @rx_fetch_size: UDMAP receive channel number of 32-bit descriptor words to
1188 * fetch configuration to be programmed into the rx_fetch_size field of the
1189 * channel's RCHAN_RCFG register.
1190 *
1191 * @rxcq_qnum: UDMAP receive channel completion queue configuration to be
1192 * programmed into the rxcq_qnum field of the RCHAN_RCQ register.
1193 * The specified completion queue must be assigned to the host, or a subordinate
1194 * of the host, requesting configuration of the receive channel.
1195 *
1196 * @rx_priority: UDMAP receive channel receive priority value to be programmed
1197 * into the priority field of the channel's RCHAN_RPRI_CTRL register.
1198 *
1199 * @rx_qos: UDMAP receive channel receive qos value to be programmed into the
1200 * qos field of the channel's RCHAN_RPRI_CTRL register.
1201 *
1202 * @rx_orderid: UDMAP receive channel bus order id value to be programmed into
1203 * the orderid field of the channel's RCHAN_RPRI_CTRL register.
1204 *
1205 * @rx_sched_priority: UDMAP receive channel rx scheduling priority
1206 * configuration to be programmed into the priority field of the channel's
1207 * RCHAN_RST_SCHED register.
1208 *
1209 * @flowid_start: UDMAP receive channel additional flows starting index
1210 * configuration to program into the flow_start field of the RCHAN_RFLOW_RNG
1211 * register. Specifies the starting index for flow IDs the receive channel is to
1212 * make use of beyond the default flow. flowid_start and @ref flowid_cnt must be
1213 * set as valid and configured together. The starting flow ID set by
1214 * @ref flowid_cnt must be a flow index within the Navigator Subsystem's subset
1215 * of flows beyond the default flows statically mapped to receive channels.
1216 * The additional flows must be assigned to the host, or a subordinate of the
1217 * host, requesting configuration of the receive channel.
1218 *
1219 * @flowid_cnt: UDMAP receive channel additional flows count configuration to
1220 * program into the flowid_cnt field of the RCHAN_RFLOW_RNG register.
1221 * This field specifies how many flow IDs are in the additional contiguous range
1222 * of legal flow IDs for the channel. @ref flowid_start and flowid_cnt must be
1223 * set as valid and configured together. Disabling the valid_params field bit
1224 * for flowid_cnt indicates no flow IDs other than the default are to be
1225 * allocated and used by the receive channel. @ref flowid_start plus flowid_cnt
1226 * cannot be greater than the number of receive flows in the receive channel's
1227 * Navigator Subsystem. The additional flows must be assigned to the host, or a
1228 * subordinate of the host, requesting configuration of the receive channel.
1229 *
1230 * @rx_pause_on_err: UDMAP receive channel pause on error configuration to be
1231 * programmed into the rx_pause_on_err field of the channel's RCHAN_RCFG
1232 * register.
1233 *
1234 * @rx_atype: UDMAP receive channel non Ring Accelerator access pointer
1235 * interpretation configuration to be programmed into the rx_atype field of the
1236 * channel's RCHAN_RCFG register.
1237 *
1238 * @rx_chan_type: UDMAP receive channel functional channel type and work passing
1239 * mechanism configuration to be programmed into the rx_chan_type field of the
1240 * channel's RCHAN_RCFG register.
1241 *
1242 * @rx_ignore_short: UDMAP receive channel short packet treatment configuration
1243 * to be programmed into the rx_ignore_short field of the RCHAN_RCFG register.
1244 *
1245 * @rx_ignore_long: UDMAP receive channel long packet treatment configuration to
1246 * be programmed into the rx_ignore_long field of the RCHAN_RCFG register.
1247 */
1248struct ti_sci_msg_rm_udmap_rx_ch_cfg_req {
1249 struct ti_sci_msg_hdr hdr;
1250 u32 valid_params;
1251 u16 nav_id;
1252 u16 index;
1253 u16 rx_fetch_size;
1254 u16 rxcq_qnum;
1255 u8 rx_priority;
1256 u8 rx_qos;
1257 u8 rx_orderid;
1258 u8 rx_sched_priority;
1259 u16 flowid_start;
1260 u16 flowid_cnt;
1261 u8 rx_pause_on_err;
1262 u8 rx_atype;
1263 u8 rx_chan_type;
1264 u8 rx_ignore_short;
1265 u8 rx_ignore_long;
1266} __packed;
1267
1268/**
1269 * Response to configuring a UDMAP receive channel.
1270 *
1271 * @hdr: Standard TISCI header
1272 */
1273struct ti_sci_msg_rm_udmap_rx_ch_cfg_resp {
1274 struct ti_sci_msg_hdr hdr;
1275} __packed;
1276
1277/**
1278 * Configures a Navigator Subsystem UDMAP receive flow
1279 *
1280 * Configures a Navigator Subsystem UDMAP receive flow's registers.
1281 * Configuration does not include the flow registers which handle size-based
1282 * free descriptor queue routing.
1283 *
1284 * The flow index must be assigned to the host defined in the TISCI header via
1285 * the RM board configuration resource assignment range list.
1286 *
1287 * @hdr: Standard TISCI header
1288 *
1289 * @valid_params
1290 * Bitfield defining validity of rx flow configuration parameters. The
1291 * rx flow configuration fields are not valid, and will not be used for flow
1292 * configuration, if their corresponding valid bit is zero. Valid bit usage:
1293 * 0 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_einfo_present
1294 * 1 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_psinfo_present
1295 * 2 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_error_handling
1296 * 3 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_desc_type
1297 * 4 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_sop_offset
1298 * 5 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_qnum
1299 * 6 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi
1300 * 7 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo
1301 * 8 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi
1302 * 9 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo
1303 * 10 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi_sel
1304 * 11 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo_sel
1305 * 12 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi_sel
1306 * 13 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo_sel
1307 * 14 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq0_sz0_qnum
1308 * 15 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq1_sz0_qnum
1309 * 16 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq2_sz0_qnum
1310 * 17 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq3_sz0_qnum
1311 * 18 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_ps_location
1312 *
1313 * @nav_id: SoC device ID of Navigator Subsystem from which the receive flow is
1314 * allocated
1315 *
1316 * @flow_index: UDMAP receive flow index for non-optional configuration.
1317 *
1318 * @rx_einfo_present:
1319 * UDMAP receive flow extended packet info present configuration to be
1320 * programmed into the rx_einfo_present field of the flow's RFLOW_RFA register.
1321 *
1322 * @rx_psinfo_present:
1323 * UDMAP receive flow PS words present configuration to be programmed into the
1324 * rx_psinfo_present field of the flow's RFLOW_RFA register.
1325 *
1326 * @rx_error_handling:
1327 * UDMAP receive flow error handling configuration to be programmed into the
1328 * rx_error_handling field of the flow's RFLOW_RFA register.
1329 *
1330 * @rx_desc_type:
1331 * UDMAP receive flow descriptor type configuration to be programmed into the
1332 * rx_desc_type field field of the flow's RFLOW_RFA register.
1333 *
1334 * @rx_sop_offset:
1335 * UDMAP receive flow start of packet offset configuration to be programmed
1336 * into the rx_sop_offset field of the RFLOW_RFA register. See the UDMAP
1337 * section of the TRM for more information on this setting. Valid values for
1338 * this field are 0-255 bytes.
1339 *
1340 * @rx_dest_qnum:
1341 * UDMAP receive flow destination queue configuration to be programmed into the
1342 * rx_dest_qnum field of the flow's RFLOW_RFA register. The specified
1343 * destination queue must be valid within the Navigator Subsystem and must be
1344 * owned by the host, or a subordinate of the host, requesting allocation and
1345 * configuration of the receive flow.
1346 *
1347 * @rx_src_tag_hi:
1348 * UDMAP receive flow source tag high byte constant configuration to be
1349 * programmed into the rx_src_tag_hi field of the flow's RFLOW_RFB register.
1350 * See the UDMAP section of the TRM for more information on this setting.
1351 *
1352 * @rx_src_tag_lo:
1353 * UDMAP receive flow source tag low byte constant configuration to be
1354 * programmed into the rx_src_tag_lo field of the flow's RFLOW_RFB register.
1355 * See the UDMAP section of the TRM for more information on this setting.
1356 *
1357 * @rx_dest_tag_hi:
1358 * UDMAP receive flow destination tag high byte constant configuration to be
1359 * programmed into the rx_dest_tag_hi field of the flow's RFLOW_RFB register.
1360 * See the UDMAP section of the TRM for more information on this setting.
1361 *
1362 * @rx_dest_tag_lo:
1363 * UDMAP receive flow destination tag low byte constant configuration to be
1364 * programmed into the rx_dest_tag_lo field of the flow's RFLOW_RFB register.
1365 * See the UDMAP section of the TRM for more information on this setting.
1366 *
1367 * @rx_src_tag_hi_sel:
1368 * UDMAP receive flow source tag high byte selector configuration to be
1369 * programmed into the rx_src_tag_hi_sel field of the RFLOW_RFC register. See
1370 * the UDMAP section of the TRM for more information on this setting.
1371 *
1372 * @rx_src_tag_lo_sel:
1373 * UDMAP receive flow source tag low byte selector configuration to be
1374 * programmed into the rx_src_tag_lo_sel field of the RFLOW_RFC register. See
1375 * the UDMAP section of the TRM for more information on this setting.
1376 *
1377 * @rx_dest_tag_hi_sel:
1378 * UDMAP receive flow destination tag high byte selector configuration to be
1379 * programmed into the rx_dest_tag_hi_sel field of the RFLOW_RFC register. See
1380 * the UDMAP section of the TRM for more information on this setting.
1381 *
1382 * @rx_dest_tag_lo_sel:
1383 * UDMAP receive flow destination tag low byte selector configuration to be
1384 * programmed into the rx_dest_tag_lo_sel field of the RFLOW_RFC register. See
1385 * the UDMAP section of the TRM for more information on this setting.
1386 *
1387 * @rx_fdq0_sz0_qnum:
1388 * UDMAP receive flow free descriptor queue 0 configuration to be programmed
1389 * into the rx_fdq0_sz0_qnum field of the flow's RFLOW_RFD register. See the
1390 * UDMAP section of the TRM for more information on this setting. The specified
1391 * free queue must be valid within the Navigator Subsystem and must be owned
1392 * by the host, or a subordinate of the host, requesting allocation and
1393 * configuration of the receive flow.
1394 *
1395 * @rx_fdq1_qnum:
1396 * UDMAP receive flow free descriptor queue 1 configuration to be programmed
1397 * into the rx_fdq1_qnum field of the flow's RFLOW_RFD register. See the
1398 * UDMAP section of the TRM for more information on this setting. The specified
1399 * free queue must be valid within the Navigator Subsystem and must be owned
1400 * by the host, or a subordinate of the host, requesting allocation and
1401 * configuration of the receive flow.
1402 *
1403 * @rx_fdq2_qnum:
1404 * UDMAP receive flow free descriptor queue 2 configuration to be programmed
1405 * into the rx_fdq2_qnum field of the flow's RFLOW_RFE register. See the
1406 * UDMAP section of the TRM for more information on this setting. The specified
1407 * free queue must be valid within the Navigator Subsystem and must be owned
1408 * by the host, or a subordinate of the host, requesting allocation and
1409 * configuration of the receive flow.
1410 *
1411 * @rx_fdq3_qnum:
1412 * UDMAP receive flow free descriptor queue 3 configuration to be programmed
1413 * into the rx_fdq3_qnum field of the flow's RFLOW_RFE register. See the
1414 * UDMAP section of the TRM for more information on this setting. The specified
1415 * free queue must be valid within the Navigator Subsystem and must be owned
1416 * by the host, or a subordinate of the host, requesting allocation and
1417 * configuration of the receive flow.
1418 *
1419 * @rx_ps_location:
1420 * UDMAP receive flow PS words location configuration to be programmed into the
1421 * rx_ps_location field of the flow's RFLOW_RFA register.
1422 */
1423struct ti_sci_msg_rm_udmap_flow_cfg_req {
1424 struct ti_sci_msg_hdr hdr;
1425 u32 valid_params;
1426 u16 nav_id;
1427 u16 flow_index;
1428 u8 rx_einfo_present;
1429 u8 rx_psinfo_present;
1430 u8 rx_error_handling;
1431 u8 rx_desc_type;
1432 u16 rx_sop_offset;
1433 u16 rx_dest_qnum;
1434 u8 rx_src_tag_hi;
1435 u8 rx_src_tag_lo;
1436 u8 rx_dest_tag_hi;
1437 u8 rx_dest_tag_lo;
1438 u8 rx_src_tag_hi_sel;
1439 u8 rx_src_tag_lo_sel;
1440 u8 rx_dest_tag_hi_sel;
1441 u8 rx_dest_tag_lo_sel;
1442 u16 rx_fdq0_sz0_qnum;
1443 u16 rx_fdq1_qnum;
1444 u16 rx_fdq2_qnum;
1445 u16 rx_fdq3_qnum;
1446 u8 rx_ps_location;
1447} __packed;
1448
1449/**
1450 * Response to configuring a Navigator Subsystem UDMAP receive flow
1451 *
1452 * @hdr: Standard TISCI header
1453 */
1454struct ti_sci_msg_rm_udmap_flow_cfg_resp {
1455 struct ti_sci_msg_hdr hdr;
1456} __packed;
1457
Andrew F. Davis2aafc0c2019-04-12 12:54:43 -04001458#define FWL_MAX_PRIVID_SLOTS 3U
1459
1460/**
1461 * struct ti_sci_msg_fwl_set_firewall_region_req - Request for configuring the firewall permissions.
1462 *
1463 * @hdr: Generic Header
1464 *
1465 * @fwl_id: Firewall ID in question
1466 * @region: Region or channel number to set config info
1467 * This field is unused in case of a simple firewall and must be initialized
1468 * to zero. In case of a region based firewall, this field indicates the
1469 * region in question. (index starting from 0) In case of a channel based
1470 * firewall, this field indicates the channel in question (index starting
1471 * from 0)
1472 * @n_permission_regs: Number of permission registers to set
1473 * @control: Contents of the firewall CONTROL register to set
1474 * @permissions: Contents of the firewall PERMISSION register to set
1475 * @start_address: Contents of the firewall START_ADDRESS register to set
1476 * @end_address: Contents of the firewall END_ADDRESS register to set
1477 */
1478
1479struct ti_sci_msg_fwl_set_firewall_region_req {
1480 struct ti_sci_msg_hdr hdr;
1481 u16 fwl_id;
1482 u16 region;
1483 u32 n_permission_regs;
1484 u32 control;
1485 u32 permissions[FWL_MAX_PRIVID_SLOTS];
1486 u64 start_address;
1487 u64 end_address;
1488} __packed;
1489
1490/**
1491 * struct ti_sci_msg_fwl_get_firewall_region_req - Request for retrieving the firewall permissions
1492 *
1493 * @hdr: Generic Header
1494 *
1495 * @fwl_id: Firewall ID in question
1496 * @region: Region or channel number to get config info
1497 * This field is unused in case of a simple firewall and must be initialized
1498 * to zero. In case of a region based firewall, this field indicates the
1499 * region in question (index starting from 0). In case of a channel based
1500 * firewall, this field indicates the channel in question (index starting
1501 * from 0).
1502 * @n_permission_regs: Number of permission registers to retrieve
1503 */
1504struct ti_sci_msg_fwl_get_firewall_region_req {
1505 struct ti_sci_msg_hdr hdr;
1506 u16 fwl_id;
1507 u16 region;
1508 u32 n_permission_regs;
1509} __packed;
1510
1511/**
1512 * struct ti_sci_msg_fwl_get_firewall_region_resp - Response for retrieving the firewall permissions
1513 *
1514 * @hdr: Generic Header
1515 *
1516 * @fwl_id: Firewall ID in question
1517 * @region: Region or channel number to set config info This field is
1518 * unused in case of a simple firewall and must be initialized to zero. In
1519 * case of a region based firewall, this field indicates the region in
1520 * question. (index starting from 0) In case of a channel based firewall, this
1521 * field indicates the channel in question (index starting from 0)
1522 * @n_permission_regs: Number of permission registers retrieved
1523 * @control: Contents of the firewall CONTROL register
1524 * @permissions: Contents of the firewall PERMISSION registers
1525 * @start_address: Contents of the firewall START_ADDRESS register This is not applicable for channelized firewalls.
1526 * @end_address: Contents of the firewall END_ADDRESS register This is not applicable for channelized firewalls.
1527 */
1528struct ti_sci_msg_fwl_get_firewall_region_resp {
1529 struct ti_sci_msg_hdr hdr;
1530 u16 fwl_id;
1531 u16 region;
1532 u32 n_permission_regs;
1533 u32 control;
1534 u32 permissions[FWL_MAX_PRIVID_SLOTS];
1535 u64 start_address;
1536 u64 end_address;
1537} __packed;
1538
1539/**
1540 * struct ti_sci_msg_fwl_change_owner_info_req - Request for a firewall owner change
1541 *
1542 * @hdr: Generic Header
1543 *
1544 * @fwl_id: Firewall ID in question
1545 * @region: Region or channel number if applicable
1546 * @owner_index: New owner index to transfer ownership to
1547 */
1548struct ti_sci_msg_fwl_change_owner_info_req {
1549 struct ti_sci_msg_hdr hdr;
1550 u16 fwl_id;
1551 u16 region;
1552 u8 owner_index;
1553} __packed;
1554
1555/**
1556 * struct ti_sci_msg_fwl_change_owner_info_resp - Response for a firewall owner change
1557 *
1558 * @hdr: Generic Header
1559 *
1560 * @fwl_id: Firewall ID specified in request
1561 * @region: Region or channel number specified in request
1562 * @owner_index: Owner index specified in request
1563 * @owner_privid: New owner priv-ID returned by DMSC.
1564 * @owner_permission_bits: New owner permission bits returned by DMSC.
1565 */
1566struct ti_sci_msg_fwl_change_owner_info_resp {
1567 struct ti_sci_msg_hdr hdr;
1568 u16 fwl_id;
1569 u16 region;
1570 u8 owner_index;
1571 u8 owner_privid;
1572 u16 owner_permission_bits;
1573} __packed;
1574
Lokesh Vutla5af02db2018-08-27 15:57:32 +05301575#endif /* __TI_SCI_H */