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