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