xref: /OK3568_Linux_fs/kernel/include/linux/soc/ti/ti_sci_protocol.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * Texas Instruments System Control Interface Protocol
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Copyright (C) 2015-2016 Texas Instruments Incorporated - https://www.ti.com/
6*4882a593Smuzhiyun  *	Nishanth Menon
7*4882a593Smuzhiyun  */
8*4882a593Smuzhiyun 
9*4882a593Smuzhiyun #ifndef __TISCI_PROTOCOL_H
10*4882a593Smuzhiyun #define __TISCI_PROTOCOL_H
11*4882a593Smuzhiyun 
12*4882a593Smuzhiyun /**
13*4882a593Smuzhiyun  * struct ti_sci_version_info - version information structure
14*4882a593Smuzhiyun  * @abi_major:	Major ABI version. Change here implies risk of backward
15*4882a593Smuzhiyun  *		compatibility break.
16*4882a593Smuzhiyun  * @abi_minor:	Minor ABI version. Change here implies new feature addition,
17*4882a593Smuzhiyun  *		or compatible change in ABI.
18*4882a593Smuzhiyun  * @firmware_revision:	Firmware revision (not usually used).
19*4882a593Smuzhiyun  * @firmware_description: Firmware description (not usually used).
20*4882a593Smuzhiyun  */
21*4882a593Smuzhiyun struct ti_sci_version_info {
22*4882a593Smuzhiyun 	u8 abi_major;
23*4882a593Smuzhiyun 	u8 abi_minor;
24*4882a593Smuzhiyun 	u16 firmware_revision;
25*4882a593Smuzhiyun 	char firmware_description[32];
26*4882a593Smuzhiyun };
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun struct ti_sci_handle;
29*4882a593Smuzhiyun 
30*4882a593Smuzhiyun /**
31*4882a593Smuzhiyun  * struct ti_sci_core_ops - SoC Core Operations
32*4882a593Smuzhiyun  * @reboot_device: Reboot the SoC
33*4882a593Smuzhiyun  *		Returns 0 for successful request(ideally should never return),
34*4882a593Smuzhiyun  *		else returns corresponding error value.
35*4882a593Smuzhiyun  */
36*4882a593Smuzhiyun struct ti_sci_core_ops {
37*4882a593Smuzhiyun 	int (*reboot_device)(const struct ti_sci_handle *handle);
38*4882a593Smuzhiyun };
39*4882a593Smuzhiyun 
40*4882a593Smuzhiyun /**
41*4882a593Smuzhiyun  * struct ti_sci_dev_ops - Device control operations
42*4882a593Smuzhiyun  * @get_device: Command to request for device managed by TISCI
43*4882a593Smuzhiyun  *		Returns 0 for successful exclusive request, else returns
44*4882a593Smuzhiyun  *		corresponding error message.
45*4882a593Smuzhiyun  * @idle_device: Command to idle a device managed by TISCI
46*4882a593Smuzhiyun  *		Returns 0 for successful exclusive request, else returns
47*4882a593Smuzhiyun  *		corresponding error message.
48*4882a593Smuzhiyun  * @put_device:	Command to release a device managed by TISCI
49*4882a593Smuzhiyun  *		Returns 0 for successful release, else returns corresponding
50*4882a593Smuzhiyun  *		error message.
51*4882a593Smuzhiyun  * @is_valid:	Check if the device ID is a valid ID.
52*4882a593Smuzhiyun  *		Returns 0 if the ID is valid, else returns corresponding error.
53*4882a593Smuzhiyun  * @get_context_loss_count: Command to retrieve context loss counter - this
54*4882a593Smuzhiyun  *		increments every time the device looses context. Overflow
55*4882a593Smuzhiyun  *		is possible.
56*4882a593Smuzhiyun  *		- count: pointer to u32 which will retrieve counter
57*4882a593Smuzhiyun  *		Returns 0 for successful information request and count has
58*4882a593Smuzhiyun  *		proper data, else returns corresponding error message.
59*4882a593Smuzhiyun  * @is_idle:	Reports back about device idle state
60*4882a593Smuzhiyun  *		- req_state: Returns requested idle state
61*4882a593Smuzhiyun  *		Returns 0 for successful information request and req_state and
62*4882a593Smuzhiyun  *		current_state has proper data, else returns corresponding error
63*4882a593Smuzhiyun  *		message.
64*4882a593Smuzhiyun  * @is_stop:	Reports back about device stop state
65*4882a593Smuzhiyun  *		- req_state: Returns requested stop state
66*4882a593Smuzhiyun  *		- current_state: Returns current stop state
67*4882a593Smuzhiyun  *		Returns 0 for successful information request and req_state and
68*4882a593Smuzhiyun  *		current_state has proper data, else returns corresponding error
69*4882a593Smuzhiyun  *		message.
70*4882a593Smuzhiyun  * @is_on:	Reports back about device ON(or active) state
71*4882a593Smuzhiyun  *		- req_state: Returns requested ON state
72*4882a593Smuzhiyun  *		- current_state: Returns current ON state
73*4882a593Smuzhiyun  *		Returns 0 for successful information request and req_state and
74*4882a593Smuzhiyun  *		current_state has proper data, else returns corresponding error
75*4882a593Smuzhiyun  *		message.
76*4882a593Smuzhiyun  * @is_transitioning: Reports back if the device is in the middle of transition
77*4882a593Smuzhiyun  *		of state.
78*4882a593Smuzhiyun  *		-current_state: Returns 'true' if currently transitioning.
79*4882a593Smuzhiyun  * @set_device_resets: Command to configure resets for device managed by TISCI.
80*4882a593Smuzhiyun  *		-reset_state: Device specific reset bit field
81*4882a593Smuzhiyun  *		Returns 0 for successful request, else returns
82*4882a593Smuzhiyun  *		corresponding error message.
83*4882a593Smuzhiyun  * @get_device_resets: Command to read state of resets for device managed
84*4882a593Smuzhiyun  *		by TISCI.
85*4882a593Smuzhiyun  *		-reset_state: pointer to u32 which will retrieve resets
86*4882a593Smuzhiyun  *		Returns 0 for successful request, else returns
87*4882a593Smuzhiyun  *		corresponding error message.
88*4882a593Smuzhiyun  *
89*4882a593Smuzhiyun  * NOTE: for all these functions, the following parameters are generic in
90*4882a593Smuzhiyun  * nature:
91*4882a593Smuzhiyun  * -handle:	Pointer to TISCI handle as retrieved by *ti_sci_get_handle
92*4882a593Smuzhiyun  * -id:		Device Identifier
93*4882a593Smuzhiyun  *
94*4882a593Smuzhiyun  * Request for the device - NOTE: the client MUST maintain integrity of
95*4882a593Smuzhiyun  * usage count by balancing get_device with put_device. No refcounting is
96*4882a593Smuzhiyun  * managed by driver for that purpose.
97*4882a593Smuzhiyun  */
98*4882a593Smuzhiyun struct ti_sci_dev_ops {
99*4882a593Smuzhiyun 	int (*get_device)(const struct ti_sci_handle *handle, u32 id);
100*4882a593Smuzhiyun 	int (*get_device_exclusive)(const struct ti_sci_handle *handle, u32 id);
101*4882a593Smuzhiyun 	int (*idle_device)(const struct ti_sci_handle *handle, u32 id);
102*4882a593Smuzhiyun 	int (*idle_device_exclusive)(const struct ti_sci_handle *handle,
103*4882a593Smuzhiyun 				     u32 id);
104*4882a593Smuzhiyun 	int (*put_device)(const struct ti_sci_handle *handle, u32 id);
105*4882a593Smuzhiyun 	int (*is_valid)(const struct ti_sci_handle *handle, u32 id);
106*4882a593Smuzhiyun 	int (*get_context_loss_count)(const struct ti_sci_handle *handle,
107*4882a593Smuzhiyun 				      u32 id, u32 *count);
108*4882a593Smuzhiyun 	int (*is_idle)(const struct ti_sci_handle *handle, u32 id,
109*4882a593Smuzhiyun 		       bool *requested_state);
110*4882a593Smuzhiyun 	int (*is_stop)(const struct ti_sci_handle *handle, u32 id,
111*4882a593Smuzhiyun 		       bool *req_state, bool *current_state);
112*4882a593Smuzhiyun 	int (*is_on)(const struct ti_sci_handle *handle, u32 id,
113*4882a593Smuzhiyun 		     bool *req_state, bool *current_state);
114*4882a593Smuzhiyun 	int (*is_transitioning)(const struct ti_sci_handle *handle, u32 id,
115*4882a593Smuzhiyun 				bool *current_state);
116*4882a593Smuzhiyun 	int (*set_device_resets)(const struct ti_sci_handle *handle, u32 id,
117*4882a593Smuzhiyun 				 u32 reset_state);
118*4882a593Smuzhiyun 	int (*get_device_resets)(const struct ti_sci_handle *handle, u32 id,
119*4882a593Smuzhiyun 				 u32 *reset_state);
120*4882a593Smuzhiyun };
121*4882a593Smuzhiyun 
122*4882a593Smuzhiyun /**
123*4882a593Smuzhiyun  * struct ti_sci_clk_ops - Clock control operations
124*4882a593Smuzhiyun  * @get_clock:	Request for activation of clock and manage by processor
125*4882a593Smuzhiyun  *		- needs_ssc: 'true' if Spread Spectrum clock is desired.
126*4882a593Smuzhiyun  *		- can_change_freq: 'true' if frequency change is desired.
127*4882a593Smuzhiyun  *		- enable_input_term: 'true' if input termination is desired.
128*4882a593Smuzhiyun  * @idle_clock:	Request for Idling a clock managed by processor
129*4882a593Smuzhiyun  * @put_clock:	Release the clock to be auto managed by TISCI
130*4882a593Smuzhiyun  * @is_auto:	Is the clock being auto managed
131*4882a593Smuzhiyun  *		- req_state: state indicating if the clock is auto managed
132*4882a593Smuzhiyun  * @is_on:	Is the clock ON
133*4882a593Smuzhiyun  *		- req_state: if the clock is requested to be forced ON
134*4882a593Smuzhiyun  *		- current_state: if the clock is currently ON
135*4882a593Smuzhiyun  * @is_off:	Is the clock OFF
136*4882a593Smuzhiyun  *		- req_state: if the clock is requested to be forced OFF
137*4882a593Smuzhiyun  *		- current_state: if the clock is currently Gated
138*4882a593Smuzhiyun  * @set_parent:	Set the clock source of a specific device clock
139*4882a593Smuzhiyun  *		- parent_id: Parent clock identifier to set.
140*4882a593Smuzhiyun  * @get_parent:	Get the current clock source of a specific device clock
141*4882a593Smuzhiyun  *		- parent_id: Parent clock identifier which is the parent.
142*4882a593Smuzhiyun  * @get_num_parents: Get the number of parents of the current clock source
143*4882a593Smuzhiyun  *		- num_parents: returns the number of parent clocks.
144*4882a593Smuzhiyun  * @get_best_match_freq: Find a best matching frequency for a frequency
145*4882a593Smuzhiyun  *		range.
146*4882a593Smuzhiyun  *		- match_freq: Best matching frequency in Hz.
147*4882a593Smuzhiyun  * @set_freq:	Set the Clock frequency
148*4882a593Smuzhiyun  * @get_freq:	Get the Clock frequency
149*4882a593Smuzhiyun  *		- current_freq: Frequency in Hz that the clock is at.
150*4882a593Smuzhiyun  *
151*4882a593Smuzhiyun  * NOTE: for all these functions, the following parameters are generic in
152*4882a593Smuzhiyun  * nature:
153*4882a593Smuzhiyun  * -handle:	Pointer to TISCI handle as retrieved by *ti_sci_get_handle
154*4882a593Smuzhiyun  * -did:	Device identifier this request is for
155*4882a593Smuzhiyun  * -cid:	Clock identifier for the device for this request.
156*4882a593Smuzhiyun  *		Each device has it's own set of clock inputs. This indexes
157*4882a593Smuzhiyun  *		which clock input to modify.
158*4882a593Smuzhiyun  * -min_freq:	The minimum allowable frequency in Hz. This is the minimum
159*4882a593Smuzhiyun  *		allowable programmed frequency and does not account for clock
160*4882a593Smuzhiyun  *		tolerances and jitter.
161*4882a593Smuzhiyun  * -target_freq: The target clock frequency in Hz. A frequency will be
162*4882a593Smuzhiyun  *		processed as close to this target frequency as possible.
163*4882a593Smuzhiyun  * -max_freq:	The maximum allowable frequency in Hz. This is the maximum
164*4882a593Smuzhiyun  *		allowable programmed frequency and does not account for clock
165*4882a593Smuzhiyun  *		tolerances and jitter.
166*4882a593Smuzhiyun  *
167*4882a593Smuzhiyun  * Request for the clock - NOTE: the client MUST maintain integrity of
168*4882a593Smuzhiyun  * usage count by balancing get_clock with put_clock. No refcounting is
169*4882a593Smuzhiyun  * managed by driver for that purpose.
170*4882a593Smuzhiyun  */
171*4882a593Smuzhiyun struct ti_sci_clk_ops {
172*4882a593Smuzhiyun 	int (*get_clock)(const struct ti_sci_handle *handle, u32 did, u32 cid,
173*4882a593Smuzhiyun 			 bool needs_ssc, bool can_change_freq,
174*4882a593Smuzhiyun 			 bool enable_input_term);
175*4882a593Smuzhiyun 	int (*idle_clock)(const struct ti_sci_handle *handle, u32 did, u32 cid);
176*4882a593Smuzhiyun 	int (*put_clock)(const struct ti_sci_handle *handle, u32 did, u32 cid);
177*4882a593Smuzhiyun 	int (*is_auto)(const struct ti_sci_handle *handle, u32 did, u32 cid,
178*4882a593Smuzhiyun 		       bool *req_state);
179*4882a593Smuzhiyun 	int (*is_on)(const struct ti_sci_handle *handle, u32 did, u32 cid,
180*4882a593Smuzhiyun 		     bool *req_state, bool *current_state);
181*4882a593Smuzhiyun 	int (*is_off)(const struct ti_sci_handle *handle, u32 did, u32 cid,
182*4882a593Smuzhiyun 		      bool *req_state, bool *current_state);
183*4882a593Smuzhiyun 	int (*set_parent)(const struct ti_sci_handle *handle, u32 did, u32 cid,
184*4882a593Smuzhiyun 			  u32 parent_id);
185*4882a593Smuzhiyun 	int (*get_parent)(const struct ti_sci_handle *handle, u32 did, u32 cid,
186*4882a593Smuzhiyun 			  u32 *parent_id);
187*4882a593Smuzhiyun 	int (*get_num_parents)(const struct ti_sci_handle *handle, u32 did,
188*4882a593Smuzhiyun 			       u32 cid, u32 *num_parents);
189*4882a593Smuzhiyun 	int (*get_best_match_freq)(const struct ti_sci_handle *handle, u32 did,
190*4882a593Smuzhiyun 				   u32 cid, u64 min_freq, u64 target_freq,
191*4882a593Smuzhiyun 				   u64 max_freq, u64 *match_freq);
192*4882a593Smuzhiyun 	int (*set_freq)(const struct ti_sci_handle *handle, u32 did, u32 cid,
193*4882a593Smuzhiyun 			u64 min_freq, u64 target_freq, u64 max_freq);
194*4882a593Smuzhiyun 	int (*get_freq)(const struct ti_sci_handle *handle, u32 did, u32 cid,
195*4882a593Smuzhiyun 			u64 *current_freq);
196*4882a593Smuzhiyun };
197*4882a593Smuzhiyun 
198*4882a593Smuzhiyun /**
199*4882a593Smuzhiyun  * struct ti_sci_rm_core_ops - Resource management core operations
200*4882a593Smuzhiyun  * @get_range:		Get a range of resources belonging to ti sci host.
201*4882a593Smuzhiyun  * @get_rage_from_shost:	Get a range of resources belonging to
202*4882a593Smuzhiyun  *				specified host id.
203*4882a593Smuzhiyun  *			- s_host: Host processing entity to which the
204*4882a593Smuzhiyun  *				  resources are allocated
205*4882a593Smuzhiyun  *
206*4882a593Smuzhiyun  * NOTE: for these functions, all the parameters are consolidated and defined
207*4882a593Smuzhiyun  * as below:
208*4882a593Smuzhiyun  * - handle:	Pointer to TISCI handle as retrieved by *ti_sci_get_handle
209*4882a593Smuzhiyun  * - dev_id:	TISCI device ID.
210*4882a593Smuzhiyun  * - subtype:	Resource assignment subtype that is being requested
211*4882a593Smuzhiyun  *		from the given device.
212*4882a593Smuzhiyun  * - range_start:	Start index of the resource range
213*4882a593Smuzhiyun  * - range_end:		Number of resources in the range
214*4882a593Smuzhiyun  */
215*4882a593Smuzhiyun struct ti_sci_rm_core_ops {
216*4882a593Smuzhiyun 	int (*get_range)(const struct ti_sci_handle *handle, u32 dev_id,
217*4882a593Smuzhiyun 			 u8 subtype, u16 *range_start, u16 *range_num);
218*4882a593Smuzhiyun 	int (*get_range_from_shost)(const struct ti_sci_handle *handle,
219*4882a593Smuzhiyun 				    u32 dev_id, u8 subtype, u8 s_host,
220*4882a593Smuzhiyun 				    u16 *range_start, u16 *range_num);
221*4882a593Smuzhiyun };
222*4882a593Smuzhiyun 
223*4882a593Smuzhiyun #define TI_SCI_RESASG_SUBTYPE_IR_OUTPUT		0
224*4882a593Smuzhiyun #define TI_SCI_RESASG_SUBTYPE_IA_VINT		0xa
225*4882a593Smuzhiyun #define TI_SCI_RESASG_SUBTYPE_GLOBAL_EVENT_SEVT	0xd
226*4882a593Smuzhiyun /**
227*4882a593Smuzhiyun  * struct ti_sci_rm_irq_ops: IRQ management operations
228*4882a593Smuzhiyun  * @set_irq:		Set an IRQ route between the requested source
229*4882a593Smuzhiyun  *			and destination
230*4882a593Smuzhiyun  * @set_event_map:	Set an Event based peripheral irq to Interrupt
231*4882a593Smuzhiyun  *			Aggregator.
232*4882a593Smuzhiyun  * @free_irq:		Free an IRQ route between the requested source
233*4882a593Smuzhiyun  *			and destination.
234*4882a593Smuzhiyun  * @free_event_map:	Free an event based peripheral irq to Interrupt
235*4882a593Smuzhiyun  *			Aggregator.
236*4882a593Smuzhiyun  */
237*4882a593Smuzhiyun struct ti_sci_rm_irq_ops {
238*4882a593Smuzhiyun 	int (*set_irq)(const struct ti_sci_handle *handle, u16 src_id,
239*4882a593Smuzhiyun 		       u16 src_index, u16 dst_id, u16 dst_host_irq);
240*4882a593Smuzhiyun 	int (*set_event_map)(const struct ti_sci_handle *handle, u16 src_id,
241*4882a593Smuzhiyun 			     u16 src_index, u16 ia_id, u16 vint,
242*4882a593Smuzhiyun 			     u16 global_event, u8 vint_status_bit);
243*4882a593Smuzhiyun 	int (*free_irq)(const struct ti_sci_handle *handle, u16 src_id,
244*4882a593Smuzhiyun 			u16 src_index, u16 dst_id, u16 dst_host_irq);
245*4882a593Smuzhiyun 	int (*free_event_map)(const struct ti_sci_handle *handle, u16 src_id,
246*4882a593Smuzhiyun 			      u16 src_index, u16 ia_id, u16 vint,
247*4882a593Smuzhiyun 			      u16 global_event, u8 vint_status_bit);
248*4882a593Smuzhiyun };
249*4882a593Smuzhiyun 
250*4882a593Smuzhiyun /* RA config.addr_lo parameter is valid for RM ring configure TI_SCI message */
251*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_RING_ADDR_LO_VALID	BIT(0)
252*4882a593Smuzhiyun /* RA config.addr_hi parameter is valid for RM ring configure TI_SCI message */
253*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_RING_ADDR_HI_VALID	BIT(1)
254*4882a593Smuzhiyun  /* RA config.count parameter is valid for RM ring configure TI_SCI message */
255*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_RING_COUNT_VALID	BIT(2)
256*4882a593Smuzhiyun /* RA config.mode parameter is valid for RM ring configure TI_SCI message */
257*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_RING_MODE_VALID	BIT(3)
258*4882a593Smuzhiyun /* RA config.size parameter is valid for RM ring configure TI_SCI message */
259*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_RING_SIZE_VALID	BIT(4)
260*4882a593Smuzhiyun /* RA config.order_id parameter is valid for RM ring configure TISCI message */
261*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_RING_ORDER_ID_VALID	BIT(5)
262*4882a593Smuzhiyun 
263*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_ALL_NO_ORDER \
264*4882a593Smuzhiyun 	(TI_SCI_MSG_VALUE_RM_RING_ADDR_LO_VALID | \
265*4882a593Smuzhiyun 	TI_SCI_MSG_VALUE_RM_RING_ADDR_HI_VALID | \
266*4882a593Smuzhiyun 	TI_SCI_MSG_VALUE_RM_RING_COUNT_VALID | \
267*4882a593Smuzhiyun 	TI_SCI_MSG_VALUE_RM_RING_MODE_VALID | \
268*4882a593Smuzhiyun 	TI_SCI_MSG_VALUE_RM_RING_SIZE_VALID)
269*4882a593Smuzhiyun 
270*4882a593Smuzhiyun /**
271*4882a593Smuzhiyun  * struct ti_sci_rm_ringacc_ops - Ring Accelerator Management operations
272*4882a593Smuzhiyun  * @config: configure the SoC Navigator Subsystem Ring Accelerator ring
273*4882a593Smuzhiyun  * @get_config: get the SoC Navigator Subsystem Ring Accelerator ring
274*4882a593Smuzhiyun  *		configuration
275*4882a593Smuzhiyun  */
276*4882a593Smuzhiyun struct ti_sci_rm_ringacc_ops {
277*4882a593Smuzhiyun 	int (*config)(const struct ti_sci_handle *handle,
278*4882a593Smuzhiyun 		      u32 valid_params, u16 nav_id, u16 index,
279*4882a593Smuzhiyun 		      u32 addr_lo, u32 addr_hi, u32 count, u8 mode,
280*4882a593Smuzhiyun 		      u8 size, u8 order_id
281*4882a593Smuzhiyun 	);
282*4882a593Smuzhiyun 	int (*get_config)(const struct ti_sci_handle *handle,
283*4882a593Smuzhiyun 			  u32 nav_id, u32 index, u8 *mode,
284*4882a593Smuzhiyun 			  u32 *addr_lo, u32 *addr_hi, u32 *count,
285*4882a593Smuzhiyun 			  u8 *size, u8 *order_id);
286*4882a593Smuzhiyun };
287*4882a593Smuzhiyun 
288*4882a593Smuzhiyun /**
289*4882a593Smuzhiyun  * struct ti_sci_rm_psil_ops - PSI-L thread operations
290*4882a593Smuzhiyun  * @pair: pair PSI-L source thread to a destination thread.
291*4882a593Smuzhiyun  *	If the src_thread is mapped to UDMA tchan, the corresponding channel's
292*4882a593Smuzhiyun  *	TCHAN_THRD_ID register is updated.
293*4882a593Smuzhiyun  *	If the dst_thread is mapped to UDMA rchan, the corresponding channel's
294*4882a593Smuzhiyun  *	RCHAN_THRD_ID register is updated.
295*4882a593Smuzhiyun  * @unpair: unpair PSI-L source thread from a destination thread.
296*4882a593Smuzhiyun  *	If the src_thread is mapped to UDMA tchan, the corresponding channel's
297*4882a593Smuzhiyun  *	TCHAN_THRD_ID register is cleared.
298*4882a593Smuzhiyun  *	If the dst_thread is mapped to UDMA rchan, the corresponding channel's
299*4882a593Smuzhiyun  *	RCHAN_THRD_ID register is cleared.
300*4882a593Smuzhiyun  */
301*4882a593Smuzhiyun struct ti_sci_rm_psil_ops {
302*4882a593Smuzhiyun 	int (*pair)(const struct ti_sci_handle *handle, u32 nav_id,
303*4882a593Smuzhiyun 		    u32 src_thread, u32 dst_thread);
304*4882a593Smuzhiyun 	int (*unpair)(const struct ti_sci_handle *handle, u32 nav_id,
305*4882a593Smuzhiyun 		      u32 src_thread, u32 dst_thread);
306*4882a593Smuzhiyun };
307*4882a593Smuzhiyun 
308*4882a593Smuzhiyun /* UDMAP channel types */
309*4882a593Smuzhiyun #define TI_SCI_RM_UDMAP_CHAN_TYPE_PKT_PBRR		2
310*4882a593Smuzhiyun #define TI_SCI_RM_UDMAP_CHAN_TYPE_PKT_PBRR_SB		3	/* RX only */
311*4882a593Smuzhiyun #define TI_SCI_RM_UDMAP_CHAN_TYPE_3RDP_PBRR		10
312*4882a593Smuzhiyun #define TI_SCI_RM_UDMAP_CHAN_TYPE_3RDP_PBVR		11
313*4882a593Smuzhiyun #define TI_SCI_RM_UDMAP_CHAN_TYPE_3RDP_BCOPY_PBRR	12
314*4882a593Smuzhiyun #define TI_SCI_RM_UDMAP_CHAN_TYPE_3RDP_BCOPY_PBVR	13
315*4882a593Smuzhiyun 
316*4882a593Smuzhiyun #define TI_SCI_RM_UDMAP_RX_FLOW_DESC_HOST		0
317*4882a593Smuzhiyun #define TI_SCI_RM_UDMAP_RX_FLOW_DESC_MONO		2
318*4882a593Smuzhiyun 
319*4882a593Smuzhiyun #define TI_SCI_RM_UDMAP_CHAN_BURST_SIZE_64_BYTES	1
320*4882a593Smuzhiyun #define TI_SCI_RM_UDMAP_CHAN_BURST_SIZE_128_BYTES	2
321*4882a593Smuzhiyun #define TI_SCI_RM_UDMAP_CHAN_BURST_SIZE_256_BYTES	3
322*4882a593Smuzhiyun 
323*4882a593Smuzhiyun /* UDMAP TX/RX channel valid_params common declarations */
324*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_PAUSE_ON_ERR_VALID		BIT(0)
325*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_ATYPE_VALID                BIT(1)
326*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_CHAN_TYPE_VALID            BIT(2)
327*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_FETCH_SIZE_VALID           BIT(3)
328*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_CQ_QNUM_VALID              BIT(4)
329*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_PRIORITY_VALID             BIT(5)
330*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_QOS_VALID                  BIT(6)
331*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_ORDER_ID_VALID             BIT(7)
332*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_SCHED_PRIORITY_VALID       BIT(8)
333*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_BURST_SIZE_VALID		BIT(14)
334*4882a593Smuzhiyun 
335*4882a593Smuzhiyun /**
336*4882a593Smuzhiyun  * Configures a Navigator Subsystem UDMAP transmit channel
337*4882a593Smuzhiyun  *
338*4882a593Smuzhiyun  * Configures a Navigator Subsystem UDMAP transmit channel registers.
339*4882a593Smuzhiyun  * See @ti_sci_msg_rm_udmap_tx_ch_cfg_req
340*4882a593Smuzhiyun  */
341*4882a593Smuzhiyun struct ti_sci_msg_rm_udmap_tx_ch_cfg {
342*4882a593Smuzhiyun 	u32 valid_params;
343*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_FILT_EINFO_VALID        BIT(9)
344*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_FILT_PSWORDS_VALID      BIT(10)
345*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_SUPR_TDPKT_VALID        BIT(11)
346*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_CREDIT_COUNT_VALID      BIT(12)
347*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_FDEPTH_VALID            BIT(13)
348*4882a593Smuzhiyun 	u16 nav_id;
349*4882a593Smuzhiyun 	u16 index;
350*4882a593Smuzhiyun 	u8 tx_pause_on_err;
351*4882a593Smuzhiyun 	u8 tx_filt_einfo;
352*4882a593Smuzhiyun 	u8 tx_filt_pswords;
353*4882a593Smuzhiyun 	u8 tx_atype;
354*4882a593Smuzhiyun 	u8 tx_chan_type;
355*4882a593Smuzhiyun 	u8 tx_supr_tdpkt;
356*4882a593Smuzhiyun 	u16 tx_fetch_size;
357*4882a593Smuzhiyun 	u8 tx_credit_count;
358*4882a593Smuzhiyun 	u16 txcq_qnum;
359*4882a593Smuzhiyun 	u8 tx_priority;
360*4882a593Smuzhiyun 	u8 tx_qos;
361*4882a593Smuzhiyun 	u8 tx_orderid;
362*4882a593Smuzhiyun 	u16 fdepth;
363*4882a593Smuzhiyun 	u8 tx_sched_priority;
364*4882a593Smuzhiyun 	u8 tx_burst_size;
365*4882a593Smuzhiyun };
366*4882a593Smuzhiyun 
367*4882a593Smuzhiyun /**
368*4882a593Smuzhiyun  * Configures a Navigator Subsystem UDMAP receive channel
369*4882a593Smuzhiyun  *
370*4882a593Smuzhiyun  * Configures a Navigator Subsystem UDMAP receive channel registers.
371*4882a593Smuzhiyun  * See @ti_sci_msg_rm_udmap_rx_ch_cfg_req
372*4882a593Smuzhiyun  */
373*4882a593Smuzhiyun struct ti_sci_msg_rm_udmap_rx_ch_cfg {
374*4882a593Smuzhiyun 	u32 valid_params;
375*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_RX_FLOWID_START_VALID      BIT(9)
376*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_RX_FLOWID_CNT_VALID        BIT(10)
377*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_RX_IGNORE_SHORT_VALID      BIT(11)
378*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_CH_RX_IGNORE_LONG_VALID       BIT(12)
379*4882a593Smuzhiyun 	u16 nav_id;
380*4882a593Smuzhiyun 	u16 index;
381*4882a593Smuzhiyun 	u16 rx_fetch_size;
382*4882a593Smuzhiyun 	u16 rxcq_qnum;
383*4882a593Smuzhiyun 	u8 rx_priority;
384*4882a593Smuzhiyun 	u8 rx_qos;
385*4882a593Smuzhiyun 	u8 rx_orderid;
386*4882a593Smuzhiyun 	u8 rx_sched_priority;
387*4882a593Smuzhiyun 	u16 flowid_start;
388*4882a593Smuzhiyun 	u16 flowid_cnt;
389*4882a593Smuzhiyun 	u8 rx_pause_on_err;
390*4882a593Smuzhiyun 	u8 rx_atype;
391*4882a593Smuzhiyun 	u8 rx_chan_type;
392*4882a593Smuzhiyun 	u8 rx_ignore_short;
393*4882a593Smuzhiyun 	u8 rx_ignore_long;
394*4882a593Smuzhiyun 	u8 rx_burst_size;
395*4882a593Smuzhiyun };
396*4882a593Smuzhiyun 
397*4882a593Smuzhiyun /**
398*4882a593Smuzhiyun  * Configures a Navigator Subsystem UDMAP receive flow
399*4882a593Smuzhiyun  *
400*4882a593Smuzhiyun  * Configures a Navigator Subsystem UDMAP receive flow's registers.
401*4882a593Smuzhiyun  * See @tis_ci_msg_rm_udmap_flow_cfg_req
402*4882a593Smuzhiyun  */
403*4882a593Smuzhiyun struct ti_sci_msg_rm_udmap_flow_cfg {
404*4882a593Smuzhiyun 	u32 valid_params;
405*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_EINFO_PRESENT_VALID	BIT(0)
406*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_PSINFO_PRESENT_VALID     BIT(1)
407*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_ERROR_HANDLING_VALID     BIT(2)
408*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DESC_TYPE_VALID          BIT(3)
409*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SOP_OFFSET_VALID         BIT(4)
410*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_QNUM_VALID          BIT(5)
411*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SRC_TAG_HI_VALID         BIT(6)
412*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SRC_TAG_LO_VALID         BIT(7)
413*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_TAG_HI_VALID        BIT(8)
414*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_TAG_LO_VALID        BIT(9)
415*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SRC_TAG_HI_SEL_VALID     BIT(10)
416*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SRC_TAG_LO_SEL_VALID     BIT(11)
417*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_TAG_HI_SEL_VALID    BIT(12)
418*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_TAG_LO_SEL_VALID    BIT(13)
419*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ0_SZ0_QNUM_VALID      BIT(14)
420*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ1_QNUM_VALID          BIT(15)
421*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ2_QNUM_VALID          BIT(16)
422*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ3_QNUM_VALID          BIT(17)
423*4882a593Smuzhiyun #define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_PS_LOCATION_VALID        BIT(18)
424*4882a593Smuzhiyun 	u16 nav_id;
425*4882a593Smuzhiyun 	u16 flow_index;
426*4882a593Smuzhiyun 	u8 rx_einfo_present;
427*4882a593Smuzhiyun 	u8 rx_psinfo_present;
428*4882a593Smuzhiyun 	u8 rx_error_handling;
429*4882a593Smuzhiyun 	u8 rx_desc_type;
430*4882a593Smuzhiyun 	u16 rx_sop_offset;
431*4882a593Smuzhiyun 	u16 rx_dest_qnum;
432*4882a593Smuzhiyun 	u8 rx_src_tag_hi;
433*4882a593Smuzhiyun 	u8 rx_src_tag_lo;
434*4882a593Smuzhiyun 	u8 rx_dest_tag_hi;
435*4882a593Smuzhiyun 	u8 rx_dest_tag_lo;
436*4882a593Smuzhiyun 	u8 rx_src_tag_hi_sel;
437*4882a593Smuzhiyun 	u8 rx_src_tag_lo_sel;
438*4882a593Smuzhiyun 	u8 rx_dest_tag_hi_sel;
439*4882a593Smuzhiyun 	u8 rx_dest_tag_lo_sel;
440*4882a593Smuzhiyun 	u16 rx_fdq0_sz0_qnum;
441*4882a593Smuzhiyun 	u16 rx_fdq1_qnum;
442*4882a593Smuzhiyun 	u16 rx_fdq2_qnum;
443*4882a593Smuzhiyun 	u16 rx_fdq3_qnum;
444*4882a593Smuzhiyun 	u8 rx_ps_location;
445*4882a593Smuzhiyun };
446*4882a593Smuzhiyun 
447*4882a593Smuzhiyun /**
448*4882a593Smuzhiyun  * struct ti_sci_rm_udmap_ops - UDMA Management operations
449*4882a593Smuzhiyun  * @tx_ch_cfg: configure SoC Navigator Subsystem UDMA transmit channel.
450*4882a593Smuzhiyun  * @rx_ch_cfg: configure SoC Navigator Subsystem UDMA receive channel.
451*4882a593Smuzhiyun  * @rx_flow_cfg1: configure SoC Navigator Subsystem UDMA receive flow.
452*4882a593Smuzhiyun  */
453*4882a593Smuzhiyun struct ti_sci_rm_udmap_ops {
454*4882a593Smuzhiyun 	int (*tx_ch_cfg)(const struct ti_sci_handle *handle,
455*4882a593Smuzhiyun 			 const struct ti_sci_msg_rm_udmap_tx_ch_cfg *params);
456*4882a593Smuzhiyun 	int (*rx_ch_cfg)(const struct ti_sci_handle *handle,
457*4882a593Smuzhiyun 			 const struct ti_sci_msg_rm_udmap_rx_ch_cfg *params);
458*4882a593Smuzhiyun 	int (*rx_flow_cfg)(const struct ti_sci_handle *handle,
459*4882a593Smuzhiyun 			   const struct ti_sci_msg_rm_udmap_flow_cfg *params);
460*4882a593Smuzhiyun };
461*4882a593Smuzhiyun 
462*4882a593Smuzhiyun /**
463*4882a593Smuzhiyun  * struct ti_sci_proc_ops - Processor Control operations
464*4882a593Smuzhiyun  * @request:	Request to control a physical processor. The requesting host
465*4882a593Smuzhiyun  *		should be in the processor access list
466*4882a593Smuzhiyun  * @release:	Relinquish a physical processor control
467*4882a593Smuzhiyun  * @handover:	Handover a physical processor control to another host
468*4882a593Smuzhiyun  *		in the permitted list
469*4882a593Smuzhiyun  * @set_config:	Set base configuration of a processor
470*4882a593Smuzhiyun  * @set_control: Setup limited control flags in specific cases
471*4882a593Smuzhiyun  * @get_status: Get the state of physical processor
472*4882a593Smuzhiyun  *
473*4882a593Smuzhiyun  * NOTE: The following paramteres are generic in nature for all these ops,
474*4882a593Smuzhiyun  * -handle:	Pointer to TI SCI handle as retrieved by *ti_sci_get_handle
475*4882a593Smuzhiyun  * -pid:	Processor ID
476*4882a593Smuzhiyun  * -hid:	Host ID
477*4882a593Smuzhiyun  */
478*4882a593Smuzhiyun struct ti_sci_proc_ops {
479*4882a593Smuzhiyun 	int (*request)(const struct ti_sci_handle *handle, u8 pid);
480*4882a593Smuzhiyun 	int (*release)(const struct ti_sci_handle *handle, u8 pid);
481*4882a593Smuzhiyun 	int (*handover)(const struct ti_sci_handle *handle, u8 pid, u8 hid);
482*4882a593Smuzhiyun 	int (*set_config)(const struct ti_sci_handle *handle, u8 pid,
483*4882a593Smuzhiyun 			  u64 boot_vector, u32 cfg_set, u32 cfg_clr);
484*4882a593Smuzhiyun 	int (*set_control)(const struct ti_sci_handle *handle, u8 pid,
485*4882a593Smuzhiyun 			   u32 ctrl_set, u32 ctrl_clr);
486*4882a593Smuzhiyun 	int (*get_status)(const struct ti_sci_handle *handle, u8 pid,
487*4882a593Smuzhiyun 			  u64 *boot_vector, u32 *cfg_flags, u32 *ctrl_flags,
488*4882a593Smuzhiyun 			  u32 *status_flags);
489*4882a593Smuzhiyun };
490*4882a593Smuzhiyun 
491*4882a593Smuzhiyun /**
492*4882a593Smuzhiyun  * struct ti_sci_ops - Function support for TI SCI
493*4882a593Smuzhiyun  * @dev_ops:	Device specific operations
494*4882a593Smuzhiyun  * @clk_ops:	Clock specific operations
495*4882a593Smuzhiyun  * @rm_core_ops:	Resource management core operations.
496*4882a593Smuzhiyun  * @rm_irq_ops:		IRQ management specific operations
497*4882a593Smuzhiyun  * @proc_ops:	Processor Control specific operations
498*4882a593Smuzhiyun  */
499*4882a593Smuzhiyun struct ti_sci_ops {
500*4882a593Smuzhiyun 	struct ti_sci_core_ops core_ops;
501*4882a593Smuzhiyun 	struct ti_sci_dev_ops dev_ops;
502*4882a593Smuzhiyun 	struct ti_sci_clk_ops clk_ops;
503*4882a593Smuzhiyun 	struct ti_sci_rm_core_ops rm_core_ops;
504*4882a593Smuzhiyun 	struct ti_sci_rm_irq_ops rm_irq_ops;
505*4882a593Smuzhiyun 	struct ti_sci_rm_ringacc_ops rm_ring_ops;
506*4882a593Smuzhiyun 	struct ti_sci_rm_psil_ops rm_psil_ops;
507*4882a593Smuzhiyun 	struct ti_sci_rm_udmap_ops rm_udmap_ops;
508*4882a593Smuzhiyun 	struct ti_sci_proc_ops proc_ops;
509*4882a593Smuzhiyun };
510*4882a593Smuzhiyun 
511*4882a593Smuzhiyun /**
512*4882a593Smuzhiyun  * struct ti_sci_handle - Handle returned to TI SCI clients for usage.
513*4882a593Smuzhiyun  * @version:	structure containing version information
514*4882a593Smuzhiyun  * @ops:	operations that are made available to TI SCI clients
515*4882a593Smuzhiyun  */
516*4882a593Smuzhiyun struct ti_sci_handle {
517*4882a593Smuzhiyun 	struct ti_sci_version_info version;
518*4882a593Smuzhiyun 	struct ti_sci_ops ops;
519*4882a593Smuzhiyun };
520*4882a593Smuzhiyun 
521*4882a593Smuzhiyun #define TI_SCI_RESOURCE_NULL	0xffff
522*4882a593Smuzhiyun 
523*4882a593Smuzhiyun /**
524*4882a593Smuzhiyun  * struct ti_sci_resource_desc - Description of TI SCI resource instance range.
525*4882a593Smuzhiyun  * @start:	Start index of the resource.
526*4882a593Smuzhiyun  * @num:	Number of resources.
527*4882a593Smuzhiyun  * @res_map:	Bitmap to manage the allocation of these resources.
528*4882a593Smuzhiyun  */
529*4882a593Smuzhiyun struct ti_sci_resource_desc {
530*4882a593Smuzhiyun 	u16 start;
531*4882a593Smuzhiyun 	u16 num;
532*4882a593Smuzhiyun 	unsigned long *res_map;
533*4882a593Smuzhiyun };
534*4882a593Smuzhiyun 
535*4882a593Smuzhiyun /**
536*4882a593Smuzhiyun  * struct ti_sci_resource - Structure representing a resource assigned
537*4882a593Smuzhiyun  *			    to a device.
538*4882a593Smuzhiyun  * @sets:	Number of sets available from this resource type
539*4882a593Smuzhiyun  * @lock:	Lock to guard the res map in each set.
540*4882a593Smuzhiyun  * @desc:	Array of resource descriptors.
541*4882a593Smuzhiyun  */
542*4882a593Smuzhiyun struct ti_sci_resource {
543*4882a593Smuzhiyun 	u16 sets;
544*4882a593Smuzhiyun 	raw_spinlock_t lock;
545*4882a593Smuzhiyun 	struct ti_sci_resource_desc *desc;
546*4882a593Smuzhiyun };
547*4882a593Smuzhiyun 
548*4882a593Smuzhiyun #if IS_ENABLED(CONFIG_TI_SCI_PROTOCOL)
549*4882a593Smuzhiyun const struct ti_sci_handle *ti_sci_get_handle(struct device *dev);
550*4882a593Smuzhiyun int ti_sci_put_handle(const struct ti_sci_handle *handle);
551*4882a593Smuzhiyun const struct ti_sci_handle *devm_ti_sci_get_handle(struct device *dev);
552*4882a593Smuzhiyun const struct ti_sci_handle *ti_sci_get_by_phandle(struct device_node *np,
553*4882a593Smuzhiyun 						  const char *property);
554*4882a593Smuzhiyun const struct ti_sci_handle *devm_ti_sci_get_by_phandle(struct device *dev,
555*4882a593Smuzhiyun 						       const char *property);
556*4882a593Smuzhiyun u16 ti_sci_get_free_resource(struct ti_sci_resource *res);
557*4882a593Smuzhiyun void ti_sci_release_resource(struct ti_sci_resource *res, u16 id);
558*4882a593Smuzhiyun u32 ti_sci_get_num_resources(struct ti_sci_resource *res);
559*4882a593Smuzhiyun struct ti_sci_resource *
560*4882a593Smuzhiyun devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle,
561*4882a593Smuzhiyun 			    struct device *dev, u32 dev_id, char *of_prop);
562*4882a593Smuzhiyun struct ti_sci_resource *
563*4882a593Smuzhiyun devm_ti_sci_get_resource(const struct ti_sci_handle *handle, struct device *dev,
564*4882a593Smuzhiyun 			 u32 dev_id, u32 sub_type);
565*4882a593Smuzhiyun 
566*4882a593Smuzhiyun #else	/* CONFIG_TI_SCI_PROTOCOL */
567*4882a593Smuzhiyun 
ti_sci_get_handle(struct device * dev)568*4882a593Smuzhiyun static inline const struct ti_sci_handle *ti_sci_get_handle(struct device *dev)
569*4882a593Smuzhiyun {
570*4882a593Smuzhiyun 	return ERR_PTR(-EINVAL);
571*4882a593Smuzhiyun }
572*4882a593Smuzhiyun 
ti_sci_put_handle(const struct ti_sci_handle * handle)573*4882a593Smuzhiyun static inline int ti_sci_put_handle(const struct ti_sci_handle *handle)
574*4882a593Smuzhiyun {
575*4882a593Smuzhiyun 	return -EINVAL;
576*4882a593Smuzhiyun }
577*4882a593Smuzhiyun 
578*4882a593Smuzhiyun static inline
devm_ti_sci_get_handle(struct device * dev)579*4882a593Smuzhiyun const struct ti_sci_handle *devm_ti_sci_get_handle(struct device *dev)
580*4882a593Smuzhiyun {
581*4882a593Smuzhiyun 	return ERR_PTR(-EINVAL);
582*4882a593Smuzhiyun }
583*4882a593Smuzhiyun 
584*4882a593Smuzhiyun static inline
ti_sci_get_by_phandle(struct device_node * np,const char * property)585*4882a593Smuzhiyun const struct ti_sci_handle *ti_sci_get_by_phandle(struct device_node *np,
586*4882a593Smuzhiyun 						  const char *property)
587*4882a593Smuzhiyun {
588*4882a593Smuzhiyun 	return ERR_PTR(-EINVAL);
589*4882a593Smuzhiyun }
590*4882a593Smuzhiyun 
591*4882a593Smuzhiyun static inline
devm_ti_sci_get_by_phandle(struct device * dev,const char * property)592*4882a593Smuzhiyun const struct ti_sci_handle *devm_ti_sci_get_by_phandle(struct device *dev,
593*4882a593Smuzhiyun 						       const char *property)
594*4882a593Smuzhiyun {
595*4882a593Smuzhiyun 	return ERR_PTR(-EINVAL);
596*4882a593Smuzhiyun }
597*4882a593Smuzhiyun 
ti_sci_get_free_resource(struct ti_sci_resource * res)598*4882a593Smuzhiyun static inline u16 ti_sci_get_free_resource(struct ti_sci_resource *res)
599*4882a593Smuzhiyun {
600*4882a593Smuzhiyun 	return TI_SCI_RESOURCE_NULL;
601*4882a593Smuzhiyun }
602*4882a593Smuzhiyun 
ti_sci_release_resource(struct ti_sci_resource * res,u16 id)603*4882a593Smuzhiyun static inline void ti_sci_release_resource(struct ti_sci_resource *res, u16 id)
604*4882a593Smuzhiyun {
605*4882a593Smuzhiyun }
606*4882a593Smuzhiyun 
ti_sci_get_num_resources(struct ti_sci_resource * res)607*4882a593Smuzhiyun static inline u32 ti_sci_get_num_resources(struct ti_sci_resource *res)
608*4882a593Smuzhiyun {
609*4882a593Smuzhiyun 	return 0;
610*4882a593Smuzhiyun }
611*4882a593Smuzhiyun 
612*4882a593Smuzhiyun static inline struct ti_sci_resource *
devm_ti_sci_get_of_resource(const struct ti_sci_handle * handle,struct device * dev,u32 dev_id,char * of_prop)613*4882a593Smuzhiyun devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle,
614*4882a593Smuzhiyun 			    struct device *dev, u32 dev_id, char *of_prop)
615*4882a593Smuzhiyun {
616*4882a593Smuzhiyun 	return ERR_PTR(-EINVAL);
617*4882a593Smuzhiyun }
618*4882a593Smuzhiyun 
619*4882a593Smuzhiyun static inline struct ti_sci_resource *
devm_ti_sci_get_resource(const struct ti_sci_handle * handle,struct device * dev,u32 dev_id,u32 sub_type)620*4882a593Smuzhiyun devm_ti_sci_get_resource(const struct ti_sci_handle *handle, struct device *dev,
621*4882a593Smuzhiyun 			 u32 dev_id, u32 sub_type)
622*4882a593Smuzhiyun {
623*4882a593Smuzhiyun 	return ERR_PTR(-EINVAL);
624*4882a593Smuzhiyun }
625*4882a593Smuzhiyun #endif	/* CONFIG_TI_SCI_PROTOCOL */
626*4882a593Smuzhiyun 
627*4882a593Smuzhiyun #endif	/* __TISCI_PROTOCOL_H */
628