/* SPDX-License-Identifier: BSD-3-Clause */1/*2* Texas Instruments System Control Interface (TISCI) Protocol3*4* Communication protocol with TI SCI hardware5* The system works in a message response protocol6* See: https://software-dl.ti.com/tisci/esd/latest/index.html for details7*8* Copyright (C) 2015-2024 Texas Instruments Incorporated - https://www.ti.com/9*/1011#ifndef __TI_SCI_H12#define __TI_SCI_H1314/* Generic Messages */15#define TI_SCI_MSG_ENABLE_WDT 0x000016#define TI_SCI_MSG_WAKE_RESET 0x000117#define TI_SCI_MSG_VERSION 0x000218#define TI_SCI_MSG_WAKE_REASON 0x000319#define TI_SCI_MSG_GOODBYE 0x000420#define TI_SCI_MSG_SYS_RESET 0x000521#define TI_SCI_MSG_QUERY_FW_CAPS 0x00222223/* Device requests */24#define TI_SCI_MSG_SET_DEVICE_STATE 0x020025#define TI_SCI_MSG_GET_DEVICE_STATE 0x020126#define TI_SCI_MSG_SET_DEVICE_RESETS 0x02022728/* Clock requests */29#define TI_SCI_MSG_SET_CLOCK_STATE 0x010030#define TI_SCI_MSG_GET_CLOCK_STATE 0x010131#define TI_SCI_MSG_SET_CLOCK_PARENT 0x010232#define TI_SCI_MSG_GET_CLOCK_PARENT 0x010333#define TI_SCI_MSG_GET_NUM_CLOCK_PARENTS 0x010434#define TI_SCI_MSG_SET_CLOCK_FREQ 0x010c35#define TI_SCI_MSG_QUERY_CLOCK_FREQ 0x010d36#define TI_SCI_MSG_GET_CLOCK_FREQ 0x010e3738/* Low Power Mode Requests */39#define TI_SCI_MSG_PREPARE_SLEEP 0x030040#define TI_SCI_MSG_LPM_WAKE_REASON 0x030641#define TI_SCI_MSG_SET_IO_ISOLATION 0x030742#define TI_SCI_MSG_LPM_SET_DEVICE_CONSTRAINT 0x030943#define TI_SCI_MSG_LPM_SET_LATENCY_CONSTRAINT 0x030A4445/* Resource Management Requests */46#define TI_SCI_MSG_GET_RESOURCE_RANGE 0x15004748/* IRQ requests */49#define TI_SCI_MSG_SET_IRQ 0x100050#define TI_SCI_MSG_FREE_IRQ 0x10015152/* NAVSS resource management */53/* Ringacc requests */54#define TI_SCI_MSG_RM_RING_ALLOCATE 0x110055#define TI_SCI_MSG_RM_RING_FREE 0x110156#define TI_SCI_MSG_RM_RING_RECONFIG 0x110257#define TI_SCI_MSG_RM_RING_RESET 0x110358#define TI_SCI_MSG_RM_RING_CFG 0x11105960/* PSI-L requests */61#define TI_SCI_MSG_RM_PSIL_PAIR 0x128062#define TI_SCI_MSG_RM_PSIL_UNPAIR 0x12816364#define TI_SCI_MSG_RM_UDMAP_TX_ALLOC 0x120065#define TI_SCI_MSG_RM_UDMAP_TX_FREE 0x120166#define TI_SCI_MSG_RM_UDMAP_RX_ALLOC 0x121067#define TI_SCI_MSG_RM_UDMAP_RX_FREE 0x121168#define TI_SCI_MSG_RM_UDMAP_FLOW_CFG 0x122069#define TI_SCI_MSG_RM_UDMAP_OPT_FLOW_CFG 0x12217071#define TISCI_MSG_RM_UDMAP_TX_CH_CFG 0x120572#define TISCI_MSG_RM_UDMAP_TX_CH_GET_CFG 0x120673#define TISCI_MSG_RM_UDMAP_RX_CH_CFG 0x121574#define TISCI_MSG_RM_UDMAP_RX_CH_GET_CFG 0x121675#define TISCI_MSG_RM_UDMAP_FLOW_CFG 0x123076#define TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_CFG 0x123177#define TISCI_MSG_RM_UDMAP_FLOW_GET_CFG 0x123278#define TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_GET_CFG 0x12337980/* Processor Control requests */81#define TI_SCI_MSG_PROC_REQUEST 0xc00082#define TI_SCI_MSG_PROC_RELEASE 0xc00183#define TI_SCI_MSG_PROC_HANDOVER 0xc00584#define TI_SCI_MSG_SET_CONFIG 0xc10085#define TI_SCI_MSG_SET_CTRL 0xc10186#define TI_SCI_MSG_GET_STATUS 0xc4008788/**89* struct ti_sci_msg_hdr - Generic Message Header for All messages and responses90* @type: Type of messages: One of TI_SCI_MSG* values91* @host: Host of the message92* @seq: Message identifier indicating a transfer sequence93* @flags: Flag for the message94*/95struct ti_sci_msg_hdr {96u16 type;97u8 host;98u8 seq;99#define TI_SCI_MSG_FLAG(val) (1 << (val))100#define TI_SCI_FLAG_REQ_GENERIC_NORESPONSE 0x0101#define TI_SCI_FLAG_REQ_ACK_ON_RECEIVED TI_SCI_MSG_FLAG(0)102#define TI_SCI_FLAG_REQ_ACK_ON_PROCESSED TI_SCI_MSG_FLAG(1)103#define TI_SCI_FLAG_RESP_GENERIC_NACK 0x0104#define TI_SCI_FLAG_RESP_GENERIC_ACK TI_SCI_MSG_FLAG(1)105/* Additional Flags */106u32 flags;107} __packed;108109/**110* struct ti_sci_msg_resp_version - Response for a message111* @hdr: Generic header112* @firmware_description: String describing the firmware113* @firmware_revision: Firmware revision114* @abi_major: Major version of the ABI that firmware supports115* @abi_minor: Minor version of the ABI that firmware supports116*117* In general, ABI version changes follow the rule that minor version increments118* are backward compatible. Major revision changes in ABI may not be119* backward compatible.120*121* Response to a generic message with message type TI_SCI_MSG_VERSION122*/123struct ti_sci_msg_resp_version {124struct ti_sci_msg_hdr hdr;125char firmware_description[32];126u16 firmware_revision;127u8 abi_major;128u8 abi_minor;129} __packed;130131/**132* struct ti_sci_msg_req_reboot - Reboot the SoC133* @hdr: Generic Header134*135* Request type is TI_SCI_MSG_SYS_RESET, responded with a generic136* ACK/NACK message.137*/138struct ti_sci_msg_req_reboot {139struct ti_sci_msg_hdr hdr;140} __packed;141142/**143* struct ti_sci_msg_resp_query_fw_caps - Response for query firmware caps144* @hdr: Generic header145* @fw_caps: Each bit in fw_caps indicating one FW/SOC capability146* MSG_FLAG_CAPS_GENERIC: Generic capability (LPM not supported)147* MSG_FLAG_CAPS_LPM_PARTIAL_IO: Partial IO in LPM148* MSG_FLAG_CAPS_LPM_DM_MANAGED: LPM can be managed by DM149*150* Response to a generic message with message type TI_SCI_MSG_QUERY_FW_CAPS151* providing currently available SOC/firmware capabilities. SoC that don't152* support low power modes return only MSG_FLAG_CAPS_GENERIC capability.153*/154struct ti_sci_msg_resp_query_fw_caps {155struct ti_sci_msg_hdr hdr;156#define MSG_FLAG_CAPS_GENERIC TI_SCI_MSG_FLAG(0)157#define MSG_FLAG_CAPS_LPM_PARTIAL_IO TI_SCI_MSG_FLAG(4)158#define MSG_FLAG_CAPS_LPM_DM_MANAGED TI_SCI_MSG_FLAG(5)159#define MSG_MASK_CAPS_LPM GENMASK_ULL(4, 1)160u64 fw_caps;161} __packed;162163/**164* struct ti_sci_msg_req_set_device_state - Set the desired state of the device165* @hdr: Generic header166* @id: Indicates which device to modify167* @reserved: Reserved space in message, must be 0 for backward compatibility168* @state: The desired state of the device.169*170* Certain flags can also be set to alter the device state:171* + MSG_FLAG_DEVICE_WAKE_ENABLED - Configure the device to be a wake source.172* The meaning of this flag will vary slightly from device to device and from173* SoC to SoC but it generally allows the device to wake the SoC out of deep174* suspend states.175* + MSG_FLAG_DEVICE_RESET_ISO - Enable reset isolation for this device.176* + MSG_FLAG_DEVICE_EXCLUSIVE - Claim this device exclusively. When passed177* with STATE_RETENTION or STATE_ON, it will claim the device exclusively.178* If another host already has this device set to STATE_RETENTION or STATE_ON,179* the message will fail. Once successful, other hosts attempting to set180* STATE_RETENTION or STATE_ON will fail.181*182* Request type is TI_SCI_MSG_SET_DEVICE_STATE, responded with a generic183* ACK/NACK message.184*/185struct ti_sci_msg_req_set_device_state {186/* Additional hdr->flags options */187#define MSG_FLAG_DEVICE_WAKE_ENABLED TI_SCI_MSG_FLAG(8)188#define MSG_FLAG_DEVICE_RESET_ISO TI_SCI_MSG_FLAG(9)189#define MSG_FLAG_DEVICE_EXCLUSIVE TI_SCI_MSG_FLAG(10)190struct ti_sci_msg_hdr hdr;191u32 id;192u32 reserved;193194#define MSG_DEVICE_SW_STATE_AUTO_OFF 0195#define MSG_DEVICE_SW_STATE_RETENTION 1196#define MSG_DEVICE_SW_STATE_ON 2197u8 state;198} __packed;199200/**201* struct ti_sci_msg_req_get_device_state - Request to get device.202* @hdr: Generic header203* @id: Device Identifier204*205* Request type is TI_SCI_MSG_GET_DEVICE_STATE, responded device state206* information207*/208struct ti_sci_msg_req_get_device_state {209struct ti_sci_msg_hdr hdr;210u32 id;211} __packed;212213/**214* struct ti_sci_msg_resp_get_device_state - Response to get device request.215* @hdr: Generic header216* @context_loss_count: Indicates how many times the device has lost context. A217* driver can use this monotonic counter to determine if the device has218* lost context since the last time this message was exchanged.219* @resets: Programmed state of the reset lines.220* @programmed_state: The state as programmed by set_device.221* - Uses the MSG_DEVICE_SW_* macros222* @current_state: The actual state of the hardware.223*224* Response to request TI_SCI_MSG_GET_DEVICE_STATE.225*/226struct ti_sci_msg_resp_get_device_state {227struct ti_sci_msg_hdr hdr;228u32 context_loss_count;229u32 resets;230u8 programmed_state;231#define MSG_DEVICE_HW_STATE_OFF 0232#define MSG_DEVICE_HW_STATE_ON 1233#define MSG_DEVICE_HW_STATE_TRANS 2234u8 current_state;235} __packed;236237/**238* struct ti_sci_msg_req_set_device_resets - Set the desired resets239* configuration of the device240* @hdr: Generic header241* @id: Indicates which device to modify242* @resets: A bit field of resets for the device. The meaning, behavior,243* and usage of the reset flags are device specific. 0 for a bit244* indicates releasing the reset represented by that bit while 1245* indicates keeping it held.246*247* Request type is TI_SCI_MSG_SET_DEVICE_RESETS, responded with a generic248* ACK/NACK message.249*/250struct ti_sci_msg_req_set_device_resets {251struct ti_sci_msg_hdr hdr;252u32 id;253u32 resets;254} __packed;255256/**257* struct ti_sci_msg_req_set_clock_state - Request to setup a Clock state258* @hdr: Generic Header, Certain flags can be set specific to the clocks:259* MSG_FLAG_CLOCK_ALLOW_SSC: Allow this clock to be modified260* via spread spectrum clocking.261* MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE: Allow this clock's262* frequency to be changed while it is running so long as it263* is within the min/max limits.264* MSG_FLAG_CLOCK_INPUT_TERM: Enable input termination, this265* is only applicable to clock inputs on the SoC pseudo-device.266* @dev_id: Device identifier this request is for267* @clk_id: Clock identifier for the device for this request.268* Each device has it's own set of clock inputs. This indexes269* which clock input to modify. Set to 255 if clock ID is270* greater than or equal to 255.271* @request_state: Request the state for the clock to be set to.272* MSG_CLOCK_SW_STATE_UNREQ: The IP does not require this clock,273* it can be disabled, regardless of the state of the device274* MSG_CLOCK_SW_STATE_AUTO: Allow the System Controller to275* automatically manage the state of this clock. If the device276* is enabled, then the clock is enabled. If the device is set277* to off or retention, then the clock is internally set as not278* being required by the device.(default)279* MSG_CLOCK_SW_STATE_REQ: Configure the clock to be enabled,280* regardless of the state of the device.281* @clk_id_32: Clock identifier for the device for this request.282* Only to be used if the clock ID is greater than or equal to283* 255.284*285* Normally, all required clocks are managed by TISCI entity, this is used286* only for specific control *IF* required. Auto managed state is287* MSG_CLOCK_SW_STATE_AUTO, in other states, TISCI entity assume remote288* will explicitly control.289*290* Request type is TI_SCI_MSG_SET_CLOCK_STATE, response is a generic291* ACK or NACK message.292*/293struct ti_sci_msg_req_set_clock_state {294/* Additional hdr->flags options */295#define MSG_FLAG_CLOCK_ALLOW_SSC TI_SCI_MSG_FLAG(8)296#define MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE TI_SCI_MSG_FLAG(9)297#define MSG_FLAG_CLOCK_INPUT_TERM TI_SCI_MSG_FLAG(10)298struct ti_sci_msg_hdr hdr;299u32 dev_id;300u8 clk_id;301#define MSG_CLOCK_SW_STATE_UNREQ 0302#define MSG_CLOCK_SW_STATE_AUTO 1303#define MSG_CLOCK_SW_STATE_REQ 2304u8 request_state;305u32 clk_id_32;306} __packed;307308/**309* struct ti_sci_msg_req_get_clock_state - Request for clock state310* @hdr: Generic Header311* @dev_id: Device identifier this request is for312* @clk_id: Clock identifier for the device for this request.313* Each device has it's own set of clock inputs. This indexes314* which clock input to get state of. Set to 255 if the clock315* ID is greater than or equal to 255.316* @clk_id_32: Clock identifier for the device for the request.317* Only to be used if the clock ID is greater than or equal to318* 255.319*320* Request type is TI_SCI_MSG_GET_CLOCK_STATE, response is state321* of the clock322*/323struct ti_sci_msg_req_get_clock_state {324struct ti_sci_msg_hdr hdr;325u32 dev_id;326u8 clk_id;327u32 clk_id_32;328} __packed;329330/**331* struct ti_sci_msg_resp_get_clock_state - Response to get clock state332* @hdr: Generic Header333* @programmed_state: Any programmed state of the clock. This is one of334* MSG_CLOCK_SW_STATE* values.335* @current_state: Current state of the clock. This is one of:336* MSG_CLOCK_HW_STATE_NOT_READY: Clock is not ready337* MSG_CLOCK_HW_STATE_READY: Clock is ready338*339* Response to TI_SCI_MSG_GET_CLOCK_STATE.340*/341struct ti_sci_msg_resp_get_clock_state {342struct ti_sci_msg_hdr hdr;343u8 programmed_state;344#define MSG_CLOCK_HW_STATE_NOT_READY 0345#define MSG_CLOCK_HW_STATE_READY 1346u8 current_state;347} __packed;348349/**350* struct ti_sci_msg_req_set_clock_parent - Set the clock parent351* @hdr: Generic Header352* @dev_id: Device identifier this request is for353* @clk_id: Clock identifier for the device for this request.354* Each device has it's own set of clock inputs. This indexes355* which clock input to modify. Set to 255 if clock ID is356* greater than or equal to 255.357* @parent_id: The new clock parent is selectable by an index via this358* parameter. Set to 255 if clock ID is greater than or359* equal to 255.360* @clk_id_32: Clock identifier if @clk_id field is 255.361* @parent_id_32: Parent identifier if @parent_id is 255.362*363* Request type is TI_SCI_MSG_SET_CLOCK_PARENT, response is generic364* ACK / NACK message.365*/366struct ti_sci_msg_req_set_clock_parent {367struct ti_sci_msg_hdr hdr;368u32 dev_id;369u8 clk_id;370u8 parent_id;371u32 clk_id_32;372u32 parent_id_32;373} __packed;374375/**376* struct ti_sci_msg_req_get_clock_parent - Get the clock parent377* @hdr: Generic Header378* @dev_id: Device identifier this request is for379* @clk_id: Clock identifier for the device for this request.380* Each device has it's own set of clock inputs. This indexes381* which clock input to get the parent for. If this field382* contains 255, the actual clock identifier is stored in383* @clk_id_32.384* @clk_id_32: Clock identifier if the @clk_id field contains 255.385*386* Request type is TI_SCI_MSG_GET_CLOCK_PARENT, response is parent information387*/388struct ti_sci_msg_req_get_clock_parent {389struct ti_sci_msg_hdr hdr;390u32 dev_id;391u8 clk_id;392u32 clk_id_32;393} __packed;394395/**396* struct ti_sci_msg_resp_get_clock_parent - Response with clock parent397* @hdr: Generic Header398* @parent_id: The current clock parent. If set to 255, the current parent399* ID can be found from the @parent_id_32 field.400* @parent_id_32: Current clock parent if @parent_id field is set to401* 255.402*403* Response to TI_SCI_MSG_GET_CLOCK_PARENT.404*/405struct ti_sci_msg_resp_get_clock_parent {406struct ti_sci_msg_hdr hdr;407u8 parent_id;408u32 parent_id_32;409} __packed;410411/**412* struct ti_sci_msg_req_get_clock_num_parents - Request to get clock parents413* @hdr: Generic header414* @dev_id: Device identifier this request is for415* @clk_id: Clock identifier for the device for this request. Set to416* 255 if clock ID is greater than or equal to 255.417* @clk_id_32: Clock identifier if the @clk_id field contains 255.418*419* This request provides information about how many clock parent options420* are available for a given clock to a device. This is typically used421* for input clocks.422*423* Request type is TI_SCI_MSG_GET_NUM_CLOCK_PARENTS, response is appropriate424* message, or NACK in case of inability to satisfy request.425*/426struct ti_sci_msg_req_get_clock_num_parents {427struct ti_sci_msg_hdr hdr;428u32 dev_id;429u8 clk_id;430u32 clk_id_32;431} __packed;432433/**434* struct ti_sci_msg_resp_get_clock_num_parents - Response for get clk parents435* @hdr: Generic header436* @num_parents: Number of clock parents. If set to 255, the actual437* number of parents is stored into @num_parents_32438* field instead.439* @num_parents_32: Number of clock parents if @num_parents field is440* set to 255.441*442* Response to TI_SCI_MSG_GET_NUM_CLOCK_PARENTS443*/444struct ti_sci_msg_resp_get_clock_num_parents {445struct ti_sci_msg_hdr hdr;446u8 num_parents;447u32 num_parents_32;448} __packed;449450/**451* struct ti_sci_msg_req_query_clock_freq - Request to query a frequency452* @hdr: Generic Header453* @dev_id: Device identifier this request is for454* @min_freq_hz: The minimum allowable frequency in Hz. This is the minimum455* allowable programmed frequency and does not account for clock456* tolerances and jitter.457* @target_freq_hz: The target clock frequency. A frequency will be found458* as close to this target frequency as possible.459* @max_freq_hz: The maximum allowable frequency in Hz. This is the maximum460* allowable programmed frequency and does not account for clock461* tolerances and jitter.462* @clk_id: Clock identifier for the device for this request. Set to463* 255 if clock identifier is greater than or equal to 255.464* @clk_id_32: Clock identifier if @clk_id is set to 255.465*466* NOTE: Normally clock frequency management is automatically done by TISCI467* entity. In case of specific requests, TISCI evaluates capability to achieve468* requested frequency within provided range and responds with469* result message.470*471* Request type is TI_SCI_MSG_QUERY_CLOCK_FREQ, response is appropriate message,472* or NACK in case of inability to satisfy request.473*/474struct ti_sci_msg_req_query_clock_freq {475struct ti_sci_msg_hdr hdr;476u32 dev_id;477u64 min_freq_hz;478u64 target_freq_hz;479u64 max_freq_hz;480u8 clk_id;481u32 clk_id_32;482} __packed;483484/**485* struct ti_sci_msg_resp_query_clock_freq - Response to a clock frequency query486* @hdr: Generic Header487* @freq_hz: Frequency that is the best match in Hz.488*489* Response to request type TI_SCI_MSG_QUERY_CLOCK_FREQ. NOTE: if the request490* cannot be satisfied, the message will be of type NACK.491*/492struct ti_sci_msg_resp_query_clock_freq {493struct ti_sci_msg_hdr hdr;494u64 freq_hz;495} __packed;496497/**498* struct ti_sci_msg_req_set_clock_freq - Request to setup a clock frequency499* @hdr: Generic Header500* @dev_id: Device identifier this request is for501* @min_freq_hz: The minimum allowable frequency in Hz. This is the minimum502* allowable programmed frequency and does not account for clock503* tolerances and jitter.504* @target_freq_hz: The target clock frequency. The clock will be programmed505* at a rate as close to this target frequency as possible.506* @max_freq_hz: The maximum allowable frequency in Hz. This is the maximum507* allowable programmed frequency and does not account for clock508* tolerances and jitter.509* @clk_id: Clock identifier for the device for this request. Set to510* 255 if clock ID is greater than or equal to 255.511* @clk_id_32: Clock identifier if @clk_id field is set to 255.512*513* NOTE: Normally clock frequency management is automatically done by TISCI514* entity. In case of specific requests, TISCI evaluates capability to achieve515* requested range and responds with success/failure message.516*517* This sets the desired frequency for a clock within an allowable518* range. This message will fail on an enabled clock unless519* MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE is set for the clock. Additionally,520* if other clocks have their frequency modified due to this message,521* they also must have the MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE or be disabled.522*523* Calling set frequency on a clock input to the SoC pseudo-device will524* inform the PMMC of that clock's frequency. Setting a frequency of525* zero will indicate the clock is disabled.526*527* Calling set frequency on clock outputs from the SoC pseudo-device will528* function similarly to setting the clock frequency on a device.529*530* Request type is TI_SCI_MSG_SET_CLOCK_FREQ, response is a generic ACK/NACK531* message.532*/533struct ti_sci_msg_req_set_clock_freq {534struct ti_sci_msg_hdr hdr;535u32 dev_id;536u64 min_freq_hz;537u64 target_freq_hz;538u64 max_freq_hz;539u8 clk_id;540u32 clk_id_32;541} __packed;542543/**544* struct ti_sci_msg_req_get_clock_freq - Request to get the clock frequency545* @hdr: Generic Header546* @dev_id: Device identifier this request is for547* @clk_id: Clock identifier for the device for this request. Set to548* 255 if clock ID is greater than or equal to 255.549* @clk_id_32: Clock identifier if @clk_id field is set to 255.550*551* NOTE: Normally clock frequency management is automatically done by TISCI552* entity. In some cases, clock frequencies are configured by host.553*554* Request type is TI_SCI_MSG_GET_CLOCK_FREQ, responded with clock frequency555* that the clock is currently at.556*/557struct ti_sci_msg_req_get_clock_freq {558struct ti_sci_msg_hdr hdr;559u32 dev_id;560u8 clk_id;561u32 clk_id_32;562} __packed;563564/**565* struct ti_sci_msg_resp_get_clock_freq - Response of clock frequency request566* @hdr: Generic Header567* @freq_hz: Frequency that the clock is currently on, in Hz.568*569* Response to request type TI_SCI_MSG_GET_CLOCK_FREQ.570*/571struct ti_sci_msg_resp_get_clock_freq {572struct ti_sci_msg_hdr hdr;573u64 freq_hz;574} __packed;575576/**577* struct tisci_msg_req_prepare_sleep - Request for TISCI_MSG_PREPARE_SLEEP.578*579* @hdr TISCI header to provide ACK/NAK flags to the host.580* @mode Low power mode to enter.581* @ctx_lo Low 32-bits of physical pointer to address to use for context save.582* @ctx_hi High 32-bits of physical pointer to address to use for context save.583* @debug_flags Flags that can be set to halt the sequence during suspend or584* resume to allow JTAG connection and debug.585*586* This message is used as the first step of entering a low power mode. It587* allows configurable information, including which state to enter to be588* easily shared from the application, as this is a non-secure message and589* therefore can be sent by anyone.590*/591struct ti_sci_msg_req_prepare_sleep {592struct ti_sci_msg_hdr hdr;593594#define TISCI_MSG_VALUE_SLEEP_MODE_DM_MANAGED 0xfd595u8 mode;596u32 ctx_lo;597u32 ctx_hi;598u32 debug_flags;599} __packed;600601/**602* struct tisci_msg_set_io_isolation_req - Request for TI_SCI_MSG_SET_IO_ISOLATION.603*604* @hdr: Generic header605* @state: The deseared state of the IO isolation.606*607* This message is used to enable/disable IO isolation for low power modes.608* Response is generic ACK / NACK message.609*/610struct ti_sci_msg_req_set_io_isolation {611struct ti_sci_msg_hdr hdr;612u8 state;613} __packed;614615/**616* struct ti_sci_msg_resp_lpm_wake_reason - Response for TI_SCI_MSG_LPM_WAKE_REASON.617*618* @hdr: Generic header.619* @wake_source: The wake up source that woke soc from LPM.620* @wake_timestamp: Timestamp at which soc woke.621* @wake_pin: The pin that has triggered wake up.622* @mode: The last entered low power mode.623* @rsvd: Reserved for future use.624*625* Response to a generic message with message type TI_SCI_MSG_LPM_WAKE_REASON,626* used to query the wake up source, pin and entered low power mode.627*/628struct ti_sci_msg_resp_lpm_wake_reason {629struct ti_sci_msg_hdr hdr;630u32 wake_source;631u64 wake_timestamp;632u8 wake_pin;633u8 mode;634u32 rsvd[2];635} __packed;636637/**638* struct ti_sci_msg_req_lpm_set_device_constraint - Request for639* TISCI_MSG_LPM_SET_DEVICE_CONSTRAINT.640*641* @hdr: TISCI header to provide ACK/NAK flags to the host.642* @id: Device ID of device whose constraint has to be modified.643* @state: The desired state of device constraint: set or clear.644* @rsvd: Reserved for future use.645*646* This message is used by host to set constraint on the device. This can be647* sent anytime after boot before prepare sleep message. Any device can set a648* constraint on the low power mode that the SoC can enter. It allows649* configurable information to be easily shared from the application, as this650* is a non-secure message and therefore can be sent by anyone. By setting a651* constraint, the device ensures that it will not be powered off or reset in652* the selected mode. Note: Access Restriction: Exclusivity flag of Device will653* be honored. If some other host already has constraint on this device ID,654* NACK will be returned.655*/656struct ti_sci_msg_req_lpm_set_device_constraint {657struct ti_sci_msg_hdr hdr;658u32 id;659u8 state;660u32 rsvd[2];661} __packed;662663/**664* struct ti_sci_msg_req_lpm_set_latency_constraint - Request for665* TISCI_MSG_LPM_SET_LATENCY_CONSTRAINT.666*667* @hdr: TISCI header to provide ACK/NAK flags to the host.668* @wkup_latency: The maximum acceptable latency to wake up from low power mode669* in milliseconds. The deeper the state, the higher the latency.670* @state: The desired state of wakeup latency constraint: set or clear.671* @rsvd: Reserved for future use.672*673* This message is used by host to set wakeup latency from low power mode. This can674* be sent anytime after boot before prepare sleep message, and can be sent after675* current low power mode is exited. Any device can set a constraint on the low power676* mode that the SoC can enter. It allows configurable information to be easily shared677* from the application, as this is a non-secure message and therefore can be sent by678* anyone. By setting a wakeup latency constraint, the host ensures that the resume time679* from selected low power mode will be less than the constraint value.680*/681struct ti_sci_msg_req_lpm_set_latency_constraint {682struct ti_sci_msg_hdr hdr;683u16 latency;684u8 state;685u32 rsvd;686} __packed;687688#define TI_SCI_IRQ_SECONDARY_HOST_INVALID 0xff689690/**691* struct ti_sci_msg_req_get_resource_range - Request to get a host's assigned692* range of resources.693* @hdr: Generic Header694* @type: Unique resource assignment type695* @subtype: Resource assignment subtype within the resource type.696* @secondary_host: Host processing entity to which the resources are697* allocated. This is required only when the destination698* host id id different from ti sci interface host id,699* else TI_SCI_IRQ_SECONDARY_HOST_INVALID can be passed.700*701* Request type is TI_SCI_MSG_GET_RESOURCE_RANGE. Responded with requested702* resource range which is of type TI_SCI_MSG_GET_RESOURCE_RANGE.703*/704struct ti_sci_msg_req_get_resource_range {705struct ti_sci_msg_hdr hdr;706#define MSG_RM_RESOURCE_TYPE_MASK GENMASK(9, 0)707#define MSG_RM_RESOURCE_SUBTYPE_MASK GENMASK(5, 0)708u16 type;709u8 subtype;710u8 secondary_host;711} __packed;712713/**714* struct ti_sci_msg_resp_get_resource_range - Response to resource get range.715* @hdr: Generic Header716* @range_start: Start index of the first resource range.717* @range_num: Number of resources in the first range.718* @range_start_sec: Start index of the second resource range.719* @range_num_sec: Number of resources in the second range.720*721* Response to request TI_SCI_MSG_GET_RESOURCE_RANGE.722*/723struct ti_sci_msg_resp_get_resource_range {724struct ti_sci_msg_hdr hdr;725u16 range_start;726u16 range_num;727u16 range_start_sec;728u16 range_num_sec;729} __packed;730731/**732* struct ti_sci_msg_req_manage_irq - Request to configure/release the route733* between the dev and the host.734* @hdr: Generic Header735* @valid_params: Bit fields defining the validity of interrupt source736* parameters. If a bit is not set, then corresponding737* field is not valid and will not be used for route set.738* Bit field definitions:739* 0 - Valid bit for @dst_id740* 1 - Valid bit for @dst_host_irq741* 2 - Valid bit for @ia_id742* 3 - Valid bit for @vint743* 4 - Valid bit for @global_event744* 5 - Valid bit for @vint_status_bit_index745* 31 - Valid bit for @secondary_host746* @src_id: IRQ source peripheral ID.747* @src_index: IRQ source index within the peripheral748* @dst_id: IRQ Destination ID. Based on the architecture it can be749* IRQ controller or host processor ID.750* @dst_host_irq: IRQ number of the destination host IRQ controller751* @ia_id: Device ID of the interrupt aggregator in which the752* vint resides.753* @vint: Virtual interrupt number if the interrupt route754* is through an interrupt aggregator.755* @global_event: Global event that is to be mapped to interrupt756* aggregator virtual interrupt status bit.757* @vint_status_bit: Virtual interrupt status bit if the interrupt route758* utilizes an interrupt aggregator status bit.759* @secondary_host: Host ID of the IRQ destination computing entity. This is760* required only when destination host id is different761* from ti sci interface host id.762*763* Request type is TI_SCI_MSG_SET/RELEASE_IRQ.764* Response is generic ACK / NACK message.765*/766struct ti_sci_msg_req_manage_irq {767struct ti_sci_msg_hdr hdr;768#define MSG_FLAG_DST_ID_VALID TI_SCI_MSG_FLAG(0)769#define MSG_FLAG_DST_HOST_IRQ_VALID TI_SCI_MSG_FLAG(1)770#define MSG_FLAG_IA_ID_VALID TI_SCI_MSG_FLAG(2)771#define MSG_FLAG_VINT_VALID TI_SCI_MSG_FLAG(3)772#define MSG_FLAG_GLB_EVNT_VALID TI_SCI_MSG_FLAG(4)773#define MSG_FLAG_VINT_STS_BIT_VALID TI_SCI_MSG_FLAG(5)774#define MSG_FLAG_SHOST_VALID TI_SCI_MSG_FLAG(31)775u32 valid_params;776u16 src_id;777u16 src_index;778u16 dst_id;779u16 dst_host_irq;780u16 ia_id;781u16 vint;782u16 global_event;783u8 vint_status_bit;784u8 secondary_host;785} __packed;786787/**788* struct ti_sci_msg_rm_ring_cfg_req - Configure a Navigator Subsystem ring789*790* Configures the non-real-time registers of a Navigator Subsystem ring.791* @hdr: Generic Header792* @valid_params: Bitfield defining validity of ring configuration parameters.793* The ring configuration fields are not valid, and will not be used for794* ring configuration, if their corresponding valid bit is zero.795* Valid bit usage:796* 0 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_lo797* 1 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_hi798* 2 - Valid bit for @tisci_msg_rm_ring_cfg_req count799* 3 - Valid bit for @tisci_msg_rm_ring_cfg_req mode800* 4 - Valid bit for @tisci_msg_rm_ring_cfg_req size801* 5 - Valid bit for @tisci_msg_rm_ring_cfg_req order_id802* 6 - Valid bit for @tisci_msg_rm_ring_cfg_req virtid803* 7 - Valid bit for @tisci_msg_rm_ring_cfg_req ASEL804* @nav_id: Device ID of Navigator Subsystem from which the ring is allocated805* @index: ring index to be configured.806* @addr_lo: 32 LSBs of ring base address to be programmed into the ring's807* RING_BA_LO register808* @addr_hi: 16 MSBs of ring base address to be programmed into the ring's809* RING_BA_HI register.810* @count: Number of ring elements. Must be even if mode is CREDENTIALS or QM811* modes.812* @mode: Specifies the mode the ring is to be configured.813* @size: Specifies encoded ring element size. To calculate the encoded size use814* the formula (log2(size_bytes) - 2), where size_bytes cannot be815* greater than 256.816* @order_id: Specifies the ring's bus order ID.817* @virtid: Ring virt ID value818* @asel: Ring ASEL (address select) value to be set into the ASEL field of the819* ring's RING_BA_HI register.820*/821struct ti_sci_msg_rm_ring_cfg_req {822struct ti_sci_msg_hdr hdr;823u32 valid_params;824u16 nav_id;825u16 index;826u32 addr_lo;827u32 addr_hi;828u32 count;829u8 mode;830u8 size;831u8 order_id;832u16 virtid;833u8 asel;834} __packed;835836/**837* struct ti_sci_msg_psil_pair - Pairs a PSI-L source thread to a destination838* thread839* @hdr: Generic Header840* @nav_id: SoC Navigator Subsystem device ID whose PSI-L config proxy is841* used to pair the source and destination threads.842* @src_thread: PSI-L source thread ID within the PSI-L System thread map.843*844* UDMAP transmit channels mapped to source threads will have their845* TCHAN_THRD_ID register programmed with the destination thread if the pairing846* is successful.847848* @dst_thread: PSI-L destination thread ID within the PSI-L System thread map.849* PSI-L destination threads start at index 0x8000. The request is NACK'd if850* the destination thread is not greater than or equal to 0x8000.851*852* UDMAP receive channels mapped to destination threads will have their853* RCHAN_THRD_ID register programmed with the source thread if the pairing854* is successful.855*856* Request type is TI_SCI_MSG_RM_PSIL_PAIR, response is a generic ACK or NACK857* message.858*/859struct ti_sci_msg_psil_pair {860struct ti_sci_msg_hdr hdr;861u32 nav_id;862u32 src_thread;863u32 dst_thread;864} __packed;865866/**867* struct ti_sci_msg_psil_unpair - Unpairs a PSI-L source thread from a868* destination thread869* @hdr: Generic Header870* @nav_id: SoC Navigator Subsystem device ID whose PSI-L config proxy is871* used to unpair the source and destination threads.872* @src_thread: PSI-L source thread ID within the PSI-L System thread map.873*874* UDMAP transmit channels mapped to source threads will have their875* TCHAN_THRD_ID register cleared if the unpairing is successful.876*877* @dst_thread: PSI-L destination thread ID within the PSI-L System thread map.878* PSI-L destination threads start at index 0x8000. The request is NACK'd if879* the destination thread is not greater than or equal to 0x8000.880*881* UDMAP receive channels mapped to destination threads will have their882* RCHAN_THRD_ID register cleared if the unpairing is successful.883*884* Request type is TI_SCI_MSG_RM_PSIL_UNPAIR, response is a generic ACK or NACK885* message.886*/887struct ti_sci_msg_psil_unpair {888struct ti_sci_msg_hdr hdr;889u32 nav_id;890u32 src_thread;891u32 dst_thread;892} __packed;893894/**895* struct ti_sci_msg_udmap_rx_flow_cfg - UDMAP receive flow configuration896* message897* @hdr: Generic Header898* @nav_id: SoC Navigator Subsystem device ID from which the receive flow is899* allocated900* @flow_index: UDMAP receive flow index for non-optional configuration.901* @rx_ch_index: Specifies the index of the receive channel using the flow_index902* @rx_einfo_present: UDMAP receive flow extended packet info present.903* @rx_psinfo_present: UDMAP receive flow PS words present.904* @rx_error_handling: UDMAP receive flow error handling configuration. Valid905* values are TI_SCI_RM_UDMAP_RX_FLOW_ERR_DROP/RETRY.906* @rx_desc_type: UDMAP receive flow descriptor type. It can be one of907* TI_SCI_RM_UDMAP_RX_FLOW_DESC_HOST/MONO.908* @rx_sop_offset: UDMAP receive flow start of packet offset.909* @rx_dest_qnum: UDMAP receive flow destination queue number.910* @rx_ps_location: UDMAP receive flow PS words location.911* 0 - end of packet descriptor912* 1 - Beginning of the data buffer913* @rx_src_tag_hi: UDMAP receive flow source tag high byte constant914* @rx_src_tag_lo: UDMAP receive flow source tag low byte constant915* @rx_dest_tag_hi: UDMAP receive flow destination tag high byte constant916* @rx_dest_tag_lo: UDMAP receive flow destination tag low byte constant917* @rx_src_tag_hi_sel: UDMAP receive flow source tag high byte selector918* @rx_src_tag_lo_sel: UDMAP receive flow source tag low byte selector919* @rx_dest_tag_hi_sel: UDMAP receive flow destination tag high byte selector920* @rx_dest_tag_lo_sel: UDMAP receive flow destination tag low byte selector921* @rx_size_thresh_en: UDMAP receive flow packet size based free buffer queue922* enable. If enabled, the ti_sci_rm_udmap_rx_flow_opt_cfg also need to be923* configured and sent.924* @rx_fdq0_sz0_qnum: UDMAP receive flow free descriptor queue 0.925* @rx_fdq1_qnum: UDMAP receive flow free descriptor queue 1.926* @rx_fdq2_qnum: UDMAP receive flow free descriptor queue 2.927* @rx_fdq3_qnum: UDMAP receive flow free descriptor queue 3.928*929* For detailed information on the settings, see the UDMAP section of the TRM.930*/931struct ti_sci_msg_udmap_rx_flow_cfg {932struct ti_sci_msg_hdr hdr;933u32 nav_id;934u32 flow_index;935u32 rx_ch_index;936u8 rx_einfo_present;937u8 rx_psinfo_present;938u8 rx_error_handling;939u8 rx_desc_type;940u16 rx_sop_offset;941u16 rx_dest_qnum;942u8 rx_ps_location;943u8 rx_src_tag_hi;944u8 rx_src_tag_lo;945u8 rx_dest_tag_hi;946u8 rx_dest_tag_lo;947u8 rx_src_tag_hi_sel;948u8 rx_src_tag_lo_sel;949u8 rx_dest_tag_hi_sel;950u8 rx_dest_tag_lo_sel;951u8 rx_size_thresh_en;952u16 rx_fdq0_sz0_qnum;953u16 rx_fdq1_qnum;954u16 rx_fdq2_qnum;955u16 rx_fdq3_qnum;956} __packed;957958/**959* struct rm_ti_sci_msg_udmap_rx_flow_opt_cfg - parameters for UDMAP receive960* flow optional configuration961* @hdr: Generic Header962* @nav_id: SoC Navigator Subsystem device ID from which the receive flow is963* allocated964* @flow_index: UDMAP receive flow index for optional configuration.965* @rx_ch_index: Specifies the index of the receive channel using the flow_index966* @rx_size_thresh0: UDMAP receive flow packet size threshold 0.967* @rx_size_thresh1: UDMAP receive flow packet size threshold 1.968* @rx_size_thresh2: UDMAP receive flow packet size threshold 2.969* @rx_fdq0_sz1_qnum: UDMAP receive flow free descriptor queue for size970* threshold 1.971* @rx_fdq0_sz2_qnum: UDMAP receive flow free descriptor queue for size972* threshold 2.973* @rx_fdq0_sz3_qnum: UDMAP receive flow free descriptor queue for size974* threshold 3.975*976* For detailed information on the settings, see the UDMAP section of the TRM.977*/978struct rm_ti_sci_msg_udmap_rx_flow_opt_cfg {979struct ti_sci_msg_hdr hdr;980u32 nav_id;981u32 flow_index;982u32 rx_ch_index;983u16 rx_size_thresh0;984u16 rx_size_thresh1;985u16 rx_size_thresh2;986u16 rx_fdq0_sz1_qnum;987u16 rx_fdq0_sz2_qnum;988u16 rx_fdq0_sz3_qnum;989} __packed;990991/**992* Configures a Navigator Subsystem UDMAP transmit channel993*994* Configures the non-real-time registers of a Navigator Subsystem UDMAP995* transmit channel. The channel index must be assigned to the host defined996* in the TISCI header via the RM board configuration resource assignment997* range list.998*999* @hdr: Generic Header1000*1001* @valid_params: Bitfield defining validity of tx channel configuration1002* parameters. The tx channel configuration fields are not valid, and will not1003* be used for ch configuration, if their corresponding valid bit is zero.1004* Valid bit usage:1005* 0 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_pause_on_err1006* 1 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_atype1007* 2 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_chan_type1008* 3 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_fetch_size1009* 4 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::txcq_qnum1010* 5 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_priority1011* 6 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_qos1012* 7 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_orderid1013* 8 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_sched_priority1014* 9 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_einfo1015* 10 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_pswords1016* 11 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_supr_tdpkt1017* 12 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_credit_count1018* 13 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::fdepth1019* 14 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_burst_size1020* 15 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_tdtype1021* 16 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::extended_ch_type1022*1023* @nav_id: SoC device ID of Navigator Subsystem where tx channel is located1024*1025* @index: UDMAP transmit channel index.1026*1027* @tx_pause_on_err: UDMAP transmit channel pause on error configuration to1028* be programmed into the tx_pause_on_err field of the channel's TCHAN_TCFG1029* register.1030*1031* @tx_filt_einfo: UDMAP transmit channel extended packet information passing1032* configuration to be programmed into the tx_filt_einfo field of the1033* channel's TCHAN_TCFG register.1034*1035* @tx_filt_pswords: UDMAP transmit channel protocol specific word passing1036* configuration to be programmed into the tx_filt_pswords field of the1037* channel's TCHAN_TCFG register.1038*1039* @tx_atype: UDMAP transmit channel non Ring Accelerator access pointer1040* interpretation configuration to be programmed into the tx_atype field of1041* the channel's TCHAN_TCFG register.1042*1043* @tx_chan_type: UDMAP transmit channel functional channel type and work1044* passing mechanism configuration to be programmed into the tx_chan_type1045* field of the channel's TCHAN_TCFG register.1046*1047* @tx_supr_tdpkt: UDMAP transmit channel teardown packet generation suppression1048* configuration to be programmed into the tx_supr_tdpkt field of the channel's1049* TCHAN_TCFG register.1050*1051* @tx_fetch_size: UDMAP transmit channel number of 32-bit descriptor words to1052* fetch configuration to be programmed into the tx_fetch_size field of the1053* channel's TCHAN_TCFG register. The user must make sure to set the maximum1054* word count that can pass through the channel for any allowed descriptor type.1055*1056* @tx_credit_count: UDMAP transmit channel transfer request credit count1057* configuration to be programmed into the count field of the TCHAN_TCREDIT1058* register. Specifies how many credits for complete TRs are available.1059*1060* @txcq_qnum: UDMAP transmit channel completion queue configuration to be1061* programmed into the txcq_qnum field of the TCHAN_TCQ register. The specified1062* completion queue must be assigned to the host, or a subordinate of the host,1063* requesting configuration of the transmit channel.1064*1065* @tx_priority: UDMAP transmit channel transmit priority value to be programmed1066* into the priority field of the channel's TCHAN_TPRI_CTRL register.1067*1068* @tx_qos: UDMAP transmit channel transmit qos value to be programmed into the1069* qos field of the channel's TCHAN_TPRI_CTRL register.1070*1071* @tx_orderid: UDMAP transmit channel bus order id value to be programmed into1072* the orderid field of the channel's TCHAN_TPRI_CTRL register.1073*1074* @fdepth: UDMAP transmit channel FIFO depth configuration to be programmed1075* into the fdepth field of the TCHAN_TFIFO_DEPTH register. Sets the number of1076* Tx FIFO bytes which are allowed to be stored for the channel. Check the UDMAP1077* section of the TRM for restrictions regarding this parameter.1078*1079* @tx_sched_priority: UDMAP transmit channel tx scheduling priority1080* configuration to be programmed into the priority field of the channel's1081* TCHAN_TST_SCHED register.1082*1083* @tx_burst_size: UDMAP transmit channel burst size configuration to be1084* programmed into the tx_burst_size field of the TCHAN_TCFG register.1085*1086* @tx_tdtype: UDMAP transmit channel teardown type configuration to be1087* programmed into the tdtype field of the TCHAN_TCFG register:1088* 0 - Return immediately1089* 1 - Wait for completion message from remote peer1090*1091* @extended_ch_type: Valid for BCDMA.1092* 0 - the channel is split tx channel (tchan)1093* 1 - the channel is block copy channel (bchan)1094*/1095struct ti_sci_msg_rm_udmap_tx_ch_cfg_req {1096struct ti_sci_msg_hdr hdr;1097u32 valid_params;1098u16 nav_id;1099u16 index;1100u8 tx_pause_on_err;1101u8 tx_filt_einfo;1102u8 tx_filt_pswords;1103u8 tx_atype;1104u8 tx_chan_type;1105u8 tx_supr_tdpkt;1106u16 tx_fetch_size;1107u8 tx_credit_count;1108u16 txcq_qnum;1109u8 tx_priority;1110u8 tx_qos;1111u8 tx_orderid;1112u16 fdepth;1113u8 tx_sched_priority;1114u8 tx_burst_size;1115u8 tx_tdtype;1116u8 extended_ch_type;1117} __packed;11181119/**1120* Configures a Navigator Subsystem UDMAP receive channel1121*1122* Configures the non-real-time registers of a Navigator Subsystem UDMAP1123* receive channel. The channel index must be assigned to the host defined1124* in the TISCI header via the RM board configuration resource assignment1125* range list.1126*1127* @hdr: Generic Header1128*1129* @valid_params: Bitfield defining validity of rx channel configuration1130* parameters.1131* The rx channel configuration fields are not valid, and will not be used for1132* ch configuration, if their corresponding valid bit is zero.1133* Valid bit usage:1134* 0 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_pause_on_err1135* 1 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_atype1136* 2 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_chan_type1137* 3 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_fetch_size1138* 4 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rxcq_qnum1139* 5 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_priority1140* 6 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_qos1141* 7 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_orderid1142* 8 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_sched_priority1143* 9 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_start1144* 10 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_cnt1145* 11 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_short1146* 12 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_long1147* 14 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_burst_size1148*1149* @nav_id: SoC device ID of Navigator Subsystem where rx channel is located1150*1151* @index: UDMAP receive channel index.1152*1153* @rx_fetch_size: UDMAP receive channel number of 32-bit descriptor words to1154* fetch configuration to be programmed into the rx_fetch_size field of the1155* channel's RCHAN_RCFG register.1156*1157* @rxcq_qnum: UDMAP receive channel completion queue configuration to be1158* programmed into the rxcq_qnum field of the RCHAN_RCQ register.1159* The specified completion queue must be assigned to the host, or a subordinate1160* of the host, requesting configuration of the receive channel.1161*1162* @rx_priority: UDMAP receive channel receive priority value to be programmed1163* into the priority field of the channel's RCHAN_RPRI_CTRL register.1164*1165* @rx_qos: UDMAP receive channel receive qos value to be programmed into the1166* qos field of the channel's RCHAN_RPRI_CTRL register.1167*1168* @rx_orderid: UDMAP receive channel bus order id value to be programmed into1169* the orderid field of the channel's RCHAN_RPRI_CTRL register.1170*1171* @rx_sched_priority: UDMAP receive channel rx scheduling priority1172* configuration to be programmed into the priority field of the channel's1173* RCHAN_RST_SCHED register.1174*1175* @flowid_start: UDMAP receive channel additional flows starting index1176* configuration to program into the flow_start field of the RCHAN_RFLOW_RNG1177* register. Specifies the starting index for flow IDs the receive channel is to1178* make use of beyond the default flow. flowid_start and @ref flowid_cnt must be1179* set as valid and configured together. The starting flow ID set by1180* @ref flowid_cnt must be a flow index within the Navigator Subsystem's subset1181* of flows beyond the default flows statically mapped to receive channels.1182* The additional flows must be assigned to the host, or a subordinate of the1183* host, requesting configuration of the receive channel.1184*1185* @flowid_cnt: UDMAP receive channel additional flows count configuration to1186* program into the flowid_cnt field of the RCHAN_RFLOW_RNG register.1187* This field specifies how many flow IDs are in the additional contiguous range1188* of legal flow IDs for the channel. @ref flowid_start and flowid_cnt must be1189* set as valid and configured together. Disabling the valid_params field bit1190* for flowid_cnt indicates no flow IDs other than the default are to be1191* allocated and used by the receive channel. @ref flowid_start plus flowid_cnt1192* cannot be greater than the number of receive flows in the receive channel's1193* Navigator Subsystem. The additional flows must be assigned to the host, or a1194* subordinate of the host, requesting configuration of the receive channel.1195*1196* @rx_pause_on_err: UDMAP receive channel pause on error configuration to be1197* programmed into the rx_pause_on_err field of the channel's RCHAN_RCFG1198* register.1199*1200* @rx_atype: UDMAP receive channel non Ring Accelerator access pointer1201* interpretation configuration to be programmed into the rx_atype field of the1202* channel's RCHAN_RCFG register.1203*1204* @rx_chan_type: UDMAP receive channel functional channel type and work passing1205* mechanism configuration to be programmed into the rx_chan_type field of the1206* channel's RCHAN_RCFG register.1207*1208* @rx_ignore_short: UDMAP receive channel short packet treatment configuration1209* to be programmed into the rx_ignore_short field of the RCHAN_RCFG register.1210*1211* @rx_ignore_long: UDMAP receive channel long packet treatment configuration to1212* be programmed into the rx_ignore_long field of the RCHAN_RCFG register.1213*1214* @rx_burst_size: UDMAP receive channel burst size configuration to be1215* programmed into the rx_burst_size field of the RCHAN_RCFG register.1216*/1217struct ti_sci_msg_rm_udmap_rx_ch_cfg_req {1218struct ti_sci_msg_hdr hdr;1219u32 valid_params;1220u16 nav_id;1221u16 index;1222u16 rx_fetch_size;1223u16 rxcq_qnum;1224u8 rx_priority;1225u8 rx_qos;1226u8 rx_orderid;1227u8 rx_sched_priority;1228u16 flowid_start;1229u16 flowid_cnt;1230u8 rx_pause_on_err;1231u8 rx_atype;1232u8 rx_chan_type;1233u8 rx_ignore_short;1234u8 rx_ignore_long;1235u8 rx_burst_size;1236} __packed;12371238/**1239* Configures a Navigator Subsystem UDMAP receive flow1240*1241* Configures a Navigator Subsystem UDMAP receive flow's registers.1242* Configuration does not include the flow registers which handle size-based1243* free descriptor queue routing.1244*1245* The flow index must be assigned to the host defined in the TISCI header via1246* the RM board configuration resource assignment range list.1247*1248* @hdr: Standard TISCI header1249*1250* @valid_params1251* Bitfield defining validity of rx flow configuration parameters. The1252* rx flow configuration fields are not valid, and will not be used for flow1253* configuration, if their corresponding valid bit is zero. Valid bit usage:1254* 0 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_einfo_present1255* 1 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_psinfo_present1256* 2 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_error_handling1257* 3 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_desc_type1258* 4 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_sop_offset1259* 5 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_qnum1260* 6 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi1261* 7 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo1262* 8 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi1263* 9 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo1264* 10 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi_sel1265* 11 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo_sel1266* 12 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi_sel1267* 13 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo_sel1268* 14 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq0_sz0_qnum1269* 15 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq1_sz0_qnum1270* 16 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq2_sz0_qnum1271* 17 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq3_sz0_qnum1272* 18 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_ps_location1273*1274* @nav_id: SoC device ID of Navigator Subsystem from which the receive flow is1275* allocated1276*1277* @flow_index: UDMAP receive flow index for non-optional configuration.1278*1279* @rx_einfo_present:1280* UDMAP receive flow extended packet info present configuration to be1281* programmed into the rx_einfo_present field of the flow's RFLOW_RFA register.1282*1283* @rx_psinfo_present:1284* UDMAP receive flow PS words present configuration to be programmed into the1285* rx_psinfo_present field of the flow's RFLOW_RFA register.1286*1287* @rx_error_handling:1288* UDMAP receive flow error handling configuration to be programmed into the1289* rx_error_handling field of the flow's RFLOW_RFA register.1290*1291* @rx_desc_type:1292* UDMAP receive flow descriptor type configuration to be programmed into the1293* rx_desc_type field field of the flow's RFLOW_RFA register.1294*1295* @rx_sop_offset:1296* UDMAP receive flow start of packet offset configuration to be programmed1297* into the rx_sop_offset field of the RFLOW_RFA register. See the UDMAP1298* section of the TRM for more information on this setting. Valid values for1299* this field are 0-255 bytes.1300*1301* @rx_dest_qnum:1302* UDMAP receive flow destination queue configuration to be programmed into the1303* rx_dest_qnum field of the flow's RFLOW_RFA register. The specified1304* destination queue must be valid within the Navigator Subsystem and must be1305* owned by the host, or a subordinate of the host, requesting allocation and1306* configuration of the receive flow.1307*1308* @rx_src_tag_hi:1309* UDMAP receive flow source tag high byte constant configuration to be1310* programmed into the rx_src_tag_hi field of the flow's RFLOW_RFB register.1311* See the UDMAP section of the TRM for more information on this setting.1312*1313* @rx_src_tag_lo:1314* UDMAP receive flow source tag low byte constant configuration to be1315* programmed into the rx_src_tag_lo field of the flow's RFLOW_RFB register.1316* See the UDMAP section of the TRM for more information on this setting.1317*1318* @rx_dest_tag_hi:1319* UDMAP receive flow destination tag high byte constant configuration to be1320* programmed into the rx_dest_tag_hi field of the flow's RFLOW_RFB register.1321* See the UDMAP section of the TRM for more information on this setting.1322*1323* @rx_dest_tag_lo:1324* UDMAP receive flow destination tag low byte constant configuration to be1325* programmed into the rx_dest_tag_lo field of the flow's RFLOW_RFB register.1326* See the UDMAP section of the TRM for more information on this setting.1327*1328* @rx_src_tag_hi_sel:1329* UDMAP receive flow source tag high byte selector configuration to be1330* programmed into the rx_src_tag_hi_sel field of the RFLOW_RFC register. See1331* the UDMAP section of the TRM for more information on this setting.1332*1333* @rx_src_tag_lo_sel:1334* UDMAP receive flow source tag low byte selector configuration to be1335* programmed into the rx_src_tag_lo_sel field of the RFLOW_RFC register. See1336* the UDMAP section of the TRM for more information on this setting.1337*1338* @rx_dest_tag_hi_sel:1339* UDMAP receive flow destination tag high byte selector configuration to be1340* programmed into the rx_dest_tag_hi_sel field of the RFLOW_RFC register. See1341* the UDMAP section of the TRM for more information on this setting.1342*1343* @rx_dest_tag_lo_sel:1344* UDMAP receive flow destination tag low byte selector configuration to be1345* programmed into the rx_dest_tag_lo_sel field of the RFLOW_RFC register. See1346* the UDMAP section of the TRM for more information on this setting.1347*1348* @rx_fdq0_sz0_qnum:1349* UDMAP receive flow free descriptor queue 0 configuration to be programmed1350* into the rx_fdq0_sz0_qnum field of the flow's RFLOW_RFD register. See the1351* UDMAP section of the TRM for more information on this setting. The specified1352* free queue must be valid within the Navigator Subsystem and must be owned1353* by the host, or a subordinate of the host, requesting allocation and1354* configuration of the receive flow.1355*1356* @rx_fdq1_qnum:1357* UDMAP receive flow free descriptor queue 1 configuration to be programmed1358* into the rx_fdq1_qnum field of the flow's RFLOW_RFD register. See the1359* UDMAP section of the TRM for more information on this setting. The specified1360* free queue must be valid within the Navigator Subsystem and must be owned1361* by the host, or a subordinate of the host, requesting allocation and1362* configuration of the receive flow.1363*1364* @rx_fdq2_qnum:1365* UDMAP receive flow free descriptor queue 2 configuration to be programmed1366* into the rx_fdq2_qnum field of the flow's RFLOW_RFE register. See the1367* UDMAP section of the TRM for more information on this setting. The specified1368* free queue must be valid within the Navigator Subsystem and must be owned1369* by the host, or a subordinate of the host, requesting allocation and1370* configuration of the receive flow.1371*1372* @rx_fdq3_qnum:1373* UDMAP receive flow free descriptor queue 3 configuration to be programmed1374* into the rx_fdq3_qnum field of the flow's RFLOW_RFE register. See the1375* UDMAP section of the TRM for more information on this setting. The specified1376* free queue must be valid within the Navigator Subsystem and must be owned1377* by the host, or a subordinate of the host, requesting allocation and1378* configuration of the receive flow.1379*1380* @rx_ps_location:1381* UDMAP receive flow PS words location configuration to be programmed into the1382* rx_ps_location field of the flow's RFLOW_RFA register.1383*/1384struct ti_sci_msg_rm_udmap_flow_cfg_req {1385struct ti_sci_msg_hdr hdr;1386u32 valid_params;1387u16 nav_id;1388u16 flow_index;1389u8 rx_einfo_present;1390u8 rx_psinfo_present;1391u8 rx_error_handling;1392u8 rx_desc_type;1393u16 rx_sop_offset;1394u16 rx_dest_qnum;1395u8 rx_src_tag_hi;1396u8 rx_src_tag_lo;1397u8 rx_dest_tag_hi;1398u8 rx_dest_tag_lo;1399u8 rx_src_tag_hi_sel;1400u8 rx_src_tag_lo_sel;1401u8 rx_dest_tag_hi_sel;1402u8 rx_dest_tag_lo_sel;1403u16 rx_fdq0_sz0_qnum;1404u16 rx_fdq1_qnum;1405u16 rx_fdq2_qnum;1406u16 rx_fdq3_qnum;1407u8 rx_ps_location;1408} __packed;14091410/**1411* struct ti_sci_msg_req_proc_request - Request a processor1412* @hdr: Generic Header1413* @processor_id: ID of processor being requested1414*1415* Request type is TI_SCI_MSG_PROC_REQUEST, response is a generic ACK/NACK1416* message.1417*/1418struct ti_sci_msg_req_proc_request {1419struct ti_sci_msg_hdr hdr;1420u8 processor_id;1421} __packed;14221423/**1424* struct ti_sci_msg_req_proc_release - Release a processor1425* @hdr: Generic Header1426* @processor_id: ID of processor being released1427*1428* Request type is TI_SCI_MSG_PROC_RELEASE, response is a generic ACK/NACK1429* message.1430*/1431struct ti_sci_msg_req_proc_release {1432struct ti_sci_msg_hdr hdr;1433u8 processor_id;1434} __packed;14351436/**1437* struct ti_sci_msg_req_proc_handover - Handover a processor to a host1438* @hdr: Generic Header1439* @processor_id: ID of processor being handed over1440* @host_id: Host ID the control needs to be transferred to1441*1442* Request type is TI_SCI_MSG_PROC_HANDOVER, response is a generic ACK/NACK1443* message.1444*/1445struct ti_sci_msg_req_proc_handover {1446struct ti_sci_msg_hdr hdr;1447u8 processor_id;1448u8 host_id;1449} __packed;14501451/* Boot Vector masks */1452#define TI_SCI_ADDR_LOW_MASK GENMASK_ULL(31, 0)1453#define TI_SCI_ADDR_HIGH_MASK GENMASK_ULL(63, 32)1454#define TI_SCI_ADDR_HIGH_SHIFT 3214551456/**1457* struct ti_sci_msg_req_set_config - Set Processor boot configuration1458* @hdr: Generic Header1459* @processor_id: ID of processor being configured1460* @bootvector_low: Lower 32 bit address (Little Endian) of boot vector1461* @bootvector_high: Higher 32 bit address (Little Endian) of boot vector1462* @config_flags_set: Optional Processor specific Config Flags to set.1463* Setting a bit here implies the corresponding mode1464* will be set1465* @config_flags_clear: Optional Processor specific Config Flags to clear.1466* Setting a bit here implies the corresponding mode1467* will be cleared1468*1469* Request type is TI_SCI_MSG_PROC_HANDOVER, response is a generic ACK/NACK1470* message.1471*/1472struct ti_sci_msg_req_set_config {1473struct ti_sci_msg_hdr hdr;1474u8 processor_id;1475u32 bootvector_low;1476u32 bootvector_high;1477u32 config_flags_set;1478u32 config_flags_clear;1479} __packed;14801481/**1482* struct ti_sci_msg_req_set_ctrl - Set Processor boot control flags1483* @hdr: Generic Header1484* @processor_id: ID of processor being configured1485* @control_flags_set: Optional Processor specific Control Flags to set.1486* Setting a bit here implies the corresponding mode1487* will be set1488* @control_flags_clear:Optional Processor specific Control Flags to clear.1489* Setting a bit here implies the corresponding mode1490* will be cleared1491*1492* Request type is TI_SCI_MSG_SET_CTRL, response is a generic ACK/NACK1493* message.1494*/1495struct ti_sci_msg_req_set_ctrl {1496struct ti_sci_msg_hdr hdr;1497u8 processor_id;1498u32 control_flags_set;1499u32 control_flags_clear;1500} __packed;15011502/**1503* struct ti_sci_msg_req_get_status - Processor boot status request1504* @hdr: Generic Header1505* @processor_id: ID of processor whose status is being requested1506*1507* Request type is TI_SCI_MSG_GET_STATUS, response is an appropriate1508* message, or NACK in case of inability to satisfy request.1509*/1510struct ti_sci_msg_req_get_status {1511struct ti_sci_msg_hdr hdr;1512u8 processor_id;1513} __packed;15141515/**1516* struct ti_sci_msg_resp_get_status - Processor boot status response1517* @hdr: Generic Header1518* @processor_id: ID of processor whose status is returned1519* @bootvector_low: Lower 32 bit address (Little Endian) of boot vector1520* @bootvector_high: Higher 32 bit address (Little Endian) of boot vector1521* @config_flags: Optional Processor specific Config Flags set currently1522* @control_flags: Optional Processor specific Control Flags set currently1523* @status_flags: Optional Processor specific Status Flags set currently1524*1525* Response structure to a TI_SCI_MSG_GET_STATUS request.1526*/1527struct ti_sci_msg_resp_get_status {1528struct ti_sci_msg_hdr hdr;1529u8 processor_id;1530u32 bootvector_low;1531u32 bootvector_high;1532u32 config_flags;1533u32 control_flags;1534u32 status_flags;1535} __packed;15361537#endif /* __TI_SCI_H */153815391540