162306a36Sopenharmony_ci/* SPDX-License-Identifier: BSD-3-Clause */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Texas Instruments System Control Interface (TISCI) Protocol
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Communication protocol with TI SCI hardware
662306a36Sopenharmony_ci * The system works in a message response protocol
762306a36Sopenharmony_ci * See: http://processors.wiki.ti.com/index.php/TISCI for details
862306a36Sopenharmony_ci *
962306a36Sopenharmony_ci * Copyright (C)  2015-2016 Texas Instruments Incorporated - https://www.ti.com/
1062306a36Sopenharmony_ci */
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#ifndef __TI_SCI_H
1362306a36Sopenharmony_ci#define __TI_SCI_H
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci/* Generic Messages */
1662306a36Sopenharmony_ci#define TI_SCI_MSG_ENABLE_WDT	0x0000
1762306a36Sopenharmony_ci#define TI_SCI_MSG_WAKE_RESET	0x0001
1862306a36Sopenharmony_ci#define TI_SCI_MSG_VERSION	0x0002
1962306a36Sopenharmony_ci#define TI_SCI_MSG_WAKE_REASON	0x0003
2062306a36Sopenharmony_ci#define TI_SCI_MSG_GOODBYE	0x0004
2162306a36Sopenharmony_ci#define TI_SCI_MSG_SYS_RESET	0x0005
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci/* Device requests */
2462306a36Sopenharmony_ci#define TI_SCI_MSG_SET_DEVICE_STATE	0x0200
2562306a36Sopenharmony_ci#define TI_SCI_MSG_GET_DEVICE_STATE	0x0201
2662306a36Sopenharmony_ci#define TI_SCI_MSG_SET_DEVICE_RESETS	0x0202
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci/* Clock requests */
2962306a36Sopenharmony_ci#define TI_SCI_MSG_SET_CLOCK_STATE	0x0100
3062306a36Sopenharmony_ci#define TI_SCI_MSG_GET_CLOCK_STATE	0x0101
3162306a36Sopenharmony_ci#define TI_SCI_MSG_SET_CLOCK_PARENT	0x0102
3262306a36Sopenharmony_ci#define TI_SCI_MSG_GET_CLOCK_PARENT	0x0103
3362306a36Sopenharmony_ci#define TI_SCI_MSG_GET_NUM_CLOCK_PARENTS 0x0104
3462306a36Sopenharmony_ci#define TI_SCI_MSG_SET_CLOCK_FREQ	0x010c
3562306a36Sopenharmony_ci#define TI_SCI_MSG_QUERY_CLOCK_FREQ	0x010d
3662306a36Sopenharmony_ci#define TI_SCI_MSG_GET_CLOCK_FREQ	0x010e
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ci/* Resource Management Requests */
3962306a36Sopenharmony_ci#define TI_SCI_MSG_GET_RESOURCE_RANGE	0x1500
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci/* IRQ requests */
4262306a36Sopenharmony_ci#define TI_SCI_MSG_SET_IRQ		0x1000
4362306a36Sopenharmony_ci#define TI_SCI_MSG_FREE_IRQ		0x1001
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci/* NAVSS resource management */
4662306a36Sopenharmony_ci/* Ringacc requests */
4762306a36Sopenharmony_ci#define TI_SCI_MSG_RM_RING_ALLOCATE		0x1100
4862306a36Sopenharmony_ci#define TI_SCI_MSG_RM_RING_FREE			0x1101
4962306a36Sopenharmony_ci#define TI_SCI_MSG_RM_RING_RECONFIG		0x1102
5062306a36Sopenharmony_ci#define TI_SCI_MSG_RM_RING_RESET		0x1103
5162306a36Sopenharmony_ci#define TI_SCI_MSG_RM_RING_CFG			0x1110
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci/* PSI-L requests */
5462306a36Sopenharmony_ci#define TI_SCI_MSG_RM_PSIL_PAIR			0x1280
5562306a36Sopenharmony_ci#define TI_SCI_MSG_RM_PSIL_UNPAIR		0x1281
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ci#define TI_SCI_MSG_RM_UDMAP_TX_ALLOC		0x1200
5862306a36Sopenharmony_ci#define TI_SCI_MSG_RM_UDMAP_TX_FREE		0x1201
5962306a36Sopenharmony_ci#define TI_SCI_MSG_RM_UDMAP_RX_ALLOC		0x1210
6062306a36Sopenharmony_ci#define TI_SCI_MSG_RM_UDMAP_RX_FREE		0x1211
6162306a36Sopenharmony_ci#define TI_SCI_MSG_RM_UDMAP_FLOW_CFG		0x1220
6262306a36Sopenharmony_ci#define TI_SCI_MSG_RM_UDMAP_OPT_FLOW_CFG	0x1221
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_ci#define TISCI_MSG_RM_UDMAP_TX_CH_CFG		0x1205
6562306a36Sopenharmony_ci#define TISCI_MSG_RM_UDMAP_TX_CH_GET_CFG	0x1206
6662306a36Sopenharmony_ci#define TISCI_MSG_RM_UDMAP_RX_CH_CFG		0x1215
6762306a36Sopenharmony_ci#define TISCI_MSG_RM_UDMAP_RX_CH_GET_CFG	0x1216
6862306a36Sopenharmony_ci#define TISCI_MSG_RM_UDMAP_FLOW_CFG		0x1230
6962306a36Sopenharmony_ci#define TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_CFG	0x1231
7062306a36Sopenharmony_ci#define TISCI_MSG_RM_UDMAP_FLOW_GET_CFG		0x1232
7162306a36Sopenharmony_ci#define TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_GET_CFG	0x1233
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ci/* Processor Control requests */
7462306a36Sopenharmony_ci#define TI_SCI_MSG_PROC_REQUEST		0xc000
7562306a36Sopenharmony_ci#define TI_SCI_MSG_PROC_RELEASE		0xc001
7662306a36Sopenharmony_ci#define TI_SCI_MSG_PROC_HANDOVER	0xc005
7762306a36Sopenharmony_ci#define TI_SCI_MSG_SET_CONFIG		0xc100
7862306a36Sopenharmony_ci#define TI_SCI_MSG_SET_CTRL		0xc101
7962306a36Sopenharmony_ci#define TI_SCI_MSG_GET_STATUS		0xc400
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ci/**
8262306a36Sopenharmony_ci * struct ti_sci_msg_hdr - Generic Message Header for All messages and responses
8362306a36Sopenharmony_ci * @type:	Type of messages: One of TI_SCI_MSG* values
8462306a36Sopenharmony_ci * @host:	Host of the message
8562306a36Sopenharmony_ci * @seq:	Message identifier indicating a transfer sequence
8662306a36Sopenharmony_ci * @flags:	Flag for the message
8762306a36Sopenharmony_ci */
8862306a36Sopenharmony_cistruct ti_sci_msg_hdr {
8962306a36Sopenharmony_ci	u16 type;
9062306a36Sopenharmony_ci	u8 host;
9162306a36Sopenharmony_ci	u8 seq;
9262306a36Sopenharmony_ci#define TI_SCI_MSG_FLAG(val)			(1 << (val))
9362306a36Sopenharmony_ci#define TI_SCI_FLAG_REQ_GENERIC_NORESPONSE	0x0
9462306a36Sopenharmony_ci#define TI_SCI_FLAG_REQ_ACK_ON_RECEIVED		TI_SCI_MSG_FLAG(0)
9562306a36Sopenharmony_ci#define TI_SCI_FLAG_REQ_ACK_ON_PROCESSED	TI_SCI_MSG_FLAG(1)
9662306a36Sopenharmony_ci#define TI_SCI_FLAG_RESP_GENERIC_NACK		0x0
9762306a36Sopenharmony_ci#define TI_SCI_FLAG_RESP_GENERIC_ACK		TI_SCI_MSG_FLAG(1)
9862306a36Sopenharmony_ci	/* Additional Flags */
9962306a36Sopenharmony_ci	u32 flags;
10062306a36Sopenharmony_ci} __packed;
10162306a36Sopenharmony_ci
10262306a36Sopenharmony_ci/**
10362306a36Sopenharmony_ci * struct ti_sci_msg_resp_version - Response for a message
10462306a36Sopenharmony_ci * @hdr:		Generic header
10562306a36Sopenharmony_ci * @firmware_description: String describing the firmware
10662306a36Sopenharmony_ci * @firmware_revision:	Firmware revision
10762306a36Sopenharmony_ci * @abi_major:		Major version of the ABI that firmware supports
10862306a36Sopenharmony_ci * @abi_minor:		Minor version of the ABI that firmware supports
10962306a36Sopenharmony_ci *
11062306a36Sopenharmony_ci * In general, ABI version changes follow the rule that minor version increments
11162306a36Sopenharmony_ci * are backward compatible. Major revision changes in ABI may not be
11262306a36Sopenharmony_ci * backward compatible.
11362306a36Sopenharmony_ci *
11462306a36Sopenharmony_ci * Response to a generic message with message type TI_SCI_MSG_VERSION
11562306a36Sopenharmony_ci */
11662306a36Sopenharmony_cistruct ti_sci_msg_resp_version {
11762306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
11862306a36Sopenharmony_ci	char firmware_description[32];
11962306a36Sopenharmony_ci	u16 firmware_revision;
12062306a36Sopenharmony_ci	u8 abi_major;
12162306a36Sopenharmony_ci	u8 abi_minor;
12262306a36Sopenharmony_ci} __packed;
12362306a36Sopenharmony_ci
12462306a36Sopenharmony_ci/**
12562306a36Sopenharmony_ci * struct ti_sci_msg_req_reboot - Reboot the SoC
12662306a36Sopenharmony_ci * @hdr:	Generic Header
12762306a36Sopenharmony_ci *
12862306a36Sopenharmony_ci * Request type is TI_SCI_MSG_SYS_RESET, responded with a generic
12962306a36Sopenharmony_ci * ACK/NACK message.
13062306a36Sopenharmony_ci */
13162306a36Sopenharmony_cistruct ti_sci_msg_req_reboot {
13262306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
13362306a36Sopenharmony_ci} __packed;
13462306a36Sopenharmony_ci
13562306a36Sopenharmony_ci/**
13662306a36Sopenharmony_ci * struct ti_sci_msg_req_set_device_state - Set the desired state of the device
13762306a36Sopenharmony_ci * @hdr:		Generic header
13862306a36Sopenharmony_ci * @id:	Indicates which device to modify
13962306a36Sopenharmony_ci * @reserved: Reserved space in message, must be 0 for backward compatibility
14062306a36Sopenharmony_ci * @state: The desired state of the device.
14162306a36Sopenharmony_ci *
14262306a36Sopenharmony_ci * Certain flags can also be set to alter the device state:
14362306a36Sopenharmony_ci * + MSG_FLAG_DEVICE_WAKE_ENABLED - Configure the device to be a wake source.
14462306a36Sopenharmony_ci * The meaning of this flag will vary slightly from device to device and from
14562306a36Sopenharmony_ci * SoC to SoC but it generally allows the device to wake the SoC out of deep
14662306a36Sopenharmony_ci * suspend states.
14762306a36Sopenharmony_ci * + MSG_FLAG_DEVICE_RESET_ISO - Enable reset isolation for this device.
14862306a36Sopenharmony_ci * + MSG_FLAG_DEVICE_EXCLUSIVE - Claim this device exclusively. When passed
14962306a36Sopenharmony_ci * with STATE_RETENTION or STATE_ON, it will claim the device exclusively.
15062306a36Sopenharmony_ci * If another host already has this device set to STATE_RETENTION or STATE_ON,
15162306a36Sopenharmony_ci * the message will fail. Once successful, other hosts attempting to set
15262306a36Sopenharmony_ci * STATE_RETENTION or STATE_ON will fail.
15362306a36Sopenharmony_ci *
15462306a36Sopenharmony_ci * Request type is TI_SCI_MSG_SET_DEVICE_STATE, responded with a generic
15562306a36Sopenharmony_ci * ACK/NACK message.
15662306a36Sopenharmony_ci */
15762306a36Sopenharmony_cistruct ti_sci_msg_req_set_device_state {
15862306a36Sopenharmony_ci	/* Additional hdr->flags options */
15962306a36Sopenharmony_ci#define MSG_FLAG_DEVICE_WAKE_ENABLED	TI_SCI_MSG_FLAG(8)
16062306a36Sopenharmony_ci#define MSG_FLAG_DEVICE_RESET_ISO	TI_SCI_MSG_FLAG(9)
16162306a36Sopenharmony_ci#define MSG_FLAG_DEVICE_EXCLUSIVE	TI_SCI_MSG_FLAG(10)
16262306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
16362306a36Sopenharmony_ci	u32 id;
16462306a36Sopenharmony_ci	u32 reserved;
16562306a36Sopenharmony_ci
16662306a36Sopenharmony_ci#define MSG_DEVICE_SW_STATE_AUTO_OFF	0
16762306a36Sopenharmony_ci#define MSG_DEVICE_SW_STATE_RETENTION	1
16862306a36Sopenharmony_ci#define MSG_DEVICE_SW_STATE_ON		2
16962306a36Sopenharmony_ci	u8 state;
17062306a36Sopenharmony_ci} __packed;
17162306a36Sopenharmony_ci
17262306a36Sopenharmony_ci/**
17362306a36Sopenharmony_ci * struct ti_sci_msg_req_get_device_state - Request to get device.
17462306a36Sopenharmony_ci * @hdr:		Generic header
17562306a36Sopenharmony_ci * @id:		Device Identifier
17662306a36Sopenharmony_ci *
17762306a36Sopenharmony_ci * Request type is TI_SCI_MSG_GET_DEVICE_STATE, responded device state
17862306a36Sopenharmony_ci * information
17962306a36Sopenharmony_ci */
18062306a36Sopenharmony_cistruct ti_sci_msg_req_get_device_state {
18162306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
18262306a36Sopenharmony_ci	u32 id;
18362306a36Sopenharmony_ci} __packed;
18462306a36Sopenharmony_ci
18562306a36Sopenharmony_ci/**
18662306a36Sopenharmony_ci * struct ti_sci_msg_resp_get_device_state - Response to get device request.
18762306a36Sopenharmony_ci * @hdr:		Generic header
18862306a36Sopenharmony_ci * @context_loss_count: Indicates how many times the device has lost context. A
18962306a36Sopenharmony_ci *	driver can use this monotonic counter to determine if the device has
19062306a36Sopenharmony_ci *	lost context since the last time this message was exchanged.
19162306a36Sopenharmony_ci * @resets: Programmed state of the reset lines.
19262306a36Sopenharmony_ci * @programmed_state:	The state as programmed by set_device.
19362306a36Sopenharmony_ci *			- Uses the MSG_DEVICE_SW_* macros
19462306a36Sopenharmony_ci * @current_state:	The actual state of the hardware.
19562306a36Sopenharmony_ci *
19662306a36Sopenharmony_ci * Response to request TI_SCI_MSG_GET_DEVICE_STATE.
19762306a36Sopenharmony_ci */
19862306a36Sopenharmony_cistruct ti_sci_msg_resp_get_device_state {
19962306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
20062306a36Sopenharmony_ci	u32 context_loss_count;
20162306a36Sopenharmony_ci	u32 resets;
20262306a36Sopenharmony_ci	u8 programmed_state;
20362306a36Sopenharmony_ci#define MSG_DEVICE_HW_STATE_OFF		0
20462306a36Sopenharmony_ci#define MSG_DEVICE_HW_STATE_ON		1
20562306a36Sopenharmony_ci#define MSG_DEVICE_HW_STATE_TRANS	2
20662306a36Sopenharmony_ci	u8 current_state;
20762306a36Sopenharmony_ci} __packed;
20862306a36Sopenharmony_ci
20962306a36Sopenharmony_ci/**
21062306a36Sopenharmony_ci * struct ti_sci_msg_req_set_device_resets - Set the desired resets
21162306a36Sopenharmony_ci *				configuration of the device
21262306a36Sopenharmony_ci * @hdr:		Generic header
21362306a36Sopenharmony_ci * @id:	Indicates which device to modify
21462306a36Sopenharmony_ci * @resets: A bit field of resets for the device. The meaning, behavior,
21562306a36Sopenharmony_ci *	and usage of the reset flags are device specific. 0 for a bit
21662306a36Sopenharmony_ci *	indicates releasing the reset represented by that bit while 1
21762306a36Sopenharmony_ci *	indicates keeping it held.
21862306a36Sopenharmony_ci *
21962306a36Sopenharmony_ci * Request type is TI_SCI_MSG_SET_DEVICE_RESETS, responded with a generic
22062306a36Sopenharmony_ci * ACK/NACK message.
22162306a36Sopenharmony_ci */
22262306a36Sopenharmony_cistruct ti_sci_msg_req_set_device_resets {
22362306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
22462306a36Sopenharmony_ci	u32 id;
22562306a36Sopenharmony_ci	u32 resets;
22662306a36Sopenharmony_ci} __packed;
22762306a36Sopenharmony_ci
22862306a36Sopenharmony_ci/**
22962306a36Sopenharmony_ci * struct ti_sci_msg_req_set_clock_state - Request to setup a Clock state
23062306a36Sopenharmony_ci * @hdr:	Generic Header, Certain flags can be set specific to the clocks:
23162306a36Sopenharmony_ci *		MSG_FLAG_CLOCK_ALLOW_SSC: Allow this clock to be modified
23262306a36Sopenharmony_ci *		via spread spectrum clocking.
23362306a36Sopenharmony_ci *		MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE: Allow this clock's
23462306a36Sopenharmony_ci *		frequency to be changed while it is running so long as it
23562306a36Sopenharmony_ci *		is within the min/max limits.
23662306a36Sopenharmony_ci *		MSG_FLAG_CLOCK_INPUT_TERM: Enable input termination, this
23762306a36Sopenharmony_ci *		is only applicable to clock inputs on the SoC pseudo-device.
23862306a36Sopenharmony_ci * @dev_id:	Device identifier this request is for
23962306a36Sopenharmony_ci * @clk_id:	Clock identifier for the device for this request.
24062306a36Sopenharmony_ci *		Each device has it's own set of clock inputs. This indexes
24162306a36Sopenharmony_ci *		which clock input to modify. Set to 255 if clock ID is
24262306a36Sopenharmony_ci *		greater than or equal to 255.
24362306a36Sopenharmony_ci * @request_state: Request the state for the clock to be set to.
24462306a36Sopenharmony_ci *		MSG_CLOCK_SW_STATE_UNREQ: The IP does not require this clock,
24562306a36Sopenharmony_ci *		it can be disabled, regardless of the state of the device
24662306a36Sopenharmony_ci *		MSG_CLOCK_SW_STATE_AUTO: Allow the System Controller to
24762306a36Sopenharmony_ci *		automatically manage the state of this clock. If the device
24862306a36Sopenharmony_ci *		is enabled, then the clock is enabled. If the device is set
24962306a36Sopenharmony_ci *		to off or retention, then the clock is internally set as not
25062306a36Sopenharmony_ci *		being required by the device.(default)
25162306a36Sopenharmony_ci *		MSG_CLOCK_SW_STATE_REQ:  Configure the clock to be enabled,
25262306a36Sopenharmony_ci *		regardless of the state of the device.
25362306a36Sopenharmony_ci * @clk_id_32:	Clock identifier for the device for this request.
25462306a36Sopenharmony_ci *		Only to be used if the clock ID is greater than or equal to
25562306a36Sopenharmony_ci *		255.
25662306a36Sopenharmony_ci *
25762306a36Sopenharmony_ci * Normally, all required clocks are managed by TISCI entity, this is used
25862306a36Sopenharmony_ci * only for specific control *IF* required. Auto managed state is
25962306a36Sopenharmony_ci * MSG_CLOCK_SW_STATE_AUTO, in other states, TISCI entity assume remote
26062306a36Sopenharmony_ci * will explicitly control.
26162306a36Sopenharmony_ci *
26262306a36Sopenharmony_ci * Request type is TI_SCI_MSG_SET_CLOCK_STATE, response is a generic
26362306a36Sopenharmony_ci * ACK or NACK message.
26462306a36Sopenharmony_ci */
26562306a36Sopenharmony_cistruct ti_sci_msg_req_set_clock_state {
26662306a36Sopenharmony_ci	/* Additional hdr->flags options */
26762306a36Sopenharmony_ci#define MSG_FLAG_CLOCK_ALLOW_SSC		TI_SCI_MSG_FLAG(8)
26862306a36Sopenharmony_ci#define MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE	TI_SCI_MSG_FLAG(9)
26962306a36Sopenharmony_ci#define MSG_FLAG_CLOCK_INPUT_TERM		TI_SCI_MSG_FLAG(10)
27062306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
27162306a36Sopenharmony_ci	u32 dev_id;
27262306a36Sopenharmony_ci	u8 clk_id;
27362306a36Sopenharmony_ci#define MSG_CLOCK_SW_STATE_UNREQ	0
27462306a36Sopenharmony_ci#define MSG_CLOCK_SW_STATE_AUTO		1
27562306a36Sopenharmony_ci#define MSG_CLOCK_SW_STATE_REQ		2
27662306a36Sopenharmony_ci	u8 request_state;
27762306a36Sopenharmony_ci	u32 clk_id_32;
27862306a36Sopenharmony_ci} __packed;
27962306a36Sopenharmony_ci
28062306a36Sopenharmony_ci/**
28162306a36Sopenharmony_ci * struct ti_sci_msg_req_get_clock_state - Request for clock state
28262306a36Sopenharmony_ci * @hdr:	Generic Header
28362306a36Sopenharmony_ci * @dev_id:	Device identifier this request is for
28462306a36Sopenharmony_ci * @clk_id:	Clock identifier for the device for this request.
28562306a36Sopenharmony_ci *		Each device has it's own set of clock inputs. This indexes
28662306a36Sopenharmony_ci *		which clock input to get state of. Set to 255 if the clock
28762306a36Sopenharmony_ci *		ID is greater than or equal to 255.
28862306a36Sopenharmony_ci * @clk_id_32:	Clock identifier for the device for the request.
28962306a36Sopenharmony_ci *		Only to be used if the clock ID is greater than or equal to
29062306a36Sopenharmony_ci *		255.
29162306a36Sopenharmony_ci *
29262306a36Sopenharmony_ci * Request type is TI_SCI_MSG_GET_CLOCK_STATE, response is state
29362306a36Sopenharmony_ci * of the clock
29462306a36Sopenharmony_ci */
29562306a36Sopenharmony_cistruct ti_sci_msg_req_get_clock_state {
29662306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
29762306a36Sopenharmony_ci	u32 dev_id;
29862306a36Sopenharmony_ci	u8 clk_id;
29962306a36Sopenharmony_ci	u32 clk_id_32;
30062306a36Sopenharmony_ci} __packed;
30162306a36Sopenharmony_ci
30262306a36Sopenharmony_ci/**
30362306a36Sopenharmony_ci * struct ti_sci_msg_resp_get_clock_state - Response to get clock state
30462306a36Sopenharmony_ci * @hdr:	Generic Header
30562306a36Sopenharmony_ci * @programmed_state: Any programmed state of the clock. This is one of
30662306a36Sopenharmony_ci *		MSG_CLOCK_SW_STATE* values.
30762306a36Sopenharmony_ci * @current_state: Current state of the clock. This is one of:
30862306a36Sopenharmony_ci *		MSG_CLOCK_HW_STATE_NOT_READY: Clock is not ready
30962306a36Sopenharmony_ci *		MSG_CLOCK_HW_STATE_READY: Clock is ready
31062306a36Sopenharmony_ci *
31162306a36Sopenharmony_ci * Response to TI_SCI_MSG_GET_CLOCK_STATE.
31262306a36Sopenharmony_ci */
31362306a36Sopenharmony_cistruct ti_sci_msg_resp_get_clock_state {
31462306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
31562306a36Sopenharmony_ci	u8 programmed_state;
31662306a36Sopenharmony_ci#define MSG_CLOCK_HW_STATE_NOT_READY	0
31762306a36Sopenharmony_ci#define MSG_CLOCK_HW_STATE_READY	1
31862306a36Sopenharmony_ci	u8 current_state;
31962306a36Sopenharmony_ci} __packed;
32062306a36Sopenharmony_ci
32162306a36Sopenharmony_ci/**
32262306a36Sopenharmony_ci * struct ti_sci_msg_req_set_clock_parent - Set the clock parent
32362306a36Sopenharmony_ci * @hdr:	Generic Header
32462306a36Sopenharmony_ci * @dev_id:	Device identifier this request is for
32562306a36Sopenharmony_ci * @clk_id:	Clock identifier for the device for this request.
32662306a36Sopenharmony_ci *		Each device has it's own set of clock inputs. This indexes
32762306a36Sopenharmony_ci *		which clock input to modify. Set to 255 if clock ID is
32862306a36Sopenharmony_ci *		greater than or equal to 255.
32962306a36Sopenharmony_ci * @parent_id:	The new clock parent is selectable by an index via this
33062306a36Sopenharmony_ci *		parameter. Set to 255 if clock ID is greater than or
33162306a36Sopenharmony_ci *		equal to 255.
33262306a36Sopenharmony_ci * @clk_id_32:	Clock identifier if @clk_id field is 255.
33362306a36Sopenharmony_ci * @parent_id_32:	Parent identifier if @parent_id is 255.
33462306a36Sopenharmony_ci *
33562306a36Sopenharmony_ci * Request type is TI_SCI_MSG_SET_CLOCK_PARENT, response is generic
33662306a36Sopenharmony_ci * ACK / NACK message.
33762306a36Sopenharmony_ci */
33862306a36Sopenharmony_cistruct ti_sci_msg_req_set_clock_parent {
33962306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
34062306a36Sopenharmony_ci	u32 dev_id;
34162306a36Sopenharmony_ci	u8 clk_id;
34262306a36Sopenharmony_ci	u8 parent_id;
34362306a36Sopenharmony_ci	u32 clk_id_32;
34462306a36Sopenharmony_ci	u32 parent_id_32;
34562306a36Sopenharmony_ci} __packed;
34662306a36Sopenharmony_ci
34762306a36Sopenharmony_ci/**
34862306a36Sopenharmony_ci * struct ti_sci_msg_req_get_clock_parent - Get the clock parent
34962306a36Sopenharmony_ci * @hdr:	Generic Header
35062306a36Sopenharmony_ci * @dev_id:	Device identifier this request is for
35162306a36Sopenharmony_ci * @clk_id:	Clock identifier for the device for this request.
35262306a36Sopenharmony_ci *		Each device has it's own set of clock inputs. This indexes
35362306a36Sopenharmony_ci *		which clock input to get the parent for. If this field
35462306a36Sopenharmony_ci *		contains 255, the actual clock identifier is stored in
35562306a36Sopenharmony_ci *		@clk_id_32.
35662306a36Sopenharmony_ci * @clk_id_32:	Clock identifier if the @clk_id field contains 255.
35762306a36Sopenharmony_ci *
35862306a36Sopenharmony_ci * Request type is TI_SCI_MSG_GET_CLOCK_PARENT, response is parent information
35962306a36Sopenharmony_ci */
36062306a36Sopenharmony_cistruct ti_sci_msg_req_get_clock_parent {
36162306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
36262306a36Sopenharmony_ci	u32 dev_id;
36362306a36Sopenharmony_ci	u8 clk_id;
36462306a36Sopenharmony_ci	u32 clk_id_32;
36562306a36Sopenharmony_ci} __packed;
36662306a36Sopenharmony_ci
36762306a36Sopenharmony_ci/**
36862306a36Sopenharmony_ci * struct ti_sci_msg_resp_get_clock_parent - Response with clock parent
36962306a36Sopenharmony_ci * @hdr:	Generic Header
37062306a36Sopenharmony_ci * @parent_id:	The current clock parent. If set to 255, the current parent
37162306a36Sopenharmony_ci *		ID can be found from the @parent_id_32 field.
37262306a36Sopenharmony_ci * @parent_id_32:	Current clock parent if @parent_id field is set to
37362306a36Sopenharmony_ci *			255.
37462306a36Sopenharmony_ci *
37562306a36Sopenharmony_ci * Response to TI_SCI_MSG_GET_CLOCK_PARENT.
37662306a36Sopenharmony_ci */
37762306a36Sopenharmony_cistruct ti_sci_msg_resp_get_clock_parent {
37862306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
37962306a36Sopenharmony_ci	u8 parent_id;
38062306a36Sopenharmony_ci	u32 parent_id_32;
38162306a36Sopenharmony_ci} __packed;
38262306a36Sopenharmony_ci
38362306a36Sopenharmony_ci/**
38462306a36Sopenharmony_ci * struct ti_sci_msg_req_get_clock_num_parents - Request to get clock parents
38562306a36Sopenharmony_ci * @hdr:	Generic header
38662306a36Sopenharmony_ci * @dev_id:	Device identifier this request is for
38762306a36Sopenharmony_ci * @clk_id:	Clock identifier for the device for this request. Set to
38862306a36Sopenharmony_ci *		255 if clock ID is greater than or equal to 255.
38962306a36Sopenharmony_ci * @clk_id_32:	Clock identifier if the @clk_id field contains 255.
39062306a36Sopenharmony_ci *
39162306a36Sopenharmony_ci * This request provides information about how many clock parent options
39262306a36Sopenharmony_ci * are available for a given clock to a device. This is typically used
39362306a36Sopenharmony_ci * for input clocks.
39462306a36Sopenharmony_ci *
39562306a36Sopenharmony_ci * Request type is TI_SCI_MSG_GET_NUM_CLOCK_PARENTS, response is appropriate
39662306a36Sopenharmony_ci * message, or NACK in case of inability to satisfy request.
39762306a36Sopenharmony_ci */
39862306a36Sopenharmony_cistruct ti_sci_msg_req_get_clock_num_parents {
39962306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
40062306a36Sopenharmony_ci	u32 dev_id;
40162306a36Sopenharmony_ci	u8 clk_id;
40262306a36Sopenharmony_ci	u32 clk_id_32;
40362306a36Sopenharmony_ci} __packed;
40462306a36Sopenharmony_ci
40562306a36Sopenharmony_ci/**
40662306a36Sopenharmony_ci * struct ti_sci_msg_resp_get_clock_num_parents - Response for get clk parents
40762306a36Sopenharmony_ci * @hdr:		Generic header
40862306a36Sopenharmony_ci * @num_parents:	Number of clock parents. If set to 255, the actual
40962306a36Sopenharmony_ci *			number of parents is stored into @num_parents_32
41062306a36Sopenharmony_ci *			field instead.
41162306a36Sopenharmony_ci * @num_parents_32:	Number of clock parents if @num_parents field is
41262306a36Sopenharmony_ci *			set to 255.
41362306a36Sopenharmony_ci *
41462306a36Sopenharmony_ci * Response to TI_SCI_MSG_GET_NUM_CLOCK_PARENTS
41562306a36Sopenharmony_ci */
41662306a36Sopenharmony_cistruct ti_sci_msg_resp_get_clock_num_parents {
41762306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
41862306a36Sopenharmony_ci	u8 num_parents;
41962306a36Sopenharmony_ci	u32 num_parents_32;
42062306a36Sopenharmony_ci} __packed;
42162306a36Sopenharmony_ci
42262306a36Sopenharmony_ci/**
42362306a36Sopenharmony_ci * struct ti_sci_msg_req_query_clock_freq - Request to query a frequency
42462306a36Sopenharmony_ci * @hdr:	Generic Header
42562306a36Sopenharmony_ci * @dev_id:	Device identifier this request is for
42662306a36Sopenharmony_ci * @min_freq_hz: The minimum allowable frequency in Hz. This is the minimum
42762306a36Sopenharmony_ci *		allowable programmed frequency and does not account for clock
42862306a36Sopenharmony_ci *		tolerances and jitter.
42962306a36Sopenharmony_ci * @target_freq_hz: The target clock frequency. A frequency will be found
43062306a36Sopenharmony_ci *		as close to this target frequency as possible.
43162306a36Sopenharmony_ci * @max_freq_hz: The maximum allowable frequency in Hz. This is the maximum
43262306a36Sopenharmony_ci *		allowable programmed frequency and does not account for clock
43362306a36Sopenharmony_ci *		tolerances and jitter.
43462306a36Sopenharmony_ci * @clk_id:	Clock identifier for the device for this request. Set to
43562306a36Sopenharmony_ci *		255 if clock identifier is greater than or equal to 255.
43662306a36Sopenharmony_ci * @clk_id_32:	Clock identifier if @clk_id is set to 255.
43762306a36Sopenharmony_ci *
43862306a36Sopenharmony_ci * NOTE: Normally clock frequency management is automatically done by TISCI
43962306a36Sopenharmony_ci * entity. In case of specific requests, TISCI evaluates capability to achieve
44062306a36Sopenharmony_ci * requested frequency within provided range and responds with
44162306a36Sopenharmony_ci * result message.
44262306a36Sopenharmony_ci *
44362306a36Sopenharmony_ci * Request type is TI_SCI_MSG_QUERY_CLOCK_FREQ, response is appropriate message,
44462306a36Sopenharmony_ci * or NACK in case of inability to satisfy request.
44562306a36Sopenharmony_ci */
44662306a36Sopenharmony_cistruct ti_sci_msg_req_query_clock_freq {
44762306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
44862306a36Sopenharmony_ci	u32 dev_id;
44962306a36Sopenharmony_ci	u64 min_freq_hz;
45062306a36Sopenharmony_ci	u64 target_freq_hz;
45162306a36Sopenharmony_ci	u64 max_freq_hz;
45262306a36Sopenharmony_ci	u8 clk_id;
45362306a36Sopenharmony_ci	u32 clk_id_32;
45462306a36Sopenharmony_ci} __packed;
45562306a36Sopenharmony_ci
45662306a36Sopenharmony_ci/**
45762306a36Sopenharmony_ci * struct ti_sci_msg_resp_query_clock_freq - Response to a clock frequency query
45862306a36Sopenharmony_ci * @hdr:	Generic Header
45962306a36Sopenharmony_ci * @freq_hz:	Frequency that is the best match in Hz.
46062306a36Sopenharmony_ci *
46162306a36Sopenharmony_ci * Response to request type TI_SCI_MSG_QUERY_CLOCK_FREQ. NOTE: if the request
46262306a36Sopenharmony_ci * cannot be satisfied, the message will be of type NACK.
46362306a36Sopenharmony_ci */
46462306a36Sopenharmony_cistruct ti_sci_msg_resp_query_clock_freq {
46562306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
46662306a36Sopenharmony_ci	u64 freq_hz;
46762306a36Sopenharmony_ci} __packed;
46862306a36Sopenharmony_ci
46962306a36Sopenharmony_ci/**
47062306a36Sopenharmony_ci * struct ti_sci_msg_req_set_clock_freq - Request to setup a clock frequency
47162306a36Sopenharmony_ci * @hdr:	Generic Header
47262306a36Sopenharmony_ci * @dev_id:	Device identifier this request is for
47362306a36Sopenharmony_ci * @min_freq_hz: The minimum allowable frequency in Hz. This is the minimum
47462306a36Sopenharmony_ci *		allowable programmed frequency and does not account for clock
47562306a36Sopenharmony_ci *		tolerances and jitter.
47662306a36Sopenharmony_ci * @target_freq_hz: The target clock frequency. The clock will be programmed
47762306a36Sopenharmony_ci *		at a rate as close to this target frequency as possible.
47862306a36Sopenharmony_ci * @max_freq_hz: The maximum allowable frequency in Hz. This is the maximum
47962306a36Sopenharmony_ci *		allowable programmed frequency and does not account for clock
48062306a36Sopenharmony_ci *		tolerances and jitter.
48162306a36Sopenharmony_ci * @clk_id:	Clock identifier for the device for this request. Set to
48262306a36Sopenharmony_ci *		255 if clock ID is greater than or equal to 255.
48362306a36Sopenharmony_ci * @clk_id_32:	Clock identifier if @clk_id field is set to 255.
48462306a36Sopenharmony_ci *
48562306a36Sopenharmony_ci * NOTE: Normally clock frequency management is automatically done by TISCI
48662306a36Sopenharmony_ci * entity. In case of specific requests, TISCI evaluates capability to achieve
48762306a36Sopenharmony_ci * requested range and responds with success/failure message.
48862306a36Sopenharmony_ci *
48962306a36Sopenharmony_ci * This sets the desired frequency for a clock within an allowable
49062306a36Sopenharmony_ci * range. This message will fail on an enabled clock unless
49162306a36Sopenharmony_ci * MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE is set for the clock. Additionally,
49262306a36Sopenharmony_ci * if other clocks have their frequency modified due to this message,
49362306a36Sopenharmony_ci * they also must have the MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE or be disabled.
49462306a36Sopenharmony_ci *
49562306a36Sopenharmony_ci * Calling set frequency on a clock input to the SoC pseudo-device will
49662306a36Sopenharmony_ci * inform the PMMC of that clock's frequency. Setting a frequency of
49762306a36Sopenharmony_ci * zero will indicate the clock is disabled.
49862306a36Sopenharmony_ci *
49962306a36Sopenharmony_ci * Calling set frequency on clock outputs from the SoC pseudo-device will
50062306a36Sopenharmony_ci * function similarly to setting the clock frequency on a device.
50162306a36Sopenharmony_ci *
50262306a36Sopenharmony_ci * Request type is TI_SCI_MSG_SET_CLOCK_FREQ, response is a generic ACK/NACK
50362306a36Sopenharmony_ci * message.
50462306a36Sopenharmony_ci */
50562306a36Sopenharmony_cistruct ti_sci_msg_req_set_clock_freq {
50662306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
50762306a36Sopenharmony_ci	u32 dev_id;
50862306a36Sopenharmony_ci	u64 min_freq_hz;
50962306a36Sopenharmony_ci	u64 target_freq_hz;
51062306a36Sopenharmony_ci	u64 max_freq_hz;
51162306a36Sopenharmony_ci	u8 clk_id;
51262306a36Sopenharmony_ci	u32 clk_id_32;
51362306a36Sopenharmony_ci} __packed;
51462306a36Sopenharmony_ci
51562306a36Sopenharmony_ci/**
51662306a36Sopenharmony_ci * struct ti_sci_msg_req_get_clock_freq - Request to get the clock frequency
51762306a36Sopenharmony_ci * @hdr:	Generic Header
51862306a36Sopenharmony_ci * @dev_id:	Device identifier this request is for
51962306a36Sopenharmony_ci * @clk_id:	Clock identifier for the device for this request. Set to
52062306a36Sopenharmony_ci *		255 if clock ID is greater than or equal to 255.
52162306a36Sopenharmony_ci * @clk_id_32:	Clock identifier if @clk_id field is set to 255.
52262306a36Sopenharmony_ci *
52362306a36Sopenharmony_ci * NOTE: Normally clock frequency management is automatically done by TISCI
52462306a36Sopenharmony_ci * entity. In some cases, clock frequencies are configured by host.
52562306a36Sopenharmony_ci *
52662306a36Sopenharmony_ci * Request type is TI_SCI_MSG_GET_CLOCK_FREQ, responded with clock frequency
52762306a36Sopenharmony_ci * that the clock is currently at.
52862306a36Sopenharmony_ci */
52962306a36Sopenharmony_cistruct ti_sci_msg_req_get_clock_freq {
53062306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
53162306a36Sopenharmony_ci	u32 dev_id;
53262306a36Sopenharmony_ci	u8 clk_id;
53362306a36Sopenharmony_ci	u32 clk_id_32;
53462306a36Sopenharmony_ci} __packed;
53562306a36Sopenharmony_ci
53662306a36Sopenharmony_ci/**
53762306a36Sopenharmony_ci * struct ti_sci_msg_resp_get_clock_freq - Response of clock frequency request
53862306a36Sopenharmony_ci * @hdr:	Generic Header
53962306a36Sopenharmony_ci * @freq_hz:	Frequency that the clock is currently on, in Hz.
54062306a36Sopenharmony_ci *
54162306a36Sopenharmony_ci * Response to request type TI_SCI_MSG_GET_CLOCK_FREQ.
54262306a36Sopenharmony_ci */
54362306a36Sopenharmony_cistruct ti_sci_msg_resp_get_clock_freq {
54462306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
54562306a36Sopenharmony_ci	u64 freq_hz;
54662306a36Sopenharmony_ci} __packed;
54762306a36Sopenharmony_ci
54862306a36Sopenharmony_ci#define TI_SCI_IRQ_SECONDARY_HOST_INVALID	0xff
54962306a36Sopenharmony_ci
55062306a36Sopenharmony_ci/**
55162306a36Sopenharmony_ci * struct ti_sci_msg_req_get_resource_range - Request to get a host's assigned
55262306a36Sopenharmony_ci *					      range of resources.
55362306a36Sopenharmony_ci * @hdr:		Generic Header
55462306a36Sopenharmony_ci * @type:		Unique resource assignment type
55562306a36Sopenharmony_ci * @subtype:		Resource assignment subtype within the resource type.
55662306a36Sopenharmony_ci * @secondary_host:	Host processing entity to which the resources are
55762306a36Sopenharmony_ci *			allocated. This is required only when the destination
55862306a36Sopenharmony_ci *			host id id different from ti sci interface host id,
55962306a36Sopenharmony_ci *			else TI_SCI_IRQ_SECONDARY_HOST_INVALID can be passed.
56062306a36Sopenharmony_ci *
56162306a36Sopenharmony_ci * Request type is TI_SCI_MSG_GET_RESOURCE_RANGE. Responded with requested
56262306a36Sopenharmony_ci * resource range which is of type TI_SCI_MSG_GET_RESOURCE_RANGE.
56362306a36Sopenharmony_ci */
56462306a36Sopenharmony_cistruct ti_sci_msg_req_get_resource_range {
56562306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
56662306a36Sopenharmony_ci#define MSG_RM_RESOURCE_TYPE_MASK	GENMASK(9, 0)
56762306a36Sopenharmony_ci#define MSG_RM_RESOURCE_SUBTYPE_MASK	GENMASK(5, 0)
56862306a36Sopenharmony_ci	u16 type;
56962306a36Sopenharmony_ci	u8 subtype;
57062306a36Sopenharmony_ci	u8 secondary_host;
57162306a36Sopenharmony_ci} __packed;
57262306a36Sopenharmony_ci
57362306a36Sopenharmony_ci/**
57462306a36Sopenharmony_ci * struct ti_sci_msg_resp_get_resource_range - Response to resource get range.
57562306a36Sopenharmony_ci * @hdr:		Generic Header
57662306a36Sopenharmony_ci * @range_start:	Start index of the first resource range.
57762306a36Sopenharmony_ci * @range_num:		Number of resources in the first range.
57862306a36Sopenharmony_ci * @range_start_sec:	Start index of the second resource range.
57962306a36Sopenharmony_ci * @range_num_sec:	Number of resources in the second range.
58062306a36Sopenharmony_ci *
58162306a36Sopenharmony_ci * Response to request TI_SCI_MSG_GET_RESOURCE_RANGE.
58262306a36Sopenharmony_ci */
58362306a36Sopenharmony_cistruct ti_sci_msg_resp_get_resource_range {
58462306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
58562306a36Sopenharmony_ci	u16 range_start;
58662306a36Sopenharmony_ci	u16 range_num;
58762306a36Sopenharmony_ci	u16 range_start_sec;
58862306a36Sopenharmony_ci	u16 range_num_sec;
58962306a36Sopenharmony_ci} __packed;
59062306a36Sopenharmony_ci
59162306a36Sopenharmony_ci/**
59262306a36Sopenharmony_ci * struct ti_sci_msg_req_manage_irq - Request to configure/release the route
59362306a36Sopenharmony_ci *					between the dev and the host.
59462306a36Sopenharmony_ci * @hdr:		Generic Header
59562306a36Sopenharmony_ci * @valid_params:	Bit fields defining the validity of interrupt source
59662306a36Sopenharmony_ci *			parameters. If a bit is not set, then corresponding
59762306a36Sopenharmony_ci *			field is not valid and will not be used for route set.
59862306a36Sopenharmony_ci *			Bit field definitions:
59962306a36Sopenharmony_ci *			0 - Valid bit for @dst_id
60062306a36Sopenharmony_ci *			1 - Valid bit for @dst_host_irq
60162306a36Sopenharmony_ci *			2 - Valid bit for @ia_id
60262306a36Sopenharmony_ci *			3 - Valid bit for @vint
60362306a36Sopenharmony_ci *			4 - Valid bit for @global_event
60462306a36Sopenharmony_ci *			5 - Valid bit for @vint_status_bit_index
60562306a36Sopenharmony_ci *			31 - Valid bit for @secondary_host
60662306a36Sopenharmony_ci * @src_id:		IRQ source peripheral ID.
60762306a36Sopenharmony_ci * @src_index:		IRQ source index within the peripheral
60862306a36Sopenharmony_ci * @dst_id:		IRQ Destination ID. Based on the architecture it can be
60962306a36Sopenharmony_ci *			IRQ controller or host processor ID.
61062306a36Sopenharmony_ci * @dst_host_irq:	IRQ number of the destination host IRQ controller
61162306a36Sopenharmony_ci * @ia_id:		Device ID of the interrupt aggregator in which the
61262306a36Sopenharmony_ci *			vint resides.
61362306a36Sopenharmony_ci * @vint:		Virtual interrupt number if the interrupt route
61462306a36Sopenharmony_ci *			is through an interrupt aggregator.
61562306a36Sopenharmony_ci * @global_event:	Global event that is to be mapped to interrupt
61662306a36Sopenharmony_ci *			aggregator virtual interrupt status bit.
61762306a36Sopenharmony_ci * @vint_status_bit:	Virtual interrupt status bit if the interrupt route
61862306a36Sopenharmony_ci *			utilizes an interrupt aggregator status bit.
61962306a36Sopenharmony_ci * @secondary_host:	Host ID of the IRQ destination computing entity. This is
62062306a36Sopenharmony_ci *			required only when destination host id is different
62162306a36Sopenharmony_ci *			from ti sci interface host id.
62262306a36Sopenharmony_ci *
62362306a36Sopenharmony_ci * Request type is TI_SCI_MSG_SET/RELEASE_IRQ.
62462306a36Sopenharmony_ci * Response is generic ACK / NACK message.
62562306a36Sopenharmony_ci */
62662306a36Sopenharmony_cistruct ti_sci_msg_req_manage_irq {
62762306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
62862306a36Sopenharmony_ci#define MSG_FLAG_DST_ID_VALID			TI_SCI_MSG_FLAG(0)
62962306a36Sopenharmony_ci#define MSG_FLAG_DST_HOST_IRQ_VALID		TI_SCI_MSG_FLAG(1)
63062306a36Sopenharmony_ci#define MSG_FLAG_IA_ID_VALID			TI_SCI_MSG_FLAG(2)
63162306a36Sopenharmony_ci#define MSG_FLAG_VINT_VALID			TI_SCI_MSG_FLAG(3)
63262306a36Sopenharmony_ci#define MSG_FLAG_GLB_EVNT_VALID			TI_SCI_MSG_FLAG(4)
63362306a36Sopenharmony_ci#define MSG_FLAG_VINT_STS_BIT_VALID		TI_SCI_MSG_FLAG(5)
63462306a36Sopenharmony_ci#define MSG_FLAG_SHOST_VALID			TI_SCI_MSG_FLAG(31)
63562306a36Sopenharmony_ci	u32 valid_params;
63662306a36Sopenharmony_ci	u16 src_id;
63762306a36Sopenharmony_ci	u16 src_index;
63862306a36Sopenharmony_ci	u16 dst_id;
63962306a36Sopenharmony_ci	u16 dst_host_irq;
64062306a36Sopenharmony_ci	u16 ia_id;
64162306a36Sopenharmony_ci	u16 vint;
64262306a36Sopenharmony_ci	u16 global_event;
64362306a36Sopenharmony_ci	u8 vint_status_bit;
64462306a36Sopenharmony_ci	u8 secondary_host;
64562306a36Sopenharmony_ci} __packed;
64662306a36Sopenharmony_ci
64762306a36Sopenharmony_ci/**
64862306a36Sopenharmony_ci * struct ti_sci_msg_rm_ring_cfg_req - Configure a Navigator Subsystem ring
64962306a36Sopenharmony_ci *
65062306a36Sopenharmony_ci * Configures the non-real-time registers of a Navigator Subsystem ring.
65162306a36Sopenharmony_ci * @hdr:	Generic Header
65262306a36Sopenharmony_ci * @valid_params: Bitfield defining validity of ring configuration parameters.
65362306a36Sopenharmony_ci *	The ring configuration fields are not valid, and will not be used for
65462306a36Sopenharmony_ci *	ring configuration, if their corresponding valid bit is zero.
65562306a36Sopenharmony_ci *	Valid bit usage:
65662306a36Sopenharmony_ci *	0 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_lo
65762306a36Sopenharmony_ci *	1 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_hi
65862306a36Sopenharmony_ci *	2 - Valid bit for @tisci_msg_rm_ring_cfg_req count
65962306a36Sopenharmony_ci *	3 - Valid bit for @tisci_msg_rm_ring_cfg_req mode
66062306a36Sopenharmony_ci *	4 - Valid bit for @tisci_msg_rm_ring_cfg_req size
66162306a36Sopenharmony_ci *	5 - Valid bit for @tisci_msg_rm_ring_cfg_req order_id
66262306a36Sopenharmony_ci *	6 - Valid bit for @tisci_msg_rm_ring_cfg_req virtid
66362306a36Sopenharmony_ci *	7 - Valid bit for @tisci_msg_rm_ring_cfg_req ASEL
66462306a36Sopenharmony_ci * @nav_id: Device ID of Navigator Subsystem from which the ring is allocated
66562306a36Sopenharmony_ci * @index: ring index to be configured.
66662306a36Sopenharmony_ci * @addr_lo: 32 LSBs of ring base address to be programmed into the ring's
66762306a36Sopenharmony_ci *	RING_BA_LO register
66862306a36Sopenharmony_ci * @addr_hi: 16 MSBs of ring base address to be programmed into the ring's
66962306a36Sopenharmony_ci *	RING_BA_HI register.
67062306a36Sopenharmony_ci * @count: Number of ring elements. Must be even if mode is CREDENTIALS or QM
67162306a36Sopenharmony_ci *	modes.
67262306a36Sopenharmony_ci * @mode: Specifies the mode the ring is to be configured.
67362306a36Sopenharmony_ci * @size: Specifies encoded ring element size. To calculate the encoded size use
67462306a36Sopenharmony_ci *	the formula (log2(size_bytes) - 2), where size_bytes cannot be
67562306a36Sopenharmony_ci *	greater than 256.
67662306a36Sopenharmony_ci * @order_id: Specifies the ring's bus order ID.
67762306a36Sopenharmony_ci * @virtid: Ring virt ID value
67862306a36Sopenharmony_ci * @asel: Ring ASEL (address select) value to be set into the ASEL field of the
67962306a36Sopenharmony_ci *	ring's RING_BA_HI register.
68062306a36Sopenharmony_ci */
68162306a36Sopenharmony_cistruct ti_sci_msg_rm_ring_cfg_req {
68262306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
68362306a36Sopenharmony_ci	u32 valid_params;
68462306a36Sopenharmony_ci	u16 nav_id;
68562306a36Sopenharmony_ci	u16 index;
68662306a36Sopenharmony_ci	u32 addr_lo;
68762306a36Sopenharmony_ci	u32 addr_hi;
68862306a36Sopenharmony_ci	u32 count;
68962306a36Sopenharmony_ci	u8 mode;
69062306a36Sopenharmony_ci	u8 size;
69162306a36Sopenharmony_ci	u8 order_id;
69262306a36Sopenharmony_ci	u16 virtid;
69362306a36Sopenharmony_ci	u8 asel;
69462306a36Sopenharmony_ci} __packed;
69562306a36Sopenharmony_ci
69662306a36Sopenharmony_ci/**
69762306a36Sopenharmony_ci * struct ti_sci_msg_psil_pair - Pairs a PSI-L source thread to a destination
69862306a36Sopenharmony_ci *				 thread
69962306a36Sopenharmony_ci * @hdr:	Generic Header
70062306a36Sopenharmony_ci * @nav_id:	SoC Navigator Subsystem device ID whose PSI-L config proxy is
70162306a36Sopenharmony_ci *		used to pair the source and destination threads.
70262306a36Sopenharmony_ci * @src_thread:	PSI-L source thread ID within the PSI-L System thread map.
70362306a36Sopenharmony_ci *
70462306a36Sopenharmony_ci * UDMAP transmit channels mapped to source threads will have their
70562306a36Sopenharmony_ci * TCHAN_THRD_ID register programmed with the destination thread if the pairing
70662306a36Sopenharmony_ci * is successful.
70762306a36Sopenharmony_ci
70862306a36Sopenharmony_ci * @dst_thread: PSI-L destination thread ID within the PSI-L System thread map.
70962306a36Sopenharmony_ci * PSI-L destination threads start at index 0x8000.  The request is NACK'd if
71062306a36Sopenharmony_ci * the destination thread is not greater than or equal to 0x8000.
71162306a36Sopenharmony_ci *
71262306a36Sopenharmony_ci * UDMAP receive channels mapped to destination threads will have their
71362306a36Sopenharmony_ci * RCHAN_THRD_ID register programmed with the source thread if the pairing
71462306a36Sopenharmony_ci * is successful.
71562306a36Sopenharmony_ci *
71662306a36Sopenharmony_ci * Request type is TI_SCI_MSG_RM_PSIL_PAIR, response is a generic ACK or NACK
71762306a36Sopenharmony_ci * message.
71862306a36Sopenharmony_ci */
71962306a36Sopenharmony_cistruct ti_sci_msg_psil_pair {
72062306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
72162306a36Sopenharmony_ci	u32 nav_id;
72262306a36Sopenharmony_ci	u32 src_thread;
72362306a36Sopenharmony_ci	u32 dst_thread;
72462306a36Sopenharmony_ci} __packed;
72562306a36Sopenharmony_ci
72662306a36Sopenharmony_ci/**
72762306a36Sopenharmony_ci * struct ti_sci_msg_psil_unpair - Unpairs a PSI-L source thread from a
72862306a36Sopenharmony_ci *				   destination thread
72962306a36Sopenharmony_ci * @hdr:	Generic Header
73062306a36Sopenharmony_ci * @nav_id:	SoC Navigator Subsystem device ID whose PSI-L config proxy is
73162306a36Sopenharmony_ci *		used to unpair the source and destination threads.
73262306a36Sopenharmony_ci * @src_thread:	PSI-L source thread ID within the PSI-L System thread map.
73362306a36Sopenharmony_ci *
73462306a36Sopenharmony_ci * UDMAP transmit channels mapped to source threads will have their
73562306a36Sopenharmony_ci * TCHAN_THRD_ID register cleared if the unpairing is successful.
73662306a36Sopenharmony_ci *
73762306a36Sopenharmony_ci * @dst_thread: PSI-L destination thread ID within the PSI-L System thread map.
73862306a36Sopenharmony_ci * PSI-L destination threads start at index 0x8000.  The request is NACK'd if
73962306a36Sopenharmony_ci * the destination thread is not greater than or equal to 0x8000.
74062306a36Sopenharmony_ci *
74162306a36Sopenharmony_ci * UDMAP receive channels mapped to destination threads will have their
74262306a36Sopenharmony_ci * RCHAN_THRD_ID register cleared if the unpairing is successful.
74362306a36Sopenharmony_ci *
74462306a36Sopenharmony_ci * Request type is TI_SCI_MSG_RM_PSIL_UNPAIR, response is a generic ACK or NACK
74562306a36Sopenharmony_ci * message.
74662306a36Sopenharmony_ci */
74762306a36Sopenharmony_cistruct ti_sci_msg_psil_unpair {
74862306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
74962306a36Sopenharmony_ci	u32 nav_id;
75062306a36Sopenharmony_ci	u32 src_thread;
75162306a36Sopenharmony_ci	u32 dst_thread;
75262306a36Sopenharmony_ci} __packed;
75362306a36Sopenharmony_ci
75462306a36Sopenharmony_ci/**
75562306a36Sopenharmony_ci * struct ti_sci_msg_udmap_rx_flow_cfg -  UDMAP receive flow configuration
75662306a36Sopenharmony_ci *					  message
75762306a36Sopenharmony_ci * @hdr: Generic Header
75862306a36Sopenharmony_ci * @nav_id: SoC Navigator Subsystem device ID from which the receive flow is
75962306a36Sopenharmony_ci *	allocated
76062306a36Sopenharmony_ci * @flow_index: UDMAP receive flow index for non-optional configuration.
76162306a36Sopenharmony_ci * @rx_ch_index: Specifies the index of the receive channel using the flow_index
76262306a36Sopenharmony_ci * @rx_einfo_present: UDMAP receive flow extended packet info present.
76362306a36Sopenharmony_ci * @rx_psinfo_present: UDMAP receive flow PS words present.
76462306a36Sopenharmony_ci * @rx_error_handling: UDMAP receive flow error handling configuration. Valid
76562306a36Sopenharmony_ci *	values are TI_SCI_RM_UDMAP_RX_FLOW_ERR_DROP/RETRY.
76662306a36Sopenharmony_ci * @rx_desc_type: UDMAP receive flow descriptor type. It can be one of
76762306a36Sopenharmony_ci *	TI_SCI_RM_UDMAP_RX_FLOW_DESC_HOST/MONO.
76862306a36Sopenharmony_ci * @rx_sop_offset: UDMAP receive flow start of packet offset.
76962306a36Sopenharmony_ci * @rx_dest_qnum: UDMAP receive flow destination queue number.
77062306a36Sopenharmony_ci * @rx_ps_location: UDMAP receive flow PS words location.
77162306a36Sopenharmony_ci *	0 - end of packet descriptor
77262306a36Sopenharmony_ci *	1 - Beginning of the data buffer
77362306a36Sopenharmony_ci * @rx_src_tag_hi: UDMAP receive flow source tag high byte constant
77462306a36Sopenharmony_ci * @rx_src_tag_lo: UDMAP receive flow source tag low byte constant
77562306a36Sopenharmony_ci * @rx_dest_tag_hi: UDMAP receive flow destination tag high byte constant
77662306a36Sopenharmony_ci * @rx_dest_tag_lo: UDMAP receive flow destination tag low byte constant
77762306a36Sopenharmony_ci * @rx_src_tag_hi_sel: UDMAP receive flow source tag high byte selector
77862306a36Sopenharmony_ci * @rx_src_tag_lo_sel: UDMAP receive flow source tag low byte selector
77962306a36Sopenharmony_ci * @rx_dest_tag_hi_sel: UDMAP receive flow destination tag high byte selector
78062306a36Sopenharmony_ci * @rx_dest_tag_lo_sel: UDMAP receive flow destination tag low byte selector
78162306a36Sopenharmony_ci * @rx_size_thresh_en: UDMAP receive flow packet size based free buffer queue
78262306a36Sopenharmony_ci *	enable. If enabled, the ti_sci_rm_udmap_rx_flow_opt_cfg also need to be
78362306a36Sopenharmony_ci *	configured and sent.
78462306a36Sopenharmony_ci * @rx_fdq0_sz0_qnum: UDMAP receive flow free descriptor queue 0.
78562306a36Sopenharmony_ci * @rx_fdq1_qnum: UDMAP receive flow free descriptor queue 1.
78662306a36Sopenharmony_ci * @rx_fdq2_qnum: UDMAP receive flow free descriptor queue 2.
78762306a36Sopenharmony_ci * @rx_fdq3_qnum: UDMAP receive flow free descriptor queue 3.
78862306a36Sopenharmony_ci *
78962306a36Sopenharmony_ci * For detailed information on the settings, see the UDMAP section of the TRM.
79062306a36Sopenharmony_ci */
79162306a36Sopenharmony_cistruct ti_sci_msg_udmap_rx_flow_cfg {
79262306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
79362306a36Sopenharmony_ci	u32 nav_id;
79462306a36Sopenharmony_ci	u32 flow_index;
79562306a36Sopenharmony_ci	u32 rx_ch_index;
79662306a36Sopenharmony_ci	u8 rx_einfo_present;
79762306a36Sopenharmony_ci	u8 rx_psinfo_present;
79862306a36Sopenharmony_ci	u8 rx_error_handling;
79962306a36Sopenharmony_ci	u8 rx_desc_type;
80062306a36Sopenharmony_ci	u16 rx_sop_offset;
80162306a36Sopenharmony_ci	u16 rx_dest_qnum;
80262306a36Sopenharmony_ci	u8 rx_ps_location;
80362306a36Sopenharmony_ci	u8 rx_src_tag_hi;
80462306a36Sopenharmony_ci	u8 rx_src_tag_lo;
80562306a36Sopenharmony_ci	u8 rx_dest_tag_hi;
80662306a36Sopenharmony_ci	u8 rx_dest_tag_lo;
80762306a36Sopenharmony_ci	u8 rx_src_tag_hi_sel;
80862306a36Sopenharmony_ci	u8 rx_src_tag_lo_sel;
80962306a36Sopenharmony_ci	u8 rx_dest_tag_hi_sel;
81062306a36Sopenharmony_ci	u8 rx_dest_tag_lo_sel;
81162306a36Sopenharmony_ci	u8 rx_size_thresh_en;
81262306a36Sopenharmony_ci	u16 rx_fdq0_sz0_qnum;
81362306a36Sopenharmony_ci	u16 rx_fdq1_qnum;
81462306a36Sopenharmony_ci	u16 rx_fdq2_qnum;
81562306a36Sopenharmony_ci	u16 rx_fdq3_qnum;
81662306a36Sopenharmony_ci} __packed;
81762306a36Sopenharmony_ci
81862306a36Sopenharmony_ci/**
81962306a36Sopenharmony_ci * struct rm_ti_sci_msg_udmap_rx_flow_opt_cfg - parameters for UDMAP receive
82062306a36Sopenharmony_ci *						flow optional configuration
82162306a36Sopenharmony_ci * @hdr: Generic Header
82262306a36Sopenharmony_ci * @nav_id: SoC Navigator Subsystem device ID from which the receive flow is
82362306a36Sopenharmony_ci *	allocated
82462306a36Sopenharmony_ci * @flow_index: UDMAP receive flow index for optional configuration.
82562306a36Sopenharmony_ci * @rx_ch_index: Specifies the index of the receive channel using the flow_index
82662306a36Sopenharmony_ci * @rx_size_thresh0: UDMAP receive flow packet size threshold 0.
82762306a36Sopenharmony_ci * @rx_size_thresh1: UDMAP receive flow packet size threshold 1.
82862306a36Sopenharmony_ci * @rx_size_thresh2: UDMAP receive flow packet size threshold 2.
82962306a36Sopenharmony_ci * @rx_fdq0_sz1_qnum: UDMAP receive flow free descriptor queue for size
83062306a36Sopenharmony_ci *	threshold 1.
83162306a36Sopenharmony_ci * @rx_fdq0_sz2_qnum: UDMAP receive flow free descriptor queue for size
83262306a36Sopenharmony_ci *	threshold 2.
83362306a36Sopenharmony_ci * @rx_fdq0_sz3_qnum: UDMAP receive flow free descriptor queue for size
83462306a36Sopenharmony_ci *	threshold 3.
83562306a36Sopenharmony_ci *
83662306a36Sopenharmony_ci * For detailed information on the settings, see the UDMAP section of the TRM.
83762306a36Sopenharmony_ci */
83862306a36Sopenharmony_cistruct rm_ti_sci_msg_udmap_rx_flow_opt_cfg {
83962306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
84062306a36Sopenharmony_ci	u32 nav_id;
84162306a36Sopenharmony_ci	u32 flow_index;
84262306a36Sopenharmony_ci	u32 rx_ch_index;
84362306a36Sopenharmony_ci	u16 rx_size_thresh0;
84462306a36Sopenharmony_ci	u16 rx_size_thresh1;
84562306a36Sopenharmony_ci	u16 rx_size_thresh2;
84662306a36Sopenharmony_ci	u16 rx_fdq0_sz1_qnum;
84762306a36Sopenharmony_ci	u16 rx_fdq0_sz2_qnum;
84862306a36Sopenharmony_ci	u16 rx_fdq0_sz3_qnum;
84962306a36Sopenharmony_ci} __packed;
85062306a36Sopenharmony_ci
85162306a36Sopenharmony_ci/**
85262306a36Sopenharmony_ci * Configures a Navigator Subsystem UDMAP transmit channel
85362306a36Sopenharmony_ci *
85462306a36Sopenharmony_ci * Configures the non-real-time registers of a Navigator Subsystem UDMAP
85562306a36Sopenharmony_ci * transmit channel.  The channel index must be assigned to the host defined
85662306a36Sopenharmony_ci * in the TISCI header via the RM board configuration resource assignment
85762306a36Sopenharmony_ci * range list.
85862306a36Sopenharmony_ci *
85962306a36Sopenharmony_ci * @hdr: Generic Header
86062306a36Sopenharmony_ci *
86162306a36Sopenharmony_ci * @valid_params: Bitfield defining validity of tx channel configuration
86262306a36Sopenharmony_ci * parameters. The tx channel configuration fields are not valid, and will not
86362306a36Sopenharmony_ci * be used for ch configuration, if their corresponding valid bit is zero.
86462306a36Sopenharmony_ci * Valid bit usage:
86562306a36Sopenharmony_ci *    0 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_pause_on_err
86662306a36Sopenharmony_ci *    1 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_atype
86762306a36Sopenharmony_ci *    2 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_chan_type
86862306a36Sopenharmony_ci *    3 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_fetch_size
86962306a36Sopenharmony_ci *    4 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::txcq_qnum
87062306a36Sopenharmony_ci *    5 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_priority
87162306a36Sopenharmony_ci *    6 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_qos
87262306a36Sopenharmony_ci *    7 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_orderid
87362306a36Sopenharmony_ci *    8 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_sched_priority
87462306a36Sopenharmony_ci *    9 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_einfo
87562306a36Sopenharmony_ci *   10 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_pswords
87662306a36Sopenharmony_ci *   11 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_supr_tdpkt
87762306a36Sopenharmony_ci *   12 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_credit_count
87862306a36Sopenharmony_ci *   13 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::fdepth
87962306a36Sopenharmony_ci *   14 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_burst_size
88062306a36Sopenharmony_ci *   15 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_tdtype
88162306a36Sopenharmony_ci *   16 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::extended_ch_type
88262306a36Sopenharmony_ci *
88362306a36Sopenharmony_ci * @nav_id: SoC device ID of Navigator Subsystem where tx channel is located
88462306a36Sopenharmony_ci *
88562306a36Sopenharmony_ci * @index: UDMAP transmit channel index.
88662306a36Sopenharmony_ci *
88762306a36Sopenharmony_ci * @tx_pause_on_err: UDMAP transmit channel pause on error configuration to
88862306a36Sopenharmony_ci * be programmed into the tx_pause_on_err field of the channel's TCHAN_TCFG
88962306a36Sopenharmony_ci * register.
89062306a36Sopenharmony_ci *
89162306a36Sopenharmony_ci * @tx_filt_einfo: UDMAP transmit channel extended packet information passing
89262306a36Sopenharmony_ci * configuration to be programmed into the tx_filt_einfo field of the
89362306a36Sopenharmony_ci * channel's TCHAN_TCFG register.
89462306a36Sopenharmony_ci *
89562306a36Sopenharmony_ci * @tx_filt_pswords: UDMAP transmit channel protocol specific word passing
89662306a36Sopenharmony_ci * configuration to be programmed into the tx_filt_pswords field of the
89762306a36Sopenharmony_ci * channel's TCHAN_TCFG register.
89862306a36Sopenharmony_ci *
89962306a36Sopenharmony_ci * @tx_atype: UDMAP transmit channel non Ring Accelerator access pointer
90062306a36Sopenharmony_ci * interpretation configuration to be programmed into the tx_atype field of
90162306a36Sopenharmony_ci * the channel's TCHAN_TCFG register.
90262306a36Sopenharmony_ci *
90362306a36Sopenharmony_ci * @tx_chan_type: UDMAP transmit channel functional channel type and work
90462306a36Sopenharmony_ci * passing mechanism configuration to be programmed into the tx_chan_type
90562306a36Sopenharmony_ci * field of the channel's TCHAN_TCFG register.
90662306a36Sopenharmony_ci *
90762306a36Sopenharmony_ci * @tx_supr_tdpkt: UDMAP transmit channel teardown packet generation suppression
90862306a36Sopenharmony_ci * configuration to be programmed into the tx_supr_tdpkt field of the channel's
90962306a36Sopenharmony_ci * TCHAN_TCFG register.
91062306a36Sopenharmony_ci *
91162306a36Sopenharmony_ci * @tx_fetch_size: UDMAP transmit channel number of 32-bit descriptor words to
91262306a36Sopenharmony_ci * fetch configuration to be programmed into the tx_fetch_size field of the
91362306a36Sopenharmony_ci * channel's TCHAN_TCFG register.  The user must make sure to set the maximum
91462306a36Sopenharmony_ci * word count that can pass through the channel for any allowed descriptor type.
91562306a36Sopenharmony_ci *
91662306a36Sopenharmony_ci * @tx_credit_count: UDMAP transmit channel transfer request credit count
91762306a36Sopenharmony_ci * configuration to be programmed into the count field of the TCHAN_TCREDIT
91862306a36Sopenharmony_ci * register.  Specifies how many credits for complete TRs are available.
91962306a36Sopenharmony_ci *
92062306a36Sopenharmony_ci * @txcq_qnum: UDMAP transmit channel completion queue configuration to be
92162306a36Sopenharmony_ci * programmed into the txcq_qnum field of the TCHAN_TCQ register. The specified
92262306a36Sopenharmony_ci * completion queue must be assigned to the host, or a subordinate of the host,
92362306a36Sopenharmony_ci * requesting configuration of the transmit channel.
92462306a36Sopenharmony_ci *
92562306a36Sopenharmony_ci * @tx_priority: UDMAP transmit channel transmit priority value to be programmed
92662306a36Sopenharmony_ci * into the priority field of the channel's TCHAN_TPRI_CTRL register.
92762306a36Sopenharmony_ci *
92862306a36Sopenharmony_ci * @tx_qos: UDMAP transmit channel transmit qos value to be programmed into the
92962306a36Sopenharmony_ci * qos field of the channel's TCHAN_TPRI_CTRL register.
93062306a36Sopenharmony_ci *
93162306a36Sopenharmony_ci * @tx_orderid: UDMAP transmit channel bus order id value to be programmed into
93262306a36Sopenharmony_ci * the orderid field of the channel's TCHAN_TPRI_CTRL register.
93362306a36Sopenharmony_ci *
93462306a36Sopenharmony_ci * @fdepth: UDMAP transmit channel FIFO depth configuration to be programmed
93562306a36Sopenharmony_ci * into the fdepth field of the TCHAN_TFIFO_DEPTH register. Sets the number of
93662306a36Sopenharmony_ci * Tx FIFO bytes which are allowed to be stored for the channel. Check the UDMAP
93762306a36Sopenharmony_ci * section of the TRM for restrictions regarding this parameter.
93862306a36Sopenharmony_ci *
93962306a36Sopenharmony_ci * @tx_sched_priority: UDMAP transmit channel tx scheduling priority
94062306a36Sopenharmony_ci * configuration to be programmed into the priority field of the channel's
94162306a36Sopenharmony_ci * TCHAN_TST_SCHED register.
94262306a36Sopenharmony_ci *
94362306a36Sopenharmony_ci * @tx_burst_size: UDMAP transmit channel burst size configuration to be
94462306a36Sopenharmony_ci * programmed into the tx_burst_size field of the TCHAN_TCFG register.
94562306a36Sopenharmony_ci *
94662306a36Sopenharmony_ci * @tx_tdtype: UDMAP transmit channel teardown type configuration to be
94762306a36Sopenharmony_ci * programmed into the tdtype field of the TCHAN_TCFG register:
94862306a36Sopenharmony_ci * 0 - Return immediately
94962306a36Sopenharmony_ci * 1 - Wait for completion message from remote peer
95062306a36Sopenharmony_ci *
95162306a36Sopenharmony_ci * @extended_ch_type: Valid for BCDMA.
95262306a36Sopenharmony_ci * 0 - the channel is split tx channel (tchan)
95362306a36Sopenharmony_ci * 1 - the channel is block copy channel (bchan)
95462306a36Sopenharmony_ci */
95562306a36Sopenharmony_cistruct ti_sci_msg_rm_udmap_tx_ch_cfg_req {
95662306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
95762306a36Sopenharmony_ci	u32 valid_params;
95862306a36Sopenharmony_ci	u16 nav_id;
95962306a36Sopenharmony_ci	u16 index;
96062306a36Sopenharmony_ci	u8 tx_pause_on_err;
96162306a36Sopenharmony_ci	u8 tx_filt_einfo;
96262306a36Sopenharmony_ci	u8 tx_filt_pswords;
96362306a36Sopenharmony_ci	u8 tx_atype;
96462306a36Sopenharmony_ci	u8 tx_chan_type;
96562306a36Sopenharmony_ci	u8 tx_supr_tdpkt;
96662306a36Sopenharmony_ci	u16 tx_fetch_size;
96762306a36Sopenharmony_ci	u8 tx_credit_count;
96862306a36Sopenharmony_ci	u16 txcq_qnum;
96962306a36Sopenharmony_ci	u8 tx_priority;
97062306a36Sopenharmony_ci	u8 tx_qos;
97162306a36Sopenharmony_ci	u8 tx_orderid;
97262306a36Sopenharmony_ci	u16 fdepth;
97362306a36Sopenharmony_ci	u8 tx_sched_priority;
97462306a36Sopenharmony_ci	u8 tx_burst_size;
97562306a36Sopenharmony_ci	u8 tx_tdtype;
97662306a36Sopenharmony_ci	u8 extended_ch_type;
97762306a36Sopenharmony_ci} __packed;
97862306a36Sopenharmony_ci
97962306a36Sopenharmony_ci/**
98062306a36Sopenharmony_ci * Configures a Navigator Subsystem UDMAP receive channel
98162306a36Sopenharmony_ci *
98262306a36Sopenharmony_ci * Configures the non-real-time registers of a Navigator Subsystem UDMAP
98362306a36Sopenharmony_ci * receive channel.  The channel index must be assigned to the host defined
98462306a36Sopenharmony_ci * in the TISCI header via the RM board configuration resource assignment
98562306a36Sopenharmony_ci * range list.
98662306a36Sopenharmony_ci *
98762306a36Sopenharmony_ci * @hdr: Generic Header
98862306a36Sopenharmony_ci *
98962306a36Sopenharmony_ci * @valid_params: Bitfield defining validity of rx channel configuration
99062306a36Sopenharmony_ci * parameters.
99162306a36Sopenharmony_ci * The rx channel configuration fields are not valid, and will not be used for
99262306a36Sopenharmony_ci * ch configuration, if their corresponding valid bit is zero.
99362306a36Sopenharmony_ci * Valid bit usage:
99462306a36Sopenharmony_ci *    0 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_pause_on_err
99562306a36Sopenharmony_ci *    1 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_atype
99662306a36Sopenharmony_ci *    2 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_chan_type
99762306a36Sopenharmony_ci *    3 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_fetch_size
99862306a36Sopenharmony_ci *    4 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rxcq_qnum
99962306a36Sopenharmony_ci *    5 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_priority
100062306a36Sopenharmony_ci *    6 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_qos
100162306a36Sopenharmony_ci *    7 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_orderid
100262306a36Sopenharmony_ci *    8 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_sched_priority
100362306a36Sopenharmony_ci *    9 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_start
100462306a36Sopenharmony_ci *   10 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_cnt
100562306a36Sopenharmony_ci *   11 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_short
100662306a36Sopenharmony_ci *   12 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_long
100762306a36Sopenharmony_ci *   14 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_burst_size
100862306a36Sopenharmony_ci *
100962306a36Sopenharmony_ci * @nav_id: SoC device ID of Navigator Subsystem where rx channel is located
101062306a36Sopenharmony_ci *
101162306a36Sopenharmony_ci * @index: UDMAP receive channel index.
101262306a36Sopenharmony_ci *
101362306a36Sopenharmony_ci * @rx_fetch_size: UDMAP receive channel number of 32-bit descriptor words to
101462306a36Sopenharmony_ci * fetch configuration to be programmed into the rx_fetch_size field of the
101562306a36Sopenharmony_ci * channel's RCHAN_RCFG register.
101662306a36Sopenharmony_ci *
101762306a36Sopenharmony_ci * @rxcq_qnum: UDMAP receive channel completion queue configuration to be
101862306a36Sopenharmony_ci * programmed into the rxcq_qnum field of the RCHAN_RCQ register.
101962306a36Sopenharmony_ci * The specified completion queue must be assigned to the host, or a subordinate
102062306a36Sopenharmony_ci * of the host, requesting configuration of the receive channel.
102162306a36Sopenharmony_ci *
102262306a36Sopenharmony_ci * @rx_priority: UDMAP receive channel receive priority value to be programmed
102362306a36Sopenharmony_ci * into the priority field of the channel's RCHAN_RPRI_CTRL register.
102462306a36Sopenharmony_ci *
102562306a36Sopenharmony_ci * @rx_qos: UDMAP receive channel receive qos value to be programmed into the
102662306a36Sopenharmony_ci * qos field of the channel's RCHAN_RPRI_CTRL register.
102762306a36Sopenharmony_ci *
102862306a36Sopenharmony_ci * @rx_orderid: UDMAP receive channel bus order id value to be programmed into
102962306a36Sopenharmony_ci * the orderid field of the channel's RCHAN_RPRI_CTRL register.
103062306a36Sopenharmony_ci *
103162306a36Sopenharmony_ci * @rx_sched_priority: UDMAP receive channel rx scheduling priority
103262306a36Sopenharmony_ci * configuration to be programmed into the priority field of the channel's
103362306a36Sopenharmony_ci * RCHAN_RST_SCHED register.
103462306a36Sopenharmony_ci *
103562306a36Sopenharmony_ci * @flowid_start: UDMAP receive channel additional flows starting index
103662306a36Sopenharmony_ci * configuration to program into the flow_start field of the RCHAN_RFLOW_RNG
103762306a36Sopenharmony_ci * register. Specifies the starting index for flow IDs the receive channel is to
103862306a36Sopenharmony_ci * make use of beyond the default flow. flowid_start and @ref flowid_cnt must be
103962306a36Sopenharmony_ci * set as valid and configured together. The starting flow ID set by
104062306a36Sopenharmony_ci * @ref flowid_cnt must be a flow index within the Navigator Subsystem's subset
104162306a36Sopenharmony_ci * of flows beyond the default flows statically mapped to receive channels.
104262306a36Sopenharmony_ci * The additional flows must be assigned to the host, or a subordinate of the
104362306a36Sopenharmony_ci * host, requesting configuration of the receive channel.
104462306a36Sopenharmony_ci *
104562306a36Sopenharmony_ci * @flowid_cnt: UDMAP receive channel additional flows count configuration to
104662306a36Sopenharmony_ci * program into the flowid_cnt field of the RCHAN_RFLOW_RNG register.
104762306a36Sopenharmony_ci * This field specifies how many flow IDs are in the additional contiguous range
104862306a36Sopenharmony_ci * of legal flow IDs for the channel.  @ref flowid_start and flowid_cnt must be
104962306a36Sopenharmony_ci * set as valid and configured together. Disabling the valid_params field bit
105062306a36Sopenharmony_ci * for flowid_cnt indicates no flow IDs other than the default are to be
105162306a36Sopenharmony_ci * allocated and used by the receive channel. @ref flowid_start plus flowid_cnt
105262306a36Sopenharmony_ci * cannot be greater than the number of receive flows in the receive channel's
105362306a36Sopenharmony_ci * Navigator Subsystem.  The additional flows must be assigned to the host, or a
105462306a36Sopenharmony_ci * subordinate of the host, requesting configuration of the receive channel.
105562306a36Sopenharmony_ci *
105662306a36Sopenharmony_ci * @rx_pause_on_err: UDMAP receive channel pause on error configuration to be
105762306a36Sopenharmony_ci * programmed into the rx_pause_on_err field of the channel's RCHAN_RCFG
105862306a36Sopenharmony_ci * register.
105962306a36Sopenharmony_ci *
106062306a36Sopenharmony_ci * @rx_atype: UDMAP receive channel non Ring Accelerator access pointer
106162306a36Sopenharmony_ci * interpretation configuration to be programmed into the rx_atype field of the
106262306a36Sopenharmony_ci * channel's RCHAN_RCFG register.
106362306a36Sopenharmony_ci *
106462306a36Sopenharmony_ci * @rx_chan_type: UDMAP receive channel functional channel type and work passing
106562306a36Sopenharmony_ci * mechanism configuration to be programmed into the rx_chan_type field of the
106662306a36Sopenharmony_ci * channel's RCHAN_RCFG register.
106762306a36Sopenharmony_ci *
106862306a36Sopenharmony_ci * @rx_ignore_short: UDMAP receive channel short packet treatment configuration
106962306a36Sopenharmony_ci * to be programmed into the rx_ignore_short field of the RCHAN_RCFG register.
107062306a36Sopenharmony_ci *
107162306a36Sopenharmony_ci * @rx_ignore_long: UDMAP receive channel long packet treatment configuration to
107262306a36Sopenharmony_ci * be programmed into the rx_ignore_long field of the RCHAN_RCFG register.
107362306a36Sopenharmony_ci *
107462306a36Sopenharmony_ci * @rx_burst_size: UDMAP receive channel burst size configuration to be
107562306a36Sopenharmony_ci * programmed into the rx_burst_size field of the RCHAN_RCFG register.
107662306a36Sopenharmony_ci */
107762306a36Sopenharmony_cistruct ti_sci_msg_rm_udmap_rx_ch_cfg_req {
107862306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
107962306a36Sopenharmony_ci	u32 valid_params;
108062306a36Sopenharmony_ci	u16 nav_id;
108162306a36Sopenharmony_ci	u16 index;
108262306a36Sopenharmony_ci	u16 rx_fetch_size;
108362306a36Sopenharmony_ci	u16 rxcq_qnum;
108462306a36Sopenharmony_ci	u8 rx_priority;
108562306a36Sopenharmony_ci	u8 rx_qos;
108662306a36Sopenharmony_ci	u8 rx_orderid;
108762306a36Sopenharmony_ci	u8 rx_sched_priority;
108862306a36Sopenharmony_ci	u16 flowid_start;
108962306a36Sopenharmony_ci	u16 flowid_cnt;
109062306a36Sopenharmony_ci	u8 rx_pause_on_err;
109162306a36Sopenharmony_ci	u8 rx_atype;
109262306a36Sopenharmony_ci	u8 rx_chan_type;
109362306a36Sopenharmony_ci	u8 rx_ignore_short;
109462306a36Sopenharmony_ci	u8 rx_ignore_long;
109562306a36Sopenharmony_ci	u8 rx_burst_size;
109662306a36Sopenharmony_ci} __packed;
109762306a36Sopenharmony_ci
109862306a36Sopenharmony_ci/**
109962306a36Sopenharmony_ci * Configures a Navigator Subsystem UDMAP receive flow
110062306a36Sopenharmony_ci *
110162306a36Sopenharmony_ci * Configures a Navigator Subsystem UDMAP receive flow's registers.
110262306a36Sopenharmony_ci * Configuration does not include the flow registers which handle size-based
110362306a36Sopenharmony_ci * free descriptor queue routing.
110462306a36Sopenharmony_ci *
110562306a36Sopenharmony_ci * The flow index must be assigned to the host defined in the TISCI header via
110662306a36Sopenharmony_ci * the RM board configuration resource assignment range list.
110762306a36Sopenharmony_ci *
110862306a36Sopenharmony_ci * @hdr: Standard TISCI header
110962306a36Sopenharmony_ci *
111062306a36Sopenharmony_ci * @valid_params
111162306a36Sopenharmony_ci * Bitfield defining validity of rx flow configuration parameters.  The
111262306a36Sopenharmony_ci * rx flow configuration fields are not valid, and will not be used for flow
111362306a36Sopenharmony_ci * configuration, if their corresponding valid bit is zero.  Valid bit usage:
111462306a36Sopenharmony_ci *     0 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_einfo_present
111562306a36Sopenharmony_ci *     1 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_psinfo_present
111662306a36Sopenharmony_ci *     2 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_error_handling
111762306a36Sopenharmony_ci *     3 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_desc_type
111862306a36Sopenharmony_ci *     4 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_sop_offset
111962306a36Sopenharmony_ci *     5 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_qnum
112062306a36Sopenharmony_ci *     6 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi
112162306a36Sopenharmony_ci *     7 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo
112262306a36Sopenharmony_ci *     8 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi
112362306a36Sopenharmony_ci *     9 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo
112462306a36Sopenharmony_ci *    10 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi_sel
112562306a36Sopenharmony_ci *    11 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo_sel
112662306a36Sopenharmony_ci *    12 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi_sel
112762306a36Sopenharmony_ci *    13 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo_sel
112862306a36Sopenharmony_ci *    14 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq0_sz0_qnum
112962306a36Sopenharmony_ci *    15 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq1_sz0_qnum
113062306a36Sopenharmony_ci *    16 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq2_sz0_qnum
113162306a36Sopenharmony_ci *    17 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq3_sz0_qnum
113262306a36Sopenharmony_ci *    18 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_ps_location
113362306a36Sopenharmony_ci *
113462306a36Sopenharmony_ci * @nav_id: SoC device ID of Navigator Subsystem from which the receive flow is
113562306a36Sopenharmony_ci * allocated
113662306a36Sopenharmony_ci *
113762306a36Sopenharmony_ci * @flow_index: UDMAP receive flow index for non-optional configuration.
113862306a36Sopenharmony_ci *
113962306a36Sopenharmony_ci * @rx_einfo_present:
114062306a36Sopenharmony_ci * UDMAP receive flow extended packet info present configuration to be
114162306a36Sopenharmony_ci * programmed into the rx_einfo_present field of the flow's RFLOW_RFA register.
114262306a36Sopenharmony_ci *
114362306a36Sopenharmony_ci * @rx_psinfo_present:
114462306a36Sopenharmony_ci * UDMAP receive flow PS words present configuration to be programmed into the
114562306a36Sopenharmony_ci * rx_psinfo_present field of the flow's RFLOW_RFA register.
114662306a36Sopenharmony_ci *
114762306a36Sopenharmony_ci * @rx_error_handling:
114862306a36Sopenharmony_ci * UDMAP receive flow error handling configuration to be programmed into the
114962306a36Sopenharmony_ci * rx_error_handling field of the flow's RFLOW_RFA register.
115062306a36Sopenharmony_ci *
115162306a36Sopenharmony_ci * @rx_desc_type:
115262306a36Sopenharmony_ci * UDMAP receive flow descriptor type configuration to be programmed into the
115362306a36Sopenharmony_ci * rx_desc_type field field of the flow's RFLOW_RFA register.
115462306a36Sopenharmony_ci *
115562306a36Sopenharmony_ci * @rx_sop_offset:
115662306a36Sopenharmony_ci * UDMAP receive flow start of packet offset configuration to be programmed
115762306a36Sopenharmony_ci * into the rx_sop_offset field of the RFLOW_RFA register.  See the UDMAP
115862306a36Sopenharmony_ci * section of the TRM for more information on this setting.  Valid values for
115962306a36Sopenharmony_ci * this field are 0-255 bytes.
116062306a36Sopenharmony_ci *
116162306a36Sopenharmony_ci * @rx_dest_qnum:
116262306a36Sopenharmony_ci * UDMAP receive flow destination queue configuration to be programmed into the
116362306a36Sopenharmony_ci * rx_dest_qnum field of the flow's RFLOW_RFA register.  The specified
116462306a36Sopenharmony_ci * destination queue must be valid within the Navigator Subsystem and must be
116562306a36Sopenharmony_ci * owned by the host, or a subordinate of the host, requesting allocation and
116662306a36Sopenharmony_ci * configuration of the receive flow.
116762306a36Sopenharmony_ci *
116862306a36Sopenharmony_ci * @rx_src_tag_hi:
116962306a36Sopenharmony_ci * UDMAP receive flow source tag high byte constant configuration to be
117062306a36Sopenharmony_ci * programmed into the rx_src_tag_hi field of the flow's RFLOW_RFB register.
117162306a36Sopenharmony_ci * See the UDMAP section of the TRM for more information on this setting.
117262306a36Sopenharmony_ci *
117362306a36Sopenharmony_ci * @rx_src_tag_lo:
117462306a36Sopenharmony_ci * UDMAP receive flow source tag low byte constant configuration to be
117562306a36Sopenharmony_ci * programmed into the rx_src_tag_lo field of the flow's RFLOW_RFB register.
117662306a36Sopenharmony_ci * See the UDMAP section of the TRM for more information on this setting.
117762306a36Sopenharmony_ci *
117862306a36Sopenharmony_ci * @rx_dest_tag_hi:
117962306a36Sopenharmony_ci * UDMAP receive flow destination tag high byte constant configuration to be
118062306a36Sopenharmony_ci * programmed into the rx_dest_tag_hi field of the flow's RFLOW_RFB register.
118162306a36Sopenharmony_ci * See the UDMAP section of the TRM for more information on this setting.
118262306a36Sopenharmony_ci *
118362306a36Sopenharmony_ci * @rx_dest_tag_lo:
118462306a36Sopenharmony_ci * UDMAP receive flow destination tag low byte constant configuration to be
118562306a36Sopenharmony_ci * programmed into the rx_dest_tag_lo field of the flow's RFLOW_RFB register.
118662306a36Sopenharmony_ci * See the UDMAP section of the TRM for more information on this setting.
118762306a36Sopenharmony_ci *
118862306a36Sopenharmony_ci * @rx_src_tag_hi_sel:
118962306a36Sopenharmony_ci * UDMAP receive flow source tag high byte selector configuration to be
119062306a36Sopenharmony_ci * programmed into the rx_src_tag_hi_sel field of the RFLOW_RFC register.  See
119162306a36Sopenharmony_ci * the UDMAP section of the TRM for more information on this setting.
119262306a36Sopenharmony_ci *
119362306a36Sopenharmony_ci * @rx_src_tag_lo_sel:
119462306a36Sopenharmony_ci * UDMAP receive flow source tag low byte selector configuration to be
119562306a36Sopenharmony_ci * programmed into the rx_src_tag_lo_sel field of the RFLOW_RFC register.  See
119662306a36Sopenharmony_ci * the UDMAP section of the TRM for more information on this setting.
119762306a36Sopenharmony_ci *
119862306a36Sopenharmony_ci * @rx_dest_tag_hi_sel:
119962306a36Sopenharmony_ci * UDMAP receive flow destination tag high byte selector configuration to be
120062306a36Sopenharmony_ci * programmed into the rx_dest_tag_hi_sel field of the RFLOW_RFC register.  See
120162306a36Sopenharmony_ci * the UDMAP section of the TRM for more information on this setting.
120262306a36Sopenharmony_ci *
120362306a36Sopenharmony_ci * @rx_dest_tag_lo_sel:
120462306a36Sopenharmony_ci * UDMAP receive flow destination tag low byte selector configuration to be
120562306a36Sopenharmony_ci * programmed into the rx_dest_tag_lo_sel field of the RFLOW_RFC register.  See
120662306a36Sopenharmony_ci * the UDMAP section of the TRM for more information on this setting.
120762306a36Sopenharmony_ci *
120862306a36Sopenharmony_ci * @rx_fdq0_sz0_qnum:
120962306a36Sopenharmony_ci * UDMAP receive flow free descriptor queue 0 configuration to be programmed
121062306a36Sopenharmony_ci * into the rx_fdq0_sz0_qnum field of the flow's RFLOW_RFD register.  See the
121162306a36Sopenharmony_ci * UDMAP section of the TRM for more information on this setting. The specified
121262306a36Sopenharmony_ci * free queue must be valid within the Navigator Subsystem and must be owned
121362306a36Sopenharmony_ci * by the host, or a subordinate of the host, requesting allocation and
121462306a36Sopenharmony_ci * configuration of the receive flow.
121562306a36Sopenharmony_ci *
121662306a36Sopenharmony_ci * @rx_fdq1_qnum:
121762306a36Sopenharmony_ci * UDMAP receive flow free descriptor queue 1 configuration to be programmed
121862306a36Sopenharmony_ci * into the rx_fdq1_qnum field of the flow's RFLOW_RFD register.  See the
121962306a36Sopenharmony_ci * UDMAP section of the TRM for more information on this setting.  The specified
122062306a36Sopenharmony_ci * free queue must be valid within the Navigator Subsystem and must be owned
122162306a36Sopenharmony_ci * by the host, or a subordinate of the host, requesting allocation and
122262306a36Sopenharmony_ci * configuration of the receive flow.
122362306a36Sopenharmony_ci *
122462306a36Sopenharmony_ci * @rx_fdq2_qnum:
122562306a36Sopenharmony_ci * UDMAP receive flow free descriptor queue 2 configuration to be programmed
122662306a36Sopenharmony_ci * into the rx_fdq2_qnum field of the flow's RFLOW_RFE register.  See the
122762306a36Sopenharmony_ci * UDMAP section of the TRM for more information on this setting.  The specified
122862306a36Sopenharmony_ci * free queue must be valid within the Navigator Subsystem and must be owned
122962306a36Sopenharmony_ci * by the host, or a subordinate of the host, requesting allocation and
123062306a36Sopenharmony_ci * configuration of the receive flow.
123162306a36Sopenharmony_ci *
123262306a36Sopenharmony_ci * @rx_fdq3_qnum:
123362306a36Sopenharmony_ci * UDMAP receive flow free descriptor queue 3 configuration to be programmed
123462306a36Sopenharmony_ci * into the rx_fdq3_qnum field of the flow's RFLOW_RFE register.  See the
123562306a36Sopenharmony_ci * UDMAP section of the TRM for more information on this setting.  The specified
123662306a36Sopenharmony_ci * free queue must be valid within the Navigator Subsystem and must be owned
123762306a36Sopenharmony_ci * by the host, or a subordinate of the host, requesting allocation and
123862306a36Sopenharmony_ci * configuration of the receive flow.
123962306a36Sopenharmony_ci *
124062306a36Sopenharmony_ci * @rx_ps_location:
124162306a36Sopenharmony_ci * UDMAP receive flow PS words location configuration to be programmed into the
124262306a36Sopenharmony_ci * rx_ps_location field of the flow's RFLOW_RFA register.
124362306a36Sopenharmony_ci */
124462306a36Sopenharmony_cistruct ti_sci_msg_rm_udmap_flow_cfg_req {
124562306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
124662306a36Sopenharmony_ci	u32 valid_params;
124762306a36Sopenharmony_ci	u16 nav_id;
124862306a36Sopenharmony_ci	u16 flow_index;
124962306a36Sopenharmony_ci	u8 rx_einfo_present;
125062306a36Sopenharmony_ci	u8 rx_psinfo_present;
125162306a36Sopenharmony_ci	u8 rx_error_handling;
125262306a36Sopenharmony_ci	u8 rx_desc_type;
125362306a36Sopenharmony_ci	u16 rx_sop_offset;
125462306a36Sopenharmony_ci	u16 rx_dest_qnum;
125562306a36Sopenharmony_ci	u8 rx_src_tag_hi;
125662306a36Sopenharmony_ci	u8 rx_src_tag_lo;
125762306a36Sopenharmony_ci	u8 rx_dest_tag_hi;
125862306a36Sopenharmony_ci	u8 rx_dest_tag_lo;
125962306a36Sopenharmony_ci	u8 rx_src_tag_hi_sel;
126062306a36Sopenharmony_ci	u8 rx_src_tag_lo_sel;
126162306a36Sopenharmony_ci	u8 rx_dest_tag_hi_sel;
126262306a36Sopenharmony_ci	u8 rx_dest_tag_lo_sel;
126362306a36Sopenharmony_ci	u16 rx_fdq0_sz0_qnum;
126462306a36Sopenharmony_ci	u16 rx_fdq1_qnum;
126562306a36Sopenharmony_ci	u16 rx_fdq2_qnum;
126662306a36Sopenharmony_ci	u16 rx_fdq3_qnum;
126762306a36Sopenharmony_ci	u8 rx_ps_location;
126862306a36Sopenharmony_ci} __packed;
126962306a36Sopenharmony_ci
127062306a36Sopenharmony_ci/**
127162306a36Sopenharmony_ci * struct ti_sci_msg_req_proc_request - Request a processor
127262306a36Sopenharmony_ci * @hdr:		Generic Header
127362306a36Sopenharmony_ci * @processor_id:	ID of processor being requested
127462306a36Sopenharmony_ci *
127562306a36Sopenharmony_ci * Request type is TI_SCI_MSG_PROC_REQUEST, response is a generic ACK/NACK
127662306a36Sopenharmony_ci * message.
127762306a36Sopenharmony_ci */
127862306a36Sopenharmony_cistruct ti_sci_msg_req_proc_request {
127962306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
128062306a36Sopenharmony_ci	u8 processor_id;
128162306a36Sopenharmony_ci} __packed;
128262306a36Sopenharmony_ci
128362306a36Sopenharmony_ci/**
128462306a36Sopenharmony_ci * struct ti_sci_msg_req_proc_release - Release a processor
128562306a36Sopenharmony_ci * @hdr:		Generic Header
128662306a36Sopenharmony_ci * @processor_id:	ID of processor being released
128762306a36Sopenharmony_ci *
128862306a36Sopenharmony_ci * Request type is TI_SCI_MSG_PROC_RELEASE, response is a generic ACK/NACK
128962306a36Sopenharmony_ci * message.
129062306a36Sopenharmony_ci */
129162306a36Sopenharmony_cistruct ti_sci_msg_req_proc_release {
129262306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
129362306a36Sopenharmony_ci	u8 processor_id;
129462306a36Sopenharmony_ci} __packed;
129562306a36Sopenharmony_ci
129662306a36Sopenharmony_ci/**
129762306a36Sopenharmony_ci * struct ti_sci_msg_req_proc_handover - Handover a processor to a host
129862306a36Sopenharmony_ci * @hdr:		Generic Header
129962306a36Sopenharmony_ci * @processor_id:	ID of processor being handed over
130062306a36Sopenharmony_ci * @host_id:		Host ID the control needs to be transferred to
130162306a36Sopenharmony_ci *
130262306a36Sopenharmony_ci * Request type is TI_SCI_MSG_PROC_HANDOVER, response is a generic ACK/NACK
130362306a36Sopenharmony_ci * message.
130462306a36Sopenharmony_ci */
130562306a36Sopenharmony_cistruct ti_sci_msg_req_proc_handover {
130662306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
130762306a36Sopenharmony_ci	u8 processor_id;
130862306a36Sopenharmony_ci	u8 host_id;
130962306a36Sopenharmony_ci} __packed;
131062306a36Sopenharmony_ci
131162306a36Sopenharmony_ci/* Boot Vector masks */
131262306a36Sopenharmony_ci#define TI_SCI_ADDR_LOW_MASK			GENMASK_ULL(31, 0)
131362306a36Sopenharmony_ci#define TI_SCI_ADDR_HIGH_MASK			GENMASK_ULL(63, 32)
131462306a36Sopenharmony_ci#define TI_SCI_ADDR_HIGH_SHIFT			32
131562306a36Sopenharmony_ci
131662306a36Sopenharmony_ci/**
131762306a36Sopenharmony_ci * struct ti_sci_msg_req_set_config - Set Processor boot configuration
131862306a36Sopenharmony_ci * @hdr:		Generic Header
131962306a36Sopenharmony_ci * @processor_id:	ID of processor being configured
132062306a36Sopenharmony_ci * @bootvector_low:	Lower 32 bit address (Little Endian) of boot vector
132162306a36Sopenharmony_ci * @bootvector_high:	Higher 32 bit address (Little Endian) of boot vector
132262306a36Sopenharmony_ci * @config_flags_set:	Optional Processor specific Config Flags to set.
132362306a36Sopenharmony_ci *			Setting a bit here implies the corresponding mode
132462306a36Sopenharmony_ci *			will be set
132562306a36Sopenharmony_ci * @config_flags_clear:	Optional Processor specific Config Flags to clear.
132662306a36Sopenharmony_ci *			Setting a bit here implies the corresponding mode
132762306a36Sopenharmony_ci *			will be cleared
132862306a36Sopenharmony_ci *
132962306a36Sopenharmony_ci * Request type is TI_SCI_MSG_PROC_HANDOVER, response is a generic ACK/NACK
133062306a36Sopenharmony_ci * message.
133162306a36Sopenharmony_ci */
133262306a36Sopenharmony_cistruct ti_sci_msg_req_set_config {
133362306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
133462306a36Sopenharmony_ci	u8 processor_id;
133562306a36Sopenharmony_ci	u32 bootvector_low;
133662306a36Sopenharmony_ci	u32 bootvector_high;
133762306a36Sopenharmony_ci	u32 config_flags_set;
133862306a36Sopenharmony_ci	u32 config_flags_clear;
133962306a36Sopenharmony_ci} __packed;
134062306a36Sopenharmony_ci
134162306a36Sopenharmony_ci/**
134262306a36Sopenharmony_ci * struct ti_sci_msg_req_set_ctrl - Set Processor boot control flags
134362306a36Sopenharmony_ci * @hdr:		Generic Header
134462306a36Sopenharmony_ci * @processor_id:	ID of processor being configured
134562306a36Sopenharmony_ci * @control_flags_set:	Optional Processor specific Control Flags to set.
134662306a36Sopenharmony_ci *			Setting a bit here implies the corresponding mode
134762306a36Sopenharmony_ci *			will be set
134862306a36Sopenharmony_ci * @control_flags_clear:Optional Processor specific Control Flags to clear.
134962306a36Sopenharmony_ci *			Setting a bit here implies the corresponding mode
135062306a36Sopenharmony_ci *			will be cleared
135162306a36Sopenharmony_ci *
135262306a36Sopenharmony_ci * Request type is TI_SCI_MSG_SET_CTRL, response is a generic ACK/NACK
135362306a36Sopenharmony_ci * message.
135462306a36Sopenharmony_ci */
135562306a36Sopenharmony_cistruct ti_sci_msg_req_set_ctrl {
135662306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
135762306a36Sopenharmony_ci	u8 processor_id;
135862306a36Sopenharmony_ci	u32 control_flags_set;
135962306a36Sopenharmony_ci	u32 control_flags_clear;
136062306a36Sopenharmony_ci} __packed;
136162306a36Sopenharmony_ci
136262306a36Sopenharmony_ci/**
136362306a36Sopenharmony_ci * struct ti_sci_msg_req_get_status - Processor boot status request
136462306a36Sopenharmony_ci * @hdr:		Generic Header
136562306a36Sopenharmony_ci * @processor_id:	ID of processor whose status is being requested
136662306a36Sopenharmony_ci *
136762306a36Sopenharmony_ci * Request type is TI_SCI_MSG_GET_STATUS, response is an appropriate
136862306a36Sopenharmony_ci * message, or NACK in case of inability to satisfy request.
136962306a36Sopenharmony_ci */
137062306a36Sopenharmony_cistruct ti_sci_msg_req_get_status {
137162306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
137262306a36Sopenharmony_ci	u8 processor_id;
137362306a36Sopenharmony_ci} __packed;
137462306a36Sopenharmony_ci
137562306a36Sopenharmony_ci/**
137662306a36Sopenharmony_ci * struct ti_sci_msg_resp_get_status - Processor boot status response
137762306a36Sopenharmony_ci * @hdr:		Generic Header
137862306a36Sopenharmony_ci * @processor_id:	ID of processor whose status is returned
137962306a36Sopenharmony_ci * @bootvector_low:	Lower 32 bit address (Little Endian) of boot vector
138062306a36Sopenharmony_ci * @bootvector_high:	Higher 32 bit address (Little Endian) of boot vector
138162306a36Sopenharmony_ci * @config_flags:	Optional Processor specific Config Flags set currently
138262306a36Sopenharmony_ci * @control_flags:	Optional Processor specific Control Flags set currently
138362306a36Sopenharmony_ci * @status_flags:	Optional Processor specific Status Flags set currently
138462306a36Sopenharmony_ci *
138562306a36Sopenharmony_ci * Response structure to a TI_SCI_MSG_GET_STATUS request.
138662306a36Sopenharmony_ci */
138762306a36Sopenharmony_cistruct ti_sci_msg_resp_get_status {
138862306a36Sopenharmony_ci	struct ti_sci_msg_hdr hdr;
138962306a36Sopenharmony_ci	u8 processor_id;
139062306a36Sopenharmony_ci	u32 bootvector_low;
139162306a36Sopenharmony_ci	u32 bootvector_high;
139262306a36Sopenharmony_ci	u32 config_flags;
139362306a36Sopenharmony_ci	u32 control_flags;
139462306a36Sopenharmony_ci	u32 status_flags;
139562306a36Sopenharmony_ci} __packed;
139662306a36Sopenharmony_ci
139762306a36Sopenharmony_ci#endif /* __TI_SCI_H */
1398