/* 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* MSG_FLAG_CAPS_IO_ISOLATION: IO Isolation support152*153* Response to a generic message with message type TI_SCI_MSG_QUERY_FW_CAPS154* providing currently available SOC/firmware capabilities. SoC that don't155* support low power modes return only MSG_FLAG_CAPS_GENERIC capability.156*/157struct ti_sci_msg_resp_query_fw_caps {158struct ti_sci_msg_hdr hdr;159#define MSG_FLAG_CAPS_GENERIC TI_SCI_MSG_FLAG(0)160#define MSG_FLAG_CAPS_LPM_PARTIAL_IO TI_SCI_MSG_FLAG(4)161#define MSG_FLAG_CAPS_LPM_DM_MANAGED TI_SCI_MSG_FLAG(5)162#define MSG_FLAG_CAPS_LPM_ABORT TI_SCI_MSG_FLAG(9)163#define MSG_FLAG_CAPS_IO_ISOLATION TI_SCI_MSG_FLAG(7)164#define MSG_MASK_CAPS_LPM GENMASK_ULL(4, 1)165u64 fw_caps;166} __packed;167168/**169* struct ti_sci_msg_req_set_device_state - Set the desired state of the device170* @hdr: Generic header171* @id: Indicates which device to modify172* @reserved: Reserved space in message, must be 0 for backward compatibility173* @state: The desired state of the device.174*175* Certain flags can also be set to alter the device state:176* + MSG_FLAG_DEVICE_WAKE_ENABLED - Configure the device to be a wake source.177* The meaning of this flag will vary slightly from device to device and from178* SoC to SoC but it generally allows the device to wake the SoC out of deep179* suspend states.180* + MSG_FLAG_DEVICE_RESET_ISO - Enable reset isolation for this device.181* + MSG_FLAG_DEVICE_EXCLUSIVE - Claim this device exclusively. When passed182* with STATE_RETENTION or STATE_ON, it will claim the device exclusively.183* If another host already has this device set to STATE_RETENTION or STATE_ON,184* the message will fail. Once successful, other hosts attempting to set185* STATE_RETENTION or STATE_ON will fail.186*187* Request type is TI_SCI_MSG_SET_DEVICE_STATE, responded with a generic188* ACK/NACK message.189*/190struct ti_sci_msg_req_set_device_state {191/* Additional hdr->flags options */192#define MSG_FLAG_DEVICE_WAKE_ENABLED TI_SCI_MSG_FLAG(8)193#define MSG_FLAG_DEVICE_RESET_ISO TI_SCI_MSG_FLAG(9)194#define MSG_FLAG_DEVICE_EXCLUSIVE TI_SCI_MSG_FLAG(10)195struct ti_sci_msg_hdr hdr;196u32 id;197u32 reserved;198199#define MSG_DEVICE_SW_STATE_AUTO_OFF 0200#define MSG_DEVICE_SW_STATE_RETENTION 1201#define MSG_DEVICE_SW_STATE_ON 2202u8 state;203} __packed;204205/**206* struct ti_sci_msg_req_get_device_state - Request to get device.207* @hdr: Generic header208* @id: Device Identifier209*210* Request type is TI_SCI_MSG_GET_DEVICE_STATE, responded device state211* information212*/213struct ti_sci_msg_req_get_device_state {214struct ti_sci_msg_hdr hdr;215u32 id;216} __packed;217218/**219* struct ti_sci_msg_resp_get_device_state - Response to get device request.220* @hdr: Generic header221* @context_loss_count: Indicates how many times the device has lost context. A222* driver can use this monotonic counter to determine if the device has223* lost context since the last time this message was exchanged.224* @resets: Programmed state of the reset lines.225* @programmed_state: The state as programmed by set_device.226* - Uses the MSG_DEVICE_SW_* macros227* @current_state: The actual state of the hardware.228*229* Response to request TI_SCI_MSG_GET_DEVICE_STATE.230*/231struct ti_sci_msg_resp_get_device_state {232struct ti_sci_msg_hdr hdr;233u32 context_loss_count;234u32 resets;235u8 programmed_state;236#define MSG_DEVICE_HW_STATE_OFF 0237#define MSG_DEVICE_HW_STATE_ON 1238#define MSG_DEVICE_HW_STATE_TRANS 2239u8 current_state;240} __packed;241242/**243* struct ti_sci_msg_req_set_device_resets - Set the desired resets244* configuration of the device245* @hdr: Generic header246* @id: Indicates which device to modify247* @resets: A bit field of resets for the device. The meaning, behavior,248* and usage of the reset flags are device specific. 0 for a bit249* indicates releasing the reset represented by that bit while 1250* indicates keeping it held.251*252* Request type is TI_SCI_MSG_SET_DEVICE_RESETS, responded with a generic253* ACK/NACK message.254*/255struct ti_sci_msg_req_set_device_resets {256struct ti_sci_msg_hdr hdr;257u32 id;258u32 resets;259} __packed;260261/**262* struct ti_sci_msg_req_set_clock_state - Request to setup a Clock state263* @hdr: Generic Header, Certain flags can be set specific to the clocks:264* MSG_FLAG_CLOCK_ALLOW_SSC: Allow this clock to be modified265* via spread spectrum clocking.266* MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE: Allow this clock's267* frequency to be changed while it is running so long as it268* is within the min/max limits.269* MSG_FLAG_CLOCK_INPUT_TERM: Enable input termination, this270* is only applicable to clock inputs on the SoC pseudo-device.271* @dev_id: Device identifier this request is for272* @clk_id: Clock identifier for the device for this request.273* Each device has it's own set of clock inputs. This indexes274* which clock input to modify. Set to 255 if clock ID is275* greater than or equal to 255.276* @request_state: Request the state for the clock to be set to.277* MSG_CLOCK_SW_STATE_UNREQ: The IP does not require this clock,278* it can be disabled, regardless of the state of the device279* MSG_CLOCK_SW_STATE_AUTO: Allow the System Controller to280* automatically manage the state of this clock. If the device281* is enabled, then the clock is enabled. If the device is set282* to off or retention, then the clock is internally set as not283* being required by the device.(default)284* MSG_CLOCK_SW_STATE_REQ: Configure the clock to be enabled,285* regardless of the state of the device.286* @clk_id_32: Clock identifier for the device for this request.287* Only to be used if the clock ID is greater than or equal to288* 255.289*290* Normally, all required clocks are managed by TISCI entity, this is used291* only for specific control *IF* required. Auto managed state is292* MSG_CLOCK_SW_STATE_AUTO, in other states, TISCI entity assume remote293* will explicitly control.294*295* Request type is TI_SCI_MSG_SET_CLOCK_STATE, response is a generic296* ACK or NACK message.297*/298struct ti_sci_msg_req_set_clock_state {299/* Additional hdr->flags options */300#define MSG_FLAG_CLOCK_ALLOW_SSC TI_SCI_MSG_FLAG(8)301#define MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE TI_SCI_MSG_FLAG(9)302#define MSG_FLAG_CLOCK_INPUT_TERM TI_SCI_MSG_FLAG(10)303struct ti_sci_msg_hdr hdr;304u32 dev_id;305u8 clk_id;306#define MSG_CLOCK_SW_STATE_UNREQ 0307#define MSG_CLOCK_SW_STATE_AUTO 1308#define MSG_CLOCK_SW_STATE_REQ 2309u8 request_state;310u32 clk_id_32;311} __packed;312313/**314* struct ti_sci_msg_req_get_clock_state - Request for clock state315* @hdr: Generic Header316* @dev_id: Device identifier this request is for317* @clk_id: Clock identifier for the device for this request.318* Each device has it's own set of clock inputs. This indexes319* which clock input to get state of. Set to 255 if the clock320* ID is greater than or equal to 255.321* @clk_id_32: Clock identifier for the device for the request.322* Only to be used if the clock ID is greater than or equal to323* 255.324*325* Request type is TI_SCI_MSG_GET_CLOCK_STATE, response is state326* of the clock327*/328struct ti_sci_msg_req_get_clock_state {329struct ti_sci_msg_hdr hdr;330u32 dev_id;331u8 clk_id;332u32 clk_id_32;333} __packed;334335/**336* struct ti_sci_msg_resp_get_clock_state - Response to get clock state337* @hdr: Generic Header338* @programmed_state: Any programmed state of the clock. This is one of339* MSG_CLOCK_SW_STATE* values.340* @current_state: Current state of the clock. This is one of:341* MSG_CLOCK_HW_STATE_NOT_READY: Clock is not ready342* MSG_CLOCK_HW_STATE_READY: Clock is ready343*344* Response to TI_SCI_MSG_GET_CLOCK_STATE.345*/346struct ti_sci_msg_resp_get_clock_state {347struct ti_sci_msg_hdr hdr;348u8 programmed_state;349#define MSG_CLOCK_HW_STATE_NOT_READY 0350#define MSG_CLOCK_HW_STATE_READY 1351u8 current_state;352} __packed;353354/**355* struct ti_sci_msg_req_set_clock_parent - Set the clock parent356* @hdr: Generic Header357* @dev_id: Device identifier this request is for358* @clk_id: Clock identifier for the device for this request.359* Each device has it's own set of clock inputs. This indexes360* which clock input to modify. Set to 255 if clock ID is361* greater than or equal to 255.362* @parent_id: The new clock parent is selectable by an index via this363* parameter. Set to 255 if clock ID is greater than or364* equal to 255.365* @clk_id_32: Clock identifier if @clk_id field is 255.366* @parent_id_32: Parent identifier if @parent_id is 255.367*368* Request type is TI_SCI_MSG_SET_CLOCK_PARENT, response is generic369* ACK / NACK message.370*/371struct ti_sci_msg_req_set_clock_parent {372struct ti_sci_msg_hdr hdr;373u32 dev_id;374u8 clk_id;375u8 parent_id;376u32 clk_id_32;377u32 parent_id_32;378} __packed;379380/**381* struct ti_sci_msg_req_get_clock_parent - Get the clock parent382* @hdr: Generic Header383* @dev_id: Device identifier this request is for384* @clk_id: Clock identifier for the device for this request.385* Each device has it's own set of clock inputs. This indexes386* which clock input to get the parent for. If this field387* contains 255, the actual clock identifier is stored in388* @clk_id_32.389* @clk_id_32: Clock identifier if the @clk_id field contains 255.390*391* Request type is TI_SCI_MSG_GET_CLOCK_PARENT, response is parent information392*/393struct ti_sci_msg_req_get_clock_parent {394struct ti_sci_msg_hdr hdr;395u32 dev_id;396u8 clk_id;397u32 clk_id_32;398} __packed;399400/**401* struct ti_sci_msg_resp_get_clock_parent - Response with clock parent402* @hdr: Generic Header403* @parent_id: The current clock parent. If set to 255, the current parent404* ID can be found from the @parent_id_32 field.405* @parent_id_32: Current clock parent if @parent_id field is set to406* 255.407*408* Response to TI_SCI_MSG_GET_CLOCK_PARENT.409*/410struct ti_sci_msg_resp_get_clock_parent {411struct ti_sci_msg_hdr hdr;412u8 parent_id;413u32 parent_id_32;414} __packed;415416/**417* struct ti_sci_msg_req_get_clock_num_parents - Request to get clock parents418* @hdr: Generic header419* @dev_id: Device identifier this request is for420* @clk_id: Clock identifier for the device for this request. Set to421* 255 if clock ID is greater than or equal to 255.422* @clk_id_32: Clock identifier if the @clk_id field contains 255.423*424* This request provides information about how many clock parent options425* are available for a given clock to a device. This is typically used426* for input clocks.427*428* Request type is TI_SCI_MSG_GET_NUM_CLOCK_PARENTS, response is appropriate429* message, or NACK in case of inability to satisfy request.430*/431struct ti_sci_msg_req_get_clock_num_parents {432struct ti_sci_msg_hdr hdr;433u32 dev_id;434u8 clk_id;435u32 clk_id_32;436} __packed;437438/**439* struct ti_sci_msg_resp_get_clock_num_parents - Response for get clk parents440* @hdr: Generic header441* @num_parents: Number of clock parents. If set to 255, the actual442* number of parents is stored into @num_parents_32443* field instead.444* @num_parents_32: Number of clock parents if @num_parents field is445* set to 255.446*447* Response to TI_SCI_MSG_GET_NUM_CLOCK_PARENTS448*/449struct ti_sci_msg_resp_get_clock_num_parents {450struct ti_sci_msg_hdr hdr;451u8 num_parents;452u32 num_parents_32;453} __packed;454455/**456* struct ti_sci_msg_req_query_clock_freq - Request to query a frequency457* @hdr: Generic Header458* @dev_id: Device identifier this request is for459* @min_freq_hz: The minimum allowable frequency in Hz. This is the minimum460* allowable programmed frequency and does not account for clock461* tolerances and jitter.462* @target_freq_hz: The target clock frequency. A frequency will be found463* as close to this target frequency as possible.464* @max_freq_hz: The maximum allowable frequency in Hz. This is the maximum465* allowable programmed frequency and does not account for clock466* tolerances and jitter.467* @clk_id: Clock identifier for the device for this request. Set to468* 255 if clock identifier is greater than or equal to 255.469* @clk_id_32: Clock identifier if @clk_id is set to 255.470*471* NOTE: Normally clock frequency management is automatically done by TISCI472* entity. In case of specific requests, TISCI evaluates capability to achieve473* requested frequency within provided range and responds with474* result message.475*476* Request type is TI_SCI_MSG_QUERY_CLOCK_FREQ, response is appropriate message,477* or NACK in case of inability to satisfy request.478*/479struct ti_sci_msg_req_query_clock_freq {480struct ti_sci_msg_hdr hdr;481u32 dev_id;482u64 min_freq_hz;483u64 target_freq_hz;484u64 max_freq_hz;485u8 clk_id;486u32 clk_id_32;487} __packed;488489/**490* struct ti_sci_msg_resp_query_clock_freq - Response to a clock frequency query491* @hdr: Generic Header492* @freq_hz: Frequency that is the best match in Hz.493*494* Response to request type TI_SCI_MSG_QUERY_CLOCK_FREQ. NOTE: if the request495* cannot be satisfied, the message will be of type NACK.496*/497struct ti_sci_msg_resp_query_clock_freq {498struct ti_sci_msg_hdr hdr;499u64 freq_hz;500} __packed;501502/**503* struct ti_sci_msg_req_set_clock_freq - Request to setup a clock frequency504* @hdr: Generic Header505* @dev_id: Device identifier this request is for506* @min_freq_hz: The minimum allowable frequency in Hz. This is the minimum507* allowable programmed frequency and does not account for clock508* tolerances and jitter.509* @target_freq_hz: The target clock frequency. The clock will be programmed510* at a rate as close to this target frequency as possible.511* @max_freq_hz: The maximum allowable frequency in Hz. This is the maximum512* allowable programmed frequency and does not account for clock513* tolerances and jitter.514* @clk_id: Clock identifier for the device for this request. Set to515* 255 if clock ID is greater than or equal to 255.516* @clk_id_32: Clock identifier if @clk_id field is set to 255.517*518* NOTE: Normally clock frequency management is automatically done by TISCI519* entity. In case of specific requests, TISCI evaluates capability to achieve520* requested range and responds with success/failure message.521*522* This sets the desired frequency for a clock within an allowable523* range. This message will fail on an enabled clock unless524* MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE is set for the clock. Additionally,525* if other clocks have their frequency modified due to this message,526* they also must have the MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE or be disabled.527*528* Calling set frequency on a clock input to the SoC pseudo-device will529* inform the PMMC of that clock's frequency. Setting a frequency of530* zero will indicate the clock is disabled.531*532* Calling set frequency on clock outputs from the SoC pseudo-device will533* function similarly to setting the clock frequency on a device.534*535* Request type is TI_SCI_MSG_SET_CLOCK_FREQ, response is a generic ACK/NACK536* message.537*/538struct ti_sci_msg_req_set_clock_freq {539struct ti_sci_msg_hdr hdr;540u32 dev_id;541u64 min_freq_hz;542u64 target_freq_hz;543u64 max_freq_hz;544u8 clk_id;545u32 clk_id_32;546} __packed;547548/**549* struct ti_sci_msg_req_get_clock_freq - Request to get the clock frequency550* @hdr: Generic Header551* @dev_id: Device identifier this request is for552* @clk_id: Clock identifier for the device for this request. Set to553* 255 if clock ID is greater than or equal to 255.554* @clk_id_32: Clock identifier if @clk_id field is set to 255.555*556* NOTE: Normally clock frequency management is automatically done by TISCI557* entity. In some cases, clock frequencies are configured by host.558*559* Request type is TI_SCI_MSG_GET_CLOCK_FREQ, responded with clock frequency560* that the clock is currently at.561*/562struct ti_sci_msg_req_get_clock_freq {563struct ti_sci_msg_hdr hdr;564u32 dev_id;565u8 clk_id;566u32 clk_id_32;567} __packed;568569/**570* struct ti_sci_msg_resp_get_clock_freq - Response of clock frequency request571* @hdr: Generic Header572* @freq_hz: Frequency that the clock is currently on, in Hz.573*574* Response to request type TI_SCI_MSG_GET_CLOCK_FREQ.575*/576struct ti_sci_msg_resp_get_clock_freq {577struct ti_sci_msg_hdr hdr;578u64 freq_hz;579} __packed;580581/**582* struct tisci_msg_req_prepare_sleep - Request for TISCI_MSG_PREPARE_SLEEP.583*584* @hdr TISCI header to provide ACK/NAK flags to the host.585* @mode Low power mode to enter.586* @ctx_lo Low 32-bits of physical pointer to address to use for context save.587* @ctx_hi High 32-bits of physical pointer to address to use for context save.588* @debug_flags Flags that can be set to halt the sequence during suspend or589* resume to allow JTAG connection and debug.590*591* This message is used as the first step of entering a low power mode. It592* allows configurable information, including which state to enter to be593* easily shared from the application, as this is a non-secure message and594* therefore can be sent by anyone.595*/596struct ti_sci_msg_req_prepare_sleep {597struct ti_sci_msg_hdr hdr;598599/*600* When sending prepare_sleep with MODE_PARTIAL_IO no response will be sent,601* no further steps are required.602*/603#define TISCI_MSG_VALUE_SLEEP_MODE_PARTIAL_IO 0x03604#define TISCI_MSG_VALUE_SLEEP_MODE_DM_MANAGED 0xfd605u8 mode;606u32 ctx_lo;607u32 ctx_hi;608u32 debug_flags;609} __packed;610611/**612* struct tisci_msg_set_io_isolation_req - Request for TI_SCI_MSG_SET_IO_ISOLATION.613*614* @hdr: Generic header615* @state: The deseared state of the IO isolation.616*617* This message is used to enable/disable IO isolation for low power modes.618* Response is generic ACK / NACK message.619*/620struct ti_sci_msg_req_set_io_isolation {621struct ti_sci_msg_hdr hdr;622u8 state;623} __packed;624625/**626* struct ti_sci_msg_resp_lpm_wake_reason - Response for TI_SCI_MSG_LPM_WAKE_REASON.627*628* @hdr: Generic header.629* @wake_source: The wake up source that woke soc from LPM.630* @wake_timestamp: Timestamp at which soc woke.631* @wake_pin: The pin that has triggered wake up.632* @mode: The last entered low power mode.633* @rsvd: Reserved for future use.634*635* Response to a generic message with message type TI_SCI_MSG_LPM_WAKE_REASON,636* used to query the wake up source, pin and entered low power mode.637*/638struct ti_sci_msg_resp_lpm_wake_reason {639struct ti_sci_msg_hdr hdr;640u32 wake_source;641u64 wake_timestamp;642u8 wake_pin;643u8 mode;644u32 rsvd[2];645} __packed;646647/**648* struct ti_sci_msg_req_lpm_set_device_constraint - Request for649* TISCI_MSG_LPM_SET_DEVICE_CONSTRAINT.650*651* @hdr: TISCI header to provide ACK/NAK flags to the host.652* @id: Device ID of device whose constraint has to be modified.653* @state: The desired state of device constraint: set or clear.654* @rsvd: Reserved for future use.655*656* This message is used by host to set constraint on the device. This can be657* sent anytime after boot before prepare sleep message. Any device can set a658* constraint on the low power mode that the SoC can enter. It allows659* configurable information to be easily shared from the application, as this660* is a non-secure message and therefore can be sent by anyone. By setting a661* constraint, the device ensures that it will not be powered off or reset in662* the selected mode. Note: Access Restriction: Exclusivity flag of Device will663* be honored. If some other host already has constraint on this device ID,664* NACK will be returned.665*/666struct ti_sci_msg_req_lpm_set_device_constraint {667struct ti_sci_msg_hdr hdr;668u32 id;669u8 state;670u32 rsvd[2];671} __packed;672673/**674* struct ti_sci_msg_req_lpm_set_latency_constraint - Request for675* TISCI_MSG_LPM_SET_LATENCY_CONSTRAINT.676*677* @hdr: TISCI header to provide ACK/NAK flags to the host.678* @wkup_latency: The maximum acceptable latency to wake up from low power mode679* in milliseconds. The deeper the state, the higher the latency.680* @state: The desired state of wakeup latency constraint: set or clear.681* @rsvd: Reserved for future use.682*683* This message is used by host to set wakeup latency from low power mode. This can684* be sent anytime after boot before prepare sleep message, and can be sent after685* current low power mode is exited. Any device can set a constraint on the low power686* mode that the SoC can enter. It allows configurable information to be easily shared687* from the application, as this is a non-secure message and therefore can be sent by688* anyone. By setting a wakeup latency constraint, the host ensures that the resume time689* from selected low power mode will be less than the constraint value.690*/691struct ti_sci_msg_req_lpm_set_latency_constraint {692struct ti_sci_msg_hdr hdr;693u16 latency;694u8 state;695u32 rsvd;696} __packed;697698#define TI_SCI_IRQ_SECONDARY_HOST_INVALID 0xff699700/**701* struct ti_sci_msg_req_get_resource_range - Request to get a host's assigned702* range of resources.703* @hdr: Generic Header704* @type: Unique resource assignment type705* @subtype: Resource assignment subtype within the resource type.706* @secondary_host: Host processing entity to which the resources are707* allocated. This is required only when the destination708* host id id different from ti sci interface host id,709* else TI_SCI_IRQ_SECONDARY_HOST_INVALID can be passed.710*711* Request type is TI_SCI_MSG_GET_RESOURCE_RANGE. Responded with requested712* resource range which is of type TI_SCI_MSG_GET_RESOURCE_RANGE.713*/714struct ti_sci_msg_req_get_resource_range {715struct ti_sci_msg_hdr hdr;716#define MSG_RM_RESOURCE_TYPE_MASK GENMASK(9, 0)717#define MSG_RM_RESOURCE_SUBTYPE_MASK GENMASK(5, 0)718u16 type;719u8 subtype;720u8 secondary_host;721} __packed;722723/**724* struct ti_sci_msg_resp_get_resource_range - Response to resource get range.725* @hdr: Generic Header726* @range_start: Start index of the first resource range.727* @range_num: Number of resources in the first range.728* @range_start_sec: Start index of the second resource range.729* @range_num_sec: Number of resources in the second range.730*731* Response to request TI_SCI_MSG_GET_RESOURCE_RANGE.732*/733struct ti_sci_msg_resp_get_resource_range {734struct ti_sci_msg_hdr hdr;735u16 range_start;736u16 range_num;737u16 range_start_sec;738u16 range_num_sec;739} __packed;740741/**742* struct ti_sci_msg_req_manage_irq - Request to configure/release the route743* between the dev and the host.744* @hdr: Generic Header745* @valid_params: Bit fields defining the validity of interrupt source746* parameters. If a bit is not set, then corresponding747* field is not valid and will not be used for route set.748* Bit field definitions:749* 0 - Valid bit for @dst_id750* 1 - Valid bit for @dst_host_irq751* 2 - Valid bit for @ia_id752* 3 - Valid bit for @vint753* 4 - Valid bit for @global_event754* 5 - Valid bit for @vint_status_bit_index755* 31 - Valid bit for @secondary_host756* @src_id: IRQ source peripheral ID.757* @src_index: IRQ source index within the peripheral758* @dst_id: IRQ Destination ID. Based on the architecture it can be759* IRQ controller or host processor ID.760* @dst_host_irq: IRQ number of the destination host IRQ controller761* @ia_id: Device ID of the interrupt aggregator in which the762* vint resides.763* @vint: Virtual interrupt number if the interrupt route764* is through an interrupt aggregator.765* @global_event: Global event that is to be mapped to interrupt766* aggregator virtual interrupt status bit.767* @vint_status_bit: Virtual interrupt status bit if the interrupt route768* utilizes an interrupt aggregator status bit.769* @secondary_host: Host ID of the IRQ destination computing entity. This is770* required only when destination host id is different771* from ti sci interface host id.772*773* Request type is TI_SCI_MSG_SET/RELEASE_IRQ.774* Response is generic ACK / NACK message.775*/776struct ti_sci_msg_req_manage_irq {777struct ti_sci_msg_hdr hdr;778#define MSG_FLAG_DST_ID_VALID TI_SCI_MSG_FLAG(0)779#define MSG_FLAG_DST_HOST_IRQ_VALID TI_SCI_MSG_FLAG(1)780#define MSG_FLAG_IA_ID_VALID TI_SCI_MSG_FLAG(2)781#define MSG_FLAG_VINT_VALID TI_SCI_MSG_FLAG(3)782#define MSG_FLAG_GLB_EVNT_VALID TI_SCI_MSG_FLAG(4)783#define MSG_FLAG_VINT_STS_BIT_VALID TI_SCI_MSG_FLAG(5)784#define MSG_FLAG_SHOST_VALID TI_SCI_MSG_FLAG(31)785u32 valid_params;786u16 src_id;787u16 src_index;788u16 dst_id;789u16 dst_host_irq;790u16 ia_id;791u16 vint;792u16 global_event;793u8 vint_status_bit;794u8 secondary_host;795} __packed;796797/**798* struct ti_sci_msg_rm_ring_cfg_req - Configure a Navigator Subsystem ring799*800* Configures the non-real-time registers of a Navigator Subsystem ring.801* @hdr: Generic Header802* @valid_params: Bitfield defining validity of ring configuration parameters.803* The ring configuration fields are not valid, and will not be used for804* ring configuration, if their corresponding valid bit is zero.805* Valid bit usage:806* 0 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_lo807* 1 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_hi808* 2 - Valid bit for @tisci_msg_rm_ring_cfg_req count809* 3 - Valid bit for @tisci_msg_rm_ring_cfg_req mode810* 4 - Valid bit for @tisci_msg_rm_ring_cfg_req size811* 5 - Valid bit for @tisci_msg_rm_ring_cfg_req order_id812* 6 - Valid bit for @tisci_msg_rm_ring_cfg_req virtid813* 7 - Valid bit for @tisci_msg_rm_ring_cfg_req ASEL814* @nav_id: Device ID of Navigator Subsystem from which the ring is allocated815* @index: ring index to be configured.816* @addr_lo: 32 LSBs of ring base address to be programmed into the ring's817* RING_BA_LO register818* @addr_hi: 16 MSBs of ring base address to be programmed into the ring's819* RING_BA_HI register.820* @count: Number of ring elements. Must be even if mode is CREDENTIALS or QM821* modes.822* @mode: Specifies the mode the ring is to be configured.823* @size: Specifies encoded ring element size. To calculate the encoded size use824* the formula (log2(size_bytes) - 2), where size_bytes cannot be825* greater than 256.826* @order_id: Specifies the ring's bus order ID.827* @virtid: Ring virt ID value828* @asel: Ring ASEL (address select) value to be set into the ASEL field of the829* ring's RING_BA_HI register.830*/831struct ti_sci_msg_rm_ring_cfg_req {832struct ti_sci_msg_hdr hdr;833u32 valid_params;834u16 nav_id;835u16 index;836u32 addr_lo;837u32 addr_hi;838u32 count;839u8 mode;840u8 size;841u8 order_id;842u16 virtid;843u8 asel;844} __packed;845846/**847* struct ti_sci_msg_psil_pair - Pairs a PSI-L source thread to a destination848* thread849* @hdr: Generic Header850* @nav_id: SoC Navigator Subsystem device ID whose PSI-L config proxy is851* used to pair the source and destination threads.852* @src_thread: PSI-L source thread ID within the PSI-L System thread map.853*854* UDMAP transmit channels mapped to source threads will have their855* TCHAN_THRD_ID register programmed with the destination thread if the pairing856* is successful.857858* @dst_thread: PSI-L destination thread ID within the PSI-L System thread map.859* PSI-L destination threads start at index 0x8000. The request is NACK'd if860* the destination thread is not greater than or equal to 0x8000.861*862* UDMAP receive channels mapped to destination threads will have their863* RCHAN_THRD_ID register programmed with the source thread if the pairing864* is successful.865*866* Request type is TI_SCI_MSG_RM_PSIL_PAIR, response is a generic ACK or NACK867* message.868*/869struct ti_sci_msg_psil_pair {870struct ti_sci_msg_hdr hdr;871u32 nav_id;872u32 src_thread;873u32 dst_thread;874} __packed;875876/**877* struct ti_sci_msg_psil_unpair - Unpairs a PSI-L source thread from a878* destination thread879* @hdr: Generic Header880* @nav_id: SoC Navigator Subsystem device ID whose PSI-L config proxy is881* used to unpair the source and destination threads.882* @src_thread: PSI-L source thread ID within the PSI-L System thread map.883*884* UDMAP transmit channels mapped to source threads will have their885* TCHAN_THRD_ID register cleared if the unpairing is successful.886*887* @dst_thread: PSI-L destination thread ID within the PSI-L System thread map.888* PSI-L destination threads start at index 0x8000. The request is NACK'd if889* the destination thread is not greater than or equal to 0x8000.890*891* UDMAP receive channels mapped to destination threads will have their892* RCHAN_THRD_ID register cleared if the unpairing is successful.893*894* Request type is TI_SCI_MSG_RM_PSIL_UNPAIR, response is a generic ACK or NACK895* message.896*/897struct ti_sci_msg_psil_unpair {898struct ti_sci_msg_hdr hdr;899u32 nav_id;900u32 src_thread;901u32 dst_thread;902} __packed;903904/**905* struct ti_sci_msg_udmap_rx_flow_cfg - UDMAP receive flow configuration906* message907* @hdr: Generic Header908* @nav_id: SoC Navigator Subsystem device ID from which the receive flow is909* allocated910* @flow_index: UDMAP receive flow index for non-optional configuration.911* @rx_ch_index: Specifies the index of the receive channel using the flow_index912* @rx_einfo_present: UDMAP receive flow extended packet info present.913* @rx_psinfo_present: UDMAP receive flow PS words present.914* @rx_error_handling: UDMAP receive flow error handling configuration. Valid915* values are TI_SCI_RM_UDMAP_RX_FLOW_ERR_DROP/RETRY.916* @rx_desc_type: UDMAP receive flow descriptor type. It can be one of917* TI_SCI_RM_UDMAP_RX_FLOW_DESC_HOST/MONO.918* @rx_sop_offset: UDMAP receive flow start of packet offset.919* @rx_dest_qnum: UDMAP receive flow destination queue number.920* @rx_ps_location: UDMAP receive flow PS words location.921* 0 - end of packet descriptor922* 1 - Beginning of the data buffer923* @rx_src_tag_hi: UDMAP receive flow source tag high byte constant924* @rx_src_tag_lo: UDMAP receive flow source tag low byte constant925* @rx_dest_tag_hi: UDMAP receive flow destination tag high byte constant926* @rx_dest_tag_lo: UDMAP receive flow destination tag low byte constant927* @rx_src_tag_hi_sel: UDMAP receive flow source tag high byte selector928* @rx_src_tag_lo_sel: UDMAP receive flow source tag low byte selector929* @rx_dest_tag_hi_sel: UDMAP receive flow destination tag high byte selector930* @rx_dest_tag_lo_sel: UDMAP receive flow destination tag low byte selector931* @rx_size_thresh_en: UDMAP receive flow packet size based free buffer queue932* enable. If enabled, the ti_sci_rm_udmap_rx_flow_opt_cfg also need to be933* configured and sent.934* @rx_fdq0_sz0_qnum: UDMAP receive flow free descriptor queue 0.935* @rx_fdq1_qnum: UDMAP receive flow free descriptor queue 1.936* @rx_fdq2_qnum: UDMAP receive flow free descriptor queue 2.937* @rx_fdq3_qnum: UDMAP receive flow free descriptor queue 3.938*939* For detailed information on the settings, see the UDMAP section of the TRM.940*/941struct ti_sci_msg_udmap_rx_flow_cfg {942struct ti_sci_msg_hdr hdr;943u32 nav_id;944u32 flow_index;945u32 rx_ch_index;946u8 rx_einfo_present;947u8 rx_psinfo_present;948u8 rx_error_handling;949u8 rx_desc_type;950u16 rx_sop_offset;951u16 rx_dest_qnum;952u8 rx_ps_location;953u8 rx_src_tag_hi;954u8 rx_src_tag_lo;955u8 rx_dest_tag_hi;956u8 rx_dest_tag_lo;957u8 rx_src_tag_hi_sel;958u8 rx_src_tag_lo_sel;959u8 rx_dest_tag_hi_sel;960u8 rx_dest_tag_lo_sel;961u8 rx_size_thresh_en;962u16 rx_fdq0_sz0_qnum;963u16 rx_fdq1_qnum;964u16 rx_fdq2_qnum;965u16 rx_fdq3_qnum;966} __packed;967968/**969* struct rm_ti_sci_msg_udmap_rx_flow_opt_cfg - parameters for UDMAP receive970* flow optional configuration971* @hdr: Generic Header972* @nav_id: SoC Navigator Subsystem device ID from which the receive flow is973* allocated974* @flow_index: UDMAP receive flow index for optional configuration.975* @rx_ch_index: Specifies the index of the receive channel using the flow_index976* @rx_size_thresh0: UDMAP receive flow packet size threshold 0.977* @rx_size_thresh1: UDMAP receive flow packet size threshold 1.978* @rx_size_thresh2: UDMAP receive flow packet size threshold 2.979* @rx_fdq0_sz1_qnum: UDMAP receive flow free descriptor queue for size980* threshold 1.981* @rx_fdq0_sz2_qnum: UDMAP receive flow free descriptor queue for size982* threshold 2.983* @rx_fdq0_sz3_qnum: UDMAP receive flow free descriptor queue for size984* threshold 3.985*986* For detailed information on the settings, see the UDMAP section of the TRM.987*/988struct rm_ti_sci_msg_udmap_rx_flow_opt_cfg {989struct ti_sci_msg_hdr hdr;990u32 nav_id;991u32 flow_index;992u32 rx_ch_index;993u16 rx_size_thresh0;994u16 rx_size_thresh1;995u16 rx_size_thresh2;996u16 rx_fdq0_sz1_qnum;997u16 rx_fdq0_sz2_qnum;998u16 rx_fdq0_sz3_qnum;999} __packed;10001001/**1002* Configures a Navigator Subsystem UDMAP transmit channel1003*1004* Configures the non-real-time registers of a Navigator Subsystem UDMAP1005* transmit channel. The channel index must be assigned to the host defined1006* in the TISCI header via the RM board configuration resource assignment1007* range list.1008*1009* @hdr: Generic Header1010*1011* @valid_params: Bitfield defining validity of tx channel configuration1012* parameters. The tx channel configuration fields are not valid, and will not1013* be used for ch configuration, if their corresponding valid bit is zero.1014* Valid bit usage:1015* 0 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_pause_on_err1016* 1 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_atype1017* 2 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_chan_type1018* 3 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_fetch_size1019* 4 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::txcq_qnum1020* 5 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_priority1021* 6 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_qos1022* 7 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_orderid1023* 8 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_sched_priority1024* 9 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_einfo1025* 10 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_pswords1026* 11 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_supr_tdpkt1027* 12 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_credit_count1028* 13 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::fdepth1029* 14 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_burst_size1030* 15 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_tdtype1031* 16 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::extended_ch_type1032*1033* @nav_id: SoC device ID of Navigator Subsystem where tx channel is located1034*1035* @index: UDMAP transmit channel index.1036*1037* @tx_pause_on_err: UDMAP transmit channel pause on error configuration to1038* be programmed into the tx_pause_on_err field of the channel's TCHAN_TCFG1039* register.1040*1041* @tx_filt_einfo: UDMAP transmit channel extended packet information passing1042* configuration to be programmed into the tx_filt_einfo field of the1043* channel's TCHAN_TCFG register.1044*1045* @tx_filt_pswords: UDMAP transmit channel protocol specific word passing1046* configuration to be programmed into the tx_filt_pswords field of the1047* channel's TCHAN_TCFG register.1048*1049* @tx_atype: UDMAP transmit channel non Ring Accelerator access pointer1050* interpretation configuration to be programmed into the tx_atype field of1051* the channel's TCHAN_TCFG register.1052*1053* @tx_chan_type: UDMAP transmit channel functional channel type and work1054* passing mechanism configuration to be programmed into the tx_chan_type1055* field of the channel's TCHAN_TCFG register.1056*1057* @tx_supr_tdpkt: UDMAP transmit channel teardown packet generation suppression1058* configuration to be programmed into the tx_supr_tdpkt field of the channel's1059* TCHAN_TCFG register.1060*1061* @tx_fetch_size: UDMAP transmit channel number of 32-bit descriptor words to1062* fetch configuration to be programmed into the tx_fetch_size field of the1063* channel's TCHAN_TCFG register. The user must make sure to set the maximum1064* word count that can pass through the channel for any allowed descriptor type.1065*1066* @tx_credit_count: UDMAP transmit channel transfer request credit count1067* configuration to be programmed into the count field of the TCHAN_TCREDIT1068* register. Specifies how many credits for complete TRs are available.1069*1070* @txcq_qnum: UDMAP transmit channel completion queue configuration to be1071* programmed into the txcq_qnum field of the TCHAN_TCQ register. The specified1072* completion queue must be assigned to the host, or a subordinate of the host,1073* requesting configuration of the transmit channel.1074*1075* @tx_priority: UDMAP transmit channel transmit priority value to be programmed1076* into the priority field of the channel's TCHAN_TPRI_CTRL register.1077*1078* @tx_qos: UDMAP transmit channel transmit qos value to be programmed into the1079* qos field of the channel's TCHAN_TPRI_CTRL register.1080*1081* @tx_orderid: UDMAP transmit channel bus order id value to be programmed into1082* the orderid field of the channel's TCHAN_TPRI_CTRL register.1083*1084* @fdepth: UDMAP transmit channel FIFO depth configuration to be programmed1085* into the fdepth field of the TCHAN_TFIFO_DEPTH register. Sets the number of1086* Tx FIFO bytes which are allowed to be stored for the channel. Check the UDMAP1087* section of the TRM for restrictions regarding this parameter.1088*1089* @tx_sched_priority: UDMAP transmit channel tx scheduling priority1090* configuration to be programmed into the priority field of the channel's1091* TCHAN_TST_SCHED register.1092*1093* @tx_burst_size: UDMAP transmit channel burst size configuration to be1094* programmed into the tx_burst_size field of the TCHAN_TCFG register.1095*1096* @tx_tdtype: UDMAP transmit channel teardown type configuration to be1097* programmed into the tdtype field of the TCHAN_TCFG register:1098* 0 - Return immediately1099* 1 - Wait for completion message from remote peer1100*1101* @extended_ch_type: Valid for BCDMA.1102* 0 - the channel is split tx channel (tchan)1103* 1 - the channel is block copy channel (bchan)1104*/1105struct ti_sci_msg_rm_udmap_tx_ch_cfg_req {1106struct ti_sci_msg_hdr hdr;1107u32 valid_params;1108u16 nav_id;1109u16 index;1110u8 tx_pause_on_err;1111u8 tx_filt_einfo;1112u8 tx_filt_pswords;1113u8 tx_atype;1114u8 tx_chan_type;1115u8 tx_supr_tdpkt;1116u16 tx_fetch_size;1117u8 tx_credit_count;1118u16 txcq_qnum;1119u8 tx_priority;1120u8 tx_qos;1121u8 tx_orderid;1122u16 fdepth;1123u8 tx_sched_priority;1124u8 tx_burst_size;1125u8 tx_tdtype;1126u8 extended_ch_type;1127} __packed;11281129/**1130* Configures a Navigator Subsystem UDMAP receive channel1131*1132* Configures the non-real-time registers of a Navigator Subsystem UDMAP1133* receive channel. The channel index must be assigned to the host defined1134* in the TISCI header via the RM board configuration resource assignment1135* range list.1136*1137* @hdr: Generic Header1138*1139* @valid_params: Bitfield defining validity of rx channel configuration1140* parameters.1141* The rx channel configuration fields are not valid, and will not be used for1142* ch configuration, if their corresponding valid bit is zero.1143* Valid bit usage:1144* 0 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_pause_on_err1145* 1 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_atype1146* 2 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_chan_type1147* 3 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_fetch_size1148* 4 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rxcq_qnum1149* 5 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_priority1150* 6 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_qos1151* 7 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_orderid1152* 8 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_sched_priority1153* 9 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_start1154* 10 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_cnt1155* 11 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_short1156* 12 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_long1157* 14 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_burst_size1158*1159* @nav_id: SoC device ID of Navigator Subsystem where rx channel is located1160*1161* @index: UDMAP receive channel index.1162*1163* @rx_fetch_size: UDMAP receive channel number of 32-bit descriptor words to1164* fetch configuration to be programmed into the rx_fetch_size field of the1165* channel's RCHAN_RCFG register.1166*1167* @rxcq_qnum: UDMAP receive channel completion queue configuration to be1168* programmed into the rxcq_qnum field of the RCHAN_RCQ register.1169* The specified completion queue must be assigned to the host, or a subordinate1170* of the host, requesting configuration of the receive channel.1171*1172* @rx_priority: UDMAP receive channel receive priority value to be programmed1173* into the priority field of the channel's RCHAN_RPRI_CTRL register.1174*1175* @rx_qos: UDMAP receive channel receive qos value to be programmed into the1176* qos field of the channel's RCHAN_RPRI_CTRL register.1177*1178* @rx_orderid: UDMAP receive channel bus order id value to be programmed into1179* the orderid field of the channel's RCHAN_RPRI_CTRL register.1180*1181* @rx_sched_priority: UDMAP receive channel rx scheduling priority1182* configuration to be programmed into the priority field of the channel's1183* RCHAN_RST_SCHED register.1184*1185* @flowid_start: UDMAP receive channel additional flows starting index1186* configuration to program into the flow_start field of the RCHAN_RFLOW_RNG1187* register. Specifies the starting index for flow IDs the receive channel is to1188* make use of beyond the default flow. flowid_start and @ref flowid_cnt must be1189* set as valid and configured together. The starting flow ID set by1190* @ref flowid_cnt must be a flow index within the Navigator Subsystem's subset1191* of flows beyond the default flows statically mapped to receive channels.1192* The additional flows must be assigned to the host, or a subordinate of the1193* host, requesting configuration of the receive channel.1194*1195* @flowid_cnt: UDMAP receive channel additional flows count configuration to1196* program into the flowid_cnt field of the RCHAN_RFLOW_RNG register.1197* This field specifies how many flow IDs are in the additional contiguous range1198* of legal flow IDs for the channel. @ref flowid_start and flowid_cnt must be1199* set as valid and configured together. Disabling the valid_params field bit1200* for flowid_cnt indicates no flow IDs other than the default are to be1201* allocated and used by the receive channel. @ref flowid_start plus flowid_cnt1202* cannot be greater than the number of receive flows in the receive channel's1203* Navigator Subsystem. The additional flows must be assigned to the host, or a1204* subordinate of the host, requesting configuration of the receive channel.1205*1206* @rx_pause_on_err: UDMAP receive channel pause on error configuration to be1207* programmed into the rx_pause_on_err field of the channel's RCHAN_RCFG1208* register.1209*1210* @rx_atype: UDMAP receive channel non Ring Accelerator access pointer1211* interpretation configuration to be programmed into the rx_atype field of the1212* channel's RCHAN_RCFG register.1213*1214* @rx_chan_type: UDMAP receive channel functional channel type and work passing1215* mechanism configuration to be programmed into the rx_chan_type field of the1216* channel's RCHAN_RCFG register.1217*1218* @rx_ignore_short: UDMAP receive channel short packet treatment configuration1219* to be programmed into the rx_ignore_short field of the RCHAN_RCFG register.1220*1221* @rx_ignore_long: UDMAP receive channel long packet treatment configuration to1222* be programmed into the rx_ignore_long field of the RCHAN_RCFG register.1223*1224* @rx_burst_size: UDMAP receive channel burst size configuration to be1225* programmed into the rx_burst_size field of the RCHAN_RCFG register.1226*/1227struct ti_sci_msg_rm_udmap_rx_ch_cfg_req {1228struct ti_sci_msg_hdr hdr;1229u32 valid_params;1230u16 nav_id;1231u16 index;1232u16 rx_fetch_size;1233u16 rxcq_qnum;1234u8 rx_priority;1235u8 rx_qos;1236u8 rx_orderid;1237u8 rx_sched_priority;1238u16 flowid_start;1239u16 flowid_cnt;1240u8 rx_pause_on_err;1241u8 rx_atype;1242u8 rx_chan_type;1243u8 rx_ignore_short;1244u8 rx_ignore_long;1245u8 rx_burst_size;1246} __packed;12471248/**1249* Configures a Navigator Subsystem UDMAP receive flow1250*1251* Configures a Navigator Subsystem UDMAP receive flow's registers.1252* Configuration does not include the flow registers which handle size-based1253* free descriptor queue routing.1254*1255* The flow index must be assigned to the host defined in the TISCI header via1256* the RM board configuration resource assignment range list.1257*1258* @hdr: Standard TISCI header1259*1260* @valid_params1261* Bitfield defining validity of rx flow configuration parameters. The1262* rx flow configuration fields are not valid, and will not be used for flow1263* configuration, if their corresponding valid bit is zero. Valid bit usage:1264* 0 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_einfo_present1265* 1 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_psinfo_present1266* 2 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_error_handling1267* 3 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_desc_type1268* 4 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_sop_offset1269* 5 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_qnum1270* 6 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi1271* 7 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo1272* 8 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi1273* 9 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo1274* 10 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi_sel1275* 11 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo_sel1276* 12 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi_sel1277* 13 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo_sel1278* 14 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq0_sz0_qnum1279* 15 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq1_sz0_qnum1280* 16 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq2_sz0_qnum1281* 17 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq3_sz0_qnum1282* 18 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_ps_location1283*1284* @nav_id: SoC device ID of Navigator Subsystem from which the receive flow is1285* allocated1286*1287* @flow_index: UDMAP receive flow index for non-optional configuration.1288*1289* @rx_einfo_present:1290* UDMAP receive flow extended packet info present configuration to be1291* programmed into the rx_einfo_present field of the flow's RFLOW_RFA register.1292*1293* @rx_psinfo_present:1294* UDMAP receive flow PS words present configuration to be programmed into the1295* rx_psinfo_present field of the flow's RFLOW_RFA register.1296*1297* @rx_error_handling:1298* UDMAP receive flow error handling configuration to be programmed into the1299* rx_error_handling field of the flow's RFLOW_RFA register.1300*1301* @rx_desc_type:1302* UDMAP receive flow descriptor type configuration to be programmed into the1303* rx_desc_type field field of the flow's RFLOW_RFA register.1304*1305* @rx_sop_offset:1306* UDMAP receive flow start of packet offset configuration to be programmed1307* into the rx_sop_offset field of the RFLOW_RFA register. See the UDMAP1308* section of the TRM for more information on this setting. Valid values for1309* this field are 0-255 bytes.1310*1311* @rx_dest_qnum:1312* UDMAP receive flow destination queue configuration to be programmed into the1313* rx_dest_qnum field of the flow's RFLOW_RFA register. The specified1314* destination queue must be valid within the Navigator Subsystem and must be1315* owned by the host, or a subordinate of the host, requesting allocation and1316* configuration of the receive flow.1317*1318* @rx_src_tag_hi:1319* UDMAP receive flow source tag high byte constant configuration to be1320* programmed into the rx_src_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_src_tag_lo:1324* UDMAP receive flow source tag low byte constant configuration to be1325* programmed into the rx_src_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_dest_tag_hi:1329* UDMAP receive flow destination tag high byte constant configuration to be1330* programmed into the rx_dest_tag_hi field of the flow's RFLOW_RFB register.1331* See the UDMAP section of the TRM for more information on this setting.1332*1333* @rx_dest_tag_lo:1334* UDMAP receive flow destination tag low byte constant configuration to be1335* programmed into the rx_dest_tag_lo field of the flow's RFLOW_RFB register.1336* See the UDMAP section of the TRM for more information on this setting.1337*1338* @rx_src_tag_hi_sel:1339* UDMAP receive flow source tag high byte selector configuration to be1340* programmed into the rx_src_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_src_tag_lo_sel:1344* UDMAP receive flow source tag low byte selector configuration to be1345* programmed into the rx_src_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_dest_tag_hi_sel:1349* UDMAP receive flow destination tag high byte selector configuration to be1350* programmed into the rx_dest_tag_hi_sel field of the RFLOW_RFC register. See1351* the UDMAP section of the TRM for more information on this setting.1352*1353* @rx_dest_tag_lo_sel:1354* UDMAP receive flow destination tag low byte selector configuration to be1355* programmed into the rx_dest_tag_lo_sel field of the RFLOW_RFC register. See1356* the UDMAP section of the TRM for more information on this setting.1357*1358* @rx_fdq0_sz0_qnum:1359* UDMAP receive flow free descriptor queue 0 configuration to be programmed1360* into the rx_fdq0_sz0_qnum field of the flow's RFLOW_RFD register. See the1361* UDMAP section of the TRM for more information on this setting. The specified1362* free queue must be valid within the Navigator Subsystem and must be owned1363* by the host, or a subordinate of the host, requesting allocation and1364* configuration of the receive flow.1365*1366* @rx_fdq1_qnum:1367* UDMAP receive flow free descriptor queue 1 configuration to be programmed1368* into the rx_fdq1_qnum field of the flow's RFLOW_RFD register. See the1369* UDMAP section of the TRM for more information on this setting. The specified1370* free queue must be valid within the Navigator Subsystem and must be owned1371* by the host, or a subordinate of the host, requesting allocation and1372* configuration of the receive flow.1373*1374* @rx_fdq2_qnum:1375* UDMAP receive flow free descriptor queue 2 configuration to be programmed1376* into the rx_fdq2_qnum field of the flow's RFLOW_RFE register. See the1377* UDMAP section of the TRM for more information on this setting. The specified1378* free queue must be valid within the Navigator Subsystem and must be owned1379* by the host, or a subordinate of the host, requesting allocation and1380* configuration of the receive flow.1381*1382* @rx_fdq3_qnum:1383* UDMAP receive flow free descriptor queue 3 configuration to be programmed1384* into the rx_fdq3_qnum field of the flow's RFLOW_RFE register. See the1385* UDMAP section of the TRM for more information on this setting. The specified1386* free queue must be valid within the Navigator Subsystem and must be owned1387* by the host, or a subordinate of the host, requesting allocation and1388* configuration of the receive flow.1389*1390* @rx_ps_location:1391* UDMAP receive flow PS words location configuration to be programmed into the1392* rx_ps_location field of the flow's RFLOW_RFA register.1393*/1394struct ti_sci_msg_rm_udmap_flow_cfg_req {1395struct ti_sci_msg_hdr hdr;1396u32 valid_params;1397u16 nav_id;1398u16 flow_index;1399u8 rx_einfo_present;1400u8 rx_psinfo_present;1401u8 rx_error_handling;1402u8 rx_desc_type;1403u16 rx_sop_offset;1404u16 rx_dest_qnum;1405u8 rx_src_tag_hi;1406u8 rx_src_tag_lo;1407u8 rx_dest_tag_hi;1408u8 rx_dest_tag_lo;1409u8 rx_src_tag_hi_sel;1410u8 rx_src_tag_lo_sel;1411u8 rx_dest_tag_hi_sel;1412u8 rx_dest_tag_lo_sel;1413u16 rx_fdq0_sz0_qnum;1414u16 rx_fdq1_qnum;1415u16 rx_fdq2_qnum;1416u16 rx_fdq3_qnum;1417u8 rx_ps_location;1418} __packed;14191420/**1421* struct ti_sci_msg_req_proc_request - Request a processor1422* @hdr: Generic Header1423* @processor_id: ID of processor being requested1424*1425* Request type is TI_SCI_MSG_PROC_REQUEST, response is a generic ACK/NACK1426* message.1427*/1428struct ti_sci_msg_req_proc_request {1429struct ti_sci_msg_hdr hdr;1430u8 processor_id;1431} __packed;14321433/**1434* struct ti_sci_msg_req_proc_release - Release a processor1435* @hdr: Generic Header1436* @processor_id: ID of processor being released1437*1438* Request type is TI_SCI_MSG_PROC_RELEASE, response is a generic ACK/NACK1439* message.1440*/1441struct ti_sci_msg_req_proc_release {1442struct ti_sci_msg_hdr hdr;1443u8 processor_id;1444} __packed;14451446/**1447* struct ti_sci_msg_req_proc_handover - Handover a processor to a host1448* @hdr: Generic Header1449* @processor_id: ID of processor being handed over1450* @host_id: Host ID the control needs to be transferred to1451*1452* Request type is TI_SCI_MSG_PROC_HANDOVER, response is a generic ACK/NACK1453* message.1454*/1455struct ti_sci_msg_req_proc_handover {1456struct ti_sci_msg_hdr hdr;1457u8 processor_id;1458u8 host_id;1459} __packed;14601461/* Boot Vector masks */1462#define TI_SCI_ADDR_LOW_MASK GENMASK_ULL(31, 0)1463#define TI_SCI_ADDR_HIGH_MASK GENMASK_ULL(63, 32)1464#define TI_SCI_ADDR_HIGH_SHIFT 3214651466/**1467* struct ti_sci_msg_req_set_config - Set Processor boot configuration1468* @hdr: Generic Header1469* @processor_id: ID of processor being configured1470* @bootvector_low: Lower 32 bit address (Little Endian) of boot vector1471* @bootvector_high: Higher 32 bit address (Little Endian) of boot vector1472* @config_flags_set: Optional Processor specific Config Flags to set.1473* Setting a bit here implies the corresponding mode1474* will be set1475* @config_flags_clear: Optional Processor specific Config Flags to clear.1476* Setting a bit here implies the corresponding mode1477* will be cleared1478*1479* Request type is TI_SCI_MSG_PROC_HANDOVER, response is a generic ACK/NACK1480* message.1481*/1482struct ti_sci_msg_req_set_config {1483struct ti_sci_msg_hdr hdr;1484u8 processor_id;1485u32 bootvector_low;1486u32 bootvector_high;1487u32 config_flags_set;1488u32 config_flags_clear;1489} __packed;14901491/**1492* struct ti_sci_msg_req_set_ctrl - Set Processor boot control flags1493* @hdr: Generic Header1494* @processor_id: ID of processor being configured1495* @control_flags_set: Optional Processor specific Control Flags to set.1496* Setting a bit here implies the corresponding mode1497* will be set1498* @control_flags_clear:Optional Processor specific Control Flags to clear.1499* Setting a bit here implies the corresponding mode1500* will be cleared1501*1502* Request type is TI_SCI_MSG_SET_CTRL, response is a generic ACK/NACK1503* message.1504*/1505struct ti_sci_msg_req_set_ctrl {1506struct ti_sci_msg_hdr hdr;1507u8 processor_id;1508u32 control_flags_set;1509u32 control_flags_clear;1510} __packed;15111512/**1513* struct ti_sci_msg_req_get_status - Processor boot status request1514* @hdr: Generic Header1515* @processor_id: ID of processor whose status is being requested1516*1517* Request type is TI_SCI_MSG_GET_STATUS, response is an appropriate1518* message, or NACK in case of inability to satisfy request.1519*/1520struct ti_sci_msg_req_get_status {1521struct ti_sci_msg_hdr hdr;1522u8 processor_id;1523} __packed;15241525/**1526* struct ti_sci_msg_resp_get_status - Processor boot status response1527* @hdr: Generic Header1528* @processor_id: ID of processor whose status is returned1529* @bootvector_low: Lower 32 bit address (Little Endian) of boot vector1530* @bootvector_high: Higher 32 bit address (Little Endian) of boot vector1531* @config_flags: Optional Processor specific Config Flags set currently1532* @control_flags: Optional Processor specific Control Flags set currently1533* @status_flags: Optional Processor specific Status Flags set currently1534*1535* Response structure to a TI_SCI_MSG_GET_STATUS request.1536*/1537struct ti_sci_msg_resp_get_status {1538struct ti_sci_msg_hdr hdr;1539u8 processor_id;1540u32 bootvector_low;1541u32 bootvector_high;1542u32 config_flags;1543u32 control_flags;1544u32 status_flags;1545} __packed;15461547#endif /* __TI_SCI_H */154815491550