Lines Matching +full:sci +full:- +full:dev +full:- +full:id

1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2015-2024 Texas Instruments Incorporated - https://www.ti.com/
27 #include <linux/soc/ti/ti-msgmgr.h>
35 /* List of all TI SCI devices active in system */
41 * struct ti_sci_xfer - Structure representing a message flow
45 * Since we work with request-ACK protocol, we can
58 * struct ti_sci_xfers_info - Structure to manage transfer information
76 * struct ti_sci_desc - Description of SoC integration
91 * struct ti_sci_info - Structure representing a TI SCI instance
92 * @dev: Device pointer
98 * @handle: Instance of TI SCI handle to send to clients.
104 * @host_id: Host ID
109 struct device *dev; member
133 * ti_sci_debug_show() - Helper to dump the debug log
141 struct ti_sci_info *info = s->private; in ti_sci_debug_show()
143 memcpy_fromio(info->debug_buffer, info->debug_region, in ti_sci_debug_show()
144 info->debug_region_size); in ti_sci_debug_show()
149 * in the buffer as is - we expect the messages to be self explanatory. in ti_sci_debug_show()
151 seq_puts(s, info->debug_buffer); in ti_sci_debug_show()
159 * ti_sci_debugfs_create() - Create log debug file
161 * @info: Pointer to SCI entity information
168 struct device *dev = &pdev->dev; in ti_sci_debugfs_create() local
175 info->debug_region = devm_ioremap_resource(dev, res); in ti_sci_debugfs_create()
176 if (IS_ERR(info->debug_region)) in ti_sci_debugfs_create()
178 info->debug_region_size = resource_size(res); in ti_sci_debugfs_create()
180 info->debug_buffer = devm_kcalloc(dev, info->debug_region_size + 1, in ti_sci_debugfs_create()
182 if (!info->debug_buffer) in ti_sci_debugfs_create()
183 return -ENOMEM; in ti_sci_debugfs_create()
185 info->debug_buffer[info->debug_region_size] = 0; in ti_sci_debugfs_create()
188 dev_name(dev)); in ti_sci_debugfs_create()
189 info->d = debugfs_create_file(debug_name, 0444, NULL, info, in ti_sci_debugfs_create()
191 if (IS_ERR(info->d)) in ti_sci_debugfs_create()
192 return PTR_ERR(info->d); in ti_sci_debugfs_create()
194 dev_dbg(dev, "Debug region => %p, size = %zu bytes, resource: %pr\n", in ti_sci_debugfs_create()
195 info->debug_region, info->debug_region_size, res); in ti_sci_debugfs_create()
200 static inline int ti_sci_debugfs_create(struct platform_device *dev, in ti_sci_debugfs_create() argument
206 static inline void ti_sci_debugfs_destroy(struct platform_device *dev, in ti_sci_debugfs_destroy() argument
213 * ti_sci_dump_header_dbg() - Helper to dump a message header.
214 * @dev: Device pointer corresponding to the SCI entity
217 static inline void ti_sci_dump_header_dbg(struct device *dev, in ti_sci_dump_header_dbg() argument
220 dev_dbg(dev, "MSGHDR:type=0x%04x host=0x%02x seq=0x%02x flags=0x%08x\n", in ti_sci_dump_header_dbg()
221 hdr->type, hdr->host, hdr->seq, hdr->flags); in ti_sci_dump_header_dbg()
225 * ti_sci_rx_callback() - mailbox client callback for receive messages
238 struct device *dev = info->dev; in ti_sci_rx_callback() local
239 struct ti_sci_xfers_info *minfo = &info->minfo; in ti_sci_rx_callback()
241 struct ti_sci_msg_hdr *hdr = (struct ti_sci_msg_hdr *)mbox_msg->buf; in ti_sci_rx_callback()
245 xfer_id = hdr->seq; in ti_sci_rx_callback()
251 if (!test_bit(xfer_id, minfo->xfer_alloc_table)) { in ti_sci_rx_callback()
252 dev_err(dev, "Message for %d is not expected!\n", xfer_id); in ti_sci_rx_callback()
256 xfer = &minfo->xfer_block[xfer_id]; in ti_sci_rx_callback()
259 if (mbox_msg->len > info->desc->max_msg_size) { in ti_sci_rx_callback()
260 dev_err(dev, "Unable to handle %zu xfer(max %d)\n", in ti_sci_rx_callback()
261 mbox_msg->len, info->desc->max_msg_size); in ti_sci_rx_callback()
262 ti_sci_dump_header_dbg(dev, hdr); in ti_sci_rx_callback()
265 if (mbox_msg->len < xfer->rx_len) { in ti_sci_rx_callback()
266 dev_err(dev, "Recv xfer %zu < expected %d length\n", in ti_sci_rx_callback()
267 mbox_msg->len, xfer->rx_len); in ti_sci_rx_callback()
268 ti_sci_dump_header_dbg(dev, hdr); in ti_sci_rx_callback()
272 ti_sci_dump_header_dbg(dev, hdr); in ti_sci_rx_callback()
274 memcpy(xfer->xfer_buf, mbox_msg->buf, xfer->rx_len); in ti_sci_rx_callback()
275 complete(&xfer->done); in ti_sci_rx_callback()
279 * ti_sci_get_one_xfer() - Allocate one message
280 * @info: Pointer to SCI entity information
290 * for the SCI entity. Further, this also holds a spinlock to maintain integrity
300 struct ti_sci_xfers_info *minfo = &info->minfo; in ti_sci_get_one_xfer()
310 if (rx_message_size > info->desc->max_msg_size || in ti_sci_get_one_xfer()
311 tx_message_size > info->desc->max_msg_size || in ti_sci_get_one_xfer()
313 return ERR_PTR(-ERANGE); in ti_sci_get_one_xfer()
320 timeout = msecs_to_jiffies(info->desc->max_rx_timeout_ms) * 5; in ti_sci_get_one_xfer()
321 ret = down_timeout(&minfo->sem_xfer_count, timeout); in ti_sci_get_one_xfer()
326 spin_lock_irqsave(&minfo->xfer_lock, flags); in ti_sci_get_one_xfer()
327 bit_pos = find_first_zero_bit(minfo->xfer_alloc_table, in ti_sci_get_one_xfer()
328 info->desc->max_msgs); in ti_sci_get_one_xfer()
329 set_bit(bit_pos, minfo->xfer_alloc_table); in ti_sci_get_one_xfer()
330 spin_unlock_irqrestore(&minfo->xfer_lock, flags); in ti_sci_get_one_xfer()
334 * fit in hdr.seq - NOTE: this improves access latencies in ti_sci_get_one_xfer()
341 xfer = &minfo->xfer_block[xfer_id]; in ti_sci_get_one_xfer()
343 hdr = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_get_one_xfer()
344 xfer->tx_message.len = tx_message_size; in ti_sci_get_one_xfer()
345 xfer->tx_message.chan_rx = info->chan_rx; in ti_sci_get_one_xfer()
346 xfer->tx_message.timeout_rx_ms = info->desc->max_rx_timeout_ms; in ti_sci_get_one_xfer()
347 xfer->rx_len = (u8)rx_message_size; in ti_sci_get_one_xfer()
349 reinit_completion(&xfer->done); in ti_sci_get_one_xfer()
351 hdr->seq = xfer_id; in ti_sci_get_one_xfer()
352 hdr->type = msg_type; in ti_sci_get_one_xfer()
353 hdr->host = info->host_id; in ti_sci_get_one_xfer()
354 hdr->flags = msg_flags; in ti_sci_get_one_xfer()
360 * ti_sci_put_one_xfer() - Release a message
373 hdr = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_put_one_xfer()
374 xfer_id = hdr->seq; in ti_sci_put_one_xfer()
381 spin_lock_irqsave(&minfo->xfer_lock, flags); in ti_sci_put_one_xfer()
382 clear_bit(xfer_id, minfo->xfer_alloc_table); in ti_sci_put_one_xfer()
383 spin_unlock_irqrestore(&minfo->xfer_lock, flags); in ti_sci_put_one_xfer()
386 up(&minfo->sem_xfer_count); in ti_sci_put_one_xfer()
390 * ti_sci_do_xfer() - Do one transfer
391 * @info: Pointer to SCI entity information
394 * Return: -ETIMEDOUT in case of no response, if transmit error,
403 struct device *dev = info->dev; in ti_sci_do_xfer() local
406 ret = mbox_send_message(info->chan_tx, &xfer->tx_message); in ti_sci_do_xfer()
414 timeout = msecs_to_jiffies(info->desc->max_rx_timeout_ms); in ti_sci_do_xfer()
415 if (!wait_for_completion_timeout(&xfer->done, timeout)) in ti_sci_do_xfer()
416 ret = -ETIMEDOUT; in ti_sci_do_xfer()
424 info->desc->max_rx_timeout_ms * 1000, in ti_sci_do_xfer()
425 false, &xfer->done); in ti_sci_do_xfer()
428 if (ret == -ETIMEDOUT) in ti_sci_do_xfer()
429 dev_err(dev, "Mbox timedout in resp(caller: %pS)\n", in ti_sci_do_xfer()
438 mbox_client_txdone(info->chan_tx, ret); in ti_sci_do_xfer()
444 * ti_sci_cmd_get_revision() - command to get the revision of the SCI entity
445 * @info: Pointer to SCI entity information
447 * Updates the SCI information in the internal data structure.
453 struct device *dev = info->dev; in ti_sci_cmd_get_revision() local
454 struct ti_sci_handle *handle = &info->handle; in ti_sci_cmd_get_revision()
455 struct ti_sci_version_info *ver = &handle->version; in ti_sci_cmd_get_revision()
466 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_get_revision()
470 rev_info = (struct ti_sci_msg_resp_version *)xfer->xfer_buf; in ti_sci_cmd_get_revision()
474 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_get_revision()
478 ver->abi_major = rev_info->abi_major; in ti_sci_cmd_get_revision()
479 ver->abi_minor = rev_info->abi_minor; in ti_sci_cmd_get_revision()
480 ver->firmware_revision = rev_info->firmware_revision; in ti_sci_cmd_get_revision()
481 strscpy(ver->firmware_description, rev_info->firmware_description, in ti_sci_cmd_get_revision()
482 sizeof(ver->firmware_description)); in ti_sci_cmd_get_revision()
485 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_get_revision()
490 * ti_sci_is_response_ack() - Generic ACK/NACK message checkup
499 return hdr->flags & TI_SCI_FLAG_RESP_GENERIC_ACK ? true : false; in ti_sci_is_response_ack()
503 * ti_sci_set_device_state() - Set device state helper
504 * @handle: pointer to TI SCI handle
505 * @id: Device identifier
512 u32 id, u32 flags, u8 state) in ti_sci_set_device_state() argument
518 struct device *dev; in ti_sci_set_device_state() local
524 return -EINVAL; in ti_sci_set_device_state()
527 dev = info->dev; in ti_sci_set_device_state()
534 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_set_device_state()
537 req = (struct ti_sci_msg_req_set_device_state *)xfer->xfer_buf; in ti_sci_set_device_state()
538 req->id = id; in ti_sci_set_device_state()
539 req->state = state; in ti_sci_set_device_state()
543 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_set_device_state()
547 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_set_device_state()
549 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_set_device_state()
552 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_set_device_state()
558 * ti_sci_get_device_state() - Get device state helper
560 * @id: Device Identifier
569 u32 id, u32 *clcnt, u32 *resets, in ti_sci_get_device_state() argument
576 struct device *dev; in ti_sci_get_device_state() local
582 return -EINVAL; in ti_sci_get_device_state()
585 return -EINVAL; in ti_sci_get_device_state()
588 dev = info->dev; in ti_sci_get_device_state()
595 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_get_device_state()
598 req = (struct ti_sci_msg_req_get_device_state *)xfer->xfer_buf; in ti_sci_get_device_state()
599 req->id = id; in ti_sci_get_device_state()
603 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_get_device_state()
607 resp = (struct ti_sci_msg_resp_get_device_state *)xfer->xfer_buf; in ti_sci_get_device_state()
609 ret = -ENODEV; in ti_sci_get_device_state()
614 *clcnt = resp->context_loss_count; in ti_sci_get_device_state()
616 *resets = resp->resets; in ti_sci_get_device_state()
618 *p_state = resp->programmed_state; in ti_sci_get_device_state()
620 *c_state = resp->current_state; in ti_sci_get_device_state()
622 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_get_device_state()
628 * ti_sci_cmd_get_device() - command to request for device managed by TISCI
631 * @id: Device Identifier
633 * Request for the device - NOTE: the client MUST maintain integrity of
639 static int ti_sci_cmd_get_device(const struct ti_sci_handle *handle, u32 id) in ti_sci_cmd_get_device() argument
641 return ti_sci_set_device_state(handle, id, 0, in ti_sci_cmd_get_device()
646 * ti_sci_cmd_get_device_exclusive() - command to request for device managed by
650 * @id: Device Identifier
652 * Request for the device - NOTE: the client MUST maintain integrity of
659 u32 id) in ti_sci_cmd_get_device_exclusive() argument
661 return ti_sci_set_device_state(handle, id, in ti_sci_cmd_get_device_exclusive()
667 * ti_sci_cmd_idle_device() - Command to idle a device managed by TISCI
669 * @id: Device Identifier
671 * Request for the device - NOTE: the client MUST maintain integrity of
677 static int ti_sci_cmd_idle_device(const struct ti_sci_handle *handle, u32 id) in ti_sci_cmd_idle_device() argument
679 return ti_sci_set_device_state(handle, id, 0, in ti_sci_cmd_idle_device()
684 * ti_sci_cmd_idle_device_exclusive() - Command to idle a device managed by
688 * @id: Device Identifier
690 * Request for the device - NOTE: the client MUST maintain integrity of
697 u32 id) in ti_sci_cmd_idle_device_exclusive() argument
699 return ti_sci_set_device_state(handle, id, in ti_sci_cmd_idle_device_exclusive()
705 * ti_sci_cmd_put_device() - command to release a device managed by TISCI
707 * @id: Device Identifier
709 * Request for the device - NOTE: the client MUST maintain integrity of
715 static int ti_sci_cmd_put_device(const struct ti_sci_handle *handle, u32 id) in ti_sci_cmd_put_device() argument
717 return ti_sci_set_device_state(handle, id, in ti_sci_cmd_put_device()
722 * ti_sci_cmd_dev_is_valid() - Is the device valid
724 * @id: Device Identifier
726 * Return: 0 if all went fine and the device ID is valid, else return
729 static int ti_sci_cmd_dev_is_valid(const struct ti_sci_handle *handle, u32 id) in ti_sci_cmd_dev_is_valid() argument
733 /* check the device state which will also tell us if the ID is valid */ in ti_sci_cmd_dev_is_valid()
734 return ti_sci_get_device_state(handle, id, NULL, NULL, NULL, &unused); in ti_sci_cmd_dev_is_valid()
738 * ti_sci_cmd_dev_get_clcnt() - Get context loss counter
740 * @id: Device Identifier
745 static int ti_sci_cmd_dev_get_clcnt(const struct ti_sci_handle *handle, u32 id, in ti_sci_cmd_dev_get_clcnt() argument
748 return ti_sci_get_device_state(handle, id, count, NULL, NULL, NULL); in ti_sci_cmd_dev_get_clcnt()
752 * ti_sci_cmd_dev_is_idle() - Check if the device is requested to be idle
754 * @id: Device Identifier
759 static int ti_sci_cmd_dev_is_idle(const struct ti_sci_handle *handle, u32 id, in ti_sci_cmd_dev_is_idle() argument
766 return -EINVAL; in ti_sci_cmd_dev_is_idle()
768 ret = ti_sci_get_device_state(handle, id, NULL, NULL, &state, NULL); in ti_sci_cmd_dev_is_idle()
778 * ti_sci_cmd_dev_is_stop() - Check if the device is requested to be stopped
780 * @id: Device Identifier
786 static int ti_sci_cmd_dev_is_stop(const struct ti_sci_handle *handle, u32 id, in ti_sci_cmd_dev_is_stop() argument
793 return -EINVAL; in ti_sci_cmd_dev_is_stop()
796 ti_sci_get_device_state(handle, id, NULL, NULL, &p_state, &c_state); in ti_sci_cmd_dev_is_stop()
809 * ti_sci_cmd_dev_is_on() - Check if the device is requested to be ON
811 * @id: Device Identifier
817 static int ti_sci_cmd_dev_is_on(const struct ti_sci_handle *handle, u32 id, in ti_sci_cmd_dev_is_on() argument
824 return -EINVAL; in ti_sci_cmd_dev_is_on()
827 ti_sci_get_device_state(handle, id, NULL, NULL, &p_state, &c_state); in ti_sci_cmd_dev_is_on()
840 * ti_sci_cmd_dev_is_trans() - Check if the device is currently transitioning
842 * @id: Device Identifier
847 static int ti_sci_cmd_dev_is_trans(const struct ti_sci_handle *handle, u32 id, in ti_sci_cmd_dev_is_trans() argument
854 return -EINVAL; in ti_sci_cmd_dev_is_trans()
856 ret = ti_sci_get_device_state(handle, id, NULL, NULL, NULL, &state); in ti_sci_cmd_dev_is_trans()
866 * ti_sci_cmd_set_device_resets() - command to set resets for device managed
869 * @id: Device Identifier
875 u32 id, u32 reset_state) in ti_sci_cmd_set_device_resets() argument
881 struct device *dev; in ti_sci_cmd_set_device_resets() local
887 return -EINVAL; in ti_sci_cmd_set_device_resets()
890 dev = info->dev; in ti_sci_cmd_set_device_resets()
897 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_set_device_resets()
900 req = (struct ti_sci_msg_req_set_device_resets *)xfer->xfer_buf; in ti_sci_cmd_set_device_resets()
901 req->id = id; in ti_sci_cmd_set_device_resets()
902 req->resets = reset_state; in ti_sci_cmd_set_device_resets()
906 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_set_device_resets()
910 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_set_device_resets()
912 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_cmd_set_device_resets()
915 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_set_device_resets()
921 * ti_sci_cmd_get_device_resets() - Get reset state for device managed
924 * @id: Device Identifier
930 u32 id, u32 *reset_state) in ti_sci_cmd_get_device_resets() argument
932 return ti_sci_get_device_state(handle, id, NULL, reset_state, NULL, in ti_sci_cmd_get_device_resets()
937 * ti_sci_set_clock_state() - Set clock state helper
938 * @handle: pointer to TI SCI handle
956 struct device *dev; in ti_sci_set_clock_state() local
962 return -EINVAL; in ti_sci_set_clock_state()
965 dev = info->dev; in ti_sci_set_clock_state()
972 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_set_clock_state()
975 req = (struct ti_sci_msg_req_set_clock_state *)xfer->xfer_buf; in ti_sci_set_clock_state()
976 req->dev_id = dev_id; in ti_sci_set_clock_state()
978 req->clk_id = clk_id; in ti_sci_set_clock_state()
980 req->clk_id = 255; in ti_sci_set_clock_state()
981 req->clk_id_32 = clk_id; in ti_sci_set_clock_state()
983 req->request_state = state; in ti_sci_set_clock_state()
987 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_set_clock_state()
991 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_set_clock_state()
993 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_set_clock_state()
996 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_set_clock_state()
1002 * ti_sci_cmd_get_clock_state() - Get clock state helper
1003 * @handle: pointer to TI SCI handle
1021 struct device *dev; in ti_sci_cmd_get_clock_state() local
1027 return -EINVAL; in ti_sci_cmd_get_clock_state()
1030 return -EINVAL; in ti_sci_cmd_get_clock_state()
1033 dev = info->dev; in ti_sci_cmd_get_clock_state()
1040 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_get_clock_state()
1043 req = (struct ti_sci_msg_req_get_clock_state *)xfer->xfer_buf; in ti_sci_cmd_get_clock_state()
1044 req->dev_id = dev_id; in ti_sci_cmd_get_clock_state()
1046 req->clk_id = clk_id; in ti_sci_cmd_get_clock_state()
1048 req->clk_id = 255; in ti_sci_cmd_get_clock_state()
1049 req->clk_id_32 = clk_id; in ti_sci_cmd_get_clock_state()
1054 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_get_clock_state()
1058 resp = (struct ti_sci_msg_resp_get_clock_state *)xfer->xfer_buf; in ti_sci_cmd_get_clock_state()
1061 ret = -ENODEV; in ti_sci_cmd_get_clock_state()
1066 *programmed_state = resp->programmed_state; in ti_sci_cmd_get_clock_state()
1068 *current_state = resp->current_state; in ti_sci_cmd_get_clock_state()
1071 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_get_clock_state()
1077 * ti_sci_cmd_get_clock() - Get control of a clock from TI SCI
1078 * @handle: pointer to TI SCI handle
1104 * ti_sci_cmd_idle_clock() - Idle a clock which is in our control
1105 * @handle: pointer to TI SCI handle
1124 * ti_sci_cmd_put_clock() - Release a clock from our control back to TISCI
1125 * @handle: pointer to TI SCI handle
1144 * ti_sci_cmd_clk_is_auto() - Is the clock being auto managed
1145 * @handle: pointer to TI SCI handle
1161 return -EINVAL; in ti_sci_cmd_clk_is_auto()
1172 * ti_sci_cmd_clk_is_on() - Is the clock ON
1173 * @handle: pointer to TI SCI handle
1190 return -EINVAL; in ti_sci_cmd_clk_is_on()
1205 * ti_sci_cmd_clk_is_off() - Is the clock OFF
1206 * @handle: pointer to TI SCI handle
1223 return -EINVAL; in ti_sci_cmd_clk_is_off()
1238 * ti_sci_cmd_clk_set_parent() - Set the clock source of a specific device clock
1239 * @handle: pointer to TI SCI handle
1255 struct device *dev; in ti_sci_cmd_clk_set_parent() local
1261 return -EINVAL; in ti_sci_cmd_clk_set_parent()
1264 dev = info->dev; in ti_sci_cmd_clk_set_parent()
1271 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_clk_set_parent()
1274 req = (struct ti_sci_msg_req_set_clock_parent *)xfer->xfer_buf; in ti_sci_cmd_clk_set_parent()
1275 req->dev_id = dev_id; in ti_sci_cmd_clk_set_parent()
1277 req->clk_id = clk_id; in ti_sci_cmd_clk_set_parent()
1279 req->clk_id = 255; in ti_sci_cmd_clk_set_parent()
1280 req->clk_id_32 = clk_id; in ti_sci_cmd_clk_set_parent()
1283 req->parent_id = parent_id; in ti_sci_cmd_clk_set_parent()
1285 req->parent_id = 255; in ti_sci_cmd_clk_set_parent()
1286 req->parent_id_32 = parent_id; in ti_sci_cmd_clk_set_parent()
1291 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_clk_set_parent()
1295 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_clk_set_parent()
1297 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_cmd_clk_set_parent()
1300 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_clk_set_parent()
1306 * ti_sci_cmd_clk_get_parent() - Get current parent clock source
1307 * @handle: pointer to TI SCI handle
1323 struct device *dev; in ti_sci_cmd_clk_get_parent() local
1329 return -EINVAL; in ti_sci_cmd_clk_get_parent()
1332 dev = info->dev; in ti_sci_cmd_clk_get_parent()
1339 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_clk_get_parent()
1342 req = (struct ti_sci_msg_req_get_clock_parent *)xfer->xfer_buf; in ti_sci_cmd_clk_get_parent()
1343 req->dev_id = dev_id; in ti_sci_cmd_clk_get_parent()
1345 req->clk_id = clk_id; in ti_sci_cmd_clk_get_parent()
1347 req->clk_id = 255; in ti_sci_cmd_clk_get_parent()
1348 req->clk_id_32 = clk_id; in ti_sci_cmd_clk_get_parent()
1353 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_clk_get_parent()
1357 resp = (struct ti_sci_msg_resp_get_clock_parent *)xfer->xfer_buf; in ti_sci_cmd_clk_get_parent()
1360 ret = -ENODEV; in ti_sci_cmd_clk_get_parent()
1362 if (resp->parent_id < 255) in ti_sci_cmd_clk_get_parent()
1363 *parent_id = resp->parent_id; in ti_sci_cmd_clk_get_parent()
1365 *parent_id = resp->parent_id_32; in ti_sci_cmd_clk_get_parent()
1369 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_clk_get_parent()
1375 * ti_sci_cmd_clk_get_num_parents() - Get num parents of the current clk source
1376 * @handle: pointer to TI SCI handle
1393 struct device *dev; in ti_sci_cmd_clk_get_num_parents() local
1399 return -EINVAL; in ti_sci_cmd_clk_get_num_parents()
1402 dev = info->dev; in ti_sci_cmd_clk_get_num_parents()
1409 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_clk_get_num_parents()
1412 req = (struct ti_sci_msg_req_get_clock_num_parents *)xfer->xfer_buf; in ti_sci_cmd_clk_get_num_parents()
1413 req->dev_id = dev_id; in ti_sci_cmd_clk_get_num_parents()
1415 req->clk_id = clk_id; in ti_sci_cmd_clk_get_num_parents()
1417 req->clk_id = 255; in ti_sci_cmd_clk_get_num_parents()
1418 req->clk_id_32 = clk_id; in ti_sci_cmd_clk_get_num_parents()
1423 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_clk_get_num_parents()
1427 resp = (struct ti_sci_msg_resp_get_clock_num_parents *)xfer->xfer_buf; in ti_sci_cmd_clk_get_num_parents()
1430 ret = -ENODEV; in ti_sci_cmd_clk_get_num_parents()
1432 if (resp->num_parents < 255) in ti_sci_cmd_clk_get_num_parents()
1433 *num_parents = resp->num_parents; in ti_sci_cmd_clk_get_num_parents()
1435 *num_parents = resp->num_parents_32; in ti_sci_cmd_clk_get_num_parents()
1439 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_clk_get_num_parents()
1445 * ti_sci_cmd_clk_get_match_freq() - Find a good match for frequency
1446 * @handle: pointer to TI SCI handle
1472 struct device *dev; in ti_sci_cmd_clk_get_match_freq() local
1478 return -EINVAL; in ti_sci_cmd_clk_get_match_freq()
1481 dev = info->dev; in ti_sci_cmd_clk_get_match_freq()
1488 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_clk_get_match_freq()
1491 req = (struct ti_sci_msg_req_query_clock_freq *)xfer->xfer_buf; in ti_sci_cmd_clk_get_match_freq()
1492 req->dev_id = dev_id; in ti_sci_cmd_clk_get_match_freq()
1494 req->clk_id = clk_id; in ti_sci_cmd_clk_get_match_freq()
1496 req->clk_id = 255; in ti_sci_cmd_clk_get_match_freq()
1497 req->clk_id_32 = clk_id; in ti_sci_cmd_clk_get_match_freq()
1499 req->min_freq_hz = min_freq; in ti_sci_cmd_clk_get_match_freq()
1500 req->target_freq_hz = target_freq; in ti_sci_cmd_clk_get_match_freq()
1501 req->max_freq_hz = max_freq; in ti_sci_cmd_clk_get_match_freq()
1505 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_clk_get_match_freq()
1509 resp = (struct ti_sci_msg_resp_query_clock_freq *)xfer->xfer_buf; in ti_sci_cmd_clk_get_match_freq()
1512 ret = -ENODEV; in ti_sci_cmd_clk_get_match_freq()
1514 *match_freq = resp->freq_hz; in ti_sci_cmd_clk_get_match_freq()
1517 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_clk_get_match_freq()
1523 * ti_sci_cmd_clk_set_freq() - Set a frequency for clock
1524 * @handle: pointer to TI SCI handle
1548 struct device *dev; in ti_sci_cmd_clk_set_freq() local
1554 return -EINVAL; in ti_sci_cmd_clk_set_freq()
1557 dev = info->dev; in ti_sci_cmd_clk_set_freq()
1564 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_clk_set_freq()
1567 req = (struct ti_sci_msg_req_set_clock_freq *)xfer->xfer_buf; in ti_sci_cmd_clk_set_freq()
1568 req->dev_id = dev_id; in ti_sci_cmd_clk_set_freq()
1570 req->clk_id = clk_id; in ti_sci_cmd_clk_set_freq()
1572 req->clk_id = 255; in ti_sci_cmd_clk_set_freq()
1573 req->clk_id_32 = clk_id; in ti_sci_cmd_clk_set_freq()
1575 req->min_freq_hz = min_freq; in ti_sci_cmd_clk_set_freq()
1576 req->target_freq_hz = target_freq; in ti_sci_cmd_clk_set_freq()
1577 req->max_freq_hz = max_freq; in ti_sci_cmd_clk_set_freq()
1581 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_clk_set_freq()
1585 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_clk_set_freq()
1587 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_cmd_clk_set_freq()
1590 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_clk_set_freq()
1596 * ti_sci_cmd_clk_get_freq() - Get current frequency
1597 * @handle: pointer to TI SCI handle
1613 struct device *dev; in ti_sci_cmd_clk_get_freq() local
1619 return -EINVAL; in ti_sci_cmd_clk_get_freq()
1622 dev = info->dev; in ti_sci_cmd_clk_get_freq()
1629 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_clk_get_freq()
1632 req = (struct ti_sci_msg_req_get_clock_freq *)xfer->xfer_buf; in ti_sci_cmd_clk_get_freq()
1633 req->dev_id = dev_id; in ti_sci_cmd_clk_get_freq()
1635 req->clk_id = clk_id; in ti_sci_cmd_clk_get_freq()
1637 req->clk_id = 255; in ti_sci_cmd_clk_get_freq()
1638 req->clk_id_32 = clk_id; in ti_sci_cmd_clk_get_freq()
1643 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_clk_get_freq()
1647 resp = (struct ti_sci_msg_resp_get_clock_freq *)xfer->xfer_buf; in ti_sci_cmd_clk_get_freq()
1650 ret = -ENODEV; in ti_sci_cmd_clk_get_freq()
1652 *freq = resp->freq_hz; in ti_sci_cmd_clk_get_freq()
1655 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_clk_get_freq()
1661 * ti_sci_cmd_prepare_sleep() - Prepare system for system suspend
1662 * @handle: pointer to TI SCI handle
1677 struct device *dev; in ti_sci_cmd_prepare_sleep() local
1683 return -EINVAL; in ti_sci_cmd_prepare_sleep()
1686 dev = info->dev; in ti_sci_cmd_prepare_sleep()
1693 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_prepare_sleep()
1697 req = (struct ti_sci_msg_req_prepare_sleep *)xfer->xfer_buf; in ti_sci_cmd_prepare_sleep()
1698 req->mode = mode; in ti_sci_cmd_prepare_sleep()
1699 req->ctx_lo = ctx_lo; in ti_sci_cmd_prepare_sleep()
1700 req->ctx_hi = ctx_hi; in ti_sci_cmd_prepare_sleep()
1701 req->debug_flags = debug_flags; in ti_sci_cmd_prepare_sleep()
1705 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_prepare_sleep()
1709 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_prepare_sleep()
1712 dev_err(dev, "Failed to prepare sleep\n"); in ti_sci_cmd_prepare_sleep()
1713 ret = -ENODEV; in ti_sci_cmd_prepare_sleep()
1717 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_prepare_sleep()
1723 * ti_sci_msg_cmd_query_fw_caps() - Get the FW/SoC capabilities
1724 * @handle: Pointer to TI SCI handle
1729 * -ENODEV being returned.
1739 struct device *dev; in ti_sci_msg_cmd_query_fw_caps() local
1745 return -EINVAL; in ti_sci_msg_cmd_query_fw_caps()
1748 dev = info->dev; in ti_sci_msg_cmd_query_fw_caps()
1756 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_msg_cmd_query_fw_caps()
1762 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_msg_cmd_query_fw_caps()
1766 resp = (struct ti_sci_msg_resp_query_fw_caps *)xfer->xfer_buf; in ti_sci_msg_cmd_query_fw_caps()
1769 dev_err(dev, "Failed to get capabilities\n"); in ti_sci_msg_cmd_query_fw_caps()
1770 ret = -ENODEV; in ti_sci_msg_cmd_query_fw_caps()
1775 *fw_caps = resp->fw_caps; in ti_sci_msg_cmd_query_fw_caps()
1778 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_msg_cmd_query_fw_caps()
1784 * ti_sci_cmd_set_io_isolation() - Enable IO isolation in LPM
1785 * @handle: Pointer to TI SCI handle
1797 struct device *dev; in ti_sci_cmd_set_io_isolation() local
1803 return -EINVAL; in ti_sci_cmd_set_io_isolation()
1806 dev = info->dev; in ti_sci_cmd_set_io_isolation()
1813 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_set_io_isolation()
1816 req = (struct ti_sci_msg_req_set_io_isolation *)xfer->xfer_buf; in ti_sci_cmd_set_io_isolation()
1817 req->state = state; in ti_sci_cmd_set_io_isolation()
1821 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_set_io_isolation()
1825 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_set_io_isolation()
1828 dev_err(dev, "Failed to set IO isolation\n"); in ti_sci_cmd_set_io_isolation()
1829 ret = -ENODEV; in ti_sci_cmd_set_io_isolation()
1833 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_set_io_isolation()
1839 * ti_sci_msg_cmd_lpm_wake_reason() - Get the wakeup source from LPM
1840 * @handle: Pointer to TI SCI handle
1854 struct device *dev; in ti_sci_msg_cmd_lpm_wake_reason() local
1860 return -EINVAL; in ti_sci_msg_cmd_lpm_wake_reason()
1863 dev = info->dev; in ti_sci_msg_cmd_lpm_wake_reason()
1871 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_msg_cmd_lpm_wake_reason()
1877 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_msg_cmd_lpm_wake_reason()
1881 resp = (struct ti_sci_msg_resp_lpm_wake_reason *)xfer->xfer_buf; in ti_sci_msg_cmd_lpm_wake_reason()
1884 dev_err(dev, "Failed to get wake reason\n"); in ti_sci_msg_cmd_lpm_wake_reason()
1885 ret = -ENODEV; in ti_sci_msg_cmd_lpm_wake_reason()
1890 *source = resp->wake_source; in ti_sci_msg_cmd_lpm_wake_reason()
1892 *timestamp = resp->wake_timestamp; in ti_sci_msg_cmd_lpm_wake_reason()
1894 *pin = resp->wake_pin; in ti_sci_msg_cmd_lpm_wake_reason()
1896 *mode = resp->mode; in ti_sci_msg_cmd_lpm_wake_reason()
1899 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_msg_cmd_lpm_wake_reason()
1905 * ti_sci_cmd_set_device_constraint() - Set LPM constraint on behalf of a device
1906 * @handle: pointer to TI SCI handle
1907 * @id: Device identifier
1913 u32 id, u8 state) in ti_sci_cmd_set_device_constraint() argument
1919 struct device *dev; in ti_sci_cmd_set_device_constraint() local
1925 return -EINVAL; in ti_sci_cmd_set_device_constraint()
1928 dev = info->dev; in ti_sci_cmd_set_device_constraint()
1935 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_set_device_constraint()
1938 req = (struct ti_sci_msg_req_lpm_set_device_constraint *)xfer->xfer_buf; in ti_sci_cmd_set_device_constraint()
1939 req->id = id; in ti_sci_cmd_set_device_constraint()
1940 req->state = state; in ti_sci_cmd_set_device_constraint()
1944 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_set_device_constraint()
1948 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_set_device_constraint()
1951 dev_err(dev, "Failed to set device constraint\n"); in ti_sci_cmd_set_device_constraint()
1952 ret = -ENODEV; in ti_sci_cmd_set_device_constraint()
1956 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_set_device_constraint()
1962 * ti_sci_cmd_set_latency_constraint() - Set LPM resume latency constraint
1963 * @handle: pointer to TI SCI handle
1976 struct device *dev; in ti_sci_cmd_set_latency_constraint() local
1982 return -EINVAL; in ti_sci_cmd_set_latency_constraint()
1985 dev = info->dev; in ti_sci_cmd_set_latency_constraint()
1992 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_set_latency_constraint()
1995 req = (struct ti_sci_msg_req_lpm_set_latency_constraint *)xfer->xfer_buf; in ti_sci_cmd_set_latency_constraint()
1996 req->latency = latency; in ti_sci_cmd_set_latency_constraint()
1997 req->state = state; in ti_sci_cmd_set_latency_constraint()
2001 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_set_latency_constraint()
2005 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_set_latency_constraint()
2008 dev_err(dev, "Failed to set device constraint\n"); in ti_sci_cmd_set_latency_constraint()
2009 ret = -ENODEV; in ti_sci_cmd_set_latency_constraint()
2013 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_set_latency_constraint()
2024 struct device *dev; in ti_sci_cmd_core_reboot() local
2030 return -EINVAL; in ti_sci_cmd_core_reboot()
2033 dev = info->dev; in ti_sci_cmd_core_reboot()
2040 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_core_reboot()
2043 req = (struct ti_sci_msg_req_reboot *)xfer->xfer_buf; in ti_sci_cmd_core_reboot()
2047 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_core_reboot()
2051 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_core_reboot()
2054 ret = -ENODEV; in ti_sci_cmd_core_reboot()
2059 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_core_reboot()
2065 * ti_sci_get_resource_range - Helper to get a range of resources assigned
2069 * @dev_id: TISCI device ID.
2072 * @s_host: Host processor ID to which the resources are allocated
2086 struct device *dev; in ti_sci_get_resource_range() local
2092 return -EINVAL; in ti_sci_get_resource_range()
2095 dev = info->dev; in ti_sci_get_resource_range()
2102 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_get_resource_range()
2106 req = (struct ti_sci_msg_req_get_resource_range *)xfer->xfer_buf; in ti_sci_get_resource_range()
2107 req->secondary_host = s_host; in ti_sci_get_resource_range()
2108 req->type = dev_id & MSG_RM_RESOURCE_TYPE_MASK; in ti_sci_get_resource_range()
2109 req->subtype = subtype & MSG_RM_RESOURCE_SUBTYPE_MASK; in ti_sci_get_resource_range()
2113 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_get_resource_range()
2117 resp = (struct ti_sci_msg_resp_get_resource_range *)xfer->xfer_buf; in ti_sci_get_resource_range()
2120 ret = -ENODEV; in ti_sci_get_resource_range()
2121 } else if (!resp->range_num && !resp->range_num_sec) { in ti_sci_get_resource_range()
2123 ret = -ENODEV; in ti_sci_get_resource_range()
2125 desc->start = resp->range_start; in ti_sci_get_resource_range()
2126 desc->num = resp->range_num; in ti_sci_get_resource_range()
2127 desc->start_sec = resp->range_start_sec; in ti_sci_get_resource_range()
2128 desc->num_sec = resp->range_num_sec; in ti_sci_get_resource_range()
2132 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_get_resource_range()
2138 * ti_sci_cmd_get_resource_range - Get a range of resources assigned to host
2139 * that is same as ti sci interface host.
2141 * @dev_id: TISCI device ID.
2159 * ti_sci_cmd_get_resource_range_from_shost - Get a range of resources
2162 * @dev_id: TISCI device ID.
2165 * @s_host: Host processor ID to which the resources are allocated
2180 * ti_sci_manage_irq() - Helper api to configure/release the irq route between
2184 * @src_id: Device ID of the IRQ source
2186 * @dst_id: Device ID of the IRQ destination
2188 * @ia_id: Device ID of the IA, if the IRQ flows through this IA
2192 * @s_host: Secondary host ID to which the irq/event is being
2208 struct device *dev; in ti_sci_manage_irq() local
2214 return -EINVAL; in ti_sci_manage_irq()
2217 dev = info->dev; in ti_sci_manage_irq()
2223 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_manage_irq()
2226 req = (struct ti_sci_msg_req_manage_irq *)xfer->xfer_buf; in ti_sci_manage_irq()
2227 req->valid_params = valid_params; in ti_sci_manage_irq()
2228 req->src_id = src_id; in ti_sci_manage_irq()
2229 req->src_index = src_index; in ti_sci_manage_irq()
2230 req->dst_id = dst_id; in ti_sci_manage_irq()
2231 req->dst_host_irq = dst_host_irq; in ti_sci_manage_irq()
2232 req->ia_id = ia_id; in ti_sci_manage_irq()
2233 req->vint = vint; in ti_sci_manage_irq()
2234 req->global_event = global_event; in ti_sci_manage_irq()
2235 req->vint_status_bit = vint_status_bit; in ti_sci_manage_irq()
2236 req->secondary_host = s_host; in ti_sci_manage_irq()
2240 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_manage_irq()
2244 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_manage_irq()
2246 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_manage_irq()
2249 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_manage_irq()
2255 * ti_sci_set_irq() - Helper api to configure the irq route between the
2259 * @src_id: Device ID of the IRQ source
2261 * @dst_id: Device ID of the IRQ destination
2263 * @ia_id: Device ID of the IA, if the IRQ flows through this IA
2267 * @s_host: Secondary host ID to which the irq/event is being
2289 * ti_sci_free_irq() - Helper api to free the irq route between the
2293 * @src_id: Device ID of the IRQ source
2295 * @dst_id: Device ID of the IRQ destination
2297 * @ia_id: Device ID of the IA, if the IRQ flows through this IA
2301 * @s_host: Secondary host ID to which the irq/event is being
2323 * ti_sci_cmd_set_irq() - Configure a host irq route between the requested
2326 * @src_id: Device ID of the IRQ source
2328 * @dst_id: Device ID of the IRQ destination
2343 * ti_sci_cmd_set_event_map() - Configure an event based irq route between the
2346 * @src_id: Device ID of the IRQ source
2348 * @ia_id: Device ID of the IA, if the IRQ flows through this IA
2369 * ti_sci_cmd_free_irq() - Free a host irq route between the between the
2372 * @src_id: Device ID of the IRQ source
2374 * @dst_id: Device ID of the IRQ destination
2389 * ti_sci_cmd_free_event_map() - Free an event map between the requested source
2392 * @src_id: Device ID of the IRQ source
2394 * @ia_id: Device ID of the IA, if the IRQ flows through this IA
2415 * ti_sci_cmd_rm_ring_cfg() - Configure a NAVSS ring
2416 * @handle: Pointer to TI SCI handle.
2431 struct device *dev; in ti_sci_cmd_rm_ring_cfg() local
2435 return -EINVAL; in ti_sci_cmd_rm_ring_cfg()
2438 dev = info->dev; in ti_sci_cmd_rm_ring_cfg()
2445 dev_err(dev, "RM_RA:Message config failed(%d)\n", ret); in ti_sci_cmd_rm_ring_cfg()
2448 req = (struct ti_sci_msg_rm_ring_cfg_req *)xfer->xfer_buf; in ti_sci_cmd_rm_ring_cfg()
2449 req->valid_params = params->valid_params; in ti_sci_cmd_rm_ring_cfg()
2450 req->nav_id = params->nav_id; in ti_sci_cmd_rm_ring_cfg()
2451 req->index = params->index; in ti_sci_cmd_rm_ring_cfg()
2452 req->addr_lo = params->addr_lo; in ti_sci_cmd_rm_ring_cfg()
2453 req->addr_hi = params->addr_hi; in ti_sci_cmd_rm_ring_cfg()
2454 req->count = params->count; in ti_sci_cmd_rm_ring_cfg()
2455 req->mode = params->mode; in ti_sci_cmd_rm_ring_cfg()
2456 req->size = params->size; in ti_sci_cmd_rm_ring_cfg()
2457 req->order_id = params->order_id; in ti_sci_cmd_rm_ring_cfg()
2458 req->virtid = params->virtid; in ti_sci_cmd_rm_ring_cfg()
2459 req->asel = params->asel; in ti_sci_cmd_rm_ring_cfg()
2463 dev_err(dev, "RM_RA:Mbox config send fail %d\n", ret); in ti_sci_cmd_rm_ring_cfg()
2467 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_rm_ring_cfg()
2468 ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL; in ti_sci_cmd_rm_ring_cfg()
2471 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_rm_ring_cfg()
2472 dev_dbg(dev, "RM_RA:config ring %u ret:%d\n", params->index, ret); in ti_sci_cmd_rm_ring_cfg()
2477 * ti_sci_cmd_rm_psil_pair() - Pair PSI-L source to destination thread
2478 * @handle: Pointer to TI SCI handle.
2479 * @nav_id: Device ID of Navigator Subsystem which should be used for
2481 * @src_thread: Source PSI-L thread ID
2482 * @dst_thread: Destination PSI-L thread ID
2493 struct device *dev; in ti_sci_cmd_rm_psil_pair() local
2499 return -EINVAL; in ti_sci_cmd_rm_psil_pair()
2502 dev = info->dev; in ti_sci_cmd_rm_psil_pair()
2509 dev_err(dev, "RM_PSIL:Message reconfig failed(%d)\n", ret); in ti_sci_cmd_rm_psil_pair()
2512 req = (struct ti_sci_msg_psil_pair *)xfer->xfer_buf; in ti_sci_cmd_rm_psil_pair()
2513 req->nav_id = nav_id; in ti_sci_cmd_rm_psil_pair()
2514 req->src_thread = src_thread; in ti_sci_cmd_rm_psil_pair()
2515 req->dst_thread = dst_thread; in ti_sci_cmd_rm_psil_pair()
2519 dev_err(dev, "RM_PSIL:Mbox send fail %d\n", ret); in ti_sci_cmd_rm_psil_pair()
2523 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_rm_psil_pair()
2524 ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL; in ti_sci_cmd_rm_psil_pair()
2527 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_rm_psil_pair()
2533 * ti_sci_cmd_rm_psil_unpair() - Unpair PSI-L source from destination thread
2534 * @handle: Pointer to TI SCI handle.
2535 * @nav_id: Device ID of Navigator Subsystem which should be used for
2537 * @src_thread: Source PSI-L thread ID
2538 * @dst_thread: Destination PSI-L thread ID
2549 struct device *dev; in ti_sci_cmd_rm_psil_unpair() local
2555 return -EINVAL; in ti_sci_cmd_rm_psil_unpair()
2558 dev = info->dev; in ti_sci_cmd_rm_psil_unpair()
2565 dev_err(dev, "RM_PSIL:Message reconfig failed(%d)\n", ret); in ti_sci_cmd_rm_psil_unpair()
2568 req = (struct ti_sci_msg_psil_unpair *)xfer->xfer_buf; in ti_sci_cmd_rm_psil_unpair()
2569 req->nav_id = nav_id; in ti_sci_cmd_rm_psil_unpair()
2570 req->src_thread = src_thread; in ti_sci_cmd_rm_psil_unpair()
2571 req->dst_thread = dst_thread; in ti_sci_cmd_rm_psil_unpair()
2575 dev_err(dev, "RM_PSIL:Mbox send fail %d\n", ret); in ti_sci_cmd_rm_psil_unpair()
2579 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_rm_psil_unpair()
2580 ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL; in ti_sci_cmd_rm_psil_unpair()
2583 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_rm_psil_unpair()
2589 * ti_sci_cmd_rm_udmap_tx_ch_cfg() - Configure a UDMAP TX channel
2590 * @handle: Pointer to TI SCI handle.
2606 struct device *dev; in ti_sci_cmd_rm_udmap_tx_ch_cfg() local
2610 return -EINVAL; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2613 dev = info->dev; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2620 dev_err(dev, "Message TX_CH_CFG alloc failed(%d)\n", ret); in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2623 req = (struct ti_sci_msg_rm_udmap_tx_ch_cfg_req *)xfer->xfer_buf; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2624 req->valid_params = params->valid_params; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2625 req->nav_id = params->nav_id; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2626 req->index = params->index; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2627 req->tx_pause_on_err = params->tx_pause_on_err; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2628 req->tx_filt_einfo = params->tx_filt_einfo; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2629 req->tx_filt_pswords = params->tx_filt_pswords; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2630 req->tx_atype = params->tx_atype; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2631 req->tx_chan_type = params->tx_chan_type; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2632 req->tx_supr_tdpkt = params->tx_supr_tdpkt; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2633 req->tx_fetch_size = params->tx_fetch_size; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2634 req->tx_credit_count = params->tx_credit_count; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2635 req->txcq_qnum = params->txcq_qnum; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2636 req->tx_priority = params->tx_priority; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2637 req->tx_qos = params->tx_qos; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2638 req->tx_orderid = params->tx_orderid; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2639 req->fdepth = params->fdepth; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2640 req->tx_sched_priority = params->tx_sched_priority; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2641 req->tx_burst_size = params->tx_burst_size; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2642 req->tx_tdtype = params->tx_tdtype; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2643 req->extended_ch_type = params->extended_ch_type; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2647 dev_err(dev, "Mbox send TX_CH_CFG fail %d\n", ret); in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2651 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2652 ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2655 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2656 dev_dbg(dev, "TX_CH_CFG: chn %u ret:%u\n", params->index, ret); in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2661 * ti_sci_cmd_rm_udmap_rx_ch_cfg() - Configure a UDMAP RX channel
2662 * @handle: Pointer to TI SCI handle.
2678 struct device *dev; in ti_sci_cmd_rm_udmap_rx_ch_cfg() local
2682 return -EINVAL; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2685 dev = info->dev; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2692 dev_err(dev, "Message RX_CH_CFG alloc failed(%d)\n", ret); in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2695 req = (struct ti_sci_msg_rm_udmap_rx_ch_cfg_req *)xfer->xfer_buf; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2696 req->valid_params = params->valid_params; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2697 req->nav_id = params->nav_id; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2698 req->index = params->index; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2699 req->rx_fetch_size = params->rx_fetch_size; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2700 req->rxcq_qnum = params->rxcq_qnum; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2701 req->rx_priority = params->rx_priority; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2702 req->rx_qos = params->rx_qos; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2703 req->rx_orderid = params->rx_orderid; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2704 req->rx_sched_priority = params->rx_sched_priority; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2705 req->flowid_start = params->flowid_start; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2706 req->flowid_cnt = params->flowid_cnt; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2707 req->rx_pause_on_err = params->rx_pause_on_err; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2708 req->rx_atype = params->rx_atype; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2709 req->rx_chan_type = params->rx_chan_type; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2710 req->rx_ignore_short = params->rx_ignore_short; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2711 req->rx_ignore_long = params->rx_ignore_long; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2712 req->rx_burst_size = params->rx_burst_size; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2716 dev_err(dev, "Mbox send RX_CH_CFG fail %d\n", ret); in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2720 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2721 ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2724 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2725 dev_dbg(dev, "RX_CH_CFG: chn %u ret:%d\n", params->index, ret); in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2730 * ti_sci_cmd_rm_udmap_rx_flow_cfg() - Configure UDMAP RX FLOW
2731 * @handle: Pointer to TI SCI handle.
2747 struct device *dev; in ti_sci_cmd_rm_udmap_rx_flow_cfg() local
2751 return -EINVAL; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2754 dev = info->dev; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2761 dev_err(dev, "RX_FL_CFG: Message alloc failed(%d)\n", ret); in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2764 req = (struct ti_sci_msg_rm_udmap_flow_cfg_req *)xfer->xfer_buf; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2765 req->valid_params = params->valid_params; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2766 req->nav_id = params->nav_id; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2767 req->flow_index = params->flow_index; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2768 req->rx_einfo_present = params->rx_einfo_present; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2769 req->rx_psinfo_present = params->rx_psinfo_present; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2770 req->rx_error_handling = params->rx_error_handling; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2771 req->rx_desc_type = params->rx_desc_type; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2772 req->rx_sop_offset = params->rx_sop_offset; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2773 req->rx_dest_qnum = params->rx_dest_qnum; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2774 req->rx_src_tag_hi = params->rx_src_tag_hi; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2775 req->rx_src_tag_lo = params->rx_src_tag_lo; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2776 req->rx_dest_tag_hi = params->rx_dest_tag_hi; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2777 req->rx_dest_tag_lo = params->rx_dest_tag_lo; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2778 req->rx_src_tag_hi_sel = params->rx_src_tag_hi_sel; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2779 req->rx_src_tag_lo_sel = params->rx_src_tag_lo_sel; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2780 req->rx_dest_tag_hi_sel = params->rx_dest_tag_hi_sel; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2781 req->rx_dest_tag_lo_sel = params->rx_dest_tag_lo_sel; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2782 req->rx_fdq0_sz0_qnum = params->rx_fdq0_sz0_qnum; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2783 req->rx_fdq1_qnum = params->rx_fdq1_qnum; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2784 req->rx_fdq2_qnum = params->rx_fdq2_qnum; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2785 req->rx_fdq3_qnum = params->rx_fdq3_qnum; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2786 req->rx_ps_location = params->rx_ps_location; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2790 dev_err(dev, "RX_FL_CFG: Mbox send fail %d\n", ret); in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2794 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2795 ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2798 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2799 dev_dbg(info->dev, "RX_FL_CFG: %u ret:%d\n", params->flow_index, ret); in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2804 * ti_sci_cmd_proc_request() - Command to request a physical processor control
2805 * @handle: Pointer to TI SCI handle
2806 * @proc_id: Processor ID this request is for
2817 struct device *dev; in ti_sci_cmd_proc_request() local
2821 return -EINVAL; in ti_sci_cmd_proc_request()
2826 dev = info->dev; in ti_sci_cmd_proc_request()
2833 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_proc_request()
2836 req = (struct ti_sci_msg_req_proc_request *)xfer->xfer_buf; in ti_sci_cmd_proc_request()
2837 req->processor_id = proc_id; in ti_sci_cmd_proc_request()
2841 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_proc_request()
2845 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_cmd_proc_request()
2847 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_cmd_proc_request()
2850 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_proc_request()
2856 * ti_sci_cmd_proc_release() - Command to release a physical processor control
2857 * @handle: Pointer to TI SCI handle
2858 * @proc_id: Processor ID this request is for
2869 struct device *dev; in ti_sci_cmd_proc_release() local
2873 return -EINVAL; in ti_sci_cmd_proc_release()
2878 dev = info->dev; in ti_sci_cmd_proc_release()
2885 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_proc_release()
2888 req = (struct ti_sci_msg_req_proc_release *)xfer->xfer_buf; in ti_sci_cmd_proc_release()
2889 req->processor_id = proc_id; in ti_sci_cmd_proc_release()
2893 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_proc_release()
2897 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_cmd_proc_release()
2899 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_cmd_proc_release()
2902 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_proc_release()
2908 * ti_sci_cmd_proc_handover() - Command to handover a physical processor
2911 * @handle: Pointer to TI SCI handle
2912 * @proc_id: Processor ID this request is for
2913 * @host_id: Host ID to get the control of the processor
2924 struct device *dev; in ti_sci_cmd_proc_handover() local
2928 return -EINVAL; in ti_sci_cmd_proc_handover()
2933 dev = info->dev; in ti_sci_cmd_proc_handover()
2940 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_proc_handover()
2943 req = (struct ti_sci_msg_req_proc_handover *)xfer->xfer_buf; in ti_sci_cmd_proc_handover()
2944 req->processor_id = proc_id; in ti_sci_cmd_proc_handover()
2945 req->host_id = host_id; in ti_sci_cmd_proc_handover()
2949 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_proc_handover()
2953 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_cmd_proc_handover()
2955 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_cmd_proc_handover()
2958 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_proc_handover()
2964 * ti_sci_cmd_proc_set_config() - Command to set the processor boot
2966 * @handle: Pointer to TI SCI handle
2967 * @proc_id: Processor ID this request is for
2983 struct device *dev; in ti_sci_cmd_proc_set_config() local
2987 return -EINVAL; in ti_sci_cmd_proc_set_config()
2992 dev = info->dev; in ti_sci_cmd_proc_set_config()
2999 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_proc_set_config()
3002 req = (struct ti_sci_msg_req_set_config *)xfer->xfer_buf; in ti_sci_cmd_proc_set_config()
3003 req->processor_id = proc_id; in ti_sci_cmd_proc_set_config()
3004 req->bootvector_low = bootvector & TI_SCI_ADDR_LOW_MASK; in ti_sci_cmd_proc_set_config()
3005 req->bootvector_high = (bootvector & TI_SCI_ADDR_HIGH_MASK) >> in ti_sci_cmd_proc_set_config()
3007 req->config_flags_set = config_flags_set; in ti_sci_cmd_proc_set_config()
3008 req->config_flags_clear = config_flags_clear; in ti_sci_cmd_proc_set_config()
3012 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_proc_set_config()
3016 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_cmd_proc_set_config()
3018 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_cmd_proc_set_config()
3021 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_proc_set_config()
3027 * ti_sci_cmd_proc_set_control() - Command to set the processor boot
3029 * @handle: Pointer to TI SCI handle
3030 * @proc_id: Processor ID this request is for
3044 struct device *dev; in ti_sci_cmd_proc_set_control() local
3048 return -EINVAL; in ti_sci_cmd_proc_set_control()
3053 dev = info->dev; in ti_sci_cmd_proc_set_control()
3060 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_proc_set_control()
3063 req = (struct ti_sci_msg_req_set_ctrl *)xfer->xfer_buf; in ti_sci_cmd_proc_set_control()
3064 req->processor_id = proc_id; in ti_sci_cmd_proc_set_control()
3065 req->control_flags_set = control_flags_set; in ti_sci_cmd_proc_set_control()
3066 req->control_flags_clear = control_flags_clear; in ti_sci_cmd_proc_set_control()
3070 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_proc_set_control()
3074 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_cmd_proc_set_control()
3076 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_cmd_proc_set_control()
3079 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_proc_set_control()
3085 * ti_sci_cmd_proc_get_status() - Command to get the processor boot status
3086 * @handle: Pointer to TI SCI handle
3087 * @proc_id: Processor ID this request is for
3103 struct device *dev; in ti_sci_cmd_proc_get_status() local
3107 return -EINVAL; in ti_sci_cmd_proc_get_status()
3112 dev = info->dev; in ti_sci_cmd_proc_get_status()
3119 dev_err(dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_proc_get_status()
3122 req = (struct ti_sci_msg_req_get_status *)xfer->xfer_buf; in ti_sci_cmd_proc_get_status()
3123 req->processor_id = proc_id; in ti_sci_cmd_proc_get_status()
3127 dev_err(dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_proc_get_status()
3131 resp = (struct ti_sci_msg_resp_get_status *)xfer->tx_message.buf; in ti_sci_cmd_proc_get_status()
3134 ret = -ENODEV; in ti_sci_cmd_proc_get_status()
3136 *bv = (resp->bootvector_low & TI_SCI_ADDR_LOW_MASK) | in ti_sci_cmd_proc_get_status()
3137 (((u64)resp->bootvector_high << TI_SCI_ADDR_HIGH_SHIFT) & in ti_sci_cmd_proc_get_status()
3139 *cfg_flags = resp->config_flags; in ti_sci_cmd_proc_get_status()
3140 *ctrl_flags = resp->control_flags; in ti_sci_cmd_proc_get_status()
3141 *sts_flags = resp->status_flags; in ti_sci_cmd_proc_get_status()
3145 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_proc_get_status()
3151 * ti_sci_setup_ops() - Setup the operations structures
3156 struct ti_sci_ops *ops = &info->handle.ops; in ti_sci_setup_ops()
3157 struct ti_sci_core_ops *core_ops = &ops->core_ops; in ti_sci_setup_ops()
3158 struct ti_sci_dev_ops *dops = &ops->dev_ops; in ti_sci_setup_ops()
3159 struct ti_sci_clk_ops *cops = &ops->clk_ops; in ti_sci_setup_ops()
3160 struct ti_sci_pm_ops *pmops = &ops->pm_ops; in ti_sci_setup_ops()
3161 struct ti_sci_rm_core_ops *rm_core_ops = &ops->rm_core_ops; in ti_sci_setup_ops()
3162 struct ti_sci_rm_irq_ops *iops = &ops->rm_irq_ops; in ti_sci_setup_ops()
3163 struct ti_sci_rm_ringacc_ops *rops = &ops->rm_ring_ops; in ti_sci_setup_ops()
3164 struct ti_sci_rm_psil_ops *psilops = &ops->rm_psil_ops; in ti_sci_setup_ops()
3165 struct ti_sci_rm_udmap_ops *udmap_ops = &ops->rm_udmap_ops; in ti_sci_setup_ops()
3166 struct ti_sci_proc_ops *pops = &ops->proc_ops; in ti_sci_setup_ops()
3168 core_ops->reboot_device = ti_sci_cmd_core_reboot; in ti_sci_setup_ops()
3170 dops->get_device = ti_sci_cmd_get_device; in ti_sci_setup_ops()
3171 dops->get_device_exclusive = ti_sci_cmd_get_device_exclusive; in ti_sci_setup_ops()
3172 dops->idle_device = ti_sci_cmd_idle_device; in ti_sci_setup_ops()
3173 dops->idle_device_exclusive = ti_sci_cmd_idle_device_exclusive; in ti_sci_setup_ops()
3174 dops->put_device = ti_sci_cmd_put_device; in ti_sci_setup_ops()
3176 dops->is_valid = ti_sci_cmd_dev_is_valid; in ti_sci_setup_ops()
3177 dops->get_context_loss_count = ti_sci_cmd_dev_get_clcnt; in ti_sci_setup_ops()
3178 dops->is_idle = ti_sci_cmd_dev_is_idle; in ti_sci_setup_ops()
3179 dops->is_stop = ti_sci_cmd_dev_is_stop; in ti_sci_setup_ops()
3180 dops->is_on = ti_sci_cmd_dev_is_on; in ti_sci_setup_ops()
3181 dops->is_transitioning = ti_sci_cmd_dev_is_trans; in ti_sci_setup_ops()
3182 dops->set_device_resets = ti_sci_cmd_set_device_resets; in ti_sci_setup_ops()
3183 dops->get_device_resets = ti_sci_cmd_get_device_resets; in ti_sci_setup_ops()
3185 cops->get_clock = ti_sci_cmd_get_clock; in ti_sci_setup_ops()
3186 cops->idle_clock = ti_sci_cmd_idle_clock; in ti_sci_setup_ops()
3187 cops->put_clock = ti_sci_cmd_put_clock; in ti_sci_setup_ops()
3188 cops->is_auto = ti_sci_cmd_clk_is_auto; in ti_sci_setup_ops()
3189 cops->is_on = ti_sci_cmd_clk_is_on; in ti_sci_setup_ops()
3190 cops->is_off = ti_sci_cmd_clk_is_off; in ti_sci_setup_ops()
3192 cops->set_parent = ti_sci_cmd_clk_set_parent; in ti_sci_setup_ops()
3193 cops->get_parent = ti_sci_cmd_clk_get_parent; in ti_sci_setup_ops()
3194 cops->get_num_parents = ti_sci_cmd_clk_get_num_parents; in ti_sci_setup_ops()
3196 cops->get_best_match_freq = ti_sci_cmd_clk_get_match_freq; in ti_sci_setup_ops()
3197 cops->set_freq = ti_sci_cmd_clk_set_freq; in ti_sci_setup_ops()
3198 cops->get_freq = ti_sci_cmd_clk_get_freq; in ti_sci_setup_ops()
3200 if (info->fw_caps & MSG_FLAG_CAPS_LPM_DM_MANAGED) { in ti_sci_setup_ops()
3202 pmops->lpm_wake_reason = ti_sci_msg_cmd_lpm_wake_reason; in ti_sci_setup_ops()
3203 pmops->set_device_constraint = ti_sci_cmd_set_device_constraint; in ti_sci_setup_ops()
3204 pmops->set_latency_constraint = ti_sci_cmd_set_latency_constraint; in ti_sci_setup_ops()
3207 rm_core_ops->get_range = ti_sci_cmd_get_resource_range; in ti_sci_setup_ops()
3208 rm_core_ops->get_range_from_shost = in ti_sci_setup_ops()
3211 iops->set_irq = ti_sci_cmd_set_irq; in ti_sci_setup_ops()
3212 iops->set_event_map = ti_sci_cmd_set_event_map; in ti_sci_setup_ops()
3213 iops->free_irq = ti_sci_cmd_free_irq; in ti_sci_setup_ops()
3214 iops->free_event_map = ti_sci_cmd_free_event_map; in ti_sci_setup_ops()
3216 rops->set_cfg = ti_sci_cmd_rm_ring_cfg; in ti_sci_setup_ops()
3218 psilops->pair = ti_sci_cmd_rm_psil_pair; in ti_sci_setup_ops()
3219 psilops->unpair = ti_sci_cmd_rm_psil_unpair; in ti_sci_setup_ops()
3221 udmap_ops->tx_ch_cfg = ti_sci_cmd_rm_udmap_tx_ch_cfg; in ti_sci_setup_ops()
3222 udmap_ops->rx_ch_cfg = ti_sci_cmd_rm_udmap_rx_ch_cfg; in ti_sci_setup_ops()
3223 udmap_ops->rx_flow_cfg = ti_sci_cmd_rm_udmap_rx_flow_cfg; in ti_sci_setup_ops()
3225 pops->request = ti_sci_cmd_proc_request; in ti_sci_setup_ops()
3226 pops->release = ti_sci_cmd_proc_release; in ti_sci_setup_ops()
3227 pops->handover = ti_sci_cmd_proc_handover; in ti_sci_setup_ops()
3228 pops->set_config = ti_sci_cmd_proc_set_config; in ti_sci_setup_ops()
3229 pops->set_control = ti_sci_cmd_proc_set_control; in ti_sci_setup_ops()
3230 pops->get_status = ti_sci_cmd_proc_get_status; in ti_sci_setup_ops()
3234 * ti_sci_get_handle() - Get the TI SCI handle for a device
3235 * @dev: Pointer to device for which we want SCI handle
3238 * and is expected to be maintained by caller of TI SCI protocol library.
3241 * -EPROBE_DEFER if the instance is not ready
3242 * -ENODEV if the required node handler is missing
3243 * -EINVAL if invalid conditions are encountered.
3245 const struct ti_sci_handle *ti_sci_get_handle(struct device *dev) in ti_sci_get_handle() argument
3251 if (!dev) { in ti_sci_get_handle()
3253 return ERR_PTR(-EINVAL); in ti_sci_get_handle()
3255 ti_sci_np = of_get_parent(dev->of_node); in ti_sci_get_handle()
3257 dev_err(dev, "No OF information\n"); in ti_sci_get_handle()
3258 return ERR_PTR(-EINVAL); in ti_sci_get_handle()
3263 if (ti_sci_np == info->dev->of_node) { in ti_sci_get_handle()
3264 handle = &info->handle; in ti_sci_get_handle()
3265 info->users++; in ti_sci_get_handle()
3273 return ERR_PTR(-EPROBE_DEFER); in ti_sci_get_handle()
3280 * ti_sci_put_handle() - Release the handle acquired by ti_sci_get_handle
3284 * and is expected to be maintained by caller of TI SCI protocol library.
3289 * if null was passed, it returns -EINVAL;
3298 return -EINVAL; in ti_sci_put_handle()
3302 if (!WARN_ON(!info->users)) in ti_sci_put_handle()
3303 info->users--; in ti_sci_put_handle()
3310 static void devm_ti_sci_release(struct device *dev, void *res) in devm_ti_sci_release() argument
3318 dev_err(dev, "failed to put handle %d\n", ret); in devm_ti_sci_release()
3322 * devm_ti_sci_get_handle() - Managed get handle
3323 * @dev: device for which we want SCI handle for.
3328 * and is expected to be maintained by caller of TI SCI protocol library.
3332 const struct ti_sci_handle *devm_ti_sci_get_handle(struct device *dev) in devm_ti_sci_get_handle() argument
3339 return ERR_PTR(-ENOMEM); in devm_ti_sci_get_handle()
3340 handle = ti_sci_get_handle(dev); in devm_ti_sci_get_handle()
3344 devres_add(dev, ptr); in devm_ti_sci_get_handle()
3354 * ti_sci_get_by_phandle() - Get the TI SCI handle using DT phandle
3359 * and is expected to be maintained by caller of TI SCI protocol library.
3362 * -EPROBE_DEFER if the instance is not ready
3363 * -ENODEV if the required node handler is missing
3364 * -EINVAL if invalid conditions are encountered.
3375 return ERR_PTR(-EINVAL); in ti_sci_get_by_phandle()
3380 return ERR_PTR(-ENODEV); in ti_sci_get_by_phandle()
3384 if (ti_sci_np == info->dev->of_node) { in ti_sci_get_by_phandle()
3385 handle = &info->handle; in ti_sci_get_by_phandle()
3386 info->users++; in ti_sci_get_by_phandle()
3394 return ERR_PTR(-EPROBE_DEFER); in ti_sci_get_by_phandle()
3401 * devm_ti_sci_get_by_phandle() - Managed get handle using phandle
3402 * @dev: Device pointer requesting TISCI handle
3408 * and is expected to be maintained by caller of TI SCI protocol library.
3412 const struct ti_sci_handle *devm_ti_sci_get_by_phandle(struct device *dev, in devm_ti_sci_get_by_phandle() argument
3420 return ERR_PTR(-ENOMEM); in devm_ti_sci_get_by_phandle()
3421 handle = ti_sci_get_by_phandle(dev_of_node(dev), property); in devm_ti_sci_get_by_phandle()
3425 devres_add(dev, ptr); in devm_ti_sci_get_by_phandle()
3435 * ti_sci_get_free_resource() - Get a free resource from TISCI resource.
3445 raw_spin_lock_irqsave(&res->lock, flags); in ti_sci_get_free_resource()
3446 for (set = 0; set < res->sets; set++) { in ti_sci_get_free_resource()
3447 struct ti_sci_resource_desc *desc = &res->desc[set]; in ti_sci_get_free_resource()
3448 int res_count = desc->num + desc->num_sec; in ti_sci_get_free_resource()
3450 free_bit = find_first_zero_bit(desc->res_map, res_count); in ti_sci_get_free_resource()
3452 __set_bit(free_bit, desc->res_map); in ti_sci_get_free_resource()
3453 raw_spin_unlock_irqrestore(&res->lock, flags); in ti_sci_get_free_resource()
3455 if (desc->num && free_bit < desc->num) in ti_sci_get_free_resource()
3456 return desc->start + free_bit; in ti_sci_get_free_resource()
3458 return desc->start_sec + free_bit; in ti_sci_get_free_resource()
3461 raw_spin_unlock_irqrestore(&res->lock, flags); in ti_sci_get_free_resource()
3468 * ti_sci_release_resource() - Release a resource from TISCI resource.
3470 * @id: Resource id to be released.
3472 void ti_sci_release_resource(struct ti_sci_resource *res, u16 id) in ti_sci_release_resource() argument
3477 raw_spin_lock_irqsave(&res->lock, flags); in ti_sci_release_resource()
3478 for (set = 0; set < res->sets; set++) { in ti_sci_release_resource()
3479 struct ti_sci_resource_desc *desc = &res->desc[set]; in ti_sci_release_resource()
3481 if (desc->num && desc->start <= id && in ti_sci_release_resource()
3482 (desc->start + desc->num) > id) in ti_sci_release_resource()
3483 __clear_bit(id - desc->start, desc->res_map); in ti_sci_release_resource()
3484 else if (desc->num_sec && desc->start_sec <= id && in ti_sci_release_resource()
3485 (desc->start_sec + desc->num_sec) > id) in ti_sci_release_resource()
3486 __clear_bit(id - desc->start_sec, desc->res_map); in ti_sci_release_resource()
3488 raw_spin_unlock_irqrestore(&res->lock, flags); in ti_sci_release_resource()
3493 * ti_sci_get_num_resources() - Get the number of resources in TISCI resource
3502 for (set = 0; set < res->sets; set++) in ti_sci_get_num_resources()
3503 count += res->desc[set].num + res->desc[set].num_sec; in ti_sci_get_num_resources()
3510 * devm_ti_sci_get_resource_sets() - Get a TISCI resources assigned to a device
3512 * @dev: Device pointer to which the resource is assigned
3513 * @dev_id: TISCI device id to which the resource is assigned
3522 struct device *dev, u32 dev_id, u32 *sub_types, in devm_ti_sci_get_resource_sets() argument
3529 res = devm_kzalloc(dev, sizeof(*res), GFP_KERNEL); in devm_ti_sci_get_resource_sets()
3531 return ERR_PTR(-ENOMEM); in devm_ti_sci_get_resource_sets()
3533 res->sets = sets; in devm_ti_sci_get_resource_sets()
3534 res->desc = devm_kcalloc(dev, res->sets, sizeof(*res->desc), in devm_ti_sci_get_resource_sets()
3536 if (!res->desc) in devm_ti_sci_get_resource_sets()
3537 return ERR_PTR(-ENOMEM); in devm_ti_sci_get_resource_sets()
3539 for (i = 0; i < res->sets; i++) { in devm_ti_sci_get_resource_sets()
3540 ret = handle->ops.rm_core_ops.get_range(handle, dev_id, in devm_ti_sci_get_resource_sets()
3542 &res->desc[i]); in devm_ti_sci_get_resource_sets()
3544 dev_dbg(dev, "dev = %d subtype %d not allocated for this host\n", in devm_ti_sci_get_resource_sets()
3546 memset(&res->desc[i], 0, sizeof(res->desc[i])); in devm_ti_sci_get_resource_sets()
3550 dev_dbg(dev, "dev/sub_type: %d/%d, start/num: %d/%d | %d/%d\n", in devm_ti_sci_get_resource_sets()
3551 dev_id, sub_types[i], res->desc[i].start, in devm_ti_sci_get_resource_sets()
3552 res->desc[i].num, res->desc[i].start_sec, in devm_ti_sci_get_resource_sets()
3553 res->desc[i].num_sec); in devm_ti_sci_get_resource_sets()
3556 res_count = res->desc[i].num + res->desc[i].num_sec; in devm_ti_sci_get_resource_sets()
3557 res->desc[i].res_map = devm_bitmap_zalloc(dev, res_count, in devm_ti_sci_get_resource_sets()
3559 if (!res->desc[i].res_map) in devm_ti_sci_get_resource_sets()
3560 return ERR_PTR(-ENOMEM); in devm_ti_sci_get_resource_sets()
3562 raw_spin_lock_init(&res->lock); in devm_ti_sci_get_resource_sets()
3567 return ERR_PTR(-EINVAL); in devm_ti_sci_get_resource_sets()
3571 * devm_ti_sci_get_of_resource() - Get a TISCI resource assigned to a device
3573 * @dev: Device pointer to which the resource is assigned
3574 * @dev_id: TISCI device id to which the resource is assigned
3582 struct device *dev, u32 dev_id, char *of_prop) in devm_ti_sci_get_of_resource() argument
3588 sets = of_property_count_elems_of_size(dev_of_node(dev), of_prop, in devm_ti_sci_get_of_resource()
3591 dev_err(dev, "%s resource type ids not available\n", of_prop); in devm_ti_sci_get_of_resource()
3597 return ERR_PTR(-ENOMEM); in devm_ti_sci_get_of_resource()
3599 of_property_read_u32_array(dev_of_node(dev), of_prop, sub_types, sets); in devm_ti_sci_get_of_resource()
3600 res = devm_ti_sci_get_resource_sets(handle, dev, dev_id, sub_types, in devm_ti_sci_get_of_resource()
3609 * devm_ti_sci_get_resource() - Get a resource range assigned to the device
3611 * @dev: Device pointer to which the resource is assigned
3612 * @dev_id: TISCI device id to which the resource is assigned
3619 devm_ti_sci_get_resource(const struct ti_sci_handle *handle, struct device *dev, in devm_ti_sci_get_resource() argument
3622 return devm_ti_sci_get_resource_sets(handle, dev, dev_id, &sub_type, 1); in devm_ti_sci_get_resource()
3628 struct ti_sci_info *info = data->cb_data; in tisci_reboot_handler()
3629 const struct ti_sci_handle *handle = &info->handle; in tisci_reboot_handler()
3645 if (info->fw_caps & MSG_FLAG_CAPS_LPM_DM_MANAGED) { in ti_sci_prepare_system_suspend()
3650 return ti_sci_cmd_prepare_sleep(&info->handle, in ti_sci_prepare_system_suspend()
3655 dev_err(info->dev, "Suspend to memory is not supported by the firmware\n"); in ti_sci_prepare_system_suspend()
3656 return -EOPNOTSUPP; in ti_sci_prepare_system_suspend()
3668 static int __maybe_unused ti_sci_suspend(struct device *dev) in ti_sci_suspend() argument
3670 struct ti_sci_info *info = dev_get_drvdata(dev); in ti_sci_suspend()
3675 if (info->fw_caps & MSG_FLAG_CAPS_LPM_DM_MANAGED) { in ti_sci_suspend()
3686 ret = ti_sci_cmd_set_latency_constraint(&info->handle, in ti_sci_suspend()
3700 static int __maybe_unused ti_sci_suspend_noirq(struct device *dev) in ti_sci_suspend_noirq() argument
3702 struct ti_sci_info *info = dev_get_drvdata(dev); in ti_sci_suspend_noirq()
3705 ret = ti_sci_cmd_set_io_isolation(&info->handle, TISCI_MSG_VALUE_IO_ENABLE); in ti_sci_suspend_noirq()
3712 static int __maybe_unused ti_sci_resume_noirq(struct device *dev) in ti_sci_resume_noirq() argument
3714 struct ti_sci_info *info = dev_get_drvdata(dev); in ti_sci_resume_noirq()
3721 ret = ti_sci_cmd_set_io_isolation(&info->handle, TISCI_MSG_VALUE_IO_DISABLE); in ti_sci_resume_noirq()
3725 ret = ti_sci_msg_cmd_lpm_wake_reason(&info->handle, &source, &time, &pin, &mode); in ti_sci_resume_noirq()
3728 dev_info(dev, "ti_sci: wakeup source:0x%x, pin:0x%x, mode:0x%x\n", in ti_sci_resume_noirq()
3763 {.compatible = "ti,k2g-sci", .data = &ti_sci_pmmc_k2g_desc},
3764 {.compatible = "ti,am654-sci", .data = &ti_sci_pmmc_am654_desc},
3771 struct device *dev = &pdev->dev; in ti_sci_probe() local
3777 int ret = -EINVAL; in ti_sci_probe()
3781 desc = device_get_match_data(dev); in ti_sci_probe()
3783 info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL); in ti_sci_probe()
3785 return -ENOMEM; in ti_sci_probe()
3787 info->dev = dev; in ti_sci_probe()
3788 info->desc = desc; in ti_sci_probe()
3789 ret = of_property_read_u32(dev->of_node, "ti,host-id", &h_id); in ti_sci_probe()
3792 info->host_id = info->desc->default_host_id; in ti_sci_probe()
3795 dev_warn(dev, "Host ID 0 is reserved for firmware\n"); in ti_sci_probe()
3796 info->host_id = info->desc->default_host_id; in ti_sci_probe()
3798 info->host_id = h_id; in ti_sci_probe()
3802 INIT_LIST_HEAD(&info->node); in ti_sci_probe()
3803 minfo = &info->minfo; in ti_sci_probe()
3806 * Pre-allocate messages in ti_sci_probe()
3810 if (WARN_ON(desc->max_msgs >= in ti_sci_probe()
3811 1 << 8 * sizeof(((struct ti_sci_msg_hdr *)0)->seq))) in ti_sci_probe()
3812 return -EINVAL; in ti_sci_probe()
3814 minfo->xfer_block = devm_kcalloc(dev, in ti_sci_probe()
3815 desc->max_msgs, in ti_sci_probe()
3816 sizeof(*minfo->xfer_block), in ti_sci_probe()
3818 if (!minfo->xfer_block) in ti_sci_probe()
3819 return -ENOMEM; in ti_sci_probe()
3821 minfo->xfer_alloc_table = devm_bitmap_zalloc(dev, in ti_sci_probe()
3822 desc->max_msgs, in ti_sci_probe()
3824 if (!minfo->xfer_alloc_table) in ti_sci_probe()
3825 return -ENOMEM; in ti_sci_probe()
3827 /* Pre-initialize the buffer pointer to pre-allocated buffers */ in ti_sci_probe()
3828 for (i = 0, xfer = minfo->xfer_block; i < desc->max_msgs; i++, xfer++) { in ti_sci_probe()
3829 xfer->xfer_buf = devm_kcalloc(dev, 1, desc->max_msg_size, in ti_sci_probe()
3831 if (!xfer->xfer_buf) in ti_sci_probe()
3832 return -ENOMEM; in ti_sci_probe()
3834 xfer->tx_message.buf = xfer->xfer_buf; in ti_sci_probe()
3835 init_completion(&xfer->done); in ti_sci_probe()
3840 dev_warn(dev, "Failed to create debug file\n"); in ti_sci_probe()
3844 cl = &info->cl; in ti_sci_probe()
3845 cl->dev = dev; in ti_sci_probe()
3846 cl->tx_block = false; in ti_sci_probe()
3847 cl->rx_callback = ti_sci_rx_callback; in ti_sci_probe()
3848 cl->knows_txdone = true; in ti_sci_probe()
3850 spin_lock_init(&minfo->xfer_lock); in ti_sci_probe()
3851 sema_init(&minfo->sem_xfer_count, desc->max_msgs); in ti_sci_probe()
3853 info->chan_rx = mbox_request_channel_byname(cl, "rx"); in ti_sci_probe()
3854 if (IS_ERR(info->chan_rx)) { in ti_sci_probe()
3855 ret = PTR_ERR(info->chan_rx); in ti_sci_probe()
3859 info->chan_tx = mbox_request_channel_byname(cl, "tx"); in ti_sci_probe()
3860 if (IS_ERR(info->chan_tx)) { in ti_sci_probe()
3861 ret = PTR_ERR(info->chan_tx); in ti_sci_probe()
3866 dev_err(dev, "Unable to communicate with TISCI(%d)\n", ret); in ti_sci_probe()
3870 ti_sci_msg_cmd_query_fw_caps(&info->handle, &info->fw_caps); in ti_sci_probe()
3871 dev_dbg(dev, "Detected firmware capabilities: %s%s%s\n", in ti_sci_probe()
3872 info->fw_caps & MSG_FLAG_CAPS_GENERIC ? "Generic" : "", in ti_sci_probe()
3873 info->fw_caps & MSG_FLAG_CAPS_LPM_PARTIAL_IO ? " Partial-IO" : "", in ti_sci_probe()
3874 info->fw_caps & MSG_FLAG_CAPS_LPM_DM_MANAGED ? " DM-Managed" : "" in ti_sci_probe()
3879 ret = devm_register_restart_handler(dev, tisci_reboot_handler, info); in ti_sci_probe()
3881 dev_err(dev, "reboot registration fail(%d)\n", ret); in ti_sci_probe()
3885 dev_info(dev, "ABI: %d.%d (firmware rev 0x%04x '%s')\n", in ti_sci_probe()
3886 info->handle.version.abi_major, info->handle.version.abi_minor, in ti_sci_probe()
3887 info->handle.version.firmware_revision, in ti_sci_probe()
3888 info->handle.version.firmware_description); in ti_sci_probe()
3891 list_add_tail(&info->node, &ti_sci_list); in ti_sci_probe()
3894 return of_platform_populate(dev->of_node, NULL, NULL, dev); in ti_sci_probe()
3896 if (!IS_ERR(info->chan_tx)) in ti_sci_probe()
3897 mbox_free_channel(info->chan_tx); in ti_sci_probe()
3898 if (!IS_ERR(info->chan_rx)) in ti_sci_probe()
3899 mbox_free_channel(info->chan_rx); in ti_sci_probe()
3900 debugfs_remove(info->d); in ti_sci_probe()
3907 .name = "ti-sci",
3916 MODULE_DESCRIPTION("TI System Control Interface(SCI) driver");
3918 MODULE_ALIAS("platform:ti-sci");