ti_sci.h 59 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551
  1. /* SPDX-License-Identifier: BSD-3-Clause */
  2. /*
  3. * Texas Instruments System Control Interface (TISCI) Protocol
  4. *
  5. * Communication protocol with TI SCI hardware
  6. * The system works in a message response protocol
  7. * See: https://software-dl.ti.com/tisci/esd/latest/index.html for details
  8. *
  9. * Copyright (C) 2015-2024 Texas Instruments Incorporated - https://www.ti.com/
  10. */
  11. #ifndef __TI_SCI_H
  12. #define __TI_SCI_H
  13. /* Generic Messages */
  14. #define TI_SCI_MSG_ENABLE_WDT 0x0000
  15. #define TI_SCI_MSG_WAKE_RESET 0x0001
  16. #define TI_SCI_MSG_VERSION 0x0002
  17. #define TI_SCI_MSG_WAKE_REASON 0x0003
  18. #define TI_SCI_MSG_GOODBYE 0x0004
  19. #define TI_SCI_MSG_SYS_RESET 0x0005
  20. #define TI_SCI_MSG_QUERY_FW_CAPS 0x0022
  21. /* Device requests */
  22. #define TI_SCI_MSG_SET_DEVICE_STATE 0x0200
  23. #define TI_SCI_MSG_GET_DEVICE_STATE 0x0201
  24. #define TI_SCI_MSG_SET_DEVICE_RESETS 0x0202
  25. /* Clock requests */
  26. #define TI_SCI_MSG_SET_CLOCK_STATE 0x0100
  27. #define TI_SCI_MSG_GET_CLOCK_STATE 0x0101
  28. #define TI_SCI_MSG_SET_CLOCK_PARENT 0x0102
  29. #define TI_SCI_MSG_GET_CLOCK_PARENT 0x0103
  30. #define TI_SCI_MSG_GET_NUM_CLOCK_PARENTS 0x0104
  31. #define TI_SCI_MSG_SET_CLOCK_FREQ 0x010c
  32. #define TI_SCI_MSG_QUERY_CLOCK_FREQ 0x010d
  33. #define TI_SCI_MSG_GET_CLOCK_FREQ 0x010e
  34. /* Low Power Mode Requests */
  35. #define TI_SCI_MSG_PREPARE_SLEEP 0x0300
  36. #define TI_SCI_MSG_LPM_WAKE_REASON 0x0306
  37. #define TI_SCI_MSG_SET_IO_ISOLATION 0x0307
  38. #define TI_SCI_MSG_LPM_SET_DEVICE_CONSTRAINT 0x0309
  39. #define TI_SCI_MSG_LPM_SET_LATENCY_CONSTRAINT 0x030A
  40. #define TI_SCI_MSG_LPM_ABORT 0x0311
  41. /* Resource Management Requests */
  42. #define TI_SCI_MSG_GET_RESOURCE_RANGE 0x1500
  43. /* IRQ requests */
  44. #define TI_SCI_MSG_SET_IRQ 0x1000
  45. #define TI_SCI_MSG_FREE_IRQ 0x1001
  46. /* NAVSS resource management */
  47. /* Ringacc requests */
  48. #define TI_SCI_MSG_RM_RING_ALLOCATE 0x1100
  49. #define TI_SCI_MSG_RM_RING_FREE 0x1101
  50. #define TI_SCI_MSG_RM_RING_RECONFIG 0x1102
  51. #define TI_SCI_MSG_RM_RING_RESET 0x1103
  52. #define TI_SCI_MSG_RM_RING_CFG 0x1110
  53. /* PSI-L requests */
  54. #define TI_SCI_MSG_RM_PSIL_PAIR 0x1280
  55. #define TI_SCI_MSG_RM_PSIL_UNPAIR 0x1281
  56. #define TI_SCI_MSG_RM_UDMAP_TX_ALLOC 0x1200
  57. #define TI_SCI_MSG_RM_UDMAP_TX_FREE 0x1201
  58. #define TI_SCI_MSG_RM_UDMAP_RX_ALLOC 0x1210
  59. #define TI_SCI_MSG_RM_UDMAP_RX_FREE 0x1211
  60. #define TI_SCI_MSG_RM_UDMAP_FLOW_CFG 0x1220
  61. #define TI_SCI_MSG_RM_UDMAP_OPT_FLOW_CFG 0x1221
  62. #define TISCI_MSG_RM_UDMAP_TX_CH_CFG 0x1205
  63. #define TISCI_MSG_RM_UDMAP_TX_CH_GET_CFG 0x1206
  64. #define TISCI_MSG_RM_UDMAP_RX_CH_CFG 0x1215
  65. #define TISCI_MSG_RM_UDMAP_RX_CH_GET_CFG 0x1216
  66. #define TISCI_MSG_RM_UDMAP_FLOW_CFG 0x1230
  67. #define TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_CFG 0x1231
  68. #define TISCI_MSG_RM_UDMAP_FLOW_GET_CFG 0x1232
  69. #define TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_GET_CFG 0x1233
  70. /* Processor Control requests */
  71. #define TI_SCI_MSG_PROC_REQUEST 0xc000
  72. #define TI_SCI_MSG_PROC_RELEASE 0xc001
  73. #define TI_SCI_MSG_PROC_HANDOVER 0xc005
  74. #define TI_SCI_MSG_SET_CONFIG 0xc100
  75. #define TI_SCI_MSG_SET_CTRL 0xc101
  76. #define TI_SCI_MSG_GET_STATUS 0xc400
  77. /**
  78. * struct ti_sci_msg_hdr - Generic Message Header for All messages and responses
  79. * @type: Type of messages: One of TI_SCI_MSG* values
  80. * @host: Host of the message
  81. * @seq: Message identifier indicating a transfer sequence
  82. * @flags: Flag for the message
  83. */
  84. struct ti_sci_msg_hdr {
  85. u16 type;
  86. u8 host;
  87. u8 seq;
  88. #define TI_SCI_MSG_FLAG(val) (1 << (val))
  89. #define TI_SCI_FLAG_REQ_GENERIC_NORESPONSE 0x0
  90. #define TI_SCI_FLAG_REQ_ACK_ON_RECEIVED TI_SCI_MSG_FLAG(0)
  91. #define TI_SCI_FLAG_REQ_ACK_ON_PROCESSED TI_SCI_MSG_FLAG(1)
  92. #define TI_SCI_FLAG_RESP_GENERIC_NACK 0x0
  93. #define TI_SCI_FLAG_RESP_GENERIC_ACK TI_SCI_MSG_FLAG(1)
  94. /* Additional Flags */
  95. u32 flags;
  96. } __packed;
  97. /**
  98. * struct ti_sci_msg_resp_version - Response for a message
  99. * @hdr: Generic header
  100. * @firmware_description: String describing the firmware
  101. * @firmware_revision: Firmware revision
  102. * @abi_major: Major version of the ABI that firmware supports
  103. * @abi_minor: Minor version of the ABI that firmware supports
  104. *
  105. * In general, ABI version changes follow the rule that minor version increments
  106. * are backward compatible. Major revision changes in ABI may not be
  107. * backward compatible.
  108. *
  109. * Response to a generic message with message type TI_SCI_MSG_VERSION
  110. */
  111. struct ti_sci_msg_resp_version {
  112. struct ti_sci_msg_hdr hdr;
  113. char firmware_description[32];
  114. u16 firmware_revision;
  115. u8 abi_major;
  116. u8 abi_minor;
  117. } __packed;
  118. /**
  119. * struct ti_sci_msg_req_reboot - Reboot the SoC
  120. * @hdr: Generic Header
  121. *
  122. * Request type is TI_SCI_MSG_SYS_RESET, responded with a generic
  123. * ACK/NACK message.
  124. */
  125. struct ti_sci_msg_req_reboot {
  126. struct ti_sci_msg_hdr hdr;
  127. } __packed;
  128. /**
  129. * struct ti_sci_msg_resp_query_fw_caps - Response for query firmware caps
  130. * @hdr: Generic header
  131. * @fw_caps: Each bit in fw_caps indicating one FW/SOC capability
  132. * MSG_FLAG_CAPS_GENERIC: Generic capability (LPM not supported)
  133. * MSG_FLAG_CAPS_LPM_PARTIAL_IO: Partial IO in LPM
  134. * MSG_FLAG_CAPS_LPM_DM_MANAGED: LPM can be managed by DM
  135. * MSG_FLAG_CAPS_LPM_ABORT: Abort entry to LPM
  136. * MSG_FLAG_CAPS_IO_ISOLATION: IO Isolation support
  137. *
  138. * Response to a generic message with message type TI_SCI_MSG_QUERY_FW_CAPS
  139. * providing currently available SOC/firmware capabilities. SoC that don't
  140. * support low power modes return only MSG_FLAG_CAPS_GENERIC capability.
  141. */
  142. struct ti_sci_msg_resp_query_fw_caps {
  143. struct ti_sci_msg_hdr hdr;
  144. #define MSG_FLAG_CAPS_GENERIC TI_SCI_MSG_FLAG(0)
  145. #define MSG_FLAG_CAPS_LPM_PARTIAL_IO TI_SCI_MSG_FLAG(4)
  146. #define MSG_FLAG_CAPS_LPM_DM_MANAGED TI_SCI_MSG_FLAG(5)
  147. #define MSG_FLAG_CAPS_LPM_ABORT TI_SCI_MSG_FLAG(9)
  148. #define MSG_FLAG_CAPS_IO_ISOLATION TI_SCI_MSG_FLAG(7)
  149. #define MSG_MASK_CAPS_LPM GENMASK_ULL(4, 1)
  150. u64 fw_caps;
  151. } __packed;
  152. /**
  153. * struct ti_sci_msg_req_set_device_state - Set the desired state of the device
  154. * @hdr: Generic header
  155. * @id: Indicates which device to modify
  156. * @reserved: Reserved space in message, must be 0 for backward compatibility
  157. * @state: The desired state of the device.
  158. *
  159. * Certain flags can also be set to alter the device state:
  160. * + MSG_FLAG_DEVICE_WAKE_ENABLED - Configure the device to be a wake source.
  161. * The meaning of this flag will vary slightly from device to device and from
  162. * SoC to SoC but it generally allows the device to wake the SoC out of deep
  163. * suspend states.
  164. * + MSG_FLAG_DEVICE_RESET_ISO - Enable reset isolation for this device.
  165. * + MSG_FLAG_DEVICE_EXCLUSIVE - Claim this device exclusively. When passed
  166. * with STATE_RETENTION or STATE_ON, it will claim the device exclusively.
  167. * If another host already has this device set to STATE_RETENTION or STATE_ON,
  168. * the message will fail. Once successful, other hosts attempting to set
  169. * STATE_RETENTION or STATE_ON will fail.
  170. *
  171. * Request type is TI_SCI_MSG_SET_DEVICE_STATE, responded with a generic
  172. * ACK/NACK message.
  173. */
  174. struct ti_sci_msg_req_set_device_state {
  175. /* Additional hdr->flags options */
  176. #define MSG_FLAG_DEVICE_WAKE_ENABLED TI_SCI_MSG_FLAG(8)
  177. #define MSG_FLAG_DEVICE_RESET_ISO TI_SCI_MSG_FLAG(9)
  178. #define MSG_FLAG_DEVICE_EXCLUSIVE TI_SCI_MSG_FLAG(10)
  179. struct ti_sci_msg_hdr hdr;
  180. u32 id;
  181. u32 reserved;
  182. #define MSG_DEVICE_SW_STATE_AUTO_OFF 0
  183. #define MSG_DEVICE_SW_STATE_RETENTION 1
  184. #define MSG_DEVICE_SW_STATE_ON 2
  185. u8 state;
  186. } __packed;
  187. /**
  188. * struct ti_sci_msg_req_get_device_state - Request to get device.
  189. * @hdr: Generic header
  190. * @id: Device Identifier
  191. *
  192. * Request type is TI_SCI_MSG_GET_DEVICE_STATE, responded device state
  193. * information
  194. */
  195. struct ti_sci_msg_req_get_device_state {
  196. struct ti_sci_msg_hdr hdr;
  197. u32 id;
  198. } __packed;
  199. /**
  200. * struct ti_sci_msg_resp_get_device_state - Response to get device request.
  201. * @hdr: Generic header
  202. * @context_loss_count: Indicates how many times the device has lost context. A
  203. * driver can use this monotonic counter to determine if the device has
  204. * lost context since the last time this message was exchanged.
  205. * @resets: Programmed state of the reset lines.
  206. * @programmed_state: The state as programmed by set_device.
  207. * - Uses the MSG_DEVICE_SW_* macros
  208. * @current_state: The actual state of the hardware.
  209. *
  210. * Response to request TI_SCI_MSG_GET_DEVICE_STATE.
  211. */
  212. struct ti_sci_msg_resp_get_device_state {
  213. struct ti_sci_msg_hdr hdr;
  214. u32 context_loss_count;
  215. u32 resets;
  216. u8 programmed_state;
  217. #define MSG_DEVICE_HW_STATE_OFF 0
  218. #define MSG_DEVICE_HW_STATE_ON 1
  219. #define MSG_DEVICE_HW_STATE_TRANS 2
  220. u8 current_state;
  221. } __packed;
  222. /**
  223. * struct ti_sci_msg_req_set_device_resets - Set the desired resets
  224. * configuration of the device
  225. * @hdr: Generic header
  226. * @id: Indicates which device to modify
  227. * @resets: A bit field of resets for the device. The meaning, behavior,
  228. * and usage of the reset flags are device specific. 0 for a bit
  229. * indicates releasing the reset represented by that bit while 1
  230. * indicates keeping it held.
  231. *
  232. * Request type is TI_SCI_MSG_SET_DEVICE_RESETS, responded with a generic
  233. * ACK/NACK message.
  234. */
  235. struct ti_sci_msg_req_set_device_resets {
  236. struct ti_sci_msg_hdr hdr;
  237. u32 id;
  238. u32 resets;
  239. } __packed;
  240. /**
  241. * struct ti_sci_msg_req_set_clock_state - Request to setup a Clock state
  242. * @hdr: Generic Header, Certain flags can be set specific to the clocks:
  243. * MSG_FLAG_CLOCK_ALLOW_SSC: Allow this clock to be modified
  244. * via spread spectrum clocking.
  245. * MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE: Allow this clock's
  246. * frequency to be changed while it is running so long as it
  247. * is within the min/max limits.
  248. * MSG_FLAG_CLOCK_INPUT_TERM: Enable input termination, this
  249. * is only applicable to clock inputs on the SoC pseudo-device.
  250. * @dev_id: Device identifier this request is for
  251. * @clk_id: Clock identifier for the device for this request.
  252. * Each device has it's own set of clock inputs. This indexes
  253. * which clock input to modify. Set to 255 if clock ID is
  254. * greater than or equal to 255.
  255. * @request_state: Request the state for the clock to be set to.
  256. * MSG_CLOCK_SW_STATE_UNREQ: The IP does not require this clock,
  257. * it can be disabled, regardless of the state of the device
  258. * MSG_CLOCK_SW_STATE_AUTO: Allow the System Controller to
  259. * automatically manage the state of this clock. If the device
  260. * is enabled, then the clock is enabled. If the device is set
  261. * to off or retention, then the clock is internally set as not
  262. * being required by the device.(default)
  263. * MSG_CLOCK_SW_STATE_REQ: Configure the clock to be enabled,
  264. * regardless of the state of the device.
  265. * @clk_id_32: Clock identifier for the device for this request.
  266. * Only to be used if the clock ID is greater than or equal to
  267. * 255.
  268. *
  269. * Normally, all required clocks are managed by TISCI entity, this is used
  270. * only for specific control *IF* required. Auto managed state is
  271. * MSG_CLOCK_SW_STATE_AUTO, in other states, TISCI entity assume remote
  272. * will explicitly control.
  273. *
  274. * Request type is TI_SCI_MSG_SET_CLOCK_STATE, response is a generic
  275. * ACK or NACK message.
  276. */
  277. struct ti_sci_msg_req_set_clock_state {
  278. /* Additional hdr->flags options */
  279. #define MSG_FLAG_CLOCK_ALLOW_SSC TI_SCI_MSG_FLAG(8)
  280. #define MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE TI_SCI_MSG_FLAG(9)
  281. #define MSG_FLAG_CLOCK_INPUT_TERM TI_SCI_MSG_FLAG(10)
  282. struct ti_sci_msg_hdr hdr;
  283. u32 dev_id;
  284. u8 clk_id;
  285. #define MSG_CLOCK_SW_STATE_UNREQ 0
  286. #define MSG_CLOCK_SW_STATE_AUTO 1
  287. #define MSG_CLOCK_SW_STATE_REQ 2
  288. u8 request_state;
  289. u32 clk_id_32;
  290. } __packed;
  291. /**
  292. * struct ti_sci_msg_req_get_clock_state - Request for clock state
  293. * @hdr: Generic Header
  294. * @dev_id: Device identifier this request is for
  295. * @clk_id: Clock identifier for the device for this request.
  296. * Each device has it's own set of clock inputs. This indexes
  297. * which clock input to get state of. Set to 255 if the clock
  298. * ID is greater than or equal to 255.
  299. * @clk_id_32: Clock identifier for the device for the request.
  300. * Only to be used if the clock ID is greater than or equal to
  301. * 255.
  302. *
  303. * Request type is TI_SCI_MSG_GET_CLOCK_STATE, response is state
  304. * of the clock
  305. */
  306. struct ti_sci_msg_req_get_clock_state {
  307. struct ti_sci_msg_hdr hdr;
  308. u32 dev_id;
  309. u8 clk_id;
  310. u32 clk_id_32;
  311. } __packed;
  312. /**
  313. * struct ti_sci_msg_resp_get_clock_state - Response to get clock state
  314. * @hdr: Generic Header
  315. * @programmed_state: Any programmed state of the clock. This is one of
  316. * MSG_CLOCK_SW_STATE* values.
  317. * @current_state: Current state of the clock. This is one of:
  318. * MSG_CLOCK_HW_STATE_NOT_READY: Clock is not ready
  319. * MSG_CLOCK_HW_STATE_READY: Clock is ready
  320. *
  321. * Response to TI_SCI_MSG_GET_CLOCK_STATE.
  322. */
  323. struct ti_sci_msg_resp_get_clock_state {
  324. struct ti_sci_msg_hdr hdr;
  325. u8 programmed_state;
  326. #define MSG_CLOCK_HW_STATE_NOT_READY 0
  327. #define MSG_CLOCK_HW_STATE_READY 1
  328. u8 current_state;
  329. } __packed;
  330. /**
  331. * struct ti_sci_msg_req_set_clock_parent - Set the clock parent
  332. * @hdr: Generic Header
  333. * @dev_id: Device identifier this request is for
  334. * @clk_id: Clock identifier for the device for this request.
  335. * Each device has it's own set of clock inputs. This indexes
  336. * which clock input to modify. Set to 255 if clock ID is
  337. * greater than or equal to 255.
  338. * @parent_id: The new clock parent is selectable by an index via this
  339. * parameter. Set to 255 if clock ID is greater than or
  340. * equal to 255.
  341. * @clk_id_32: Clock identifier if @clk_id field is 255.
  342. * @parent_id_32: Parent identifier if @parent_id is 255.
  343. *
  344. * Request type is TI_SCI_MSG_SET_CLOCK_PARENT, response is generic
  345. * ACK / NACK message.
  346. */
  347. struct ti_sci_msg_req_set_clock_parent {
  348. struct ti_sci_msg_hdr hdr;
  349. u32 dev_id;
  350. u8 clk_id;
  351. u8 parent_id;
  352. u32 clk_id_32;
  353. u32 parent_id_32;
  354. } __packed;
  355. /**
  356. * struct ti_sci_msg_req_get_clock_parent - Get the clock parent
  357. * @hdr: Generic Header
  358. * @dev_id: Device identifier this request is for
  359. * @clk_id: Clock identifier for the device for this request.
  360. * Each device has it's own set of clock inputs. This indexes
  361. * which clock input to get the parent for. If this field
  362. * contains 255, the actual clock identifier is stored in
  363. * @clk_id_32.
  364. * @clk_id_32: Clock identifier if the @clk_id field contains 255.
  365. *
  366. * Request type is TI_SCI_MSG_GET_CLOCK_PARENT, response is parent information
  367. */
  368. struct ti_sci_msg_req_get_clock_parent {
  369. struct ti_sci_msg_hdr hdr;
  370. u32 dev_id;
  371. u8 clk_id;
  372. u32 clk_id_32;
  373. } __packed;
  374. /**
  375. * struct ti_sci_msg_resp_get_clock_parent - Response with clock parent
  376. * @hdr: Generic Header
  377. * @parent_id: The current clock parent. If set to 255, the current parent
  378. * ID can be found from the @parent_id_32 field.
  379. * @parent_id_32: Current clock parent if @parent_id field is set to
  380. * 255.
  381. *
  382. * Response to TI_SCI_MSG_GET_CLOCK_PARENT.
  383. */
  384. struct ti_sci_msg_resp_get_clock_parent {
  385. struct ti_sci_msg_hdr hdr;
  386. u8 parent_id;
  387. u32 parent_id_32;
  388. } __packed;
  389. /**
  390. * struct ti_sci_msg_req_get_clock_num_parents - Request to get clock parents
  391. * @hdr: Generic header
  392. * @dev_id: Device identifier this request is for
  393. * @clk_id: Clock identifier for the device for this request. Set to
  394. * 255 if clock ID is greater than or equal to 255.
  395. * @clk_id_32: Clock identifier if the @clk_id field contains 255.
  396. *
  397. * This request provides information about how many clock parent options
  398. * are available for a given clock to a device. This is typically used
  399. * for input clocks.
  400. *
  401. * Request type is TI_SCI_MSG_GET_NUM_CLOCK_PARENTS, response is appropriate
  402. * message, or NACK in case of inability to satisfy request.
  403. */
  404. struct ti_sci_msg_req_get_clock_num_parents {
  405. struct ti_sci_msg_hdr hdr;
  406. u32 dev_id;
  407. u8 clk_id;
  408. u32 clk_id_32;
  409. } __packed;
  410. /**
  411. * struct ti_sci_msg_resp_get_clock_num_parents - Response for get clk parents
  412. * @hdr: Generic header
  413. * @num_parents: Number of clock parents. If set to 255, the actual
  414. * number of parents is stored into @num_parents_32
  415. * field instead.
  416. * @num_parents_32: Number of clock parents if @num_parents field is
  417. * set to 255.
  418. *
  419. * Response to TI_SCI_MSG_GET_NUM_CLOCK_PARENTS
  420. */
  421. struct ti_sci_msg_resp_get_clock_num_parents {
  422. struct ti_sci_msg_hdr hdr;
  423. u8 num_parents;
  424. u32 num_parents_32;
  425. } __packed;
  426. /**
  427. * struct ti_sci_msg_req_query_clock_freq - Request to query a frequency
  428. * @hdr: Generic Header
  429. * @dev_id: Device identifier this request is for
  430. * @min_freq_hz: The minimum allowable frequency in Hz. This is the minimum
  431. * allowable programmed frequency and does not account for clock
  432. * tolerances and jitter.
  433. * @target_freq_hz: The target clock frequency. A frequency will be found
  434. * as close to this target frequency as possible.
  435. * @max_freq_hz: The maximum allowable frequency in Hz. This is the maximum
  436. * allowable programmed frequency and does not account for clock
  437. * tolerances and jitter.
  438. * @clk_id: Clock identifier for the device for this request. Set to
  439. * 255 if clock identifier is greater than or equal to 255.
  440. * @clk_id_32: Clock identifier if @clk_id is set to 255.
  441. *
  442. * NOTE: Normally clock frequency management is automatically done by TISCI
  443. * entity. In case of specific requests, TISCI evaluates capability to achieve
  444. * requested frequency within provided range and responds with
  445. * result message.
  446. *
  447. * Request type is TI_SCI_MSG_QUERY_CLOCK_FREQ, response is appropriate message,
  448. * or NACK in case of inability to satisfy request.
  449. */
  450. struct ti_sci_msg_req_query_clock_freq {
  451. struct ti_sci_msg_hdr hdr;
  452. u32 dev_id;
  453. u64 min_freq_hz;
  454. u64 target_freq_hz;
  455. u64 max_freq_hz;
  456. u8 clk_id;
  457. u32 clk_id_32;
  458. } __packed;
  459. /**
  460. * struct ti_sci_msg_resp_query_clock_freq - Response to a clock frequency query
  461. * @hdr: Generic Header
  462. * @freq_hz: Frequency that is the best match in Hz.
  463. *
  464. * Response to request type TI_SCI_MSG_QUERY_CLOCK_FREQ. NOTE: if the request
  465. * cannot be satisfied, the message will be of type NACK.
  466. */
  467. struct ti_sci_msg_resp_query_clock_freq {
  468. struct ti_sci_msg_hdr hdr;
  469. u64 freq_hz;
  470. } __packed;
  471. /**
  472. * struct ti_sci_msg_req_set_clock_freq - Request to setup a clock frequency
  473. * @hdr: Generic Header
  474. * @dev_id: Device identifier this request is for
  475. * @min_freq_hz: The minimum allowable frequency in Hz. This is the minimum
  476. * allowable programmed frequency and does not account for clock
  477. * tolerances and jitter.
  478. * @target_freq_hz: The target clock frequency. The clock will be programmed
  479. * at a rate as close to this target frequency as possible.
  480. * @max_freq_hz: The maximum allowable frequency in Hz. This is the maximum
  481. * allowable programmed frequency and does not account for clock
  482. * tolerances and jitter.
  483. * @clk_id: Clock identifier for the device for this request. Set to
  484. * 255 if clock ID is greater than or equal to 255.
  485. * @clk_id_32: Clock identifier if @clk_id field is set to 255.
  486. *
  487. * NOTE: Normally clock frequency management is automatically done by TISCI
  488. * entity. In case of specific requests, TISCI evaluates capability to achieve
  489. * requested range and responds with success/failure message.
  490. *
  491. * This sets the desired frequency for a clock within an allowable
  492. * range. This message will fail on an enabled clock unless
  493. * MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE is set for the clock. Additionally,
  494. * if other clocks have their frequency modified due to this message,
  495. * they also must have the MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE or be disabled.
  496. *
  497. * Calling set frequency on a clock input to the SoC pseudo-device will
  498. * inform the PMMC of that clock's frequency. Setting a frequency of
  499. * zero will indicate the clock is disabled.
  500. *
  501. * Calling set frequency on clock outputs from the SoC pseudo-device will
  502. * function similarly to setting the clock frequency on a device.
  503. *
  504. * Request type is TI_SCI_MSG_SET_CLOCK_FREQ, response is a generic ACK/NACK
  505. * message.
  506. */
  507. struct ti_sci_msg_req_set_clock_freq {
  508. struct ti_sci_msg_hdr hdr;
  509. u32 dev_id;
  510. u64 min_freq_hz;
  511. u64 target_freq_hz;
  512. u64 max_freq_hz;
  513. u8 clk_id;
  514. u32 clk_id_32;
  515. } __packed;
  516. /**
  517. * struct ti_sci_msg_req_get_clock_freq - Request to get the clock frequency
  518. * @hdr: Generic Header
  519. * @dev_id: Device identifier this request is for
  520. * @clk_id: Clock identifier for the device for this request. Set to
  521. * 255 if clock ID is greater than or equal to 255.
  522. * @clk_id_32: Clock identifier if @clk_id field is set to 255.
  523. *
  524. * NOTE: Normally clock frequency management is automatically done by TISCI
  525. * entity. In some cases, clock frequencies are configured by host.
  526. *
  527. * Request type is TI_SCI_MSG_GET_CLOCK_FREQ, responded with clock frequency
  528. * that the clock is currently at.
  529. */
  530. struct ti_sci_msg_req_get_clock_freq {
  531. struct ti_sci_msg_hdr hdr;
  532. u32 dev_id;
  533. u8 clk_id;
  534. u32 clk_id_32;
  535. } __packed;
  536. /**
  537. * struct ti_sci_msg_resp_get_clock_freq - Response of clock frequency request
  538. * @hdr: Generic Header
  539. * @freq_hz: Frequency that the clock is currently on, in Hz.
  540. *
  541. * Response to request type TI_SCI_MSG_GET_CLOCK_FREQ.
  542. */
  543. struct ti_sci_msg_resp_get_clock_freq {
  544. struct ti_sci_msg_hdr hdr;
  545. u64 freq_hz;
  546. } __packed;
  547. /**
  548. * struct ti_sci_msg_req_prepare_sleep - Request for TISCI_MSG_PREPARE_SLEEP.
  549. *
  550. * @hdr: TISCI header to provide ACK/NAK flags to the host.
  551. * @mode: Low power mode to enter.
  552. * @ctx_lo: Low 32-bits of physical pointer to address to use for context save.
  553. * @ctx_hi: High 32-bits of physical pointer to address to use for context save.
  554. * @debug_flags: Flags that can be set to halt the sequence during suspend or
  555. * resume to allow JTAG connection and debug.
  556. *
  557. * This message is used as the first step of entering a low power mode. It
  558. * allows configurable information, including which state to enter to be
  559. * easily shared from the application, as this is a non-secure message and
  560. * therefore can be sent by anyone.
  561. */
  562. struct ti_sci_msg_req_prepare_sleep {
  563. struct ti_sci_msg_hdr hdr;
  564. /*
  565. * When sending prepare_sleep with MODE_PARTIAL_IO no response will be sent,
  566. * no further steps are required.
  567. */
  568. #define TISCI_MSG_VALUE_SLEEP_MODE_PARTIAL_IO 0x03
  569. #define TISCI_MSG_VALUE_SLEEP_MODE_DM_MANAGED 0xfd
  570. u8 mode;
  571. u32 ctx_lo;
  572. u32 ctx_hi;
  573. u32 debug_flags;
  574. } __packed;
  575. /**
  576. * struct ti_sci_msg_req_set_io_isolation - Request for TI_SCI_MSG_SET_IO_ISOLATION.
  577. *
  578. * @hdr: Generic header
  579. * @state: The deseared state of the IO isolation.
  580. *
  581. * This message is used to enable/disable IO isolation for low power modes.
  582. * Response is generic ACK / NACK message.
  583. */
  584. struct ti_sci_msg_req_set_io_isolation {
  585. struct ti_sci_msg_hdr hdr;
  586. u8 state;
  587. } __packed;
  588. /**
  589. * struct ti_sci_msg_resp_lpm_wake_reason - Response for TI_SCI_MSG_LPM_WAKE_REASON.
  590. *
  591. * @hdr: Generic header.
  592. * @wake_source: The wake up source that woke soc from LPM.
  593. * @wake_timestamp: Timestamp at which soc woke.
  594. * @wake_pin: The pin that has triggered wake up.
  595. * @mode: The last entered low power mode.
  596. * @rsvd: Reserved for future use.
  597. *
  598. * Response to a generic message with message type TI_SCI_MSG_LPM_WAKE_REASON,
  599. * used to query the wake up source, pin and entered low power mode.
  600. */
  601. struct ti_sci_msg_resp_lpm_wake_reason {
  602. struct ti_sci_msg_hdr hdr;
  603. u32 wake_source;
  604. u64 wake_timestamp;
  605. u8 wake_pin;
  606. u8 mode;
  607. u32 rsvd[2];
  608. } __packed;
  609. /**
  610. * struct ti_sci_msg_req_lpm_set_device_constraint - Request for
  611. * TISCI_MSG_LPM_SET_DEVICE_CONSTRAINT.
  612. *
  613. * @hdr: TISCI header to provide ACK/NAK flags to the host.
  614. * @id: Device ID of device whose constraint has to be modified.
  615. * @state: The desired state of device constraint: set or clear.
  616. * @rsvd: Reserved for future use.
  617. *
  618. * This message is used by host to set constraint on the device. This can be
  619. * sent anytime after boot before prepare sleep message. Any device can set a
  620. * constraint on the low power mode that the SoC can enter. It allows
  621. * configurable information to be easily shared from the application, as this
  622. * is a non-secure message and therefore can be sent by anyone. By setting a
  623. * constraint, the device ensures that it will not be powered off or reset in
  624. * the selected mode. Note: Access Restriction: Exclusivity flag of Device will
  625. * be honored. If some other host already has constraint on this device ID,
  626. * NACK will be returned.
  627. */
  628. struct ti_sci_msg_req_lpm_set_device_constraint {
  629. struct ti_sci_msg_hdr hdr;
  630. u32 id;
  631. u8 state;
  632. u32 rsvd[2];
  633. } __packed;
  634. /**
  635. * struct ti_sci_msg_req_lpm_set_latency_constraint - Request for
  636. * TISCI_MSG_LPM_SET_LATENCY_CONSTRAINT.
  637. *
  638. * @hdr: TISCI header to provide ACK/NAK flags to the host.
  639. * @latency: The maximum acceptable latency to wake up from low power mode
  640. * in milliseconds. The deeper the state, the higher the latency.
  641. * @state: The desired state of wakeup latency constraint: set or clear.
  642. * @rsvd: Reserved for future use.
  643. *
  644. * This message is used by host to set wakeup latency from low power mode. This can
  645. * be sent anytime after boot before prepare sleep message, and can be sent after
  646. * current low power mode is exited. Any device can set a constraint on the low power
  647. * mode that the SoC can enter. It allows configurable information to be easily shared
  648. * from the application, as this is a non-secure message and therefore can be sent by
  649. * anyone. By setting a wakeup latency constraint, the host ensures that the resume time
  650. * from selected low power mode will be less than the constraint value.
  651. */
  652. struct ti_sci_msg_req_lpm_set_latency_constraint {
  653. struct ti_sci_msg_hdr hdr;
  654. u16 latency;
  655. u8 state;
  656. u32 rsvd;
  657. } __packed;
  658. #define TI_SCI_IRQ_SECONDARY_HOST_INVALID 0xff
  659. /**
  660. * struct ti_sci_msg_req_get_resource_range - Request to get a host's assigned
  661. * range of resources.
  662. * @hdr: Generic Header
  663. * @type: Unique resource assignment type
  664. * @subtype: Resource assignment subtype within the resource type.
  665. * @secondary_host: Host processing entity to which the resources are
  666. * allocated. This is required only when the destination
  667. * host id id different from ti sci interface host id,
  668. * else TI_SCI_IRQ_SECONDARY_HOST_INVALID can be passed.
  669. *
  670. * Request type is TI_SCI_MSG_GET_RESOURCE_RANGE. Responded with requested
  671. * resource range which is of type TI_SCI_MSG_GET_RESOURCE_RANGE.
  672. */
  673. struct ti_sci_msg_req_get_resource_range {
  674. struct ti_sci_msg_hdr hdr;
  675. #define MSG_RM_RESOURCE_TYPE_MASK GENMASK(9, 0)
  676. #define MSG_RM_RESOURCE_SUBTYPE_MASK GENMASK(5, 0)
  677. u16 type;
  678. u8 subtype;
  679. u8 secondary_host;
  680. } __packed;
  681. /**
  682. * struct ti_sci_msg_resp_get_resource_range - Response to resource get range.
  683. * @hdr: Generic Header
  684. * @range_start: Start index of the first resource range.
  685. * @range_num: Number of resources in the first range.
  686. * @range_start_sec: Start index of the second resource range.
  687. * @range_num_sec: Number of resources in the second range.
  688. *
  689. * Response to request TI_SCI_MSG_GET_RESOURCE_RANGE.
  690. */
  691. struct ti_sci_msg_resp_get_resource_range {
  692. struct ti_sci_msg_hdr hdr;
  693. u16 range_start;
  694. u16 range_num;
  695. u16 range_start_sec;
  696. u16 range_num_sec;
  697. } __packed;
  698. /**
  699. * struct ti_sci_msg_req_manage_irq - Request to configure/release the route
  700. * between the dev and the host.
  701. * @hdr: Generic Header
  702. * @valid_params: Bit fields defining the validity of interrupt source
  703. * parameters. If a bit is not set, then corresponding
  704. * field is not valid and will not be used for route set.
  705. * Bit field definitions:
  706. * 0 - Valid bit for @dst_id
  707. * 1 - Valid bit for @dst_host_irq
  708. * 2 - Valid bit for @ia_id
  709. * 3 - Valid bit for @vint
  710. * 4 - Valid bit for @global_event
  711. * 5 - Valid bit for @vint_status_bit_index
  712. * 31 - Valid bit for @secondary_host
  713. * @src_id: IRQ source peripheral ID.
  714. * @src_index: IRQ source index within the peripheral
  715. * @dst_id: IRQ Destination ID. Based on the architecture it can be
  716. * IRQ controller or host processor ID.
  717. * @dst_host_irq: IRQ number of the destination host IRQ controller
  718. * @ia_id: Device ID of the interrupt aggregator in which the
  719. * vint resides.
  720. * @vint: Virtual interrupt number if the interrupt route
  721. * is through an interrupt aggregator.
  722. * @global_event: Global event that is to be mapped to interrupt
  723. * aggregator virtual interrupt status bit.
  724. * @vint_status_bit: Virtual interrupt status bit if the interrupt route
  725. * utilizes an interrupt aggregator status bit.
  726. * @secondary_host: Host ID of the IRQ destination computing entity. This is
  727. * required only when destination host id is different
  728. * from ti sci interface host id.
  729. *
  730. * Request type is TI_SCI_MSG_SET/RELEASE_IRQ.
  731. * Response is generic ACK / NACK message.
  732. */
  733. struct ti_sci_msg_req_manage_irq {
  734. struct ti_sci_msg_hdr hdr;
  735. #define MSG_FLAG_DST_ID_VALID TI_SCI_MSG_FLAG(0)
  736. #define MSG_FLAG_DST_HOST_IRQ_VALID TI_SCI_MSG_FLAG(1)
  737. #define MSG_FLAG_IA_ID_VALID TI_SCI_MSG_FLAG(2)
  738. #define MSG_FLAG_VINT_VALID TI_SCI_MSG_FLAG(3)
  739. #define MSG_FLAG_GLB_EVNT_VALID TI_SCI_MSG_FLAG(4)
  740. #define MSG_FLAG_VINT_STS_BIT_VALID TI_SCI_MSG_FLAG(5)
  741. #define MSG_FLAG_SHOST_VALID TI_SCI_MSG_FLAG(31)
  742. u32 valid_params;
  743. u16 src_id;
  744. u16 src_index;
  745. u16 dst_id;
  746. u16 dst_host_irq;
  747. u16 ia_id;
  748. u16 vint;
  749. u16 global_event;
  750. u8 vint_status_bit;
  751. u8 secondary_host;
  752. } __packed;
  753. /**
  754. * struct ti_sci_msg_rm_ring_cfg_req - Configure a Navigator Subsystem ring
  755. *
  756. * Configures the non-real-time registers of a Navigator Subsystem ring.
  757. * @hdr: Generic Header
  758. * @valid_params: Bitfield defining validity of ring configuration parameters.
  759. * The ring configuration fields are not valid, and will not be used for
  760. * ring configuration, if their corresponding valid bit is zero.
  761. * Valid bit usage:
  762. * 0 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_lo
  763. * 1 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_hi
  764. * 2 - Valid bit for @tisci_msg_rm_ring_cfg_req count
  765. * 3 - Valid bit for @tisci_msg_rm_ring_cfg_req mode
  766. * 4 - Valid bit for @tisci_msg_rm_ring_cfg_req size
  767. * 5 - Valid bit for @tisci_msg_rm_ring_cfg_req order_id
  768. * 6 - Valid bit for @tisci_msg_rm_ring_cfg_req virtid
  769. * 7 - Valid bit for @tisci_msg_rm_ring_cfg_req ASEL
  770. * @nav_id: Device ID of Navigator Subsystem from which the ring is allocated
  771. * @index: ring index to be configured.
  772. * @addr_lo: 32 LSBs of ring base address to be programmed into the ring's
  773. * RING_BA_LO register
  774. * @addr_hi: 16 MSBs of ring base address to be programmed into the ring's
  775. * RING_BA_HI register.
  776. * @count: Number of ring elements. Must be even if mode is CREDENTIALS or QM
  777. * modes.
  778. * @mode: Specifies the mode the ring is to be configured.
  779. * @size: Specifies encoded ring element size. To calculate the encoded size use
  780. * the formula (log2(size_bytes) - 2), where size_bytes cannot be
  781. * greater than 256.
  782. * @order_id: Specifies the ring's bus order ID.
  783. * @virtid: Ring virt ID value
  784. * @asel: Ring ASEL (address select) value to be set into the ASEL field of the
  785. * ring's RING_BA_HI register.
  786. */
  787. struct ti_sci_msg_rm_ring_cfg_req {
  788. struct ti_sci_msg_hdr hdr;
  789. u32 valid_params;
  790. u16 nav_id;
  791. u16 index;
  792. u32 addr_lo;
  793. u32 addr_hi;
  794. u32 count;
  795. u8 mode;
  796. u8 size;
  797. u8 order_id;
  798. u16 virtid;
  799. u8 asel;
  800. } __packed;
  801. /**
  802. * struct ti_sci_msg_psil_pair - Pairs a PSI-L source thread to a destination
  803. * thread
  804. * @hdr: Generic Header
  805. * @nav_id: SoC Navigator Subsystem device ID whose PSI-L config proxy is
  806. * used to pair the source and destination threads.
  807. * @src_thread: PSI-L source thread ID within the PSI-L System thread map.
  808. *
  809. * UDMAP transmit channels mapped to source threads will have their
  810. * TCHAN_THRD_ID register programmed with the destination thread if the pairing
  811. * is successful.
  812. *
  813. * @dst_thread: PSI-L destination thread ID within the PSI-L System thread map.
  814. * PSI-L destination threads start at index 0x8000. The request is NACK'd if
  815. * the destination thread is not greater than or equal to 0x8000.
  816. *
  817. * UDMAP receive channels mapped to destination threads will have their
  818. * RCHAN_THRD_ID register programmed with the source thread if the pairing
  819. * is successful.
  820. *
  821. * Request type is TI_SCI_MSG_RM_PSIL_PAIR, response is a generic ACK or NACK
  822. * message.
  823. */
  824. struct ti_sci_msg_psil_pair {
  825. struct ti_sci_msg_hdr hdr;
  826. u32 nav_id;
  827. u32 src_thread;
  828. u32 dst_thread;
  829. } __packed;
  830. /**
  831. * struct ti_sci_msg_psil_unpair - Unpairs a PSI-L source thread from a
  832. * destination thread
  833. * @hdr: Generic Header
  834. * @nav_id: SoC Navigator Subsystem device ID whose PSI-L config proxy is
  835. * used to unpair the source and destination threads.
  836. * @src_thread: PSI-L source thread ID within the PSI-L System thread map.
  837. *
  838. * UDMAP transmit channels mapped to source threads will have their
  839. * TCHAN_THRD_ID register cleared if the unpairing is successful.
  840. *
  841. * @dst_thread: PSI-L destination thread ID within the PSI-L System thread map.
  842. * PSI-L destination threads start at index 0x8000. The request is NACK'd if
  843. * the destination thread is not greater than or equal to 0x8000.
  844. *
  845. * UDMAP receive channels mapped to destination threads will have their
  846. * RCHAN_THRD_ID register cleared if the unpairing is successful.
  847. *
  848. * Request type is TI_SCI_MSG_RM_PSIL_UNPAIR, response is a generic ACK or NACK
  849. * message.
  850. */
  851. struct ti_sci_msg_psil_unpair {
  852. struct ti_sci_msg_hdr hdr;
  853. u32 nav_id;
  854. u32 src_thread;
  855. u32 dst_thread;
  856. } __packed;
  857. /**
  858. * struct ti_sci_msg_udmap_rx_flow_cfg - UDMAP receive flow configuration
  859. * message
  860. * @hdr: Generic Header
  861. * @nav_id: SoC Navigator Subsystem device ID from which the receive flow is
  862. * allocated
  863. * @flow_index: UDMAP receive flow index for non-optional configuration.
  864. * @rx_ch_index: Specifies the index of the receive channel using the flow_index
  865. * @rx_einfo_present: UDMAP receive flow extended packet info present.
  866. * @rx_psinfo_present: UDMAP receive flow PS words present.
  867. * @rx_error_handling: UDMAP receive flow error handling configuration. Valid
  868. * values are TI_SCI_RM_UDMAP_RX_FLOW_ERR_DROP/RETRY.
  869. * @rx_desc_type: UDMAP receive flow descriptor type. It can be one of
  870. * TI_SCI_RM_UDMAP_RX_FLOW_DESC_HOST/MONO.
  871. * @rx_sop_offset: UDMAP receive flow start of packet offset.
  872. * @rx_dest_qnum: UDMAP receive flow destination queue number.
  873. * @rx_ps_location: UDMAP receive flow PS words location.
  874. * 0 - end of packet descriptor
  875. * 1 - Beginning of the data buffer
  876. * @rx_src_tag_hi: UDMAP receive flow source tag high byte constant
  877. * @rx_src_tag_lo: UDMAP receive flow source tag low byte constant
  878. * @rx_dest_tag_hi: UDMAP receive flow destination tag high byte constant
  879. * @rx_dest_tag_lo: UDMAP receive flow destination tag low byte constant
  880. * @rx_src_tag_hi_sel: UDMAP receive flow source tag high byte selector
  881. * @rx_src_tag_lo_sel: UDMAP receive flow source tag low byte selector
  882. * @rx_dest_tag_hi_sel: UDMAP receive flow destination tag high byte selector
  883. * @rx_dest_tag_lo_sel: UDMAP receive flow destination tag low byte selector
  884. * @rx_size_thresh_en: UDMAP receive flow packet size based free buffer queue
  885. * enable. If enabled, the ti_sci_rm_udmap_rx_flow_opt_cfg also need to be
  886. * configured and sent.
  887. * @rx_fdq0_sz0_qnum: UDMAP receive flow free descriptor queue 0.
  888. * @rx_fdq1_qnum: UDMAP receive flow free descriptor queue 1.
  889. * @rx_fdq2_qnum: UDMAP receive flow free descriptor queue 2.
  890. * @rx_fdq3_qnum: UDMAP receive flow free descriptor queue 3.
  891. *
  892. * For detailed information on the settings, see the UDMAP section of the TRM.
  893. */
  894. struct ti_sci_msg_udmap_rx_flow_cfg {
  895. struct ti_sci_msg_hdr hdr;
  896. u32 nav_id;
  897. u32 flow_index;
  898. u32 rx_ch_index;
  899. u8 rx_einfo_present;
  900. u8 rx_psinfo_present;
  901. u8 rx_error_handling;
  902. u8 rx_desc_type;
  903. u16 rx_sop_offset;
  904. u16 rx_dest_qnum;
  905. u8 rx_ps_location;
  906. u8 rx_src_tag_hi;
  907. u8 rx_src_tag_lo;
  908. u8 rx_dest_tag_hi;
  909. u8 rx_dest_tag_lo;
  910. u8 rx_src_tag_hi_sel;
  911. u8 rx_src_tag_lo_sel;
  912. u8 rx_dest_tag_hi_sel;
  913. u8 rx_dest_tag_lo_sel;
  914. u8 rx_size_thresh_en;
  915. u16 rx_fdq0_sz0_qnum;
  916. u16 rx_fdq1_qnum;
  917. u16 rx_fdq2_qnum;
  918. u16 rx_fdq3_qnum;
  919. } __packed;
  920. /**
  921. * struct rm_ti_sci_msg_udmap_rx_flow_opt_cfg - parameters for UDMAP receive
  922. * flow optional configuration
  923. * @hdr: Generic Header
  924. * @nav_id: SoC Navigator Subsystem device ID from which the receive flow is
  925. * allocated
  926. * @flow_index: UDMAP receive flow index for optional configuration.
  927. * @rx_ch_index: Specifies the index of the receive channel using the flow_index
  928. * @rx_size_thresh0: UDMAP receive flow packet size threshold 0.
  929. * @rx_size_thresh1: UDMAP receive flow packet size threshold 1.
  930. * @rx_size_thresh2: UDMAP receive flow packet size threshold 2.
  931. * @rx_fdq0_sz1_qnum: UDMAP receive flow free descriptor queue for size
  932. * threshold 1.
  933. * @rx_fdq0_sz2_qnum: UDMAP receive flow free descriptor queue for size
  934. * threshold 2.
  935. * @rx_fdq0_sz3_qnum: UDMAP receive flow free descriptor queue for size
  936. * threshold 3.
  937. *
  938. * For detailed information on the settings, see the UDMAP section of the TRM.
  939. */
  940. struct rm_ti_sci_msg_udmap_rx_flow_opt_cfg {
  941. struct ti_sci_msg_hdr hdr;
  942. u32 nav_id;
  943. u32 flow_index;
  944. u32 rx_ch_index;
  945. u16 rx_size_thresh0;
  946. u16 rx_size_thresh1;
  947. u16 rx_size_thresh2;
  948. u16 rx_fdq0_sz1_qnum;
  949. u16 rx_fdq0_sz2_qnum;
  950. u16 rx_fdq0_sz3_qnum;
  951. } __packed;
  952. /**
  953. * struct ti_sci_msg_rm_udmap_tx_ch_cfg_req - Configures a
  954. * Navigator Subsystem UDMAP transmit channel
  955. *
  956. * Configures the non-real-time registers of a Navigator Subsystem UDMAP
  957. * transmit channel. The channel index must be assigned to the host defined
  958. * in the TISCI header via the RM board configuration resource assignment
  959. * range list.
  960. *
  961. * @hdr: Generic Header
  962. *
  963. * @valid_params: Bitfield defining validity of tx channel configuration
  964. * parameters. The tx channel configuration fields are not valid, and will not
  965. * be used for ch configuration, if their corresponding valid bit is zero.
  966. * Valid bit usage:
  967. * 0 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_pause_on_err
  968. * 1 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_atype
  969. * 2 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_chan_type
  970. * 3 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_fetch_size
  971. * 4 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::txcq_qnum
  972. * 5 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_priority
  973. * 6 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_qos
  974. * 7 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_orderid
  975. * 8 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_sched_priority
  976. * 9 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_einfo
  977. * 10 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_pswords
  978. * 11 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_supr_tdpkt
  979. * 12 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_credit_count
  980. * 13 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::fdepth
  981. * 14 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_burst_size
  982. * 15 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_tdtype
  983. * 16 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::extended_ch_type
  984. *
  985. * @nav_id: SoC device ID of Navigator Subsystem where tx channel is located
  986. *
  987. * @index: UDMAP transmit channel index.
  988. *
  989. * @tx_pause_on_err: UDMAP transmit channel pause on error configuration to
  990. * be programmed into the tx_pause_on_err field of the channel's TCHAN_TCFG
  991. * register.
  992. *
  993. * @tx_filt_einfo: UDMAP transmit channel extended packet information passing
  994. * configuration to be programmed into the tx_filt_einfo field of the
  995. * channel's TCHAN_TCFG register.
  996. *
  997. * @tx_filt_pswords: UDMAP transmit channel protocol specific word passing
  998. * configuration to be programmed into the tx_filt_pswords field of the
  999. * channel's TCHAN_TCFG register.
  1000. *
  1001. * @tx_atype: UDMAP transmit channel non Ring Accelerator access pointer
  1002. * interpretation configuration to be programmed into the tx_atype field of
  1003. * the channel's TCHAN_TCFG register.
  1004. *
  1005. * @tx_chan_type: UDMAP transmit channel functional channel type and work
  1006. * passing mechanism configuration to be programmed into the tx_chan_type
  1007. * field of the channel's TCHAN_TCFG register.
  1008. *
  1009. * @tx_supr_tdpkt: UDMAP transmit channel teardown packet generation suppression
  1010. * configuration to be programmed into the tx_supr_tdpkt field of the channel's
  1011. * TCHAN_TCFG register.
  1012. *
  1013. * @tx_fetch_size: UDMAP transmit channel number of 32-bit descriptor words to
  1014. * fetch configuration to be programmed into the tx_fetch_size field of the
  1015. * channel's TCHAN_TCFG register. The user must make sure to set the maximum
  1016. * word count that can pass through the channel for any allowed descriptor type.
  1017. *
  1018. * @tx_credit_count: UDMAP transmit channel transfer request credit count
  1019. * configuration to be programmed into the count field of the TCHAN_TCREDIT
  1020. * register. Specifies how many credits for complete TRs are available.
  1021. *
  1022. * @txcq_qnum: UDMAP transmit channel completion queue configuration to be
  1023. * programmed into the txcq_qnum field of the TCHAN_TCQ register. The specified
  1024. * completion queue must be assigned to the host, or a subordinate of the host,
  1025. * requesting configuration of the transmit channel.
  1026. *
  1027. * @tx_priority: UDMAP transmit channel transmit priority value to be programmed
  1028. * into the priority field of the channel's TCHAN_TPRI_CTRL register.
  1029. *
  1030. * @tx_qos: UDMAP transmit channel transmit qos value to be programmed into the
  1031. * qos field of the channel's TCHAN_TPRI_CTRL register.
  1032. *
  1033. * @tx_orderid: UDMAP transmit channel bus order id value to be programmed into
  1034. * the orderid field of the channel's TCHAN_TPRI_CTRL register.
  1035. *
  1036. * @fdepth: UDMAP transmit channel FIFO depth configuration to be programmed
  1037. * into the fdepth field of the TCHAN_TFIFO_DEPTH register. Sets the number of
  1038. * Tx FIFO bytes which are allowed to be stored for the channel. Check the UDMAP
  1039. * section of the TRM for restrictions regarding this parameter.
  1040. *
  1041. * @tx_sched_priority: UDMAP transmit channel tx scheduling priority
  1042. * configuration to be programmed into the priority field of the channel's
  1043. * TCHAN_TST_SCHED register.
  1044. *
  1045. * @tx_burst_size: UDMAP transmit channel burst size configuration to be
  1046. * programmed into the tx_burst_size field of the TCHAN_TCFG register.
  1047. *
  1048. * @tx_tdtype: UDMAP transmit channel teardown type configuration to be
  1049. * programmed into the tdtype field of the TCHAN_TCFG register:
  1050. * 0 - Return immediately
  1051. * 1 - Wait for completion message from remote peer
  1052. *
  1053. * @extended_ch_type: Valid for BCDMA.
  1054. * 0 - the channel is split tx channel (tchan)
  1055. * 1 - the channel is block copy channel (bchan)
  1056. */
  1057. struct ti_sci_msg_rm_udmap_tx_ch_cfg_req {
  1058. struct ti_sci_msg_hdr hdr;
  1059. u32 valid_params;
  1060. u16 nav_id;
  1061. u16 index;
  1062. u8 tx_pause_on_err;
  1063. u8 tx_filt_einfo;
  1064. u8 tx_filt_pswords;
  1065. u8 tx_atype;
  1066. u8 tx_chan_type;
  1067. u8 tx_supr_tdpkt;
  1068. u16 tx_fetch_size;
  1069. u8 tx_credit_count;
  1070. u16 txcq_qnum;
  1071. u8 tx_priority;
  1072. u8 tx_qos;
  1073. u8 tx_orderid;
  1074. u16 fdepth;
  1075. u8 tx_sched_priority;
  1076. u8 tx_burst_size;
  1077. u8 tx_tdtype;
  1078. u8 extended_ch_type;
  1079. } __packed;
  1080. /**
  1081. * struct ti_sci_msg_rm_udmap_rx_ch_cfg_req - Configures a
  1082. * Navigator Subsystem UDMAP receive channel
  1083. *
  1084. * Configures the non-real-time registers of a Navigator Subsystem UDMAP
  1085. * receive channel. The channel index must be assigned to the host defined
  1086. * in the TISCI header via the RM board configuration resource assignment
  1087. * range list.
  1088. *
  1089. * @hdr: Generic Header
  1090. *
  1091. * @valid_params: Bitfield defining validity of rx channel configuration
  1092. * parameters.
  1093. * The rx channel configuration fields are not valid, and will not be used for
  1094. * ch configuration, if their corresponding valid bit is zero.
  1095. * Valid bit usage:
  1096. * 0 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_pause_on_err
  1097. * 1 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_atype
  1098. * 2 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_chan_type
  1099. * 3 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_fetch_size
  1100. * 4 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rxcq_qnum
  1101. * 5 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_priority
  1102. * 6 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_qos
  1103. * 7 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_orderid
  1104. * 8 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_sched_priority
  1105. * 9 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_start
  1106. * 10 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_cnt
  1107. * 11 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_short
  1108. * 12 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_long
  1109. * 14 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_burst_size
  1110. *
  1111. * @nav_id: SoC device ID of Navigator Subsystem where rx channel is located
  1112. *
  1113. * @index: UDMAP receive channel index.
  1114. *
  1115. * @rx_fetch_size: UDMAP receive channel number of 32-bit descriptor words to
  1116. * fetch configuration to be programmed into the rx_fetch_size field of the
  1117. * channel's RCHAN_RCFG register.
  1118. *
  1119. * @rxcq_qnum: UDMAP receive channel completion queue configuration to be
  1120. * programmed into the rxcq_qnum field of the RCHAN_RCQ register.
  1121. * The specified completion queue must be assigned to the host, or a subordinate
  1122. * of the host, requesting configuration of the receive channel.
  1123. *
  1124. * @rx_priority: UDMAP receive channel receive priority value to be programmed
  1125. * into the priority field of the channel's RCHAN_RPRI_CTRL register.
  1126. *
  1127. * @rx_qos: UDMAP receive channel receive qos value to be programmed into the
  1128. * qos field of the channel's RCHAN_RPRI_CTRL register.
  1129. *
  1130. * @rx_orderid: UDMAP receive channel bus order id value to be programmed into
  1131. * the orderid field of the channel's RCHAN_RPRI_CTRL register.
  1132. *
  1133. * @rx_sched_priority: UDMAP receive channel rx scheduling priority
  1134. * configuration to be programmed into the priority field of the channel's
  1135. * RCHAN_RST_SCHED register.
  1136. *
  1137. * @flowid_start: UDMAP receive channel additional flows starting index
  1138. * configuration to program into the flow_start field of the RCHAN_RFLOW_RNG
  1139. * register. Specifies the starting index for flow IDs the receive channel is to
  1140. * make use of beyond the default flow. flowid_start and @ref flowid_cnt must be
  1141. * set as valid and configured together. The starting flow ID set by
  1142. * @ref flowid_cnt must be a flow index within the Navigator Subsystem's subset
  1143. * of flows beyond the default flows statically mapped to receive channels.
  1144. * The additional flows must be assigned to the host, or a subordinate of the
  1145. * host, requesting configuration of the receive channel.
  1146. *
  1147. * @flowid_cnt: UDMAP receive channel additional flows count configuration to
  1148. * program into the flowid_cnt field of the RCHAN_RFLOW_RNG register.
  1149. * This field specifies how many flow IDs are in the additional contiguous range
  1150. * of legal flow IDs for the channel. @ref flowid_start and flowid_cnt must be
  1151. * set as valid and configured together. Disabling the valid_params field bit
  1152. * for flowid_cnt indicates no flow IDs other than the default are to be
  1153. * allocated and used by the receive channel. @ref flowid_start plus flowid_cnt
  1154. * cannot be greater than the number of receive flows in the receive channel's
  1155. * Navigator Subsystem. The additional flows must be assigned to the host, or a
  1156. * subordinate of the host, requesting configuration of the receive channel.
  1157. *
  1158. * @rx_pause_on_err: UDMAP receive channel pause on error configuration to be
  1159. * programmed into the rx_pause_on_err field of the channel's RCHAN_RCFG
  1160. * register.
  1161. *
  1162. * @rx_atype: UDMAP receive channel non Ring Accelerator access pointer
  1163. * interpretation configuration to be programmed into the rx_atype field of the
  1164. * channel's RCHAN_RCFG register.
  1165. *
  1166. * @rx_chan_type: UDMAP receive channel functional channel type and work passing
  1167. * mechanism configuration to be programmed into the rx_chan_type field of the
  1168. * channel's RCHAN_RCFG register.
  1169. *
  1170. * @rx_ignore_short: UDMAP receive channel short packet treatment configuration
  1171. * to be programmed into the rx_ignore_short field of the RCHAN_RCFG register.
  1172. *
  1173. * @rx_ignore_long: UDMAP receive channel long packet treatment configuration to
  1174. * be programmed into the rx_ignore_long field of the RCHAN_RCFG register.
  1175. *
  1176. * @rx_burst_size: UDMAP receive channel burst size configuration to be
  1177. * programmed into the rx_burst_size field of the RCHAN_RCFG register.
  1178. */
  1179. struct ti_sci_msg_rm_udmap_rx_ch_cfg_req {
  1180. struct ti_sci_msg_hdr hdr;
  1181. u32 valid_params;
  1182. u16 nav_id;
  1183. u16 index;
  1184. u16 rx_fetch_size;
  1185. u16 rxcq_qnum;
  1186. u8 rx_priority;
  1187. u8 rx_qos;
  1188. u8 rx_orderid;
  1189. u8 rx_sched_priority;
  1190. u16 flowid_start;
  1191. u16 flowid_cnt;
  1192. u8 rx_pause_on_err;
  1193. u8 rx_atype;
  1194. u8 rx_chan_type;
  1195. u8 rx_ignore_short;
  1196. u8 rx_ignore_long;
  1197. u8 rx_burst_size;
  1198. } __packed;
  1199. /**
  1200. * struct ti_sci_msg_rm_udmap_flow_cfg_req - Configures a
  1201. * Navigator Subsystem UDMAP receive flow
  1202. *
  1203. * Configures a Navigator Subsystem UDMAP receive flow's registers.
  1204. * Configuration does not include the flow registers which handle size-based
  1205. * free descriptor queue routing.
  1206. *
  1207. * The flow index must be assigned to the host defined in the TISCI header via
  1208. * the RM board configuration resource assignment range list.
  1209. *
  1210. * @hdr: Standard TISCI header
  1211. *
  1212. * @valid_params:
  1213. * Bitfield defining validity of rx flow configuration parameters. The
  1214. * rx flow configuration fields are not valid, and will not be used for flow
  1215. * configuration, if their corresponding valid bit is zero. Valid bit usage:
  1216. * 0 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_einfo_present
  1217. * 1 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_psinfo_present
  1218. * 2 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_error_handling
  1219. * 3 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_desc_type
  1220. * 4 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_sop_offset
  1221. * 5 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_qnum
  1222. * 6 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi
  1223. * 7 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo
  1224. * 8 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi
  1225. * 9 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo
  1226. * 10 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi_sel
  1227. * 11 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo_sel
  1228. * 12 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi_sel
  1229. * 13 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo_sel
  1230. * 14 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq0_sz0_qnum
  1231. * 15 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq1_sz0_qnum
  1232. * 16 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq2_sz0_qnum
  1233. * 17 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq3_sz0_qnum
  1234. * 18 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_ps_location
  1235. *
  1236. * @nav_id: SoC device ID of Navigator Subsystem from which the receive flow is
  1237. * allocated
  1238. *
  1239. * @flow_index: UDMAP receive flow index for non-optional configuration.
  1240. *
  1241. * @rx_einfo_present:
  1242. * UDMAP receive flow extended packet info present configuration to be
  1243. * programmed into the rx_einfo_present field of the flow's RFLOW_RFA register.
  1244. *
  1245. * @rx_psinfo_present:
  1246. * UDMAP receive flow PS words present configuration to be programmed into the
  1247. * rx_psinfo_present field of the flow's RFLOW_RFA register.
  1248. *
  1249. * @rx_error_handling:
  1250. * UDMAP receive flow error handling configuration to be programmed into the
  1251. * rx_error_handling field of the flow's RFLOW_RFA register.
  1252. *
  1253. * @rx_desc_type:
  1254. * UDMAP receive flow descriptor type configuration to be programmed into the
  1255. * rx_desc_type field field of the flow's RFLOW_RFA register.
  1256. *
  1257. * @rx_sop_offset:
  1258. * UDMAP receive flow start of packet offset configuration to be programmed
  1259. * into the rx_sop_offset field of the RFLOW_RFA register. See the UDMAP
  1260. * section of the TRM for more information on this setting. Valid values for
  1261. * this field are 0-255 bytes.
  1262. *
  1263. * @rx_dest_qnum:
  1264. * UDMAP receive flow destination queue configuration to be programmed into the
  1265. * rx_dest_qnum field of the flow's RFLOW_RFA register. The specified
  1266. * destination queue must be valid within the Navigator Subsystem and must be
  1267. * owned by the host, or a subordinate of the host, requesting allocation and
  1268. * configuration of the receive flow.
  1269. *
  1270. * @rx_src_tag_hi:
  1271. * UDMAP receive flow source tag high byte constant configuration to be
  1272. * programmed into the rx_src_tag_hi field of the flow's RFLOW_RFB register.
  1273. * See the UDMAP section of the TRM for more information on this setting.
  1274. *
  1275. * @rx_src_tag_lo:
  1276. * UDMAP receive flow source tag low byte constant configuration to be
  1277. * programmed into the rx_src_tag_lo field of the flow's RFLOW_RFB register.
  1278. * See the UDMAP section of the TRM for more information on this setting.
  1279. *
  1280. * @rx_dest_tag_hi:
  1281. * UDMAP receive flow destination tag high byte constant configuration to be
  1282. * programmed into the rx_dest_tag_hi field of the flow's RFLOW_RFB register.
  1283. * See the UDMAP section of the TRM for more information on this setting.
  1284. *
  1285. * @rx_dest_tag_lo:
  1286. * UDMAP receive flow destination tag low byte constant configuration to be
  1287. * programmed into the rx_dest_tag_lo field of the flow's RFLOW_RFB register.
  1288. * See the UDMAP section of the TRM for more information on this setting.
  1289. *
  1290. * @rx_src_tag_hi_sel:
  1291. * UDMAP receive flow source tag high byte selector configuration to be
  1292. * programmed into the rx_src_tag_hi_sel field of the RFLOW_RFC register. See
  1293. * the UDMAP section of the TRM for more information on this setting.
  1294. *
  1295. * @rx_src_tag_lo_sel:
  1296. * UDMAP receive flow source tag low byte selector configuration to be
  1297. * programmed into the rx_src_tag_lo_sel field of the RFLOW_RFC register. See
  1298. * the UDMAP section of the TRM for more information on this setting.
  1299. *
  1300. * @rx_dest_tag_hi_sel:
  1301. * UDMAP receive flow destination tag high byte selector configuration to be
  1302. * programmed into the rx_dest_tag_hi_sel field of the RFLOW_RFC register. See
  1303. * the UDMAP section of the TRM for more information on this setting.
  1304. *
  1305. * @rx_dest_tag_lo_sel:
  1306. * UDMAP receive flow destination tag low byte selector configuration to be
  1307. * programmed into the rx_dest_tag_lo_sel field of the RFLOW_RFC register. See
  1308. * the UDMAP section of the TRM for more information on this setting.
  1309. *
  1310. * @rx_fdq0_sz0_qnum:
  1311. * UDMAP receive flow free descriptor queue 0 configuration to be programmed
  1312. * into the rx_fdq0_sz0_qnum field of the flow's RFLOW_RFD register. See the
  1313. * UDMAP section of the TRM for more information on this setting. The specified
  1314. * free queue must be valid within the Navigator Subsystem and must be owned
  1315. * by the host, or a subordinate of the host, requesting allocation and
  1316. * configuration of the receive flow.
  1317. *
  1318. * @rx_fdq1_qnum:
  1319. * UDMAP receive flow free descriptor queue 1 configuration to be programmed
  1320. * into the rx_fdq1_qnum field of the flow's RFLOW_RFD register. See the
  1321. * UDMAP section of the TRM for more information on this setting. The specified
  1322. * free queue must be valid within the Navigator Subsystem and must be owned
  1323. * by the host, or a subordinate of the host, requesting allocation and
  1324. * configuration of the receive flow.
  1325. *
  1326. * @rx_fdq2_qnum:
  1327. * UDMAP receive flow free descriptor queue 2 configuration to be programmed
  1328. * into the rx_fdq2_qnum field of the flow's RFLOW_RFE register. See the
  1329. * UDMAP section of the TRM for more information on this setting. The specified
  1330. * free queue must be valid within the Navigator Subsystem and must be owned
  1331. * by the host, or a subordinate of the host, requesting allocation and
  1332. * configuration of the receive flow.
  1333. *
  1334. * @rx_fdq3_qnum:
  1335. * UDMAP receive flow free descriptor queue 3 configuration to be programmed
  1336. * into the rx_fdq3_qnum field of the flow's RFLOW_RFE register. See the
  1337. * UDMAP section of the TRM for more information on this setting. The specified
  1338. * free queue must be valid within the Navigator Subsystem and must be owned
  1339. * by the host, or a subordinate of the host, requesting allocation and
  1340. * configuration of the receive flow.
  1341. *
  1342. * @rx_ps_location:
  1343. * UDMAP receive flow PS words location configuration to be programmed into the
  1344. * rx_ps_location field of the flow's RFLOW_RFA register.
  1345. */
  1346. struct ti_sci_msg_rm_udmap_flow_cfg_req {
  1347. struct ti_sci_msg_hdr hdr;
  1348. u32 valid_params;
  1349. u16 nav_id;
  1350. u16 flow_index;
  1351. u8 rx_einfo_present;
  1352. u8 rx_psinfo_present;
  1353. u8 rx_error_handling;
  1354. u8 rx_desc_type;
  1355. u16 rx_sop_offset;
  1356. u16 rx_dest_qnum;
  1357. u8 rx_src_tag_hi;
  1358. u8 rx_src_tag_lo;
  1359. u8 rx_dest_tag_hi;
  1360. u8 rx_dest_tag_lo;
  1361. u8 rx_src_tag_hi_sel;
  1362. u8 rx_src_tag_lo_sel;
  1363. u8 rx_dest_tag_hi_sel;
  1364. u8 rx_dest_tag_lo_sel;
  1365. u16 rx_fdq0_sz0_qnum;
  1366. u16 rx_fdq1_qnum;
  1367. u16 rx_fdq2_qnum;
  1368. u16 rx_fdq3_qnum;
  1369. u8 rx_ps_location;
  1370. } __packed;
  1371. /**
  1372. * struct ti_sci_msg_req_proc_request - Request a processor
  1373. * @hdr: Generic Header
  1374. * @processor_id: ID of processor being requested
  1375. *
  1376. * Request type is TI_SCI_MSG_PROC_REQUEST, response is a generic ACK/NACK
  1377. * message.
  1378. */
  1379. struct ti_sci_msg_req_proc_request {
  1380. struct ti_sci_msg_hdr hdr;
  1381. u8 processor_id;
  1382. } __packed;
  1383. /**
  1384. * struct ti_sci_msg_req_proc_release - Release a processor
  1385. * @hdr: Generic Header
  1386. * @processor_id: ID of processor being released
  1387. *
  1388. * Request type is TI_SCI_MSG_PROC_RELEASE, response is a generic ACK/NACK
  1389. * message.
  1390. */
  1391. struct ti_sci_msg_req_proc_release {
  1392. struct ti_sci_msg_hdr hdr;
  1393. u8 processor_id;
  1394. } __packed;
  1395. /**
  1396. * struct ti_sci_msg_req_proc_handover - Handover a processor to a host
  1397. * @hdr: Generic Header
  1398. * @processor_id: ID of processor being handed over
  1399. * @host_id: Host ID the control needs to be transferred to
  1400. *
  1401. * Request type is TI_SCI_MSG_PROC_HANDOVER, response is a generic ACK/NACK
  1402. * message.
  1403. */
  1404. struct ti_sci_msg_req_proc_handover {
  1405. struct ti_sci_msg_hdr hdr;
  1406. u8 processor_id;
  1407. u8 host_id;
  1408. } __packed;
  1409. /* Boot Vector masks */
  1410. #define TI_SCI_ADDR_LOW_MASK GENMASK_ULL(31, 0)
  1411. #define TI_SCI_ADDR_HIGH_MASK GENMASK_ULL(63, 32)
  1412. #define TI_SCI_ADDR_HIGH_SHIFT 32
  1413. /**
  1414. * struct ti_sci_msg_req_set_config - Set Processor boot configuration
  1415. * @hdr: Generic Header
  1416. * @processor_id: ID of processor being configured
  1417. * @bootvector_low: Lower 32 bit address (Little Endian) of boot vector
  1418. * @bootvector_high: Higher 32 bit address (Little Endian) of boot vector
  1419. * @config_flags_set: Optional Processor specific Config Flags to set.
  1420. * Setting a bit here implies the corresponding mode
  1421. * will be set
  1422. * @config_flags_clear: Optional Processor specific Config Flags to clear.
  1423. * Setting a bit here implies the corresponding mode
  1424. * will be cleared
  1425. *
  1426. * Request type is TI_SCI_MSG_PROC_HANDOVER, response is a generic ACK/NACK
  1427. * message.
  1428. */
  1429. struct ti_sci_msg_req_set_config {
  1430. struct ti_sci_msg_hdr hdr;
  1431. u8 processor_id;
  1432. u32 bootvector_low;
  1433. u32 bootvector_high;
  1434. u32 config_flags_set;
  1435. u32 config_flags_clear;
  1436. } __packed;
  1437. /**
  1438. * struct ti_sci_msg_req_set_ctrl - Set Processor boot control flags
  1439. * @hdr: Generic Header
  1440. * @processor_id: ID of processor being configured
  1441. * @control_flags_set: Optional Processor specific Control Flags to set.
  1442. * Setting a bit here implies the corresponding mode
  1443. * will be set
  1444. * @control_flags_clear:Optional Processor specific Control Flags to clear.
  1445. * Setting a bit here implies the corresponding mode
  1446. * will be cleared
  1447. *
  1448. * Request type is TI_SCI_MSG_SET_CTRL, response is a generic ACK/NACK
  1449. * message.
  1450. */
  1451. struct ti_sci_msg_req_set_ctrl {
  1452. struct ti_sci_msg_hdr hdr;
  1453. u8 processor_id;
  1454. u32 control_flags_set;
  1455. u32 control_flags_clear;
  1456. } __packed;
  1457. /**
  1458. * struct ti_sci_msg_req_get_status - Processor boot status request
  1459. * @hdr: Generic Header
  1460. * @processor_id: ID of processor whose status is being requested
  1461. *
  1462. * Request type is TI_SCI_MSG_GET_STATUS, response is an appropriate
  1463. * message, or NACK in case of inability to satisfy request.
  1464. */
  1465. struct ti_sci_msg_req_get_status {
  1466. struct ti_sci_msg_hdr hdr;
  1467. u8 processor_id;
  1468. } __packed;
  1469. /**
  1470. * struct ti_sci_msg_resp_get_status - Processor boot status response
  1471. * @hdr: Generic Header
  1472. * @processor_id: ID of processor whose status is returned
  1473. * @bootvector_low: Lower 32 bit address (Little Endian) of boot vector
  1474. * @bootvector_high: Higher 32 bit address (Little Endian) of boot vector
  1475. * @config_flags: Optional Processor specific Config Flags set currently
  1476. * @control_flags: Optional Processor specific Control Flags set currently
  1477. * @status_flags: Optional Processor specific Status Flags set currently
  1478. *
  1479. * Response structure to a TI_SCI_MSG_GET_STATUS request.
  1480. */
  1481. struct ti_sci_msg_resp_get_status {
  1482. struct ti_sci_msg_hdr hdr;
  1483. u8 processor_id;
  1484. u32 bootvector_low;
  1485. u32 bootvector_high;
  1486. u32 config_flags;
  1487. u32 control_flags;
  1488. u32 status_flags;
  1489. } __packed;
  1490. #endif /* __TI_SCI_H */