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