Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: BSD-3-Clause */
0002 /*
0003  * Texas Instruments System Control Interface (TISCI) Protocol
0004  *
0005  * Communication protocol with TI SCI hardware
0006  * The system works in a message response protocol
0007  * See: http://processors.wiki.ti.com/index.php/TISCI for details
0008  *
0009  * Copyright (C)  2015-2016 Texas Instruments Incorporated - https://www.ti.com/
0010  */
0011 
0012 #ifndef __TI_SCI_H
0013 #define __TI_SCI_H
0014 
0015 /* Generic Messages */
0016 #define TI_SCI_MSG_ENABLE_WDT   0x0000
0017 #define TI_SCI_MSG_WAKE_RESET   0x0001
0018 #define TI_SCI_MSG_VERSION  0x0002
0019 #define TI_SCI_MSG_WAKE_REASON  0x0003
0020 #define TI_SCI_MSG_GOODBYE  0x0004
0021 #define TI_SCI_MSG_SYS_RESET    0x0005
0022 
0023 /* Device requests */
0024 #define TI_SCI_MSG_SET_DEVICE_STATE 0x0200
0025 #define TI_SCI_MSG_GET_DEVICE_STATE 0x0201
0026 #define TI_SCI_MSG_SET_DEVICE_RESETS    0x0202
0027 
0028 /* Clock requests */
0029 #define TI_SCI_MSG_SET_CLOCK_STATE  0x0100
0030 #define TI_SCI_MSG_GET_CLOCK_STATE  0x0101
0031 #define TI_SCI_MSG_SET_CLOCK_PARENT 0x0102
0032 #define TI_SCI_MSG_GET_CLOCK_PARENT 0x0103
0033 #define TI_SCI_MSG_GET_NUM_CLOCK_PARENTS 0x0104
0034 #define TI_SCI_MSG_SET_CLOCK_FREQ   0x010c
0035 #define TI_SCI_MSG_QUERY_CLOCK_FREQ 0x010d
0036 #define TI_SCI_MSG_GET_CLOCK_FREQ   0x010e
0037 
0038 /* Resource Management Requests */
0039 #define TI_SCI_MSG_GET_RESOURCE_RANGE   0x1500
0040 
0041 /* IRQ requests */
0042 #define TI_SCI_MSG_SET_IRQ      0x1000
0043 #define TI_SCI_MSG_FREE_IRQ     0x1001
0044 
0045 /* NAVSS resource management */
0046 /* Ringacc requests */
0047 #define TI_SCI_MSG_RM_RING_ALLOCATE     0x1100
0048 #define TI_SCI_MSG_RM_RING_FREE         0x1101
0049 #define TI_SCI_MSG_RM_RING_RECONFIG     0x1102
0050 #define TI_SCI_MSG_RM_RING_RESET        0x1103
0051 #define TI_SCI_MSG_RM_RING_CFG          0x1110
0052 
0053 /* PSI-L requests */
0054 #define TI_SCI_MSG_RM_PSIL_PAIR         0x1280
0055 #define TI_SCI_MSG_RM_PSIL_UNPAIR       0x1281
0056 
0057 #define TI_SCI_MSG_RM_UDMAP_TX_ALLOC        0x1200
0058 #define TI_SCI_MSG_RM_UDMAP_TX_FREE     0x1201
0059 #define TI_SCI_MSG_RM_UDMAP_RX_ALLOC        0x1210
0060 #define TI_SCI_MSG_RM_UDMAP_RX_FREE     0x1211
0061 #define TI_SCI_MSG_RM_UDMAP_FLOW_CFG        0x1220
0062 #define TI_SCI_MSG_RM_UDMAP_OPT_FLOW_CFG    0x1221
0063 
0064 #define TISCI_MSG_RM_UDMAP_TX_CH_CFG        0x1205
0065 #define TISCI_MSG_RM_UDMAP_TX_CH_GET_CFG    0x1206
0066 #define TISCI_MSG_RM_UDMAP_RX_CH_CFG        0x1215
0067 #define TISCI_MSG_RM_UDMAP_RX_CH_GET_CFG    0x1216
0068 #define TISCI_MSG_RM_UDMAP_FLOW_CFG     0x1230
0069 #define TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_CFG 0x1231
0070 #define TISCI_MSG_RM_UDMAP_FLOW_GET_CFG     0x1232
0071 #define TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_GET_CFG 0x1233
0072 
0073 /* Processor Control requests */
0074 #define TI_SCI_MSG_PROC_REQUEST     0xc000
0075 #define TI_SCI_MSG_PROC_RELEASE     0xc001
0076 #define TI_SCI_MSG_PROC_HANDOVER    0xc005
0077 #define TI_SCI_MSG_SET_CONFIG       0xc100
0078 #define TI_SCI_MSG_SET_CTRL     0xc101
0079 #define TI_SCI_MSG_GET_STATUS       0xc400
0080 
0081 /**
0082  * struct ti_sci_msg_hdr - Generic Message Header for All messages and responses
0083  * @type:   Type of messages: One of TI_SCI_MSG* values
0084  * @host:   Host of the message
0085  * @seq:    Message identifier indicating a transfer sequence
0086  * @flags:  Flag for the message
0087  */
0088 struct ti_sci_msg_hdr {
0089     u16 type;
0090     u8 host;
0091     u8 seq;
0092 #define TI_SCI_MSG_FLAG(val)            (1 << (val))
0093 #define TI_SCI_FLAG_REQ_GENERIC_NORESPONSE  0x0
0094 #define TI_SCI_FLAG_REQ_ACK_ON_RECEIVED     TI_SCI_MSG_FLAG(0)
0095 #define TI_SCI_FLAG_REQ_ACK_ON_PROCESSED    TI_SCI_MSG_FLAG(1)
0096 #define TI_SCI_FLAG_RESP_GENERIC_NACK       0x0
0097 #define TI_SCI_FLAG_RESP_GENERIC_ACK        TI_SCI_MSG_FLAG(1)
0098     /* Additional Flags */
0099     u32 flags;
0100 } __packed;
0101 
0102 /**
0103  * struct ti_sci_msg_resp_version - Response for a message
0104  * @hdr:        Generic header
0105  * @firmware_description: String describing the firmware
0106  * @firmware_revision:  Firmware revision
0107  * @abi_major:      Major version of the ABI that firmware supports
0108  * @abi_minor:      Minor version of the ABI that firmware supports
0109  *
0110  * In general, ABI version changes follow the rule that minor version increments
0111  * are backward compatible. Major revision changes in ABI may not be
0112  * backward compatible.
0113  *
0114  * Response to a generic message with message type TI_SCI_MSG_VERSION
0115  */
0116 struct ti_sci_msg_resp_version {
0117     struct ti_sci_msg_hdr hdr;
0118     char firmware_description[32];
0119     u16 firmware_revision;
0120     u8 abi_major;
0121     u8 abi_minor;
0122 } __packed;
0123 
0124 /**
0125  * struct ti_sci_msg_req_reboot - Reboot the SoC
0126  * @hdr:    Generic Header
0127  *
0128  * Request type is TI_SCI_MSG_SYS_RESET, responded with a generic
0129  * ACK/NACK message.
0130  */
0131 struct ti_sci_msg_req_reboot {
0132     struct ti_sci_msg_hdr hdr;
0133 } __packed;
0134 
0135 /**
0136  * struct ti_sci_msg_req_set_device_state - Set the desired state of the device
0137  * @hdr:        Generic header
0138  * @id: Indicates which device to modify
0139  * @reserved: Reserved space in message, must be 0 for backward compatibility
0140  * @state: The desired state of the device.
0141  *
0142  * Certain flags can also be set to alter the device state:
0143  * + MSG_FLAG_DEVICE_WAKE_ENABLED - Configure the device to be a wake source.
0144  * The meaning of this flag will vary slightly from device to device and from
0145  * SoC to SoC but it generally allows the device to wake the SoC out of deep
0146  * suspend states.
0147  * + MSG_FLAG_DEVICE_RESET_ISO - Enable reset isolation for this device.
0148  * + MSG_FLAG_DEVICE_EXCLUSIVE - Claim this device exclusively. When passed
0149  * with STATE_RETENTION or STATE_ON, it will claim the device exclusively.
0150  * If another host already has this device set to STATE_RETENTION or STATE_ON,
0151  * the message will fail. Once successful, other hosts attempting to set
0152  * STATE_RETENTION or STATE_ON will fail.
0153  *
0154  * Request type is TI_SCI_MSG_SET_DEVICE_STATE, responded with a generic
0155  * ACK/NACK message.
0156  */
0157 struct ti_sci_msg_req_set_device_state {
0158     /* Additional hdr->flags options */
0159 #define MSG_FLAG_DEVICE_WAKE_ENABLED    TI_SCI_MSG_FLAG(8)
0160 #define MSG_FLAG_DEVICE_RESET_ISO   TI_SCI_MSG_FLAG(9)
0161 #define MSG_FLAG_DEVICE_EXCLUSIVE   TI_SCI_MSG_FLAG(10)
0162     struct ti_sci_msg_hdr hdr;
0163     u32 id;
0164     u32 reserved;
0165 
0166 #define MSG_DEVICE_SW_STATE_AUTO_OFF    0
0167 #define MSG_DEVICE_SW_STATE_RETENTION   1
0168 #define MSG_DEVICE_SW_STATE_ON      2
0169     u8 state;
0170 } __packed;
0171 
0172 /**
0173  * struct ti_sci_msg_req_get_device_state - Request to get device.
0174  * @hdr:        Generic header
0175  * @id:     Device Identifier
0176  *
0177  * Request type is TI_SCI_MSG_GET_DEVICE_STATE, responded device state
0178  * information
0179  */
0180 struct ti_sci_msg_req_get_device_state {
0181     struct ti_sci_msg_hdr hdr;
0182     u32 id;
0183 } __packed;
0184 
0185 /**
0186  * struct ti_sci_msg_resp_get_device_state - Response to get device request.
0187  * @hdr:        Generic header
0188  * @context_loss_count: Indicates how many times the device has lost context. A
0189  *  driver can use this monotonic counter to determine if the device has
0190  *  lost context since the last time this message was exchanged.
0191  * @resets: Programmed state of the reset lines.
0192  * @programmed_state:   The state as programmed by set_device.
0193  *          - Uses the MSG_DEVICE_SW_* macros
0194  * @current_state:  The actual state of the hardware.
0195  *
0196  * Response to request TI_SCI_MSG_GET_DEVICE_STATE.
0197  */
0198 struct ti_sci_msg_resp_get_device_state {
0199     struct ti_sci_msg_hdr hdr;
0200     u32 context_loss_count;
0201     u32 resets;
0202     u8 programmed_state;
0203 #define MSG_DEVICE_HW_STATE_OFF     0
0204 #define MSG_DEVICE_HW_STATE_ON      1
0205 #define MSG_DEVICE_HW_STATE_TRANS   2
0206     u8 current_state;
0207 } __packed;
0208 
0209 /**
0210  * struct ti_sci_msg_req_set_device_resets - Set the desired resets
0211  *              configuration of the device
0212  * @hdr:        Generic header
0213  * @id: Indicates which device to modify
0214  * @resets: A bit field of resets for the device. The meaning, behavior,
0215  *  and usage of the reset flags are device specific. 0 for a bit
0216  *  indicates releasing the reset represented by that bit while 1
0217  *  indicates keeping it held.
0218  *
0219  * Request type is TI_SCI_MSG_SET_DEVICE_RESETS, responded with a generic
0220  * ACK/NACK message.
0221  */
0222 struct ti_sci_msg_req_set_device_resets {
0223     struct ti_sci_msg_hdr hdr;
0224     u32 id;
0225     u32 resets;
0226 } __packed;
0227 
0228 /**
0229  * struct ti_sci_msg_req_set_clock_state - Request to setup a Clock state
0230  * @hdr:    Generic Header, Certain flags can be set specific to the clocks:
0231  *      MSG_FLAG_CLOCK_ALLOW_SSC: Allow this clock to be modified
0232  *      via spread spectrum clocking.
0233  *      MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE: Allow this clock's
0234  *      frequency to be changed while it is running so long as it
0235  *      is within the min/max limits.
0236  *      MSG_FLAG_CLOCK_INPUT_TERM: Enable input termination, this
0237  *      is only applicable to clock inputs on the SoC pseudo-device.
0238  * @dev_id: Device identifier this request is for
0239  * @clk_id: Clock identifier for the device for this request.
0240  *      Each device has it's own set of clock inputs. This indexes
0241  *      which clock input to modify. Set to 255 if clock ID is
0242  *      greater than or equal to 255.
0243  * @request_state: Request the state for the clock to be set to.
0244  *      MSG_CLOCK_SW_STATE_UNREQ: The IP does not require this clock,
0245  *      it can be disabled, regardless of the state of the device
0246  *      MSG_CLOCK_SW_STATE_AUTO: Allow the System Controller to
0247  *      automatically manage the state of this clock. If the device
0248  *      is enabled, then the clock is enabled. If the device is set
0249  *      to off or retention, then the clock is internally set as not
0250  *      being required by the device.(default)
0251  *      MSG_CLOCK_SW_STATE_REQ:  Configure the clock to be enabled,
0252  *      regardless of the state of the device.
0253  * @clk_id_32:  Clock identifier for the device for this request.
0254  *      Only to be used if the clock ID is greater than or equal to
0255  *      255.
0256  *
0257  * Normally, all required clocks are managed by TISCI entity, this is used
0258  * only for specific control *IF* required. Auto managed state is
0259  * MSG_CLOCK_SW_STATE_AUTO, in other states, TISCI entity assume remote
0260  * will explicitly control.
0261  *
0262  * Request type is TI_SCI_MSG_SET_CLOCK_STATE, response is a generic
0263  * ACK or NACK message.
0264  */
0265 struct ti_sci_msg_req_set_clock_state {
0266     /* Additional hdr->flags options */
0267 #define MSG_FLAG_CLOCK_ALLOW_SSC        TI_SCI_MSG_FLAG(8)
0268 #define MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE    TI_SCI_MSG_FLAG(9)
0269 #define MSG_FLAG_CLOCK_INPUT_TERM       TI_SCI_MSG_FLAG(10)
0270     struct ti_sci_msg_hdr hdr;
0271     u32 dev_id;
0272     u8 clk_id;
0273 #define MSG_CLOCK_SW_STATE_UNREQ    0
0274 #define MSG_CLOCK_SW_STATE_AUTO     1
0275 #define MSG_CLOCK_SW_STATE_REQ      2
0276     u8 request_state;
0277     u32 clk_id_32;
0278 } __packed;
0279 
0280 /**
0281  * struct ti_sci_msg_req_get_clock_state - Request for clock state
0282  * @hdr:    Generic Header
0283  * @dev_id: Device identifier this request is for
0284  * @clk_id: Clock identifier for the device for this request.
0285  *      Each device has it's own set of clock inputs. This indexes
0286  *      which clock input to get state of. Set to 255 if the clock
0287  *      ID is greater than or equal to 255.
0288  * @clk_id_32:  Clock identifier for the device for the request.
0289  *      Only to be used if the clock ID is greater than or equal to
0290  *      255.
0291  *
0292  * Request type is TI_SCI_MSG_GET_CLOCK_STATE, response is state
0293  * of the clock
0294  */
0295 struct ti_sci_msg_req_get_clock_state {
0296     struct ti_sci_msg_hdr hdr;
0297     u32 dev_id;
0298     u8 clk_id;
0299     u32 clk_id_32;
0300 } __packed;
0301 
0302 /**
0303  * struct ti_sci_msg_resp_get_clock_state - Response to get clock state
0304  * @hdr:    Generic Header
0305  * @programmed_state: Any programmed state of the clock. This is one of
0306  *      MSG_CLOCK_SW_STATE* values.
0307  * @current_state: Current state of the clock. This is one of:
0308  *      MSG_CLOCK_HW_STATE_NOT_READY: Clock is not ready
0309  *      MSG_CLOCK_HW_STATE_READY: Clock is ready
0310  *
0311  * Response to TI_SCI_MSG_GET_CLOCK_STATE.
0312  */
0313 struct ti_sci_msg_resp_get_clock_state {
0314     struct ti_sci_msg_hdr hdr;
0315     u8 programmed_state;
0316 #define MSG_CLOCK_HW_STATE_NOT_READY    0
0317 #define MSG_CLOCK_HW_STATE_READY    1
0318     u8 current_state;
0319 } __packed;
0320 
0321 /**
0322  * struct ti_sci_msg_req_set_clock_parent - Set the clock parent
0323  * @hdr:    Generic Header
0324  * @dev_id: Device identifier this request is for
0325  * @clk_id: Clock identifier for the device for this request.
0326  *      Each device has it's own set of clock inputs. This indexes
0327  *      which clock input to modify. Set to 255 if clock ID is
0328  *      greater than or equal to 255.
0329  * @parent_id:  The new clock parent is selectable by an index via this
0330  *      parameter. Set to 255 if clock ID is greater than or
0331  *      equal to 255.
0332  * @clk_id_32:  Clock identifier if @clk_id field is 255.
0333  * @parent_id_32:   Parent identifier if @parent_id is 255.
0334  *
0335  * Request type is TI_SCI_MSG_SET_CLOCK_PARENT, response is generic
0336  * ACK / NACK message.
0337  */
0338 struct ti_sci_msg_req_set_clock_parent {
0339     struct ti_sci_msg_hdr hdr;
0340     u32 dev_id;
0341     u8 clk_id;
0342     u8 parent_id;
0343     u32 clk_id_32;
0344     u32 parent_id_32;
0345 } __packed;
0346 
0347 /**
0348  * struct ti_sci_msg_req_get_clock_parent - Get the clock parent
0349  * @hdr:    Generic Header
0350  * @dev_id: Device identifier this request is for
0351  * @clk_id: Clock identifier for the device for this request.
0352  *      Each device has it's own set of clock inputs. This indexes
0353  *      which clock input to get the parent for. If this field
0354  *      contains 255, the actual clock identifier is stored in
0355  *      @clk_id_32.
0356  * @clk_id_32:  Clock identifier if the @clk_id field contains 255.
0357  *
0358  * Request type is TI_SCI_MSG_GET_CLOCK_PARENT, response is parent information
0359  */
0360 struct ti_sci_msg_req_get_clock_parent {
0361     struct ti_sci_msg_hdr hdr;
0362     u32 dev_id;
0363     u8 clk_id;
0364     u32 clk_id_32;
0365 } __packed;
0366 
0367 /**
0368  * struct ti_sci_msg_resp_get_clock_parent - Response with clock parent
0369  * @hdr:    Generic Header
0370  * @parent_id:  The current clock parent. If set to 255, the current parent
0371  *      ID can be found from the @parent_id_32 field.
0372  * @parent_id_32:   Current clock parent if @parent_id field is set to
0373  *          255.
0374  *
0375  * Response to TI_SCI_MSG_GET_CLOCK_PARENT.
0376  */
0377 struct ti_sci_msg_resp_get_clock_parent {
0378     struct ti_sci_msg_hdr hdr;
0379     u8 parent_id;
0380     u32 parent_id_32;
0381 } __packed;
0382 
0383 /**
0384  * struct ti_sci_msg_req_get_clock_num_parents - Request to get clock parents
0385  * @hdr:    Generic header
0386  * @dev_id: Device identifier this request is for
0387  * @clk_id: Clock identifier for the device for this request. Set to
0388  *      255 if clock ID is greater than or equal to 255.
0389  * @clk_id_32:  Clock identifier if the @clk_id field contains 255.
0390  *
0391  * This request provides information about how many clock parent options
0392  * are available for a given clock to a device. This is typically used
0393  * for input clocks.
0394  *
0395  * Request type is TI_SCI_MSG_GET_NUM_CLOCK_PARENTS, response is appropriate
0396  * message, or NACK in case of inability to satisfy request.
0397  */
0398 struct ti_sci_msg_req_get_clock_num_parents {
0399     struct ti_sci_msg_hdr hdr;
0400     u32 dev_id;
0401     u8 clk_id;
0402     u32 clk_id_32;
0403 } __packed;
0404 
0405 /**
0406  * struct ti_sci_msg_resp_get_clock_num_parents - Response for get clk parents
0407  * @hdr:        Generic header
0408  * @num_parents:    Number of clock parents. If set to 255, the actual
0409  *          number of parents is stored into @num_parents_32
0410  *          field instead.
0411  * @num_parents_32: Number of clock parents if @num_parents field is
0412  *          set to 255.
0413  *
0414  * Response to TI_SCI_MSG_GET_NUM_CLOCK_PARENTS
0415  */
0416 struct ti_sci_msg_resp_get_clock_num_parents {
0417     struct ti_sci_msg_hdr hdr;
0418     u8 num_parents;
0419     u32 num_parents_32;
0420 } __packed;
0421 
0422 /**
0423  * struct ti_sci_msg_req_query_clock_freq - Request to query a frequency
0424  * @hdr:    Generic Header
0425  * @dev_id: Device identifier this request is for
0426  * @min_freq_hz: The minimum allowable frequency in Hz. This is the minimum
0427  *      allowable programmed frequency and does not account for clock
0428  *      tolerances and jitter.
0429  * @target_freq_hz: The target clock frequency. A frequency will be found
0430  *      as close to this target frequency as possible.
0431  * @max_freq_hz: The maximum allowable frequency in Hz. This is the maximum
0432  *      allowable programmed frequency and does not account for clock
0433  *      tolerances and jitter.
0434  * @clk_id: Clock identifier for the device for this request. Set to
0435  *      255 if clock identifier is greater than or equal to 255.
0436  * @clk_id_32:  Clock identifier if @clk_id is set to 255.
0437  *
0438  * NOTE: Normally clock frequency management is automatically done by TISCI
0439  * entity. In case of specific requests, TISCI evaluates capability to achieve
0440  * requested frequency within provided range and responds with
0441  * result message.
0442  *
0443  * Request type is TI_SCI_MSG_QUERY_CLOCK_FREQ, response is appropriate message,
0444  * or NACK in case of inability to satisfy request.
0445  */
0446 struct ti_sci_msg_req_query_clock_freq {
0447     struct ti_sci_msg_hdr hdr;
0448     u32 dev_id;
0449     u64 min_freq_hz;
0450     u64 target_freq_hz;
0451     u64 max_freq_hz;
0452     u8 clk_id;
0453     u32 clk_id_32;
0454 } __packed;
0455 
0456 /**
0457  * struct ti_sci_msg_resp_query_clock_freq - Response to a clock frequency query
0458  * @hdr:    Generic Header
0459  * @freq_hz:    Frequency that is the best match in Hz.
0460  *
0461  * Response to request type TI_SCI_MSG_QUERY_CLOCK_FREQ. NOTE: if the request
0462  * cannot be satisfied, the message will be of type NACK.
0463  */
0464 struct ti_sci_msg_resp_query_clock_freq {
0465     struct ti_sci_msg_hdr hdr;
0466     u64 freq_hz;
0467 } __packed;
0468 
0469 /**
0470  * struct ti_sci_msg_req_set_clock_freq - Request to setup a clock frequency
0471  * @hdr:    Generic Header
0472  * @dev_id: Device identifier this request is for
0473  * @min_freq_hz: The minimum allowable frequency in Hz. This is the minimum
0474  *      allowable programmed frequency and does not account for clock
0475  *      tolerances and jitter.
0476  * @target_freq_hz: The target clock frequency. The clock will be programmed
0477  *      at a rate as close to this target frequency as possible.
0478  * @max_freq_hz: The maximum allowable frequency in Hz. This is the maximum
0479  *      allowable programmed frequency and does not account for clock
0480  *      tolerances and jitter.
0481  * @clk_id: Clock identifier for the device for this request. Set to
0482  *      255 if clock ID is greater than or equal to 255.
0483  * @clk_id_32:  Clock identifier if @clk_id field is set to 255.
0484  *
0485  * NOTE: Normally clock frequency management is automatically done by TISCI
0486  * entity. In case of specific requests, TISCI evaluates capability to achieve
0487  * requested range and responds with success/failure message.
0488  *
0489  * This sets the desired frequency for a clock within an allowable
0490  * range. This message will fail on an enabled clock unless
0491  * MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE is set for the clock. Additionally,
0492  * if other clocks have their frequency modified due to this message,
0493  * they also must have the MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE or be disabled.
0494  *
0495  * Calling set frequency on a clock input to the SoC pseudo-device will
0496  * inform the PMMC of that clock's frequency. Setting a frequency of
0497  * zero will indicate the clock is disabled.
0498  *
0499  * Calling set frequency on clock outputs from the SoC pseudo-device will
0500  * function similarly to setting the clock frequency on a device.
0501  *
0502  * Request type is TI_SCI_MSG_SET_CLOCK_FREQ, response is a generic ACK/NACK
0503  * message.
0504  */
0505 struct ti_sci_msg_req_set_clock_freq {
0506     struct ti_sci_msg_hdr hdr;
0507     u32 dev_id;
0508     u64 min_freq_hz;
0509     u64 target_freq_hz;
0510     u64 max_freq_hz;
0511     u8 clk_id;
0512     u32 clk_id_32;
0513 } __packed;
0514 
0515 /**
0516  * struct ti_sci_msg_req_get_clock_freq - Request to get the clock frequency
0517  * @hdr:    Generic Header
0518  * @dev_id: Device identifier this request is for
0519  * @clk_id: Clock identifier for the device for this request. Set to
0520  *      255 if clock ID is greater than or equal to 255.
0521  * @clk_id_32:  Clock identifier if @clk_id field is set to 255.
0522  *
0523  * NOTE: Normally clock frequency management is automatically done by TISCI
0524  * entity. In some cases, clock frequencies are configured by host.
0525  *
0526  * Request type is TI_SCI_MSG_GET_CLOCK_FREQ, responded with clock frequency
0527  * that the clock is currently at.
0528  */
0529 struct ti_sci_msg_req_get_clock_freq {
0530     struct ti_sci_msg_hdr hdr;
0531     u32 dev_id;
0532     u8 clk_id;
0533     u32 clk_id_32;
0534 } __packed;
0535 
0536 /**
0537  * struct ti_sci_msg_resp_get_clock_freq - Response of clock frequency request
0538  * @hdr:    Generic Header
0539  * @freq_hz:    Frequency that the clock is currently on, in Hz.
0540  *
0541  * Response to request type TI_SCI_MSG_GET_CLOCK_FREQ.
0542  */
0543 struct ti_sci_msg_resp_get_clock_freq {
0544     struct ti_sci_msg_hdr hdr;
0545     u64 freq_hz;
0546 } __packed;
0547 
0548 #define TI_SCI_IRQ_SECONDARY_HOST_INVALID   0xff
0549 
0550 /**
0551  * struct ti_sci_msg_req_get_resource_range - Request to get a host's assigned
0552  *                        range of resources.
0553  * @hdr:        Generic Header
0554  * @type:       Unique resource assignment type
0555  * @subtype:        Resource assignment subtype within the resource type.
0556  * @secondary_host: Host processing entity to which the resources are
0557  *          allocated. This is required only when the destination
0558  *          host id id different from ti sci interface host id,
0559  *          else TI_SCI_IRQ_SECONDARY_HOST_INVALID can be passed.
0560  *
0561  * Request type is TI_SCI_MSG_GET_RESOURCE_RANGE. Responded with requested
0562  * resource range which is of type TI_SCI_MSG_GET_RESOURCE_RANGE.
0563  */
0564 struct ti_sci_msg_req_get_resource_range {
0565     struct ti_sci_msg_hdr hdr;
0566 #define MSG_RM_RESOURCE_TYPE_MASK   GENMASK(9, 0)
0567 #define MSG_RM_RESOURCE_SUBTYPE_MASK    GENMASK(5, 0)
0568     u16 type;
0569     u8 subtype;
0570     u8 secondary_host;
0571 } __packed;
0572 
0573 /**
0574  * struct ti_sci_msg_resp_get_resource_range - Response to resource get range.
0575  * @hdr:        Generic Header
0576  * @range_start:    Start index of the first resource range.
0577  * @range_num:      Number of resources in the first range.
0578  * @range_start_sec:    Start index of the second resource range.
0579  * @range_num_sec:  Number of resources in the second range.
0580  *
0581  * Response to request TI_SCI_MSG_GET_RESOURCE_RANGE.
0582  */
0583 struct ti_sci_msg_resp_get_resource_range {
0584     struct ti_sci_msg_hdr hdr;
0585     u16 range_start;
0586     u16 range_num;
0587     u16 range_start_sec;
0588     u16 range_num_sec;
0589 } __packed;
0590 
0591 /**
0592  * struct ti_sci_msg_req_manage_irq - Request to configure/release the route
0593  *                  between the dev and the host.
0594  * @hdr:        Generic Header
0595  * @valid_params:   Bit fields defining the validity of interrupt source
0596  *          parameters. If a bit is not set, then corresponding
0597  *          field is not valid and will not be used for route set.
0598  *          Bit field definitions:
0599  *          0 - Valid bit for @dst_id
0600  *          1 - Valid bit for @dst_host_irq
0601  *          2 - Valid bit for @ia_id
0602  *          3 - Valid bit for @vint
0603  *          4 - Valid bit for @global_event
0604  *          5 - Valid bit for @vint_status_bit_index
0605  *          31 - Valid bit for @secondary_host
0606  * @src_id:     IRQ source peripheral ID.
0607  * @src_index:      IRQ source index within the peripheral
0608  * @dst_id:     IRQ Destination ID. Based on the architecture it can be
0609  *          IRQ controller or host processor ID.
0610  * @dst_host_irq:   IRQ number of the destination host IRQ controller
0611  * @ia_id:      Device ID of the interrupt aggregator in which the
0612  *          vint resides.
0613  * @vint:       Virtual interrupt number if the interrupt route
0614  *          is through an interrupt aggregator.
0615  * @global_event:   Global event that is to be mapped to interrupt
0616  *          aggregator virtual interrupt status bit.
0617  * @vint_status_bit:    Virtual interrupt status bit if the interrupt route
0618  *          utilizes an interrupt aggregator status bit.
0619  * @secondary_host: Host ID of the IRQ destination computing entity. This is
0620  *          required only when destination host id is different
0621  *          from ti sci interface host id.
0622  *
0623  * Request type is TI_SCI_MSG_SET/RELEASE_IRQ.
0624  * Response is generic ACK / NACK message.
0625  */
0626 struct ti_sci_msg_req_manage_irq {
0627     struct ti_sci_msg_hdr hdr;
0628 #define MSG_FLAG_DST_ID_VALID           TI_SCI_MSG_FLAG(0)
0629 #define MSG_FLAG_DST_HOST_IRQ_VALID     TI_SCI_MSG_FLAG(1)
0630 #define MSG_FLAG_IA_ID_VALID            TI_SCI_MSG_FLAG(2)
0631 #define MSG_FLAG_VINT_VALID         TI_SCI_MSG_FLAG(3)
0632 #define MSG_FLAG_GLB_EVNT_VALID         TI_SCI_MSG_FLAG(4)
0633 #define MSG_FLAG_VINT_STS_BIT_VALID     TI_SCI_MSG_FLAG(5)
0634 #define MSG_FLAG_SHOST_VALID            TI_SCI_MSG_FLAG(31)
0635     u32 valid_params;
0636     u16 src_id;
0637     u16 src_index;
0638     u16 dst_id;
0639     u16 dst_host_irq;
0640     u16 ia_id;
0641     u16 vint;
0642     u16 global_event;
0643     u8 vint_status_bit;
0644     u8 secondary_host;
0645 } __packed;
0646 
0647 /**
0648  * struct ti_sci_msg_rm_ring_cfg_req - Configure a Navigator Subsystem ring
0649  *
0650  * Configures the non-real-time registers of a Navigator Subsystem ring.
0651  * @hdr:    Generic Header
0652  * @valid_params: Bitfield defining validity of ring configuration parameters.
0653  *  The ring configuration fields are not valid, and will not be used for
0654  *  ring configuration, if their corresponding valid bit is zero.
0655  *  Valid bit usage:
0656  *  0 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_lo
0657  *  1 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_hi
0658  *  2 - Valid bit for @tisci_msg_rm_ring_cfg_req count
0659  *  3 - Valid bit for @tisci_msg_rm_ring_cfg_req mode
0660  *  4 - Valid bit for @tisci_msg_rm_ring_cfg_req size
0661  *  5 - Valid bit for @tisci_msg_rm_ring_cfg_req order_id
0662  *  6 - Valid bit for @tisci_msg_rm_ring_cfg_req virtid
0663  *  7 - Valid bit for @tisci_msg_rm_ring_cfg_req ASEL
0664  * @nav_id: Device ID of Navigator Subsystem from which the ring is allocated
0665  * @index: ring index to be configured.
0666  * @addr_lo: 32 LSBs of ring base address to be programmed into the ring's
0667  *  RING_BA_LO register
0668  * @addr_hi: 16 MSBs of ring base address to be programmed into the ring's
0669  *  RING_BA_HI register.
0670  * @count: Number of ring elements. Must be even if mode is CREDENTIALS or QM
0671  *  modes.
0672  * @mode: Specifies the mode the ring is to be configured.
0673  * @size: Specifies encoded ring element size. To calculate the encoded size use
0674  *  the formula (log2(size_bytes) - 2), where size_bytes cannot be
0675  *  greater than 256.
0676  * @order_id: Specifies the ring's bus order ID.
0677  * @virtid: Ring virt ID value
0678  * @asel: Ring ASEL (address select) value to be set into the ASEL field of the
0679  *  ring's RING_BA_HI register.
0680  */
0681 struct ti_sci_msg_rm_ring_cfg_req {
0682     struct ti_sci_msg_hdr hdr;
0683     u32 valid_params;
0684     u16 nav_id;
0685     u16 index;
0686     u32 addr_lo;
0687     u32 addr_hi;
0688     u32 count;
0689     u8 mode;
0690     u8 size;
0691     u8 order_id;
0692     u16 virtid;
0693     u8 asel;
0694 } __packed;
0695 
0696 /**
0697  * struct ti_sci_msg_psil_pair - Pairs a PSI-L source thread to a destination
0698  *               thread
0699  * @hdr:    Generic Header
0700  * @nav_id: SoC Navigator Subsystem device ID whose PSI-L config proxy is
0701  *      used to pair the source and destination threads.
0702  * @src_thread: PSI-L source thread ID within the PSI-L System thread map.
0703  *
0704  * UDMAP transmit channels mapped to source threads will have their
0705  * TCHAN_THRD_ID register programmed with the destination thread if the pairing
0706  * is successful.
0707 
0708  * @dst_thread: PSI-L destination thread ID within the PSI-L System thread map.
0709  * PSI-L destination threads start at index 0x8000.  The request is NACK'd if
0710  * the destination thread is not greater than or equal to 0x8000.
0711  *
0712  * UDMAP receive channels mapped to destination threads will have their
0713  * RCHAN_THRD_ID register programmed with the source thread if the pairing
0714  * is successful.
0715  *
0716  * Request type is TI_SCI_MSG_RM_PSIL_PAIR, response is a generic ACK or NACK
0717  * message.
0718  */
0719 struct ti_sci_msg_psil_pair {
0720     struct ti_sci_msg_hdr hdr;
0721     u32 nav_id;
0722     u32 src_thread;
0723     u32 dst_thread;
0724 } __packed;
0725 
0726 /**
0727  * struct ti_sci_msg_psil_unpair - Unpairs a PSI-L source thread from a
0728  *                 destination thread
0729  * @hdr:    Generic Header
0730  * @nav_id: SoC Navigator Subsystem device ID whose PSI-L config proxy is
0731  *      used to unpair the source and destination threads.
0732  * @src_thread: PSI-L source thread ID within the PSI-L System thread map.
0733  *
0734  * UDMAP transmit channels mapped to source threads will have their
0735  * TCHAN_THRD_ID register cleared if the unpairing is successful.
0736  *
0737  * @dst_thread: PSI-L destination thread ID within the PSI-L System thread map.
0738  * PSI-L destination threads start at index 0x8000.  The request is NACK'd if
0739  * the destination thread is not greater than or equal to 0x8000.
0740  *
0741  * UDMAP receive channels mapped to destination threads will have their
0742  * RCHAN_THRD_ID register cleared if the unpairing is successful.
0743  *
0744  * Request type is TI_SCI_MSG_RM_PSIL_UNPAIR, response is a generic ACK or NACK
0745  * message.
0746  */
0747 struct ti_sci_msg_psil_unpair {
0748     struct ti_sci_msg_hdr hdr;
0749     u32 nav_id;
0750     u32 src_thread;
0751     u32 dst_thread;
0752 } __packed;
0753 
0754 /**
0755  * struct ti_sci_msg_udmap_rx_flow_cfg -  UDMAP receive flow configuration
0756  *                    message
0757  * @hdr: Generic Header
0758  * @nav_id: SoC Navigator Subsystem device ID from which the receive flow is
0759  *  allocated
0760  * @flow_index: UDMAP receive flow index for non-optional configuration.
0761  * @rx_ch_index: Specifies the index of the receive channel using the flow_index
0762  * @rx_einfo_present: UDMAP receive flow extended packet info present.
0763  * @rx_psinfo_present: UDMAP receive flow PS words present.
0764  * @rx_error_handling: UDMAP receive flow error handling configuration. Valid
0765  *  values are TI_SCI_RM_UDMAP_RX_FLOW_ERR_DROP/RETRY.
0766  * @rx_desc_type: UDMAP receive flow descriptor type. It can be one of
0767  *  TI_SCI_RM_UDMAP_RX_FLOW_DESC_HOST/MONO.
0768  * @rx_sop_offset: UDMAP receive flow start of packet offset.
0769  * @rx_dest_qnum: UDMAP receive flow destination queue number.
0770  * @rx_ps_location: UDMAP receive flow PS words location.
0771  *  0 - end of packet descriptor
0772  *  1 - Beginning of the data buffer
0773  * @rx_src_tag_hi: UDMAP receive flow source tag high byte constant
0774  * @rx_src_tag_lo: UDMAP receive flow source tag low byte constant
0775  * @rx_dest_tag_hi: UDMAP receive flow destination tag high byte constant
0776  * @rx_dest_tag_lo: UDMAP receive flow destination tag low byte constant
0777  * @rx_src_tag_hi_sel: UDMAP receive flow source tag high byte selector
0778  * @rx_src_tag_lo_sel: UDMAP receive flow source tag low byte selector
0779  * @rx_dest_tag_hi_sel: UDMAP receive flow destination tag high byte selector
0780  * @rx_dest_tag_lo_sel: UDMAP receive flow destination tag low byte selector
0781  * @rx_size_thresh_en: UDMAP receive flow packet size based free buffer queue
0782  *  enable. If enabled, the ti_sci_rm_udmap_rx_flow_opt_cfg also need to be
0783  *  configured and sent.
0784  * @rx_fdq0_sz0_qnum: UDMAP receive flow free descriptor queue 0.
0785  * @rx_fdq1_qnum: UDMAP receive flow free descriptor queue 1.
0786  * @rx_fdq2_qnum: UDMAP receive flow free descriptor queue 2.
0787  * @rx_fdq3_qnum: UDMAP receive flow free descriptor queue 3.
0788  *
0789  * For detailed information on the settings, see the UDMAP section of the TRM.
0790  */
0791 struct ti_sci_msg_udmap_rx_flow_cfg {
0792     struct ti_sci_msg_hdr hdr;
0793     u32 nav_id;
0794     u32 flow_index;
0795     u32 rx_ch_index;
0796     u8 rx_einfo_present;
0797     u8 rx_psinfo_present;
0798     u8 rx_error_handling;
0799     u8 rx_desc_type;
0800     u16 rx_sop_offset;
0801     u16 rx_dest_qnum;
0802     u8 rx_ps_location;
0803     u8 rx_src_tag_hi;
0804     u8 rx_src_tag_lo;
0805     u8 rx_dest_tag_hi;
0806     u8 rx_dest_tag_lo;
0807     u8 rx_src_tag_hi_sel;
0808     u8 rx_src_tag_lo_sel;
0809     u8 rx_dest_tag_hi_sel;
0810     u8 rx_dest_tag_lo_sel;
0811     u8 rx_size_thresh_en;
0812     u16 rx_fdq0_sz0_qnum;
0813     u16 rx_fdq1_qnum;
0814     u16 rx_fdq2_qnum;
0815     u16 rx_fdq3_qnum;
0816 } __packed;
0817 
0818 /**
0819  * struct rm_ti_sci_msg_udmap_rx_flow_opt_cfg - parameters for UDMAP receive
0820  *                      flow optional configuration
0821  * @hdr: Generic Header
0822  * @nav_id: SoC Navigator Subsystem device ID from which the receive flow is
0823  *  allocated
0824  * @flow_index: UDMAP receive flow index for optional configuration.
0825  * @rx_ch_index: Specifies the index of the receive channel using the flow_index
0826  * @rx_size_thresh0: UDMAP receive flow packet size threshold 0.
0827  * @rx_size_thresh1: UDMAP receive flow packet size threshold 1.
0828  * @rx_size_thresh2: UDMAP receive flow packet size threshold 2.
0829  * @rx_fdq0_sz1_qnum: UDMAP receive flow free descriptor queue for size
0830  *  threshold 1.
0831  * @rx_fdq0_sz2_qnum: UDMAP receive flow free descriptor queue for size
0832  *  threshold 2.
0833  * @rx_fdq0_sz3_qnum: UDMAP receive flow free descriptor queue for size
0834  *  threshold 3.
0835  *
0836  * For detailed information on the settings, see the UDMAP section of the TRM.
0837  */
0838 struct rm_ti_sci_msg_udmap_rx_flow_opt_cfg {
0839     struct ti_sci_msg_hdr hdr;
0840     u32 nav_id;
0841     u32 flow_index;
0842     u32 rx_ch_index;
0843     u16 rx_size_thresh0;
0844     u16 rx_size_thresh1;
0845     u16 rx_size_thresh2;
0846     u16 rx_fdq0_sz1_qnum;
0847     u16 rx_fdq0_sz2_qnum;
0848     u16 rx_fdq0_sz3_qnum;
0849 } __packed;
0850 
0851 /**
0852  * Configures a Navigator Subsystem UDMAP transmit channel
0853  *
0854  * Configures the non-real-time registers of a Navigator Subsystem UDMAP
0855  * transmit channel.  The channel index must be assigned to the host defined
0856  * in the TISCI header via the RM board configuration resource assignment
0857  * range list.
0858  *
0859  * @hdr: Generic Header
0860  *
0861  * @valid_params: Bitfield defining validity of tx channel configuration
0862  * parameters. The tx channel configuration fields are not valid, and will not
0863  * be used for ch configuration, if their corresponding valid bit is zero.
0864  * Valid bit usage:
0865  *    0 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_pause_on_err
0866  *    1 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_atype
0867  *    2 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_chan_type
0868  *    3 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_fetch_size
0869  *    4 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::txcq_qnum
0870  *    5 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_priority
0871  *    6 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_qos
0872  *    7 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_orderid
0873  *    8 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_sched_priority
0874  *    9 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_einfo
0875  *   10 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_pswords
0876  *   11 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_supr_tdpkt
0877  *   12 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_credit_count
0878  *   13 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::fdepth
0879  *   14 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_burst_size
0880  *   15 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_tdtype
0881  *   16 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::extended_ch_type
0882  *
0883  * @nav_id: SoC device ID of Navigator Subsystem where tx channel is located
0884  *
0885  * @index: UDMAP transmit channel index.
0886  *
0887  * @tx_pause_on_err: UDMAP transmit channel pause on error configuration to
0888  * be programmed into the tx_pause_on_err field of the channel's TCHAN_TCFG
0889  * register.
0890  *
0891  * @tx_filt_einfo: UDMAP transmit channel extended packet information passing
0892  * configuration to be programmed into the tx_filt_einfo field of the
0893  * channel's TCHAN_TCFG register.
0894  *
0895  * @tx_filt_pswords: UDMAP transmit channel protocol specific word passing
0896  * configuration to be programmed into the tx_filt_pswords field of the
0897  * channel's TCHAN_TCFG register.
0898  *
0899  * @tx_atype: UDMAP transmit channel non Ring Accelerator access pointer
0900  * interpretation configuration to be programmed into the tx_atype field of
0901  * the channel's TCHAN_TCFG register.
0902  *
0903  * @tx_chan_type: UDMAP transmit channel functional channel type and work
0904  * passing mechanism configuration to be programmed into the tx_chan_type
0905  * field of the channel's TCHAN_TCFG register.
0906  *
0907  * @tx_supr_tdpkt: UDMAP transmit channel teardown packet generation suppression
0908  * configuration to be programmed into the tx_supr_tdpkt field of the channel's
0909  * TCHAN_TCFG register.
0910  *
0911  * @tx_fetch_size: UDMAP transmit channel number of 32-bit descriptor words to
0912  * fetch configuration to be programmed into the tx_fetch_size field of the
0913  * channel's TCHAN_TCFG register.  The user must make sure to set the maximum
0914  * word count that can pass through the channel for any allowed descriptor type.
0915  *
0916  * @tx_credit_count: UDMAP transmit channel transfer request credit count
0917  * configuration to be programmed into the count field of the TCHAN_TCREDIT
0918  * register.  Specifies how many credits for complete TRs are available.
0919  *
0920  * @txcq_qnum: UDMAP transmit channel completion queue configuration to be
0921  * programmed into the txcq_qnum field of the TCHAN_TCQ register. The specified
0922  * completion queue must be assigned to the host, or a subordinate of the host,
0923  * requesting configuration of the transmit channel.
0924  *
0925  * @tx_priority: UDMAP transmit channel transmit priority value to be programmed
0926  * into the priority field of the channel's TCHAN_TPRI_CTRL register.
0927  *
0928  * @tx_qos: UDMAP transmit channel transmit qos value to be programmed into the
0929  * qos field of the channel's TCHAN_TPRI_CTRL register.
0930  *
0931  * @tx_orderid: UDMAP transmit channel bus order id value to be programmed into
0932  * the orderid field of the channel's TCHAN_TPRI_CTRL register.
0933  *
0934  * @fdepth: UDMAP transmit channel FIFO depth configuration to be programmed
0935  * into the fdepth field of the TCHAN_TFIFO_DEPTH register. Sets the number of
0936  * Tx FIFO bytes which are allowed to be stored for the channel. Check the UDMAP
0937  * section of the TRM for restrictions regarding this parameter.
0938  *
0939  * @tx_sched_priority: UDMAP transmit channel tx scheduling priority
0940  * configuration to be programmed into the priority field of the channel's
0941  * TCHAN_TST_SCHED register.
0942  *
0943  * @tx_burst_size: UDMAP transmit channel burst size configuration to be
0944  * programmed into the tx_burst_size field of the TCHAN_TCFG register.
0945  *
0946  * @tx_tdtype: UDMAP transmit channel teardown type configuration to be
0947  * programmed into the tdtype field of the TCHAN_TCFG register:
0948  * 0 - Return immediately
0949  * 1 - Wait for completion message from remote peer
0950  *
0951  * @extended_ch_type: Valid for BCDMA.
0952  * 0 - the channel is split tx channel (tchan)
0953  * 1 - the channel is block copy channel (bchan)
0954  */
0955 struct ti_sci_msg_rm_udmap_tx_ch_cfg_req {
0956     struct ti_sci_msg_hdr hdr;
0957     u32 valid_params;
0958     u16 nav_id;
0959     u16 index;
0960     u8 tx_pause_on_err;
0961     u8 tx_filt_einfo;
0962     u8 tx_filt_pswords;
0963     u8 tx_atype;
0964     u8 tx_chan_type;
0965     u8 tx_supr_tdpkt;
0966     u16 tx_fetch_size;
0967     u8 tx_credit_count;
0968     u16 txcq_qnum;
0969     u8 tx_priority;
0970     u8 tx_qos;
0971     u8 tx_orderid;
0972     u16 fdepth;
0973     u8 tx_sched_priority;
0974     u8 tx_burst_size;
0975     u8 tx_tdtype;
0976     u8 extended_ch_type;
0977 } __packed;
0978 
0979 /**
0980  * Configures a Navigator Subsystem UDMAP receive channel
0981  *
0982  * Configures the non-real-time registers of a Navigator Subsystem UDMAP
0983  * receive channel.  The channel index must be assigned to the host defined
0984  * in the TISCI header via the RM board configuration resource assignment
0985  * range list.
0986  *
0987  * @hdr: Generic Header
0988  *
0989  * @valid_params: Bitfield defining validity of rx channel configuration
0990  * parameters.
0991  * The rx channel configuration fields are not valid, and will not be used for
0992  * ch configuration, if their corresponding valid bit is zero.
0993  * Valid bit usage:
0994  *    0 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_pause_on_err
0995  *    1 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_atype
0996  *    2 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_chan_type
0997  *    3 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_fetch_size
0998  *    4 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rxcq_qnum
0999  *    5 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_priority
1000  *    6 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_qos
1001  *    7 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_orderid
1002  *    8 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_sched_priority
1003  *    9 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_start
1004  *   10 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_cnt
1005  *   11 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_short
1006  *   12 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_long
1007  *   14 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_burst_size
1008  *
1009  * @nav_id: SoC device ID of Navigator Subsystem where rx channel is located
1010  *
1011  * @index: UDMAP receive channel index.
1012  *
1013  * @rx_fetch_size: UDMAP receive channel number of 32-bit descriptor words to
1014  * fetch configuration to be programmed into the rx_fetch_size field of the
1015  * channel's RCHAN_RCFG register.
1016  *
1017  * @rxcq_qnum: UDMAP receive channel completion queue configuration to be
1018  * programmed into the rxcq_qnum field of the RCHAN_RCQ register.
1019  * The specified completion queue must be assigned to the host, or a subordinate
1020  * of the host, requesting configuration of the receive channel.
1021  *
1022  * @rx_priority: UDMAP receive channel receive priority value to be programmed
1023  * into the priority field of the channel's RCHAN_RPRI_CTRL register.
1024  *
1025  * @rx_qos: UDMAP receive channel receive qos value to be programmed into the
1026  * qos field of the channel's RCHAN_RPRI_CTRL register.
1027  *
1028  * @rx_orderid: UDMAP receive channel bus order id value to be programmed into
1029  * the orderid field of the channel's RCHAN_RPRI_CTRL register.
1030  *
1031  * @rx_sched_priority: UDMAP receive channel rx scheduling priority
1032  * configuration to be programmed into the priority field of the channel's
1033  * RCHAN_RST_SCHED register.
1034  *
1035  * @flowid_start: UDMAP receive channel additional flows starting index
1036  * configuration to program into the flow_start field of the RCHAN_RFLOW_RNG
1037  * register. Specifies the starting index for flow IDs the receive channel is to
1038  * make use of beyond the default flow. flowid_start and @ref flowid_cnt must be
1039  * set as valid and configured together. The starting flow ID set by
1040  * @ref flowid_cnt must be a flow index within the Navigator Subsystem's subset
1041  * of flows beyond the default flows statically mapped to receive channels.
1042  * The additional flows must be assigned to the host, or a subordinate of the
1043  * host, requesting configuration of the receive channel.
1044  *
1045  * @flowid_cnt: UDMAP receive channel additional flows count configuration to
1046  * program into the flowid_cnt field of the RCHAN_RFLOW_RNG register.
1047  * This field specifies how many flow IDs are in the additional contiguous range
1048  * of legal flow IDs for the channel.  @ref flowid_start and flowid_cnt must be
1049  * set as valid and configured together. Disabling the valid_params field bit
1050  * for flowid_cnt indicates no flow IDs other than the default are to be
1051  * allocated and used by the receive channel. @ref flowid_start plus flowid_cnt
1052  * cannot be greater than the number of receive flows in the receive channel's
1053  * Navigator Subsystem.  The additional flows must be assigned to the host, or a
1054  * subordinate of the host, requesting configuration of the receive channel.
1055  *
1056  * @rx_pause_on_err: UDMAP receive channel pause on error configuration to be
1057  * programmed into the rx_pause_on_err field of the channel's RCHAN_RCFG
1058  * register.
1059  *
1060  * @rx_atype: UDMAP receive channel non Ring Accelerator access pointer
1061  * interpretation configuration to be programmed into the rx_atype field of the
1062  * channel's RCHAN_RCFG register.
1063  *
1064  * @rx_chan_type: UDMAP receive channel functional channel type and work passing
1065  * mechanism configuration to be programmed into the rx_chan_type field of the
1066  * channel's RCHAN_RCFG register.
1067  *
1068  * @rx_ignore_short: UDMAP receive channel short packet treatment configuration
1069  * to be programmed into the rx_ignore_short field of the RCHAN_RCFG register.
1070  *
1071  * @rx_ignore_long: UDMAP receive channel long packet treatment configuration to
1072  * be programmed into the rx_ignore_long field of the RCHAN_RCFG register.
1073  *
1074  * @rx_burst_size: UDMAP receive channel burst size configuration to be
1075  * programmed into the rx_burst_size field of the RCHAN_RCFG register.
1076  */
1077 struct ti_sci_msg_rm_udmap_rx_ch_cfg_req {
1078     struct ti_sci_msg_hdr hdr;
1079     u32 valid_params;
1080     u16 nav_id;
1081     u16 index;
1082     u16 rx_fetch_size;
1083     u16 rxcq_qnum;
1084     u8 rx_priority;
1085     u8 rx_qos;
1086     u8 rx_orderid;
1087     u8 rx_sched_priority;
1088     u16 flowid_start;
1089     u16 flowid_cnt;
1090     u8 rx_pause_on_err;
1091     u8 rx_atype;
1092     u8 rx_chan_type;
1093     u8 rx_ignore_short;
1094     u8 rx_ignore_long;
1095     u8 rx_burst_size;
1096 } __packed;
1097 
1098 /**
1099  * Configures a Navigator Subsystem UDMAP receive flow
1100  *
1101  * Configures a Navigator Subsystem UDMAP receive flow's registers.
1102  * Configuration does not include the flow registers which handle size-based
1103  * free descriptor queue routing.
1104  *
1105  * The flow index must be assigned to the host defined in the TISCI header via
1106  * the RM board configuration resource assignment range list.
1107  *
1108  * @hdr: Standard TISCI header
1109  *
1110  * @valid_params
1111  * Bitfield defining validity of rx flow configuration parameters.  The
1112  * rx flow configuration fields are not valid, and will not be used for flow
1113  * configuration, if their corresponding valid bit is zero.  Valid bit usage:
1114  *     0 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_einfo_present
1115  *     1 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_psinfo_present
1116  *     2 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_error_handling
1117  *     3 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_desc_type
1118  *     4 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_sop_offset
1119  *     5 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_qnum
1120  *     6 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi
1121  *     7 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo
1122  *     8 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi
1123  *     9 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo
1124  *    10 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi_sel
1125  *    11 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo_sel
1126  *    12 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi_sel
1127  *    13 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo_sel
1128  *    14 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq0_sz0_qnum
1129  *    15 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq1_sz0_qnum
1130  *    16 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq2_sz0_qnum
1131  *    17 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq3_sz0_qnum
1132  *    18 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_ps_location
1133  *
1134  * @nav_id: SoC device ID of Navigator Subsystem from which the receive flow is
1135  * allocated
1136  *
1137  * @flow_index: UDMAP receive flow index for non-optional configuration.
1138  *
1139  * @rx_einfo_present:
1140  * UDMAP receive flow extended packet info present configuration to be
1141  * programmed into the rx_einfo_present field of the flow's RFLOW_RFA register.
1142  *
1143  * @rx_psinfo_present:
1144  * UDMAP receive flow PS words present configuration to be programmed into the
1145  * rx_psinfo_present field of the flow's RFLOW_RFA register.
1146  *
1147  * @rx_error_handling:
1148  * UDMAP receive flow error handling configuration to be programmed into the
1149  * rx_error_handling field of the flow's RFLOW_RFA register.
1150  *
1151  * @rx_desc_type:
1152  * UDMAP receive flow descriptor type configuration to be programmed into the
1153  * rx_desc_type field field of the flow's RFLOW_RFA register.
1154  *
1155  * @rx_sop_offset:
1156  * UDMAP receive flow start of packet offset configuration to be programmed
1157  * into the rx_sop_offset field of the RFLOW_RFA register.  See the UDMAP
1158  * section of the TRM for more information on this setting.  Valid values for
1159  * this field are 0-255 bytes.
1160  *
1161  * @rx_dest_qnum:
1162  * UDMAP receive flow destination queue configuration to be programmed into the
1163  * rx_dest_qnum field of the flow's RFLOW_RFA register.  The specified
1164  * destination queue must be valid within the Navigator Subsystem and must be
1165  * owned by the host, or a subordinate of the host, requesting allocation and
1166  * configuration of the receive flow.
1167  *
1168  * @rx_src_tag_hi:
1169  * UDMAP receive flow source tag high byte constant configuration to be
1170  * programmed into the rx_src_tag_hi field of the flow's RFLOW_RFB register.
1171  * See the UDMAP section of the TRM for more information on this setting.
1172  *
1173  * @rx_src_tag_lo:
1174  * UDMAP receive flow source tag low byte constant configuration to be
1175  * programmed into the rx_src_tag_lo field of the flow's RFLOW_RFB register.
1176  * See the UDMAP section of the TRM for more information on this setting.
1177  *
1178  * @rx_dest_tag_hi:
1179  * UDMAP receive flow destination tag high byte constant configuration to be
1180  * programmed into the rx_dest_tag_hi field of the flow's RFLOW_RFB register.
1181  * See the UDMAP section of the TRM for more information on this setting.
1182  *
1183  * @rx_dest_tag_lo:
1184  * UDMAP receive flow destination tag low byte constant configuration to be
1185  * programmed into the rx_dest_tag_lo field of the flow's RFLOW_RFB register.
1186  * See the UDMAP section of the TRM for more information on this setting.
1187  *
1188  * @rx_src_tag_hi_sel:
1189  * UDMAP receive flow source tag high byte selector configuration to be
1190  * programmed into the rx_src_tag_hi_sel field of the RFLOW_RFC register.  See
1191  * the UDMAP section of the TRM for more information on this setting.
1192  *
1193  * @rx_src_tag_lo_sel:
1194  * UDMAP receive flow source tag low byte selector configuration to be
1195  * programmed into the rx_src_tag_lo_sel field of the RFLOW_RFC register.  See
1196  * the UDMAP section of the TRM for more information on this setting.
1197  *
1198  * @rx_dest_tag_hi_sel:
1199  * UDMAP receive flow destination tag high byte selector configuration to be
1200  * programmed into the rx_dest_tag_hi_sel field of the RFLOW_RFC register.  See
1201  * the UDMAP section of the TRM for more information on this setting.
1202  *
1203  * @rx_dest_tag_lo_sel:
1204  * UDMAP receive flow destination tag low byte selector configuration to be
1205  * programmed into the rx_dest_tag_lo_sel field of the RFLOW_RFC register.  See
1206  * the UDMAP section of the TRM for more information on this setting.
1207  *
1208  * @rx_fdq0_sz0_qnum:
1209  * UDMAP receive flow free descriptor queue 0 configuration to be programmed
1210  * into the rx_fdq0_sz0_qnum field of the flow's RFLOW_RFD register.  See the
1211  * UDMAP section of the TRM for more information on this setting. The specified
1212  * free queue must be valid within the Navigator Subsystem and must be owned
1213  * by the host, or a subordinate of the host, requesting allocation and
1214  * configuration of the receive flow.
1215  *
1216  * @rx_fdq1_qnum:
1217  * UDMAP receive flow free descriptor queue 1 configuration to be programmed
1218  * into the rx_fdq1_qnum field of the flow's RFLOW_RFD register.  See the
1219  * UDMAP section of the TRM for more information on this setting.  The specified
1220  * free queue must be valid within the Navigator Subsystem and must be owned
1221  * by the host, or a subordinate of the host, requesting allocation and
1222  * configuration of the receive flow.
1223  *
1224  * @rx_fdq2_qnum:
1225  * UDMAP receive flow free descriptor queue 2 configuration to be programmed
1226  * into the rx_fdq2_qnum field of the flow's RFLOW_RFE register.  See the
1227  * UDMAP section of the TRM for more information on this setting.  The specified
1228  * free queue must be valid within the Navigator Subsystem and must be owned
1229  * by the host, or a subordinate of the host, requesting allocation and
1230  * configuration of the receive flow.
1231  *
1232  * @rx_fdq3_qnum:
1233  * UDMAP receive flow free descriptor queue 3 configuration to be programmed
1234  * into the rx_fdq3_qnum field of the flow's RFLOW_RFE register.  See the
1235  * UDMAP section of the TRM for more information on this setting.  The specified
1236  * free queue must be valid within the Navigator Subsystem and must be owned
1237  * by the host, or a subordinate of the host, requesting allocation and
1238  * configuration of the receive flow.
1239  *
1240  * @rx_ps_location:
1241  * UDMAP receive flow PS words location configuration to be programmed into the
1242  * rx_ps_location field of the flow's RFLOW_RFA register.
1243  */
1244 struct ti_sci_msg_rm_udmap_flow_cfg_req {
1245     struct ti_sci_msg_hdr hdr;
1246     u32 valid_params;
1247     u16 nav_id;
1248     u16 flow_index;
1249     u8 rx_einfo_present;
1250     u8 rx_psinfo_present;
1251     u8 rx_error_handling;
1252     u8 rx_desc_type;
1253     u16 rx_sop_offset;
1254     u16 rx_dest_qnum;
1255     u8 rx_src_tag_hi;
1256     u8 rx_src_tag_lo;
1257     u8 rx_dest_tag_hi;
1258     u8 rx_dest_tag_lo;
1259     u8 rx_src_tag_hi_sel;
1260     u8 rx_src_tag_lo_sel;
1261     u8 rx_dest_tag_hi_sel;
1262     u8 rx_dest_tag_lo_sel;
1263     u16 rx_fdq0_sz0_qnum;
1264     u16 rx_fdq1_qnum;
1265     u16 rx_fdq2_qnum;
1266     u16 rx_fdq3_qnum;
1267     u8 rx_ps_location;
1268 } __packed;
1269 
1270 /**
1271  * struct ti_sci_msg_req_proc_request - Request a processor
1272  * @hdr:        Generic Header
1273  * @processor_id:   ID of processor being requested
1274  *
1275  * Request type is TI_SCI_MSG_PROC_REQUEST, response is a generic ACK/NACK
1276  * message.
1277  */
1278 struct ti_sci_msg_req_proc_request {
1279     struct ti_sci_msg_hdr hdr;
1280     u8 processor_id;
1281 } __packed;
1282 
1283 /**
1284  * struct ti_sci_msg_req_proc_release - Release a processor
1285  * @hdr:        Generic Header
1286  * @processor_id:   ID of processor being released
1287  *
1288  * Request type is TI_SCI_MSG_PROC_RELEASE, response is a generic ACK/NACK
1289  * message.
1290  */
1291 struct ti_sci_msg_req_proc_release {
1292     struct ti_sci_msg_hdr hdr;
1293     u8 processor_id;
1294 } __packed;
1295 
1296 /**
1297  * struct ti_sci_msg_req_proc_handover - Handover a processor to a host
1298  * @hdr:        Generic Header
1299  * @processor_id:   ID of processor being handed over
1300  * @host_id:        Host ID the control needs to be transferred to
1301  *
1302  * Request type is TI_SCI_MSG_PROC_HANDOVER, response is a generic ACK/NACK
1303  * message.
1304  */
1305 struct ti_sci_msg_req_proc_handover {
1306     struct ti_sci_msg_hdr hdr;
1307     u8 processor_id;
1308     u8 host_id;
1309 } __packed;
1310 
1311 /* Boot Vector masks */
1312 #define TI_SCI_ADDR_LOW_MASK            GENMASK_ULL(31, 0)
1313 #define TI_SCI_ADDR_HIGH_MASK           GENMASK_ULL(63, 32)
1314 #define TI_SCI_ADDR_HIGH_SHIFT          32
1315 
1316 /**
1317  * struct ti_sci_msg_req_set_config - Set Processor boot configuration
1318  * @hdr:        Generic Header
1319  * @processor_id:   ID of processor being configured
1320  * @bootvector_low: Lower 32 bit address (Little Endian) of boot vector
1321  * @bootvector_high:    Higher 32 bit address (Little Endian) of boot vector
1322  * @config_flags_set:   Optional Processor specific Config Flags to set.
1323  *          Setting a bit here implies the corresponding mode
1324  *          will be set
1325  * @config_flags_clear: Optional Processor specific Config Flags to clear.
1326  *          Setting a bit here implies the corresponding mode
1327  *          will be cleared
1328  *
1329  * Request type is TI_SCI_MSG_PROC_HANDOVER, response is a generic ACK/NACK
1330  * message.
1331  */
1332 struct ti_sci_msg_req_set_config {
1333     struct ti_sci_msg_hdr hdr;
1334     u8 processor_id;
1335     u32 bootvector_low;
1336     u32 bootvector_high;
1337     u32 config_flags_set;
1338     u32 config_flags_clear;
1339 } __packed;
1340 
1341 /**
1342  * struct ti_sci_msg_req_set_ctrl - Set Processor boot control flags
1343  * @hdr:        Generic Header
1344  * @processor_id:   ID of processor being configured
1345  * @control_flags_set:  Optional Processor specific Control Flags to set.
1346  *          Setting a bit here implies the corresponding mode
1347  *          will be set
1348  * @control_flags_clear:Optional Processor specific Control Flags to clear.
1349  *          Setting a bit here implies the corresponding mode
1350  *          will be cleared
1351  *
1352  * Request type is TI_SCI_MSG_SET_CTRL, response is a generic ACK/NACK
1353  * message.
1354  */
1355 struct ti_sci_msg_req_set_ctrl {
1356     struct ti_sci_msg_hdr hdr;
1357     u8 processor_id;
1358     u32 control_flags_set;
1359     u32 control_flags_clear;
1360 } __packed;
1361 
1362 /**
1363  * struct ti_sci_msg_req_get_status - Processor boot status request
1364  * @hdr:        Generic Header
1365  * @processor_id:   ID of processor whose status is being requested
1366  *
1367  * Request type is TI_SCI_MSG_GET_STATUS, response is an appropriate
1368  * message, or NACK in case of inability to satisfy request.
1369  */
1370 struct ti_sci_msg_req_get_status {
1371     struct ti_sci_msg_hdr hdr;
1372     u8 processor_id;
1373 } __packed;
1374 
1375 /**
1376  * struct ti_sci_msg_resp_get_status - Processor boot status response
1377  * @hdr:        Generic Header
1378  * @processor_id:   ID of processor whose status is returned
1379  * @bootvector_low: Lower 32 bit address (Little Endian) of boot vector
1380  * @bootvector_high:    Higher 32 bit address (Little Endian) of boot vector
1381  * @config_flags:   Optional Processor specific Config Flags set currently
1382  * @control_flags:  Optional Processor specific Control Flags set currently
1383  * @status_flags:   Optional Processor specific Status Flags set currently
1384  *
1385  * Response structure to a TI_SCI_MSG_GET_STATUS request.
1386  */
1387 struct ti_sci_msg_resp_get_status {
1388     struct ti_sci_msg_hdr hdr;
1389     u8 processor_id;
1390     u32 bootvector_low;
1391     u32 bootvector_high;
1392     u32 config_flags;
1393     u32 control_flags;
1394     u32 status_flags;
1395 } __packed;
1396 
1397 #endif /* __TI_SCI_H */