aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2019-06-10 05:18:56 -0400
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>2019-06-12 23:13:35 -0400
commit68608b5e5063dd12942f1118286c6f595d0c4a05 (patch)
treeb674dc2bd69b9e692312cae3f8bf18582b71e207
parent66f030eac257a572fbedab3d9646d87d647351fd (diff)
firmware: ti_sci: Add resource management APIs for ringacc, psi-l and udma
Configuration of NAVSS resource, like rings, UDMAP channels, flows and PSI-L thread management need to be done via TISCI. Add the needed structures and functions for NAVSS resource configuration of the following: Rings from Ring Accelerator PSI-L thread management UDMAP tchan, rchan and rflow configuration. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com> Signed-off-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
-rw-r--r--drivers/firmware/ti_sci.c488
-rw-r--r--drivers/firmware/ti_sci.h675
-rw-r--r--include/linux/soc/ti/ti_sci_protocol.h215
3 files changed, 1378 insertions, 0 deletions
diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
index 36ce11a67235..02fa196428d8 100644
--- a/drivers/firmware/ti_sci.c
+++ b/drivers/firmware/ti_sci.c
@@ -2004,6 +2004,481 @@ static int ti_sci_cmd_free_event_map(const struct ti_sci_handle *handle,
2004 ia_id, vint, global_event, vint_status_bit, 0); 2004 ia_id, vint, global_event, vint_status_bit, 0);
2005} 2005}
2006 2006
2007/**
2008 * ti_sci_cmd_ring_config() - configure RA ring
2009 * @handle: Pointer to TI SCI handle.
2010 * @valid_params: Bitfield defining validity of ring configuration
2011 * parameters
2012 * @nav_id: Device ID of Navigator Subsystem from which the ring is
2013 * allocated
2014 * @index: Ring index
2015 * @addr_lo: The ring base address lo 32 bits
2016 * @addr_hi: The ring base address hi 32 bits
2017 * @count: Number of ring elements
2018 * @mode: The mode of the ring
2019 * @size: The ring element size.
2020 * @order_id: Specifies the ring's bus order ID
2021 *
2022 * Return: 0 if all went well, else returns appropriate error value.
2023 *
2024 * See @ti_sci_msg_rm_ring_cfg_req for more info.
2025 */
2026static int ti_sci_cmd_ring_config(const struct ti_sci_handle *handle,
2027 u32 valid_params, u16 nav_id, u16 index,
2028 u32 addr_lo, u32 addr_hi, u32 count,
2029 u8 mode, u8 size, u8 order_id)
2030{
2031 struct ti_sci_msg_rm_ring_cfg_req *req;
2032 struct ti_sci_msg_hdr *resp;
2033 struct ti_sci_xfer *xfer;
2034 struct ti_sci_info *info;
2035 struct device *dev;
2036 int ret = 0;
2037
2038 if (IS_ERR_OR_NULL(handle))
2039 return -EINVAL;
2040
2041 info = handle_to_ti_sci_info(handle);
2042 dev = info->dev;
2043
2044 xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_RM_RING_CFG,
2045 TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
2046 sizeof(*req), sizeof(*resp));
2047 if (IS_ERR(xfer)) {
2048 ret = PTR_ERR(xfer);
2049 dev_err(info->dev, "RM_RA:Message config failed(%d)\n", ret);
2050 return ret;
2051 }
2052 req = (struct ti_sci_msg_rm_ring_cfg_req *)xfer->xfer_buf;
2053 req->valid_params = valid_params;
2054 req->nav_id = nav_id;
2055 req->index = index;
2056 req->addr_lo = addr_lo;
2057 req->addr_hi = addr_hi;
2058 req->count = count;
2059 req->mode = mode;
2060 req->size = size;
2061 req->order_id = order_id;
2062
2063 ret = ti_sci_do_xfer(info, xfer);
2064 if (ret) {
2065 dev_err(info->dev, "RM_RA:Mbox config send fail %d\n", ret);
2066 goto fail;
2067 }
2068
2069 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf;
2070 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV;
2071
2072fail:
2073 ti_sci_put_one_xfer(&info->minfo, xfer);
2074 dev_dbg(info->dev, "RM_RA:config ring %u ret:%d\n", index, ret);
2075 return ret;
2076}
2077
2078/**
2079 * ti_sci_cmd_ring_get_config() - get RA ring configuration
2080 * @handle: Pointer to TI SCI handle.
2081 * @nav_id: Device ID of Navigator Subsystem from which the ring is
2082 * allocated
2083 * @index: Ring index
2084 * @addr_lo: Returns ring's base address lo 32 bits
2085 * @addr_hi: Returns ring's base address hi 32 bits
2086 * @count: Returns number of ring elements
2087 * @mode: Returns mode of the ring
2088 * @size: Returns ring element size
2089 * @order_id: Returns ring's bus order ID
2090 *
2091 * Return: 0 if all went well, else returns appropriate error value.
2092 *
2093 * See @ti_sci_msg_rm_ring_get_cfg_req for more info.
2094 */
2095static int ti_sci_cmd_ring_get_config(const struct ti_sci_handle *handle,
2096 u32 nav_id, u32 index, u8 *mode,
2097 u32 *addr_lo, u32 *addr_hi,
2098 u32 *count, u8 *size, u8 *order_id)
2099{
2100 struct ti_sci_msg_rm_ring_get_cfg_resp *resp;
2101 struct ti_sci_msg_rm_ring_get_cfg_req *req;
2102 struct ti_sci_xfer *xfer;
2103 struct ti_sci_info *info;
2104 struct device *dev;
2105 int ret = 0;
2106
2107 if (IS_ERR_OR_NULL(handle))
2108 return -EINVAL;
2109
2110 info = handle_to_ti_sci_info(handle);
2111 dev = info->dev;
2112
2113 xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_RM_RING_GET_CFG,
2114 TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
2115 sizeof(*req), sizeof(*resp));
2116 if (IS_ERR(xfer)) {
2117 ret = PTR_ERR(xfer);
2118 dev_err(info->dev,
2119 "RM_RA:Message get config failed(%d)\n", ret);
2120 return ret;
2121 }
2122 req = (struct ti_sci_msg_rm_ring_get_cfg_req *)xfer->xfer_buf;
2123 req->nav_id = nav_id;
2124 req->index = index;
2125
2126 ret = ti_sci_do_xfer(info, xfer);
2127 if (ret) {
2128 dev_err(info->dev, "RM_RA:Mbox get config send fail %d\n", ret);
2129 goto fail;
2130 }
2131
2132 resp = (struct ti_sci_msg_rm_ring_get_cfg_resp *)xfer->xfer_buf;
2133
2134 if (!ti_sci_is_response_ack(resp)) {
2135 ret = -ENODEV;
2136 } else {
2137 if (mode)
2138 *mode = resp->mode;
2139 if (addr_lo)
2140 *addr_lo = resp->addr_lo;
2141 if (addr_hi)
2142 *addr_hi = resp->addr_hi;
2143 if (count)
2144 *count = resp->count;
2145 if (size)
2146 *size = resp->size;
2147 if (order_id)
2148 *order_id = resp->order_id;
2149 };
2150
2151fail:
2152 ti_sci_put_one_xfer(&info->minfo, xfer);
2153 dev_dbg(info->dev, "RM_RA:get config ring %u ret:%d\n", index, ret);
2154 return ret;
2155}
2156
2157/**
2158 * ti_sci_cmd_rm_psil_pair() - Pair PSI-L source to destination thread
2159 * @handle: Pointer to TI SCI handle.
2160 * @nav_id: Device ID of Navigator Subsystem which should be used for
2161 * pairing
2162 * @src_thread: Source PSI-L thread ID
2163 * @dst_thread: Destination PSI-L thread ID
2164 *
2165 * Return: 0 if all went well, else returns appropriate error value.
2166 */
2167static int ti_sci_cmd_rm_psil_pair(const struct ti_sci_handle *handle,
2168 u32 nav_id, u32 src_thread, u32 dst_thread)
2169{
2170 struct ti_sci_msg_psil_pair *req;
2171 struct ti_sci_msg_hdr *resp;
2172 struct ti_sci_xfer *xfer;
2173 struct ti_sci_info *info;
2174 struct device *dev;
2175 int ret = 0;
2176
2177 if (IS_ERR(handle))
2178 return PTR_ERR(handle);
2179 if (!handle)
2180 return -EINVAL;
2181
2182 info = handle_to_ti_sci_info(handle);
2183 dev = info->dev;
2184
2185 xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_RM_PSIL_PAIR,
2186 TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
2187 sizeof(*req), sizeof(*resp));
2188 if (IS_ERR(xfer)) {
2189 ret = PTR_ERR(xfer);
2190 dev_err(dev, "RM_PSIL:Message reconfig failed(%d)\n", ret);
2191 return ret;
2192 }
2193 req = (struct ti_sci_msg_psil_pair *)xfer->xfer_buf;
2194 req->nav_id = nav_id;
2195 req->src_thread = src_thread;
2196 req->dst_thread = dst_thread;
2197
2198 ret = ti_sci_do_xfer(info, xfer);
2199 if (ret) {
2200 dev_err(dev, "RM_PSIL:Mbox send fail %d\n", ret);
2201 goto fail;
2202 }
2203
2204 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf;
2205 ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL;
2206
2207fail:
2208 ti_sci_put_one_xfer(&info->minfo, xfer);
2209
2210 return ret;
2211}
2212
2213/**
2214 * ti_sci_cmd_rm_psil_unpair() - Unpair PSI-L source from destination thread
2215 * @handle: Pointer to TI SCI handle.
2216 * @nav_id: Device ID of Navigator Subsystem which should be used for
2217 * unpairing
2218 * @src_thread: Source PSI-L thread ID
2219 * @dst_thread: Destination PSI-L thread ID
2220 *
2221 * Return: 0 if all went well, else returns appropriate error value.
2222 */
2223static int ti_sci_cmd_rm_psil_unpair(const struct ti_sci_handle *handle,
2224 u32 nav_id, u32 src_thread, u32 dst_thread)
2225{
2226 struct ti_sci_msg_psil_unpair *req;
2227 struct ti_sci_msg_hdr *resp;
2228 struct ti_sci_xfer *xfer;
2229 struct ti_sci_info *info;
2230 struct device *dev;
2231 int ret = 0;
2232
2233 if (IS_ERR(handle))
2234 return PTR_ERR(handle);
2235 if (!handle)
2236 return -EINVAL;
2237
2238 info = handle_to_ti_sci_info(handle);
2239 dev = info->dev;
2240
2241 xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_RM_PSIL_UNPAIR,
2242 TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
2243 sizeof(*req), sizeof(*resp));
2244 if (IS_ERR(xfer)) {
2245 ret = PTR_ERR(xfer);
2246 dev_err(dev, "RM_PSIL:Message reconfig failed(%d)\n", ret);
2247 return ret;
2248 }
2249 req = (struct ti_sci_msg_psil_unpair *)xfer->xfer_buf;
2250 req->nav_id = nav_id;
2251 req->src_thread = src_thread;
2252 req->dst_thread = dst_thread;
2253
2254 ret = ti_sci_do_xfer(info, xfer);
2255 if (ret) {
2256 dev_err(dev, "RM_PSIL:Mbox send fail %d\n", ret);
2257 goto fail;
2258 }
2259
2260 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf;
2261 ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL;
2262
2263fail:
2264 ti_sci_put_one_xfer(&info->minfo, xfer);
2265
2266 return ret;
2267}
2268
2269/**
2270 * ti_sci_cmd_rm_udmap_tx_ch_cfg() - Configure a UDMAP TX channel
2271 * @handle: Pointer to TI SCI handle.
2272 * @params: Pointer to ti_sci_msg_rm_udmap_tx_ch_cfg TX channel config
2273 * structure
2274 *
2275 * Return: 0 if all went well, else returns appropriate error value.
2276 *
2277 * See @ti_sci_msg_rm_udmap_tx_ch_cfg and @ti_sci_msg_rm_udmap_tx_ch_cfg_req for
2278 * more info.
2279 */
2280static int ti_sci_cmd_rm_udmap_tx_ch_cfg(const struct ti_sci_handle *handle,
2281 const struct ti_sci_msg_rm_udmap_tx_ch_cfg *params)
2282{
2283 struct ti_sci_msg_rm_udmap_tx_ch_cfg_req *req;
2284 struct ti_sci_msg_hdr *resp;
2285 struct ti_sci_xfer *xfer;
2286 struct ti_sci_info *info;
2287 struct device *dev;
2288 int ret = 0;
2289
2290 if (IS_ERR_OR_NULL(handle))
2291 return -EINVAL;
2292
2293 info = handle_to_ti_sci_info(handle);
2294 dev = info->dev;
2295
2296 xfer = ti_sci_get_one_xfer(info, TISCI_MSG_RM_UDMAP_TX_CH_CFG,
2297 TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
2298 sizeof(*req), sizeof(*resp));
2299 if (IS_ERR(xfer)) {
2300 ret = PTR_ERR(xfer);
2301 dev_err(info->dev, "Message TX_CH_CFG alloc failed(%d)\n", ret);
2302 return ret;
2303 }
2304 req = (struct ti_sci_msg_rm_udmap_tx_ch_cfg_req *)xfer->xfer_buf;
2305 req->valid_params = params->valid_params;
2306 req->nav_id = params->nav_id;
2307 req->index = params->index;
2308 req->tx_pause_on_err = params->tx_pause_on_err;
2309 req->tx_filt_einfo = params->tx_filt_einfo;
2310 req->tx_filt_pswords = params->tx_filt_pswords;
2311 req->tx_atype = params->tx_atype;
2312 req->tx_chan_type = params->tx_chan_type;
2313 req->tx_supr_tdpkt = params->tx_supr_tdpkt;
2314 req->tx_fetch_size = params->tx_fetch_size;
2315 req->tx_credit_count = params->tx_credit_count;
2316 req->txcq_qnum = params->txcq_qnum;
2317 req->tx_priority = params->tx_priority;
2318 req->tx_qos = params->tx_qos;
2319 req->tx_orderid = params->tx_orderid;
2320 req->fdepth = params->fdepth;
2321 req->tx_sched_priority = params->tx_sched_priority;
2322 req->tx_burst_size = params->tx_burst_size;
2323
2324 ret = ti_sci_do_xfer(info, xfer);
2325 if (ret) {
2326 dev_err(info->dev, "Mbox send TX_CH_CFG fail %d\n", ret);
2327 goto fail;
2328 }
2329
2330 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf;
2331 ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL;
2332
2333fail:
2334 ti_sci_put_one_xfer(&info->minfo, xfer);
2335 dev_dbg(info->dev, "TX_CH_CFG: chn %u ret:%u\n", params->index, ret);
2336 return ret;
2337}
2338
2339/**
2340 * ti_sci_cmd_rm_udmap_rx_ch_cfg() - Configure a UDMAP RX channel
2341 * @handle: Pointer to TI SCI handle.
2342 * @params: Pointer to ti_sci_msg_rm_udmap_rx_ch_cfg RX channel config
2343 * structure
2344 *
2345 * Return: 0 if all went well, else returns appropriate error value.
2346 *
2347 * See @ti_sci_msg_rm_udmap_rx_ch_cfg and @ti_sci_msg_rm_udmap_rx_ch_cfg_req for
2348 * more info.
2349 */
2350static int ti_sci_cmd_rm_udmap_rx_ch_cfg(const struct ti_sci_handle *handle,
2351 const struct ti_sci_msg_rm_udmap_rx_ch_cfg *params)
2352{
2353 struct ti_sci_msg_rm_udmap_rx_ch_cfg_req *req;
2354 struct ti_sci_msg_hdr *resp;
2355 struct ti_sci_xfer *xfer;
2356 struct ti_sci_info *info;
2357 struct device *dev;
2358 int ret = 0;
2359
2360 if (IS_ERR_OR_NULL(handle))
2361 return -EINVAL;
2362
2363 info = handle_to_ti_sci_info(handle);
2364 dev = info->dev;
2365
2366 xfer = ti_sci_get_one_xfer(info, TISCI_MSG_RM_UDMAP_RX_CH_CFG,
2367 TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
2368 sizeof(*req), sizeof(*resp));
2369 if (IS_ERR(xfer)) {
2370 ret = PTR_ERR(xfer);
2371 dev_err(info->dev, "Message RX_CH_CFG alloc failed(%d)\n", ret);
2372 return ret;
2373 }
2374 req = (struct ti_sci_msg_rm_udmap_rx_ch_cfg_req *)xfer->xfer_buf;
2375 req->valid_params = params->valid_params;
2376 req->nav_id = params->nav_id;
2377 req->index = params->index;
2378 req->rx_fetch_size = params->rx_fetch_size;
2379 req->rxcq_qnum = params->rxcq_qnum;
2380 req->rx_priority = params->rx_priority;
2381 req->rx_qos = params->rx_qos;
2382 req->rx_orderid = params->rx_orderid;
2383 req->rx_sched_priority = params->rx_sched_priority;
2384 req->flowid_start = params->flowid_start;
2385 req->flowid_cnt = params->flowid_cnt;
2386 req->rx_pause_on_err = params->rx_pause_on_err;
2387 req->rx_atype = params->rx_atype;
2388 req->rx_chan_type = params->rx_chan_type;
2389 req->rx_ignore_short = params->rx_ignore_short;
2390 req->rx_ignore_long = params->rx_ignore_long;
2391 req->rx_burst_size = params->rx_burst_size;
2392
2393 ret = ti_sci_do_xfer(info, xfer);
2394 if (ret) {
2395 dev_err(info->dev, "Mbox send RX_CH_CFG fail %d\n", ret);
2396 goto fail;
2397 }
2398
2399 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf;
2400 ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL;
2401
2402fail:
2403 ti_sci_put_one_xfer(&info->minfo, xfer);
2404 dev_dbg(info->dev, "RX_CH_CFG: chn %u ret:%d\n", params->index, ret);
2405 return ret;
2406}
2407
2408/**
2409 * ti_sci_cmd_rm_udmap_rx_flow_cfg() - Configure UDMAP RX FLOW
2410 * @handle: Pointer to TI SCI handle.
2411 * @params: Pointer to ti_sci_msg_rm_udmap_flow_cfg RX FLOW config
2412 * structure
2413 *
2414 * Return: 0 if all went well, else returns appropriate error value.
2415 *
2416 * See @ti_sci_msg_rm_udmap_flow_cfg and @ti_sci_msg_rm_udmap_flow_cfg_req for
2417 * more info.
2418 */
2419static int ti_sci_cmd_rm_udmap_rx_flow_cfg(const struct ti_sci_handle *handle,
2420 const struct ti_sci_msg_rm_udmap_flow_cfg *params)
2421{
2422 struct ti_sci_msg_rm_udmap_flow_cfg_req *req;
2423 struct ti_sci_msg_hdr *resp;
2424 struct ti_sci_xfer *xfer;
2425 struct ti_sci_info *info;
2426 struct device *dev;
2427 int ret = 0;
2428
2429 if (IS_ERR_OR_NULL(handle))
2430 return -EINVAL;
2431
2432 info = handle_to_ti_sci_info(handle);
2433 dev = info->dev;
2434
2435 xfer = ti_sci_get_one_xfer(info, TISCI_MSG_RM_UDMAP_FLOW_CFG,
2436 TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
2437 sizeof(*req), sizeof(*resp));
2438 if (IS_ERR(xfer)) {
2439 ret = PTR_ERR(xfer);
2440 dev_err(dev, "RX_FL_CFG: Message alloc failed(%d)\n", ret);
2441 return ret;
2442 }
2443 req = (struct ti_sci_msg_rm_udmap_flow_cfg_req *)xfer->xfer_buf;
2444 req->valid_params = params->valid_params;
2445 req->nav_id = params->nav_id;
2446 req->flow_index = params->flow_index;
2447 req->rx_einfo_present = params->rx_einfo_present;
2448 req->rx_psinfo_present = params->rx_psinfo_present;
2449 req->rx_error_handling = params->rx_error_handling;
2450 req->rx_desc_type = params->rx_desc_type;
2451 req->rx_sop_offset = params->rx_sop_offset;
2452 req->rx_dest_qnum = params->rx_dest_qnum;
2453 req->rx_src_tag_hi = params->rx_src_tag_hi;
2454 req->rx_src_tag_lo = params->rx_src_tag_lo;
2455 req->rx_dest_tag_hi = params->rx_dest_tag_hi;
2456 req->rx_dest_tag_lo = params->rx_dest_tag_lo;
2457 req->rx_src_tag_hi_sel = params->rx_src_tag_hi_sel;
2458 req->rx_src_tag_lo_sel = params->rx_src_tag_lo_sel;
2459 req->rx_dest_tag_hi_sel = params->rx_dest_tag_hi_sel;
2460 req->rx_dest_tag_lo_sel = params->rx_dest_tag_lo_sel;
2461 req->rx_fdq0_sz0_qnum = params->rx_fdq0_sz0_qnum;
2462 req->rx_fdq1_qnum = params->rx_fdq1_qnum;
2463 req->rx_fdq2_qnum = params->rx_fdq2_qnum;
2464 req->rx_fdq3_qnum = params->rx_fdq3_qnum;
2465 req->rx_ps_location = params->rx_ps_location;
2466
2467 ret = ti_sci_do_xfer(info, xfer);
2468 if (ret) {
2469 dev_err(dev, "RX_FL_CFG: Mbox send fail %d\n", ret);
2470 goto fail;
2471 }
2472
2473 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf;
2474 ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL;
2475
2476fail:
2477 ti_sci_put_one_xfer(&info->minfo, xfer);
2478 dev_dbg(info->dev, "RX_FL_CFG: %u ret:%d\n", params->flow_index, ret);
2479 return ret;
2480}
2481
2007/* 2482/*
2008 * ti_sci_setup_ops() - Setup the operations structures 2483 * ti_sci_setup_ops() - Setup the operations structures
2009 * @info: pointer to TISCI pointer 2484 * @info: pointer to TISCI pointer
@@ -2016,6 +2491,9 @@ static void ti_sci_setup_ops(struct ti_sci_info *info)
2016 struct ti_sci_clk_ops *cops = &ops->clk_ops; 2491 struct ti_sci_clk_ops *cops = &ops->clk_ops;
2017 struct ti_sci_rm_core_ops *rm_core_ops = &ops->rm_core_ops; 2492 struct ti_sci_rm_core_ops *rm_core_ops = &ops->rm_core_ops;
2018 struct ti_sci_rm_irq_ops *iops = &ops->rm_irq_ops; 2493 struct ti_sci_rm_irq_ops *iops = &ops->rm_irq_ops;
2494 struct ti_sci_rm_ringacc_ops *rops = &ops->rm_ring_ops;
2495 struct ti_sci_rm_psil_ops *psilops = &ops->rm_psil_ops;
2496 struct ti_sci_rm_udmap_ops *udmap_ops = &ops->rm_udmap_ops;
2019 2497
2020 core_ops->reboot_device = ti_sci_cmd_core_reboot; 2498 core_ops->reboot_device = ti_sci_cmd_core_reboot;
2021 2499
@@ -2055,6 +2533,16 @@ static void ti_sci_setup_ops(struct ti_sci_info *info)
2055 iops->set_event_map = ti_sci_cmd_set_event_map; 2533 iops->set_event_map = ti_sci_cmd_set_event_map;
2056 iops->free_irq = ti_sci_cmd_free_irq; 2534 iops->free_irq = ti_sci_cmd_free_irq;
2057 iops->free_event_map = ti_sci_cmd_free_event_map; 2535 iops->free_event_map = ti_sci_cmd_free_event_map;
2536
2537 rops->config = ti_sci_cmd_ring_config;
2538 rops->get_config = ti_sci_cmd_ring_get_config;
2539
2540 psilops->pair = ti_sci_cmd_rm_psil_pair;
2541 psilops->unpair = ti_sci_cmd_rm_psil_unpair;
2542
2543 udmap_ops->tx_ch_cfg = ti_sci_cmd_rm_udmap_tx_ch_cfg;
2544 udmap_ops->rx_ch_cfg = ti_sci_cmd_rm_udmap_rx_ch_cfg;
2545 udmap_ops->rx_flow_cfg = ti_sci_cmd_rm_udmap_rx_flow_cfg;
2058} 2546}
2059 2547
2060/** 2548/**
diff --git a/drivers/firmware/ti_sci.h b/drivers/firmware/ti_sci.h
index 4983827151bf..2bb81ec7793c 100644
--- a/drivers/firmware/ti_sci.h
+++ b/drivers/firmware/ti_sci.h
@@ -42,6 +42,35 @@
42#define TI_SCI_MSG_SET_IRQ 0x1000 42#define TI_SCI_MSG_SET_IRQ 0x1000
43#define TI_SCI_MSG_FREE_IRQ 0x1001 43#define TI_SCI_MSG_FREE_IRQ 0x1001
44 44
45/* NAVSS resource management */
46/* Ringacc requests */
47#define TI_SCI_MSG_RM_RING_ALLOCATE 0x1100
48#define TI_SCI_MSG_RM_RING_FREE 0x1101
49#define TI_SCI_MSG_RM_RING_RECONFIG 0x1102
50#define TI_SCI_MSG_RM_RING_RESET 0x1103
51#define TI_SCI_MSG_RM_RING_CFG 0x1110
52#define TI_SCI_MSG_RM_RING_GET_CFG 0x1111
53
54/* PSI-L requests */
55#define TI_SCI_MSG_RM_PSIL_PAIR 0x1280
56#define TI_SCI_MSG_RM_PSIL_UNPAIR 0x1281
57
58#define TI_SCI_MSG_RM_UDMAP_TX_ALLOC 0x1200
59#define TI_SCI_MSG_RM_UDMAP_TX_FREE 0x1201
60#define TI_SCI_MSG_RM_UDMAP_RX_ALLOC 0x1210
61#define TI_SCI_MSG_RM_UDMAP_RX_FREE 0x1211
62#define TI_SCI_MSG_RM_UDMAP_FLOW_CFG 0x1220
63#define TI_SCI_MSG_RM_UDMAP_OPT_FLOW_CFG 0x1221
64
65#define TISCI_MSG_RM_UDMAP_TX_CH_CFG 0x1205
66#define TISCI_MSG_RM_UDMAP_TX_CH_GET_CFG 0x1206
67#define TISCI_MSG_RM_UDMAP_RX_CH_CFG 0x1215
68#define TISCI_MSG_RM_UDMAP_RX_CH_GET_CFG 0x1216
69#define TISCI_MSG_RM_UDMAP_FLOW_CFG 0x1230
70#define TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_CFG 0x1231
71#define TISCI_MSG_RM_UDMAP_FLOW_GET_CFG 0x1232
72#define TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_GET_CFG 0x1233
73
45/** 74/**
46 * struct ti_sci_msg_hdr - Generic Message Header for All messages and responses 75 * struct ti_sci_msg_hdr - Generic Message Header for All messages and responses
47 * @type: Type of messages: One of TI_SCI_MSG* values 76 * @type: Type of messages: One of TI_SCI_MSG* values
@@ -563,4 +592,650 @@ struct ti_sci_msg_req_manage_irq {
563 u8 secondary_host; 592 u8 secondary_host;
564} __packed; 593} __packed;
565 594
595/**
596 * struct ti_sci_msg_rm_ring_cfg_req - Configure a Navigator Subsystem ring
597 *
598 * Configures the non-real-time registers of a Navigator Subsystem ring.
599 * @hdr: Generic Header
600 * @valid_params: Bitfield defining validity of ring configuration parameters.
601 * The ring configuration fields are not valid, and will not be used for
602 * ring configuration, if their corresponding valid bit is zero.
603 * Valid bit usage:
604 * 0 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_lo
605 * 1 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_hi
606 * 2 - Valid bit for @tisci_msg_rm_ring_cfg_req count
607 * 3 - Valid bit for @tisci_msg_rm_ring_cfg_req mode
608 * 4 - Valid bit for @tisci_msg_rm_ring_cfg_req size
609 * 5 - Valid bit for @tisci_msg_rm_ring_cfg_req order_id
610 * @nav_id: Device ID of Navigator Subsystem from which the ring is allocated
611 * @index: ring index to be configured.
612 * @addr_lo: 32 LSBs of ring base address to be programmed into the ring's
613 * RING_BA_LO register
614 * @addr_hi: 16 MSBs of ring base address to be programmed into the ring's
615 * RING_BA_HI register.
616 * @count: Number of ring elements. Must be even if mode is CREDENTIALS or QM
617 * modes.
618 * @mode: Specifies the mode the ring is to be configured.
619 * @size: Specifies encoded ring element size. To calculate the encoded size use
620 * the formula (log2(size_bytes) - 2), where size_bytes cannot be
621 * greater than 256.
622 * @order_id: Specifies the ring's bus order ID.
623 */
624struct ti_sci_msg_rm_ring_cfg_req {
625 struct ti_sci_msg_hdr hdr;
626 u32 valid_params;
627 u16 nav_id;
628 u16 index;
629 u32 addr_lo;
630 u32 addr_hi;
631 u32 count;
632 u8 mode;
633 u8 size;
634 u8 order_id;
635} __packed;
636
637/**
638 * struct ti_sci_msg_rm_ring_get_cfg_req - Get RA ring's configuration
639 *
640 * Gets the configuration of the non-real-time register fields of a ring. The
641 * host, or a supervisor of the host, who owns the ring must be the requesting
642 * host. The values of the non-real-time registers are returned in
643 * @ti_sci_msg_rm_ring_get_cfg_resp.
644 *
645 * @hdr: Generic Header
646 * @nav_id: Device ID of Navigator Subsystem from which the ring is allocated
647 * @index: ring index.
648 */
649struct ti_sci_msg_rm_ring_get_cfg_req {
650 struct ti_sci_msg_hdr hdr;
651 u16 nav_id;
652 u16 index;
653} __packed;
654
655/**
656 * struct ti_sci_msg_rm_ring_get_cfg_resp - Ring get configuration response
657 *
658 * Response received by host processor after RM has handled
659 * @ti_sci_msg_rm_ring_get_cfg_req. The response contains the ring's
660 * non-real-time register values.
661 *
662 * @hdr: Generic Header
663 * @addr_lo: Ring 32 LSBs of base address
664 * @addr_hi: Ring 16 MSBs of base address.
665 * @count: Ring number of elements.
666 * @mode: Ring mode.
667 * @size: encoded Ring element size
668 * @order_id: ing order ID.
669 */
670struct ti_sci_msg_rm_ring_get_cfg_resp {
671 struct ti_sci_msg_hdr hdr;
672 u32 addr_lo;
673 u32 addr_hi;
674 u32 count;
675 u8 mode;
676 u8 size;
677 u8 order_id;
678} __packed;
679
680/**
681 * struct ti_sci_msg_psil_pair - Pairs a PSI-L source thread to a destination
682 * thread
683 * @hdr: Generic Header
684 * @nav_id: SoC Navigator Subsystem device ID whose PSI-L config proxy is
685 * used to pair the source and destination threads.
686 * @src_thread: PSI-L source thread ID within the PSI-L System thread map.
687 *
688 * UDMAP transmit channels mapped to source threads will have their
689 * TCHAN_THRD_ID register programmed with the destination thread if the pairing
690 * is successful.
691
692 * @dst_thread: PSI-L destination thread ID within the PSI-L System thread map.
693 * PSI-L destination threads start at index 0x8000. The request is NACK'd if
694 * the destination thread is not greater than or equal to 0x8000.
695 *
696 * UDMAP receive channels mapped to destination threads will have their
697 * RCHAN_THRD_ID register programmed with the source thread if the pairing
698 * is successful.
699 *
700 * Request type is TI_SCI_MSG_RM_PSIL_PAIR, response is a generic ACK or NACK
701 * message.
702 */
703struct ti_sci_msg_psil_pair {
704 struct ti_sci_msg_hdr hdr;
705 u32 nav_id;
706 u32 src_thread;
707 u32 dst_thread;
708} __packed;
709
710/**
711 * struct ti_sci_msg_psil_unpair - Unpairs a PSI-L source thread from a
712 * destination thread
713 * @hdr: Generic Header
714 * @nav_id: SoC Navigator Subsystem device ID whose PSI-L config proxy is
715 * used to unpair the source and destination threads.
716 * @src_thread: PSI-L source thread ID within the PSI-L System thread map.
717 *
718 * UDMAP transmit channels mapped to source threads will have their
719 * TCHAN_THRD_ID register cleared if the unpairing is successful.
720 *
721 * @dst_thread: PSI-L destination thread ID within the PSI-L System thread map.
722 * PSI-L destination threads start at index 0x8000. The request is NACK'd if
723 * the destination thread is not greater than or equal to 0x8000.
724 *
725 * UDMAP receive channels mapped to destination threads will have their
726 * RCHAN_THRD_ID register cleared if the unpairing is successful.
727 *
728 * Request type is TI_SCI_MSG_RM_PSIL_UNPAIR, response is a generic ACK or NACK
729 * message.
730 */
731struct ti_sci_msg_psil_unpair {
732 struct ti_sci_msg_hdr hdr;
733 u32 nav_id;
734 u32 src_thread;
735 u32 dst_thread;
736} __packed;
737
738/**
739 * struct ti_sci_msg_udmap_rx_flow_cfg - UDMAP receive flow configuration
740 * message
741 * @hdr: Generic Header
742 * @nav_id: SoC Navigator Subsystem device ID from which the receive flow is
743 * allocated
744 * @flow_index: UDMAP receive flow index for non-optional configuration.
745 * @rx_ch_index: Specifies the index of the receive channel using the flow_index
746 * @rx_einfo_present: UDMAP receive flow extended packet info present.
747 * @rx_psinfo_present: UDMAP receive flow PS words present.
748 * @rx_error_handling: UDMAP receive flow error handling configuration. Valid
749 * values are TI_SCI_RM_UDMAP_RX_FLOW_ERR_DROP/RETRY.
750 * @rx_desc_type: UDMAP receive flow descriptor type. It can be one of
751 * TI_SCI_RM_UDMAP_RX_FLOW_DESC_HOST/MONO.
752 * @rx_sop_offset: UDMAP receive flow start of packet offset.
753 * @rx_dest_qnum: UDMAP receive flow destination queue number.
754 * @rx_ps_location: UDMAP receive flow PS words location.
755 * 0 - end of packet descriptor
756 * 1 - Beginning of the data buffer
757 * @rx_src_tag_hi: UDMAP receive flow source tag high byte constant
758 * @rx_src_tag_lo: UDMAP receive flow source tag low byte constant
759 * @rx_dest_tag_hi: UDMAP receive flow destination tag high byte constant
760 * @rx_dest_tag_lo: UDMAP receive flow destination tag low byte constant
761 * @rx_src_tag_hi_sel: UDMAP receive flow source tag high byte selector
762 * @rx_src_tag_lo_sel: UDMAP receive flow source tag low byte selector
763 * @rx_dest_tag_hi_sel: UDMAP receive flow destination tag high byte selector
764 * @rx_dest_tag_lo_sel: UDMAP receive flow destination tag low byte selector
765 * @rx_size_thresh_en: UDMAP receive flow packet size based free buffer queue
766 * enable. If enabled, the ti_sci_rm_udmap_rx_flow_opt_cfg also need to be
767 * configured and sent.
768 * @rx_fdq0_sz0_qnum: UDMAP receive flow free descriptor queue 0.
769 * @rx_fdq1_qnum: UDMAP receive flow free descriptor queue 1.
770 * @rx_fdq2_qnum: UDMAP receive flow free descriptor queue 2.
771 * @rx_fdq3_qnum: UDMAP receive flow free descriptor queue 3.
772 *
773 * For detailed information on the settings, see the UDMAP section of the TRM.
774 */
775struct ti_sci_msg_udmap_rx_flow_cfg {
776 struct ti_sci_msg_hdr hdr;
777 u32 nav_id;
778 u32 flow_index;
779 u32 rx_ch_index;
780 u8 rx_einfo_present;
781 u8 rx_psinfo_present;
782 u8 rx_error_handling;
783 u8 rx_desc_type;
784 u16 rx_sop_offset;
785 u16 rx_dest_qnum;
786 u8 rx_ps_location;
787 u8 rx_src_tag_hi;
788 u8 rx_src_tag_lo;
789 u8 rx_dest_tag_hi;
790 u8 rx_dest_tag_lo;
791 u8 rx_src_tag_hi_sel;
792 u8 rx_src_tag_lo_sel;
793 u8 rx_dest_tag_hi_sel;
794 u8 rx_dest_tag_lo_sel;
795 u8 rx_size_thresh_en;
796 u16 rx_fdq0_sz0_qnum;
797 u16 rx_fdq1_qnum;
798 u16 rx_fdq2_qnum;
799 u16 rx_fdq3_qnum;
800} __packed;
801
802/**
803 * struct rm_ti_sci_msg_udmap_rx_flow_opt_cfg - parameters for UDMAP receive
804 * flow optional configuration
805 * @hdr: Generic Header
806 * @nav_id: SoC Navigator Subsystem device ID from which the receive flow is
807 * allocated
808 * @flow_index: UDMAP receive flow index for optional configuration.
809 * @rx_ch_index: Specifies the index of the receive channel using the flow_index
810 * @rx_size_thresh0: UDMAP receive flow packet size threshold 0.
811 * @rx_size_thresh1: UDMAP receive flow packet size threshold 1.
812 * @rx_size_thresh2: UDMAP receive flow packet size threshold 2.
813 * @rx_fdq0_sz1_qnum: UDMAP receive flow free descriptor queue for size
814 * threshold 1.
815 * @rx_fdq0_sz2_qnum: UDMAP receive flow free descriptor queue for size
816 * threshold 2.
817 * @rx_fdq0_sz3_qnum: UDMAP receive flow free descriptor queue for size
818 * threshold 3.
819 *
820 * For detailed information on the settings, see the UDMAP section of the TRM.
821 */
822struct rm_ti_sci_msg_udmap_rx_flow_opt_cfg {
823 struct ti_sci_msg_hdr hdr;
824 u32 nav_id;
825 u32 flow_index;
826 u32 rx_ch_index;
827 u16 rx_size_thresh0;
828 u16 rx_size_thresh1;
829 u16 rx_size_thresh2;
830 u16 rx_fdq0_sz1_qnum;
831 u16 rx_fdq0_sz2_qnum;
832 u16 rx_fdq0_sz3_qnum;
833} __packed;
834
835/**
836 * Configures a Navigator Subsystem UDMAP transmit channel
837 *
838 * Configures the non-real-time registers of a Navigator Subsystem UDMAP
839 * transmit channel. The channel index must be assigned to the host defined
840 * in the TISCI header via the RM board configuration resource assignment
841 * range list.
842 *
843 * @hdr: Generic Header
844 *
845 * @valid_params: Bitfield defining validity of tx channel configuration
846 * parameters. The tx channel configuration fields are not valid, and will not
847 * be used for ch configuration, if their corresponding valid bit is zero.
848 * Valid bit usage:
849 * 0 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_pause_on_err
850 * 1 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_atype
851 * 2 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_chan_type
852 * 3 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_fetch_size
853 * 4 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::txcq_qnum
854 * 5 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_priority
855 * 6 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_qos
856 * 7 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_orderid
857 * 8 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_sched_priority
858 * 9 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_einfo
859 * 10 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_pswords
860 * 11 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_supr_tdpkt
861 * 12 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_credit_count
862 * 13 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::fdepth
863 * 14 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_burst_size
864 *
865 * @nav_id: SoC device ID of Navigator Subsystem where tx channel is located
866 *
867 * @index: UDMAP transmit channel index.
868 *
869 * @tx_pause_on_err: UDMAP transmit channel pause on error configuration to
870 * be programmed into the tx_pause_on_err field of the channel's TCHAN_TCFG
871 * register.
872 *
873 * @tx_filt_einfo: UDMAP transmit channel extended packet information passing
874 * configuration to be programmed into the tx_filt_einfo field of the
875 * channel's TCHAN_TCFG register.
876 *
877 * @tx_filt_pswords: UDMAP transmit channel protocol specific word passing
878 * configuration to be programmed into the tx_filt_pswords field of the
879 * channel's TCHAN_TCFG register.
880 *
881 * @tx_atype: UDMAP transmit channel non Ring Accelerator access pointer
882 * interpretation configuration to be programmed into the tx_atype field of
883 * the channel's TCHAN_TCFG register.
884 *
885 * @tx_chan_type: UDMAP transmit channel functional channel type and work
886 * passing mechanism configuration to be programmed into the tx_chan_type
887 * field of the channel's TCHAN_TCFG register.
888 *
889 * @tx_supr_tdpkt: UDMAP transmit channel teardown packet generation suppression
890 * configuration to be programmed into the tx_supr_tdpkt field of the channel's
891 * TCHAN_TCFG register.
892 *
893 * @tx_fetch_size: UDMAP transmit channel number of 32-bit descriptor words to
894 * fetch configuration to be programmed into the tx_fetch_size field of the
895 * channel's TCHAN_TCFG register. The user must make sure to set the maximum
896 * word count that can pass through the channel for any allowed descriptor type.
897 *
898 * @tx_credit_count: UDMAP transmit channel transfer request credit count
899 * configuration to be programmed into the count field of the TCHAN_TCREDIT
900 * register. Specifies how many credits for complete TRs are available.
901 *
902 * @txcq_qnum: UDMAP transmit channel completion queue configuration to be
903 * programmed into the txcq_qnum field of the TCHAN_TCQ register. The specified
904 * completion queue must be assigned to the host, or a subordinate of the host,
905 * requesting configuration of the transmit channel.
906 *
907 * @tx_priority: UDMAP transmit channel transmit priority value to be programmed
908 * into the priority field of the channel's TCHAN_TPRI_CTRL register.
909 *
910 * @tx_qos: UDMAP transmit channel transmit qos value to be programmed into the
911 * qos field of the channel's TCHAN_TPRI_CTRL register.
912 *
913 * @tx_orderid: UDMAP transmit channel bus order id value to be programmed into
914 * the orderid field of the channel's TCHAN_TPRI_CTRL register.
915 *
916 * @fdepth: UDMAP transmit channel FIFO depth configuration to be programmed
917 * into the fdepth field of the TCHAN_TFIFO_DEPTH register. Sets the number of
918 * Tx FIFO bytes which are allowed to be stored for the channel. Check the UDMAP
919 * section of the TRM for restrictions regarding this parameter.
920 *
921 * @tx_sched_priority: UDMAP transmit channel tx scheduling priority
922 * configuration to be programmed into the priority field of the channel's
923 * TCHAN_TST_SCHED register.
924 *
925 * @tx_burst_size: UDMAP transmit channel burst size configuration to be
926 * programmed into the tx_burst_size field of the TCHAN_TCFG register.
927 */
928struct ti_sci_msg_rm_udmap_tx_ch_cfg_req {
929 struct ti_sci_msg_hdr hdr;
930 u32 valid_params;
931 u16 nav_id;
932 u16 index;
933 u8 tx_pause_on_err;
934 u8 tx_filt_einfo;
935 u8 tx_filt_pswords;
936 u8 tx_atype;
937 u8 tx_chan_type;
938 u8 tx_supr_tdpkt;
939 u16 tx_fetch_size;
940 u8 tx_credit_count;
941 u16 txcq_qnum;
942 u8 tx_priority;
943 u8 tx_qos;
944 u8 tx_orderid;
945 u16 fdepth;
946 u8 tx_sched_priority;
947 u8 tx_burst_size;
948} __packed;
949
950/**
951 * Configures a Navigator Subsystem UDMAP receive channel
952 *
953 * Configures the non-real-time registers of a Navigator Subsystem UDMAP
954 * receive channel. The channel index must be assigned to the host defined
955 * in the TISCI header via the RM board configuration resource assignment
956 * range list.
957 *
958 * @hdr: Generic Header
959 *
960 * @valid_params: Bitfield defining validity of rx channel configuration
961 * parameters.
962 * The rx channel configuration fields are not valid, and will not be used for
963 * ch configuration, if their corresponding valid bit is zero.
964 * Valid bit usage:
965 * 0 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_pause_on_err
966 * 1 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_atype
967 * 2 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_chan_type
968 * 3 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_fetch_size
969 * 4 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rxcq_qnum
970 * 5 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_priority
971 * 6 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_qos
972 * 7 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_orderid
973 * 8 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_sched_priority
974 * 9 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_start
975 * 10 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_cnt
976 * 11 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_short
977 * 12 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_long
978 * 14 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_burst_size
979 *
980 * @nav_id: SoC device ID of Navigator Subsystem where rx channel is located
981 *
982 * @index: UDMAP receive channel index.
983 *
984 * @rx_fetch_size: UDMAP receive channel number of 32-bit descriptor words to
985 * fetch configuration to be programmed into the rx_fetch_size field of the
986 * channel's RCHAN_RCFG register.
987 *
988 * @rxcq_qnum: UDMAP receive channel completion queue configuration to be
989 * programmed into the rxcq_qnum field of the RCHAN_RCQ register.
990 * The specified completion queue must be assigned to the host, or a subordinate
991 * of the host, requesting configuration of the receive channel.
992 *
993 * @rx_priority: UDMAP receive channel receive priority value to be programmed
994 * into the priority field of the channel's RCHAN_RPRI_CTRL register.
995 *
996 * @rx_qos: UDMAP receive channel receive qos value to be programmed into the
997 * qos field of the channel's RCHAN_RPRI_CTRL register.
998 *
999 * @rx_orderid: UDMAP receive channel bus order id value to be programmed into
1000 * the orderid field of the channel's RCHAN_RPRI_CTRL register.
1001 *
1002 * @rx_sched_priority: UDMAP receive channel rx scheduling priority
1003 * configuration to be programmed into the priority field of the channel's
1004 * RCHAN_RST_SCHED register.
1005 *
1006 * @flowid_start: UDMAP receive channel additional flows starting index
1007 * configuration to program into the flow_start field of the RCHAN_RFLOW_RNG
1008 * register. Specifies the starting index for flow IDs the receive channel is to
1009 * make use of beyond the default flow. flowid_start and @ref flowid_cnt must be
1010 * set as valid and configured together. The starting flow ID set by
1011 * @ref flowid_cnt must be a flow index within the Navigator Subsystem's subset
1012 * of flows beyond the default flows statically mapped to receive channels.
1013 * The additional flows must be assigned to the host, or a subordinate of the
1014 * host, requesting configuration of the receive channel.
1015 *
1016 * @flowid_cnt: UDMAP receive channel additional flows count configuration to
1017 * program into the flowid_cnt field of the RCHAN_RFLOW_RNG register.
1018 * This field specifies how many flow IDs are in the additional contiguous range
1019 * of legal flow IDs for the channel. @ref flowid_start and flowid_cnt must be
1020 * set as valid and configured together. Disabling the valid_params field bit
1021 * for flowid_cnt indicates no flow IDs other than the default are to be
1022 * allocated and used by the receive channel. @ref flowid_start plus flowid_cnt
1023 * cannot be greater than the number of receive flows in the receive channel's
1024 * Navigator Subsystem. The additional flows must be assigned to the host, or a
1025 * subordinate of the host, requesting configuration of the receive channel.
1026 *
1027 * @rx_pause_on_err: UDMAP receive channel pause on error configuration to be
1028 * programmed into the rx_pause_on_err field of the channel's RCHAN_RCFG
1029 * register.
1030 *
1031 * @rx_atype: UDMAP receive channel non Ring Accelerator access pointer
1032 * interpretation configuration to be programmed into the rx_atype field of the
1033 * channel's RCHAN_RCFG register.
1034 *
1035 * @rx_chan_type: UDMAP receive channel functional channel type and work passing
1036 * mechanism configuration to be programmed into the rx_chan_type field of the
1037 * channel's RCHAN_RCFG register.
1038 *
1039 * @rx_ignore_short: UDMAP receive channel short packet treatment configuration
1040 * to be programmed into the rx_ignore_short field of the RCHAN_RCFG register.
1041 *
1042 * @rx_ignore_long: UDMAP receive channel long packet treatment configuration to
1043 * be programmed into the rx_ignore_long field of the RCHAN_RCFG register.
1044 *
1045 * @rx_burst_size: UDMAP receive channel burst size configuration to be
1046 * programmed into the rx_burst_size field of the RCHAN_RCFG register.
1047 */
1048struct ti_sci_msg_rm_udmap_rx_ch_cfg_req {
1049 struct ti_sci_msg_hdr hdr;
1050 u32 valid_params;
1051 u16 nav_id;
1052 u16 index;
1053 u16 rx_fetch_size;
1054 u16 rxcq_qnum;
1055 u8 rx_priority;
1056 u8 rx_qos;
1057 u8 rx_orderid;
1058 u8 rx_sched_priority;
1059 u16 flowid_start;
1060 u16 flowid_cnt;
1061 u8 rx_pause_on_err;
1062 u8 rx_atype;
1063 u8 rx_chan_type;
1064 u8 rx_ignore_short;
1065 u8 rx_ignore_long;
1066 u8 rx_burst_size;
1067} __packed;
1068
1069/**
1070 * Configures a Navigator Subsystem UDMAP receive flow
1071 *
1072 * Configures a Navigator Subsystem UDMAP receive flow's registers.
1073 * Configuration does not include the flow registers which handle size-based
1074 * free descriptor queue routing.
1075 *
1076 * The flow index must be assigned to the host defined in the TISCI header via
1077 * the RM board configuration resource assignment range list.
1078 *
1079 * @hdr: Standard TISCI header
1080 *
1081 * @valid_params
1082 * Bitfield defining validity of rx flow configuration parameters. The
1083 * rx flow configuration fields are not valid, and will not be used for flow
1084 * configuration, if their corresponding valid bit is zero. Valid bit usage:
1085 * 0 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_einfo_present
1086 * 1 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_psinfo_present
1087 * 2 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_error_handling
1088 * 3 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_desc_type
1089 * 4 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_sop_offset
1090 * 5 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_qnum
1091 * 6 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi
1092 * 7 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo
1093 * 8 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi
1094 * 9 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo
1095 * 10 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi_sel
1096 * 11 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo_sel
1097 * 12 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi_sel
1098 * 13 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo_sel
1099 * 14 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq0_sz0_qnum
1100 * 15 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq1_sz0_qnum
1101 * 16 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq2_sz0_qnum
1102 * 17 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq3_sz0_qnum
1103 * 18 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_ps_location
1104 *
1105 * @nav_id: SoC device ID of Navigator Subsystem from which the receive flow is
1106 * allocated
1107 *
1108 * @flow_index: UDMAP receive flow index for non-optional configuration.
1109 *
1110 * @rx_einfo_present:
1111 * UDMAP receive flow extended packet info present configuration to be
1112 * programmed into the rx_einfo_present field of the flow's RFLOW_RFA register.
1113 *
1114 * @rx_psinfo_present:
1115 * UDMAP receive flow PS words present configuration to be programmed into the
1116 * rx_psinfo_present field of the flow's RFLOW_RFA register.
1117 *
1118 * @rx_error_handling:
1119 * UDMAP receive flow error handling configuration to be programmed into the
1120 * rx_error_handling field of the flow's RFLOW_RFA register.
1121 *
1122 * @rx_desc_type:
1123 * UDMAP receive flow descriptor type configuration to be programmed into the
1124 * rx_desc_type field field of the flow's RFLOW_RFA register.
1125 *
1126 * @rx_sop_offset:
1127 * UDMAP receive flow start of packet offset configuration to be programmed
1128 * into the rx_sop_offset field of the RFLOW_RFA register. See the UDMAP
1129 * section of the TRM for more information on this setting. Valid values for
1130 * this field are 0-255 bytes.
1131 *
1132 * @rx_dest_qnum:
1133 * UDMAP receive flow destination queue configuration to be programmed into the
1134 * rx_dest_qnum field of the flow's RFLOW_RFA register. The specified
1135 * destination queue must be valid within the Navigator Subsystem and must be
1136 * owned by the host, or a subordinate of the host, requesting allocation and
1137 * configuration of the receive flow.
1138 *
1139 * @rx_src_tag_hi:
1140 * UDMAP receive flow source tag high byte constant configuration to be
1141 * programmed into the rx_src_tag_hi field of the flow's RFLOW_RFB register.
1142 * See the UDMAP section of the TRM for more information on this setting.
1143 *
1144 * @rx_src_tag_lo:
1145 * UDMAP receive flow source tag low byte constant configuration to be
1146 * programmed into the rx_src_tag_lo field of the flow's RFLOW_RFB register.
1147 * See the UDMAP section of the TRM for more information on this setting.
1148 *
1149 * @rx_dest_tag_hi:
1150 * UDMAP receive flow destination tag high byte constant configuration to be
1151 * programmed into the rx_dest_tag_hi field of the flow's RFLOW_RFB register.
1152 * See the UDMAP section of the TRM for more information on this setting.
1153 *
1154 * @rx_dest_tag_lo:
1155 * UDMAP receive flow destination tag low byte constant configuration to be
1156 * programmed into the rx_dest_tag_lo field of the flow's RFLOW_RFB register.
1157 * See the UDMAP section of the TRM for more information on this setting.
1158 *
1159 * @rx_src_tag_hi_sel:
1160 * UDMAP receive flow source tag high byte selector configuration to be
1161 * programmed into the rx_src_tag_hi_sel field of the RFLOW_RFC register. See
1162 * the UDMAP section of the TRM for more information on this setting.
1163 *
1164 * @rx_src_tag_lo_sel:
1165 * UDMAP receive flow source tag low byte selector configuration to be
1166 * programmed into the rx_src_tag_lo_sel field of the RFLOW_RFC register. See
1167 * the UDMAP section of the TRM for more information on this setting.
1168 *
1169 * @rx_dest_tag_hi_sel:
1170 * UDMAP receive flow destination tag high byte selector configuration to be
1171 * programmed into the rx_dest_tag_hi_sel field of the RFLOW_RFC register. See
1172 * the UDMAP section of the TRM for more information on this setting.
1173 *
1174 * @rx_dest_tag_lo_sel:
1175 * UDMAP receive flow destination tag low byte selector configuration to be
1176 * programmed into the rx_dest_tag_lo_sel field of the RFLOW_RFC register. See
1177 * the UDMAP section of the TRM for more information on this setting.
1178 *
1179 * @rx_fdq0_sz0_qnum:
1180 * UDMAP receive flow free descriptor queue 0 configuration to be programmed
1181 * into the rx_fdq0_sz0_qnum field of the flow's RFLOW_RFD register. See the
1182 * UDMAP section of the TRM for more information on this setting. The specified
1183 * free queue must be valid within the Navigator Subsystem and must be owned
1184 * by the host, or a subordinate of the host, requesting allocation and
1185 * configuration of the receive flow.
1186 *
1187 * @rx_fdq1_qnum:
1188 * UDMAP receive flow free descriptor queue 1 configuration to be programmed
1189 * into the rx_fdq1_qnum field of the flow's RFLOW_RFD register. See the
1190 * UDMAP section of the TRM for more information on this setting. The specified
1191 * free queue must be valid within the Navigator Subsystem and must be owned
1192 * by the host, or a subordinate of the host, requesting allocation and
1193 * configuration of the receive flow.
1194 *
1195 * @rx_fdq2_qnum:
1196 * UDMAP receive flow free descriptor queue 2 configuration to be programmed
1197 * into the rx_fdq2_qnum field of the flow's RFLOW_RFE register. See the
1198 * UDMAP section of the TRM for more information on this setting. The specified
1199 * free queue must be valid within the Navigator Subsystem and must be owned
1200 * by the host, or a subordinate of the host, requesting allocation and
1201 * configuration of the receive flow.
1202 *
1203 * @rx_fdq3_qnum:
1204 * UDMAP receive flow free descriptor queue 3 configuration to be programmed
1205 * into the rx_fdq3_qnum field of the flow's RFLOW_RFE register. See the
1206 * UDMAP section of the TRM for more information on this setting. The specified
1207 * free queue must be valid within the Navigator Subsystem and must be owned
1208 * by the host, or a subordinate of the host, requesting allocation and
1209 * configuration of the receive flow.
1210 *
1211 * @rx_ps_location:
1212 * UDMAP receive flow PS words location configuration to be programmed into the
1213 * rx_ps_location field of the flow's RFLOW_RFA register.
1214 */
1215struct ti_sci_msg_rm_udmap_flow_cfg_req {
1216 struct ti_sci_msg_hdr hdr;
1217 u32 valid_params;
1218 u16 nav_id;
1219 u16 flow_index;
1220 u8 rx_einfo_present;
1221 u8 rx_psinfo_present;
1222 u8 rx_error_handling;
1223 u8 rx_desc_type;
1224 u16 rx_sop_offset;
1225 u16 rx_dest_qnum;
1226 u8 rx_src_tag_hi;
1227 u8 rx_src_tag_lo;
1228 u8 rx_dest_tag_hi;
1229 u8 rx_dest_tag_lo;
1230 u8 rx_src_tag_hi_sel;
1231 u8 rx_src_tag_lo_sel;
1232 u8 rx_dest_tag_hi_sel;
1233 u8 rx_dest_tag_lo_sel;
1234 u16 rx_fdq0_sz0_qnum;
1235 u16 rx_fdq1_qnum;
1236 u16 rx_fdq2_qnum;
1237 u16 rx_fdq3_qnum;
1238 u8 rx_ps_location;
1239} __packed;
1240
566#endif /* __TI_SCI_H */ 1241#endif /* __TI_SCI_H */
diff --git a/include/linux/soc/ti/ti_sci_protocol.h b/include/linux/soc/ti/ti_sci_protocol.h
index 568722a041bf..4fd9bff5806b 100644
--- a/include/linux/soc/ti/ti_sci_protocol.h
+++ b/include/linux/soc/ti/ti_sci_protocol.h
@@ -241,6 +241,218 @@ struct ti_sci_rm_irq_ops {
241 u16 global_event, u8 vint_status_bit); 241 u16 global_event, u8 vint_status_bit);
242}; 242};
243 243
244/* RA config.addr_lo parameter is valid for RM ring configure TI_SCI message */
245#define TI_SCI_MSG_VALUE_RM_RING_ADDR_LO_VALID BIT(0)
246/* RA config.addr_hi parameter is valid for RM ring configure TI_SCI message */
247#define TI_SCI_MSG_VALUE_RM_RING_ADDR_HI_VALID BIT(1)
248 /* RA config.count parameter is valid for RM ring configure TI_SCI message */
249#define TI_SCI_MSG_VALUE_RM_RING_COUNT_VALID BIT(2)
250/* RA config.mode parameter is valid for RM ring configure TI_SCI message */
251#define TI_SCI_MSG_VALUE_RM_RING_MODE_VALID BIT(3)
252/* RA config.size parameter is valid for RM ring configure TI_SCI message */
253#define TI_SCI_MSG_VALUE_RM_RING_SIZE_VALID BIT(4)
254/* RA config.order_id parameter is valid for RM ring configure TISCI message */
255#define TI_SCI_MSG_VALUE_RM_RING_ORDER_ID_VALID BIT(5)
256
257#define TI_SCI_MSG_VALUE_RM_ALL_NO_ORDER \
258 (TI_SCI_MSG_VALUE_RM_RING_ADDR_LO_VALID | \
259 TI_SCI_MSG_VALUE_RM_RING_ADDR_HI_VALID | \
260 TI_SCI_MSG_VALUE_RM_RING_COUNT_VALID | \
261 TI_SCI_MSG_VALUE_RM_RING_MODE_VALID | \
262 TI_SCI_MSG_VALUE_RM_RING_SIZE_VALID)
263
264/**
265 * struct ti_sci_rm_ringacc_ops - Ring Accelerator Management operations
266 * @config: configure the SoC Navigator Subsystem Ring Accelerator ring
267 * @get_config: get the SoC Navigator Subsystem Ring Accelerator ring
268 * configuration
269 */
270struct ti_sci_rm_ringacc_ops {
271 int (*config)(const struct ti_sci_handle *handle,
272 u32 valid_params, u16 nav_id, u16 index,
273 u32 addr_lo, u32 addr_hi, u32 count, u8 mode,
274 u8 size, u8 order_id
275 );
276 int (*get_config)(const struct ti_sci_handle *handle,
277 u32 nav_id, u32 index, u8 *mode,
278 u32 *addr_lo, u32 *addr_hi, u32 *count,
279 u8 *size, u8 *order_id);
280};
281
282/**
283 * struct ti_sci_rm_psil_ops - PSI-L thread operations
284 * @pair: pair PSI-L source thread to a destination thread.
285 * If the src_thread is mapped to UDMA tchan, the corresponding channel's
286 * TCHAN_THRD_ID register is updated.
287 * If the dst_thread is mapped to UDMA rchan, the corresponding channel's
288 * RCHAN_THRD_ID register is updated.
289 * @unpair: unpair PSI-L source thread from a destination thread.
290 * If the src_thread is mapped to UDMA tchan, the corresponding channel's
291 * TCHAN_THRD_ID register is cleared.
292 * If the dst_thread is mapped to UDMA rchan, the corresponding channel's
293 * RCHAN_THRD_ID register is cleared.
294 */
295struct ti_sci_rm_psil_ops {
296 int (*pair)(const struct ti_sci_handle *handle, u32 nav_id,
297 u32 src_thread, u32 dst_thread);
298 int (*unpair)(const struct ti_sci_handle *handle, u32 nav_id,
299 u32 src_thread, u32 dst_thread);
300};
301
302/* UDMAP channel types */
303#define TI_SCI_RM_UDMAP_CHAN_TYPE_PKT_PBRR 2
304#define TI_SCI_RM_UDMAP_CHAN_TYPE_PKT_PBRR_SB 3 /* RX only */
305#define TI_SCI_RM_UDMAP_CHAN_TYPE_3RDP_PBRR 10
306#define TI_SCI_RM_UDMAP_CHAN_TYPE_3RDP_PBVR 11
307#define TI_SCI_RM_UDMAP_CHAN_TYPE_3RDP_BCOPY_PBRR 12
308#define TI_SCI_RM_UDMAP_CHAN_TYPE_3RDP_BCOPY_PBVR 13
309
310#define TI_SCI_RM_UDMAP_RX_FLOW_DESC_HOST 0
311#define TI_SCI_RM_UDMAP_RX_FLOW_DESC_MONO 2
312
313#define TI_SCI_RM_UDMAP_CHAN_BURST_SIZE_64_BYTES 1
314#define TI_SCI_RM_UDMAP_CHAN_BURST_SIZE_128_BYTES 2
315#define TI_SCI_RM_UDMAP_CHAN_BURST_SIZE_256_BYTES 3
316
317/* UDMAP TX/RX channel valid_params common declarations */
318#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_PAUSE_ON_ERR_VALID BIT(0)
319#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_ATYPE_VALID BIT(1)
320#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_CHAN_TYPE_VALID BIT(2)
321#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_FETCH_SIZE_VALID BIT(3)
322#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_CQ_QNUM_VALID BIT(4)
323#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_PRIORITY_VALID BIT(5)
324#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_QOS_VALID BIT(6)
325#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_ORDER_ID_VALID BIT(7)
326#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_SCHED_PRIORITY_VALID BIT(8)
327#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_BURST_SIZE_VALID BIT(14)
328
329/**
330 * Configures a Navigator Subsystem UDMAP transmit channel
331 *
332 * Configures a Navigator Subsystem UDMAP transmit channel registers.
333 * See @ti_sci_msg_rm_udmap_tx_ch_cfg_req
334 */
335struct ti_sci_msg_rm_udmap_tx_ch_cfg {
336 u32 valid_params;
337#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_FILT_EINFO_VALID BIT(9)
338#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_FILT_PSWORDS_VALID BIT(10)
339#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_SUPR_TDPKT_VALID BIT(11)
340#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_CREDIT_COUNT_VALID BIT(12)
341#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_FDEPTH_VALID BIT(13)
342 u16 nav_id;
343 u16 index;
344 u8 tx_pause_on_err;
345 u8 tx_filt_einfo;
346 u8 tx_filt_pswords;
347 u8 tx_atype;
348 u8 tx_chan_type;
349 u8 tx_supr_tdpkt;
350 u16 tx_fetch_size;
351 u8 tx_credit_count;
352 u16 txcq_qnum;
353 u8 tx_priority;
354 u8 tx_qos;
355 u8 tx_orderid;
356 u16 fdepth;
357 u8 tx_sched_priority;
358 u8 tx_burst_size;
359};
360
361/**
362 * Configures a Navigator Subsystem UDMAP receive channel
363 *
364 * Configures a Navigator Subsystem UDMAP receive channel registers.
365 * See @ti_sci_msg_rm_udmap_rx_ch_cfg_req
366 */
367struct ti_sci_msg_rm_udmap_rx_ch_cfg {
368 u32 valid_params;
369#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_RX_FLOWID_START_VALID BIT(9)
370#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_RX_FLOWID_CNT_VALID BIT(10)
371#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_RX_IGNORE_SHORT_VALID BIT(11)
372#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_RX_IGNORE_LONG_VALID BIT(12)
373 u16 nav_id;
374 u16 index;
375 u16 rx_fetch_size;
376 u16 rxcq_qnum;
377 u8 rx_priority;
378 u8 rx_qos;
379 u8 rx_orderid;
380 u8 rx_sched_priority;
381 u16 flowid_start;
382 u16 flowid_cnt;
383 u8 rx_pause_on_err;
384 u8 rx_atype;
385 u8 rx_chan_type;
386 u8 rx_ignore_short;
387 u8 rx_ignore_long;
388 u8 rx_burst_size;
389};
390
391/**
392 * Configures a Navigator Subsystem UDMAP receive flow
393 *
394 * Configures a Navigator Subsystem UDMAP receive flow's registers.
395 * See @tis_ci_msg_rm_udmap_flow_cfg_req
396 */
397struct ti_sci_msg_rm_udmap_flow_cfg {
398 u32 valid_params;
399#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_EINFO_PRESENT_VALID BIT(0)
400#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_PSINFO_PRESENT_VALID BIT(1)
401#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_ERROR_HANDLING_VALID BIT(2)
402#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DESC_TYPE_VALID BIT(3)
403#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SOP_OFFSET_VALID BIT(4)
404#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_QNUM_VALID BIT(5)
405#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SRC_TAG_HI_VALID BIT(6)
406#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SRC_TAG_LO_VALID BIT(7)
407#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_TAG_HI_VALID BIT(8)
408#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_TAG_LO_VALID BIT(9)
409#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SRC_TAG_HI_SEL_VALID BIT(10)
410#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SRC_TAG_LO_SEL_VALID BIT(11)
411#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_TAG_HI_SEL_VALID BIT(12)
412#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_TAG_LO_SEL_VALID BIT(13)
413#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ0_SZ0_QNUM_VALID BIT(14)
414#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ1_QNUM_VALID BIT(15)
415#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ2_QNUM_VALID BIT(16)
416#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ3_QNUM_VALID BIT(17)
417#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_PS_LOCATION_VALID BIT(18)
418 u16 nav_id;
419 u16 flow_index;
420 u8 rx_einfo_present;
421 u8 rx_psinfo_present;
422 u8 rx_error_handling;
423 u8 rx_desc_type;
424 u16 rx_sop_offset;
425 u16 rx_dest_qnum;
426 u8 rx_src_tag_hi;
427 u8 rx_src_tag_lo;
428 u8 rx_dest_tag_hi;
429 u8 rx_dest_tag_lo;
430 u8 rx_src_tag_hi_sel;
431 u8 rx_src_tag_lo_sel;
432 u8 rx_dest_tag_hi_sel;
433 u8 rx_dest_tag_lo_sel;
434 u16 rx_fdq0_sz0_qnum;
435 u16 rx_fdq1_qnum;
436 u16 rx_fdq2_qnum;
437 u16 rx_fdq3_qnum;
438 u8 rx_ps_location;
439};
440
441/**
442 * struct ti_sci_rm_udmap_ops - UDMA Management operations
443 * @tx_ch_cfg: configure SoC Navigator Subsystem UDMA transmit channel.
444 * @rx_ch_cfg: configure SoC Navigator Subsystem UDMA receive channel.
445 * @rx_flow_cfg1: configure SoC Navigator Subsystem UDMA receive flow.
446 */
447struct ti_sci_rm_udmap_ops {
448 int (*tx_ch_cfg)(const struct ti_sci_handle *handle,
449 const struct ti_sci_msg_rm_udmap_tx_ch_cfg *params);
450 int (*rx_ch_cfg)(const struct ti_sci_handle *handle,
451 const struct ti_sci_msg_rm_udmap_rx_ch_cfg *params);
452 int (*rx_flow_cfg)(const struct ti_sci_handle *handle,
453 const struct ti_sci_msg_rm_udmap_flow_cfg *params);
454};
455
244/** 456/**
245 * struct ti_sci_ops - Function support for TI SCI 457 * struct ti_sci_ops - Function support for TI SCI
246 * @dev_ops: Device specific operations 458 * @dev_ops: Device specific operations
@@ -254,6 +466,9 @@ struct ti_sci_ops {
254 struct ti_sci_clk_ops clk_ops; 466 struct ti_sci_clk_ops clk_ops;
255 struct ti_sci_rm_core_ops rm_core_ops; 467 struct ti_sci_rm_core_ops rm_core_ops;
256 struct ti_sci_rm_irq_ops rm_irq_ops; 468 struct ti_sci_rm_irq_ops rm_irq_ops;
469 struct ti_sci_rm_ringacc_ops rm_ring_ops;
470 struct ti_sci_rm_psil_ops rm_psil_ops;
471 struct ti_sci_rm_udmap_ops rm_udmap_ops;
257}; 472};
258 473
259/** 474/**