18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: BSD-3-Clause */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Texas Instruments System Control Interface (TISCI) Protocol 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Communication protocol with TI SCI hardware 68c2ecf20Sopenharmony_ci * The system works in a message response protocol 78c2ecf20Sopenharmony_ci * See: http://processors.wiki.ti.com/index.php/TISCI for details 88c2ecf20Sopenharmony_ci * 98c2ecf20Sopenharmony_ci * Copyright (C) 2015-2016 Texas Instruments Incorporated - https://www.ti.com/ 108c2ecf20Sopenharmony_ci */ 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#ifndef __TI_SCI_H 138c2ecf20Sopenharmony_ci#define __TI_SCI_H 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci/* Generic Messages */ 168c2ecf20Sopenharmony_ci#define TI_SCI_MSG_ENABLE_WDT 0x0000 178c2ecf20Sopenharmony_ci#define TI_SCI_MSG_WAKE_RESET 0x0001 188c2ecf20Sopenharmony_ci#define TI_SCI_MSG_VERSION 0x0002 198c2ecf20Sopenharmony_ci#define TI_SCI_MSG_WAKE_REASON 0x0003 208c2ecf20Sopenharmony_ci#define TI_SCI_MSG_GOODBYE 0x0004 218c2ecf20Sopenharmony_ci#define TI_SCI_MSG_SYS_RESET 0x0005 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci/* Device requests */ 248c2ecf20Sopenharmony_ci#define TI_SCI_MSG_SET_DEVICE_STATE 0x0200 258c2ecf20Sopenharmony_ci#define TI_SCI_MSG_GET_DEVICE_STATE 0x0201 268c2ecf20Sopenharmony_ci#define TI_SCI_MSG_SET_DEVICE_RESETS 0x0202 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci/* Clock requests */ 298c2ecf20Sopenharmony_ci#define TI_SCI_MSG_SET_CLOCK_STATE 0x0100 308c2ecf20Sopenharmony_ci#define TI_SCI_MSG_GET_CLOCK_STATE 0x0101 318c2ecf20Sopenharmony_ci#define TI_SCI_MSG_SET_CLOCK_PARENT 0x0102 328c2ecf20Sopenharmony_ci#define TI_SCI_MSG_GET_CLOCK_PARENT 0x0103 338c2ecf20Sopenharmony_ci#define TI_SCI_MSG_GET_NUM_CLOCK_PARENTS 0x0104 348c2ecf20Sopenharmony_ci#define TI_SCI_MSG_SET_CLOCK_FREQ 0x010c 358c2ecf20Sopenharmony_ci#define TI_SCI_MSG_QUERY_CLOCK_FREQ 0x010d 368c2ecf20Sopenharmony_ci#define TI_SCI_MSG_GET_CLOCK_FREQ 0x010e 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ci/* Resource Management Requests */ 398c2ecf20Sopenharmony_ci#define TI_SCI_MSG_GET_RESOURCE_RANGE 0x1500 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci/* IRQ requests */ 428c2ecf20Sopenharmony_ci#define TI_SCI_MSG_SET_IRQ 0x1000 438c2ecf20Sopenharmony_ci#define TI_SCI_MSG_FREE_IRQ 0x1001 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ci/* NAVSS resource management */ 468c2ecf20Sopenharmony_ci/* Ringacc requests */ 478c2ecf20Sopenharmony_ci#define TI_SCI_MSG_RM_RING_ALLOCATE 0x1100 488c2ecf20Sopenharmony_ci#define TI_SCI_MSG_RM_RING_FREE 0x1101 498c2ecf20Sopenharmony_ci#define TI_SCI_MSG_RM_RING_RECONFIG 0x1102 508c2ecf20Sopenharmony_ci#define TI_SCI_MSG_RM_RING_RESET 0x1103 518c2ecf20Sopenharmony_ci#define TI_SCI_MSG_RM_RING_CFG 0x1110 528c2ecf20Sopenharmony_ci#define TI_SCI_MSG_RM_RING_GET_CFG 0x1111 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_ci/* PSI-L requests */ 558c2ecf20Sopenharmony_ci#define TI_SCI_MSG_RM_PSIL_PAIR 0x1280 568c2ecf20Sopenharmony_ci#define TI_SCI_MSG_RM_PSIL_UNPAIR 0x1281 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci#define TI_SCI_MSG_RM_UDMAP_TX_ALLOC 0x1200 598c2ecf20Sopenharmony_ci#define TI_SCI_MSG_RM_UDMAP_TX_FREE 0x1201 608c2ecf20Sopenharmony_ci#define TI_SCI_MSG_RM_UDMAP_RX_ALLOC 0x1210 618c2ecf20Sopenharmony_ci#define TI_SCI_MSG_RM_UDMAP_RX_FREE 0x1211 628c2ecf20Sopenharmony_ci#define TI_SCI_MSG_RM_UDMAP_FLOW_CFG 0x1220 638c2ecf20Sopenharmony_ci#define TI_SCI_MSG_RM_UDMAP_OPT_FLOW_CFG 0x1221 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ci#define TISCI_MSG_RM_UDMAP_TX_CH_CFG 0x1205 668c2ecf20Sopenharmony_ci#define TISCI_MSG_RM_UDMAP_TX_CH_GET_CFG 0x1206 678c2ecf20Sopenharmony_ci#define TISCI_MSG_RM_UDMAP_RX_CH_CFG 0x1215 688c2ecf20Sopenharmony_ci#define TISCI_MSG_RM_UDMAP_RX_CH_GET_CFG 0x1216 698c2ecf20Sopenharmony_ci#define TISCI_MSG_RM_UDMAP_FLOW_CFG 0x1230 708c2ecf20Sopenharmony_ci#define TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_CFG 0x1231 718c2ecf20Sopenharmony_ci#define TISCI_MSG_RM_UDMAP_FLOW_GET_CFG 0x1232 728c2ecf20Sopenharmony_ci#define TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_GET_CFG 0x1233 738c2ecf20Sopenharmony_ci 748c2ecf20Sopenharmony_ci/* Processor Control requests */ 758c2ecf20Sopenharmony_ci#define TI_SCI_MSG_PROC_REQUEST 0xc000 768c2ecf20Sopenharmony_ci#define TI_SCI_MSG_PROC_RELEASE 0xc001 778c2ecf20Sopenharmony_ci#define TI_SCI_MSG_PROC_HANDOVER 0xc005 788c2ecf20Sopenharmony_ci#define TI_SCI_MSG_SET_CONFIG 0xc100 798c2ecf20Sopenharmony_ci#define TI_SCI_MSG_SET_CTRL 0xc101 808c2ecf20Sopenharmony_ci#define TI_SCI_MSG_GET_STATUS 0xc400 818c2ecf20Sopenharmony_ci 828c2ecf20Sopenharmony_ci/** 838c2ecf20Sopenharmony_ci * struct ti_sci_msg_hdr - Generic Message Header for All messages and responses 848c2ecf20Sopenharmony_ci * @type: Type of messages: One of TI_SCI_MSG* values 858c2ecf20Sopenharmony_ci * @host: Host of the message 868c2ecf20Sopenharmony_ci * @seq: Message identifier indicating a transfer sequence 878c2ecf20Sopenharmony_ci * @flags: Flag for the message 888c2ecf20Sopenharmony_ci */ 898c2ecf20Sopenharmony_cistruct ti_sci_msg_hdr { 908c2ecf20Sopenharmony_ci u16 type; 918c2ecf20Sopenharmony_ci u8 host; 928c2ecf20Sopenharmony_ci u8 seq; 938c2ecf20Sopenharmony_ci#define TI_SCI_MSG_FLAG(val) (1 << (val)) 948c2ecf20Sopenharmony_ci#define TI_SCI_FLAG_REQ_GENERIC_NORESPONSE 0x0 958c2ecf20Sopenharmony_ci#define TI_SCI_FLAG_REQ_ACK_ON_RECEIVED TI_SCI_MSG_FLAG(0) 968c2ecf20Sopenharmony_ci#define TI_SCI_FLAG_REQ_ACK_ON_PROCESSED TI_SCI_MSG_FLAG(1) 978c2ecf20Sopenharmony_ci#define TI_SCI_FLAG_RESP_GENERIC_NACK 0x0 988c2ecf20Sopenharmony_ci#define TI_SCI_FLAG_RESP_GENERIC_ACK TI_SCI_MSG_FLAG(1) 998c2ecf20Sopenharmony_ci /* Additional Flags */ 1008c2ecf20Sopenharmony_ci u32 flags; 1018c2ecf20Sopenharmony_ci} __packed; 1028c2ecf20Sopenharmony_ci 1038c2ecf20Sopenharmony_ci/** 1048c2ecf20Sopenharmony_ci * struct ti_sci_msg_resp_version - Response for a message 1058c2ecf20Sopenharmony_ci * @hdr: Generic header 1068c2ecf20Sopenharmony_ci * @firmware_description: String describing the firmware 1078c2ecf20Sopenharmony_ci * @firmware_revision: Firmware revision 1088c2ecf20Sopenharmony_ci * @abi_major: Major version of the ABI that firmware supports 1098c2ecf20Sopenharmony_ci * @abi_minor: Minor version of the ABI that firmware supports 1108c2ecf20Sopenharmony_ci * 1118c2ecf20Sopenharmony_ci * In general, ABI version changes follow the rule that minor version increments 1128c2ecf20Sopenharmony_ci * are backward compatible. Major revision changes in ABI may not be 1138c2ecf20Sopenharmony_ci * backward compatible. 1148c2ecf20Sopenharmony_ci * 1158c2ecf20Sopenharmony_ci * Response to a generic message with message type TI_SCI_MSG_VERSION 1168c2ecf20Sopenharmony_ci */ 1178c2ecf20Sopenharmony_cistruct ti_sci_msg_resp_version { 1188c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 1198c2ecf20Sopenharmony_ci char firmware_description[32]; 1208c2ecf20Sopenharmony_ci u16 firmware_revision; 1218c2ecf20Sopenharmony_ci u8 abi_major; 1228c2ecf20Sopenharmony_ci u8 abi_minor; 1238c2ecf20Sopenharmony_ci} __packed; 1248c2ecf20Sopenharmony_ci 1258c2ecf20Sopenharmony_ci/** 1268c2ecf20Sopenharmony_ci * struct ti_sci_msg_req_reboot - Reboot the SoC 1278c2ecf20Sopenharmony_ci * @hdr: Generic Header 1288c2ecf20Sopenharmony_ci * 1298c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_SYS_RESET, responded with a generic 1308c2ecf20Sopenharmony_ci * ACK/NACK message. 1318c2ecf20Sopenharmony_ci */ 1328c2ecf20Sopenharmony_cistruct ti_sci_msg_req_reboot { 1338c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 1348c2ecf20Sopenharmony_ci} __packed; 1358c2ecf20Sopenharmony_ci 1368c2ecf20Sopenharmony_ci/** 1378c2ecf20Sopenharmony_ci * struct ti_sci_msg_req_set_device_state - Set the desired state of the device 1388c2ecf20Sopenharmony_ci * @hdr: Generic header 1398c2ecf20Sopenharmony_ci * @id: Indicates which device to modify 1408c2ecf20Sopenharmony_ci * @reserved: Reserved space in message, must be 0 for backward compatibility 1418c2ecf20Sopenharmony_ci * @state: The desired state of the device. 1428c2ecf20Sopenharmony_ci * 1438c2ecf20Sopenharmony_ci * Certain flags can also be set to alter the device state: 1448c2ecf20Sopenharmony_ci * + MSG_FLAG_DEVICE_WAKE_ENABLED - Configure the device to be a wake source. 1458c2ecf20Sopenharmony_ci * The meaning of this flag will vary slightly from device to device and from 1468c2ecf20Sopenharmony_ci * SoC to SoC but it generally allows the device to wake the SoC out of deep 1478c2ecf20Sopenharmony_ci * suspend states. 1488c2ecf20Sopenharmony_ci * + MSG_FLAG_DEVICE_RESET_ISO - Enable reset isolation for this device. 1498c2ecf20Sopenharmony_ci * + MSG_FLAG_DEVICE_EXCLUSIVE - Claim this device exclusively. When passed 1508c2ecf20Sopenharmony_ci * with STATE_RETENTION or STATE_ON, it will claim the device exclusively. 1518c2ecf20Sopenharmony_ci * If another host already has this device set to STATE_RETENTION or STATE_ON, 1528c2ecf20Sopenharmony_ci * the message will fail. Once successful, other hosts attempting to set 1538c2ecf20Sopenharmony_ci * STATE_RETENTION or STATE_ON will fail. 1548c2ecf20Sopenharmony_ci * 1558c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_SET_DEVICE_STATE, responded with a generic 1568c2ecf20Sopenharmony_ci * ACK/NACK message. 1578c2ecf20Sopenharmony_ci */ 1588c2ecf20Sopenharmony_cistruct ti_sci_msg_req_set_device_state { 1598c2ecf20Sopenharmony_ci /* Additional hdr->flags options */ 1608c2ecf20Sopenharmony_ci#define MSG_FLAG_DEVICE_WAKE_ENABLED TI_SCI_MSG_FLAG(8) 1618c2ecf20Sopenharmony_ci#define MSG_FLAG_DEVICE_RESET_ISO TI_SCI_MSG_FLAG(9) 1628c2ecf20Sopenharmony_ci#define MSG_FLAG_DEVICE_EXCLUSIVE TI_SCI_MSG_FLAG(10) 1638c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 1648c2ecf20Sopenharmony_ci u32 id; 1658c2ecf20Sopenharmony_ci u32 reserved; 1668c2ecf20Sopenharmony_ci 1678c2ecf20Sopenharmony_ci#define MSG_DEVICE_SW_STATE_AUTO_OFF 0 1688c2ecf20Sopenharmony_ci#define MSG_DEVICE_SW_STATE_RETENTION 1 1698c2ecf20Sopenharmony_ci#define MSG_DEVICE_SW_STATE_ON 2 1708c2ecf20Sopenharmony_ci u8 state; 1718c2ecf20Sopenharmony_ci} __packed; 1728c2ecf20Sopenharmony_ci 1738c2ecf20Sopenharmony_ci/** 1748c2ecf20Sopenharmony_ci * struct ti_sci_msg_req_get_device_state - Request to get device. 1758c2ecf20Sopenharmony_ci * @hdr: Generic header 1768c2ecf20Sopenharmony_ci * @id: Device Identifier 1778c2ecf20Sopenharmony_ci * 1788c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_GET_DEVICE_STATE, responded device state 1798c2ecf20Sopenharmony_ci * information 1808c2ecf20Sopenharmony_ci */ 1818c2ecf20Sopenharmony_cistruct ti_sci_msg_req_get_device_state { 1828c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 1838c2ecf20Sopenharmony_ci u32 id; 1848c2ecf20Sopenharmony_ci} __packed; 1858c2ecf20Sopenharmony_ci 1868c2ecf20Sopenharmony_ci/** 1878c2ecf20Sopenharmony_ci * struct ti_sci_msg_resp_get_device_state - Response to get device request. 1888c2ecf20Sopenharmony_ci * @hdr: Generic header 1898c2ecf20Sopenharmony_ci * @context_loss_count: Indicates how many times the device has lost context. A 1908c2ecf20Sopenharmony_ci * driver can use this monotonic counter to determine if the device has 1918c2ecf20Sopenharmony_ci * lost context since the last time this message was exchanged. 1928c2ecf20Sopenharmony_ci * @resets: Programmed state of the reset lines. 1938c2ecf20Sopenharmony_ci * @programmed_state: The state as programmed by set_device. 1948c2ecf20Sopenharmony_ci * - Uses the MSG_DEVICE_SW_* macros 1958c2ecf20Sopenharmony_ci * @current_state: The actual state of the hardware. 1968c2ecf20Sopenharmony_ci * 1978c2ecf20Sopenharmony_ci * Response to request TI_SCI_MSG_GET_DEVICE_STATE. 1988c2ecf20Sopenharmony_ci */ 1998c2ecf20Sopenharmony_cistruct ti_sci_msg_resp_get_device_state { 2008c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 2018c2ecf20Sopenharmony_ci u32 context_loss_count; 2028c2ecf20Sopenharmony_ci u32 resets; 2038c2ecf20Sopenharmony_ci u8 programmed_state; 2048c2ecf20Sopenharmony_ci#define MSG_DEVICE_HW_STATE_OFF 0 2058c2ecf20Sopenharmony_ci#define MSG_DEVICE_HW_STATE_ON 1 2068c2ecf20Sopenharmony_ci#define MSG_DEVICE_HW_STATE_TRANS 2 2078c2ecf20Sopenharmony_ci u8 current_state; 2088c2ecf20Sopenharmony_ci} __packed; 2098c2ecf20Sopenharmony_ci 2108c2ecf20Sopenharmony_ci/** 2118c2ecf20Sopenharmony_ci * struct ti_sci_msg_req_set_device_resets - Set the desired resets 2128c2ecf20Sopenharmony_ci * configuration of the device 2138c2ecf20Sopenharmony_ci * @hdr: Generic header 2148c2ecf20Sopenharmony_ci * @id: Indicates which device to modify 2158c2ecf20Sopenharmony_ci * @resets: A bit field of resets for the device. The meaning, behavior, 2168c2ecf20Sopenharmony_ci * and usage of the reset flags are device specific. 0 for a bit 2178c2ecf20Sopenharmony_ci * indicates releasing the reset represented by that bit while 1 2188c2ecf20Sopenharmony_ci * indicates keeping it held. 2198c2ecf20Sopenharmony_ci * 2208c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_SET_DEVICE_RESETS, responded with a generic 2218c2ecf20Sopenharmony_ci * ACK/NACK message. 2228c2ecf20Sopenharmony_ci */ 2238c2ecf20Sopenharmony_cistruct ti_sci_msg_req_set_device_resets { 2248c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 2258c2ecf20Sopenharmony_ci u32 id; 2268c2ecf20Sopenharmony_ci u32 resets; 2278c2ecf20Sopenharmony_ci} __packed; 2288c2ecf20Sopenharmony_ci 2298c2ecf20Sopenharmony_ci/** 2308c2ecf20Sopenharmony_ci * struct ti_sci_msg_req_set_clock_state - Request to setup a Clock state 2318c2ecf20Sopenharmony_ci * @hdr: Generic Header, Certain flags can be set specific to the clocks: 2328c2ecf20Sopenharmony_ci * MSG_FLAG_CLOCK_ALLOW_SSC: Allow this clock to be modified 2338c2ecf20Sopenharmony_ci * via spread spectrum clocking. 2348c2ecf20Sopenharmony_ci * MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE: Allow this clock's 2358c2ecf20Sopenharmony_ci * frequency to be changed while it is running so long as it 2368c2ecf20Sopenharmony_ci * is within the min/max limits. 2378c2ecf20Sopenharmony_ci * MSG_FLAG_CLOCK_INPUT_TERM: Enable input termination, this 2388c2ecf20Sopenharmony_ci * is only applicable to clock inputs on the SoC pseudo-device. 2398c2ecf20Sopenharmony_ci * @dev_id: Device identifier this request is for 2408c2ecf20Sopenharmony_ci * @clk_id: Clock identifier for the device for this request. 2418c2ecf20Sopenharmony_ci * Each device has it's own set of clock inputs. This indexes 2428c2ecf20Sopenharmony_ci * which clock input to modify. Set to 255 if clock ID is 2438c2ecf20Sopenharmony_ci * greater than or equal to 255. 2448c2ecf20Sopenharmony_ci * @request_state: Request the state for the clock to be set to. 2458c2ecf20Sopenharmony_ci * MSG_CLOCK_SW_STATE_UNREQ: The IP does not require this clock, 2468c2ecf20Sopenharmony_ci * it can be disabled, regardless of the state of the device 2478c2ecf20Sopenharmony_ci * MSG_CLOCK_SW_STATE_AUTO: Allow the System Controller to 2488c2ecf20Sopenharmony_ci * automatically manage the state of this clock. If the device 2498c2ecf20Sopenharmony_ci * is enabled, then the clock is enabled. If the device is set 2508c2ecf20Sopenharmony_ci * to off or retention, then the clock is internally set as not 2518c2ecf20Sopenharmony_ci * being required by the device.(default) 2528c2ecf20Sopenharmony_ci * MSG_CLOCK_SW_STATE_REQ: Configure the clock to be enabled, 2538c2ecf20Sopenharmony_ci * regardless of the state of the device. 2548c2ecf20Sopenharmony_ci * @clk_id_32: Clock identifier for the device for this request. 2558c2ecf20Sopenharmony_ci * Only to be used if the clock ID is greater than or equal to 2568c2ecf20Sopenharmony_ci * 255. 2578c2ecf20Sopenharmony_ci * 2588c2ecf20Sopenharmony_ci * Normally, all required clocks are managed by TISCI entity, this is used 2598c2ecf20Sopenharmony_ci * only for specific control *IF* required. Auto managed state is 2608c2ecf20Sopenharmony_ci * MSG_CLOCK_SW_STATE_AUTO, in other states, TISCI entity assume remote 2618c2ecf20Sopenharmony_ci * will explicitly control. 2628c2ecf20Sopenharmony_ci * 2638c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_SET_CLOCK_STATE, response is a generic 2648c2ecf20Sopenharmony_ci * ACK or NACK message. 2658c2ecf20Sopenharmony_ci */ 2668c2ecf20Sopenharmony_cistruct ti_sci_msg_req_set_clock_state { 2678c2ecf20Sopenharmony_ci /* Additional hdr->flags options */ 2688c2ecf20Sopenharmony_ci#define MSG_FLAG_CLOCK_ALLOW_SSC TI_SCI_MSG_FLAG(8) 2698c2ecf20Sopenharmony_ci#define MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE TI_SCI_MSG_FLAG(9) 2708c2ecf20Sopenharmony_ci#define MSG_FLAG_CLOCK_INPUT_TERM TI_SCI_MSG_FLAG(10) 2718c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 2728c2ecf20Sopenharmony_ci u32 dev_id; 2738c2ecf20Sopenharmony_ci u8 clk_id; 2748c2ecf20Sopenharmony_ci#define MSG_CLOCK_SW_STATE_UNREQ 0 2758c2ecf20Sopenharmony_ci#define MSG_CLOCK_SW_STATE_AUTO 1 2768c2ecf20Sopenharmony_ci#define MSG_CLOCK_SW_STATE_REQ 2 2778c2ecf20Sopenharmony_ci u8 request_state; 2788c2ecf20Sopenharmony_ci u32 clk_id_32; 2798c2ecf20Sopenharmony_ci} __packed; 2808c2ecf20Sopenharmony_ci 2818c2ecf20Sopenharmony_ci/** 2828c2ecf20Sopenharmony_ci * struct ti_sci_msg_req_get_clock_state - Request for clock state 2838c2ecf20Sopenharmony_ci * @hdr: Generic Header 2848c2ecf20Sopenharmony_ci * @dev_id: Device identifier this request is for 2858c2ecf20Sopenharmony_ci * @clk_id: Clock identifier for the device for this request. 2868c2ecf20Sopenharmony_ci * Each device has it's own set of clock inputs. This indexes 2878c2ecf20Sopenharmony_ci * which clock input to get state of. Set to 255 if the clock 2888c2ecf20Sopenharmony_ci * ID is greater than or equal to 255. 2898c2ecf20Sopenharmony_ci * @clk_id_32: Clock identifier for the device for the request. 2908c2ecf20Sopenharmony_ci * Only to be used if the clock ID is greater than or equal to 2918c2ecf20Sopenharmony_ci * 255. 2928c2ecf20Sopenharmony_ci * 2938c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_GET_CLOCK_STATE, response is state 2948c2ecf20Sopenharmony_ci * of the clock 2958c2ecf20Sopenharmony_ci */ 2968c2ecf20Sopenharmony_cistruct ti_sci_msg_req_get_clock_state { 2978c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 2988c2ecf20Sopenharmony_ci u32 dev_id; 2998c2ecf20Sopenharmony_ci u8 clk_id; 3008c2ecf20Sopenharmony_ci u32 clk_id_32; 3018c2ecf20Sopenharmony_ci} __packed; 3028c2ecf20Sopenharmony_ci 3038c2ecf20Sopenharmony_ci/** 3048c2ecf20Sopenharmony_ci * struct ti_sci_msg_resp_get_clock_state - Response to get clock state 3058c2ecf20Sopenharmony_ci * @hdr: Generic Header 3068c2ecf20Sopenharmony_ci * @programmed_state: Any programmed state of the clock. This is one of 3078c2ecf20Sopenharmony_ci * MSG_CLOCK_SW_STATE* values. 3088c2ecf20Sopenharmony_ci * @current_state: Current state of the clock. This is one of: 3098c2ecf20Sopenharmony_ci * MSG_CLOCK_HW_STATE_NOT_READY: Clock is not ready 3108c2ecf20Sopenharmony_ci * MSG_CLOCK_HW_STATE_READY: Clock is ready 3118c2ecf20Sopenharmony_ci * 3128c2ecf20Sopenharmony_ci * Response to TI_SCI_MSG_GET_CLOCK_STATE. 3138c2ecf20Sopenharmony_ci */ 3148c2ecf20Sopenharmony_cistruct ti_sci_msg_resp_get_clock_state { 3158c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 3168c2ecf20Sopenharmony_ci u8 programmed_state; 3178c2ecf20Sopenharmony_ci#define MSG_CLOCK_HW_STATE_NOT_READY 0 3188c2ecf20Sopenharmony_ci#define MSG_CLOCK_HW_STATE_READY 1 3198c2ecf20Sopenharmony_ci u8 current_state; 3208c2ecf20Sopenharmony_ci} __packed; 3218c2ecf20Sopenharmony_ci 3228c2ecf20Sopenharmony_ci/** 3238c2ecf20Sopenharmony_ci * struct ti_sci_msg_req_set_clock_parent - Set the clock parent 3248c2ecf20Sopenharmony_ci * @hdr: Generic Header 3258c2ecf20Sopenharmony_ci * @dev_id: Device identifier this request is for 3268c2ecf20Sopenharmony_ci * @clk_id: Clock identifier for the device for this request. 3278c2ecf20Sopenharmony_ci * Each device has it's own set of clock inputs. This indexes 3288c2ecf20Sopenharmony_ci * which clock input to modify. Set to 255 if clock ID is 3298c2ecf20Sopenharmony_ci * greater than or equal to 255. 3308c2ecf20Sopenharmony_ci * @parent_id: The new clock parent is selectable by an index via this 3318c2ecf20Sopenharmony_ci * parameter. Set to 255 if clock ID is greater than or 3328c2ecf20Sopenharmony_ci * equal to 255. 3338c2ecf20Sopenharmony_ci * @clk_id_32: Clock identifier if @clk_id field is 255. 3348c2ecf20Sopenharmony_ci * @parent_id_32: Parent identifier if @parent_id is 255. 3358c2ecf20Sopenharmony_ci * 3368c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_SET_CLOCK_PARENT, response is generic 3378c2ecf20Sopenharmony_ci * ACK / NACK message. 3388c2ecf20Sopenharmony_ci */ 3398c2ecf20Sopenharmony_cistruct ti_sci_msg_req_set_clock_parent { 3408c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 3418c2ecf20Sopenharmony_ci u32 dev_id; 3428c2ecf20Sopenharmony_ci u8 clk_id; 3438c2ecf20Sopenharmony_ci u8 parent_id; 3448c2ecf20Sopenharmony_ci u32 clk_id_32; 3458c2ecf20Sopenharmony_ci u32 parent_id_32; 3468c2ecf20Sopenharmony_ci} __packed; 3478c2ecf20Sopenharmony_ci 3488c2ecf20Sopenharmony_ci/** 3498c2ecf20Sopenharmony_ci * struct ti_sci_msg_req_get_clock_parent - Get the clock parent 3508c2ecf20Sopenharmony_ci * @hdr: Generic Header 3518c2ecf20Sopenharmony_ci * @dev_id: Device identifier this request is for 3528c2ecf20Sopenharmony_ci * @clk_id: Clock identifier for the device for this request. 3538c2ecf20Sopenharmony_ci * Each device has it's own set of clock inputs. This indexes 3548c2ecf20Sopenharmony_ci * which clock input to get the parent for. If this field 3558c2ecf20Sopenharmony_ci * contains 255, the actual clock identifier is stored in 3568c2ecf20Sopenharmony_ci * @clk_id_32. 3578c2ecf20Sopenharmony_ci * @clk_id_32: Clock identifier if the @clk_id field contains 255. 3588c2ecf20Sopenharmony_ci * 3598c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_GET_CLOCK_PARENT, response is parent information 3608c2ecf20Sopenharmony_ci */ 3618c2ecf20Sopenharmony_cistruct ti_sci_msg_req_get_clock_parent { 3628c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 3638c2ecf20Sopenharmony_ci u32 dev_id; 3648c2ecf20Sopenharmony_ci u8 clk_id; 3658c2ecf20Sopenharmony_ci u32 clk_id_32; 3668c2ecf20Sopenharmony_ci} __packed; 3678c2ecf20Sopenharmony_ci 3688c2ecf20Sopenharmony_ci/** 3698c2ecf20Sopenharmony_ci * struct ti_sci_msg_resp_get_clock_parent - Response with clock parent 3708c2ecf20Sopenharmony_ci * @hdr: Generic Header 3718c2ecf20Sopenharmony_ci * @parent_id: The current clock parent. If set to 255, the current parent 3728c2ecf20Sopenharmony_ci * ID can be found from the @parent_id_32 field. 3738c2ecf20Sopenharmony_ci * @parent_id_32: Current clock parent if @parent_id field is set to 3748c2ecf20Sopenharmony_ci * 255. 3758c2ecf20Sopenharmony_ci * 3768c2ecf20Sopenharmony_ci * Response to TI_SCI_MSG_GET_CLOCK_PARENT. 3778c2ecf20Sopenharmony_ci */ 3788c2ecf20Sopenharmony_cistruct ti_sci_msg_resp_get_clock_parent { 3798c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 3808c2ecf20Sopenharmony_ci u8 parent_id; 3818c2ecf20Sopenharmony_ci u32 parent_id_32; 3828c2ecf20Sopenharmony_ci} __packed; 3838c2ecf20Sopenharmony_ci 3848c2ecf20Sopenharmony_ci/** 3858c2ecf20Sopenharmony_ci * struct ti_sci_msg_req_get_clock_num_parents - Request to get clock parents 3868c2ecf20Sopenharmony_ci * @hdr: Generic header 3878c2ecf20Sopenharmony_ci * @dev_id: Device identifier this request is for 3888c2ecf20Sopenharmony_ci * @clk_id: Clock identifier for the device for this request. Set to 3898c2ecf20Sopenharmony_ci * 255 if clock ID is greater than or equal to 255. 3908c2ecf20Sopenharmony_ci * @clk_id_32: Clock identifier if the @clk_id field contains 255. 3918c2ecf20Sopenharmony_ci * 3928c2ecf20Sopenharmony_ci * This request provides information about how many clock parent options 3938c2ecf20Sopenharmony_ci * are available for a given clock to a device. This is typically used 3948c2ecf20Sopenharmony_ci * for input clocks. 3958c2ecf20Sopenharmony_ci * 3968c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_GET_NUM_CLOCK_PARENTS, response is appropriate 3978c2ecf20Sopenharmony_ci * message, or NACK in case of inability to satisfy request. 3988c2ecf20Sopenharmony_ci */ 3998c2ecf20Sopenharmony_cistruct ti_sci_msg_req_get_clock_num_parents { 4008c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 4018c2ecf20Sopenharmony_ci u32 dev_id; 4028c2ecf20Sopenharmony_ci u8 clk_id; 4038c2ecf20Sopenharmony_ci u32 clk_id_32; 4048c2ecf20Sopenharmony_ci} __packed; 4058c2ecf20Sopenharmony_ci 4068c2ecf20Sopenharmony_ci/** 4078c2ecf20Sopenharmony_ci * struct ti_sci_msg_resp_get_clock_num_parents - Response for get clk parents 4088c2ecf20Sopenharmony_ci * @hdr: Generic header 4098c2ecf20Sopenharmony_ci * @num_parents: Number of clock parents. If set to 255, the actual 4108c2ecf20Sopenharmony_ci * number of parents is stored into @num_parents_32 4118c2ecf20Sopenharmony_ci * field instead. 4128c2ecf20Sopenharmony_ci * @num_parents_32: Number of clock parents if @num_parents field is 4138c2ecf20Sopenharmony_ci * set to 255. 4148c2ecf20Sopenharmony_ci * 4158c2ecf20Sopenharmony_ci * Response to TI_SCI_MSG_GET_NUM_CLOCK_PARENTS 4168c2ecf20Sopenharmony_ci */ 4178c2ecf20Sopenharmony_cistruct ti_sci_msg_resp_get_clock_num_parents { 4188c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 4198c2ecf20Sopenharmony_ci u8 num_parents; 4208c2ecf20Sopenharmony_ci u32 num_parents_32; 4218c2ecf20Sopenharmony_ci} __packed; 4228c2ecf20Sopenharmony_ci 4238c2ecf20Sopenharmony_ci/** 4248c2ecf20Sopenharmony_ci * struct ti_sci_msg_req_query_clock_freq - Request to query a frequency 4258c2ecf20Sopenharmony_ci * @hdr: Generic Header 4268c2ecf20Sopenharmony_ci * @dev_id: Device identifier this request is for 4278c2ecf20Sopenharmony_ci * @min_freq_hz: The minimum allowable frequency in Hz. This is the minimum 4288c2ecf20Sopenharmony_ci * allowable programmed frequency and does not account for clock 4298c2ecf20Sopenharmony_ci * tolerances and jitter. 4308c2ecf20Sopenharmony_ci * @target_freq_hz: The target clock frequency. A frequency will be found 4318c2ecf20Sopenharmony_ci * as close to this target frequency as possible. 4328c2ecf20Sopenharmony_ci * @max_freq_hz: The maximum allowable frequency in Hz. This is the maximum 4338c2ecf20Sopenharmony_ci * allowable programmed frequency and does not account for clock 4348c2ecf20Sopenharmony_ci * tolerances and jitter. 4358c2ecf20Sopenharmony_ci * @clk_id: Clock identifier for the device for this request. Set to 4368c2ecf20Sopenharmony_ci * 255 if clock identifier is greater than or equal to 255. 4378c2ecf20Sopenharmony_ci * @clk_id_32: Clock identifier if @clk_id is set to 255. 4388c2ecf20Sopenharmony_ci * 4398c2ecf20Sopenharmony_ci * NOTE: Normally clock frequency management is automatically done by TISCI 4408c2ecf20Sopenharmony_ci * entity. In case of specific requests, TISCI evaluates capability to achieve 4418c2ecf20Sopenharmony_ci * requested frequency within provided range and responds with 4428c2ecf20Sopenharmony_ci * result message. 4438c2ecf20Sopenharmony_ci * 4448c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_QUERY_CLOCK_FREQ, response is appropriate message, 4458c2ecf20Sopenharmony_ci * or NACK in case of inability to satisfy request. 4468c2ecf20Sopenharmony_ci */ 4478c2ecf20Sopenharmony_cistruct ti_sci_msg_req_query_clock_freq { 4488c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 4498c2ecf20Sopenharmony_ci u32 dev_id; 4508c2ecf20Sopenharmony_ci u64 min_freq_hz; 4518c2ecf20Sopenharmony_ci u64 target_freq_hz; 4528c2ecf20Sopenharmony_ci u64 max_freq_hz; 4538c2ecf20Sopenharmony_ci u8 clk_id; 4548c2ecf20Sopenharmony_ci u32 clk_id_32; 4558c2ecf20Sopenharmony_ci} __packed; 4568c2ecf20Sopenharmony_ci 4578c2ecf20Sopenharmony_ci/** 4588c2ecf20Sopenharmony_ci * struct ti_sci_msg_resp_query_clock_freq - Response to a clock frequency query 4598c2ecf20Sopenharmony_ci * @hdr: Generic Header 4608c2ecf20Sopenharmony_ci * @freq_hz: Frequency that is the best match in Hz. 4618c2ecf20Sopenharmony_ci * 4628c2ecf20Sopenharmony_ci * Response to request type TI_SCI_MSG_QUERY_CLOCK_FREQ. NOTE: if the request 4638c2ecf20Sopenharmony_ci * cannot be satisfied, the message will be of type NACK. 4648c2ecf20Sopenharmony_ci */ 4658c2ecf20Sopenharmony_cistruct ti_sci_msg_resp_query_clock_freq { 4668c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 4678c2ecf20Sopenharmony_ci u64 freq_hz; 4688c2ecf20Sopenharmony_ci} __packed; 4698c2ecf20Sopenharmony_ci 4708c2ecf20Sopenharmony_ci/** 4718c2ecf20Sopenharmony_ci * struct ti_sci_msg_req_set_clock_freq - Request to setup a clock frequency 4728c2ecf20Sopenharmony_ci * @hdr: Generic Header 4738c2ecf20Sopenharmony_ci * @dev_id: Device identifier this request is for 4748c2ecf20Sopenharmony_ci * @min_freq_hz: The minimum allowable frequency in Hz. This is the minimum 4758c2ecf20Sopenharmony_ci * allowable programmed frequency and does not account for clock 4768c2ecf20Sopenharmony_ci * tolerances and jitter. 4778c2ecf20Sopenharmony_ci * @target_freq_hz: The target clock frequency. The clock will be programmed 4788c2ecf20Sopenharmony_ci * at a rate as close to this target frequency as possible. 4798c2ecf20Sopenharmony_ci * @max_freq_hz: The maximum allowable frequency in Hz. This is the maximum 4808c2ecf20Sopenharmony_ci * allowable programmed frequency and does not account for clock 4818c2ecf20Sopenharmony_ci * tolerances and jitter. 4828c2ecf20Sopenharmony_ci * @clk_id: Clock identifier for the device for this request. Set to 4838c2ecf20Sopenharmony_ci * 255 if clock ID is greater than or equal to 255. 4848c2ecf20Sopenharmony_ci * @clk_id_32: Clock identifier if @clk_id field is set to 255. 4858c2ecf20Sopenharmony_ci * 4868c2ecf20Sopenharmony_ci * NOTE: Normally clock frequency management is automatically done by TISCI 4878c2ecf20Sopenharmony_ci * entity. In case of specific requests, TISCI evaluates capability to achieve 4888c2ecf20Sopenharmony_ci * requested range and responds with success/failure message. 4898c2ecf20Sopenharmony_ci * 4908c2ecf20Sopenharmony_ci * This sets the desired frequency for a clock within an allowable 4918c2ecf20Sopenharmony_ci * range. This message will fail on an enabled clock unless 4928c2ecf20Sopenharmony_ci * MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE is set for the clock. Additionally, 4938c2ecf20Sopenharmony_ci * if other clocks have their frequency modified due to this message, 4948c2ecf20Sopenharmony_ci * they also must have the MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE or be disabled. 4958c2ecf20Sopenharmony_ci * 4968c2ecf20Sopenharmony_ci * Calling set frequency on a clock input to the SoC pseudo-device will 4978c2ecf20Sopenharmony_ci * inform the PMMC of that clock's frequency. Setting a frequency of 4988c2ecf20Sopenharmony_ci * zero will indicate the clock is disabled. 4998c2ecf20Sopenharmony_ci * 5008c2ecf20Sopenharmony_ci * Calling set frequency on clock outputs from the SoC pseudo-device will 5018c2ecf20Sopenharmony_ci * function similarly to setting the clock frequency on a device. 5028c2ecf20Sopenharmony_ci * 5038c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_SET_CLOCK_FREQ, response is a generic ACK/NACK 5048c2ecf20Sopenharmony_ci * message. 5058c2ecf20Sopenharmony_ci */ 5068c2ecf20Sopenharmony_cistruct ti_sci_msg_req_set_clock_freq { 5078c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 5088c2ecf20Sopenharmony_ci u32 dev_id; 5098c2ecf20Sopenharmony_ci u64 min_freq_hz; 5108c2ecf20Sopenharmony_ci u64 target_freq_hz; 5118c2ecf20Sopenharmony_ci u64 max_freq_hz; 5128c2ecf20Sopenharmony_ci u8 clk_id; 5138c2ecf20Sopenharmony_ci u32 clk_id_32; 5148c2ecf20Sopenharmony_ci} __packed; 5158c2ecf20Sopenharmony_ci 5168c2ecf20Sopenharmony_ci/** 5178c2ecf20Sopenharmony_ci * struct ti_sci_msg_req_get_clock_freq - Request to get the clock frequency 5188c2ecf20Sopenharmony_ci * @hdr: Generic Header 5198c2ecf20Sopenharmony_ci * @dev_id: Device identifier this request is for 5208c2ecf20Sopenharmony_ci * @clk_id: Clock identifier for the device for this request. Set to 5218c2ecf20Sopenharmony_ci * 255 if clock ID is greater than or equal to 255. 5228c2ecf20Sopenharmony_ci * @clk_id_32: Clock identifier if @clk_id field is set to 255. 5238c2ecf20Sopenharmony_ci * 5248c2ecf20Sopenharmony_ci * NOTE: Normally clock frequency management is automatically done by TISCI 5258c2ecf20Sopenharmony_ci * entity. In some cases, clock frequencies are configured by host. 5268c2ecf20Sopenharmony_ci * 5278c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_GET_CLOCK_FREQ, responded with clock frequency 5288c2ecf20Sopenharmony_ci * that the clock is currently at. 5298c2ecf20Sopenharmony_ci */ 5308c2ecf20Sopenharmony_cistruct ti_sci_msg_req_get_clock_freq { 5318c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 5328c2ecf20Sopenharmony_ci u32 dev_id; 5338c2ecf20Sopenharmony_ci u8 clk_id; 5348c2ecf20Sopenharmony_ci u32 clk_id_32; 5358c2ecf20Sopenharmony_ci} __packed; 5368c2ecf20Sopenharmony_ci 5378c2ecf20Sopenharmony_ci/** 5388c2ecf20Sopenharmony_ci * struct ti_sci_msg_resp_get_clock_freq - Response of clock frequency request 5398c2ecf20Sopenharmony_ci * @hdr: Generic Header 5408c2ecf20Sopenharmony_ci * @freq_hz: Frequency that the clock is currently on, in Hz. 5418c2ecf20Sopenharmony_ci * 5428c2ecf20Sopenharmony_ci * Response to request type TI_SCI_MSG_GET_CLOCK_FREQ. 5438c2ecf20Sopenharmony_ci */ 5448c2ecf20Sopenharmony_cistruct ti_sci_msg_resp_get_clock_freq { 5458c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 5468c2ecf20Sopenharmony_ci u64 freq_hz; 5478c2ecf20Sopenharmony_ci} __packed; 5488c2ecf20Sopenharmony_ci 5498c2ecf20Sopenharmony_ci#define TI_SCI_IRQ_SECONDARY_HOST_INVALID 0xff 5508c2ecf20Sopenharmony_ci 5518c2ecf20Sopenharmony_ci/** 5528c2ecf20Sopenharmony_ci * struct ti_sci_msg_req_get_resource_range - Request to get a host's assigned 5538c2ecf20Sopenharmony_ci * range of resources. 5548c2ecf20Sopenharmony_ci * @hdr: Generic Header 5558c2ecf20Sopenharmony_ci * @type: Unique resource assignment type 5568c2ecf20Sopenharmony_ci * @subtype: Resource assignment subtype within the resource type. 5578c2ecf20Sopenharmony_ci * @secondary_host: Host processing entity to which the resources are 5588c2ecf20Sopenharmony_ci * allocated. This is required only when the destination 5598c2ecf20Sopenharmony_ci * host id id different from ti sci interface host id, 5608c2ecf20Sopenharmony_ci * else TI_SCI_IRQ_SECONDARY_HOST_INVALID can be passed. 5618c2ecf20Sopenharmony_ci * 5628c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_GET_RESOURCE_RANGE. Responded with requested 5638c2ecf20Sopenharmony_ci * resource range which is of type TI_SCI_MSG_GET_RESOURCE_RANGE. 5648c2ecf20Sopenharmony_ci */ 5658c2ecf20Sopenharmony_cistruct ti_sci_msg_req_get_resource_range { 5668c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 5678c2ecf20Sopenharmony_ci#define MSG_RM_RESOURCE_TYPE_MASK GENMASK(9, 0) 5688c2ecf20Sopenharmony_ci#define MSG_RM_RESOURCE_SUBTYPE_MASK GENMASK(5, 0) 5698c2ecf20Sopenharmony_ci u16 type; 5708c2ecf20Sopenharmony_ci u8 subtype; 5718c2ecf20Sopenharmony_ci u8 secondary_host; 5728c2ecf20Sopenharmony_ci} __packed; 5738c2ecf20Sopenharmony_ci 5748c2ecf20Sopenharmony_ci/** 5758c2ecf20Sopenharmony_ci * struct ti_sci_msg_resp_get_resource_range - Response to resource get range. 5768c2ecf20Sopenharmony_ci * @hdr: Generic Header 5778c2ecf20Sopenharmony_ci * @range_start: Start index of the resource range. 5788c2ecf20Sopenharmony_ci * @range_num: Number of resources in the range. 5798c2ecf20Sopenharmony_ci * 5808c2ecf20Sopenharmony_ci * Response to request TI_SCI_MSG_GET_RESOURCE_RANGE. 5818c2ecf20Sopenharmony_ci */ 5828c2ecf20Sopenharmony_cistruct ti_sci_msg_resp_get_resource_range { 5838c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 5848c2ecf20Sopenharmony_ci u16 range_start; 5858c2ecf20Sopenharmony_ci u16 range_num; 5868c2ecf20Sopenharmony_ci} __packed; 5878c2ecf20Sopenharmony_ci 5888c2ecf20Sopenharmony_ci/** 5898c2ecf20Sopenharmony_ci * struct ti_sci_msg_req_manage_irq - Request to configure/release the route 5908c2ecf20Sopenharmony_ci * between the dev and the host. 5918c2ecf20Sopenharmony_ci * @hdr: Generic Header 5928c2ecf20Sopenharmony_ci * @valid_params: Bit fields defining the validity of interrupt source 5938c2ecf20Sopenharmony_ci * parameters. If a bit is not set, then corresponding 5948c2ecf20Sopenharmony_ci * field is not valid and will not be used for route set. 5958c2ecf20Sopenharmony_ci * Bit field definitions: 5968c2ecf20Sopenharmony_ci * 0 - Valid bit for @dst_id 5978c2ecf20Sopenharmony_ci * 1 - Valid bit for @dst_host_irq 5988c2ecf20Sopenharmony_ci * 2 - Valid bit for @ia_id 5998c2ecf20Sopenharmony_ci * 3 - Valid bit for @vint 6008c2ecf20Sopenharmony_ci * 4 - Valid bit for @global_event 6018c2ecf20Sopenharmony_ci * 5 - Valid bit for @vint_status_bit_index 6028c2ecf20Sopenharmony_ci * 31 - Valid bit for @secondary_host 6038c2ecf20Sopenharmony_ci * @src_id: IRQ source peripheral ID. 6048c2ecf20Sopenharmony_ci * @src_index: IRQ source index within the peripheral 6058c2ecf20Sopenharmony_ci * @dst_id: IRQ Destination ID. Based on the architecture it can be 6068c2ecf20Sopenharmony_ci * IRQ controller or host processor ID. 6078c2ecf20Sopenharmony_ci * @dst_host_irq: IRQ number of the destination host IRQ controller 6088c2ecf20Sopenharmony_ci * @ia_id: Device ID of the interrupt aggregator in which the 6098c2ecf20Sopenharmony_ci * vint resides. 6108c2ecf20Sopenharmony_ci * @vint: Virtual interrupt number if the interrupt route 6118c2ecf20Sopenharmony_ci * is through an interrupt aggregator. 6128c2ecf20Sopenharmony_ci * @global_event: Global event that is to be mapped to interrupt 6138c2ecf20Sopenharmony_ci * aggregator virtual interrupt status bit. 6148c2ecf20Sopenharmony_ci * @vint_status_bit: Virtual interrupt status bit if the interrupt route 6158c2ecf20Sopenharmony_ci * utilizes an interrupt aggregator status bit. 6168c2ecf20Sopenharmony_ci * @secondary_host: Host ID of the IRQ destination computing entity. This is 6178c2ecf20Sopenharmony_ci * required only when destination host id is different 6188c2ecf20Sopenharmony_ci * from ti sci interface host id. 6198c2ecf20Sopenharmony_ci * 6208c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_SET/RELEASE_IRQ. 6218c2ecf20Sopenharmony_ci * Response is generic ACK / NACK message. 6228c2ecf20Sopenharmony_ci */ 6238c2ecf20Sopenharmony_cistruct ti_sci_msg_req_manage_irq { 6248c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 6258c2ecf20Sopenharmony_ci#define MSG_FLAG_DST_ID_VALID TI_SCI_MSG_FLAG(0) 6268c2ecf20Sopenharmony_ci#define MSG_FLAG_DST_HOST_IRQ_VALID TI_SCI_MSG_FLAG(1) 6278c2ecf20Sopenharmony_ci#define MSG_FLAG_IA_ID_VALID TI_SCI_MSG_FLAG(2) 6288c2ecf20Sopenharmony_ci#define MSG_FLAG_VINT_VALID TI_SCI_MSG_FLAG(3) 6298c2ecf20Sopenharmony_ci#define MSG_FLAG_GLB_EVNT_VALID TI_SCI_MSG_FLAG(4) 6308c2ecf20Sopenharmony_ci#define MSG_FLAG_VINT_STS_BIT_VALID TI_SCI_MSG_FLAG(5) 6318c2ecf20Sopenharmony_ci#define MSG_FLAG_SHOST_VALID TI_SCI_MSG_FLAG(31) 6328c2ecf20Sopenharmony_ci u32 valid_params; 6338c2ecf20Sopenharmony_ci u16 src_id; 6348c2ecf20Sopenharmony_ci u16 src_index; 6358c2ecf20Sopenharmony_ci u16 dst_id; 6368c2ecf20Sopenharmony_ci u16 dst_host_irq; 6378c2ecf20Sopenharmony_ci u16 ia_id; 6388c2ecf20Sopenharmony_ci u16 vint; 6398c2ecf20Sopenharmony_ci u16 global_event; 6408c2ecf20Sopenharmony_ci u8 vint_status_bit; 6418c2ecf20Sopenharmony_ci u8 secondary_host; 6428c2ecf20Sopenharmony_ci} __packed; 6438c2ecf20Sopenharmony_ci 6448c2ecf20Sopenharmony_ci/** 6458c2ecf20Sopenharmony_ci * struct ti_sci_msg_rm_ring_cfg_req - Configure a Navigator Subsystem ring 6468c2ecf20Sopenharmony_ci * 6478c2ecf20Sopenharmony_ci * Configures the non-real-time registers of a Navigator Subsystem ring. 6488c2ecf20Sopenharmony_ci * @hdr: Generic Header 6498c2ecf20Sopenharmony_ci * @valid_params: Bitfield defining validity of ring configuration parameters. 6508c2ecf20Sopenharmony_ci * The ring configuration fields are not valid, and will not be used for 6518c2ecf20Sopenharmony_ci * ring configuration, if their corresponding valid bit is zero. 6528c2ecf20Sopenharmony_ci * Valid bit usage: 6538c2ecf20Sopenharmony_ci * 0 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_lo 6548c2ecf20Sopenharmony_ci * 1 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_hi 6558c2ecf20Sopenharmony_ci * 2 - Valid bit for @tisci_msg_rm_ring_cfg_req count 6568c2ecf20Sopenharmony_ci * 3 - Valid bit for @tisci_msg_rm_ring_cfg_req mode 6578c2ecf20Sopenharmony_ci * 4 - Valid bit for @tisci_msg_rm_ring_cfg_req size 6588c2ecf20Sopenharmony_ci * 5 - Valid bit for @tisci_msg_rm_ring_cfg_req order_id 6598c2ecf20Sopenharmony_ci * @nav_id: Device ID of Navigator Subsystem from which the ring is allocated 6608c2ecf20Sopenharmony_ci * @index: ring index to be configured. 6618c2ecf20Sopenharmony_ci * @addr_lo: 32 LSBs of ring base address to be programmed into the ring's 6628c2ecf20Sopenharmony_ci * RING_BA_LO register 6638c2ecf20Sopenharmony_ci * @addr_hi: 16 MSBs of ring base address to be programmed into the ring's 6648c2ecf20Sopenharmony_ci * RING_BA_HI register. 6658c2ecf20Sopenharmony_ci * @count: Number of ring elements. Must be even if mode is CREDENTIALS or QM 6668c2ecf20Sopenharmony_ci * modes. 6678c2ecf20Sopenharmony_ci * @mode: Specifies the mode the ring is to be configured. 6688c2ecf20Sopenharmony_ci * @size: Specifies encoded ring element size. To calculate the encoded size use 6698c2ecf20Sopenharmony_ci * the formula (log2(size_bytes) - 2), where size_bytes cannot be 6708c2ecf20Sopenharmony_ci * greater than 256. 6718c2ecf20Sopenharmony_ci * @order_id: Specifies the ring's bus order ID. 6728c2ecf20Sopenharmony_ci */ 6738c2ecf20Sopenharmony_cistruct ti_sci_msg_rm_ring_cfg_req { 6748c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 6758c2ecf20Sopenharmony_ci u32 valid_params; 6768c2ecf20Sopenharmony_ci u16 nav_id; 6778c2ecf20Sopenharmony_ci u16 index; 6788c2ecf20Sopenharmony_ci u32 addr_lo; 6798c2ecf20Sopenharmony_ci u32 addr_hi; 6808c2ecf20Sopenharmony_ci u32 count; 6818c2ecf20Sopenharmony_ci u8 mode; 6828c2ecf20Sopenharmony_ci u8 size; 6838c2ecf20Sopenharmony_ci u8 order_id; 6848c2ecf20Sopenharmony_ci} __packed; 6858c2ecf20Sopenharmony_ci 6868c2ecf20Sopenharmony_ci/** 6878c2ecf20Sopenharmony_ci * struct ti_sci_msg_rm_ring_get_cfg_req - Get RA ring's configuration 6888c2ecf20Sopenharmony_ci * 6898c2ecf20Sopenharmony_ci * Gets the configuration of the non-real-time register fields of a ring. The 6908c2ecf20Sopenharmony_ci * host, or a supervisor of the host, who owns the ring must be the requesting 6918c2ecf20Sopenharmony_ci * host. The values of the non-real-time registers are returned in 6928c2ecf20Sopenharmony_ci * @ti_sci_msg_rm_ring_get_cfg_resp. 6938c2ecf20Sopenharmony_ci * 6948c2ecf20Sopenharmony_ci * @hdr: Generic Header 6958c2ecf20Sopenharmony_ci * @nav_id: Device ID of Navigator Subsystem from which the ring is allocated 6968c2ecf20Sopenharmony_ci * @index: ring index. 6978c2ecf20Sopenharmony_ci */ 6988c2ecf20Sopenharmony_cistruct ti_sci_msg_rm_ring_get_cfg_req { 6998c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 7008c2ecf20Sopenharmony_ci u16 nav_id; 7018c2ecf20Sopenharmony_ci u16 index; 7028c2ecf20Sopenharmony_ci} __packed; 7038c2ecf20Sopenharmony_ci 7048c2ecf20Sopenharmony_ci/** 7058c2ecf20Sopenharmony_ci * struct ti_sci_msg_rm_ring_get_cfg_resp - Ring get configuration response 7068c2ecf20Sopenharmony_ci * 7078c2ecf20Sopenharmony_ci * Response received by host processor after RM has handled 7088c2ecf20Sopenharmony_ci * @ti_sci_msg_rm_ring_get_cfg_req. The response contains the ring's 7098c2ecf20Sopenharmony_ci * non-real-time register values. 7108c2ecf20Sopenharmony_ci * 7118c2ecf20Sopenharmony_ci * @hdr: Generic Header 7128c2ecf20Sopenharmony_ci * @addr_lo: Ring 32 LSBs of base address 7138c2ecf20Sopenharmony_ci * @addr_hi: Ring 16 MSBs of base address. 7148c2ecf20Sopenharmony_ci * @count: Ring number of elements. 7158c2ecf20Sopenharmony_ci * @mode: Ring mode. 7168c2ecf20Sopenharmony_ci * @size: encoded Ring element size 7178c2ecf20Sopenharmony_ci * @order_id: ing order ID. 7188c2ecf20Sopenharmony_ci */ 7198c2ecf20Sopenharmony_cistruct ti_sci_msg_rm_ring_get_cfg_resp { 7208c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 7218c2ecf20Sopenharmony_ci u32 addr_lo; 7228c2ecf20Sopenharmony_ci u32 addr_hi; 7238c2ecf20Sopenharmony_ci u32 count; 7248c2ecf20Sopenharmony_ci u8 mode; 7258c2ecf20Sopenharmony_ci u8 size; 7268c2ecf20Sopenharmony_ci u8 order_id; 7278c2ecf20Sopenharmony_ci} __packed; 7288c2ecf20Sopenharmony_ci 7298c2ecf20Sopenharmony_ci/** 7308c2ecf20Sopenharmony_ci * struct ti_sci_msg_psil_pair - Pairs a PSI-L source thread to a destination 7318c2ecf20Sopenharmony_ci * thread 7328c2ecf20Sopenharmony_ci * @hdr: Generic Header 7338c2ecf20Sopenharmony_ci * @nav_id: SoC Navigator Subsystem device ID whose PSI-L config proxy is 7348c2ecf20Sopenharmony_ci * used to pair the source and destination threads. 7358c2ecf20Sopenharmony_ci * @src_thread: PSI-L source thread ID within the PSI-L System thread map. 7368c2ecf20Sopenharmony_ci * 7378c2ecf20Sopenharmony_ci * UDMAP transmit channels mapped to source threads will have their 7388c2ecf20Sopenharmony_ci * TCHAN_THRD_ID register programmed with the destination thread if the pairing 7398c2ecf20Sopenharmony_ci * is successful. 7408c2ecf20Sopenharmony_ci 7418c2ecf20Sopenharmony_ci * @dst_thread: PSI-L destination thread ID within the PSI-L System thread map. 7428c2ecf20Sopenharmony_ci * PSI-L destination threads start at index 0x8000. The request is NACK'd if 7438c2ecf20Sopenharmony_ci * the destination thread is not greater than or equal to 0x8000. 7448c2ecf20Sopenharmony_ci * 7458c2ecf20Sopenharmony_ci * UDMAP receive channels mapped to destination threads will have their 7468c2ecf20Sopenharmony_ci * RCHAN_THRD_ID register programmed with the source thread if the pairing 7478c2ecf20Sopenharmony_ci * is successful. 7488c2ecf20Sopenharmony_ci * 7498c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_RM_PSIL_PAIR, response is a generic ACK or NACK 7508c2ecf20Sopenharmony_ci * message. 7518c2ecf20Sopenharmony_ci */ 7528c2ecf20Sopenharmony_cistruct ti_sci_msg_psil_pair { 7538c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 7548c2ecf20Sopenharmony_ci u32 nav_id; 7558c2ecf20Sopenharmony_ci u32 src_thread; 7568c2ecf20Sopenharmony_ci u32 dst_thread; 7578c2ecf20Sopenharmony_ci} __packed; 7588c2ecf20Sopenharmony_ci 7598c2ecf20Sopenharmony_ci/** 7608c2ecf20Sopenharmony_ci * struct ti_sci_msg_psil_unpair - Unpairs a PSI-L source thread from a 7618c2ecf20Sopenharmony_ci * destination thread 7628c2ecf20Sopenharmony_ci * @hdr: Generic Header 7638c2ecf20Sopenharmony_ci * @nav_id: SoC Navigator Subsystem device ID whose PSI-L config proxy is 7648c2ecf20Sopenharmony_ci * used to unpair the source and destination threads. 7658c2ecf20Sopenharmony_ci * @src_thread: PSI-L source thread ID within the PSI-L System thread map. 7668c2ecf20Sopenharmony_ci * 7678c2ecf20Sopenharmony_ci * UDMAP transmit channels mapped to source threads will have their 7688c2ecf20Sopenharmony_ci * TCHAN_THRD_ID register cleared if the unpairing is successful. 7698c2ecf20Sopenharmony_ci * 7708c2ecf20Sopenharmony_ci * @dst_thread: PSI-L destination thread ID within the PSI-L System thread map. 7718c2ecf20Sopenharmony_ci * PSI-L destination threads start at index 0x8000. The request is NACK'd if 7728c2ecf20Sopenharmony_ci * the destination thread is not greater than or equal to 0x8000. 7738c2ecf20Sopenharmony_ci * 7748c2ecf20Sopenharmony_ci * UDMAP receive channels mapped to destination threads will have their 7758c2ecf20Sopenharmony_ci * RCHAN_THRD_ID register cleared if the unpairing is successful. 7768c2ecf20Sopenharmony_ci * 7778c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_RM_PSIL_UNPAIR, response is a generic ACK or NACK 7788c2ecf20Sopenharmony_ci * message. 7798c2ecf20Sopenharmony_ci */ 7808c2ecf20Sopenharmony_cistruct ti_sci_msg_psil_unpair { 7818c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 7828c2ecf20Sopenharmony_ci u32 nav_id; 7838c2ecf20Sopenharmony_ci u32 src_thread; 7848c2ecf20Sopenharmony_ci u32 dst_thread; 7858c2ecf20Sopenharmony_ci} __packed; 7868c2ecf20Sopenharmony_ci 7878c2ecf20Sopenharmony_ci/** 7888c2ecf20Sopenharmony_ci * struct ti_sci_msg_udmap_rx_flow_cfg - UDMAP receive flow configuration 7898c2ecf20Sopenharmony_ci * message 7908c2ecf20Sopenharmony_ci * @hdr: Generic Header 7918c2ecf20Sopenharmony_ci * @nav_id: SoC Navigator Subsystem device ID from which the receive flow is 7928c2ecf20Sopenharmony_ci * allocated 7938c2ecf20Sopenharmony_ci * @flow_index: UDMAP receive flow index for non-optional configuration. 7948c2ecf20Sopenharmony_ci * @rx_ch_index: Specifies the index of the receive channel using the flow_index 7958c2ecf20Sopenharmony_ci * @rx_einfo_present: UDMAP receive flow extended packet info present. 7968c2ecf20Sopenharmony_ci * @rx_psinfo_present: UDMAP receive flow PS words present. 7978c2ecf20Sopenharmony_ci * @rx_error_handling: UDMAP receive flow error handling configuration. Valid 7988c2ecf20Sopenharmony_ci * values are TI_SCI_RM_UDMAP_RX_FLOW_ERR_DROP/RETRY. 7998c2ecf20Sopenharmony_ci * @rx_desc_type: UDMAP receive flow descriptor type. It can be one of 8008c2ecf20Sopenharmony_ci * TI_SCI_RM_UDMAP_RX_FLOW_DESC_HOST/MONO. 8018c2ecf20Sopenharmony_ci * @rx_sop_offset: UDMAP receive flow start of packet offset. 8028c2ecf20Sopenharmony_ci * @rx_dest_qnum: UDMAP receive flow destination queue number. 8038c2ecf20Sopenharmony_ci * @rx_ps_location: UDMAP receive flow PS words location. 8048c2ecf20Sopenharmony_ci * 0 - end of packet descriptor 8058c2ecf20Sopenharmony_ci * 1 - Beginning of the data buffer 8068c2ecf20Sopenharmony_ci * @rx_src_tag_hi: UDMAP receive flow source tag high byte constant 8078c2ecf20Sopenharmony_ci * @rx_src_tag_lo: UDMAP receive flow source tag low byte constant 8088c2ecf20Sopenharmony_ci * @rx_dest_tag_hi: UDMAP receive flow destination tag high byte constant 8098c2ecf20Sopenharmony_ci * @rx_dest_tag_lo: UDMAP receive flow destination tag low byte constant 8108c2ecf20Sopenharmony_ci * @rx_src_tag_hi_sel: UDMAP receive flow source tag high byte selector 8118c2ecf20Sopenharmony_ci * @rx_src_tag_lo_sel: UDMAP receive flow source tag low byte selector 8128c2ecf20Sopenharmony_ci * @rx_dest_tag_hi_sel: UDMAP receive flow destination tag high byte selector 8138c2ecf20Sopenharmony_ci * @rx_dest_tag_lo_sel: UDMAP receive flow destination tag low byte selector 8148c2ecf20Sopenharmony_ci * @rx_size_thresh_en: UDMAP receive flow packet size based free buffer queue 8158c2ecf20Sopenharmony_ci * enable. If enabled, the ti_sci_rm_udmap_rx_flow_opt_cfg also need to be 8168c2ecf20Sopenharmony_ci * configured and sent. 8178c2ecf20Sopenharmony_ci * @rx_fdq0_sz0_qnum: UDMAP receive flow free descriptor queue 0. 8188c2ecf20Sopenharmony_ci * @rx_fdq1_qnum: UDMAP receive flow free descriptor queue 1. 8198c2ecf20Sopenharmony_ci * @rx_fdq2_qnum: UDMAP receive flow free descriptor queue 2. 8208c2ecf20Sopenharmony_ci * @rx_fdq3_qnum: UDMAP receive flow free descriptor queue 3. 8218c2ecf20Sopenharmony_ci * 8228c2ecf20Sopenharmony_ci * For detailed information on the settings, see the UDMAP section of the TRM. 8238c2ecf20Sopenharmony_ci */ 8248c2ecf20Sopenharmony_cistruct ti_sci_msg_udmap_rx_flow_cfg { 8258c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 8268c2ecf20Sopenharmony_ci u32 nav_id; 8278c2ecf20Sopenharmony_ci u32 flow_index; 8288c2ecf20Sopenharmony_ci u32 rx_ch_index; 8298c2ecf20Sopenharmony_ci u8 rx_einfo_present; 8308c2ecf20Sopenharmony_ci u8 rx_psinfo_present; 8318c2ecf20Sopenharmony_ci u8 rx_error_handling; 8328c2ecf20Sopenharmony_ci u8 rx_desc_type; 8338c2ecf20Sopenharmony_ci u16 rx_sop_offset; 8348c2ecf20Sopenharmony_ci u16 rx_dest_qnum; 8358c2ecf20Sopenharmony_ci u8 rx_ps_location; 8368c2ecf20Sopenharmony_ci u8 rx_src_tag_hi; 8378c2ecf20Sopenharmony_ci u8 rx_src_tag_lo; 8388c2ecf20Sopenharmony_ci u8 rx_dest_tag_hi; 8398c2ecf20Sopenharmony_ci u8 rx_dest_tag_lo; 8408c2ecf20Sopenharmony_ci u8 rx_src_tag_hi_sel; 8418c2ecf20Sopenharmony_ci u8 rx_src_tag_lo_sel; 8428c2ecf20Sopenharmony_ci u8 rx_dest_tag_hi_sel; 8438c2ecf20Sopenharmony_ci u8 rx_dest_tag_lo_sel; 8448c2ecf20Sopenharmony_ci u8 rx_size_thresh_en; 8458c2ecf20Sopenharmony_ci u16 rx_fdq0_sz0_qnum; 8468c2ecf20Sopenharmony_ci u16 rx_fdq1_qnum; 8478c2ecf20Sopenharmony_ci u16 rx_fdq2_qnum; 8488c2ecf20Sopenharmony_ci u16 rx_fdq3_qnum; 8498c2ecf20Sopenharmony_ci} __packed; 8508c2ecf20Sopenharmony_ci 8518c2ecf20Sopenharmony_ci/** 8528c2ecf20Sopenharmony_ci * struct rm_ti_sci_msg_udmap_rx_flow_opt_cfg - parameters for UDMAP receive 8538c2ecf20Sopenharmony_ci * flow optional configuration 8548c2ecf20Sopenharmony_ci * @hdr: Generic Header 8558c2ecf20Sopenharmony_ci * @nav_id: SoC Navigator Subsystem device ID from which the receive flow is 8568c2ecf20Sopenharmony_ci * allocated 8578c2ecf20Sopenharmony_ci * @flow_index: UDMAP receive flow index for optional configuration. 8588c2ecf20Sopenharmony_ci * @rx_ch_index: Specifies the index of the receive channel using the flow_index 8598c2ecf20Sopenharmony_ci * @rx_size_thresh0: UDMAP receive flow packet size threshold 0. 8608c2ecf20Sopenharmony_ci * @rx_size_thresh1: UDMAP receive flow packet size threshold 1. 8618c2ecf20Sopenharmony_ci * @rx_size_thresh2: UDMAP receive flow packet size threshold 2. 8628c2ecf20Sopenharmony_ci * @rx_fdq0_sz1_qnum: UDMAP receive flow free descriptor queue for size 8638c2ecf20Sopenharmony_ci * threshold 1. 8648c2ecf20Sopenharmony_ci * @rx_fdq0_sz2_qnum: UDMAP receive flow free descriptor queue for size 8658c2ecf20Sopenharmony_ci * threshold 2. 8668c2ecf20Sopenharmony_ci * @rx_fdq0_sz3_qnum: UDMAP receive flow free descriptor queue for size 8678c2ecf20Sopenharmony_ci * threshold 3. 8688c2ecf20Sopenharmony_ci * 8698c2ecf20Sopenharmony_ci * For detailed information on the settings, see the UDMAP section of the TRM. 8708c2ecf20Sopenharmony_ci */ 8718c2ecf20Sopenharmony_cistruct rm_ti_sci_msg_udmap_rx_flow_opt_cfg { 8728c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 8738c2ecf20Sopenharmony_ci u32 nav_id; 8748c2ecf20Sopenharmony_ci u32 flow_index; 8758c2ecf20Sopenharmony_ci u32 rx_ch_index; 8768c2ecf20Sopenharmony_ci u16 rx_size_thresh0; 8778c2ecf20Sopenharmony_ci u16 rx_size_thresh1; 8788c2ecf20Sopenharmony_ci u16 rx_size_thresh2; 8798c2ecf20Sopenharmony_ci u16 rx_fdq0_sz1_qnum; 8808c2ecf20Sopenharmony_ci u16 rx_fdq0_sz2_qnum; 8818c2ecf20Sopenharmony_ci u16 rx_fdq0_sz3_qnum; 8828c2ecf20Sopenharmony_ci} __packed; 8838c2ecf20Sopenharmony_ci 8848c2ecf20Sopenharmony_ci/** 8858c2ecf20Sopenharmony_ci * Configures a Navigator Subsystem UDMAP transmit channel 8868c2ecf20Sopenharmony_ci * 8878c2ecf20Sopenharmony_ci * Configures the non-real-time registers of a Navigator Subsystem UDMAP 8888c2ecf20Sopenharmony_ci * transmit channel. The channel index must be assigned to the host defined 8898c2ecf20Sopenharmony_ci * in the TISCI header via the RM board configuration resource assignment 8908c2ecf20Sopenharmony_ci * range list. 8918c2ecf20Sopenharmony_ci * 8928c2ecf20Sopenharmony_ci * @hdr: Generic Header 8938c2ecf20Sopenharmony_ci * 8948c2ecf20Sopenharmony_ci * @valid_params: Bitfield defining validity of tx channel configuration 8958c2ecf20Sopenharmony_ci * parameters. The tx channel configuration fields are not valid, and will not 8968c2ecf20Sopenharmony_ci * be used for ch configuration, if their corresponding valid bit is zero. 8978c2ecf20Sopenharmony_ci * Valid bit usage: 8988c2ecf20Sopenharmony_ci * 0 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_pause_on_err 8998c2ecf20Sopenharmony_ci * 1 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_atype 9008c2ecf20Sopenharmony_ci * 2 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_chan_type 9018c2ecf20Sopenharmony_ci * 3 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_fetch_size 9028c2ecf20Sopenharmony_ci * 4 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::txcq_qnum 9038c2ecf20Sopenharmony_ci * 5 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_priority 9048c2ecf20Sopenharmony_ci * 6 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_qos 9058c2ecf20Sopenharmony_ci * 7 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_orderid 9068c2ecf20Sopenharmony_ci * 8 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_sched_priority 9078c2ecf20Sopenharmony_ci * 9 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_einfo 9088c2ecf20Sopenharmony_ci * 10 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_pswords 9098c2ecf20Sopenharmony_ci * 11 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_supr_tdpkt 9108c2ecf20Sopenharmony_ci * 12 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_credit_count 9118c2ecf20Sopenharmony_ci * 13 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::fdepth 9128c2ecf20Sopenharmony_ci * 14 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_burst_size 9138c2ecf20Sopenharmony_ci * 9148c2ecf20Sopenharmony_ci * @nav_id: SoC device ID of Navigator Subsystem where tx channel is located 9158c2ecf20Sopenharmony_ci * 9168c2ecf20Sopenharmony_ci * @index: UDMAP transmit channel index. 9178c2ecf20Sopenharmony_ci * 9188c2ecf20Sopenharmony_ci * @tx_pause_on_err: UDMAP transmit channel pause on error configuration to 9198c2ecf20Sopenharmony_ci * be programmed into the tx_pause_on_err field of the channel's TCHAN_TCFG 9208c2ecf20Sopenharmony_ci * register. 9218c2ecf20Sopenharmony_ci * 9228c2ecf20Sopenharmony_ci * @tx_filt_einfo: UDMAP transmit channel extended packet information passing 9238c2ecf20Sopenharmony_ci * configuration to be programmed into the tx_filt_einfo field of the 9248c2ecf20Sopenharmony_ci * channel's TCHAN_TCFG register. 9258c2ecf20Sopenharmony_ci * 9268c2ecf20Sopenharmony_ci * @tx_filt_pswords: UDMAP transmit channel protocol specific word passing 9278c2ecf20Sopenharmony_ci * configuration to be programmed into the tx_filt_pswords field of the 9288c2ecf20Sopenharmony_ci * channel's TCHAN_TCFG register. 9298c2ecf20Sopenharmony_ci * 9308c2ecf20Sopenharmony_ci * @tx_atype: UDMAP transmit channel non Ring Accelerator access pointer 9318c2ecf20Sopenharmony_ci * interpretation configuration to be programmed into the tx_atype field of 9328c2ecf20Sopenharmony_ci * the channel's TCHAN_TCFG register. 9338c2ecf20Sopenharmony_ci * 9348c2ecf20Sopenharmony_ci * @tx_chan_type: UDMAP transmit channel functional channel type and work 9358c2ecf20Sopenharmony_ci * passing mechanism configuration to be programmed into the tx_chan_type 9368c2ecf20Sopenharmony_ci * field of the channel's TCHAN_TCFG register. 9378c2ecf20Sopenharmony_ci * 9388c2ecf20Sopenharmony_ci * @tx_supr_tdpkt: UDMAP transmit channel teardown packet generation suppression 9398c2ecf20Sopenharmony_ci * configuration to be programmed into the tx_supr_tdpkt field of the channel's 9408c2ecf20Sopenharmony_ci * TCHAN_TCFG register. 9418c2ecf20Sopenharmony_ci * 9428c2ecf20Sopenharmony_ci * @tx_fetch_size: UDMAP transmit channel number of 32-bit descriptor words to 9438c2ecf20Sopenharmony_ci * fetch configuration to be programmed into the tx_fetch_size field of the 9448c2ecf20Sopenharmony_ci * channel's TCHAN_TCFG register. The user must make sure to set the maximum 9458c2ecf20Sopenharmony_ci * word count that can pass through the channel for any allowed descriptor type. 9468c2ecf20Sopenharmony_ci * 9478c2ecf20Sopenharmony_ci * @tx_credit_count: UDMAP transmit channel transfer request credit count 9488c2ecf20Sopenharmony_ci * configuration to be programmed into the count field of the TCHAN_TCREDIT 9498c2ecf20Sopenharmony_ci * register. Specifies how many credits for complete TRs are available. 9508c2ecf20Sopenharmony_ci * 9518c2ecf20Sopenharmony_ci * @txcq_qnum: UDMAP transmit channel completion queue configuration to be 9528c2ecf20Sopenharmony_ci * programmed into the txcq_qnum field of the TCHAN_TCQ register. The specified 9538c2ecf20Sopenharmony_ci * completion queue must be assigned to the host, or a subordinate of the host, 9548c2ecf20Sopenharmony_ci * requesting configuration of the transmit channel. 9558c2ecf20Sopenharmony_ci * 9568c2ecf20Sopenharmony_ci * @tx_priority: UDMAP transmit channel transmit priority value to be programmed 9578c2ecf20Sopenharmony_ci * into the priority field of the channel's TCHAN_TPRI_CTRL register. 9588c2ecf20Sopenharmony_ci * 9598c2ecf20Sopenharmony_ci * @tx_qos: UDMAP transmit channel transmit qos value to be programmed into the 9608c2ecf20Sopenharmony_ci * qos field of the channel's TCHAN_TPRI_CTRL register. 9618c2ecf20Sopenharmony_ci * 9628c2ecf20Sopenharmony_ci * @tx_orderid: UDMAP transmit channel bus order id value to be programmed into 9638c2ecf20Sopenharmony_ci * the orderid field of the channel's TCHAN_TPRI_CTRL register. 9648c2ecf20Sopenharmony_ci * 9658c2ecf20Sopenharmony_ci * @fdepth: UDMAP transmit channel FIFO depth configuration to be programmed 9668c2ecf20Sopenharmony_ci * into the fdepth field of the TCHAN_TFIFO_DEPTH register. Sets the number of 9678c2ecf20Sopenharmony_ci * Tx FIFO bytes which are allowed to be stored for the channel. Check the UDMAP 9688c2ecf20Sopenharmony_ci * section of the TRM for restrictions regarding this parameter. 9698c2ecf20Sopenharmony_ci * 9708c2ecf20Sopenharmony_ci * @tx_sched_priority: UDMAP transmit channel tx scheduling priority 9718c2ecf20Sopenharmony_ci * configuration to be programmed into the priority field of the channel's 9728c2ecf20Sopenharmony_ci * TCHAN_TST_SCHED register. 9738c2ecf20Sopenharmony_ci * 9748c2ecf20Sopenharmony_ci * @tx_burst_size: UDMAP transmit channel burst size configuration to be 9758c2ecf20Sopenharmony_ci * programmed into the tx_burst_size field of the TCHAN_TCFG register. 9768c2ecf20Sopenharmony_ci */ 9778c2ecf20Sopenharmony_cistruct ti_sci_msg_rm_udmap_tx_ch_cfg_req { 9788c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 9798c2ecf20Sopenharmony_ci u32 valid_params; 9808c2ecf20Sopenharmony_ci u16 nav_id; 9818c2ecf20Sopenharmony_ci u16 index; 9828c2ecf20Sopenharmony_ci u8 tx_pause_on_err; 9838c2ecf20Sopenharmony_ci u8 tx_filt_einfo; 9848c2ecf20Sopenharmony_ci u8 tx_filt_pswords; 9858c2ecf20Sopenharmony_ci u8 tx_atype; 9868c2ecf20Sopenharmony_ci u8 tx_chan_type; 9878c2ecf20Sopenharmony_ci u8 tx_supr_tdpkt; 9888c2ecf20Sopenharmony_ci u16 tx_fetch_size; 9898c2ecf20Sopenharmony_ci u8 tx_credit_count; 9908c2ecf20Sopenharmony_ci u16 txcq_qnum; 9918c2ecf20Sopenharmony_ci u8 tx_priority; 9928c2ecf20Sopenharmony_ci u8 tx_qos; 9938c2ecf20Sopenharmony_ci u8 tx_orderid; 9948c2ecf20Sopenharmony_ci u16 fdepth; 9958c2ecf20Sopenharmony_ci u8 tx_sched_priority; 9968c2ecf20Sopenharmony_ci u8 tx_burst_size; 9978c2ecf20Sopenharmony_ci} __packed; 9988c2ecf20Sopenharmony_ci 9998c2ecf20Sopenharmony_ci/** 10008c2ecf20Sopenharmony_ci * Configures a Navigator Subsystem UDMAP receive channel 10018c2ecf20Sopenharmony_ci * 10028c2ecf20Sopenharmony_ci * Configures the non-real-time registers of a Navigator Subsystem UDMAP 10038c2ecf20Sopenharmony_ci * receive channel. The channel index must be assigned to the host defined 10048c2ecf20Sopenharmony_ci * in the TISCI header via the RM board configuration resource assignment 10058c2ecf20Sopenharmony_ci * range list. 10068c2ecf20Sopenharmony_ci * 10078c2ecf20Sopenharmony_ci * @hdr: Generic Header 10088c2ecf20Sopenharmony_ci * 10098c2ecf20Sopenharmony_ci * @valid_params: Bitfield defining validity of rx channel configuration 10108c2ecf20Sopenharmony_ci * parameters. 10118c2ecf20Sopenharmony_ci * The rx channel configuration fields are not valid, and will not be used for 10128c2ecf20Sopenharmony_ci * ch configuration, if their corresponding valid bit is zero. 10138c2ecf20Sopenharmony_ci * Valid bit usage: 10148c2ecf20Sopenharmony_ci * 0 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_pause_on_err 10158c2ecf20Sopenharmony_ci * 1 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_atype 10168c2ecf20Sopenharmony_ci * 2 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_chan_type 10178c2ecf20Sopenharmony_ci * 3 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_fetch_size 10188c2ecf20Sopenharmony_ci * 4 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rxcq_qnum 10198c2ecf20Sopenharmony_ci * 5 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_priority 10208c2ecf20Sopenharmony_ci * 6 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_qos 10218c2ecf20Sopenharmony_ci * 7 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_orderid 10228c2ecf20Sopenharmony_ci * 8 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_sched_priority 10238c2ecf20Sopenharmony_ci * 9 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_start 10248c2ecf20Sopenharmony_ci * 10 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_cnt 10258c2ecf20Sopenharmony_ci * 11 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_short 10268c2ecf20Sopenharmony_ci * 12 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_long 10278c2ecf20Sopenharmony_ci * 14 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_burst_size 10288c2ecf20Sopenharmony_ci * 10298c2ecf20Sopenharmony_ci * @nav_id: SoC device ID of Navigator Subsystem where rx channel is located 10308c2ecf20Sopenharmony_ci * 10318c2ecf20Sopenharmony_ci * @index: UDMAP receive channel index. 10328c2ecf20Sopenharmony_ci * 10338c2ecf20Sopenharmony_ci * @rx_fetch_size: UDMAP receive channel number of 32-bit descriptor words to 10348c2ecf20Sopenharmony_ci * fetch configuration to be programmed into the rx_fetch_size field of the 10358c2ecf20Sopenharmony_ci * channel's RCHAN_RCFG register. 10368c2ecf20Sopenharmony_ci * 10378c2ecf20Sopenharmony_ci * @rxcq_qnum: UDMAP receive channel completion queue configuration to be 10388c2ecf20Sopenharmony_ci * programmed into the rxcq_qnum field of the RCHAN_RCQ register. 10398c2ecf20Sopenharmony_ci * The specified completion queue must be assigned to the host, or a subordinate 10408c2ecf20Sopenharmony_ci * of the host, requesting configuration of the receive channel. 10418c2ecf20Sopenharmony_ci * 10428c2ecf20Sopenharmony_ci * @rx_priority: UDMAP receive channel receive priority value to be programmed 10438c2ecf20Sopenharmony_ci * into the priority field of the channel's RCHAN_RPRI_CTRL register. 10448c2ecf20Sopenharmony_ci * 10458c2ecf20Sopenharmony_ci * @rx_qos: UDMAP receive channel receive qos value to be programmed into the 10468c2ecf20Sopenharmony_ci * qos field of the channel's RCHAN_RPRI_CTRL register. 10478c2ecf20Sopenharmony_ci * 10488c2ecf20Sopenharmony_ci * @rx_orderid: UDMAP receive channel bus order id value to be programmed into 10498c2ecf20Sopenharmony_ci * the orderid field of the channel's RCHAN_RPRI_CTRL register. 10508c2ecf20Sopenharmony_ci * 10518c2ecf20Sopenharmony_ci * @rx_sched_priority: UDMAP receive channel rx scheduling priority 10528c2ecf20Sopenharmony_ci * configuration to be programmed into the priority field of the channel's 10538c2ecf20Sopenharmony_ci * RCHAN_RST_SCHED register. 10548c2ecf20Sopenharmony_ci * 10558c2ecf20Sopenharmony_ci * @flowid_start: UDMAP receive channel additional flows starting index 10568c2ecf20Sopenharmony_ci * configuration to program into the flow_start field of the RCHAN_RFLOW_RNG 10578c2ecf20Sopenharmony_ci * register. Specifies the starting index for flow IDs the receive channel is to 10588c2ecf20Sopenharmony_ci * make use of beyond the default flow. flowid_start and @ref flowid_cnt must be 10598c2ecf20Sopenharmony_ci * set as valid and configured together. The starting flow ID set by 10608c2ecf20Sopenharmony_ci * @ref flowid_cnt must be a flow index within the Navigator Subsystem's subset 10618c2ecf20Sopenharmony_ci * of flows beyond the default flows statically mapped to receive channels. 10628c2ecf20Sopenharmony_ci * The additional flows must be assigned to the host, or a subordinate of the 10638c2ecf20Sopenharmony_ci * host, requesting configuration of the receive channel. 10648c2ecf20Sopenharmony_ci * 10658c2ecf20Sopenharmony_ci * @flowid_cnt: UDMAP receive channel additional flows count configuration to 10668c2ecf20Sopenharmony_ci * program into the flowid_cnt field of the RCHAN_RFLOW_RNG register. 10678c2ecf20Sopenharmony_ci * This field specifies how many flow IDs are in the additional contiguous range 10688c2ecf20Sopenharmony_ci * of legal flow IDs for the channel. @ref flowid_start and flowid_cnt must be 10698c2ecf20Sopenharmony_ci * set as valid and configured together. Disabling the valid_params field bit 10708c2ecf20Sopenharmony_ci * for flowid_cnt indicates no flow IDs other than the default are to be 10718c2ecf20Sopenharmony_ci * allocated and used by the receive channel. @ref flowid_start plus flowid_cnt 10728c2ecf20Sopenharmony_ci * cannot be greater than the number of receive flows in the receive channel's 10738c2ecf20Sopenharmony_ci * Navigator Subsystem. The additional flows must be assigned to the host, or a 10748c2ecf20Sopenharmony_ci * subordinate of the host, requesting configuration of the receive channel. 10758c2ecf20Sopenharmony_ci * 10768c2ecf20Sopenharmony_ci * @rx_pause_on_err: UDMAP receive channel pause on error configuration to be 10778c2ecf20Sopenharmony_ci * programmed into the rx_pause_on_err field of the channel's RCHAN_RCFG 10788c2ecf20Sopenharmony_ci * register. 10798c2ecf20Sopenharmony_ci * 10808c2ecf20Sopenharmony_ci * @rx_atype: UDMAP receive channel non Ring Accelerator access pointer 10818c2ecf20Sopenharmony_ci * interpretation configuration to be programmed into the rx_atype field of the 10828c2ecf20Sopenharmony_ci * channel's RCHAN_RCFG register. 10838c2ecf20Sopenharmony_ci * 10848c2ecf20Sopenharmony_ci * @rx_chan_type: UDMAP receive channel functional channel type and work passing 10858c2ecf20Sopenharmony_ci * mechanism configuration to be programmed into the rx_chan_type field of the 10868c2ecf20Sopenharmony_ci * channel's RCHAN_RCFG register. 10878c2ecf20Sopenharmony_ci * 10888c2ecf20Sopenharmony_ci * @rx_ignore_short: UDMAP receive channel short packet treatment configuration 10898c2ecf20Sopenharmony_ci * to be programmed into the rx_ignore_short field of the RCHAN_RCFG register. 10908c2ecf20Sopenharmony_ci * 10918c2ecf20Sopenharmony_ci * @rx_ignore_long: UDMAP receive channel long packet treatment configuration to 10928c2ecf20Sopenharmony_ci * be programmed into the rx_ignore_long field of the RCHAN_RCFG register. 10938c2ecf20Sopenharmony_ci * 10948c2ecf20Sopenharmony_ci * @rx_burst_size: UDMAP receive channel burst size configuration to be 10958c2ecf20Sopenharmony_ci * programmed into the rx_burst_size field of the RCHAN_RCFG register. 10968c2ecf20Sopenharmony_ci */ 10978c2ecf20Sopenharmony_cistruct ti_sci_msg_rm_udmap_rx_ch_cfg_req { 10988c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 10998c2ecf20Sopenharmony_ci u32 valid_params; 11008c2ecf20Sopenharmony_ci u16 nav_id; 11018c2ecf20Sopenharmony_ci u16 index; 11028c2ecf20Sopenharmony_ci u16 rx_fetch_size; 11038c2ecf20Sopenharmony_ci u16 rxcq_qnum; 11048c2ecf20Sopenharmony_ci u8 rx_priority; 11058c2ecf20Sopenharmony_ci u8 rx_qos; 11068c2ecf20Sopenharmony_ci u8 rx_orderid; 11078c2ecf20Sopenharmony_ci u8 rx_sched_priority; 11088c2ecf20Sopenharmony_ci u16 flowid_start; 11098c2ecf20Sopenharmony_ci u16 flowid_cnt; 11108c2ecf20Sopenharmony_ci u8 rx_pause_on_err; 11118c2ecf20Sopenharmony_ci u8 rx_atype; 11128c2ecf20Sopenharmony_ci u8 rx_chan_type; 11138c2ecf20Sopenharmony_ci u8 rx_ignore_short; 11148c2ecf20Sopenharmony_ci u8 rx_ignore_long; 11158c2ecf20Sopenharmony_ci u8 rx_burst_size; 11168c2ecf20Sopenharmony_ci} __packed; 11178c2ecf20Sopenharmony_ci 11188c2ecf20Sopenharmony_ci/** 11198c2ecf20Sopenharmony_ci * Configures a Navigator Subsystem UDMAP receive flow 11208c2ecf20Sopenharmony_ci * 11218c2ecf20Sopenharmony_ci * Configures a Navigator Subsystem UDMAP receive flow's registers. 11228c2ecf20Sopenharmony_ci * Configuration does not include the flow registers which handle size-based 11238c2ecf20Sopenharmony_ci * free descriptor queue routing. 11248c2ecf20Sopenharmony_ci * 11258c2ecf20Sopenharmony_ci * The flow index must be assigned to the host defined in the TISCI header via 11268c2ecf20Sopenharmony_ci * the RM board configuration resource assignment range list. 11278c2ecf20Sopenharmony_ci * 11288c2ecf20Sopenharmony_ci * @hdr: Standard TISCI header 11298c2ecf20Sopenharmony_ci * 11308c2ecf20Sopenharmony_ci * @valid_params 11318c2ecf20Sopenharmony_ci * Bitfield defining validity of rx flow configuration parameters. The 11328c2ecf20Sopenharmony_ci * rx flow configuration fields are not valid, and will not be used for flow 11338c2ecf20Sopenharmony_ci * configuration, if their corresponding valid bit is zero. Valid bit usage: 11348c2ecf20Sopenharmony_ci * 0 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_einfo_present 11358c2ecf20Sopenharmony_ci * 1 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_psinfo_present 11368c2ecf20Sopenharmony_ci * 2 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_error_handling 11378c2ecf20Sopenharmony_ci * 3 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_desc_type 11388c2ecf20Sopenharmony_ci * 4 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_sop_offset 11398c2ecf20Sopenharmony_ci * 5 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_qnum 11408c2ecf20Sopenharmony_ci * 6 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi 11418c2ecf20Sopenharmony_ci * 7 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo 11428c2ecf20Sopenharmony_ci * 8 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi 11438c2ecf20Sopenharmony_ci * 9 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo 11448c2ecf20Sopenharmony_ci * 10 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi_sel 11458c2ecf20Sopenharmony_ci * 11 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo_sel 11468c2ecf20Sopenharmony_ci * 12 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi_sel 11478c2ecf20Sopenharmony_ci * 13 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo_sel 11488c2ecf20Sopenharmony_ci * 14 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq0_sz0_qnum 11498c2ecf20Sopenharmony_ci * 15 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq1_sz0_qnum 11508c2ecf20Sopenharmony_ci * 16 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq2_sz0_qnum 11518c2ecf20Sopenharmony_ci * 17 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq3_sz0_qnum 11528c2ecf20Sopenharmony_ci * 18 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_ps_location 11538c2ecf20Sopenharmony_ci * 11548c2ecf20Sopenharmony_ci * @nav_id: SoC device ID of Navigator Subsystem from which the receive flow is 11558c2ecf20Sopenharmony_ci * allocated 11568c2ecf20Sopenharmony_ci * 11578c2ecf20Sopenharmony_ci * @flow_index: UDMAP receive flow index for non-optional configuration. 11588c2ecf20Sopenharmony_ci * 11598c2ecf20Sopenharmony_ci * @rx_einfo_present: 11608c2ecf20Sopenharmony_ci * UDMAP receive flow extended packet info present configuration to be 11618c2ecf20Sopenharmony_ci * programmed into the rx_einfo_present field of the flow's RFLOW_RFA register. 11628c2ecf20Sopenharmony_ci * 11638c2ecf20Sopenharmony_ci * @rx_psinfo_present: 11648c2ecf20Sopenharmony_ci * UDMAP receive flow PS words present configuration to be programmed into the 11658c2ecf20Sopenharmony_ci * rx_psinfo_present field of the flow's RFLOW_RFA register. 11668c2ecf20Sopenharmony_ci * 11678c2ecf20Sopenharmony_ci * @rx_error_handling: 11688c2ecf20Sopenharmony_ci * UDMAP receive flow error handling configuration to be programmed into the 11698c2ecf20Sopenharmony_ci * rx_error_handling field of the flow's RFLOW_RFA register. 11708c2ecf20Sopenharmony_ci * 11718c2ecf20Sopenharmony_ci * @rx_desc_type: 11728c2ecf20Sopenharmony_ci * UDMAP receive flow descriptor type configuration to be programmed into the 11738c2ecf20Sopenharmony_ci * rx_desc_type field field of the flow's RFLOW_RFA register. 11748c2ecf20Sopenharmony_ci * 11758c2ecf20Sopenharmony_ci * @rx_sop_offset: 11768c2ecf20Sopenharmony_ci * UDMAP receive flow start of packet offset configuration to be programmed 11778c2ecf20Sopenharmony_ci * into the rx_sop_offset field of the RFLOW_RFA register. See the UDMAP 11788c2ecf20Sopenharmony_ci * section of the TRM for more information on this setting. Valid values for 11798c2ecf20Sopenharmony_ci * this field are 0-255 bytes. 11808c2ecf20Sopenharmony_ci * 11818c2ecf20Sopenharmony_ci * @rx_dest_qnum: 11828c2ecf20Sopenharmony_ci * UDMAP receive flow destination queue configuration to be programmed into the 11838c2ecf20Sopenharmony_ci * rx_dest_qnum field of the flow's RFLOW_RFA register. The specified 11848c2ecf20Sopenharmony_ci * destination queue must be valid within the Navigator Subsystem and must be 11858c2ecf20Sopenharmony_ci * owned by the host, or a subordinate of the host, requesting allocation and 11868c2ecf20Sopenharmony_ci * configuration of the receive flow. 11878c2ecf20Sopenharmony_ci * 11888c2ecf20Sopenharmony_ci * @rx_src_tag_hi: 11898c2ecf20Sopenharmony_ci * UDMAP receive flow source tag high byte constant configuration to be 11908c2ecf20Sopenharmony_ci * programmed into the rx_src_tag_hi field of the flow's RFLOW_RFB register. 11918c2ecf20Sopenharmony_ci * See the UDMAP section of the TRM for more information on this setting. 11928c2ecf20Sopenharmony_ci * 11938c2ecf20Sopenharmony_ci * @rx_src_tag_lo: 11948c2ecf20Sopenharmony_ci * UDMAP receive flow source tag low byte constant configuration to be 11958c2ecf20Sopenharmony_ci * programmed into the rx_src_tag_lo field of the flow's RFLOW_RFB register. 11968c2ecf20Sopenharmony_ci * See the UDMAP section of the TRM for more information on this setting. 11978c2ecf20Sopenharmony_ci * 11988c2ecf20Sopenharmony_ci * @rx_dest_tag_hi: 11998c2ecf20Sopenharmony_ci * UDMAP receive flow destination tag high byte constant configuration to be 12008c2ecf20Sopenharmony_ci * programmed into the rx_dest_tag_hi field of the flow's RFLOW_RFB register. 12018c2ecf20Sopenharmony_ci * See the UDMAP section of the TRM for more information on this setting. 12028c2ecf20Sopenharmony_ci * 12038c2ecf20Sopenharmony_ci * @rx_dest_tag_lo: 12048c2ecf20Sopenharmony_ci * UDMAP receive flow destination tag low byte constant configuration to be 12058c2ecf20Sopenharmony_ci * programmed into the rx_dest_tag_lo field of the flow's RFLOW_RFB register. 12068c2ecf20Sopenharmony_ci * See the UDMAP section of the TRM for more information on this setting. 12078c2ecf20Sopenharmony_ci * 12088c2ecf20Sopenharmony_ci * @rx_src_tag_hi_sel: 12098c2ecf20Sopenharmony_ci * UDMAP receive flow source tag high byte selector configuration to be 12108c2ecf20Sopenharmony_ci * programmed into the rx_src_tag_hi_sel field of the RFLOW_RFC register. See 12118c2ecf20Sopenharmony_ci * the UDMAP section of the TRM for more information on this setting. 12128c2ecf20Sopenharmony_ci * 12138c2ecf20Sopenharmony_ci * @rx_src_tag_lo_sel: 12148c2ecf20Sopenharmony_ci * UDMAP receive flow source tag low byte selector configuration to be 12158c2ecf20Sopenharmony_ci * programmed into the rx_src_tag_lo_sel field of the RFLOW_RFC register. See 12168c2ecf20Sopenharmony_ci * the UDMAP section of the TRM for more information on this setting. 12178c2ecf20Sopenharmony_ci * 12188c2ecf20Sopenharmony_ci * @rx_dest_tag_hi_sel: 12198c2ecf20Sopenharmony_ci * UDMAP receive flow destination tag high byte selector configuration to be 12208c2ecf20Sopenharmony_ci * programmed into the rx_dest_tag_hi_sel field of the RFLOW_RFC register. See 12218c2ecf20Sopenharmony_ci * the UDMAP section of the TRM for more information on this setting. 12228c2ecf20Sopenharmony_ci * 12238c2ecf20Sopenharmony_ci * @rx_dest_tag_lo_sel: 12248c2ecf20Sopenharmony_ci * UDMAP receive flow destination tag low byte selector configuration to be 12258c2ecf20Sopenharmony_ci * programmed into the rx_dest_tag_lo_sel field of the RFLOW_RFC register. See 12268c2ecf20Sopenharmony_ci * the UDMAP section of the TRM for more information on this setting. 12278c2ecf20Sopenharmony_ci * 12288c2ecf20Sopenharmony_ci * @rx_fdq0_sz0_qnum: 12298c2ecf20Sopenharmony_ci * UDMAP receive flow free descriptor queue 0 configuration to be programmed 12308c2ecf20Sopenharmony_ci * into the rx_fdq0_sz0_qnum field of the flow's RFLOW_RFD register. See the 12318c2ecf20Sopenharmony_ci * UDMAP section of the TRM for more information on this setting. The specified 12328c2ecf20Sopenharmony_ci * free queue must be valid within the Navigator Subsystem and must be owned 12338c2ecf20Sopenharmony_ci * by the host, or a subordinate of the host, requesting allocation and 12348c2ecf20Sopenharmony_ci * configuration of the receive flow. 12358c2ecf20Sopenharmony_ci * 12368c2ecf20Sopenharmony_ci * @rx_fdq1_qnum: 12378c2ecf20Sopenharmony_ci * UDMAP receive flow free descriptor queue 1 configuration to be programmed 12388c2ecf20Sopenharmony_ci * into the rx_fdq1_qnum field of the flow's RFLOW_RFD register. See the 12398c2ecf20Sopenharmony_ci * UDMAP section of the TRM for more information on this setting. The specified 12408c2ecf20Sopenharmony_ci * free queue must be valid within the Navigator Subsystem and must be owned 12418c2ecf20Sopenharmony_ci * by the host, or a subordinate of the host, requesting allocation and 12428c2ecf20Sopenharmony_ci * configuration of the receive flow. 12438c2ecf20Sopenharmony_ci * 12448c2ecf20Sopenharmony_ci * @rx_fdq2_qnum: 12458c2ecf20Sopenharmony_ci * UDMAP receive flow free descriptor queue 2 configuration to be programmed 12468c2ecf20Sopenharmony_ci * into the rx_fdq2_qnum field of the flow's RFLOW_RFE register. See the 12478c2ecf20Sopenharmony_ci * UDMAP section of the TRM for more information on this setting. The specified 12488c2ecf20Sopenharmony_ci * free queue must be valid within the Navigator Subsystem and must be owned 12498c2ecf20Sopenharmony_ci * by the host, or a subordinate of the host, requesting allocation and 12508c2ecf20Sopenharmony_ci * configuration of the receive flow. 12518c2ecf20Sopenharmony_ci * 12528c2ecf20Sopenharmony_ci * @rx_fdq3_qnum: 12538c2ecf20Sopenharmony_ci * UDMAP receive flow free descriptor queue 3 configuration to be programmed 12548c2ecf20Sopenharmony_ci * into the rx_fdq3_qnum field of the flow's RFLOW_RFE register. See the 12558c2ecf20Sopenharmony_ci * UDMAP section of the TRM for more information on this setting. The specified 12568c2ecf20Sopenharmony_ci * free queue must be valid within the Navigator Subsystem and must be owned 12578c2ecf20Sopenharmony_ci * by the host, or a subordinate of the host, requesting allocation and 12588c2ecf20Sopenharmony_ci * configuration of the receive flow. 12598c2ecf20Sopenharmony_ci * 12608c2ecf20Sopenharmony_ci * @rx_ps_location: 12618c2ecf20Sopenharmony_ci * UDMAP receive flow PS words location configuration to be programmed into the 12628c2ecf20Sopenharmony_ci * rx_ps_location field of the flow's RFLOW_RFA register. 12638c2ecf20Sopenharmony_ci */ 12648c2ecf20Sopenharmony_cistruct ti_sci_msg_rm_udmap_flow_cfg_req { 12658c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 12668c2ecf20Sopenharmony_ci u32 valid_params; 12678c2ecf20Sopenharmony_ci u16 nav_id; 12688c2ecf20Sopenharmony_ci u16 flow_index; 12698c2ecf20Sopenharmony_ci u8 rx_einfo_present; 12708c2ecf20Sopenharmony_ci u8 rx_psinfo_present; 12718c2ecf20Sopenharmony_ci u8 rx_error_handling; 12728c2ecf20Sopenharmony_ci u8 rx_desc_type; 12738c2ecf20Sopenharmony_ci u16 rx_sop_offset; 12748c2ecf20Sopenharmony_ci u16 rx_dest_qnum; 12758c2ecf20Sopenharmony_ci u8 rx_src_tag_hi; 12768c2ecf20Sopenharmony_ci u8 rx_src_tag_lo; 12778c2ecf20Sopenharmony_ci u8 rx_dest_tag_hi; 12788c2ecf20Sopenharmony_ci u8 rx_dest_tag_lo; 12798c2ecf20Sopenharmony_ci u8 rx_src_tag_hi_sel; 12808c2ecf20Sopenharmony_ci u8 rx_src_tag_lo_sel; 12818c2ecf20Sopenharmony_ci u8 rx_dest_tag_hi_sel; 12828c2ecf20Sopenharmony_ci u8 rx_dest_tag_lo_sel; 12838c2ecf20Sopenharmony_ci u16 rx_fdq0_sz0_qnum; 12848c2ecf20Sopenharmony_ci u16 rx_fdq1_qnum; 12858c2ecf20Sopenharmony_ci u16 rx_fdq2_qnum; 12868c2ecf20Sopenharmony_ci u16 rx_fdq3_qnum; 12878c2ecf20Sopenharmony_ci u8 rx_ps_location; 12888c2ecf20Sopenharmony_ci} __packed; 12898c2ecf20Sopenharmony_ci 12908c2ecf20Sopenharmony_ci/** 12918c2ecf20Sopenharmony_ci * struct ti_sci_msg_req_proc_request - Request a processor 12928c2ecf20Sopenharmony_ci * @hdr: Generic Header 12938c2ecf20Sopenharmony_ci * @processor_id: ID of processor being requested 12948c2ecf20Sopenharmony_ci * 12958c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_PROC_REQUEST, response is a generic ACK/NACK 12968c2ecf20Sopenharmony_ci * message. 12978c2ecf20Sopenharmony_ci */ 12988c2ecf20Sopenharmony_cistruct ti_sci_msg_req_proc_request { 12998c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 13008c2ecf20Sopenharmony_ci u8 processor_id; 13018c2ecf20Sopenharmony_ci} __packed; 13028c2ecf20Sopenharmony_ci 13038c2ecf20Sopenharmony_ci/** 13048c2ecf20Sopenharmony_ci * struct ti_sci_msg_req_proc_release - Release a processor 13058c2ecf20Sopenharmony_ci * @hdr: Generic Header 13068c2ecf20Sopenharmony_ci * @processor_id: ID of processor being released 13078c2ecf20Sopenharmony_ci * 13088c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_PROC_RELEASE, response is a generic ACK/NACK 13098c2ecf20Sopenharmony_ci * message. 13108c2ecf20Sopenharmony_ci */ 13118c2ecf20Sopenharmony_cistruct ti_sci_msg_req_proc_release { 13128c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 13138c2ecf20Sopenharmony_ci u8 processor_id; 13148c2ecf20Sopenharmony_ci} __packed; 13158c2ecf20Sopenharmony_ci 13168c2ecf20Sopenharmony_ci/** 13178c2ecf20Sopenharmony_ci * struct ti_sci_msg_req_proc_handover - Handover a processor to a host 13188c2ecf20Sopenharmony_ci * @hdr: Generic Header 13198c2ecf20Sopenharmony_ci * @processor_id: ID of processor being handed over 13208c2ecf20Sopenharmony_ci * @host_id: Host ID the control needs to be transferred to 13218c2ecf20Sopenharmony_ci * 13228c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_PROC_HANDOVER, response is a generic ACK/NACK 13238c2ecf20Sopenharmony_ci * message. 13248c2ecf20Sopenharmony_ci */ 13258c2ecf20Sopenharmony_cistruct ti_sci_msg_req_proc_handover { 13268c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 13278c2ecf20Sopenharmony_ci u8 processor_id; 13288c2ecf20Sopenharmony_ci u8 host_id; 13298c2ecf20Sopenharmony_ci} __packed; 13308c2ecf20Sopenharmony_ci 13318c2ecf20Sopenharmony_ci/* Boot Vector masks */ 13328c2ecf20Sopenharmony_ci#define TI_SCI_ADDR_LOW_MASK GENMASK_ULL(31, 0) 13338c2ecf20Sopenharmony_ci#define TI_SCI_ADDR_HIGH_MASK GENMASK_ULL(63, 32) 13348c2ecf20Sopenharmony_ci#define TI_SCI_ADDR_HIGH_SHIFT 32 13358c2ecf20Sopenharmony_ci 13368c2ecf20Sopenharmony_ci/** 13378c2ecf20Sopenharmony_ci * struct ti_sci_msg_req_set_config - Set Processor boot configuration 13388c2ecf20Sopenharmony_ci * @hdr: Generic Header 13398c2ecf20Sopenharmony_ci * @processor_id: ID of processor being configured 13408c2ecf20Sopenharmony_ci * @bootvector_low: Lower 32 bit address (Little Endian) of boot vector 13418c2ecf20Sopenharmony_ci * @bootvector_high: Higher 32 bit address (Little Endian) of boot vector 13428c2ecf20Sopenharmony_ci * @config_flags_set: Optional Processor specific Config Flags to set. 13438c2ecf20Sopenharmony_ci * Setting a bit here implies the corresponding mode 13448c2ecf20Sopenharmony_ci * will be set 13458c2ecf20Sopenharmony_ci * @config_flags_clear: Optional Processor specific Config Flags to clear. 13468c2ecf20Sopenharmony_ci * Setting a bit here implies the corresponding mode 13478c2ecf20Sopenharmony_ci * will be cleared 13488c2ecf20Sopenharmony_ci * 13498c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_PROC_HANDOVER, response is a generic ACK/NACK 13508c2ecf20Sopenharmony_ci * message. 13518c2ecf20Sopenharmony_ci */ 13528c2ecf20Sopenharmony_cistruct ti_sci_msg_req_set_config { 13538c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 13548c2ecf20Sopenharmony_ci u8 processor_id; 13558c2ecf20Sopenharmony_ci u32 bootvector_low; 13568c2ecf20Sopenharmony_ci u32 bootvector_high; 13578c2ecf20Sopenharmony_ci u32 config_flags_set; 13588c2ecf20Sopenharmony_ci u32 config_flags_clear; 13598c2ecf20Sopenharmony_ci} __packed; 13608c2ecf20Sopenharmony_ci 13618c2ecf20Sopenharmony_ci/** 13628c2ecf20Sopenharmony_ci * struct ti_sci_msg_req_set_ctrl - Set Processor boot control flags 13638c2ecf20Sopenharmony_ci * @hdr: Generic Header 13648c2ecf20Sopenharmony_ci * @processor_id: ID of processor being configured 13658c2ecf20Sopenharmony_ci * @control_flags_set: Optional Processor specific Control Flags to set. 13668c2ecf20Sopenharmony_ci * Setting a bit here implies the corresponding mode 13678c2ecf20Sopenharmony_ci * will be set 13688c2ecf20Sopenharmony_ci * @control_flags_clear:Optional Processor specific Control Flags to clear. 13698c2ecf20Sopenharmony_ci * Setting a bit here implies the corresponding mode 13708c2ecf20Sopenharmony_ci * will be cleared 13718c2ecf20Sopenharmony_ci * 13728c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_SET_CTRL, response is a generic ACK/NACK 13738c2ecf20Sopenharmony_ci * message. 13748c2ecf20Sopenharmony_ci */ 13758c2ecf20Sopenharmony_cistruct ti_sci_msg_req_set_ctrl { 13768c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 13778c2ecf20Sopenharmony_ci u8 processor_id; 13788c2ecf20Sopenharmony_ci u32 control_flags_set; 13798c2ecf20Sopenharmony_ci u32 control_flags_clear; 13808c2ecf20Sopenharmony_ci} __packed; 13818c2ecf20Sopenharmony_ci 13828c2ecf20Sopenharmony_ci/** 13838c2ecf20Sopenharmony_ci * struct ti_sci_msg_req_get_status - Processor boot status request 13848c2ecf20Sopenharmony_ci * @hdr: Generic Header 13858c2ecf20Sopenharmony_ci * @processor_id: ID of processor whose status is being requested 13868c2ecf20Sopenharmony_ci * 13878c2ecf20Sopenharmony_ci * Request type is TI_SCI_MSG_GET_STATUS, response is an appropriate 13888c2ecf20Sopenharmony_ci * message, or NACK in case of inability to satisfy request. 13898c2ecf20Sopenharmony_ci */ 13908c2ecf20Sopenharmony_cistruct ti_sci_msg_req_get_status { 13918c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 13928c2ecf20Sopenharmony_ci u8 processor_id; 13938c2ecf20Sopenharmony_ci} __packed; 13948c2ecf20Sopenharmony_ci 13958c2ecf20Sopenharmony_ci/** 13968c2ecf20Sopenharmony_ci * struct ti_sci_msg_resp_get_status - Processor boot status response 13978c2ecf20Sopenharmony_ci * @hdr: Generic Header 13988c2ecf20Sopenharmony_ci * @processor_id: ID of processor whose status is returned 13998c2ecf20Sopenharmony_ci * @bootvector_low: Lower 32 bit address (Little Endian) of boot vector 14008c2ecf20Sopenharmony_ci * @bootvector_high: Higher 32 bit address (Little Endian) of boot vector 14018c2ecf20Sopenharmony_ci * @config_flags: Optional Processor specific Config Flags set currently 14028c2ecf20Sopenharmony_ci * @control_flags: Optional Processor specific Control Flags set currently 14038c2ecf20Sopenharmony_ci * @status_flags: Optional Processor specific Status Flags set currently 14048c2ecf20Sopenharmony_ci * 14058c2ecf20Sopenharmony_ci * Response structure to a TI_SCI_MSG_GET_STATUS request. 14068c2ecf20Sopenharmony_ci */ 14078c2ecf20Sopenharmony_cistruct ti_sci_msg_resp_get_status { 14088c2ecf20Sopenharmony_ci struct ti_sci_msg_hdr hdr; 14098c2ecf20Sopenharmony_ci u8 processor_id; 14108c2ecf20Sopenharmony_ci u32 bootvector_low; 14118c2ecf20Sopenharmony_ci u32 bootvector_high; 14128c2ecf20Sopenharmony_ci u32 config_flags; 14138c2ecf20Sopenharmony_ci u32 control_flags; 14148c2ecf20Sopenharmony_ci u32 status_flags; 14158c2ecf20Sopenharmony_ci} __packed; 14168c2ecf20Sopenharmony_ci 14178c2ecf20Sopenharmony_ci#endif /* __TI_SCI_H */ 1418