xref: /linux/drivers/firmware/ti_sci.h (revision a6df49f4224324dd8588f6a0d9cff53cd61a196b)
15d8a437cSNishad Kamdar /* SPDX-License-Identifier: BSD-3-Clause */
2aa276781SNishanth Menon /*
3aa276781SNishanth Menon  * Texas Instruments System Control Interface (TISCI) Protocol
4aa276781SNishanth Menon  *
5aa276781SNishanth Menon  * Communication protocol with TI SCI hardware
6aa276781SNishanth Menon  * The system works in a message response protocol
7aa276781SNishanth Menon  * See: http://processors.wiki.ti.com/index.php/TISCI for details
8aa276781SNishanth Menon  *
9*a6df49f4SAlexander A. Klimov  * Copyright (C)  2015-2016 Texas Instruments Incorporated - https://www.ti.com/
10aa276781SNishanth Menon  */
11aa276781SNishanth Menon 
12aa276781SNishanth Menon #ifndef __TI_SCI_H
13aa276781SNishanth Menon #define __TI_SCI_H
14aa276781SNishanth Menon 
15aa276781SNishanth Menon /* Generic Messages */
16aa276781SNishanth Menon #define TI_SCI_MSG_ENABLE_WDT	0x0000
17aa276781SNishanth Menon #define TI_SCI_MSG_WAKE_RESET	0x0001
18aa276781SNishanth Menon #define TI_SCI_MSG_VERSION	0x0002
19aa276781SNishanth Menon #define TI_SCI_MSG_WAKE_REASON	0x0003
20aa276781SNishanth Menon #define TI_SCI_MSG_GOODBYE	0x0004
21912cffb4SNishanth Menon #define TI_SCI_MSG_SYS_RESET	0x0005
22aa276781SNishanth Menon 
239e7d756dSNishanth Menon /* Device requests */
249e7d756dSNishanth Menon #define TI_SCI_MSG_SET_DEVICE_STATE	0x0200
259e7d756dSNishanth Menon #define TI_SCI_MSG_GET_DEVICE_STATE	0x0201
269e7d756dSNishanth Menon #define TI_SCI_MSG_SET_DEVICE_RESETS	0x0202
279e7d756dSNishanth Menon 
289f723220SNishanth Menon /* Clock requests */
299f723220SNishanth Menon #define TI_SCI_MSG_SET_CLOCK_STATE	0x0100
309f723220SNishanth Menon #define TI_SCI_MSG_GET_CLOCK_STATE	0x0101
319f723220SNishanth Menon #define TI_SCI_MSG_SET_CLOCK_PARENT	0x0102
329f723220SNishanth Menon #define TI_SCI_MSG_GET_CLOCK_PARENT	0x0103
339f723220SNishanth Menon #define TI_SCI_MSG_GET_NUM_CLOCK_PARENTS 0x0104
349f723220SNishanth Menon #define TI_SCI_MSG_SET_CLOCK_FREQ	0x010c
359f723220SNishanth Menon #define TI_SCI_MSG_QUERY_CLOCK_FREQ	0x010d
369f723220SNishanth Menon #define TI_SCI_MSG_GET_CLOCK_FREQ	0x010e
379f723220SNishanth Menon 
389c19fb68SLokesh Vutla /* Resource Management Requests */
399c19fb68SLokesh Vutla #define TI_SCI_MSG_GET_RESOURCE_RANGE	0x1500
409c19fb68SLokesh Vutla 
41997b001fSLokesh Vutla /* IRQ requests */
42997b001fSLokesh Vutla #define TI_SCI_MSG_SET_IRQ		0x1000
43997b001fSLokesh Vutla #define TI_SCI_MSG_FREE_IRQ		0x1001
44997b001fSLokesh Vutla 
4568608b5eSPeter Ujfalusi /* NAVSS resource management */
4668608b5eSPeter Ujfalusi /* Ringacc requests */
4768608b5eSPeter Ujfalusi #define TI_SCI_MSG_RM_RING_ALLOCATE		0x1100
4868608b5eSPeter Ujfalusi #define TI_SCI_MSG_RM_RING_FREE			0x1101
4968608b5eSPeter Ujfalusi #define TI_SCI_MSG_RM_RING_RECONFIG		0x1102
5068608b5eSPeter Ujfalusi #define TI_SCI_MSG_RM_RING_RESET		0x1103
5168608b5eSPeter Ujfalusi #define TI_SCI_MSG_RM_RING_CFG			0x1110
5268608b5eSPeter Ujfalusi #define TI_SCI_MSG_RM_RING_GET_CFG		0x1111
5368608b5eSPeter Ujfalusi 
5468608b5eSPeter Ujfalusi /* PSI-L requests */
5568608b5eSPeter Ujfalusi #define TI_SCI_MSG_RM_PSIL_PAIR			0x1280
5668608b5eSPeter Ujfalusi #define TI_SCI_MSG_RM_PSIL_UNPAIR		0x1281
5768608b5eSPeter Ujfalusi 
5868608b5eSPeter Ujfalusi #define TI_SCI_MSG_RM_UDMAP_TX_ALLOC		0x1200
5968608b5eSPeter Ujfalusi #define TI_SCI_MSG_RM_UDMAP_TX_FREE		0x1201
6068608b5eSPeter Ujfalusi #define TI_SCI_MSG_RM_UDMAP_RX_ALLOC		0x1210
6168608b5eSPeter Ujfalusi #define TI_SCI_MSG_RM_UDMAP_RX_FREE		0x1211
6268608b5eSPeter Ujfalusi #define TI_SCI_MSG_RM_UDMAP_FLOW_CFG		0x1220
6368608b5eSPeter Ujfalusi #define TI_SCI_MSG_RM_UDMAP_OPT_FLOW_CFG	0x1221
6468608b5eSPeter Ujfalusi 
6568608b5eSPeter Ujfalusi #define TISCI_MSG_RM_UDMAP_TX_CH_CFG		0x1205
6668608b5eSPeter Ujfalusi #define TISCI_MSG_RM_UDMAP_TX_CH_GET_CFG	0x1206
6768608b5eSPeter Ujfalusi #define TISCI_MSG_RM_UDMAP_RX_CH_CFG		0x1215
6868608b5eSPeter Ujfalusi #define TISCI_MSG_RM_UDMAP_RX_CH_GET_CFG	0x1216
6968608b5eSPeter Ujfalusi #define TISCI_MSG_RM_UDMAP_FLOW_CFG		0x1230
7068608b5eSPeter Ujfalusi #define TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_CFG	0x1231
7168608b5eSPeter Ujfalusi #define TISCI_MSG_RM_UDMAP_FLOW_GET_CFG		0x1232
7268608b5eSPeter Ujfalusi #define TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_GET_CFG	0x1233
7368608b5eSPeter Ujfalusi 
741e407f33SSuman Anna /* Processor Control requests */
751e407f33SSuman Anna #define TI_SCI_MSG_PROC_REQUEST		0xc000
761e407f33SSuman Anna #define TI_SCI_MSG_PROC_RELEASE		0xc001
771e407f33SSuman Anna #define TI_SCI_MSG_PROC_HANDOVER	0xc005
781e407f33SSuman Anna #define TI_SCI_MSG_SET_CONFIG		0xc100
791e407f33SSuman Anna #define TI_SCI_MSG_SET_CTRL		0xc101
801e407f33SSuman Anna #define TI_SCI_MSG_GET_STATUS		0xc400
811e407f33SSuman Anna 
82aa276781SNishanth Menon /**
83aa276781SNishanth Menon  * struct ti_sci_msg_hdr - Generic Message Header for All messages and responses
84aa276781SNishanth Menon  * @type:	Type of messages: One of TI_SCI_MSG* values
85aa276781SNishanth Menon  * @host:	Host of the message
86aa276781SNishanth Menon  * @seq:	Message identifier indicating a transfer sequence
87aa276781SNishanth Menon  * @flags:	Flag for the message
88aa276781SNishanth Menon  */
89aa276781SNishanth Menon struct ti_sci_msg_hdr {
90aa276781SNishanth Menon 	u16 type;
91aa276781SNishanth Menon 	u8 host;
92aa276781SNishanth Menon 	u8 seq;
93aa276781SNishanth Menon #define TI_SCI_MSG_FLAG(val)			(1 << (val))
94aa276781SNishanth Menon #define TI_SCI_FLAG_REQ_GENERIC_NORESPONSE	0x0
95aa276781SNishanth Menon #define TI_SCI_FLAG_REQ_ACK_ON_RECEIVED		TI_SCI_MSG_FLAG(0)
96aa276781SNishanth Menon #define TI_SCI_FLAG_REQ_ACK_ON_PROCESSED	TI_SCI_MSG_FLAG(1)
97aa276781SNishanth Menon #define TI_SCI_FLAG_RESP_GENERIC_NACK		0x0
98aa276781SNishanth Menon #define TI_SCI_FLAG_RESP_GENERIC_ACK		TI_SCI_MSG_FLAG(1)
99aa276781SNishanth Menon 	/* Additional Flags */
100aa276781SNishanth Menon 	u32 flags;
101aa276781SNishanth Menon } __packed;
102aa276781SNishanth Menon 
103aa276781SNishanth Menon /**
104aa276781SNishanth Menon  * struct ti_sci_msg_resp_version - Response for a message
105aa276781SNishanth Menon  * @hdr:		Generic header
106aa276781SNishanth Menon  * @firmware_description: String describing the firmware
107aa276781SNishanth Menon  * @firmware_revision:	Firmware revision
108aa276781SNishanth Menon  * @abi_major:		Major version of the ABI that firmware supports
109aa276781SNishanth Menon  * @abi_minor:		Minor version of the ABI that firmware supports
110aa276781SNishanth Menon  *
111aa276781SNishanth Menon  * In general, ABI version changes follow the rule that minor version increments
112aa276781SNishanth Menon  * are backward compatible. Major revision changes in ABI may not be
113aa276781SNishanth Menon  * backward compatible.
114aa276781SNishanth Menon  *
115aa276781SNishanth Menon  * Response to a generic message with message type TI_SCI_MSG_VERSION
116aa276781SNishanth Menon  */
117aa276781SNishanth Menon struct ti_sci_msg_resp_version {
118aa276781SNishanth Menon 	struct ti_sci_msg_hdr hdr;
119aa276781SNishanth Menon 	char firmware_description[32];
120aa276781SNishanth Menon 	u16 firmware_revision;
121aa276781SNishanth Menon 	u8 abi_major;
122aa276781SNishanth Menon 	u8 abi_minor;
123aa276781SNishanth Menon } __packed;
124aa276781SNishanth Menon 
1259e7d756dSNishanth Menon /**
126912cffb4SNishanth Menon  * struct ti_sci_msg_req_reboot - Reboot the SoC
127912cffb4SNishanth Menon  * @hdr:	Generic Header
128912cffb4SNishanth Menon  *
129912cffb4SNishanth Menon  * Request type is TI_SCI_MSG_SYS_RESET, responded with a generic
130912cffb4SNishanth Menon  * ACK/NACK message.
131912cffb4SNishanth Menon  */
132912cffb4SNishanth Menon struct ti_sci_msg_req_reboot {
133912cffb4SNishanth Menon 	struct ti_sci_msg_hdr hdr;
134912cffb4SNishanth Menon } __packed;
135912cffb4SNishanth Menon 
136912cffb4SNishanth Menon /**
1379e7d756dSNishanth Menon  * struct ti_sci_msg_req_set_device_state - Set the desired state of the device
1389e7d756dSNishanth Menon  * @hdr:		Generic header
1399e7d756dSNishanth Menon  * @id:	Indicates which device to modify
1409e7d756dSNishanth Menon  * @reserved: Reserved space in message, must be 0 for backward compatibility
1419e7d756dSNishanth Menon  * @state: The desired state of the device.
1429e7d756dSNishanth Menon  *
1439e7d756dSNishanth Menon  * Certain flags can also be set to alter the device state:
1449e7d756dSNishanth Menon  * + MSG_FLAG_DEVICE_WAKE_ENABLED - Configure the device to be a wake source.
1459e7d756dSNishanth Menon  * The meaning of this flag will vary slightly from device to device and from
1469e7d756dSNishanth Menon  * SoC to SoC but it generally allows the device to wake the SoC out of deep
1479e7d756dSNishanth Menon  * suspend states.
1489e7d756dSNishanth Menon  * + MSG_FLAG_DEVICE_RESET_ISO - Enable reset isolation for this device.
1499e7d756dSNishanth Menon  * + MSG_FLAG_DEVICE_EXCLUSIVE - Claim this device exclusively. When passed
1509e7d756dSNishanth Menon  * with STATE_RETENTION or STATE_ON, it will claim the device exclusively.
1519e7d756dSNishanth Menon  * If another host already has this device set to STATE_RETENTION or STATE_ON,
1529e7d756dSNishanth Menon  * the message will fail. Once successful, other hosts attempting to set
1539e7d756dSNishanth Menon  * STATE_RETENTION or STATE_ON will fail.
1549e7d756dSNishanth Menon  *
1559e7d756dSNishanth Menon  * Request type is TI_SCI_MSG_SET_DEVICE_STATE, responded with a generic
1569e7d756dSNishanth Menon  * ACK/NACK message.
1579e7d756dSNishanth Menon  */
1589e7d756dSNishanth Menon struct ti_sci_msg_req_set_device_state {
1599e7d756dSNishanth Menon 	/* Additional hdr->flags options */
1609e7d756dSNishanth Menon #define MSG_FLAG_DEVICE_WAKE_ENABLED	TI_SCI_MSG_FLAG(8)
1619e7d756dSNishanth Menon #define MSG_FLAG_DEVICE_RESET_ISO	TI_SCI_MSG_FLAG(9)
1629e7d756dSNishanth Menon #define MSG_FLAG_DEVICE_EXCLUSIVE	TI_SCI_MSG_FLAG(10)
1639e7d756dSNishanth Menon 	struct ti_sci_msg_hdr hdr;
1649e7d756dSNishanth Menon 	u32 id;
1659e7d756dSNishanth Menon 	u32 reserved;
1669e7d756dSNishanth Menon 
1679e7d756dSNishanth Menon #define MSG_DEVICE_SW_STATE_AUTO_OFF	0
1689e7d756dSNishanth Menon #define MSG_DEVICE_SW_STATE_RETENTION	1
1699e7d756dSNishanth Menon #define MSG_DEVICE_SW_STATE_ON		2
1709e7d756dSNishanth Menon 	u8 state;
1719e7d756dSNishanth Menon } __packed;
1729e7d756dSNishanth Menon 
1739e7d756dSNishanth Menon /**
1749e7d756dSNishanth Menon  * struct ti_sci_msg_req_get_device_state - Request to get device.
1759e7d756dSNishanth Menon  * @hdr:		Generic header
1769e7d756dSNishanth Menon  * @id:		Device Identifier
1779e7d756dSNishanth Menon  *
1789e7d756dSNishanth Menon  * Request type is TI_SCI_MSG_GET_DEVICE_STATE, responded device state
1799e7d756dSNishanth Menon  * information
1809e7d756dSNishanth Menon  */
1819e7d756dSNishanth Menon struct ti_sci_msg_req_get_device_state {
1829e7d756dSNishanth Menon 	struct ti_sci_msg_hdr hdr;
1839e7d756dSNishanth Menon 	u32 id;
1849e7d756dSNishanth Menon } __packed;
1859e7d756dSNishanth Menon 
1869e7d756dSNishanth Menon /**
1879e7d756dSNishanth Menon  * struct ti_sci_msg_resp_get_device_state - Response to get device request.
1889e7d756dSNishanth Menon  * @hdr:		Generic header
1899e7d756dSNishanth Menon  * @context_loss_count: Indicates how many times the device has lost context. A
1909e7d756dSNishanth Menon  *	driver can use this monotonic counter to determine if the device has
1919e7d756dSNishanth Menon  *	lost context since the last time this message was exchanged.
1929e7d756dSNishanth Menon  * @resets: Programmed state of the reset lines.
1939e7d756dSNishanth Menon  * @programmed_state:	The state as programmed by set_device.
1949e7d756dSNishanth Menon  *			- Uses the MSG_DEVICE_SW_* macros
1959e7d756dSNishanth Menon  * @current_state:	The actual state of the hardware.
1969e7d756dSNishanth Menon  *
1979e7d756dSNishanth Menon  * Response to request TI_SCI_MSG_GET_DEVICE_STATE.
1989e7d756dSNishanth Menon  */
1999e7d756dSNishanth Menon struct ti_sci_msg_resp_get_device_state {
2009e7d756dSNishanth Menon 	struct ti_sci_msg_hdr hdr;
2019e7d756dSNishanth Menon 	u32 context_loss_count;
2029e7d756dSNishanth Menon 	u32 resets;
2039e7d756dSNishanth Menon 	u8 programmed_state;
2049e7d756dSNishanth Menon #define MSG_DEVICE_HW_STATE_OFF		0
2059e7d756dSNishanth Menon #define MSG_DEVICE_HW_STATE_ON		1
2069e7d756dSNishanth Menon #define MSG_DEVICE_HW_STATE_TRANS	2
2079e7d756dSNishanth Menon 	u8 current_state;
2089e7d756dSNishanth Menon } __packed;
2099e7d756dSNishanth Menon 
2109e7d756dSNishanth Menon /**
2119e7d756dSNishanth Menon  * struct ti_sci_msg_req_set_device_resets - Set the desired resets
2129e7d756dSNishanth Menon  *				configuration of the device
2139e7d756dSNishanth Menon  * @hdr:		Generic header
2149e7d756dSNishanth Menon  * @id:	Indicates which device to modify
2159e7d756dSNishanth Menon  * @resets: A bit field of resets for the device. The meaning, behavior,
2169e7d756dSNishanth Menon  *	and usage of the reset flags are device specific. 0 for a bit
2179e7d756dSNishanth Menon  *	indicates releasing the reset represented by that bit while 1
2189e7d756dSNishanth Menon  *	indicates keeping it held.
2199e7d756dSNishanth Menon  *
2209e7d756dSNishanth Menon  * Request type is TI_SCI_MSG_SET_DEVICE_RESETS, responded with a generic
2219e7d756dSNishanth Menon  * ACK/NACK message.
2229e7d756dSNishanth Menon  */
2239e7d756dSNishanth Menon struct ti_sci_msg_req_set_device_resets {
2249e7d756dSNishanth Menon 	struct ti_sci_msg_hdr hdr;
2259e7d756dSNishanth Menon 	u32 id;
2269e7d756dSNishanth Menon 	u32 resets;
2279e7d756dSNishanth Menon } __packed;
2289e7d756dSNishanth Menon 
2299f723220SNishanth Menon /**
2309f723220SNishanth Menon  * struct ti_sci_msg_req_set_clock_state - Request to setup a Clock state
2319f723220SNishanth Menon  * @hdr:	Generic Header, Certain flags can be set specific to the clocks:
2329f723220SNishanth Menon  *		MSG_FLAG_CLOCK_ALLOW_SSC: Allow this clock to be modified
2339f723220SNishanth Menon  *		via spread spectrum clocking.
2349f723220SNishanth Menon  *		MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE: Allow this clock's
2359f723220SNishanth Menon  *		frequency to be changed while it is running so long as it
2369f723220SNishanth Menon  *		is within the min/max limits.
2379f723220SNishanth Menon  *		MSG_FLAG_CLOCK_INPUT_TERM: Enable input termination, this
2389f723220SNishanth Menon  *		is only applicable to clock inputs on the SoC pseudo-device.
2399f723220SNishanth Menon  * @dev_id:	Device identifier this request is for
2409f723220SNishanth Menon  * @clk_id:	Clock identifier for the device for this request.
2419f723220SNishanth Menon  *		Each device has it's own set of clock inputs. This indexes
24281f4458cSTero Kristo  *		which clock input to modify. Set to 255 if clock ID is
24381f4458cSTero Kristo  *		greater than or equal to 255.
2449f723220SNishanth Menon  * @request_state: Request the state for the clock to be set to.
2459f723220SNishanth Menon  *		MSG_CLOCK_SW_STATE_UNREQ: The IP does not require this clock,
2469f723220SNishanth Menon  *		it can be disabled, regardless of the state of the device
2479f723220SNishanth Menon  *		MSG_CLOCK_SW_STATE_AUTO: Allow the System Controller to
2489f723220SNishanth Menon  *		automatically manage the state of this clock. If the device
2499f723220SNishanth Menon  *		is enabled, then the clock is enabled. If the device is set
2509f723220SNishanth Menon  *		to off or retention, then the clock is internally set as not
2519f723220SNishanth Menon  *		being required by the device.(default)
2529f723220SNishanth Menon  *		MSG_CLOCK_SW_STATE_REQ:  Configure the clock to be enabled,
2539f723220SNishanth Menon  *		regardless of the state of the device.
25481f4458cSTero Kristo  * @clk_id_32:	Clock identifier for the device for this request.
25581f4458cSTero Kristo  *		Only to be used if the clock ID is greater than or equal to
25681f4458cSTero Kristo  *		255.
2579f723220SNishanth Menon  *
2589f723220SNishanth Menon  * Normally, all required clocks are managed by TISCI entity, this is used
2599f723220SNishanth Menon  * only for specific control *IF* required. Auto managed state is
2609f723220SNishanth Menon  * MSG_CLOCK_SW_STATE_AUTO, in other states, TISCI entity assume remote
2619f723220SNishanth Menon  * will explicitly control.
2629f723220SNishanth Menon  *
2639f723220SNishanth Menon  * Request type is TI_SCI_MSG_SET_CLOCK_STATE, response is a generic
2649f723220SNishanth Menon  * ACK or NACK message.
2659f723220SNishanth Menon  */
2669f723220SNishanth Menon struct ti_sci_msg_req_set_clock_state {
2679f723220SNishanth Menon 	/* Additional hdr->flags options */
2689f723220SNishanth Menon #define MSG_FLAG_CLOCK_ALLOW_SSC		TI_SCI_MSG_FLAG(8)
2699f723220SNishanth Menon #define MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE	TI_SCI_MSG_FLAG(9)
2709f723220SNishanth Menon #define MSG_FLAG_CLOCK_INPUT_TERM		TI_SCI_MSG_FLAG(10)
2719f723220SNishanth Menon 	struct ti_sci_msg_hdr hdr;
2729f723220SNishanth Menon 	u32 dev_id;
2739f723220SNishanth Menon 	u8 clk_id;
2749f723220SNishanth Menon #define MSG_CLOCK_SW_STATE_UNREQ	0
2759f723220SNishanth Menon #define MSG_CLOCK_SW_STATE_AUTO		1
2769f723220SNishanth Menon #define MSG_CLOCK_SW_STATE_REQ		2
2779f723220SNishanth Menon 	u8 request_state;
27881f4458cSTero Kristo 	u32 clk_id_32;
2799f723220SNishanth Menon } __packed;
2809f723220SNishanth Menon 
2819f723220SNishanth Menon /**
2829f723220SNishanth Menon  * struct ti_sci_msg_req_get_clock_state - Request for clock state
2839f723220SNishanth Menon  * @hdr:	Generic Header
2849f723220SNishanth Menon  * @dev_id:	Device identifier this request is for
2859f723220SNishanth Menon  * @clk_id:	Clock identifier for the device for this request.
2869f723220SNishanth Menon  *		Each device has it's own set of clock inputs. This indexes
28781f4458cSTero Kristo  *		which clock input to get state of. Set to 255 if the clock
28881f4458cSTero Kristo  *		ID is greater than or equal to 255.
28981f4458cSTero Kristo  * @clk_id_32:	Clock identifier for the device for the request.
29081f4458cSTero Kristo  *		Only to be used if the clock ID is greater than or equal to
29181f4458cSTero Kristo  *		255.
2929f723220SNishanth Menon  *
2939f723220SNishanth Menon  * Request type is TI_SCI_MSG_GET_CLOCK_STATE, response is state
2949f723220SNishanth Menon  * of the clock
2959f723220SNishanth Menon  */
2969f723220SNishanth Menon struct ti_sci_msg_req_get_clock_state {
2979f723220SNishanth Menon 	struct ti_sci_msg_hdr hdr;
2989f723220SNishanth Menon 	u32 dev_id;
2999f723220SNishanth Menon 	u8 clk_id;
30081f4458cSTero Kristo 	u32 clk_id_32;
3019f723220SNishanth Menon } __packed;
3029f723220SNishanth Menon 
3039f723220SNishanth Menon /**
3049f723220SNishanth Menon  * struct ti_sci_msg_resp_get_clock_state - Response to get clock state
3059f723220SNishanth Menon  * @hdr:	Generic Header
3069f723220SNishanth Menon  * @programmed_state: Any programmed state of the clock. This is one of
3079f723220SNishanth Menon  *		MSG_CLOCK_SW_STATE* values.
3089f723220SNishanth Menon  * @current_state: Current state of the clock. This is one of:
3099f723220SNishanth Menon  *		MSG_CLOCK_HW_STATE_NOT_READY: Clock is not ready
3109f723220SNishanth Menon  *		MSG_CLOCK_HW_STATE_READY: Clock is ready
3119f723220SNishanth Menon  *
3129f723220SNishanth Menon  * Response to TI_SCI_MSG_GET_CLOCK_STATE.
3139f723220SNishanth Menon  */
3149f723220SNishanth Menon struct ti_sci_msg_resp_get_clock_state {
3159f723220SNishanth Menon 	struct ti_sci_msg_hdr hdr;
3169f723220SNishanth Menon 	u8 programmed_state;
3179f723220SNishanth Menon #define MSG_CLOCK_HW_STATE_NOT_READY	0
3189f723220SNishanth Menon #define MSG_CLOCK_HW_STATE_READY	1
3199f723220SNishanth Menon 	u8 current_state;
3209f723220SNishanth Menon } __packed;
3219f723220SNishanth Menon 
3229f723220SNishanth Menon /**
3239f723220SNishanth Menon  * struct ti_sci_msg_req_set_clock_parent - Set the clock parent
3249f723220SNishanth Menon  * @hdr:	Generic Header
3259f723220SNishanth Menon  * @dev_id:	Device identifier this request is for
3269f723220SNishanth Menon  * @clk_id:	Clock identifier for the device for this request.
3279f723220SNishanth Menon  *		Each device has it's own set of clock inputs. This indexes
32881f4458cSTero Kristo  *		which clock input to modify. Set to 255 if clock ID is
32981f4458cSTero Kristo  *		greater than or equal to 255.
3309f723220SNishanth Menon  * @parent_id:	The new clock parent is selectable by an index via this
33181f4458cSTero Kristo  *		parameter. Set to 255 if clock ID is greater than or
33281f4458cSTero Kristo  *		equal to 255.
33381f4458cSTero Kristo  * @clk_id_32:	Clock identifier if @clk_id field is 255.
33481f4458cSTero Kristo  * @parent_id_32:	Parent identifier if @parent_id is 255.
3359f723220SNishanth Menon  *
3369f723220SNishanth Menon  * Request type is TI_SCI_MSG_SET_CLOCK_PARENT, response is generic
3379f723220SNishanth Menon  * ACK / NACK message.
3389f723220SNishanth Menon  */
3399f723220SNishanth Menon struct ti_sci_msg_req_set_clock_parent {
3409f723220SNishanth Menon 	struct ti_sci_msg_hdr hdr;
3419f723220SNishanth Menon 	u32 dev_id;
3429f723220SNishanth Menon 	u8 clk_id;
3439f723220SNishanth Menon 	u8 parent_id;
34481f4458cSTero Kristo 	u32 clk_id_32;
34581f4458cSTero Kristo 	u32 parent_id_32;
3469f723220SNishanth Menon } __packed;
3479f723220SNishanth Menon 
3489f723220SNishanth Menon /**
3499f723220SNishanth Menon  * struct ti_sci_msg_req_get_clock_parent - Get the clock parent
3509f723220SNishanth Menon  * @hdr:	Generic Header
3519f723220SNishanth Menon  * @dev_id:	Device identifier this request is for
3529f723220SNishanth Menon  * @clk_id:	Clock identifier for the device for this request.
3539f723220SNishanth Menon  *		Each device has it's own set of clock inputs. This indexes
35481f4458cSTero Kristo  *		which clock input to get the parent for. If this field
35581f4458cSTero Kristo  *		contains 255, the actual clock identifier is stored in
35681f4458cSTero Kristo  *		@clk_id_32.
35781f4458cSTero Kristo  * @clk_id_32:	Clock identifier if the @clk_id field contains 255.
3589f723220SNishanth Menon  *
3599f723220SNishanth Menon  * Request type is TI_SCI_MSG_GET_CLOCK_PARENT, response is parent information
3609f723220SNishanth Menon  */
3619f723220SNishanth Menon struct ti_sci_msg_req_get_clock_parent {
3629f723220SNishanth Menon 	struct ti_sci_msg_hdr hdr;
3639f723220SNishanth Menon 	u32 dev_id;
3649f723220SNishanth Menon 	u8 clk_id;
36581f4458cSTero Kristo 	u32 clk_id_32;
3669f723220SNishanth Menon } __packed;
3679f723220SNishanth Menon 
3689f723220SNishanth Menon /**
3699f723220SNishanth Menon  * struct ti_sci_msg_resp_get_clock_parent - Response with clock parent
3709f723220SNishanth Menon  * @hdr:	Generic Header
37181f4458cSTero Kristo  * @parent_id:	The current clock parent. If set to 255, the current parent
37281f4458cSTero Kristo  *		ID can be found from the @parent_id_32 field.
37381f4458cSTero Kristo  * @parent_id_32:	Current clock parent if @parent_id field is set to
37481f4458cSTero Kristo  *			255.
3759f723220SNishanth Menon  *
3769f723220SNishanth Menon  * Response to TI_SCI_MSG_GET_CLOCK_PARENT.
3779f723220SNishanth Menon  */
3789f723220SNishanth Menon struct ti_sci_msg_resp_get_clock_parent {
3799f723220SNishanth Menon 	struct ti_sci_msg_hdr hdr;
3809f723220SNishanth Menon 	u8 parent_id;
38181f4458cSTero Kristo 	u32 parent_id_32;
3829f723220SNishanth Menon } __packed;
3839f723220SNishanth Menon 
3849f723220SNishanth Menon /**
3859f723220SNishanth Menon  * struct ti_sci_msg_req_get_clock_num_parents - Request to get clock parents
3869f723220SNishanth Menon  * @hdr:	Generic header
3879f723220SNishanth Menon  * @dev_id:	Device identifier this request is for
38881f4458cSTero Kristo  * @clk_id:	Clock identifier for the device for this request. Set to
38981f4458cSTero Kristo  *		255 if clock ID is greater than or equal to 255.
39081f4458cSTero Kristo  * @clk_id_32:	Clock identifier if the @clk_id field contains 255.
3919f723220SNishanth Menon  *
3929f723220SNishanth Menon  * This request provides information about how many clock parent options
3939f723220SNishanth Menon  * are available for a given clock to a device. This is typically used
3949f723220SNishanth Menon  * for input clocks.
3959f723220SNishanth Menon  *
3969f723220SNishanth Menon  * Request type is TI_SCI_MSG_GET_NUM_CLOCK_PARENTS, response is appropriate
3979f723220SNishanth Menon  * message, or NACK in case of inability to satisfy request.
3989f723220SNishanth Menon  */
3999f723220SNishanth Menon struct ti_sci_msg_req_get_clock_num_parents {
4009f723220SNishanth Menon 	struct ti_sci_msg_hdr hdr;
4019f723220SNishanth Menon 	u32 dev_id;
4029f723220SNishanth Menon 	u8 clk_id;
40381f4458cSTero Kristo 	u32 clk_id_32;
4049f723220SNishanth Menon } __packed;
4059f723220SNishanth Menon 
4069f723220SNishanth Menon /**
4079f723220SNishanth Menon  * struct ti_sci_msg_resp_get_clock_num_parents - Response for get clk parents
4089f723220SNishanth Menon  * @hdr:		Generic header
40981f4458cSTero Kristo  * @num_parents:	Number of clock parents. If set to 255, the actual
41081f4458cSTero Kristo  *			number of parents is stored into @num_parents_32
41181f4458cSTero Kristo  *			field instead.
41281f4458cSTero Kristo  * @num_parents_32:	Number of clock parents if @num_parents field is
41381f4458cSTero Kristo  *			set to 255.
4149f723220SNishanth Menon  *
4159f723220SNishanth Menon  * Response to TI_SCI_MSG_GET_NUM_CLOCK_PARENTS
4169f723220SNishanth Menon  */
4179f723220SNishanth Menon struct ti_sci_msg_resp_get_clock_num_parents {
4189f723220SNishanth Menon 	struct ti_sci_msg_hdr hdr;
4199f723220SNishanth Menon 	u8 num_parents;
42081f4458cSTero Kristo 	u32 num_parents_32;
4219f723220SNishanth Menon } __packed;
4229f723220SNishanth Menon 
4239f723220SNishanth Menon /**
4249f723220SNishanth Menon  * struct ti_sci_msg_req_query_clock_freq - Request to query a frequency
4259f723220SNishanth Menon  * @hdr:	Generic Header
4269f723220SNishanth Menon  * @dev_id:	Device identifier this request is for
4279f723220SNishanth Menon  * @min_freq_hz: The minimum allowable frequency in Hz. This is the minimum
4289f723220SNishanth Menon  *		allowable programmed frequency and does not account for clock
4299f723220SNishanth Menon  *		tolerances and jitter.
4309f723220SNishanth Menon  * @target_freq_hz: The target clock frequency. A frequency will be found
4319f723220SNishanth Menon  *		as close to this target frequency as possible.
4329f723220SNishanth Menon  * @max_freq_hz: The maximum allowable frequency in Hz. This is the maximum
4339f723220SNishanth Menon  *		allowable programmed frequency and does not account for clock
4349f723220SNishanth Menon  *		tolerances and jitter.
43581f4458cSTero Kristo  * @clk_id:	Clock identifier for the device for this request. Set to
43681f4458cSTero Kristo  *		255 if clock identifier is greater than or equal to 255.
43781f4458cSTero Kristo  * @clk_id_32:	Clock identifier if @clk_id is set to 255.
4389f723220SNishanth Menon  *
4399f723220SNishanth Menon  * NOTE: Normally clock frequency management is automatically done by TISCI
4409f723220SNishanth Menon  * entity. In case of specific requests, TISCI evaluates capability to achieve
4419f723220SNishanth Menon  * requested frequency within provided range and responds with
4429f723220SNishanth Menon  * result message.
4439f723220SNishanth Menon  *
4449f723220SNishanth Menon  * Request type is TI_SCI_MSG_QUERY_CLOCK_FREQ, response is appropriate message,
4459f723220SNishanth Menon  * or NACK in case of inability to satisfy request.
4469f723220SNishanth Menon  */
4479f723220SNishanth Menon struct ti_sci_msg_req_query_clock_freq {
4489f723220SNishanth Menon 	struct ti_sci_msg_hdr hdr;
4499f723220SNishanth Menon 	u32 dev_id;
4509f723220SNishanth Menon 	u64 min_freq_hz;
4519f723220SNishanth Menon 	u64 target_freq_hz;
4529f723220SNishanth Menon 	u64 max_freq_hz;
4539f723220SNishanth Menon 	u8 clk_id;
45481f4458cSTero Kristo 	u32 clk_id_32;
4559f723220SNishanth Menon } __packed;
4569f723220SNishanth Menon 
4579f723220SNishanth Menon /**
4589f723220SNishanth Menon  * struct ti_sci_msg_resp_query_clock_freq - Response to a clock frequency query
4599f723220SNishanth Menon  * @hdr:	Generic Header
4609f723220SNishanth Menon  * @freq_hz:	Frequency that is the best match in Hz.
4619f723220SNishanth Menon  *
4629f723220SNishanth Menon  * Response to request type TI_SCI_MSG_QUERY_CLOCK_FREQ. NOTE: if the request
4639f723220SNishanth Menon  * cannot be satisfied, the message will be of type NACK.
4649f723220SNishanth Menon  */
4659f723220SNishanth Menon struct ti_sci_msg_resp_query_clock_freq {
4669f723220SNishanth Menon 	struct ti_sci_msg_hdr hdr;
4679f723220SNishanth Menon 	u64 freq_hz;
4689f723220SNishanth Menon } __packed;
4699f723220SNishanth Menon 
4709f723220SNishanth Menon /**
4719f723220SNishanth Menon  * struct ti_sci_msg_req_set_clock_freq - Request to setup a clock frequency
4729f723220SNishanth Menon  * @hdr:	Generic Header
4739f723220SNishanth Menon  * @dev_id:	Device identifier this request is for
4749f723220SNishanth Menon  * @min_freq_hz: The minimum allowable frequency in Hz. This is the minimum
4759f723220SNishanth Menon  *		allowable programmed frequency and does not account for clock
4769f723220SNishanth Menon  *		tolerances and jitter.
4779f723220SNishanth Menon  * @target_freq_hz: The target clock frequency. The clock will be programmed
4789f723220SNishanth Menon  *		at a rate as close to this target frequency as possible.
4799f723220SNishanth Menon  * @max_freq_hz: The maximum allowable frequency in Hz. This is the maximum
4809f723220SNishanth Menon  *		allowable programmed frequency and does not account for clock
4819f723220SNishanth Menon  *		tolerances and jitter.
48281f4458cSTero Kristo  * @clk_id:	Clock identifier for the device for this request. Set to
48381f4458cSTero Kristo  *		255 if clock ID is greater than or equal to 255.
48481f4458cSTero Kristo  * @clk_id_32:	Clock identifier if @clk_id field is set to 255.
4859f723220SNishanth Menon  *
4869f723220SNishanth Menon  * NOTE: Normally clock frequency management is automatically done by TISCI
4879f723220SNishanth Menon  * entity. In case of specific requests, TISCI evaluates capability to achieve
4889f723220SNishanth Menon  * requested range and responds with success/failure message.
4899f723220SNishanth Menon  *
4909f723220SNishanth Menon  * This sets the desired frequency for a clock within an allowable
4919f723220SNishanth Menon  * range. This message will fail on an enabled clock unless
4929f723220SNishanth Menon  * MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE is set for the clock. Additionally,
4939f723220SNishanth Menon  * if other clocks have their frequency modified due to this message,
4949f723220SNishanth Menon  * they also must have the MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE or be disabled.
4959f723220SNishanth Menon  *
4969f723220SNishanth Menon  * Calling set frequency on a clock input to the SoC pseudo-device will
4979f723220SNishanth Menon  * inform the PMMC of that clock's frequency. Setting a frequency of
4989f723220SNishanth Menon  * zero will indicate the clock is disabled.
4999f723220SNishanth Menon  *
5009f723220SNishanth Menon  * Calling set frequency on clock outputs from the SoC pseudo-device will
5019f723220SNishanth Menon  * function similarly to setting the clock frequency on a device.
5029f723220SNishanth Menon  *
5039f723220SNishanth Menon  * Request type is TI_SCI_MSG_SET_CLOCK_FREQ, response is a generic ACK/NACK
5049f723220SNishanth Menon  * message.
5059f723220SNishanth Menon  */
5069f723220SNishanth Menon struct ti_sci_msg_req_set_clock_freq {
5079f723220SNishanth Menon 	struct ti_sci_msg_hdr hdr;
5089f723220SNishanth Menon 	u32 dev_id;
5099f723220SNishanth Menon 	u64 min_freq_hz;
5109f723220SNishanth Menon 	u64 target_freq_hz;
5119f723220SNishanth Menon 	u64 max_freq_hz;
5129f723220SNishanth Menon 	u8 clk_id;
51381f4458cSTero Kristo 	u32 clk_id_32;
5149f723220SNishanth Menon } __packed;
5159f723220SNishanth Menon 
5169f723220SNishanth Menon /**
5179f723220SNishanth Menon  * struct ti_sci_msg_req_get_clock_freq - Request to get the clock frequency
5189f723220SNishanth Menon  * @hdr:	Generic Header
5199f723220SNishanth Menon  * @dev_id:	Device identifier this request is for
52081f4458cSTero Kristo  * @clk_id:	Clock identifier for the device for this request. Set to
52181f4458cSTero Kristo  *		255 if clock ID is greater than or equal to 255.
52281f4458cSTero Kristo  * @clk_id_32:	Clock identifier if @clk_id field is set to 255.
5239f723220SNishanth Menon  *
5249f723220SNishanth Menon  * NOTE: Normally clock frequency management is automatically done by TISCI
5259f723220SNishanth Menon  * entity. In some cases, clock frequencies are configured by host.
5269f723220SNishanth Menon  *
5279f723220SNishanth Menon  * Request type is TI_SCI_MSG_GET_CLOCK_FREQ, responded with clock frequency
5289f723220SNishanth Menon  * that the clock is currently at.
5299f723220SNishanth Menon  */
5309f723220SNishanth Menon struct ti_sci_msg_req_get_clock_freq {
5319f723220SNishanth Menon 	struct ti_sci_msg_hdr hdr;
5329f723220SNishanth Menon 	u32 dev_id;
5339f723220SNishanth Menon 	u8 clk_id;
53481f4458cSTero Kristo 	u32 clk_id_32;
5359f723220SNishanth Menon } __packed;
5369f723220SNishanth Menon 
5379f723220SNishanth Menon /**
5389f723220SNishanth Menon  * struct ti_sci_msg_resp_get_clock_freq - Response of clock frequency request
5399f723220SNishanth Menon  * @hdr:	Generic Header
5409f723220SNishanth Menon  * @freq_hz:	Frequency that the clock is currently on, in Hz.
5419f723220SNishanth Menon  *
5429f723220SNishanth Menon  * Response to request type TI_SCI_MSG_GET_CLOCK_FREQ.
5439f723220SNishanth Menon  */
5449f723220SNishanth Menon struct ti_sci_msg_resp_get_clock_freq {
5459f723220SNishanth Menon 	struct ti_sci_msg_hdr hdr;
5469f723220SNishanth Menon 	u64 freq_hz;
5479f723220SNishanth Menon } __packed;
5489f723220SNishanth Menon 
5499c19fb68SLokesh Vutla #define TI_SCI_IRQ_SECONDARY_HOST_INVALID	0xff
5509c19fb68SLokesh Vutla 
5519c19fb68SLokesh Vutla /**
5529c19fb68SLokesh Vutla  * struct ti_sci_msg_req_get_resource_range - Request to get a host's assigned
5539c19fb68SLokesh Vutla  *					      range of resources.
5549c19fb68SLokesh Vutla  * @hdr:		Generic Header
5559c19fb68SLokesh Vutla  * @type:		Unique resource assignment type
5569c19fb68SLokesh Vutla  * @subtype:		Resource assignment subtype within the resource type.
5579c19fb68SLokesh Vutla  * @secondary_host:	Host processing entity to which the resources are
5589c19fb68SLokesh Vutla  *			allocated. This is required only when the destination
5599c19fb68SLokesh Vutla  *			host id id different from ti sci interface host id,
5609c19fb68SLokesh Vutla  *			else TI_SCI_IRQ_SECONDARY_HOST_INVALID can be passed.
5619c19fb68SLokesh Vutla  *
5629c19fb68SLokesh Vutla  * Request type is TI_SCI_MSG_GET_RESOURCE_RANGE. Responded with requested
5639c19fb68SLokesh Vutla  * resource range which is of type TI_SCI_MSG_GET_RESOURCE_RANGE.
5649c19fb68SLokesh Vutla  */
5659c19fb68SLokesh Vutla struct ti_sci_msg_req_get_resource_range {
5669c19fb68SLokesh Vutla 	struct ti_sci_msg_hdr hdr;
5679c19fb68SLokesh Vutla #define MSG_RM_RESOURCE_TYPE_MASK	GENMASK(9, 0)
5689c19fb68SLokesh Vutla #define MSG_RM_RESOURCE_SUBTYPE_MASK	GENMASK(5, 0)
5699c19fb68SLokesh Vutla 	u16 type;
5709c19fb68SLokesh Vutla 	u8 subtype;
5719c19fb68SLokesh Vutla 	u8 secondary_host;
5729c19fb68SLokesh Vutla } __packed;
5739c19fb68SLokesh Vutla 
5749c19fb68SLokesh Vutla /**
5759c19fb68SLokesh Vutla  * struct ti_sci_msg_resp_get_resource_range - Response to resource get range.
5769c19fb68SLokesh Vutla  * @hdr:		Generic Header
5779c19fb68SLokesh Vutla  * @range_start:	Start index of the resource range.
5789c19fb68SLokesh Vutla  * @range_num:		Number of resources in the range.
5799c19fb68SLokesh Vutla  *
5809c19fb68SLokesh Vutla  * Response to request TI_SCI_MSG_GET_RESOURCE_RANGE.
5819c19fb68SLokesh Vutla  */
5829c19fb68SLokesh Vutla struct ti_sci_msg_resp_get_resource_range {
5839c19fb68SLokesh Vutla 	struct ti_sci_msg_hdr hdr;
5849c19fb68SLokesh Vutla 	u16 range_start;
5859c19fb68SLokesh Vutla 	u16 range_num;
5869c19fb68SLokesh Vutla } __packed;
5879c19fb68SLokesh Vutla 
588997b001fSLokesh Vutla /**
589997b001fSLokesh Vutla  * struct ti_sci_msg_req_manage_irq - Request to configure/release the route
590997b001fSLokesh Vutla  *					between the dev and the host.
591997b001fSLokesh Vutla  * @hdr:		Generic Header
592997b001fSLokesh Vutla  * @valid_params:	Bit fields defining the validity of interrupt source
593997b001fSLokesh Vutla  *			parameters. If a bit is not set, then corresponding
594997b001fSLokesh Vutla  *			field is not valid and will not be used for route set.
595997b001fSLokesh Vutla  *			Bit field definitions:
596997b001fSLokesh Vutla  *			0 - Valid bit for @dst_id
597997b001fSLokesh Vutla  *			1 - Valid bit for @dst_host_irq
598997b001fSLokesh Vutla  *			2 - Valid bit for @ia_id
599997b001fSLokesh Vutla  *			3 - Valid bit for @vint
600997b001fSLokesh Vutla  *			4 - Valid bit for @global_event
601997b001fSLokesh Vutla  *			5 - Valid bit for @vint_status_bit_index
602997b001fSLokesh Vutla  *			31 - Valid bit for @secondary_host
603997b001fSLokesh Vutla  * @src_id:		IRQ source peripheral ID.
604997b001fSLokesh Vutla  * @src_index:		IRQ source index within the peripheral
605997b001fSLokesh Vutla  * @dst_id:		IRQ Destination ID. Based on the architecture it can be
606997b001fSLokesh Vutla  *			IRQ controller or host processor ID.
607997b001fSLokesh Vutla  * @dst_host_irq:	IRQ number of the destination host IRQ controller
608997b001fSLokesh Vutla  * @ia_id:		Device ID of the interrupt aggregator in which the
609997b001fSLokesh Vutla  *			vint resides.
610997b001fSLokesh Vutla  * @vint:		Virtual interrupt number if the interrupt route
611997b001fSLokesh Vutla  *			is through an interrupt aggregator.
612997b001fSLokesh Vutla  * @global_event:	Global event that is to be mapped to interrupt
613997b001fSLokesh Vutla  *			aggregator virtual interrupt status bit.
614997b001fSLokesh Vutla  * @vint_status_bit:	Virtual interrupt status bit if the interrupt route
615997b001fSLokesh Vutla  *			utilizes an interrupt aggregator status bit.
616997b001fSLokesh Vutla  * @secondary_host:	Host ID of the IRQ destination computing entity. This is
617997b001fSLokesh Vutla  *			required only when destination host id is different
618997b001fSLokesh Vutla  *			from ti sci interface host id.
619997b001fSLokesh Vutla  *
620997b001fSLokesh Vutla  * Request type is TI_SCI_MSG_SET/RELEASE_IRQ.
621997b001fSLokesh Vutla  * Response is generic ACK / NACK message.
622997b001fSLokesh Vutla  */
623997b001fSLokesh Vutla struct ti_sci_msg_req_manage_irq {
624997b001fSLokesh Vutla 	struct ti_sci_msg_hdr hdr;
625997b001fSLokesh Vutla #define MSG_FLAG_DST_ID_VALID			TI_SCI_MSG_FLAG(0)
626997b001fSLokesh Vutla #define MSG_FLAG_DST_HOST_IRQ_VALID		TI_SCI_MSG_FLAG(1)
627997b001fSLokesh Vutla #define MSG_FLAG_IA_ID_VALID			TI_SCI_MSG_FLAG(2)
628997b001fSLokesh Vutla #define MSG_FLAG_VINT_VALID			TI_SCI_MSG_FLAG(3)
629997b001fSLokesh Vutla #define MSG_FLAG_GLB_EVNT_VALID			TI_SCI_MSG_FLAG(4)
630997b001fSLokesh Vutla #define MSG_FLAG_VINT_STS_BIT_VALID		TI_SCI_MSG_FLAG(5)
631997b001fSLokesh Vutla #define MSG_FLAG_SHOST_VALID			TI_SCI_MSG_FLAG(31)
632997b001fSLokesh Vutla 	u32 valid_params;
633997b001fSLokesh Vutla 	u16 src_id;
634997b001fSLokesh Vutla 	u16 src_index;
635997b001fSLokesh Vutla 	u16 dst_id;
636997b001fSLokesh Vutla 	u16 dst_host_irq;
637997b001fSLokesh Vutla 	u16 ia_id;
638997b001fSLokesh Vutla 	u16 vint;
639997b001fSLokesh Vutla 	u16 global_event;
640997b001fSLokesh Vutla 	u8 vint_status_bit;
641997b001fSLokesh Vutla 	u8 secondary_host;
642997b001fSLokesh Vutla } __packed;
643997b001fSLokesh Vutla 
64468608b5eSPeter Ujfalusi /**
64568608b5eSPeter Ujfalusi  * struct ti_sci_msg_rm_ring_cfg_req - Configure a Navigator Subsystem ring
64668608b5eSPeter Ujfalusi  *
64768608b5eSPeter Ujfalusi  * Configures the non-real-time registers of a Navigator Subsystem ring.
64868608b5eSPeter Ujfalusi  * @hdr:	Generic Header
64968608b5eSPeter Ujfalusi  * @valid_params: Bitfield defining validity of ring configuration parameters.
65068608b5eSPeter Ujfalusi  *	The ring configuration fields are not valid, and will not be used for
65168608b5eSPeter Ujfalusi  *	ring configuration, if their corresponding valid bit is zero.
65268608b5eSPeter Ujfalusi  *	Valid bit usage:
65368608b5eSPeter Ujfalusi  *	0 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_lo
65468608b5eSPeter Ujfalusi  *	1 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_hi
65568608b5eSPeter Ujfalusi  *	2 - Valid bit for @tisci_msg_rm_ring_cfg_req count
65668608b5eSPeter Ujfalusi  *	3 - Valid bit for @tisci_msg_rm_ring_cfg_req mode
65768608b5eSPeter Ujfalusi  *	4 - Valid bit for @tisci_msg_rm_ring_cfg_req size
65868608b5eSPeter Ujfalusi  *	5 - Valid bit for @tisci_msg_rm_ring_cfg_req order_id
65968608b5eSPeter Ujfalusi  * @nav_id: Device ID of Navigator Subsystem from which the ring is allocated
66068608b5eSPeter Ujfalusi  * @index: ring index to be configured.
66168608b5eSPeter Ujfalusi  * @addr_lo: 32 LSBs of ring base address to be programmed into the ring's
66268608b5eSPeter Ujfalusi  *	RING_BA_LO register
66368608b5eSPeter Ujfalusi  * @addr_hi: 16 MSBs of ring base address to be programmed into the ring's
66468608b5eSPeter Ujfalusi  *	RING_BA_HI register.
66568608b5eSPeter Ujfalusi  * @count: Number of ring elements. Must be even if mode is CREDENTIALS or QM
66668608b5eSPeter Ujfalusi  *	modes.
66768608b5eSPeter Ujfalusi  * @mode: Specifies the mode the ring is to be configured.
66868608b5eSPeter Ujfalusi  * @size: Specifies encoded ring element size. To calculate the encoded size use
66968608b5eSPeter Ujfalusi  *	the formula (log2(size_bytes) - 2), where size_bytes cannot be
67068608b5eSPeter Ujfalusi  *	greater than 256.
67168608b5eSPeter Ujfalusi  * @order_id: Specifies the ring's bus order ID.
67268608b5eSPeter Ujfalusi  */
67368608b5eSPeter Ujfalusi struct ti_sci_msg_rm_ring_cfg_req {
67468608b5eSPeter Ujfalusi 	struct ti_sci_msg_hdr hdr;
67568608b5eSPeter Ujfalusi 	u32 valid_params;
67668608b5eSPeter Ujfalusi 	u16 nav_id;
67768608b5eSPeter Ujfalusi 	u16 index;
67868608b5eSPeter Ujfalusi 	u32 addr_lo;
67968608b5eSPeter Ujfalusi 	u32 addr_hi;
68068608b5eSPeter Ujfalusi 	u32 count;
68168608b5eSPeter Ujfalusi 	u8 mode;
68268608b5eSPeter Ujfalusi 	u8 size;
68368608b5eSPeter Ujfalusi 	u8 order_id;
68468608b5eSPeter Ujfalusi } __packed;
68568608b5eSPeter Ujfalusi 
68668608b5eSPeter Ujfalusi /**
68768608b5eSPeter Ujfalusi  * struct ti_sci_msg_rm_ring_get_cfg_req - Get RA ring's configuration
68868608b5eSPeter Ujfalusi  *
68968608b5eSPeter Ujfalusi  * Gets the configuration of the non-real-time register fields of a ring.  The
69068608b5eSPeter Ujfalusi  * host, or a supervisor of the host, who owns the ring must be the requesting
69168608b5eSPeter Ujfalusi  * host.  The values of the non-real-time registers are returned in
69268608b5eSPeter Ujfalusi  * @ti_sci_msg_rm_ring_get_cfg_resp.
69368608b5eSPeter Ujfalusi  *
69468608b5eSPeter Ujfalusi  * @hdr: Generic Header
69568608b5eSPeter Ujfalusi  * @nav_id: Device ID of Navigator Subsystem from which the ring is allocated
69668608b5eSPeter Ujfalusi  * @index: ring index.
69768608b5eSPeter Ujfalusi  */
69868608b5eSPeter Ujfalusi struct ti_sci_msg_rm_ring_get_cfg_req {
69968608b5eSPeter Ujfalusi 	struct ti_sci_msg_hdr hdr;
70068608b5eSPeter Ujfalusi 	u16 nav_id;
70168608b5eSPeter Ujfalusi 	u16 index;
70268608b5eSPeter Ujfalusi } __packed;
70368608b5eSPeter Ujfalusi 
70468608b5eSPeter Ujfalusi /**
70568608b5eSPeter Ujfalusi  * struct ti_sci_msg_rm_ring_get_cfg_resp -  Ring get configuration response
70668608b5eSPeter Ujfalusi  *
70768608b5eSPeter Ujfalusi  * Response received by host processor after RM has handled
70868608b5eSPeter Ujfalusi  * @ti_sci_msg_rm_ring_get_cfg_req. The response contains the ring's
70968608b5eSPeter Ujfalusi  * non-real-time register values.
71068608b5eSPeter Ujfalusi  *
71168608b5eSPeter Ujfalusi  * @hdr: Generic Header
71268608b5eSPeter Ujfalusi  * @addr_lo: Ring 32 LSBs of base address
71368608b5eSPeter Ujfalusi  * @addr_hi: Ring 16 MSBs of base address.
71468608b5eSPeter Ujfalusi  * @count: Ring number of elements.
71568608b5eSPeter Ujfalusi  * @mode: Ring mode.
71668608b5eSPeter Ujfalusi  * @size: encoded Ring element size
71768608b5eSPeter Ujfalusi  * @order_id: ing order ID.
71868608b5eSPeter Ujfalusi  */
71968608b5eSPeter Ujfalusi struct ti_sci_msg_rm_ring_get_cfg_resp {
72068608b5eSPeter Ujfalusi 	struct ti_sci_msg_hdr hdr;
72168608b5eSPeter Ujfalusi 	u32 addr_lo;
72268608b5eSPeter Ujfalusi 	u32 addr_hi;
72368608b5eSPeter Ujfalusi 	u32 count;
72468608b5eSPeter Ujfalusi 	u8 mode;
72568608b5eSPeter Ujfalusi 	u8 size;
72668608b5eSPeter Ujfalusi 	u8 order_id;
72768608b5eSPeter Ujfalusi } __packed;
72868608b5eSPeter Ujfalusi 
72968608b5eSPeter Ujfalusi /**
73068608b5eSPeter Ujfalusi  * struct ti_sci_msg_psil_pair - Pairs a PSI-L source thread to a destination
73168608b5eSPeter Ujfalusi  *				 thread
73268608b5eSPeter Ujfalusi  * @hdr:	Generic Header
73368608b5eSPeter Ujfalusi  * @nav_id:	SoC Navigator Subsystem device ID whose PSI-L config proxy is
73468608b5eSPeter Ujfalusi  *		used to pair the source and destination threads.
73568608b5eSPeter Ujfalusi  * @src_thread:	PSI-L source thread ID within the PSI-L System thread map.
73668608b5eSPeter Ujfalusi  *
73768608b5eSPeter Ujfalusi  * UDMAP transmit channels mapped to source threads will have their
73868608b5eSPeter Ujfalusi  * TCHAN_THRD_ID register programmed with the destination thread if the pairing
73968608b5eSPeter Ujfalusi  * is successful.
74068608b5eSPeter Ujfalusi 
74168608b5eSPeter Ujfalusi  * @dst_thread: PSI-L destination thread ID within the PSI-L System thread map.
74268608b5eSPeter Ujfalusi  * PSI-L destination threads start at index 0x8000.  The request is NACK'd if
74368608b5eSPeter Ujfalusi  * the destination thread is not greater than or equal to 0x8000.
74468608b5eSPeter Ujfalusi  *
74568608b5eSPeter Ujfalusi  * UDMAP receive channels mapped to destination threads will have their
74668608b5eSPeter Ujfalusi  * RCHAN_THRD_ID register programmed with the source thread if the pairing
74768608b5eSPeter Ujfalusi  * is successful.
74868608b5eSPeter Ujfalusi  *
74968608b5eSPeter Ujfalusi  * Request type is TI_SCI_MSG_RM_PSIL_PAIR, response is a generic ACK or NACK
75068608b5eSPeter Ujfalusi  * message.
75168608b5eSPeter Ujfalusi  */
75268608b5eSPeter Ujfalusi struct ti_sci_msg_psil_pair {
75368608b5eSPeter Ujfalusi 	struct ti_sci_msg_hdr hdr;
75468608b5eSPeter Ujfalusi 	u32 nav_id;
75568608b5eSPeter Ujfalusi 	u32 src_thread;
75668608b5eSPeter Ujfalusi 	u32 dst_thread;
75768608b5eSPeter Ujfalusi } __packed;
75868608b5eSPeter Ujfalusi 
75968608b5eSPeter Ujfalusi /**
76068608b5eSPeter Ujfalusi  * struct ti_sci_msg_psil_unpair - Unpairs a PSI-L source thread from a
76168608b5eSPeter Ujfalusi  *				   destination thread
76268608b5eSPeter Ujfalusi  * @hdr:	Generic Header
76368608b5eSPeter Ujfalusi  * @nav_id:	SoC Navigator Subsystem device ID whose PSI-L config proxy is
76468608b5eSPeter Ujfalusi  *		used to unpair the source and destination threads.
76568608b5eSPeter Ujfalusi  * @src_thread:	PSI-L source thread ID within the PSI-L System thread map.
76668608b5eSPeter Ujfalusi  *
76768608b5eSPeter Ujfalusi  * UDMAP transmit channels mapped to source threads will have their
76868608b5eSPeter Ujfalusi  * TCHAN_THRD_ID register cleared if the unpairing is successful.
76968608b5eSPeter Ujfalusi  *
77068608b5eSPeter Ujfalusi  * @dst_thread: PSI-L destination thread ID within the PSI-L System thread map.
77168608b5eSPeter Ujfalusi  * PSI-L destination threads start at index 0x8000.  The request is NACK'd if
77268608b5eSPeter Ujfalusi  * the destination thread is not greater than or equal to 0x8000.
77368608b5eSPeter Ujfalusi  *
77468608b5eSPeter Ujfalusi  * UDMAP receive channels mapped to destination threads will have their
77568608b5eSPeter Ujfalusi  * RCHAN_THRD_ID register cleared if the unpairing is successful.
77668608b5eSPeter Ujfalusi  *
77768608b5eSPeter Ujfalusi  * Request type is TI_SCI_MSG_RM_PSIL_UNPAIR, response is a generic ACK or NACK
77868608b5eSPeter Ujfalusi  * message.
77968608b5eSPeter Ujfalusi  */
78068608b5eSPeter Ujfalusi struct ti_sci_msg_psil_unpair {
78168608b5eSPeter Ujfalusi 	struct ti_sci_msg_hdr hdr;
78268608b5eSPeter Ujfalusi 	u32 nav_id;
78368608b5eSPeter Ujfalusi 	u32 src_thread;
78468608b5eSPeter Ujfalusi 	u32 dst_thread;
78568608b5eSPeter Ujfalusi } __packed;
78668608b5eSPeter Ujfalusi 
78768608b5eSPeter Ujfalusi /**
78868608b5eSPeter Ujfalusi  * struct ti_sci_msg_udmap_rx_flow_cfg -  UDMAP receive flow configuration
78968608b5eSPeter Ujfalusi  *					  message
79068608b5eSPeter Ujfalusi  * @hdr: Generic Header
79168608b5eSPeter Ujfalusi  * @nav_id: SoC Navigator Subsystem device ID from which the receive flow is
79268608b5eSPeter Ujfalusi  *	allocated
79368608b5eSPeter Ujfalusi  * @flow_index: UDMAP receive flow index for non-optional configuration.
79468608b5eSPeter Ujfalusi  * @rx_ch_index: Specifies the index of the receive channel using the flow_index
79568608b5eSPeter Ujfalusi  * @rx_einfo_present: UDMAP receive flow extended packet info present.
79668608b5eSPeter Ujfalusi  * @rx_psinfo_present: UDMAP receive flow PS words present.
79768608b5eSPeter Ujfalusi  * @rx_error_handling: UDMAP receive flow error handling configuration. Valid
79868608b5eSPeter Ujfalusi  *	values are TI_SCI_RM_UDMAP_RX_FLOW_ERR_DROP/RETRY.
79968608b5eSPeter Ujfalusi  * @rx_desc_type: UDMAP receive flow descriptor type. It can be one of
80068608b5eSPeter Ujfalusi  *	TI_SCI_RM_UDMAP_RX_FLOW_DESC_HOST/MONO.
80168608b5eSPeter Ujfalusi  * @rx_sop_offset: UDMAP receive flow start of packet offset.
80268608b5eSPeter Ujfalusi  * @rx_dest_qnum: UDMAP receive flow destination queue number.
80368608b5eSPeter Ujfalusi  * @rx_ps_location: UDMAP receive flow PS words location.
80468608b5eSPeter Ujfalusi  *	0 - end of packet descriptor
80568608b5eSPeter Ujfalusi  *	1 - Beginning of the data buffer
80668608b5eSPeter Ujfalusi  * @rx_src_tag_hi: UDMAP receive flow source tag high byte constant
80768608b5eSPeter Ujfalusi  * @rx_src_tag_lo: UDMAP receive flow source tag low byte constant
80868608b5eSPeter Ujfalusi  * @rx_dest_tag_hi: UDMAP receive flow destination tag high byte constant
80968608b5eSPeter Ujfalusi  * @rx_dest_tag_lo: UDMAP receive flow destination tag low byte constant
81068608b5eSPeter Ujfalusi  * @rx_src_tag_hi_sel: UDMAP receive flow source tag high byte selector
81168608b5eSPeter Ujfalusi  * @rx_src_tag_lo_sel: UDMAP receive flow source tag low byte selector
81268608b5eSPeter Ujfalusi  * @rx_dest_tag_hi_sel: UDMAP receive flow destination tag high byte selector
81368608b5eSPeter Ujfalusi  * @rx_dest_tag_lo_sel: UDMAP receive flow destination tag low byte selector
81468608b5eSPeter Ujfalusi  * @rx_size_thresh_en: UDMAP receive flow packet size based free buffer queue
81568608b5eSPeter Ujfalusi  *	enable. If enabled, the ti_sci_rm_udmap_rx_flow_opt_cfg also need to be
81668608b5eSPeter Ujfalusi  *	configured and sent.
81768608b5eSPeter Ujfalusi  * @rx_fdq0_sz0_qnum: UDMAP receive flow free descriptor queue 0.
81868608b5eSPeter Ujfalusi  * @rx_fdq1_qnum: UDMAP receive flow free descriptor queue 1.
81968608b5eSPeter Ujfalusi  * @rx_fdq2_qnum: UDMAP receive flow free descriptor queue 2.
82068608b5eSPeter Ujfalusi  * @rx_fdq3_qnum: UDMAP receive flow free descriptor queue 3.
82168608b5eSPeter Ujfalusi  *
82268608b5eSPeter Ujfalusi  * For detailed information on the settings, see the UDMAP section of the TRM.
82368608b5eSPeter Ujfalusi  */
82468608b5eSPeter Ujfalusi struct ti_sci_msg_udmap_rx_flow_cfg {
82568608b5eSPeter Ujfalusi 	struct ti_sci_msg_hdr hdr;
82668608b5eSPeter Ujfalusi 	u32 nav_id;
82768608b5eSPeter Ujfalusi 	u32 flow_index;
82868608b5eSPeter Ujfalusi 	u32 rx_ch_index;
82968608b5eSPeter Ujfalusi 	u8 rx_einfo_present;
83068608b5eSPeter Ujfalusi 	u8 rx_psinfo_present;
83168608b5eSPeter Ujfalusi 	u8 rx_error_handling;
83268608b5eSPeter Ujfalusi 	u8 rx_desc_type;
83368608b5eSPeter Ujfalusi 	u16 rx_sop_offset;
83468608b5eSPeter Ujfalusi 	u16 rx_dest_qnum;
83568608b5eSPeter Ujfalusi 	u8 rx_ps_location;
83668608b5eSPeter Ujfalusi 	u8 rx_src_tag_hi;
83768608b5eSPeter Ujfalusi 	u8 rx_src_tag_lo;
83868608b5eSPeter Ujfalusi 	u8 rx_dest_tag_hi;
83968608b5eSPeter Ujfalusi 	u8 rx_dest_tag_lo;
84068608b5eSPeter Ujfalusi 	u8 rx_src_tag_hi_sel;
84168608b5eSPeter Ujfalusi 	u8 rx_src_tag_lo_sel;
84268608b5eSPeter Ujfalusi 	u8 rx_dest_tag_hi_sel;
84368608b5eSPeter Ujfalusi 	u8 rx_dest_tag_lo_sel;
84468608b5eSPeter Ujfalusi 	u8 rx_size_thresh_en;
84568608b5eSPeter Ujfalusi 	u16 rx_fdq0_sz0_qnum;
84668608b5eSPeter Ujfalusi 	u16 rx_fdq1_qnum;
84768608b5eSPeter Ujfalusi 	u16 rx_fdq2_qnum;
84868608b5eSPeter Ujfalusi 	u16 rx_fdq3_qnum;
84968608b5eSPeter Ujfalusi } __packed;
85068608b5eSPeter Ujfalusi 
85168608b5eSPeter Ujfalusi /**
85268608b5eSPeter Ujfalusi  * struct rm_ti_sci_msg_udmap_rx_flow_opt_cfg - parameters for UDMAP receive
85368608b5eSPeter Ujfalusi  *						flow optional configuration
85468608b5eSPeter Ujfalusi  * @hdr: Generic Header
85568608b5eSPeter Ujfalusi  * @nav_id: SoC Navigator Subsystem device ID from which the receive flow is
85668608b5eSPeter Ujfalusi  *	allocated
85768608b5eSPeter Ujfalusi  * @flow_index: UDMAP receive flow index for optional configuration.
85868608b5eSPeter Ujfalusi  * @rx_ch_index: Specifies the index of the receive channel using the flow_index
85968608b5eSPeter Ujfalusi  * @rx_size_thresh0: UDMAP receive flow packet size threshold 0.
86068608b5eSPeter Ujfalusi  * @rx_size_thresh1: UDMAP receive flow packet size threshold 1.
86168608b5eSPeter Ujfalusi  * @rx_size_thresh2: UDMAP receive flow packet size threshold 2.
86268608b5eSPeter Ujfalusi  * @rx_fdq0_sz1_qnum: UDMAP receive flow free descriptor queue for size
86368608b5eSPeter Ujfalusi  *	threshold 1.
86468608b5eSPeter Ujfalusi  * @rx_fdq0_sz2_qnum: UDMAP receive flow free descriptor queue for size
86568608b5eSPeter Ujfalusi  *	threshold 2.
86668608b5eSPeter Ujfalusi  * @rx_fdq0_sz3_qnum: UDMAP receive flow free descriptor queue for size
86768608b5eSPeter Ujfalusi  *	threshold 3.
86868608b5eSPeter Ujfalusi  *
86968608b5eSPeter Ujfalusi  * For detailed information on the settings, see the UDMAP section of the TRM.
87068608b5eSPeter Ujfalusi  */
87168608b5eSPeter Ujfalusi struct rm_ti_sci_msg_udmap_rx_flow_opt_cfg {
87268608b5eSPeter Ujfalusi 	struct ti_sci_msg_hdr hdr;
87368608b5eSPeter Ujfalusi 	u32 nav_id;
87468608b5eSPeter Ujfalusi 	u32 flow_index;
87568608b5eSPeter Ujfalusi 	u32 rx_ch_index;
87668608b5eSPeter Ujfalusi 	u16 rx_size_thresh0;
87768608b5eSPeter Ujfalusi 	u16 rx_size_thresh1;
87868608b5eSPeter Ujfalusi 	u16 rx_size_thresh2;
87968608b5eSPeter Ujfalusi 	u16 rx_fdq0_sz1_qnum;
88068608b5eSPeter Ujfalusi 	u16 rx_fdq0_sz2_qnum;
88168608b5eSPeter Ujfalusi 	u16 rx_fdq0_sz3_qnum;
88268608b5eSPeter Ujfalusi } __packed;
88368608b5eSPeter Ujfalusi 
88468608b5eSPeter Ujfalusi /**
88568608b5eSPeter Ujfalusi  * Configures a Navigator Subsystem UDMAP transmit channel
88668608b5eSPeter Ujfalusi  *
88768608b5eSPeter Ujfalusi  * Configures the non-real-time registers of a Navigator Subsystem UDMAP
88868608b5eSPeter Ujfalusi  * transmit channel.  The channel index must be assigned to the host defined
88968608b5eSPeter Ujfalusi  * in the TISCI header via the RM board configuration resource assignment
89068608b5eSPeter Ujfalusi  * range list.
89168608b5eSPeter Ujfalusi  *
89268608b5eSPeter Ujfalusi  * @hdr: Generic Header
89368608b5eSPeter Ujfalusi  *
89468608b5eSPeter Ujfalusi  * @valid_params: Bitfield defining validity of tx channel configuration
89568608b5eSPeter Ujfalusi  * parameters. The tx channel configuration fields are not valid, and will not
89668608b5eSPeter Ujfalusi  * be used for ch configuration, if their corresponding valid bit is zero.
89768608b5eSPeter Ujfalusi  * Valid bit usage:
89868608b5eSPeter Ujfalusi  *    0 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_pause_on_err
89968608b5eSPeter Ujfalusi  *    1 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_atype
90068608b5eSPeter Ujfalusi  *    2 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_chan_type
90168608b5eSPeter Ujfalusi  *    3 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_fetch_size
90268608b5eSPeter Ujfalusi  *    4 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::txcq_qnum
90368608b5eSPeter Ujfalusi  *    5 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_priority
90468608b5eSPeter Ujfalusi  *    6 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_qos
90568608b5eSPeter Ujfalusi  *    7 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_orderid
90668608b5eSPeter Ujfalusi  *    8 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_sched_priority
90768608b5eSPeter Ujfalusi  *    9 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_einfo
90868608b5eSPeter Ujfalusi  *   10 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_pswords
90968608b5eSPeter Ujfalusi  *   11 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_supr_tdpkt
91068608b5eSPeter Ujfalusi  *   12 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_credit_count
91168608b5eSPeter Ujfalusi  *   13 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::fdepth
91268608b5eSPeter Ujfalusi  *   14 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_burst_size
91368608b5eSPeter Ujfalusi  *
91468608b5eSPeter Ujfalusi  * @nav_id: SoC device ID of Navigator Subsystem where tx channel is located
91568608b5eSPeter Ujfalusi  *
91668608b5eSPeter Ujfalusi  * @index: UDMAP transmit channel index.
91768608b5eSPeter Ujfalusi  *
91868608b5eSPeter Ujfalusi  * @tx_pause_on_err: UDMAP transmit channel pause on error configuration to
91968608b5eSPeter Ujfalusi  * be programmed into the tx_pause_on_err field of the channel's TCHAN_TCFG
92068608b5eSPeter Ujfalusi  * register.
92168608b5eSPeter Ujfalusi  *
92268608b5eSPeter Ujfalusi  * @tx_filt_einfo: UDMAP transmit channel extended packet information passing
92368608b5eSPeter Ujfalusi  * configuration to be programmed into the tx_filt_einfo field of the
92468608b5eSPeter Ujfalusi  * channel's TCHAN_TCFG register.
92568608b5eSPeter Ujfalusi  *
92668608b5eSPeter Ujfalusi  * @tx_filt_pswords: UDMAP transmit channel protocol specific word passing
92768608b5eSPeter Ujfalusi  * configuration to be programmed into the tx_filt_pswords field of the
92868608b5eSPeter Ujfalusi  * channel's TCHAN_TCFG register.
92968608b5eSPeter Ujfalusi  *
93068608b5eSPeter Ujfalusi  * @tx_atype: UDMAP transmit channel non Ring Accelerator access pointer
93168608b5eSPeter Ujfalusi  * interpretation configuration to be programmed into the tx_atype field of
93268608b5eSPeter Ujfalusi  * the channel's TCHAN_TCFG register.
93368608b5eSPeter Ujfalusi  *
93468608b5eSPeter Ujfalusi  * @tx_chan_type: UDMAP transmit channel functional channel type and work
93568608b5eSPeter Ujfalusi  * passing mechanism configuration to be programmed into the tx_chan_type
93668608b5eSPeter Ujfalusi  * field of the channel's TCHAN_TCFG register.
93768608b5eSPeter Ujfalusi  *
93868608b5eSPeter Ujfalusi  * @tx_supr_tdpkt: UDMAP transmit channel teardown packet generation suppression
93968608b5eSPeter Ujfalusi  * configuration to be programmed into the tx_supr_tdpkt field of the channel's
94068608b5eSPeter Ujfalusi  * TCHAN_TCFG register.
94168608b5eSPeter Ujfalusi  *
94268608b5eSPeter Ujfalusi  * @tx_fetch_size: UDMAP transmit channel number of 32-bit descriptor words to
94368608b5eSPeter Ujfalusi  * fetch configuration to be programmed into the tx_fetch_size field of the
94468608b5eSPeter Ujfalusi  * channel's TCHAN_TCFG register.  The user must make sure to set the maximum
94568608b5eSPeter Ujfalusi  * word count that can pass through the channel for any allowed descriptor type.
94668608b5eSPeter Ujfalusi  *
94768608b5eSPeter Ujfalusi  * @tx_credit_count: UDMAP transmit channel transfer request credit count
94868608b5eSPeter Ujfalusi  * configuration to be programmed into the count field of the TCHAN_TCREDIT
94968608b5eSPeter Ujfalusi  * register.  Specifies how many credits for complete TRs are available.
95068608b5eSPeter Ujfalusi  *
95168608b5eSPeter Ujfalusi  * @txcq_qnum: UDMAP transmit channel completion queue configuration to be
95268608b5eSPeter Ujfalusi  * programmed into the txcq_qnum field of the TCHAN_TCQ register. The specified
95368608b5eSPeter Ujfalusi  * completion queue must be assigned to the host, or a subordinate of the host,
95468608b5eSPeter Ujfalusi  * requesting configuration of the transmit channel.
95568608b5eSPeter Ujfalusi  *
95668608b5eSPeter Ujfalusi  * @tx_priority: UDMAP transmit channel transmit priority value to be programmed
95768608b5eSPeter Ujfalusi  * into the priority field of the channel's TCHAN_TPRI_CTRL register.
95868608b5eSPeter Ujfalusi  *
95968608b5eSPeter Ujfalusi  * @tx_qos: UDMAP transmit channel transmit qos value to be programmed into the
96068608b5eSPeter Ujfalusi  * qos field of the channel's TCHAN_TPRI_CTRL register.
96168608b5eSPeter Ujfalusi  *
96268608b5eSPeter Ujfalusi  * @tx_orderid: UDMAP transmit channel bus order id value to be programmed into
96368608b5eSPeter Ujfalusi  * the orderid field of the channel's TCHAN_TPRI_CTRL register.
96468608b5eSPeter Ujfalusi  *
96568608b5eSPeter Ujfalusi  * @fdepth: UDMAP transmit channel FIFO depth configuration to be programmed
96668608b5eSPeter Ujfalusi  * into the fdepth field of the TCHAN_TFIFO_DEPTH register. Sets the number of
96768608b5eSPeter Ujfalusi  * Tx FIFO bytes which are allowed to be stored for the channel. Check the UDMAP
96868608b5eSPeter Ujfalusi  * section of the TRM for restrictions regarding this parameter.
96968608b5eSPeter Ujfalusi  *
97068608b5eSPeter Ujfalusi  * @tx_sched_priority: UDMAP transmit channel tx scheduling priority
97168608b5eSPeter Ujfalusi  * configuration to be programmed into the priority field of the channel's
97268608b5eSPeter Ujfalusi  * TCHAN_TST_SCHED register.
97368608b5eSPeter Ujfalusi  *
97468608b5eSPeter Ujfalusi  * @tx_burst_size: UDMAP transmit channel burst size configuration to be
97568608b5eSPeter Ujfalusi  * programmed into the tx_burst_size field of the TCHAN_TCFG register.
97668608b5eSPeter Ujfalusi  */
97768608b5eSPeter Ujfalusi struct ti_sci_msg_rm_udmap_tx_ch_cfg_req {
97868608b5eSPeter Ujfalusi 	struct ti_sci_msg_hdr hdr;
97968608b5eSPeter Ujfalusi 	u32 valid_params;
98068608b5eSPeter Ujfalusi 	u16 nav_id;
98168608b5eSPeter Ujfalusi 	u16 index;
98268608b5eSPeter Ujfalusi 	u8 tx_pause_on_err;
98368608b5eSPeter Ujfalusi 	u8 tx_filt_einfo;
98468608b5eSPeter Ujfalusi 	u8 tx_filt_pswords;
98568608b5eSPeter Ujfalusi 	u8 tx_atype;
98668608b5eSPeter Ujfalusi 	u8 tx_chan_type;
98768608b5eSPeter Ujfalusi 	u8 tx_supr_tdpkt;
98868608b5eSPeter Ujfalusi 	u16 tx_fetch_size;
98968608b5eSPeter Ujfalusi 	u8 tx_credit_count;
99068608b5eSPeter Ujfalusi 	u16 txcq_qnum;
99168608b5eSPeter Ujfalusi 	u8 tx_priority;
99268608b5eSPeter Ujfalusi 	u8 tx_qos;
99368608b5eSPeter Ujfalusi 	u8 tx_orderid;
99468608b5eSPeter Ujfalusi 	u16 fdepth;
99568608b5eSPeter Ujfalusi 	u8 tx_sched_priority;
99668608b5eSPeter Ujfalusi 	u8 tx_burst_size;
99768608b5eSPeter Ujfalusi } __packed;
99868608b5eSPeter Ujfalusi 
99968608b5eSPeter Ujfalusi /**
100068608b5eSPeter Ujfalusi  * Configures a Navigator Subsystem UDMAP receive channel
100168608b5eSPeter Ujfalusi  *
100268608b5eSPeter Ujfalusi  * Configures the non-real-time registers of a Navigator Subsystem UDMAP
100368608b5eSPeter Ujfalusi  * receive channel.  The channel index must be assigned to the host defined
100468608b5eSPeter Ujfalusi  * in the TISCI header via the RM board configuration resource assignment
100568608b5eSPeter Ujfalusi  * range list.
100668608b5eSPeter Ujfalusi  *
100768608b5eSPeter Ujfalusi  * @hdr: Generic Header
100868608b5eSPeter Ujfalusi  *
100968608b5eSPeter Ujfalusi  * @valid_params: Bitfield defining validity of rx channel configuration
101068608b5eSPeter Ujfalusi  * parameters.
101168608b5eSPeter Ujfalusi  * The rx channel configuration fields are not valid, and will not be used for
101268608b5eSPeter Ujfalusi  * ch configuration, if their corresponding valid bit is zero.
101368608b5eSPeter Ujfalusi  * Valid bit usage:
101468608b5eSPeter Ujfalusi  *    0 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_pause_on_err
101568608b5eSPeter Ujfalusi  *    1 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_atype
101668608b5eSPeter Ujfalusi  *    2 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_chan_type
101768608b5eSPeter Ujfalusi  *    3 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_fetch_size
101868608b5eSPeter Ujfalusi  *    4 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rxcq_qnum
101968608b5eSPeter Ujfalusi  *    5 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_priority
102068608b5eSPeter Ujfalusi  *    6 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_qos
102168608b5eSPeter Ujfalusi  *    7 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_orderid
102268608b5eSPeter Ujfalusi  *    8 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_sched_priority
102368608b5eSPeter Ujfalusi  *    9 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_start
102468608b5eSPeter Ujfalusi  *   10 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_cnt
102568608b5eSPeter Ujfalusi  *   11 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_short
102668608b5eSPeter Ujfalusi  *   12 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_long
102768608b5eSPeter Ujfalusi  *   14 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_burst_size
102868608b5eSPeter Ujfalusi  *
102968608b5eSPeter Ujfalusi  * @nav_id: SoC device ID of Navigator Subsystem where rx channel is located
103068608b5eSPeter Ujfalusi  *
103168608b5eSPeter Ujfalusi  * @index: UDMAP receive channel index.
103268608b5eSPeter Ujfalusi  *
103368608b5eSPeter Ujfalusi  * @rx_fetch_size: UDMAP receive channel number of 32-bit descriptor words to
103468608b5eSPeter Ujfalusi  * fetch configuration to be programmed into the rx_fetch_size field of the
103568608b5eSPeter Ujfalusi  * channel's RCHAN_RCFG register.
103668608b5eSPeter Ujfalusi  *
103768608b5eSPeter Ujfalusi  * @rxcq_qnum: UDMAP receive channel completion queue configuration to be
103868608b5eSPeter Ujfalusi  * programmed into the rxcq_qnum field of the RCHAN_RCQ register.
103968608b5eSPeter Ujfalusi  * The specified completion queue must be assigned to the host, or a subordinate
104068608b5eSPeter Ujfalusi  * of the host, requesting configuration of the receive channel.
104168608b5eSPeter Ujfalusi  *
104268608b5eSPeter Ujfalusi  * @rx_priority: UDMAP receive channel receive priority value to be programmed
104368608b5eSPeter Ujfalusi  * into the priority field of the channel's RCHAN_RPRI_CTRL register.
104468608b5eSPeter Ujfalusi  *
104568608b5eSPeter Ujfalusi  * @rx_qos: UDMAP receive channel receive qos value to be programmed into the
104668608b5eSPeter Ujfalusi  * qos field of the channel's RCHAN_RPRI_CTRL register.
104768608b5eSPeter Ujfalusi  *
104868608b5eSPeter Ujfalusi  * @rx_orderid: UDMAP receive channel bus order id value to be programmed into
104968608b5eSPeter Ujfalusi  * the orderid field of the channel's RCHAN_RPRI_CTRL register.
105068608b5eSPeter Ujfalusi  *
105168608b5eSPeter Ujfalusi  * @rx_sched_priority: UDMAP receive channel rx scheduling priority
105268608b5eSPeter Ujfalusi  * configuration to be programmed into the priority field of the channel's
105368608b5eSPeter Ujfalusi  * RCHAN_RST_SCHED register.
105468608b5eSPeter Ujfalusi  *
105568608b5eSPeter Ujfalusi  * @flowid_start: UDMAP receive channel additional flows starting index
105668608b5eSPeter Ujfalusi  * configuration to program into the flow_start field of the RCHAN_RFLOW_RNG
105768608b5eSPeter Ujfalusi  * register. Specifies the starting index for flow IDs the receive channel is to
105868608b5eSPeter Ujfalusi  * make use of beyond the default flow. flowid_start and @ref flowid_cnt must be
105968608b5eSPeter Ujfalusi  * set as valid and configured together. The starting flow ID set by
106068608b5eSPeter Ujfalusi  * @ref flowid_cnt must be a flow index within the Navigator Subsystem's subset
106168608b5eSPeter Ujfalusi  * of flows beyond the default flows statically mapped to receive channels.
106268608b5eSPeter Ujfalusi  * The additional flows must be assigned to the host, or a subordinate of the
106368608b5eSPeter Ujfalusi  * host, requesting configuration of the receive channel.
106468608b5eSPeter Ujfalusi  *
106568608b5eSPeter Ujfalusi  * @flowid_cnt: UDMAP receive channel additional flows count configuration to
106668608b5eSPeter Ujfalusi  * program into the flowid_cnt field of the RCHAN_RFLOW_RNG register.
106768608b5eSPeter Ujfalusi  * This field specifies how many flow IDs are in the additional contiguous range
106868608b5eSPeter Ujfalusi  * of legal flow IDs for the channel.  @ref flowid_start and flowid_cnt must be
106968608b5eSPeter Ujfalusi  * set as valid and configured together. Disabling the valid_params field bit
107068608b5eSPeter Ujfalusi  * for flowid_cnt indicates no flow IDs other than the default are to be
107168608b5eSPeter Ujfalusi  * allocated and used by the receive channel. @ref flowid_start plus flowid_cnt
107268608b5eSPeter Ujfalusi  * cannot be greater than the number of receive flows in the receive channel's
107368608b5eSPeter Ujfalusi  * Navigator Subsystem.  The additional flows must be assigned to the host, or a
107468608b5eSPeter Ujfalusi  * subordinate of the host, requesting configuration of the receive channel.
107568608b5eSPeter Ujfalusi  *
107668608b5eSPeter Ujfalusi  * @rx_pause_on_err: UDMAP receive channel pause on error configuration to be
107768608b5eSPeter Ujfalusi  * programmed into the rx_pause_on_err field of the channel's RCHAN_RCFG
107868608b5eSPeter Ujfalusi  * register.
107968608b5eSPeter Ujfalusi  *
108068608b5eSPeter Ujfalusi  * @rx_atype: UDMAP receive channel non Ring Accelerator access pointer
108168608b5eSPeter Ujfalusi  * interpretation configuration to be programmed into the rx_atype field of the
108268608b5eSPeter Ujfalusi  * channel's RCHAN_RCFG register.
108368608b5eSPeter Ujfalusi  *
108468608b5eSPeter Ujfalusi  * @rx_chan_type: UDMAP receive channel functional channel type and work passing
108568608b5eSPeter Ujfalusi  * mechanism configuration to be programmed into the rx_chan_type field of the
108668608b5eSPeter Ujfalusi  * channel's RCHAN_RCFG register.
108768608b5eSPeter Ujfalusi  *
108868608b5eSPeter Ujfalusi  * @rx_ignore_short: UDMAP receive channel short packet treatment configuration
108968608b5eSPeter Ujfalusi  * to be programmed into the rx_ignore_short field of the RCHAN_RCFG register.
109068608b5eSPeter Ujfalusi  *
109168608b5eSPeter Ujfalusi  * @rx_ignore_long: UDMAP receive channel long packet treatment configuration to
109268608b5eSPeter Ujfalusi  * be programmed into the rx_ignore_long field of the RCHAN_RCFG register.
109368608b5eSPeter Ujfalusi  *
109468608b5eSPeter Ujfalusi  * @rx_burst_size: UDMAP receive channel burst size configuration to be
109568608b5eSPeter Ujfalusi  * programmed into the rx_burst_size field of the RCHAN_RCFG register.
109668608b5eSPeter Ujfalusi  */
109768608b5eSPeter Ujfalusi struct ti_sci_msg_rm_udmap_rx_ch_cfg_req {
109868608b5eSPeter Ujfalusi 	struct ti_sci_msg_hdr hdr;
109968608b5eSPeter Ujfalusi 	u32 valid_params;
110068608b5eSPeter Ujfalusi 	u16 nav_id;
110168608b5eSPeter Ujfalusi 	u16 index;
110268608b5eSPeter Ujfalusi 	u16 rx_fetch_size;
110368608b5eSPeter Ujfalusi 	u16 rxcq_qnum;
110468608b5eSPeter Ujfalusi 	u8 rx_priority;
110568608b5eSPeter Ujfalusi 	u8 rx_qos;
110668608b5eSPeter Ujfalusi 	u8 rx_orderid;
110768608b5eSPeter Ujfalusi 	u8 rx_sched_priority;
110868608b5eSPeter Ujfalusi 	u16 flowid_start;
110968608b5eSPeter Ujfalusi 	u16 flowid_cnt;
111068608b5eSPeter Ujfalusi 	u8 rx_pause_on_err;
111168608b5eSPeter Ujfalusi 	u8 rx_atype;
111268608b5eSPeter Ujfalusi 	u8 rx_chan_type;
111368608b5eSPeter Ujfalusi 	u8 rx_ignore_short;
111468608b5eSPeter Ujfalusi 	u8 rx_ignore_long;
111568608b5eSPeter Ujfalusi 	u8 rx_burst_size;
111668608b5eSPeter Ujfalusi } __packed;
111768608b5eSPeter Ujfalusi 
111868608b5eSPeter Ujfalusi /**
111968608b5eSPeter Ujfalusi  * Configures a Navigator Subsystem UDMAP receive flow
112068608b5eSPeter Ujfalusi  *
112168608b5eSPeter Ujfalusi  * Configures a Navigator Subsystem UDMAP receive flow's registers.
112268608b5eSPeter Ujfalusi  * Configuration does not include the flow registers which handle size-based
112368608b5eSPeter Ujfalusi  * free descriptor queue routing.
112468608b5eSPeter Ujfalusi  *
112568608b5eSPeter Ujfalusi  * The flow index must be assigned to the host defined in the TISCI header via
112668608b5eSPeter Ujfalusi  * the RM board configuration resource assignment range list.
112768608b5eSPeter Ujfalusi  *
112868608b5eSPeter Ujfalusi  * @hdr: Standard TISCI header
112968608b5eSPeter Ujfalusi  *
113068608b5eSPeter Ujfalusi  * @valid_params
113168608b5eSPeter Ujfalusi  * Bitfield defining validity of rx flow configuration parameters.  The
113268608b5eSPeter Ujfalusi  * rx flow configuration fields are not valid, and will not be used for flow
113368608b5eSPeter Ujfalusi  * configuration, if their corresponding valid bit is zero.  Valid bit usage:
113468608b5eSPeter Ujfalusi  *     0 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_einfo_present
113568608b5eSPeter Ujfalusi  *     1 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_psinfo_present
113668608b5eSPeter Ujfalusi  *     2 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_error_handling
113768608b5eSPeter Ujfalusi  *     3 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_desc_type
113868608b5eSPeter Ujfalusi  *     4 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_sop_offset
113968608b5eSPeter Ujfalusi  *     5 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_qnum
114068608b5eSPeter Ujfalusi  *     6 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi
114168608b5eSPeter Ujfalusi  *     7 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo
114268608b5eSPeter Ujfalusi  *     8 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi
114368608b5eSPeter Ujfalusi  *     9 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo
114468608b5eSPeter Ujfalusi  *    10 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi_sel
114568608b5eSPeter Ujfalusi  *    11 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo_sel
114668608b5eSPeter Ujfalusi  *    12 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi_sel
114768608b5eSPeter Ujfalusi  *    13 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo_sel
114868608b5eSPeter Ujfalusi  *    14 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq0_sz0_qnum
114968608b5eSPeter Ujfalusi  *    15 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq1_sz0_qnum
115068608b5eSPeter Ujfalusi  *    16 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq2_sz0_qnum
115168608b5eSPeter Ujfalusi  *    17 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq3_sz0_qnum
115268608b5eSPeter Ujfalusi  *    18 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_ps_location
115368608b5eSPeter Ujfalusi  *
115468608b5eSPeter Ujfalusi  * @nav_id: SoC device ID of Navigator Subsystem from which the receive flow is
115568608b5eSPeter Ujfalusi  * allocated
115668608b5eSPeter Ujfalusi  *
115768608b5eSPeter Ujfalusi  * @flow_index: UDMAP receive flow index for non-optional configuration.
115868608b5eSPeter Ujfalusi  *
115968608b5eSPeter Ujfalusi  * @rx_einfo_present:
116068608b5eSPeter Ujfalusi  * UDMAP receive flow extended packet info present configuration to be
116168608b5eSPeter Ujfalusi  * programmed into the rx_einfo_present field of the flow's RFLOW_RFA register.
116268608b5eSPeter Ujfalusi  *
116368608b5eSPeter Ujfalusi  * @rx_psinfo_present:
116468608b5eSPeter Ujfalusi  * UDMAP receive flow PS words present configuration to be programmed into the
116568608b5eSPeter Ujfalusi  * rx_psinfo_present field of the flow's RFLOW_RFA register.
116668608b5eSPeter Ujfalusi  *
116768608b5eSPeter Ujfalusi  * @rx_error_handling:
116868608b5eSPeter Ujfalusi  * UDMAP receive flow error handling configuration to be programmed into the
116968608b5eSPeter Ujfalusi  * rx_error_handling field of the flow's RFLOW_RFA register.
117068608b5eSPeter Ujfalusi  *
117168608b5eSPeter Ujfalusi  * @rx_desc_type:
117268608b5eSPeter Ujfalusi  * UDMAP receive flow descriptor type configuration to be programmed into the
117368608b5eSPeter Ujfalusi  * rx_desc_type field field of the flow's RFLOW_RFA register.
117468608b5eSPeter Ujfalusi  *
117568608b5eSPeter Ujfalusi  * @rx_sop_offset:
117668608b5eSPeter Ujfalusi  * UDMAP receive flow start of packet offset configuration to be programmed
117768608b5eSPeter Ujfalusi  * into the rx_sop_offset field of the RFLOW_RFA register.  See the UDMAP
117868608b5eSPeter Ujfalusi  * section of the TRM for more information on this setting.  Valid values for
117968608b5eSPeter Ujfalusi  * this field are 0-255 bytes.
118068608b5eSPeter Ujfalusi  *
118168608b5eSPeter Ujfalusi  * @rx_dest_qnum:
118268608b5eSPeter Ujfalusi  * UDMAP receive flow destination queue configuration to be programmed into the
118368608b5eSPeter Ujfalusi  * rx_dest_qnum field of the flow's RFLOW_RFA register.  The specified
118468608b5eSPeter Ujfalusi  * destination queue must be valid within the Navigator Subsystem and must be
118568608b5eSPeter Ujfalusi  * owned by the host, or a subordinate of the host, requesting allocation and
118668608b5eSPeter Ujfalusi  * configuration of the receive flow.
118768608b5eSPeter Ujfalusi  *
118868608b5eSPeter Ujfalusi  * @rx_src_tag_hi:
118968608b5eSPeter Ujfalusi  * UDMAP receive flow source tag high byte constant configuration to be
119068608b5eSPeter Ujfalusi  * programmed into the rx_src_tag_hi field of the flow's RFLOW_RFB register.
119168608b5eSPeter Ujfalusi  * See the UDMAP section of the TRM for more information on this setting.
119268608b5eSPeter Ujfalusi  *
119368608b5eSPeter Ujfalusi  * @rx_src_tag_lo:
119468608b5eSPeter Ujfalusi  * UDMAP receive flow source tag low byte constant configuration to be
119568608b5eSPeter Ujfalusi  * programmed into the rx_src_tag_lo field of the flow's RFLOW_RFB register.
119668608b5eSPeter Ujfalusi  * See the UDMAP section of the TRM for more information on this setting.
119768608b5eSPeter Ujfalusi  *
119868608b5eSPeter Ujfalusi  * @rx_dest_tag_hi:
119968608b5eSPeter Ujfalusi  * UDMAP receive flow destination tag high byte constant configuration to be
120068608b5eSPeter Ujfalusi  * programmed into the rx_dest_tag_hi field of the flow's RFLOW_RFB register.
120168608b5eSPeter Ujfalusi  * See the UDMAP section of the TRM for more information on this setting.
120268608b5eSPeter Ujfalusi  *
120368608b5eSPeter Ujfalusi  * @rx_dest_tag_lo:
120468608b5eSPeter Ujfalusi  * UDMAP receive flow destination tag low byte constant configuration to be
120568608b5eSPeter Ujfalusi  * programmed into the rx_dest_tag_lo field of the flow's RFLOW_RFB register.
120668608b5eSPeter Ujfalusi  * See the UDMAP section of the TRM for more information on this setting.
120768608b5eSPeter Ujfalusi  *
120868608b5eSPeter Ujfalusi  * @rx_src_tag_hi_sel:
120968608b5eSPeter Ujfalusi  * UDMAP receive flow source tag high byte selector configuration to be
121068608b5eSPeter Ujfalusi  * programmed into the rx_src_tag_hi_sel field of the RFLOW_RFC register.  See
121168608b5eSPeter Ujfalusi  * the UDMAP section of the TRM for more information on this setting.
121268608b5eSPeter Ujfalusi  *
121368608b5eSPeter Ujfalusi  * @rx_src_tag_lo_sel:
121468608b5eSPeter Ujfalusi  * UDMAP receive flow source tag low byte selector configuration to be
121568608b5eSPeter Ujfalusi  * programmed into the rx_src_tag_lo_sel field of the RFLOW_RFC register.  See
121668608b5eSPeter Ujfalusi  * the UDMAP section of the TRM for more information on this setting.
121768608b5eSPeter Ujfalusi  *
121868608b5eSPeter Ujfalusi  * @rx_dest_tag_hi_sel:
121968608b5eSPeter Ujfalusi  * UDMAP receive flow destination tag high byte selector configuration to be
122068608b5eSPeter Ujfalusi  * programmed into the rx_dest_tag_hi_sel field of the RFLOW_RFC register.  See
122168608b5eSPeter Ujfalusi  * the UDMAP section of the TRM for more information on this setting.
122268608b5eSPeter Ujfalusi  *
122368608b5eSPeter Ujfalusi  * @rx_dest_tag_lo_sel:
122468608b5eSPeter Ujfalusi  * UDMAP receive flow destination tag low byte selector configuration to be
122568608b5eSPeter Ujfalusi  * programmed into the rx_dest_tag_lo_sel field of the RFLOW_RFC register.  See
122668608b5eSPeter Ujfalusi  * the UDMAP section of the TRM for more information on this setting.
122768608b5eSPeter Ujfalusi  *
122868608b5eSPeter Ujfalusi  * @rx_fdq0_sz0_qnum:
122968608b5eSPeter Ujfalusi  * UDMAP receive flow free descriptor queue 0 configuration to be programmed
123068608b5eSPeter Ujfalusi  * into the rx_fdq0_sz0_qnum field of the flow's RFLOW_RFD register.  See the
123168608b5eSPeter Ujfalusi  * UDMAP section of the TRM for more information on this setting. The specified
123268608b5eSPeter Ujfalusi  * free queue must be valid within the Navigator Subsystem and must be owned
123368608b5eSPeter Ujfalusi  * by the host, or a subordinate of the host, requesting allocation and
123468608b5eSPeter Ujfalusi  * configuration of the receive flow.
123568608b5eSPeter Ujfalusi  *
123668608b5eSPeter Ujfalusi  * @rx_fdq1_qnum:
123768608b5eSPeter Ujfalusi  * UDMAP receive flow free descriptor queue 1 configuration to be programmed
123868608b5eSPeter Ujfalusi  * into the rx_fdq1_qnum field of the flow's RFLOW_RFD register.  See the
123968608b5eSPeter Ujfalusi  * UDMAP section of the TRM for more information on this setting.  The specified
124068608b5eSPeter Ujfalusi  * free queue must be valid within the Navigator Subsystem and must be owned
124168608b5eSPeter Ujfalusi  * by the host, or a subordinate of the host, requesting allocation and
124268608b5eSPeter Ujfalusi  * configuration of the receive flow.
124368608b5eSPeter Ujfalusi  *
124468608b5eSPeter Ujfalusi  * @rx_fdq2_qnum:
124568608b5eSPeter Ujfalusi  * UDMAP receive flow free descriptor queue 2 configuration to be programmed
124668608b5eSPeter Ujfalusi  * into the rx_fdq2_qnum field of the flow's RFLOW_RFE register.  See the
124768608b5eSPeter Ujfalusi  * UDMAP section of the TRM for more information on this setting.  The specified
124868608b5eSPeter Ujfalusi  * free queue must be valid within the Navigator Subsystem and must be owned
124968608b5eSPeter Ujfalusi  * by the host, or a subordinate of the host, requesting allocation and
125068608b5eSPeter Ujfalusi  * configuration of the receive flow.
125168608b5eSPeter Ujfalusi  *
125268608b5eSPeter Ujfalusi  * @rx_fdq3_qnum:
125368608b5eSPeter Ujfalusi  * UDMAP receive flow free descriptor queue 3 configuration to be programmed
125468608b5eSPeter Ujfalusi  * into the rx_fdq3_qnum field of the flow's RFLOW_RFE register.  See the
125568608b5eSPeter Ujfalusi  * UDMAP section of the TRM for more information on this setting.  The specified
125668608b5eSPeter Ujfalusi  * free queue must be valid within the Navigator Subsystem and must be owned
125768608b5eSPeter Ujfalusi  * by the host, or a subordinate of the host, requesting allocation and
125868608b5eSPeter Ujfalusi  * configuration of the receive flow.
125968608b5eSPeter Ujfalusi  *
126068608b5eSPeter Ujfalusi  * @rx_ps_location:
126168608b5eSPeter Ujfalusi  * UDMAP receive flow PS words location configuration to be programmed into the
126268608b5eSPeter Ujfalusi  * rx_ps_location field of the flow's RFLOW_RFA register.
126368608b5eSPeter Ujfalusi  */
126468608b5eSPeter Ujfalusi struct ti_sci_msg_rm_udmap_flow_cfg_req {
126568608b5eSPeter Ujfalusi 	struct ti_sci_msg_hdr hdr;
126668608b5eSPeter Ujfalusi 	u32 valid_params;
126768608b5eSPeter Ujfalusi 	u16 nav_id;
126868608b5eSPeter Ujfalusi 	u16 flow_index;
126968608b5eSPeter Ujfalusi 	u8 rx_einfo_present;
127068608b5eSPeter Ujfalusi 	u8 rx_psinfo_present;
127168608b5eSPeter Ujfalusi 	u8 rx_error_handling;
127268608b5eSPeter Ujfalusi 	u8 rx_desc_type;
127368608b5eSPeter Ujfalusi 	u16 rx_sop_offset;
127468608b5eSPeter Ujfalusi 	u16 rx_dest_qnum;
127568608b5eSPeter Ujfalusi 	u8 rx_src_tag_hi;
127668608b5eSPeter Ujfalusi 	u8 rx_src_tag_lo;
127768608b5eSPeter Ujfalusi 	u8 rx_dest_tag_hi;
127868608b5eSPeter Ujfalusi 	u8 rx_dest_tag_lo;
127968608b5eSPeter Ujfalusi 	u8 rx_src_tag_hi_sel;
128068608b5eSPeter Ujfalusi 	u8 rx_src_tag_lo_sel;
128168608b5eSPeter Ujfalusi 	u8 rx_dest_tag_hi_sel;
128268608b5eSPeter Ujfalusi 	u8 rx_dest_tag_lo_sel;
128368608b5eSPeter Ujfalusi 	u16 rx_fdq0_sz0_qnum;
128468608b5eSPeter Ujfalusi 	u16 rx_fdq1_qnum;
128568608b5eSPeter Ujfalusi 	u16 rx_fdq2_qnum;
128668608b5eSPeter Ujfalusi 	u16 rx_fdq3_qnum;
128768608b5eSPeter Ujfalusi 	u8 rx_ps_location;
128868608b5eSPeter Ujfalusi } __packed;
128968608b5eSPeter Ujfalusi 
12901e407f33SSuman Anna /**
12911e407f33SSuman Anna  * struct ti_sci_msg_req_proc_request - Request a processor
12921e407f33SSuman Anna  * @hdr:		Generic Header
12931e407f33SSuman Anna  * @processor_id:	ID of processor being requested
12941e407f33SSuman Anna  *
12951e407f33SSuman Anna  * Request type is TI_SCI_MSG_PROC_REQUEST, response is a generic ACK/NACK
12961e407f33SSuman Anna  * message.
12971e407f33SSuman Anna  */
12981e407f33SSuman Anna struct ti_sci_msg_req_proc_request {
12991e407f33SSuman Anna 	struct ti_sci_msg_hdr hdr;
13001e407f33SSuman Anna 	u8 processor_id;
13011e407f33SSuman Anna } __packed;
13021e407f33SSuman Anna 
13031e407f33SSuman Anna /**
13041e407f33SSuman Anna  * struct ti_sci_msg_req_proc_release - Release a processor
13051e407f33SSuman Anna  * @hdr:		Generic Header
13061e407f33SSuman Anna  * @processor_id:	ID of processor being released
13071e407f33SSuman Anna  *
13081e407f33SSuman Anna  * Request type is TI_SCI_MSG_PROC_RELEASE, response is a generic ACK/NACK
13091e407f33SSuman Anna  * message.
13101e407f33SSuman Anna  */
13111e407f33SSuman Anna struct ti_sci_msg_req_proc_release {
13121e407f33SSuman Anna 	struct ti_sci_msg_hdr hdr;
13131e407f33SSuman Anna 	u8 processor_id;
13141e407f33SSuman Anna } __packed;
13151e407f33SSuman Anna 
13161e407f33SSuman Anna /**
13171e407f33SSuman Anna  * struct ti_sci_msg_req_proc_handover - Handover a processor to a host
13181e407f33SSuman Anna  * @hdr:		Generic Header
13191e407f33SSuman Anna  * @processor_id:	ID of processor being handed over
13201e407f33SSuman Anna  * @host_id:		Host ID the control needs to be transferred to
13211e407f33SSuman Anna  *
13221e407f33SSuman Anna  * Request type is TI_SCI_MSG_PROC_HANDOVER, response is a generic ACK/NACK
13231e407f33SSuman Anna  * message.
13241e407f33SSuman Anna  */
13251e407f33SSuman Anna struct ti_sci_msg_req_proc_handover {
13261e407f33SSuman Anna 	struct ti_sci_msg_hdr hdr;
13271e407f33SSuman Anna 	u8 processor_id;
13281e407f33SSuman Anna 	u8 host_id;
13291e407f33SSuman Anna } __packed;
13301e407f33SSuman Anna 
13311e407f33SSuman Anna /* Boot Vector masks */
13321e407f33SSuman Anna #define TI_SCI_ADDR_LOW_MASK			GENMASK_ULL(31, 0)
13331e407f33SSuman Anna #define TI_SCI_ADDR_HIGH_MASK			GENMASK_ULL(63, 32)
13341e407f33SSuman Anna #define TI_SCI_ADDR_HIGH_SHIFT			32
13351e407f33SSuman Anna 
13361e407f33SSuman Anna /**
13371e407f33SSuman Anna  * struct ti_sci_msg_req_set_config - Set Processor boot configuration
13381e407f33SSuman Anna  * @hdr:		Generic Header
13391e407f33SSuman Anna  * @processor_id:	ID of processor being configured
13401e407f33SSuman Anna  * @bootvector_low:	Lower 32 bit address (Little Endian) of boot vector
13411e407f33SSuman Anna  * @bootvector_high:	Higher 32 bit address (Little Endian) of boot vector
13421e407f33SSuman Anna  * @config_flags_set:	Optional Processor specific Config Flags to set.
13431e407f33SSuman Anna  *			Setting a bit here implies the corresponding mode
13441e407f33SSuman Anna  *			will be set
13451e407f33SSuman Anna  * @config_flags_clear:	Optional Processor specific Config Flags to clear.
13461e407f33SSuman Anna  *			Setting a bit here implies the corresponding mode
13471e407f33SSuman Anna  *			will be cleared
13481e407f33SSuman Anna  *
13491e407f33SSuman Anna  * Request type is TI_SCI_MSG_PROC_HANDOVER, response is a generic ACK/NACK
13501e407f33SSuman Anna  * message.
13511e407f33SSuman Anna  */
13521e407f33SSuman Anna struct ti_sci_msg_req_set_config {
13531e407f33SSuman Anna 	struct ti_sci_msg_hdr hdr;
13541e407f33SSuman Anna 	u8 processor_id;
13551e407f33SSuman Anna 	u32 bootvector_low;
13561e407f33SSuman Anna 	u32 bootvector_high;
13571e407f33SSuman Anna 	u32 config_flags_set;
13581e407f33SSuman Anna 	u32 config_flags_clear;
13591e407f33SSuman Anna } __packed;
13601e407f33SSuman Anna 
13611e407f33SSuman Anna /**
13621e407f33SSuman Anna  * struct ti_sci_msg_req_set_ctrl - Set Processor boot control flags
13631e407f33SSuman Anna  * @hdr:		Generic Header
13641e407f33SSuman Anna  * @processor_id:	ID of processor being configured
13651e407f33SSuman Anna  * @control_flags_set:	Optional Processor specific Control Flags to set.
13661e407f33SSuman Anna  *			Setting a bit here implies the corresponding mode
13671e407f33SSuman Anna  *			will be set
13681e407f33SSuman Anna  * @control_flags_clear:Optional Processor specific Control Flags to clear.
13691e407f33SSuman Anna  *			Setting a bit here implies the corresponding mode
13701e407f33SSuman Anna  *			will be cleared
13711e407f33SSuman Anna  *
13721e407f33SSuman Anna  * Request type is TI_SCI_MSG_SET_CTRL, response is a generic ACK/NACK
13731e407f33SSuman Anna  * message.
13741e407f33SSuman Anna  */
13751e407f33SSuman Anna struct ti_sci_msg_req_set_ctrl {
13761e407f33SSuman Anna 	struct ti_sci_msg_hdr hdr;
13771e407f33SSuman Anna 	u8 processor_id;
13781e407f33SSuman Anna 	u32 control_flags_set;
13791e407f33SSuman Anna 	u32 control_flags_clear;
13801e407f33SSuman Anna } __packed;
13811e407f33SSuman Anna 
13821e407f33SSuman Anna /**
13831e407f33SSuman Anna  * struct ti_sci_msg_req_get_status - Processor boot status request
13841e407f33SSuman Anna  * @hdr:		Generic Header
13851e407f33SSuman Anna  * @processor_id:	ID of processor whose status is being requested
13861e407f33SSuman Anna  *
13871e407f33SSuman Anna  * Request type is TI_SCI_MSG_GET_STATUS, response is an appropriate
13881e407f33SSuman Anna  * message, or NACK in case of inability to satisfy request.
13891e407f33SSuman Anna  */
13901e407f33SSuman Anna struct ti_sci_msg_req_get_status {
13911e407f33SSuman Anna 	struct ti_sci_msg_hdr hdr;
13921e407f33SSuman Anna 	u8 processor_id;
13931e407f33SSuman Anna } __packed;
13941e407f33SSuman Anna 
13951e407f33SSuman Anna /**
13961e407f33SSuman Anna  * struct ti_sci_msg_resp_get_status - Processor boot status response
13971e407f33SSuman Anna  * @hdr:		Generic Header
13981e407f33SSuman Anna  * @processor_id:	ID of processor whose status is returned
13991e407f33SSuman Anna  * @bootvector_low:	Lower 32 bit address (Little Endian) of boot vector
14001e407f33SSuman Anna  * @bootvector_high:	Higher 32 bit address (Little Endian) of boot vector
14011e407f33SSuman Anna  * @config_flags:	Optional Processor specific Config Flags set currently
14021e407f33SSuman Anna  * @control_flags:	Optional Processor specific Control Flags set currently
14031e407f33SSuman Anna  * @status_flags:	Optional Processor specific Status Flags set currently
14041e407f33SSuman Anna  *
14051e407f33SSuman Anna  * Response structure to a TI_SCI_MSG_GET_STATUS request.
14061e407f33SSuman Anna  */
14071e407f33SSuman Anna struct ti_sci_msg_resp_get_status {
14081e407f33SSuman Anna 	struct ti_sci_msg_hdr hdr;
14091e407f33SSuman Anna 	u8 processor_id;
14101e407f33SSuman Anna 	u32 bootvector_low;
14111e407f33SSuman Anna 	u32 bootvector_high;
14121e407f33SSuman Anna 	u32 config_flags;
14131e407f33SSuman Anna 	u32 control_flags;
14141e407f33SSuman Anna 	u32 status_flags;
14151e407f33SSuman Anna } __packed;
14161e407f33SSuman Anna 
1417aa276781SNishanth Menon #endif /* __TI_SCI_H */
1418