/* 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 0x030A44#define TI_SCI_MSG_LPM_ABORT 0x03114546/* Resource Management Requests */47#define TI_SCI_MSG_GET_RESOURCE_RANGE 0x15004849/* IRQ requests */50#define TI_SCI_MSG_SET_IRQ 0x100051#define TI_SCI_MSG_FREE_IRQ 0x10015253/* NAVSS resource management */54/* Ringacc requests */55#define TI_SCI_MSG_RM_RING_ALLOCATE 0x110056#define TI_SCI_MSG_RM_RING_FREE 0x110157#define TI_SCI_MSG_RM_RING_RECONFIG 0x110258#define TI_SCI_MSG_RM_RING_RESET 0x110359#define TI_SCI_MSG_RM_RING_CFG 0x11106061/* PSI-L requests */62#define TI_SCI_MSG_RM_PSIL_PAIR 0x128063#define TI_SCI_MSG_RM_PSIL_UNPAIR 0x12816465#define TI_SCI_MSG_RM_UDMAP_TX_ALLOC 0x120066#define TI_SCI_MSG_RM_UDMAP_TX_FREE 0x120167#define TI_SCI_MSG_RM_UDMAP_RX_ALLOC 0x121068#define TI_SCI_MSG_RM_UDMAP_RX_FREE 0x121169#define TI_SCI_MSG_RM_UDMAP_FLOW_CFG 0x122070#define TI_SCI_MSG_RM_UDMAP_OPT_FLOW_CFG 0x12217172#define TISCI_MSG_RM_UDMAP_TX_CH_CFG 0x120573#define TISCI_MSG_RM_UDMAP_TX_CH_GET_CFG 0x120674#define TISCI_MSG_RM_UDMAP_RX_CH_CFG 0x121575#define TISCI_MSG_RM_UDMAP_RX_CH_GET_CFG 0x121676#define TISCI_MSG_RM_UDMAP_FLOW_CFG 0x123077#define TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_CFG 0x123178#define TISCI_MSG_RM_UDMAP_FLOW_GET_CFG 0x123279#define TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_GET_CFG 0x12338081/* Processor Control requests */82#define TI_SCI_MSG_PROC_REQUEST 0xc00083#define TI_SCI_MSG_PROC_RELEASE 0xc00184#define TI_SCI_MSG_PROC_HANDOVER 0xc00585#define TI_SCI_MSG_SET_CONFIG 0xc10086#define TI_SCI_MSG_SET_CTRL 0xc10187#define TI_SCI_MSG_GET_STATUS 0xc4008889/**90* struct ti_sci_msg_hdr - Generic Message Header for All messages and responses91* @type: Type of messages: One of TI_SCI_MSG* values92* @host: Host of the message93* @seq: Message identifier indicating a transfer sequence94* @flags: Flag for the message95*/96struct ti_sci_msg_hdr {97u16 type;98u8 host;99u8 seq;100#define TI_SCI_MSG_FLAG(val) (1 << (val))101#define TI_SCI_FLAG_REQ_GENERIC_NORESPONSE 0x0102#define TI_SCI_FLAG_REQ_ACK_ON_RECEIVED TI_SCI_MSG_FLAG(0)103#define TI_SCI_FLAG_REQ_ACK_ON_PROCESSED TI_SCI_MSG_FLAG(1)104#define TI_SCI_FLAG_RESP_GENERIC_NACK 0x0105#define TI_SCI_FLAG_RESP_GENERIC_ACK TI_SCI_MSG_FLAG(1)106/* Additional Flags */107u32 flags;108} __packed;109110/**111* struct ti_sci_msg_resp_version - Response for a message112* @hdr: Generic header113* @firmware_description: String describing the firmware114* @firmware_revision: Firmware revision115* @abi_major: Major version of the ABI that firmware supports116* @abi_minor: Minor version of the ABI that firmware supports117*118* In general, ABI version changes follow the rule that minor version increments119* are backward compatible. Major revision changes in ABI may not be120* backward compatible.121*122* Response to a generic message with message type TI_SCI_MSG_VERSION123*/124struct ti_sci_msg_resp_version {125struct ti_sci_msg_hdr hdr;126char firmware_description[32];127u16 firmware_revision;128u8 abi_major;129u8 abi_minor;130} __packed;131132/**133* struct ti_sci_msg_req_reboot - Reboot the SoC134* @hdr: Generic Header135*136* Request type is TI_SCI_MSG_SYS_RESET, responded with a generic137* ACK/NACK message.138*/139struct ti_sci_msg_req_reboot {140struct ti_sci_msg_hdr hdr;141} __packed;142143/**144* struct ti_sci_msg_resp_query_fw_caps - Response for query firmware caps145* @hdr: Generic header146* @fw_caps: Each bit in fw_caps indicating one FW/SOC capability147* MSG_FLAG_CAPS_GENERIC: Generic capability (LPM not supported)148* MSG_FLAG_CAPS_LPM_PARTIAL_IO: Partial IO in LPM149* MSG_FLAG_CAPS_LPM_DM_MANAGED: LPM can be managed by DM150* MSG_FLAG_CAPS_LPM_ABORT: Abort entry to LPM151*152* Response to a generic message with message type TI_SCI_MSG_QUERY_FW_CAPS153* providing currently available SOC/firmware capabilities. SoC that don't154* support low power modes return only MSG_FLAG_CAPS_GENERIC capability.155*/156struct ti_sci_msg_resp_query_fw_caps {157struct ti_sci_msg_hdr hdr;158#define MSG_FLAG_CAPS_GENERIC TI_SCI_MSG_FLAG(0)159#define MSG_FLAG_CAPS_LPM_PARTIAL_IO TI_SCI_MSG_FLAG(4)160#define MSG_FLAG_CAPS_LPM_DM_MANAGED TI_SCI_MSG_FLAG(5)161#define MSG_FLAG_CAPS_LPM_ABORT TI_SCI_MSG_FLAG(9)162#define MSG_MASK_CAPS_LPM GENMASK_ULL(4, 1)163u64 fw_caps;164} __packed;165166/**167* struct ti_sci_msg_req_set_device_state - Set the desired state of the device168* @hdr: Generic header169* @id: Indicates which device to modify170* @reserved: Reserved space in message, must be 0 for backward compatibility171* @state: The desired state of the device.172*173* Certain flags can also be set to alter the device state:174* + MSG_FLAG_DEVICE_WAKE_ENABLED - Configure the device to be a wake source.175* The meaning of this flag will vary slightly from device to device and from176* SoC to SoC but it generally allows the device to wake the SoC out of deep177* suspend states.178* + MSG_FLAG_DEVICE_RESET_ISO - Enable reset isolation for this device.179* + MSG_FLAG_DEVICE_EXCLUSIVE - Claim this device exclusively. When passed180* with STATE_RETENTION or STATE_ON, it will claim the device exclusively.181* If another host already has this device set to STATE_RETENTION or STATE_ON,182* the message will fail. Once successful, other hosts attempting to set183* STATE_RETENTION or STATE_ON will fail.184*185* Request type is TI_SCI_MSG_SET_DEVICE_STATE, responded with a generic186* ACK/NACK message.187*/188struct ti_sci_msg_req_set_device_state {189/* Additional hdr->flags options */190#define MSG_FLAG_DEVICE_WAKE_ENABLED TI_SCI_MSG_FLAG(8)191#define MSG_FLAG_DEVICE_RESET_ISO TI_SCI_MSG_FLAG(9)192#define MSG_FLAG_DEVICE_EXCLUSIVE TI_SCI_MSG_FLAG(10)193struct ti_sci_msg_hdr hdr;194u32 id;195u32 reserved;196197#define MSG_DEVICE_SW_STATE_AUTO_OFF 0198#define MSG_DEVICE_SW_STATE_RETENTION 1199#define MSG_DEVICE_SW_STATE_ON 2200u8 state;201} __packed;202203/**204* struct ti_sci_msg_req_get_device_state - Request to get device.205* @hdr: Generic header206* @id: Device Identifier207*208* Request type is TI_SCI_MSG_GET_DEVICE_STATE, responded device state209* information210*/211struct ti_sci_msg_req_get_device_state {212struct ti_sci_msg_hdr hdr;213u32 id;214} __packed;215216/**217* struct ti_sci_msg_resp_get_device_state - Response to get device request.218* @hdr: Generic header219* @context_loss_count: Indicates how many times the device has lost context. A220* driver can use this monotonic counter to determine if the device has221* lost context since the last time this message was exchanged.222* @resets: Programmed state of the reset lines.223* @programmed_state: The state as programmed by set_device.224* - Uses the MSG_DEVICE_SW_* macros225* @current_state: The actual state of the hardware.226*227* Response to request TI_SCI_MSG_GET_DEVICE_STATE.228*/229struct ti_sci_msg_resp_get_device_state {230struct ti_sci_msg_hdr hdr;231u32 context_loss_count;232u32 resets;233u8 programmed_state;234#define MSG_DEVICE_HW_STATE_OFF 0235#define MSG_DEVICE_HW_STATE_ON 1236#define MSG_DEVICE_HW_STATE_TRANS 2237u8 current_state;238} __packed;239240/**241* struct ti_sci_msg_req_set_device_resets - Set the desired resets242* configuration of the device243* @hdr: Generic header244* @id: Indicates which device to modify245* @resets: A bit field of resets for the device. The meaning, behavior,246* and usage of the reset flags are device specific. 0 for a bit247* indicates releasing the reset represented by that bit while 1248* indicates keeping it held.249*250* Request type is TI_SCI_MSG_SET_DEVICE_RESETS, responded with a generic251* ACK/NACK message.252*/253struct ti_sci_msg_req_set_device_resets {254struct ti_sci_msg_hdr hdr;255u32 id;256u32 resets;257} __packed;258259/**260* struct ti_sci_msg_req_set_clock_state - Request to setup a Clock state261* @hdr: Generic Header, Certain flags can be set specific to the clocks:262* MSG_FLAG_CLOCK_ALLOW_SSC: Allow this clock to be modified263* via spread spectrum clocking.264* MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE: Allow this clock's265* frequency to be changed while it is running so long as it266* is within the min/max limits.267* MSG_FLAG_CLOCK_INPUT_TERM: Enable input termination, this268* is only applicable to clock inputs on the SoC pseudo-device.269* @dev_id: Device identifier this request is for270* @clk_id: Clock identifier for the device for this request.271* Each device has it's own set of clock inputs. This indexes272* which clock input to modify. Set to 255 if clock ID is273* greater than or equal to 255.274* @request_state: Request the state for the clock to be set to.275* MSG_CLOCK_SW_STATE_UNREQ: The IP does not require this clock,276* it can be disabled, regardless of the state of the device277* MSG_CLOCK_SW_STATE_AUTO: Allow the System Controller to278* automatically manage the state of this clock. If the device279* is enabled, then the clock is enabled. If the device is set280* to off or retention, then the clock is internally set as not281* being required by the device.(default)282* MSG_CLOCK_SW_STATE_REQ: Configure the clock to be enabled,283* regardless of the state of the device.284* @clk_id_32: Clock identifier for the device for this request.285* Only to be used if the clock ID is greater than or equal to286* 255.287*288* Normally, all required clocks are managed by TISCI entity, this is used289* only for specific control *IF* required. Auto managed state is290* MSG_CLOCK_SW_STATE_AUTO, in other states, TISCI entity assume remote291* will explicitly control.292*293* Request type is TI_SCI_MSG_SET_CLOCK_STATE, response is a generic294* ACK or NACK message.295*/296struct ti_sci_msg_req_set_clock_state {297/* Additional hdr->flags options */298#define MSG_FLAG_CLOCK_ALLOW_SSC TI_SCI_MSG_FLAG(8)299#define MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE TI_SCI_MSG_FLAG(9)300#define MSG_FLAG_CLOCK_INPUT_TERM TI_SCI_MSG_FLAG(10)301struct ti_sci_msg_hdr hdr;302u32 dev_id;303u8 clk_id;304#define MSG_CLOCK_SW_STATE_UNREQ 0305#define MSG_CLOCK_SW_STATE_AUTO 1306#define MSG_CLOCK_SW_STATE_REQ 2307u8 request_state;308u32 clk_id_32;309} __packed;310311/**312* struct ti_sci_msg_req_get_clock_state - Request for clock state313* @hdr: Generic Header314* @dev_id: Device identifier this request is for315* @clk_id: Clock identifier for the device for this request.316* Each device has it's own set of clock inputs. This indexes317* which clock input to get state of. Set to 255 if the clock318* ID is greater than or equal to 255.319* @clk_id_32: Clock identifier for the device for the request.320* Only to be used if the clock ID is greater than or equal to321* 255.322*323* Request type is TI_SCI_MSG_GET_CLOCK_STATE, response is state324* of the clock325*/326struct ti_sci_msg_req_get_clock_state {327struct ti_sci_msg_hdr hdr;328u32 dev_id;329u8 clk_id;330u32 clk_id_32;331} __packed;332333/**334* struct ti_sci_msg_resp_get_clock_state - Response to get clock state335* @hdr: Generic Header336* @programmed_state: Any programmed state of the clock. This is one of337* MSG_CLOCK_SW_STATE* values.338* @current_state: Current state of the clock. This is one of:339* MSG_CLOCK_HW_STATE_NOT_READY: Clock is not ready340* MSG_CLOCK_HW_STATE_READY: Clock is ready341*342* Response to TI_SCI_MSG_GET_CLOCK_STATE.343*/344struct ti_sci_msg_resp_get_clock_state {345struct ti_sci_msg_hdr hdr;346u8 programmed_state;347#define MSG_CLOCK_HW_STATE_NOT_READY 0348#define MSG_CLOCK_HW_STATE_READY 1349u8 current_state;350} __packed;351352/**353* struct ti_sci_msg_req_set_clock_parent - Set the clock parent354* @hdr: Generic Header355* @dev_id: Device identifier this request is for356* @clk_id: Clock identifier for the device for this request.357* Each device has it's own set of clock inputs. This indexes358* which clock input to modify. Set to 255 if clock ID is359* greater than or equal to 255.360* @parent_id: The new clock parent is selectable by an index via this361* parameter. Set to 255 if clock ID is greater than or362* equal to 255.363* @clk_id_32: Clock identifier if @clk_id field is 255.364* @parent_id_32: Parent identifier if @parent_id is 255.365*366* Request type is TI_SCI_MSG_SET_CLOCK_PARENT, response is generic367* ACK / NACK message.368*/369struct ti_sci_msg_req_set_clock_parent {370struct ti_sci_msg_hdr hdr;371u32 dev_id;372u8 clk_id;373u8 parent_id;374u32 clk_id_32;375u32 parent_id_32;376} __packed;377378/**379* struct ti_sci_msg_req_get_clock_parent - Get the clock parent380* @hdr: Generic Header381* @dev_id: Device identifier this request is for382* @clk_id: Clock identifier for the device for this request.383* Each device has it's own set of clock inputs. This indexes384* which clock input to get the parent for. If this field385* contains 255, the actual clock identifier is stored in386* @clk_id_32.387* @clk_id_32: Clock identifier if the @clk_id field contains 255.388*389* Request type is TI_SCI_MSG_GET_CLOCK_PARENT, response is parent information390*/391struct ti_sci_msg_req_get_clock_parent {392struct ti_sci_msg_hdr hdr;393u32 dev_id;394u8 clk_id;395u32 clk_id_32;396} __packed;397398/**399* struct ti_sci_msg_resp_get_clock_parent - Response with clock parent400* @hdr: Generic Header401* @parent_id: The current clock parent. If set to 255, the current parent402* ID can be found from the @parent_id_32 field.403* @parent_id_32: Current clock parent if @parent_id field is set to404* 255.405*406* Response to TI_SCI_MSG_GET_CLOCK_PARENT.407*/408struct ti_sci_msg_resp_get_clock_parent {409struct ti_sci_msg_hdr hdr;410u8 parent_id;411u32 parent_id_32;412} __packed;413414/**415* struct ti_sci_msg_req_get_clock_num_parents - Request to get clock parents416* @hdr: Generic header417* @dev_id: Device identifier this request is for418* @clk_id: Clock identifier for the device for this request. Set to419* 255 if clock ID is greater than or equal to 255.420* @clk_id_32: Clock identifier if the @clk_id field contains 255.421*422* This request provides information about how many clock parent options423* are available for a given clock to a device. This is typically used424* for input clocks.425*426* Request type is TI_SCI_MSG_GET_NUM_CLOCK_PARENTS, response is appropriate427* message, or NACK in case of inability to satisfy request.428*/429struct ti_sci_msg_req_get_clock_num_parents {430struct ti_sci_msg_hdr hdr;431u32 dev_id;432u8 clk_id;433u32 clk_id_32;434} __packed;435436/**437* struct ti_sci_msg_resp_get_clock_num_parents - Response for get clk parents438* @hdr: Generic header439* @num_parents: Number of clock parents. If set to 255, the actual440* number of parents is stored into @num_parents_32441* field instead.442* @num_parents_32: Number of clock parents if @num_parents field is443* set to 255.444*445* Response to TI_SCI_MSG_GET_NUM_CLOCK_PARENTS446*/447struct ti_sci_msg_resp_get_clock_num_parents {448struct ti_sci_msg_hdr hdr;449u8 num_parents;450u32 num_parents_32;451} __packed;452453/**454* struct ti_sci_msg_req_query_clock_freq - Request to query a frequency455* @hdr: Generic Header456* @dev_id: Device identifier this request is for457* @min_freq_hz: The minimum allowable frequency in Hz. This is the minimum458* allowable programmed frequency and does not account for clock459* tolerances and jitter.460* @target_freq_hz: The target clock frequency. A frequency will be found461* as close to this target frequency as possible.462* @max_freq_hz: The maximum allowable frequency in Hz. This is the maximum463* allowable programmed frequency and does not account for clock464* tolerances and jitter.465* @clk_id: Clock identifier for the device for this request. Set to466* 255 if clock identifier is greater than or equal to 255.467* @clk_id_32: Clock identifier if @clk_id is set to 255.468*469* NOTE: Normally clock frequency management is automatically done by TISCI470* entity. In case of specific requests, TISCI evaluates capability to achieve471* requested frequency within provided range and responds with472* result message.473*474* Request type is TI_SCI_MSG_QUERY_CLOCK_FREQ, response is appropriate message,475* or NACK in case of inability to satisfy request.476*/477struct ti_sci_msg_req_query_clock_freq {478struct ti_sci_msg_hdr hdr;479u32 dev_id;480u64 min_freq_hz;481u64 target_freq_hz;482u64 max_freq_hz;483u8 clk_id;484u32 clk_id_32;485} __packed;486487/**488* struct ti_sci_msg_resp_query_clock_freq - Response to a clock frequency query489* @hdr: Generic Header490* @freq_hz: Frequency that is the best match in Hz.491*492* Response to request type TI_SCI_MSG_QUERY_CLOCK_FREQ. NOTE: if the request493* cannot be satisfied, the message will be of type NACK.494*/495struct ti_sci_msg_resp_query_clock_freq {496struct ti_sci_msg_hdr hdr;497u64 freq_hz;498} __packed;499500/**501* struct ti_sci_msg_req_set_clock_freq - Request to setup a clock frequency502* @hdr: Generic Header503* @dev_id: Device identifier this request is for504* @min_freq_hz: The minimum allowable frequency in Hz. This is the minimum505* allowable programmed frequency and does not account for clock506* tolerances and jitter.507* @target_freq_hz: The target clock frequency. The clock will be programmed508* at a rate as close to this target frequency as possible.509* @max_freq_hz: The maximum allowable frequency in Hz. This is the maximum510* allowable programmed frequency and does not account for clock511* tolerances and jitter.512* @clk_id: Clock identifier for the device for this request. Set to513* 255 if clock ID is greater than or equal to 255.514* @clk_id_32: Clock identifier if @clk_id field is set to 255.515*516* NOTE: Normally clock frequency management is automatically done by TISCI517* entity. In case of specific requests, TISCI evaluates capability to achieve518* requested range and responds with success/failure message.519*520* This sets the desired frequency for a clock within an allowable521* range. This message will fail on an enabled clock unless522* MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE is set for the clock. Additionally,523* if other clocks have their frequency modified due to this message,524* they also must have the MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE or be disabled.525*526* Calling set frequency on a clock input to the SoC pseudo-device will527* inform the PMMC of that clock's frequency. Setting a frequency of528* zero will indicate the clock is disabled.529*530* Calling set frequency on clock outputs from the SoC pseudo-device will531* function similarly to setting the clock frequency on a device.532*533* Request type is TI_SCI_MSG_SET_CLOCK_FREQ, response is a generic ACK/NACK534* message.535*/536struct ti_sci_msg_req_set_clock_freq {537struct ti_sci_msg_hdr hdr;538u32 dev_id;539u64 min_freq_hz;540u64 target_freq_hz;541u64 max_freq_hz;542u8 clk_id;543u32 clk_id_32;544} __packed;545546/**547* struct ti_sci_msg_req_get_clock_freq - Request to get the clock frequency548* @hdr: Generic Header549* @dev_id: Device identifier this request is for550* @clk_id: Clock identifier for the device for this request. Set to551* 255 if clock ID is greater than or equal to 255.552* @clk_id_32: Clock identifier if @clk_id field is set to 255.553*554* NOTE: Normally clock frequency management is automatically done by TISCI555* entity. In some cases, clock frequencies are configured by host.556*557* Request type is TI_SCI_MSG_GET_CLOCK_FREQ, responded with clock frequency558* that the clock is currently at.559*/560struct ti_sci_msg_req_get_clock_freq {561struct ti_sci_msg_hdr hdr;562u32 dev_id;563u8 clk_id;564u32 clk_id_32;565} __packed;566567/**568* struct ti_sci_msg_resp_get_clock_freq - Response of clock frequency request569* @hdr: Generic Header570* @freq_hz: Frequency that the clock is currently on, in Hz.571*572* Response to request type TI_SCI_MSG_GET_CLOCK_FREQ.573*/574struct ti_sci_msg_resp_get_clock_freq {575struct ti_sci_msg_hdr hdr;576u64 freq_hz;577} __packed;578579/**580* struct tisci_msg_req_prepare_sleep - Request for TISCI_MSG_PREPARE_SLEEP.581*582* @hdr TISCI header to provide ACK/NAK flags to the host.583* @mode Low power mode to enter.584* @ctx_lo Low 32-bits of physical pointer to address to use for context save.585* @ctx_hi High 32-bits of physical pointer to address to use for context save.586* @debug_flags Flags that can be set to halt the sequence during suspend or587* resume to allow JTAG connection and debug.588*589* This message is used as the first step of entering a low power mode. It590* allows configurable information, including which state to enter to be591* easily shared from the application, as this is a non-secure message and592* therefore can be sent by anyone.593*/594struct ti_sci_msg_req_prepare_sleep {595struct ti_sci_msg_hdr hdr;596597#define TISCI_MSG_VALUE_SLEEP_MODE_DM_MANAGED 0xfd598u8 mode;599u32 ctx_lo;600u32 ctx_hi;601u32 debug_flags;602} __packed;603604/**605* struct tisci_msg_set_io_isolation_req - Request for TI_SCI_MSG_SET_IO_ISOLATION.606*607* @hdr: Generic header608* @state: The deseared state of the IO isolation.609*610* This message is used to enable/disable IO isolation for low power modes.611* Response is generic ACK / NACK message.612*/613struct ti_sci_msg_req_set_io_isolation {614struct ti_sci_msg_hdr hdr;615u8 state;616} __packed;617618/**619* struct ti_sci_msg_resp_lpm_wake_reason - Response for TI_SCI_MSG_LPM_WAKE_REASON.620*621* @hdr: Generic header.622* @wake_source: The wake up source that woke soc from LPM.623* @wake_timestamp: Timestamp at which soc woke.624* @wake_pin: The pin that has triggered wake up.625* @mode: The last entered low power mode.626* @rsvd: Reserved for future use.627*628* Response to a generic message with message type TI_SCI_MSG_LPM_WAKE_REASON,629* used to query the wake up source, pin and entered low power mode.630*/631struct ti_sci_msg_resp_lpm_wake_reason {632struct ti_sci_msg_hdr hdr;633u32 wake_source;634u64 wake_timestamp;635u8 wake_pin;636u8 mode;637u32 rsvd[2];638} __packed;639640/**641* struct ti_sci_msg_req_lpm_set_device_constraint - Request for642* TISCI_MSG_LPM_SET_DEVICE_CONSTRAINT.643*644* @hdr: TISCI header to provide ACK/NAK flags to the host.645* @id: Device ID of device whose constraint has to be modified.646* @state: The desired state of device constraint: set or clear.647* @rsvd: Reserved for future use.648*649* This message is used by host to set constraint on the device. This can be650* sent anytime after boot before prepare sleep message. Any device can set a651* constraint on the low power mode that the SoC can enter. It allows652* configurable information to be easily shared from the application, as this653* is a non-secure message and therefore can be sent by anyone. By setting a654* constraint, the device ensures that it will not be powered off or reset in655* the selected mode. Note: Access Restriction: Exclusivity flag of Device will656* be honored. If some other host already has constraint on this device ID,657* NACK will be returned.658*/659struct ti_sci_msg_req_lpm_set_device_constraint {660struct ti_sci_msg_hdr hdr;661u32 id;662u8 state;663u32 rsvd[2];664} __packed;665666/**667* struct ti_sci_msg_req_lpm_set_latency_constraint - Request for668* TISCI_MSG_LPM_SET_LATENCY_CONSTRAINT.669*670* @hdr: TISCI header to provide ACK/NAK flags to the host.671* @wkup_latency: The maximum acceptable latency to wake up from low power mode672* in milliseconds. The deeper the state, the higher the latency.673* @state: The desired state of wakeup latency constraint: set or clear.674* @rsvd: Reserved for future use.675*676* This message is used by host to set wakeup latency from low power mode. This can677* be sent anytime after boot before prepare sleep message, and can be sent after678* current low power mode is exited. Any device can set a constraint on the low power679* mode that the SoC can enter. It allows configurable information to be easily shared680* from the application, as this is a non-secure message and therefore can be sent by681* anyone. By setting a wakeup latency constraint, the host ensures that the resume time682* from selected low power mode will be less than the constraint value.683*/684struct ti_sci_msg_req_lpm_set_latency_constraint {685struct ti_sci_msg_hdr hdr;686u16 latency;687u8 state;688u32 rsvd;689} __packed;690691#define TI_SCI_IRQ_SECONDARY_HOST_INVALID 0xff692693/**694* struct ti_sci_msg_req_get_resource_range - Request to get a host's assigned695* range of resources.696* @hdr: Generic Header697* @type: Unique resource assignment type698* @subtype: Resource assignment subtype within the resource type.699* @secondary_host: Host processing entity to which the resources are700* allocated. This is required only when the destination701* host id id different from ti sci interface host id,702* else TI_SCI_IRQ_SECONDARY_HOST_INVALID can be passed.703*704* Request type is TI_SCI_MSG_GET_RESOURCE_RANGE. Responded with requested705* resource range which is of type TI_SCI_MSG_GET_RESOURCE_RANGE.706*/707struct ti_sci_msg_req_get_resource_range {708struct ti_sci_msg_hdr hdr;709#define MSG_RM_RESOURCE_TYPE_MASK GENMASK(9, 0)710#define MSG_RM_RESOURCE_SUBTYPE_MASK GENMASK(5, 0)711u16 type;712u8 subtype;713u8 secondary_host;714} __packed;715716/**717* struct ti_sci_msg_resp_get_resource_range - Response to resource get range.718* @hdr: Generic Header719* @range_start: Start index of the first resource range.720* @range_num: Number of resources in the first range.721* @range_start_sec: Start index of the second resource range.722* @range_num_sec: Number of resources in the second range.723*724* Response to request TI_SCI_MSG_GET_RESOURCE_RANGE.725*/726struct ti_sci_msg_resp_get_resource_range {727struct ti_sci_msg_hdr hdr;728u16 range_start;729u16 range_num;730u16 range_start_sec;731u16 range_num_sec;732} __packed;733734/**735* struct ti_sci_msg_req_manage_irq - Request to configure/release the route736* between the dev and the host.737* @hdr: Generic Header738* @valid_params: Bit fields defining the validity of interrupt source739* parameters. If a bit is not set, then corresponding740* field is not valid and will not be used for route set.741* Bit field definitions:742* 0 - Valid bit for @dst_id743* 1 - Valid bit for @dst_host_irq744* 2 - Valid bit for @ia_id745* 3 - Valid bit for @vint746* 4 - Valid bit for @global_event747* 5 - Valid bit for @vint_status_bit_index748* 31 - Valid bit for @secondary_host749* @src_id: IRQ source peripheral ID.750* @src_index: IRQ source index within the peripheral751* @dst_id: IRQ Destination ID. Based on the architecture it can be752* IRQ controller or host processor ID.753* @dst_host_irq: IRQ number of the destination host IRQ controller754* @ia_id: Device ID of the interrupt aggregator in which the755* vint resides.756* @vint: Virtual interrupt number if the interrupt route757* is through an interrupt aggregator.758* @global_event: Global event that is to be mapped to interrupt759* aggregator virtual interrupt status bit.760* @vint_status_bit: Virtual interrupt status bit if the interrupt route761* utilizes an interrupt aggregator status bit.762* @secondary_host: Host ID of the IRQ destination computing entity. This is763* required only when destination host id is different764* from ti sci interface host id.765*766* Request type is TI_SCI_MSG_SET/RELEASE_IRQ.767* Response is generic ACK / NACK message.768*/769struct ti_sci_msg_req_manage_irq {770struct ti_sci_msg_hdr hdr;771#define MSG_FLAG_DST_ID_VALID TI_SCI_MSG_FLAG(0)772#define MSG_FLAG_DST_HOST_IRQ_VALID TI_SCI_MSG_FLAG(1)773#define MSG_FLAG_IA_ID_VALID TI_SCI_MSG_FLAG(2)774#define MSG_FLAG_VINT_VALID TI_SCI_MSG_FLAG(3)775#define MSG_FLAG_GLB_EVNT_VALID TI_SCI_MSG_FLAG(4)776#define MSG_FLAG_VINT_STS_BIT_VALID TI_SCI_MSG_FLAG(5)777#define MSG_FLAG_SHOST_VALID TI_SCI_MSG_FLAG(31)778u32 valid_params;779u16 src_id;780u16 src_index;781u16 dst_id;782u16 dst_host_irq;783u16 ia_id;784u16 vint;785u16 global_event;786u8 vint_status_bit;787u8 secondary_host;788} __packed;789790/**791* struct ti_sci_msg_rm_ring_cfg_req - Configure a Navigator Subsystem ring792*793* Configures the non-real-time registers of a Navigator Subsystem ring.794* @hdr: Generic Header795* @valid_params: Bitfield defining validity of ring configuration parameters.796* The ring configuration fields are not valid, and will not be used for797* ring configuration, if their corresponding valid bit is zero.798* Valid bit usage:799* 0 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_lo800* 1 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_hi801* 2 - Valid bit for @tisci_msg_rm_ring_cfg_req count802* 3 - Valid bit for @tisci_msg_rm_ring_cfg_req mode803* 4 - Valid bit for @tisci_msg_rm_ring_cfg_req size804* 5 - Valid bit for @tisci_msg_rm_ring_cfg_req order_id805* 6 - Valid bit for @tisci_msg_rm_ring_cfg_req virtid806* 7 - Valid bit for @tisci_msg_rm_ring_cfg_req ASEL807* @nav_id: Device ID of Navigator Subsystem from which the ring is allocated808* @index: ring index to be configured.809* @addr_lo: 32 LSBs of ring base address to be programmed into the ring's810* RING_BA_LO register811* @addr_hi: 16 MSBs of ring base address to be programmed into the ring's812* RING_BA_HI register.813* @count: Number of ring elements. Must be even if mode is CREDENTIALS or QM814* modes.815* @mode: Specifies the mode the ring is to be configured.816* @size: Specifies encoded ring element size. To calculate the encoded size use817* the formula (log2(size_bytes) - 2), where size_bytes cannot be818* greater than 256.819* @order_id: Specifies the ring's bus order ID.820* @virtid: Ring virt ID value821* @asel: Ring ASEL (address select) value to be set into the ASEL field of the822* ring's RING_BA_HI register.823*/824struct ti_sci_msg_rm_ring_cfg_req {825struct ti_sci_msg_hdr hdr;826u32 valid_params;827u16 nav_id;828u16 index;829u32 addr_lo;830u32 addr_hi;831u32 count;832u8 mode;833u8 size;834u8 order_id;835u16 virtid;836u8 asel;837} __packed;838839/**840* struct ti_sci_msg_psil_pair - Pairs a PSI-L source thread to a destination841* thread842* @hdr: Generic Header843* @nav_id: SoC Navigator Subsystem device ID whose PSI-L config proxy is844* used to pair the source and destination threads.845* @src_thread: PSI-L source thread ID within the PSI-L System thread map.846*847* UDMAP transmit channels mapped to source threads will have their848* TCHAN_THRD_ID register programmed with the destination thread if the pairing849* is successful.850851* @dst_thread: PSI-L destination thread ID within the PSI-L System thread map.852* PSI-L destination threads start at index 0x8000. The request is NACK'd if853* the destination thread is not greater than or equal to 0x8000.854*855* UDMAP receive channels mapped to destination threads will have their856* RCHAN_THRD_ID register programmed with the source thread if the pairing857* is successful.858*859* Request type is TI_SCI_MSG_RM_PSIL_PAIR, response is a generic ACK or NACK860* message.861*/862struct ti_sci_msg_psil_pair {863struct ti_sci_msg_hdr hdr;864u32 nav_id;865u32 src_thread;866u32 dst_thread;867} __packed;868869/**870* struct ti_sci_msg_psil_unpair - Unpairs a PSI-L source thread from a871* destination thread872* @hdr: Generic Header873* @nav_id: SoC Navigator Subsystem device ID whose PSI-L config proxy is874* used to unpair the source and destination threads.875* @src_thread: PSI-L source thread ID within the PSI-L System thread map.876*877* UDMAP transmit channels mapped to source threads will have their878* TCHAN_THRD_ID register cleared if the unpairing is successful.879*880* @dst_thread: PSI-L destination thread ID within the PSI-L System thread map.881* PSI-L destination threads start at index 0x8000. The request is NACK'd if882* the destination thread is not greater than or equal to 0x8000.883*884* UDMAP receive channels mapped to destination threads will have their885* RCHAN_THRD_ID register cleared if the unpairing is successful.886*887* Request type is TI_SCI_MSG_RM_PSIL_UNPAIR, response is a generic ACK or NACK888* message.889*/890struct ti_sci_msg_psil_unpair {891struct ti_sci_msg_hdr hdr;892u32 nav_id;893u32 src_thread;894u32 dst_thread;895} __packed;896897/**898* struct ti_sci_msg_udmap_rx_flow_cfg - UDMAP receive flow configuration899* message900* @hdr: Generic Header901* @nav_id: SoC Navigator Subsystem device ID from which the receive flow is902* allocated903* @flow_index: UDMAP receive flow index for non-optional configuration.904* @rx_ch_index: Specifies the index of the receive channel using the flow_index905* @rx_einfo_present: UDMAP receive flow extended packet info present.906* @rx_psinfo_present: UDMAP receive flow PS words present.907* @rx_error_handling: UDMAP receive flow error handling configuration. Valid908* values are TI_SCI_RM_UDMAP_RX_FLOW_ERR_DROP/RETRY.909* @rx_desc_type: UDMAP receive flow descriptor type. It can be one of910* TI_SCI_RM_UDMAP_RX_FLOW_DESC_HOST/MONO.911* @rx_sop_offset: UDMAP receive flow start of packet offset.912* @rx_dest_qnum: UDMAP receive flow destination queue number.913* @rx_ps_location: UDMAP receive flow PS words location.914* 0 - end of packet descriptor915* 1 - Beginning of the data buffer916* @rx_src_tag_hi: UDMAP receive flow source tag high byte constant917* @rx_src_tag_lo: UDMAP receive flow source tag low byte constant918* @rx_dest_tag_hi: UDMAP receive flow destination tag high byte constant919* @rx_dest_tag_lo: UDMAP receive flow destination tag low byte constant920* @rx_src_tag_hi_sel: UDMAP receive flow source tag high byte selector921* @rx_src_tag_lo_sel: UDMAP receive flow source tag low byte selector922* @rx_dest_tag_hi_sel: UDMAP receive flow destination tag high byte selector923* @rx_dest_tag_lo_sel: UDMAP receive flow destination tag low byte selector924* @rx_size_thresh_en: UDMAP receive flow packet size based free buffer queue925* enable. If enabled, the ti_sci_rm_udmap_rx_flow_opt_cfg also need to be926* configured and sent.927* @rx_fdq0_sz0_qnum: UDMAP receive flow free descriptor queue 0.928* @rx_fdq1_qnum: UDMAP receive flow free descriptor queue 1.929* @rx_fdq2_qnum: UDMAP receive flow free descriptor queue 2.930* @rx_fdq3_qnum: UDMAP receive flow free descriptor queue 3.931*932* For detailed information on the settings, see the UDMAP section of the TRM.933*/934struct ti_sci_msg_udmap_rx_flow_cfg {935struct ti_sci_msg_hdr hdr;936u32 nav_id;937u32 flow_index;938u32 rx_ch_index;939u8 rx_einfo_present;940u8 rx_psinfo_present;941u8 rx_error_handling;942u8 rx_desc_type;943u16 rx_sop_offset;944u16 rx_dest_qnum;945u8 rx_ps_location;946u8 rx_src_tag_hi;947u8 rx_src_tag_lo;948u8 rx_dest_tag_hi;949u8 rx_dest_tag_lo;950u8 rx_src_tag_hi_sel;951u8 rx_src_tag_lo_sel;952u8 rx_dest_tag_hi_sel;953u8 rx_dest_tag_lo_sel;954u8 rx_size_thresh_en;955u16 rx_fdq0_sz0_qnum;956u16 rx_fdq1_qnum;957u16 rx_fdq2_qnum;958u16 rx_fdq3_qnum;959} __packed;960961/**962* struct rm_ti_sci_msg_udmap_rx_flow_opt_cfg - parameters for UDMAP receive963* flow optional configuration964* @hdr: Generic Header965* @nav_id: SoC Navigator Subsystem device ID from which the receive flow is966* allocated967* @flow_index: UDMAP receive flow index for optional configuration.968* @rx_ch_index: Specifies the index of the receive channel using the flow_index969* @rx_size_thresh0: UDMAP receive flow packet size threshold 0.970* @rx_size_thresh1: UDMAP receive flow packet size threshold 1.971* @rx_size_thresh2: UDMAP receive flow packet size threshold 2.972* @rx_fdq0_sz1_qnum: UDMAP receive flow free descriptor queue for size973* threshold 1.974* @rx_fdq0_sz2_qnum: UDMAP receive flow free descriptor queue for size975* threshold 2.976* @rx_fdq0_sz3_qnum: UDMAP receive flow free descriptor queue for size977* threshold 3.978*979* For detailed information on the settings, see the UDMAP section of the TRM.980*/981struct rm_ti_sci_msg_udmap_rx_flow_opt_cfg {982struct ti_sci_msg_hdr hdr;983u32 nav_id;984u32 flow_index;985u32 rx_ch_index;986u16 rx_size_thresh0;987u16 rx_size_thresh1;988u16 rx_size_thresh2;989u16 rx_fdq0_sz1_qnum;990u16 rx_fdq0_sz2_qnum;991u16 rx_fdq0_sz3_qnum;992} __packed;993994/**995* Configures a Navigator Subsystem UDMAP transmit channel996*997* Configures the non-real-time registers of a Navigator Subsystem UDMAP998* transmit channel. The channel index must be assigned to the host defined999* in the TISCI header via the RM board configuration resource assignment1000* range list.1001*1002* @hdr: Generic Header1003*1004* @valid_params: Bitfield defining validity of tx channel configuration1005* parameters. The tx channel configuration fields are not valid, and will not1006* be used for ch configuration, if their corresponding valid bit is zero.1007* Valid bit usage:1008* 0 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_pause_on_err1009* 1 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_atype1010* 2 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_chan_type1011* 3 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_fetch_size1012* 4 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::txcq_qnum1013* 5 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_priority1014* 6 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_qos1015* 7 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_orderid1016* 8 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_sched_priority1017* 9 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_einfo1018* 10 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_pswords1019* 11 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_supr_tdpkt1020* 12 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_credit_count1021* 13 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::fdepth1022* 14 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_burst_size1023* 15 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_tdtype1024* 16 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::extended_ch_type1025*1026* @nav_id: SoC device ID of Navigator Subsystem where tx channel is located1027*1028* @index: UDMAP transmit channel index.1029*1030* @tx_pause_on_err: UDMAP transmit channel pause on error configuration to1031* be programmed into the tx_pause_on_err field of the channel's TCHAN_TCFG1032* register.1033*1034* @tx_filt_einfo: UDMAP transmit channel extended packet information passing1035* configuration to be programmed into the tx_filt_einfo field of the1036* channel's TCHAN_TCFG register.1037*1038* @tx_filt_pswords: UDMAP transmit channel protocol specific word passing1039* configuration to be programmed into the tx_filt_pswords field of the1040* channel's TCHAN_TCFG register.1041*1042* @tx_atype: UDMAP transmit channel non Ring Accelerator access pointer1043* interpretation configuration to be programmed into the tx_atype field of1044* the channel's TCHAN_TCFG register.1045*1046* @tx_chan_type: UDMAP transmit channel functional channel type and work1047* passing mechanism configuration to be programmed into the tx_chan_type1048* field of the channel's TCHAN_TCFG register.1049*1050* @tx_supr_tdpkt: UDMAP transmit channel teardown packet generation suppression1051* configuration to be programmed into the tx_supr_tdpkt field of the channel's1052* TCHAN_TCFG register.1053*1054* @tx_fetch_size: UDMAP transmit channel number of 32-bit descriptor words to1055* fetch configuration to be programmed into the tx_fetch_size field of the1056* channel's TCHAN_TCFG register. The user must make sure to set the maximum1057* word count that can pass through the channel for any allowed descriptor type.1058*1059* @tx_credit_count: UDMAP transmit channel transfer request credit count1060* configuration to be programmed into the count field of the TCHAN_TCREDIT1061* register. Specifies how many credits for complete TRs are available.1062*1063* @txcq_qnum: UDMAP transmit channel completion queue configuration to be1064* programmed into the txcq_qnum field of the TCHAN_TCQ register. The specified1065* completion queue must be assigned to the host, or a subordinate of the host,1066* requesting configuration of the transmit channel.1067*1068* @tx_priority: UDMAP transmit channel transmit priority value to be programmed1069* into the priority field of the channel's TCHAN_TPRI_CTRL register.1070*1071* @tx_qos: UDMAP transmit channel transmit qos value to be programmed into the1072* qos field of the channel's TCHAN_TPRI_CTRL register.1073*1074* @tx_orderid: UDMAP transmit channel bus order id value to be programmed into1075* the orderid field of the channel's TCHAN_TPRI_CTRL register.1076*1077* @fdepth: UDMAP transmit channel FIFO depth configuration to be programmed1078* into the fdepth field of the TCHAN_TFIFO_DEPTH register. Sets the number of1079* Tx FIFO bytes which are allowed to be stored for the channel. Check the UDMAP1080* section of the TRM for restrictions regarding this parameter.1081*1082* @tx_sched_priority: UDMAP transmit channel tx scheduling priority1083* configuration to be programmed into the priority field of the channel's1084* TCHAN_TST_SCHED register.1085*1086* @tx_burst_size: UDMAP transmit channel burst size configuration to be1087* programmed into the tx_burst_size field of the TCHAN_TCFG register.1088*1089* @tx_tdtype: UDMAP transmit channel teardown type configuration to be1090* programmed into the tdtype field of the TCHAN_TCFG register:1091* 0 - Return immediately1092* 1 - Wait for completion message from remote peer1093*1094* @extended_ch_type: Valid for BCDMA.1095* 0 - the channel is split tx channel (tchan)1096* 1 - the channel is block copy channel (bchan)1097*/1098struct ti_sci_msg_rm_udmap_tx_ch_cfg_req {1099struct ti_sci_msg_hdr hdr;1100u32 valid_params;1101u16 nav_id;1102u16 index;1103u8 tx_pause_on_err;1104u8 tx_filt_einfo;1105u8 tx_filt_pswords;1106u8 tx_atype;1107u8 tx_chan_type;1108u8 tx_supr_tdpkt;1109u16 tx_fetch_size;1110u8 tx_credit_count;1111u16 txcq_qnum;1112u8 tx_priority;1113u8 tx_qos;1114u8 tx_orderid;1115u16 fdepth;1116u8 tx_sched_priority;1117u8 tx_burst_size;1118u8 tx_tdtype;1119u8 extended_ch_type;1120} __packed;11211122/**1123* Configures a Navigator Subsystem UDMAP receive channel1124*1125* Configures the non-real-time registers of a Navigator Subsystem UDMAP1126* receive channel. The channel index must be assigned to the host defined1127* in the TISCI header via the RM board configuration resource assignment1128* range list.1129*1130* @hdr: Generic Header1131*1132* @valid_params: Bitfield defining validity of rx channel configuration1133* parameters.1134* The rx channel configuration fields are not valid, and will not be used for1135* ch configuration, if their corresponding valid bit is zero.1136* Valid bit usage:1137* 0 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_pause_on_err1138* 1 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_atype1139* 2 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_chan_type1140* 3 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_fetch_size1141* 4 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rxcq_qnum1142* 5 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_priority1143* 6 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_qos1144* 7 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_orderid1145* 8 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_sched_priority1146* 9 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_start1147* 10 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_cnt1148* 11 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_short1149* 12 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_long1150* 14 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_burst_size1151*1152* @nav_id: SoC device ID of Navigator Subsystem where rx channel is located1153*1154* @index: UDMAP receive channel index.1155*1156* @rx_fetch_size: UDMAP receive channel number of 32-bit descriptor words to1157* fetch configuration to be programmed into the rx_fetch_size field of the1158* channel's RCHAN_RCFG register.1159*1160* @rxcq_qnum: UDMAP receive channel completion queue configuration to be1161* programmed into the rxcq_qnum field of the RCHAN_RCQ register.1162* The specified completion queue must be assigned to the host, or a subordinate1163* of the host, requesting configuration of the receive channel.1164*1165* @rx_priority: UDMAP receive channel receive priority value to be programmed1166* into the priority field of the channel's RCHAN_RPRI_CTRL register.1167*1168* @rx_qos: UDMAP receive channel receive qos value to be programmed into the1169* qos field of the channel's RCHAN_RPRI_CTRL register.1170*1171* @rx_orderid: UDMAP receive channel bus order id value to be programmed into1172* the orderid field of the channel's RCHAN_RPRI_CTRL register.1173*1174* @rx_sched_priority: UDMAP receive channel rx scheduling priority1175* configuration to be programmed into the priority field of the channel's1176* RCHAN_RST_SCHED register.1177*1178* @flowid_start: UDMAP receive channel additional flows starting index1179* configuration to program into the flow_start field of the RCHAN_RFLOW_RNG1180* register. Specifies the starting index for flow IDs the receive channel is to1181* make use of beyond the default flow. flowid_start and @ref flowid_cnt must be1182* set as valid and configured together. The starting flow ID set by1183* @ref flowid_cnt must be a flow index within the Navigator Subsystem's subset1184* of flows beyond the default flows statically mapped to receive channels.1185* The additional flows must be assigned to the host, or a subordinate of the1186* host, requesting configuration of the receive channel.1187*1188* @flowid_cnt: UDMAP receive channel additional flows count configuration to1189* program into the flowid_cnt field of the RCHAN_RFLOW_RNG register.1190* This field specifies how many flow IDs are in the additional contiguous range1191* of legal flow IDs for the channel. @ref flowid_start and flowid_cnt must be1192* set as valid and configured together. Disabling the valid_params field bit1193* for flowid_cnt indicates no flow IDs other than the default are to be1194* allocated and used by the receive channel. @ref flowid_start plus flowid_cnt1195* cannot be greater than the number of receive flows in the receive channel's1196* Navigator Subsystem. The additional flows must be assigned to the host, or a1197* subordinate of the host, requesting configuration of the receive channel.1198*1199* @rx_pause_on_err: UDMAP receive channel pause on error configuration to be1200* programmed into the rx_pause_on_err field of the channel's RCHAN_RCFG1201* register.1202*1203* @rx_atype: UDMAP receive channel non Ring Accelerator access pointer1204* interpretation configuration to be programmed into the rx_atype field of the1205* channel's RCHAN_RCFG register.1206*1207* @rx_chan_type: UDMAP receive channel functional channel type and work passing1208* mechanism configuration to be programmed into the rx_chan_type field of the1209* channel's RCHAN_RCFG register.1210*1211* @rx_ignore_short: UDMAP receive channel short packet treatment configuration1212* to be programmed into the rx_ignore_short field of the RCHAN_RCFG register.1213*1214* @rx_ignore_long: UDMAP receive channel long packet treatment configuration to1215* be programmed into the rx_ignore_long field of the RCHAN_RCFG register.1216*1217* @rx_burst_size: UDMAP receive channel burst size configuration to be1218* programmed into the rx_burst_size field of the RCHAN_RCFG register.1219*/1220struct ti_sci_msg_rm_udmap_rx_ch_cfg_req {1221struct ti_sci_msg_hdr hdr;1222u32 valid_params;1223u16 nav_id;1224u16 index;1225u16 rx_fetch_size;1226u16 rxcq_qnum;1227u8 rx_priority;1228u8 rx_qos;1229u8 rx_orderid;1230u8 rx_sched_priority;1231u16 flowid_start;1232u16 flowid_cnt;1233u8 rx_pause_on_err;1234u8 rx_atype;1235u8 rx_chan_type;1236u8 rx_ignore_short;1237u8 rx_ignore_long;1238u8 rx_burst_size;1239} __packed;12401241/**1242* Configures a Navigator Subsystem UDMAP receive flow1243*1244* Configures a Navigator Subsystem UDMAP receive flow's registers.1245* Configuration does not include the flow registers which handle size-based1246* free descriptor queue routing.1247*1248* The flow index must be assigned to the host defined in the TISCI header via1249* the RM board configuration resource assignment range list.1250*1251* @hdr: Standard TISCI header1252*1253* @valid_params1254* Bitfield defining validity of rx flow configuration parameters. The1255* rx flow configuration fields are not valid, and will not be used for flow1256* configuration, if their corresponding valid bit is zero. Valid bit usage:1257* 0 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_einfo_present1258* 1 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_psinfo_present1259* 2 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_error_handling1260* 3 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_desc_type1261* 4 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_sop_offset1262* 5 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_qnum1263* 6 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi1264* 7 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo1265* 8 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi1266* 9 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo1267* 10 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi_sel1268* 11 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo_sel1269* 12 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi_sel1270* 13 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo_sel1271* 14 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq0_sz0_qnum1272* 15 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq1_sz0_qnum1273* 16 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq2_sz0_qnum1274* 17 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq3_sz0_qnum1275* 18 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_ps_location1276*1277* @nav_id: SoC device ID of Navigator Subsystem from which the receive flow is1278* allocated1279*1280* @flow_index: UDMAP receive flow index for non-optional configuration.1281*1282* @rx_einfo_present:1283* UDMAP receive flow extended packet info present configuration to be1284* programmed into the rx_einfo_present field of the flow's RFLOW_RFA register.1285*1286* @rx_psinfo_present:1287* UDMAP receive flow PS words present configuration to be programmed into the1288* rx_psinfo_present field of the flow's RFLOW_RFA register.1289*1290* @rx_error_handling:1291* UDMAP receive flow error handling configuration to be programmed into the1292* rx_error_handling field of the flow's RFLOW_RFA register.1293*1294* @rx_desc_type:1295* UDMAP receive flow descriptor type configuration to be programmed into the1296* rx_desc_type field field of the flow's RFLOW_RFA register.1297*1298* @rx_sop_offset:1299* UDMAP receive flow start of packet offset configuration to be programmed1300* into the rx_sop_offset field of the RFLOW_RFA register. See the UDMAP1301* section of the TRM for more information on this setting. Valid values for1302* this field are 0-255 bytes.1303*1304* @rx_dest_qnum:1305* UDMAP receive flow destination queue configuration to be programmed into the1306* rx_dest_qnum field of the flow's RFLOW_RFA register. The specified1307* destination queue must be valid within the Navigator Subsystem and must be1308* owned by the host, or a subordinate of the host, requesting allocation and1309* configuration of the receive flow.1310*1311* @rx_src_tag_hi:1312* UDMAP receive flow source tag high byte constant configuration to be1313* programmed into the rx_src_tag_hi field of the flow's RFLOW_RFB register.1314* See the UDMAP section of the TRM for more information on this setting.1315*1316* @rx_src_tag_lo:1317* UDMAP receive flow source tag low byte constant configuration to be1318* programmed into the rx_src_tag_lo field of the flow's RFLOW_RFB register.1319* See the UDMAP section of the TRM for more information on this setting.1320*1321* @rx_dest_tag_hi:1322* UDMAP receive flow destination tag high byte constant configuration to be1323* programmed into the rx_dest_tag_hi field of the flow's RFLOW_RFB register.1324* See the UDMAP section of the TRM for more information on this setting.1325*1326* @rx_dest_tag_lo:1327* UDMAP receive flow destination tag low byte constant configuration to be1328* programmed into the rx_dest_tag_lo field of the flow's RFLOW_RFB register.1329* See the UDMAP section of the TRM for more information on this setting.1330*1331* @rx_src_tag_hi_sel:1332* UDMAP receive flow source tag high byte selector configuration to be1333* programmed into the rx_src_tag_hi_sel field of the RFLOW_RFC register. See1334* the UDMAP section of the TRM for more information on this setting.1335*1336* @rx_src_tag_lo_sel:1337* UDMAP receive flow source tag low byte selector configuration to be1338* programmed into the rx_src_tag_lo_sel field of the RFLOW_RFC register. See1339* the UDMAP section of the TRM for more information on this setting.1340*1341* @rx_dest_tag_hi_sel:1342* UDMAP receive flow destination tag high byte selector configuration to be1343* programmed into the rx_dest_tag_hi_sel field of the RFLOW_RFC register. See1344* the UDMAP section of the TRM for more information on this setting.1345*1346* @rx_dest_tag_lo_sel:1347* UDMAP receive flow destination tag low byte selector configuration to be1348* programmed into the rx_dest_tag_lo_sel field of the RFLOW_RFC register. See1349* the UDMAP section of the TRM for more information on this setting.1350*1351* @rx_fdq0_sz0_qnum:1352* UDMAP receive flow free descriptor queue 0 configuration to be programmed1353* into the rx_fdq0_sz0_qnum field of the flow's RFLOW_RFD register. See the1354* UDMAP section of the TRM for more information on this setting. The specified1355* free queue must be valid within the Navigator Subsystem and must be owned1356* by the host, or a subordinate of the host, requesting allocation and1357* configuration of the receive flow.1358*1359* @rx_fdq1_qnum:1360* UDMAP receive flow free descriptor queue 1 configuration to be programmed1361* into the rx_fdq1_qnum field of the flow's RFLOW_RFD register. See the1362* UDMAP section of the TRM for more information on this setting. The specified1363* free queue must be valid within the Navigator Subsystem and must be owned1364* by the host, or a subordinate of the host, requesting allocation and1365* configuration of the receive flow.1366*1367* @rx_fdq2_qnum:1368* UDMAP receive flow free descriptor queue 2 configuration to be programmed1369* into the rx_fdq2_qnum field of the flow's RFLOW_RFE register. See the1370* UDMAP section of the TRM for more information on this setting. The specified1371* free queue must be valid within the Navigator Subsystem and must be owned1372* by the host, or a subordinate of the host, requesting allocation and1373* configuration of the receive flow.1374*1375* @rx_fdq3_qnum:1376* UDMAP receive flow free descriptor queue 3 configuration to be programmed1377* into the rx_fdq3_qnum field of the flow's RFLOW_RFE register. See the1378* UDMAP section of the TRM for more information on this setting. The specified1379* free queue must be valid within the Navigator Subsystem and must be owned1380* by the host, or a subordinate of the host, requesting allocation and1381* configuration of the receive flow.1382*1383* @rx_ps_location:1384* UDMAP receive flow PS words location configuration to be programmed into the1385* rx_ps_location field of the flow's RFLOW_RFA register.1386*/1387struct ti_sci_msg_rm_udmap_flow_cfg_req {1388struct ti_sci_msg_hdr hdr;1389u32 valid_params;1390u16 nav_id;1391u16 flow_index;1392u8 rx_einfo_present;1393u8 rx_psinfo_present;1394u8 rx_error_handling;1395u8 rx_desc_type;1396u16 rx_sop_offset;1397u16 rx_dest_qnum;1398u8 rx_src_tag_hi;1399u8 rx_src_tag_lo;1400u8 rx_dest_tag_hi;1401u8 rx_dest_tag_lo;1402u8 rx_src_tag_hi_sel;1403u8 rx_src_tag_lo_sel;1404u8 rx_dest_tag_hi_sel;1405u8 rx_dest_tag_lo_sel;1406u16 rx_fdq0_sz0_qnum;1407u16 rx_fdq1_qnum;1408u16 rx_fdq2_qnum;1409u16 rx_fdq3_qnum;1410u8 rx_ps_location;1411} __packed;14121413/**1414* struct ti_sci_msg_req_proc_request - Request a processor1415* @hdr: Generic Header1416* @processor_id: ID of processor being requested1417*1418* Request type is TI_SCI_MSG_PROC_REQUEST, response is a generic ACK/NACK1419* message.1420*/1421struct ti_sci_msg_req_proc_request {1422struct ti_sci_msg_hdr hdr;1423u8 processor_id;1424} __packed;14251426/**1427* struct ti_sci_msg_req_proc_release - Release a processor1428* @hdr: Generic Header1429* @processor_id: ID of processor being released1430*1431* Request type is TI_SCI_MSG_PROC_RELEASE, response is a generic ACK/NACK1432* message.1433*/1434struct ti_sci_msg_req_proc_release {1435struct ti_sci_msg_hdr hdr;1436u8 processor_id;1437} __packed;14381439/**1440* struct ti_sci_msg_req_proc_handover - Handover a processor to a host1441* @hdr: Generic Header1442* @processor_id: ID of processor being handed over1443* @host_id: Host ID the control needs to be transferred to1444*1445* Request type is TI_SCI_MSG_PROC_HANDOVER, response is a generic ACK/NACK1446* message.1447*/1448struct ti_sci_msg_req_proc_handover {1449struct ti_sci_msg_hdr hdr;1450u8 processor_id;1451u8 host_id;1452} __packed;14531454/* Boot Vector masks */1455#define TI_SCI_ADDR_LOW_MASK GENMASK_ULL(31, 0)1456#define TI_SCI_ADDR_HIGH_MASK GENMASK_ULL(63, 32)1457#define TI_SCI_ADDR_HIGH_SHIFT 3214581459/**1460* struct ti_sci_msg_req_set_config - Set Processor boot configuration1461* @hdr: Generic Header1462* @processor_id: ID of processor being configured1463* @bootvector_low: Lower 32 bit address (Little Endian) of boot vector1464* @bootvector_high: Higher 32 bit address (Little Endian) of boot vector1465* @config_flags_set: Optional Processor specific Config Flags to set.1466* Setting a bit here implies the corresponding mode1467* will be set1468* @config_flags_clear: Optional Processor specific Config Flags to clear.1469* Setting a bit here implies the corresponding mode1470* will be cleared1471*1472* Request type is TI_SCI_MSG_PROC_HANDOVER, response is a generic ACK/NACK1473* message.1474*/1475struct ti_sci_msg_req_set_config {1476struct ti_sci_msg_hdr hdr;1477u8 processor_id;1478u32 bootvector_low;1479u32 bootvector_high;1480u32 config_flags_set;1481u32 config_flags_clear;1482} __packed;14831484/**1485* struct ti_sci_msg_req_set_ctrl - Set Processor boot control flags1486* @hdr: Generic Header1487* @processor_id: ID of processor being configured1488* @control_flags_set: Optional Processor specific Control Flags to set.1489* Setting a bit here implies the corresponding mode1490* will be set1491* @control_flags_clear:Optional Processor specific Control Flags to clear.1492* Setting a bit here implies the corresponding mode1493* will be cleared1494*1495* Request type is TI_SCI_MSG_SET_CTRL, response is a generic ACK/NACK1496* message.1497*/1498struct ti_sci_msg_req_set_ctrl {1499struct ti_sci_msg_hdr hdr;1500u8 processor_id;1501u32 control_flags_set;1502u32 control_flags_clear;1503} __packed;15041505/**1506* struct ti_sci_msg_req_get_status - Processor boot status request1507* @hdr: Generic Header1508* @processor_id: ID of processor whose status is being requested1509*1510* Request type is TI_SCI_MSG_GET_STATUS, response is an appropriate1511* message, or NACK in case of inability to satisfy request.1512*/1513struct ti_sci_msg_req_get_status {1514struct ti_sci_msg_hdr hdr;1515u8 processor_id;1516} __packed;15171518/**1519* struct ti_sci_msg_resp_get_status - Processor boot status response1520* @hdr: Generic Header1521* @processor_id: ID of processor whose status is returned1522* @bootvector_low: Lower 32 bit address (Little Endian) of boot vector1523* @bootvector_high: Higher 32 bit address (Little Endian) of boot vector1524* @config_flags: Optional Processor specific Config Flags set currently1525* @control_flags: Optional Processor specific Control Flags set currently1526* @status_flags: Optional Processor specific Status Flags set currently1527*1528* Response structure to a TI_SCI_MSG_GET_STATUS request.1529*/1530struct ti_sci_msg_resp_get_status {1531struct ti_sci_msg_hdr hdr;1532u8 processor_id;1533u32 bootvector_low;1534u32 bootvector_high;1535u32 config_flags;1536u32 control_flags;1537u32 status_flags;1538} __packed;15391540#endif /* __TI_SCI_H */154115421543