1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Texas Instruments System Control Interface Protocol
4 * Based on include/linux/soc/ti/ti_sci_protocol.h from Linux.
6 * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
8 * Lokesh Vutla <lokeshvutla@ti.com>
11 #ifndef __TISCI_PROTOCOL_H
12 #define __TISCI_PROTOCOL_H
15 * struct ti_sci_version_info - version information structure
16 * @abi_major: Major ABI version. Change here implies risk of backward
17 * compatibility break.
18 * @abi_minor: Minor ABI version. Change here implies new feature addition,
19 * or compatible change in ABI.
20 * @firmware_revision: Firmware revision (not usually used).
21 * @firmware_description: Firmware description (not usually used).
23 struct ti_sci_version_info {
26 u16 firmware_revision;
27 char firmware_description[32];
33 * struct ti_sci_board_ops - Board config operations
34 * @board_config: Command to set the board configuration
35 * Returns 0 for successful exclusive request, else returns
36 * corresponding error message.
37 * @board_config_rm: Command to set the board resource management
39 * Returns 0 for successful exclusive request, else returns
40 * corresponding error message.
41 * @board_config_security: Command to set the board security configuration
42 * Returns 0 for successful exclusive request, else returns
43 * corresponding error message.
44 * @board_config_pm: Command to trigger and set the board power and clock
45 * management related configuration
46 * Returns 0 for successful exclusive request, else returns
47 * corresponding error message.
49 struct ti_sci_board_ops {
50 int (*board_config)(const struct ti_sci_handle *handle,
52 int (*board_config_rm)(const struct ti_sci_handle *handle,
54 int (*board_config_security)(const struct ti_sci_handle *handle,
56 int (*board_config_pm)(const struct ti_sci_handle *handle,
61 * struct ti_sci_dev_ops - Device control operations
62 * @get_device: Command to request for device managed by TISCI
63 * Returns 0 for successful exclusive request, else returns
64 * corresponding error message.
65 * @idle_device: Command to idle a device managed by TISCI
66 * Returns 0 for successful exclusive request, else returns
67 * corresponding error message.
68 * @put_device: Command to release a device managed by TISCI
69 * Returns 0 for successful release, else returns corresponding
71 * @is_valid: Check if the device ID is a valid ID.
72 * Returns 0 if the ID is valid, else returns corresponding error.
73 * @get_context_loss_count: Command to retrieve context loss counter - this
74 * increments every time the device looses context. Overflow
76 * - count: pointer to u32 which will retrieve counter
77 * Returns 0 for successful information request and count has
78 * proper data, else returns corresponding error message.
79 * @is_idle: Reports back about device idle state
80 * - req_state: Returns requested idle state
81 * Returns 0 for successful information request and req_state and
82 * current_state has proper data, else returns corresponding error
84 * @is_stop: Reports back about device stop state
85 * - req_state: Returns requested stop state
86 * - current_state: Returns current stop state
87 * Returns 0 for successful information request and req_state and
88 * current_state has proper data, else returns corresponding error
90 * @is_on: Reports back about device ON(or active) state
91 * - req_state: Returns requested ON state
92 * - current_state: Returns current ON state
93 * Returns 0 for successful information request and req_state and
94 * current_state has proper data, else returns corresponding error
96 * @is_transitioning: Reports back if the device is in the middle of transition
98 * -current_state: Returns 'true' if currently transitioning.
99 * @set_device_resets: Command to configure resets for device managed by TISCI.
100 * -reset_state: Device specific reset bit field
101 * Returns 0 for successful request, else returns
102 * corresponding error message.
103 * @get_device_resets: Command to read state of resets for device managed
105 * -reset_state: pointer to u32 which will retrieve resets
106 * Returns 0 for successful request, else returns
107 * corresponding error message.
109 * NOTE: for all these functions, the following parameters are generic in
111 * -handle: Pointer to TISCI handle as retrieved by *ti_sci_get_handle
112 * -id: Device Identifier
114 * Request for the device - NOTE: the client MUST maintain integrity of
115 * usage count by balancing get_device with put_device. No refcounting is
116 * managed by driver for that purpose.
118 struct ti_sci_dev_ops {
119 int (*get_device)(const struct ti_sci_handle *handle, u32 id);
120 int (*idle_device)(const struct ti_sci_handle *handle, u32 id);
121 int (*put_device)(const struct ti_sci_handle *handle, u32 id);
122 int (*is_valid)(const struct ti_sci_handle *handle, u32 id);
123 int (*get_context_loss_count)(const struct ti_sci_handle *handle,
125 int (*is_idle)(const struct ti_sci_handle *handle, u32 id,
126 bool *requested_state);
127 int (*is_stop)(const struct ti_sci_handle *handle, u32 id,
128 bool *req_state, bool *current_state);
129 int (*is_on)(const struct ti_sci_handle *handle, u32 id,
130 bool *req_state, bool *current_state);
131 int (*is_transitioning)(const struct ti_sci_handle *handle, u32 id,
132 bool *current_state);
133 int (*set_device_resets)(const struct ti_sci_handle *handle, u32 id,
135 int (*get_device_resets)(const struct ti_sci_handle *handle, u32 id,
140 * struct ti_sci_clk_ops - Clock control operations
141 * @get_clock: Request for activation of clock and manage by processor
142 * - needs_ssc: 'true' if Spread Spectrum clock is desired.
143 * - can_change_freq: 'true' if frequency change is desired.
144 * - enable_input_term: 'true' if input termination is desired.
145 * @idle_clock: Request for Idling a clock managed by processor
146 * @put_clock: Release the clock to be auto managed by TISCI
147 * @is_auto: Is the clock being auto managed
148 * - req_state: state indicating if the clock is auto managed
149 * @is_on: Is the clock ON
150 * - req_state: if the clock is requested to be forced ON
151 * - current_state: if the clock is currently ON
152 * @is_off: Is the clock OFF
153 * - req_state: if the clock is requested to be forced OFF
154 * - current_state: if the clock is currently Gated
155 * @set_parent: Set the clock source of a specific device clock
156 * - parent_id: Parent clock identifier to set.
157 * @get_parent: Get the current clock source of a specific device clock
158 * - parent_id: Parent clock identifier which is the parent.
159 * @get_num_parents: Get the number of parents of the current clock source
160 * - num_parents: returns the number of parent clocks.
161 * @get_best_match_freq: Find a best matching frequency for a frequency
163 * - match_freq: Best matching frequency in Hz.
164 * @set_freq: Set the Clock frequency
165 * @get_freq: Get the Clock frequency
166 * - current_freq: Frequency in Hz that the clock is at.
168 * NOTE: for all these functions, the following parameters are generic in
170 * -handle: Pointer to TISCI handle as retrieved by *ti_sci_get_handle
171 * -did: Device identifier this request is for
172 * -cid: Clock identifier for the device for this request.
173 * Each device has it's own set of clock inputs. This indexes
174 * which clock input to modify.
175 * -min_freq: The minimum allowable frequency in Hz. This is the minimum
176 * allowable programmed frequency and does not account for clock
177 * tolerances and jitter.
178 * -target_freq: The target clock frequency in Hz. A frequency will be
179 * processed as close to this target frequency as possible.
180 * -max_freq: The maximum allowable frequency in Hz. This is the maximum
181 * allowable programmed frequency and does not account for clock
182 * tolerances and jitter.
184 * Request for the clock - NOTE: the client MUST maintain integrity of
185 * usage count by balancing get_clock with put_clock. No refcounting is
186 * managed by driver for that purpose.
188 struct ti_sci_clk_ops {
189 int (*get_clock)(const struct ti_sci_handle *handle, u32 did, u8 cid,
190 bool needs_ssc, bool can_change_freq,
191 bool enable_input_term);
192 int (*idle_clock)(const struct ti_sci_handle *handle, u32 did, u8 cid);
193 int (*put_clock)(const struct ti_sci_handle *handle, u32 did, u8 cid);
194 int (*is_auto)(const struct ti_sci_handle *handle, u32 did, u8 cid,
196 int (*is_on)(const struct ti_sci_handle *handle, u32 did, u8 cid,
197 bool *req_state, bool *current_state);
198 int (*is_off)(const struct ti_sci_handle *handle, u32 did, u8 cid,
199 bool *req_state, bool *current_state);
200 int (*set_parent)(const struct ti_sci_handle *handle, u32 did, u8 cid,
202 int (*get_parent)(const struct ti_sci_handle *handle, u32 did, u8 cid,
204 int (*get_num_parents)(const struct ti_sci_handle *handle, u32 did,
205 u8 cid, u8 *num_parents);
206 int (*get_best_match_freq)(const struct ti_sci_handle *handle, u32 did,
207 u8 cid, u64 min_freq, u64 target_freq,
208 u64 max_freq, u64 *match_freq);
209 int (*set_freq)(const struct ti_sci_handle *handle, u32 did, u8 cid,
210 u64 min_freq, u64 target_freq, u64 max_freq);
211 int (*get_freq)(const struct ti_sci_handle *handle, u32 did, u8 cid,
216 * struct ti_sci_rm_core_ops - Resource management core operations
217 * @get_range: Get a range of resources belonging to ti sci host.
218 * @get_rage_from_shost: Get a range of resources belonging to
220 * - s_host: Host processing entity to which the
221 * resources are allocated
223 * NOTE: for these functions, all the parameters are consolidated and defined
225 * - handle: Pointer to TISCI handle as retrieved by *ti_sci_get_handle
226 * - dev_id: TISCI device ID.
227 * - subtype: Resource assignment subtype that is being requested
228 * from the given device.
229 * - range_start: Start index of the resource range
230 * - range_end: Number of resources in the range
232 struct ti_sci_rm_core_ops {
233 int (*get_range)(const struct ti_sci_handle *handle, u32 dev_id,
234 u8 subtype, u16 *range_start, u16 *range_num);
235 int (*get_range_from_shost)(const struct ti_sci_handle *handle,
236 u32 dev_id, u8 subtype, u8 s_host,
237 u16 *range_start, u16 *range_num);
241 * struct ti_sci_core_ops - SoC Core Operations
242 * @reboot_device: Reboot the SoC
243 * Returns 0 for successful request(ideally should never return),
244 * else returns corresponding error value.
245 * @query_msmc: Query the size of available msmc
246 * Return 0 for successful query else appropriate error value.
248 struct ti_sci_core_ops {
249 int (*reboot_device)(const struct ti_sci_handle *handle);
250 int (*query_msmc)(const struct ti_sci_handle *handle,
251 u64 *msmc_start, u64 *msmc_end);
255 * struct ti_sci_proc_ops - Processor specific operations.
257 * @proc_request: Request for controlling a physical processor.
258 * The requesting host should be in the processor access list.
259 * @proc_release: Relinquish a physical processor control
260 * @proc_handover: Handover a physical processor control to another host
261 * in the permitted list.
262 * @set_proc_boot_cfg: Base configuration of the processor
263 * @set_proc_boot_ctrl: Setup limited control flags in specific cases.
264 * @proc_auth_boot_image:
265 * @get_proc_boot_status: Get the state of physical processor
267 * NOTE: for all these functions, the following parameters are generic in
269 * -handle: Pointer to TISCI handle as retrieved by *ti_sci_get_handle
273 struct ti_sci_proc_ops {
274 int (*proc_request)(const struct ti_sci_handle *handle, u8 pid);
275 int (*proc_release)(const struct ti_sci_handle *handle, u8 pid);
276 int (*proc_handover)(const struct ti_sci_handle *handle, u8 pid,
278 int (*set_proc_boot_cfg)(const struct ti_sci_handle *handle, u8 pid,
279 u64 bv, u32 cfg_set, u32 cfg_clr);
280 int (*set_proc_boot_ctrl)(const struct ti_sci_handle *handle, u8 pid,
281 u32 ctrl_set, u32 ctrl_clr);
282 int (*proc_auth_boot_image)(const struct ti_sci_handle *handle, u8 pid,
284 int (*get_proc_boot_status)(const struct ti_sci_handle *handle, u8 pid,
285 u64 *bv, u32 *cfg_flags, u32 *ctrl_flags,
289 #define TI_SCI_RING_MODE_RING (0)
290 #define TI_SCI_RING_MODE_MESSAGE (1)
291 #define TI_SCI_RING_MODE_CREDENTIALS (2)
292 #define TI_SCI_RING_MODE_QM (3)
294 #define TI_SCI_MSG_UNUSED_SECONDARY_HOST TI_SCI_RM_NULL_U8
296 /* RA config.addr_lo parameter is valid for RM ring configure TI_SCI message */
297 #define TI_SCI_MSG_VALUE_RM_RING_ADDR_LO_VALID BIT(0)
298 /* RA config.addr_hi parameter is valid for RM ring configure TI_SCI message */
299 #define TI_SCI_MSG_VALUE_RM_RING_ADDR_HI_VALID BIT(1)
300 /* RA config.count parameter is valid for RM ring configure TI_SCI message */
301 #define TI_SCI_MSG_VALUE_RM_RING_COUNT_VALID BIT(2)
302 /* RA config.mode parameter is valid for RM ring configure TI_SCI message */
303 #define TI_SCI_MSG_VALUE_RM_RING_MODE_VALID BIT(3)
304 /* RA config.size parameter is valid for RM ring configure TI_SCI message */
305 #define TI_SCI_MSG_VALUE_RM_RING_SIZE_VALID BIT(4)
306 /* RA config.order_id parameter is valid for RM ring configure TISCI message */
307 #define TI_SCI_MSG_VALUE_RM_RING_ORDER_ID_VALID BIT(5)
309 #define TI_SCI_MSG_VALUE_RM_ALL_NO_ORDER \
310 (TI_SCI_MSG_VALUE_RM_RING_ADDR_LO_VALID | \
311 TI_SCI_MSG_VALUE_RM_RING_ADDR_HI_VALID | \
312 TI_SCI_MSG_VALUE_RM_RING_COUNT_VALID | \
313 TI_SCI_MSG_VALUE_RM_RING_MODE_VALID | \
314 TI_SCI_MSG_VALUE_RM_RING_SIZE_VALID)
317 * struct ti_sci_rm_ringacc_ops - Ring Accelerator Management operations
318 * @config: configure the SoC Navigator Subsystem Ring Accelerator ring
319 * @get_config: get the SoC Navigator Subsystem Ring Accelerator ring
322 struct ti_sci_rm_ringacc_ops {
323 int (*config)(const struct ti_sci_handle *handle,
324 u32 valid_params, u16 nav_id, u16 index,
325 u32 addr_lo, u32 addr_hi, u32 count, u8 mode,
328 int (*get_config)(const struct ti_sci_handle *handle,
329 u32 nav_id, u32 index, u8 *mode,
330 u32 *addr_lo, u32 *addr_hi, u32 *count,
331 u8 *size, u8 *order_id);
335 * struct ti_sci_rm_psil_ops - PSI-L thread operations
336 * @pair: pair PSI-L source thread to a destination thread.
337 * If the src_thread is mapped to UDMA tchan, the corresponding channel's
338 * TCHAN_THRD_ID register is updated.
339 * If the dst_thread is mapped to UDMA rchan, the corresponding channel's
340 * RCHAN_THRD_ID register is updated.
341 * @unpair: unpair PSI-L source thread from a destination thread.
342 * If the src_thread is mapped to UDMA tchan, the corresponding channel's
343 * TCHAN_THRD_ID register is cleared.
344 * If the dst_thread is mapped to UDMA rchan, the corresponding channel's
345 * RCHAN_THRD_ID register is cleared.
347 struct ti_sci_rm_psil_ops {
348 int (*pair)(const struct ti_sci_handle *handle, u32 nav_id,
349 u32 src_thread, u32 dst_thread);
350 int (*unpair)(const struct ti_sci_handle *handle, u32 nav_id,
351 u32 src_thread, u32 dst_thread);
354 /* UDMAP channel types */
355 #define TI_SCI_RM_UDMAP_CHAN_TYPE_PKT_PBRR 2
356 #define TI_SCI_RM_UDMAP_CHAN_TYPE_PKT_PBRR_SB 3 /* RX only */
357 #define TI_SCI_RM_UDMAP_CHAN_TYPE_3RDP_PBRR 10
358 #define TI_SCI_RM_UDMAP_CHAN_TYPE_3RDP_PBVR 11
359 #define TI_SCI_RM_UDMAP_CHAN_TYPE_3RDP_BCOPY_PBRR 12
360 #define TI_SCI_RM_UDMAP_CHAN_TYPE_3RDP_BCOPY_PBVR 13
362 /* UDMAP channel atypes */
363 #define TI_SCI_RM_UDMAP_ATYPE_PHYS 0
364 #define TI_SCI_RM_UDMAP_ATYPE_INTERMEDIATE 1
365 #define TI_SCI_RM_UDMAP_ATYPE_VIRTUAL 2
367 /* UDMAP channel scheduling priorities */
368 #define TI_SCI_RM_UDMAP_SCHED_PRIOR_HIGH 0
369 #define TI_SCI_RM_UDMAP_SCHED_PRIOR_MEDHIGH 1
370 #define TI_SCI_RM_UDMAP_SCHED_PRIOR_MEDLOW 2
371 #define TI_SCI_RM_UDMAP_SCHED_PRIOR_LOW 3
373 #define TI_SCI_RM_UDMAP_RX_FLOW_DESC_HOST 0
374 #define TI_SCI_RM_UDMAP_RX_FLOW_DESC_MONO 2
376 /* UDMAP TX/RX channel valid_params common declarations */
377 #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_PAUSE_ON_ERR_VALID BIT(0)
378 #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_ATYPE_VALID BIT(1)
379 #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_CHAN_TYPE_VALID BIT(2)
380 #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_FETCH_SIZE_VALID BIT(3)
381 #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_CQ_QNUM_VALID BIT(4)
382 #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_PRIORITY_VALID BIT(5)
383 #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_QOS_VALID BIT(6)
384 #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_ORDER_ID_VALID BIT(7)
385 #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_SCHED_PRIORITY_VALID BIT(8)
388 * Configures a Navigator Subsystem UDMAP transmit channel
390 * Configures a Navigator Subsystem UDMAP transmit channel registers.
391 * See @ti_sci_msg_rm_udmap_tx_ch_cfg_req
393 struct ti_sci_msg_rm_udmap_tx_ch_cfg {
395 #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_FILT_EINFO_VALID BIT(9)
396 #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_FILT_PSWORDS_VALID BIT(10)
397 #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_SUPR_TDPKT_VALID BIT(11)
398 #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_CREDIT_COUNT_VALID BIT(12)
399 #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_FDEPTH_VALID BIT(13)
415 u8 tx_sched_priority;
419 * Configures a Navigator Subsystem UDMAP receive channel
421 * Configures a Navigator Subsystem UDMAP receive channel registers.
422 * See @ti_sci_msg_rm_udmap_rx_ch_cfg_req
424 struct ti_sci_msg_rm_udmap_rx_ch_cfg {
426 #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_RX_FLOWID_START_VALID BIT(9)
427 #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_RX_FLOWID_CNT_VALID BIT(10)
428 #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_RX_IGNORE_SHORT_VALID BIT(11)
429 #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_RX_IGNORE_LONG_VALID BIT(12)
437 u8 rx_sched_priority;
448 * Configures a Navigator Subsystem UDMAP receive flow
450 * Configures a Navigator Subsystem UDMAP receive flow's registers.
451 * See @tis_ci_msg_rm_udmap_flow_cfg_req
453 struct ti_sci_msg_rm_udmap_flow_cfg {
455 #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_EINFO_PRESENT_VALID BIT(0)
456 #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_PSINFO_PRESENT_VALID BIT(1)
457 #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_ERROR_HANDLING_VALID BIT(2)
458 #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DESC_TYPE_VALID BIT(3)
459 #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SOP_OFFSET_VALID BIT(4)
460 #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_QNUM_VALID BIT(5)
461 #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SRC_TAG_HI_VALID BIT(6)
462 #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SRC_TAG_LO_VALID BIT(7)
463 #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_TAG_HI_VALID BIT(8)
464 #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_TAG_LO_VALID BIT(9)
465 #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SRC_TAG_HI_SEL_VALID BIT(10)
466 #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SRC_TAG_LO_SEL_VALID BIT(11)
467 #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_TAG_HI_SEL_VALID BIT(12)
468 #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_TAG_LO_SEL_VALID BIT(13)
469 #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ0_SZ0_QNUM_VALID BIT(14)
470 #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ1_QNUM_VALID BIT(15)
471 #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ2_QNUM_VALID BIT(16)
472 #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ3_QNUM_VALID BIT(17)
473 #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_PS_LOCATION_VALID BIT(18)
477 u8 rx_psinfo_present;
478 u8 rx_error_handling;
486 u8 rx_src_tag_hi_sel;
487 u8 rx_src_tag_lo_sel;
488 u8 rx_dest_tag_hi_sel;
489 u8 rx_dest_tag_lo_sel;
490 u16 rx_fdq0_sz0_qnum;
498 * struct ti_sci_rm_udmap_ops - UDMA Management operations
499 * @tx_ch_cfg: configure SoC Navigator Subsystem UDMA transmit channel.
500 * @rx_ch_cfg: configure SoC Navigator Subsystem UDMA receive channel.
501 * @rx_flow_cfg: configure SoC Navigator Subsystem UDMA receive flow.
503 struct ti_sci_rm_udmap_ops {
504 int (*tx_ch_cfg)(const struct ti_sci_handle *handle,
505 const struct ti_sci_msg_rm_udmap_tx_ch_cfg *params);
506 int (*rx_ch_cfg)(const struct ti_sci_handle *handle,
507 const struct ti_sci_msg_rm_udmap_rx_ch_cfg *params);
509 const struct ti_sci_handle *handle,
510 const struct ti_sci_msg_rm_udmap_flow_cfg *params);
514 * struct ti_sci_ops - Function support for TI SCI
515 * @board_ops: Miscellaneous operations
516 * @dev_ops: Device specific operations
517 * @clk_ops: Clock specific operations
518 * @core_ops: Core specific operations
519 * @proc_ops: Processor specific operations
520 * @ring_ops: Ring Accelerator Management operations
523 struct ti_sci_board_ops board_ops;
524 struct ti_sci_dev_ops dev_ops;
525 struct ti_sci_clk_ops clk_ops;
526 struct ti_sci_core_ops core_ops;
527 struct ti_sci_proc_ops proc_ops;
528 struct ti_sci_rm_core_ops rm_core_ops;
529 struct ti_sci_rm_ringacc_ops rm_ring_ops;
530 struct ti_sci_rm_psil_ops rm_psil_ops;
531 struct ti_sci_rm_udmap_ops rm_udmap_ops;
535 * struct ti_sci_handle - Handle returned to TI SCI clients for usage.
536 * @ops: operations that are made available to TI SCI clients
537 * @version: structure containing version information
539 struct ti_sci_handle {
540 struct ti_sci_ops ops;
541 struct ti_sci_version_info version;
544 #define TI_SCI_RESOURCE_NULL 0xffff
547 * struct ti_sci_resource_desc - Description of TI SCI resource instance range.
548 * @start: Start index of the resource.
549 * @num: Number of resources.
550 * @res_map: Bitmap to manage the allocation of these resources.
552 struct ti_sci_resource_desc {
555 unsigned long *res_map;
559 * struct ti_sci_resource - Structure representing a resource assigned
561 * @sets: Number of sets available from this resource type
562 * @desc: Array of resource descriptors.
564 struct ti_sci_resource {
566 struct ti_sci_resource_desc *desc;
569 #if IS_ENABLED(CONFIG_TI_SCI_PROTOCOL)
571 const struct ti_sci_handle *ti_sci_get_handle_from_sysfw(struct udevice *dev);
572 const struct ti_sci_handle *ti_sci_get_handle(struct udevice *dev);
573 const struct ti_sci_handle *ti_sci_get_by_phandle(struct udevice *dev,
574 const char *property);
575 u16 ti_sci_get_free_resource(struct ti_sci_resource *res);
576 void ti_sci_release_resource(struct ti_sci_resource *res, u16 id);
577 struct ti_sci_resource *
578 devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle,
579 struct udevice *dev, u32 dev_id, char *of_prop);
581 #else /* CONFIG_TI_SCI_PROTOCOL */
584 const struct ti_sci_handle *ti_sci_get_handle_from_sysfw(struct udevice *dev)
586 return ERR_PTR(-EINVAL);
589 static inline const struct ti_sci_handle *ti_sci_get_handle(struct udevice *dev)
591 return ERR_PTR(-EINVAL);
595 const struct ti_sci_handle *ti_sci_get_by_phandle(struct udevice *dev,
596 const char *property)
598 return ERR_PTR(-EINVAL);
601 static inline u16 ti_sci_get_free_resource(struct ti_sci_resource *res)
603 return TI_SCI_RESOURCE_NULL;
606 static inline void ti_sci_release_resource(struct ti_sci_resource *res, u16 id)
610 static inline struct ti_sci_resource *
611 devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle,
612 struct udevice *dev, u32 dev_id, char *of_prop)
614 return ERR_PTR(-EINVAL);
616 #endif /* CONFIG_TI_SCI_PROTOCOL */
618 #endif /* __TISCI_PROTOCOL_H */