Lines Matching +full:device +full:- +full:handle

1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2015-2022 Texas Instruments Incorporated - https://www.ti.com/
25 #include <linux/soc/ti/ti-msgmgr.h>
37 * struct ti_sci_xfer - Structure representing a message flow
41 * Since we work with request-ACK protocol, we can
54 * struct ti_sci_xfers_info - Structure to manage transfer information
72 * struct ti_sci_desc - Description of SoC integration
87 * struct ti_sci_info - Structure representing a TI SCI instance
88 * @dev: Device pointer
94 * @handle: Instance of TI SCI handle to send to clients.
104 struct device *dev;
110 struct ti_sci_handle handle; member
122 #define handle_to_ti_sci_info(h) container_of(h, struct ti_sci_info, handle)
127 * ti_sci_debug_show() - Helper to dump the debug log
135 struct ti_sci_info *info = s->private; in ti_sci_debug_show()
137 memcpy_fromio(info->debug_buffer, info->debug_region, in ti_sci_debug_show()
138 info->debug_region_size); in ti_sci_debug_show()
143 * in the buffer as is - we expect the messages to be self explanatory. in ti_sci_debug_show()
145 seq_puts(s, info->debug_buffer); in ti_sci_debug_show()
153 * ti_sci_debugfs_create() - Create log debug file
154 * @pdev: platform device pointer
162 struct device *dev = &pdev->dev; in ti_sci_debugfs_create()
169 info->debug_region = devm_ioremap_resource(dev, res); in ti_sci_debugfs_create()
170 if (IS_ERR(info->debug_region)) in ti_sci_debugfs_create()
172 info->debug_region_size = resource_size(res); in ti_sci_debugfs_create()
174 info->debug_buffer = devm_kcalloc(dev, info->debug_region_size + 1, in ti_sci_debugfs_create()
176 if (!info->debug_buffer) in ti_sci_debugfs_create()
177 return -ENOMEM; in ti_sci_debugfs_create()
179 info->debug_buffer[info->debug_region_size] = 0; in ti_sci_debugfs_create()
183 info->d = debugfs_create_file(debug_name, 0444, NULL, info, in ti_sci_debugfs_create()
185 if (IS_ERR(info->d)) in ti_sci_debugfs_create()
186 return PTR_ERR(info->d); in ti_sci_debugfs_create()
189 info->debug_region, info->debug_region_size, res); in ti_sci_debugfs_create()
207 * ti_sci_dump_header_dbg() - Helper to dump a message header.
208 * @dev: Device pointer corresponding to the SCI entity
211 static inline void ti_sci_dump_header_dbg(struct device *dev, in ti_sci_dump_header_dbg()
215 hdr->type, hdr->host, hdr->seq, hdr->flags); in ti_sci_dump_header_dbg()
219 * ti_sci_rx_callback() - mailbox client callback for receive messages
232 struct device *dev = info->dev; in ti_sci_rx_callback()
233 struct ti_sci_xfers_info *minfo = &info->minfo; in ti_sci_rx_callback()
235 struct ti_sci_msg_hdr *hdr = (struct ti_sci_msg_hdr *)mbox_msg->buf; in ti_sci_rx_callback()
239 xfer_id = hdr->seq; in ti_sci_rx_callback()
245 if (!test_bit(xfer_id, minfo->xfer_alloc_table)) { in ti_sci_rx_callback()
250 xfer = &minfo->xfer_block[xfer_id]; in ti_sci_rx_callback()
253 if (mbox_msg->len > info->desc->max_msg_size) { in ti_sci_rx_callback()
254 dev_err(dev, "Unable to handle %zu xfer(max %d)\n", in ti_sci_rx_callback()
255 mbox_msg->len, info->desc->max_msg_size); in ti_sci_rx_callback()
259 if (mbox_msg->len < xfer->rx_len) { in ti_sci_rx_callback()
261 mbox_msg->len, xfer->rx_len); in ti_sci_rx_callback()
268 memcpy(xfer->xfer_buf, mbox_msg->buf, xfer->rx_len); in ti_sci_rx_callback()
269 complete(&xfer->done); in ti_sci_rx_callback()
273 * ti_sci_get_one_xfer() - Allocate one message
294 struct ti_sci_xfers_info *minfo = &info->minfo; in ti_sci_get_one_xfer()
304 if (rx_message_size > info->desc->max_msg_size || in ti_sci_get_one_xfer()
305 tx_message_size > info->desc->max_msg_size || in ti_sci_get_one_xfer()
307 return ERR_PTR(-ERANGE); in ti_sci_get_one_xfer()
314 timeout = msecs_to_jiffies(info->desc->max_rx_timeout_ms) * 5; in ti_sci_get_one_xfer()
315 ret = down_timeout(&minfo->sem_xfer_count, timeout); in ti_sci_get_one_xfer()
320 spin_lock_irqsave(&minfo->xfer_lock, flags); in ti_sci_get_one_xfer()
321 bit_pos = find_first_zero_bit(minfo->xfer_alloc_table, in ti_sci_get_one_xfer()
322 info->desc->max_msgs); in ti_sci_get_one_xfer()
323 set_bit(bit_pos, minfo->xfer_alloc_table); in ti_sci_get_one_xfer()
324 spin_unlock_irqrestore(&minfo->xfer_lock, flags); in ti_sci_get_one_xfer()
328 * fit in hdr.seq - NOTE: this improves access latencies in ti_sci_get_one_xfer()
335 xfer = &minfo->xfer_block[xfer_id]; in ti_sci_get_one_xfer()
337 hdr = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_get_one_xfer()
338 xfer->tx_message.len = tx_message_size; in ti_sci_get_one_xfer()
339 xfer->tx_message.chan_rx = info->chan_rx; in ti_sci_get_one_xfer()
340 xfer->tx_message.timeout_rx_ms = info->desc->max_rx_timeout_ms; in ti_sci_get_one_xfer()
341 xfer->rx_len = (u8)rx_message_size; in ti_sci_get_one_xfer()
343 reinit_completion(&xfer->done); in ti_sci_get_one_xfer()
345 hdr->seq = xfer_id; in ti_sci_get_one_xfer()
346 hdr->type = msg_type; in ti_sci_get_one_xfer()
347 hdr->host = info->host_id; in ti_sci_get_one_xfer()
348 hdr->flags = msg_flags; in ti_sci_get_one_xfer()
354 * ti_sci_put_one_xfer() - Release a message
367 hdr = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_put_one_xfer()
368 xfer_id = hdr->seq; in ti_sci_put_one_xfer()
375 spin_lock_irqsave(&minfo->xfer_lock, flags); in ti_sci_put_one_xfer()
376 clear_bit(xfer_id, minfo->xfer_alloc_table); in ti_sci_put_one_xfer()
377 spin_unlock_irqrestore(&minfo->xfer_lock, flags); in ti_sci_put_one_xfer()
380 up(&minfo->sem_xfer_count); in ti_sci_put_one_xfer()
384 * ti_sci_do_xfer() - Do one transfer
388 * Return: -ETIMEDOUT in case of no response, if transmit error,
397 struct device *dev = info->dev; in ti_sci_do_xfer()
400 ret = mbox_send_message(info->chan_tx, &xfer->tx_message); in ti_sci_do_xfer()
408 timeout = msecs_to_jiffies(info->desc->max_rx_timeout_ms); in ti_sci_do_xfer()
409 if (!wait_for_completion_timeout(&xfer->done, timeout)) in ti_sci_do_xfer()
410 ret = -ETIMEDOUT; in ti_sci_do_xfer()
418 info->desc->max_rx_timeout_ms * 1000, in ti_sci_do_xfer()
419 false, &xfer->done); in ti_sci_do_xfer()
422 if (ret == -ETIMEDOUT) in ti_sci_do_xfer()
432 mbox_client_txdone(info->chan_tx, ret); in ti_sci_do_xfer()
438 * ti_sci_cmd_get_revision() - command to get the revision of the SCI entity
447 struct device *dev = info->dev; in ti_sci_cmd_get_revision()
448 struct ti_sci_handle *handle = &info->handle; in ti_sci_cmd_get_revision() local
449 struct ti_sci_version_info *ver = &handle->version; in ti_sci_cmd_get_revision()
464 rev_info = (struct ti_sci_msg_resp_version *)xfer->xfer_buf; in ti_sci_cmd_get_revision()
472 ver->abi_major = rev_info->abi_major; in ti_sci_cmd_get_revision()
473 ver->abi_minor = rev_info->abi_minor; in ti_sci_cmd_get_revision()
474 ver->firmware_revision = rev_info->firmware_revision; in ti_sci_cmd_get_revision()
475 strscpy(ver->firmware_description, rev_info->firmware_description, in ti_sci_cmd_get_revision()
476 sizeof(ver->firmware_description)); in ti_sci_cmd_get_revision()
479 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_get_revision()
484 * ti_sci_is_response_ack() - Generic ACK/NACK message checkup
493 return hdr->flags & TI_SCI_FLAG_RESP_GENERIC_ACK ? true : false; in ti_sci_is_response_ack()
497 * ti_sci_set_device_state() - Set device state helper
498 * @handle: pointer to TI SCI handle
499 * @id: Device identifier
500 * @flags: flags to setup for the device
501 * @state: State to move the device to
505 static int ti_sci_set_device_state(const struct ti_sci_handle *handle, in ti_sci_set_device_state() argument
512 struct device *dev; in ti_sci_set_device_state()
515 if (IS_ERR(handle)) in ti_sci_set_device_state()
516 return PTR_ERR(handle); in ti_sci_set_device_state()
517 if (!handle) in ti_sci_set_device_state()
518 return -EINVAL; in ti_sci_set_device_state()
520 info = handle_to_ti_sci_info(handle); in ti_sci_set_device_state()
521 dev = info->dev; in ti_sci_set_device_state()
531 req = (struct ti_sci_msg_req_set_device_state *)xfer->xfer_buf; in ti_sci_set_device_state()
532 req->id = id; in ti_sci_set_device_state()
533 req->state = state; in ti_sci_set_device_state()
541 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_set_device_state()
543 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_set_device_state()
546 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_set_device_state()
552 * ti_sci_get_device_state() - Get device state helper
553 * @handle: Handle to the device
554 * @id: Device Identifier
562 static int ti_sci_get_device_state(const struct ti_sci_handle *handle, in ti_sci_get_device_state() argument
570 struct device *dev; in ti_sci_get_device_state()
573 if (IS_ERR(handle)) in ti_sci_get_device_state()
574 return PTR_ERR(handle); in ti_sci_get_device_state()
575 if (!handle) in ti_sci_get_device_state()
576 return -EINVAL; in ti_sci_get_device_state()
579 return -EINVAL; in ti_sci_get_device_state()
581 info = handle_to_ti_sci_info(handle); in ti_sci_get_device_state()
582 dev = info->dev; in ti_sci_get_device_state()
592 req = (struct ti_sci_msg_req_get_device_state *)xfer->xfer_buf; in ti_sci_get_device_state()
593 req->id = id; in ti_sci_get_device_state()
601 resp = (struct ti_sci_msg_resp_get_device_state *)xfer->xfer_buf; in ti_sci_get_device_state()
603 ret = -ENODEV; in ti_sci_get_device_state()
608 *clcnt = resp->context_loss_count; in ti_sci_get_device_state()
610 *resets = resp->resets; in ti_sci_get_device_state()
612 *p_state = resp->programmed_state; in ti_sci_get_device_state()
614 *c_state = resp->current_state; in ti_sci_get_device_state()
616 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_get_device_state()
622 * ti_sci_cmd_get_device() - command to request for device managed by TISCI
624 * @handle: Pointer to TISCI handle as retrieved by *ti_sci_get_handle
625 * @id: Device Identifier
627 * Request for the device - NOTE: the client MUST maintain integrity of
633 static int ti_sci_cmd_get_device(const struct ti_sci_handle *handle, u32 id) in ti_sci_cmd_get_device() argument
635 return ti_sci_set_device_state(handle, id, 0, in ti_sci_cmd_get_device()
640 * ti_sci_cmd_get_device_exclusive() - command to request for device managed by
643 * @handle: Pointer to TISCI handle as retrieved by *ti_sci_get_handle
644 * @id: Device Identifier
646 * Request for the device - NOTE: the client MUST maintain integrity of
652 static int ti_sci_cmd_get_device_exclusive(const struct ti_sci_handle *handle, in ti_sci_cmd_get_device_exclusive() argument
655 return ti_sci_set_device_state(handle, id, in ti_sci_cmd_get_device_exclusive()
661 * ti_sci_cmd_idle_device() - Command to idle a device managed by TISCI
662 * @handle: Pointer to TISCI handle as retrieved by *ti_sci_get_handle
663 * @id: Device Identifier
665 * Request for the device - NOTE: the client MUST maintain integrity of
671 static int ti_sci_cmd_idle_device(const struct ti_sci_handle *handle, u32 id) in ti_sci_cmd_idle_device() argument
673 return ti_sci_set_device_state(handle, id, 0, in ti_sci_cmd_idle_device()
678 * ti_sci_cmd_idle_device_exclusive() - Command to idle a device managed by
681 * @handle: Pointer to TISCI handle as retrieved by *ti_sci_get_handle
682 * @id: Device Identifier
684 * Request for the device - NOTE: the client MUST maintain integrity of
690 static int ti_sci_cmd_idle_device_exclusive(const struct ti_sci_handle *handle, in ti_sci_cmd_idle_device_exclusive() argument
693 return ti_sci_set_device_state(handle, id, in ti_sci_cmd_idle_device_exclusive()
699 * ti_sci_cmd_put_device() - command to release a device managed by TISCI
700 * @handle: Pointer to TISCI handle as retrieved by *ti_sci_get_handle
701 * @id: Device Identifier
703 * Request for the device - NOTE: the client MUST maintain integrity of
709 static int ti_sci_cmd_put_device(const struct ti_sci_handle *handle, u32 id) in ti_sci_cmd_put_device() argument
711 return ti_sci_set_device_state(handle, id, in ti_sci_cmd_put_device()
716 * ti_sci_cmd_dev_is_valid() - Is the device valid
717 * @handle: Pointer to TISCI handle as retrieved by *ti_sci_get_handle
718 * @id: Device Identifier
720 * Return: 0 if all went fine and the device ID is valid, else return
723 static int ti_sci_cmd_dev_is_valid(const struct ti_sci_handle *handle, u32 id) in ti_sci_cmd_dev_is_valid() argument
727 /* check the device state which will also tell us if the ID is valid */ in ti_sci_cmd_dev_is_valid()
728 return ti_sci_get_device_state(handle, id, NULL, NULL, NULL, &unused); in ti_sci_cmd_dev_is_valid()
732 * ti_sci_cmd_dev_get_clcnt() - Get context loss counter
733 * @handle: Pointer to TISCI handle
734 * @id: Device Identifier
739 static int ti_sci_cmd_dev_get_clcnt(const struct ti_sci_handle *handle, u32 id, in ti_sci_cmd_dev_get_clcnt() argument
742 return ti_sci_get_device_state(handle, id, count, NULL, NULL, NULL); in ti_sci_cmd_dev_get_clcnt()
746 * ti_sci_cmd_dev_is_idle() - Check if the device is requested to be idle
747 * @handle: Pointer to TISCI handle
748 * @id: Device Identifier
753 static int ti_sci_cmd_dev_is_idle(const struct ti_sci_handle *handle, u32 id, in ti_sci_cmd_dev_is_idle() argument
760 return -EINVAL; in ti_sci_cmd_dev_is_idle()
762 ret = ti_sci_get_device_state(handle, id, NULL, NULL, &state, NULL); in ti_sci_cmd_dev_is_idle()
772 * ti_sci_cmd_dev_is_stop() - Check if the device is requested to be stopped
773 * @handle: Pointer to TISCI handle
774 * @id: Device Identifier
780 static int ti_sci_cmd_dev_is_stop(const struct ti_sci_handle *handle, u32 id, in ti_sci_cmd_dev_is_stop() argument
787 return -EINVAL; in ti_sci_cmd_dev_is_stop()
790 ti_sci_get_device_state(handle, id, NULL, NULL, &p_state, &c_state); in ti_sci_cmd_dev_is_stop()
803 * ti_sci_cmd_dev_is_on() - Check if the device is requested to be ON
804 * @handle: Pointer to TISCI handle
805 * @id: Device Identifier
811 static int ti_sci_cmd_dev_is_on(const struct ti_sci_handle *handle, u32 id, in ti_sci_cmd_dev_is_on() argument
818 return -EINVAL; in ti_sci_cmd_dev_is_on()
821 ti_sci_get_device_state(handle, id, NULL, NULL, &p_state, &c_state); in ti_sci_cmd_dev_is_on()
834 * ti_sci_cmd_dev_is_trans() - Check if the device is currently transitioning
835 * @handle: Pointer to TISCI handle
836 * @id: Device Identifier
841 static int ti_sci_cmd_dev_is_trans(const struct ti_sci_handle *handle, u32 id, in ti_sci_cmd_dev_is_trans() argument
848 return -EINVAL; in ti_sci_cmd_dev_is_trans()
850 ret = ti_sci_get_device_state(handle, id, NULL, NULL, NULL, &state); in ti_sci_cmd_dev_is_trans()
860 * ti_sci_cmd_set_device_resets() - command to set resets for device managed
862 * @handle: Pointer to TISCI handle as retrieved by *ti_sci_get_handle
863 * @id: Device Identifier
864 * @reset_state: Device specific reset bit field
868 static int ti_sci_cmd_set_device_resets(const struct ti_sci_handle *handle, in ti_sci_cmd_set_device_resets() argument
875 struct device *dev; in ti_sci_cmd_set_device_resets()
878 if (IS_ERR(handle)) in ti_sci_cmd_set_device_resets()
879 return PTR_ERR(handle); in ti_sci_cmd_set_device_resets()
880 if (!handle) in ti_sci_cmd_set_device_resets()
881 return -EINVAL; in ti_sci_cmd_set_device_resets()
883 info = handle_to_ti_sci_info(handle); in ti_sci_cmd_set_device_resets()
884 dev = info->dev; in ti_sci_cmd_set_device_resets()
894 req = (struct ti_sci_msg_req_set_device_resets *)xfer->xfer_buf; in ti_sci_cmd_set_device_resets()
895 req->id = id; in ti_sci_cmd_set_device_resets()
896 req->resets = reset_state; in ti_sci_cmd_set_device_resets()
904 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_set_device_resets()
906 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_cmd_set_device_resets()
909 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_set_device_resets()
915 * ti_sci_cmd_get_device_resets() - Get reset state for device managed
917 * @handle: Pointer to TISCI handle
918 * @id: Device Identifier
923 static int ti_sci_cmd_get_device_resets(const struct ti_sci_handle *handle, in ti_sci_cmd_get_device_resets() argument
926 return ti_sci_get_device_state(handle, id, NULL, reset_state, NULL, in ti_sci_cmd_get_device_resets()
931 * ti_sci_set_clock_state() - Set clock state helper
932 * @handle: pointer to TI SCI handle
933 * @dev_id: Device identifier this request is for
934 * @clk_id: Clock identifier for the device for this request.
935 * Each device has it's own set of clock inputs. This indexes
942 static int ti_sci_set_clock_state(const struct ti_sci_handle *handle, in ti_sci_set_clock_state() argument
950 struct device *dev; in ti_sci_set_clock_state()
953 if (IS_ERR(handle)) in ti_sci_set_clock_state()
954 return PTR_ERR(handle); in ti_sci_set_clock_state()
955 if (!handle) in ti_sci_set_clock_state()
956 return -EINVAL; in ti_sci_set_clock_state()
958 info = handle_to_ti_sci_info(handle); in ti_sci_set_clock_state()
959 dev = info->dev; in ti_sci_set_clock_state()
969 req = (struct ti_sci_msg_req_set_clock_state *)xfer->xfer_buf; in ti_sci_set_clock_state()
970 req->dev_id = dev_id; in ti_sci_set_clock_state()
972 req->clk_id = clk_id; in ti_sci_set_clock_state()
974 req->clk_id = 255; in ti_sci_set_clock_state()
975 req->clk_id_32 = clk_id; in ti_sci_set_clock_state()
977 req->request_state = state; in ti_sci_set_clock_state()
985 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_set_clock_state()
987 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_set_clock_state()
990 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_set_clock_state()
996 * ti_sci_cmd_get_clock_state() - Get clock state helper
997 * @handle: pointer to TI SCI handle
998 * @dev_id: Device identifier this request is for
999 * @clk_id: Clock identifier for the device for this request.
1000 * Each device has it's own set of clock inputs. This indexes
1007 static int ti_sci_cmd_get_clock_state(const struct ti_sci_handle *handle, in ti_sci_cmd_get_clock_state() argument
1015 struct device *dev; in ti_sci_cmd_get_clock_state()
1018 if (IS_ERR(handle)) in ti_sci_cmd_get_clock_state()
1019 return PTR_ERR(handle); in ti_sci_cmd_get_clock_state()
1020 if (!handle) in ti_sci_cmd_get_clock_state()
1021 return -EINVAL; in ti_sci_cmd_get_clock_state()
1024 return -EINVAL; in ti_sci_cmd_get_clock_state()
1026 info = handle_to_ti_sci_info(handle); in ti_sci_cmd_get_clock_state()
1027 dev = info->dev; in ti_sci_cmd_get_clock_state()
1037 req = (struct ti_sci_msg_req_get_clock_state *)xfer->xfer_buf; in ti_sci_cmd_get_clock_state()
1038 req->dev_id = dev_id; in ti_sci_cmd_get_clock_state()
1040 req->clk_id = clk_id; in ti_sci_cmd_get_clock_state()
1042 req->clk_id = 255; in ti_sci_cmd_get_clock_state()
1043 req->clk_id_32 = clk_id; in ti_sci_cmd_get_clock_state()
1052 resp = (struct ti_sci_msg_resp_get_clock_state *)xfer->xfer_buf; in ti_sci_cmd_get_clock_state()
1055 ret = -ENODEV; in ti_sci_cmd_get_clock_state()
1060 *programmed_state = resp->programmed_state; in ti_sci_cmd_get_clock_state()
1062 *current_state = resp->current_state; in ti_sci_cmd_get_clock_state()
1065 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_get_clock_state()
1071 * ti_sci_cmd_get_clock() - Get control of a clock from TI SCI
1072 * @handle: pointer to TI SCI handle
1073 * @dev_id: Device identifier this request is for
1074 * @clk_id: Clock identifier for the device for this request.
1075 * Each device has it's own set of clock inputs. This indexes
1083 static int ti_sci_cmd_get_clock(const struct ti_sci_handle *handle, u32 dev_id, in ti_sci_cmd_get_clock() argument
1093 return ti_sci_set_clock_state(handle, dev_id, clk_id, flags, in ti_sci_cmd_get_clock()
1098 * ti_sci_cmd_idle_clock() - Idle a clock which is in our control
1099 * @handle: pointer to TI SCI handle
1100 * @dev_id: Device identifier this request is for
1101 * @clk_id: Clock identifier for the device for this request.
1102 * Each device has it's own set of clock inputs. This indexes
1109 static int ti_sci_cmd_idle_clock(const struct ti_sci_handle *handle, in ti_sci_cmd_idle_clock() argument
1112 return ti_sci_set_clock_state(handle, dev_id, clk_id, in ti_sci_cmd_idle_clock()
1118 * ti_sci_cmd_put_clock() - Release a clock from our control back to TISCI
1119 * @handle: pointer to TI SCI handle
1120 * @dev_id: Device identifier this request is for
1121 * @clk_id: Clock identifier for the device for this request.
1122 * Each device has it's own set of clock inputs. This indexes
1129 static int ti_sci_cmd_put_clock(const struct ti_sci_handle *handle, in ti_sci_cmd_put_clock() argument
1132 return ti_sci_set_clock_state(handle, dev_id, clk_id, in ti_sci_cmd_put_clock()
1138 * ti_sci_cmd_clk_is_auto() - Is the clock being auto managed
1139 * @handle: pointer to TI SCI handle
1140 * @dev_id: Device identifier this request is for
1141 * @clk_id: Clock identifier for the device for this request.
1142 * Each device has it's own set of clock inputs. This indexes
1148 static int ti_sci_cmd_clk_is_auto(const struct ti_sci_handle *handle, in ti_sci_cmd_clk_is_auto() argument
1155 return -EINVAL; in ti_sci_cmd_clk_is_auto()
1157 ret = ti_sci_cmd_get_clock_state(handle, dev_id, clk_id, &state, NULL); in ti_sci_cmd_clk_is_auto()
1166 * ti_sci_cmd_clk_is_on() - Is the clock ON
1167 * @handle: pointer to TI SCI handle
1168 * @dev_id: Device identifier this request is for
1169 * @clk_id: Clock identifier for the device for this request.
1170 * Each device has it's own set of clock inputs. This indexes
1177 static int ti_sci_cmd_clk_is_on(const struct ti_sci_handle *handle, u32 dev_id, in ti_sci_cmd_clk_is_on() argument
1184 return -EINVAL; in ti_sci_cmd_clk_is_on()
1186 ret = ti_sci_cmd_get_clock_state(handle, dev_id, clk_id, in ti_sci_cmd_clk_is_on()
1199 * ti_sci_cmd_clk_is_off() - Is the clock OFF
1200 * @handle: pointer to TI SCI handle
1201 * @dev_id: Device identifier this request is for
1202 * @clk_id: Clock identifier for the device for this request.
1203 * Each device has it's own set of clock inputs. This indexes
1210 static int ti_sci_cmd_clk_is_off(const struct ti_sci_handle *handle, u32 dev_id, in ti_sci_cmd_clk_is_off() argument
1217 return -EINVAL; in ti_sci_cmd_clk_is_off()
1219 ret = ti_sci_cmd_get_clock_state(handle, dev_id, clk_id, in ti_sci_cmd_clk_is_off()
1232 * ti_sci_cmd_clk_set_parent() - Set the clock source of a specific device clock
1233 * @handle: pointer to TI SCI handle
1234 * @dev_id: Device identifier this request is for
1235 * @clk_id: Clock identifier for the device for this request.
1236 * Each device has it's own set of clock inputs. This indexes
1242 static int ti_sci_cmd_clk_set_parent(const struct ti_sci_handle *handle, in ti_sci_cmd_clk_set_parent() argument
1249 struct device *dev; in ti_sci_cmd_clk_set_parent()
1252 if (IS_ERR(handle)) in ti_sci_cmd_clk_set_parent()
1253 return PTR_ERR(handle); in ti_sci_cmd_clk_set_parent()
1254 if (!handle) in ti_sci_cmd_clk_set_parent()
1255 return -EINVAL; in ti_sci_cmd_clk_set_parent()
1257 info = handle_to_ti_sci_info(handle); in ti_sci_cmd_clk_set_parent()
1258 dev = info->dev; in ti_sci_cmd_clk_set_parent()
1268 req = (struct ti_sci_msg_req_set_clock_parent *)xfer->xfer_buf; in ti_sci_cmd_clk_set_parent()
1269 req->dev_id = dev_id; in ti_sci_cmd_clk_set_parent()
1271 req->clk_id = clk_id; in ti_sci_cmd_clk_set_parent()
1273 req->clk_id = 255; in ti_sci_cmd_clk_set_parent()
1274 req->clk_id_32 = clk_id; in ti_sci_cmd_clk_set_parent()
1277 req->parent_id = parent_id; in ti_sci_cmd_clk_set_parent()
1279 req->parent_id = 255; in ti_sci_cmd_clk_set_parent()
1280 req->parent_id_32 = parent_id; in ti_sci_cmd_clk_set_parent()
1289 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_clk_set_parent()
1291 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_cmd_clk_set_parent()
1294 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_clk_set_parent()
1300 * ti_sci_cmd_clk_get_parent() - Get current parent clock source
1301 * @handle: pointer to TI SCI handle
1302 * @dev_id: Device identifier this request is for
1303 * @clk_id: Clock identifier for the device for this request.
1304 * Each device has it's own set of clock inputs. This indexes
1310 static int ti_sci_cmd_clk_get_parent(const struct ti_sci_handle *handle, in ti_sci_cmd_clk_get_parent() argument
1317 struct device *dev; in ti_sci_cmd_clk_get_parent()
1320 if (IS_ERR(handle)) in ti_sci_cmd_clk_get_parent()
1321 return PTR_ERR(handle); in ti_sci_cmd_clk_get_parent()
1322 if (!handle || !parent_id) in ti_sci_cmd_clk_get_parent()
1323 return -EINVAL; in ti_sci_cmd_clk_get_parent()
1325 info = handle_to_ti_sci_info(handle); in ti_sci_cmd_clk_get_parent()
1326 dev = info->dev; in ti_sci_cmd_clk_get_parent()
1336 req = (struct ti_sci_msg_req_get_clock_parent *)xfer->xfer_buf; in ti_sci_cmd_clk_get_parent()
1337 req->dev_id = dev_id; in ti_sci_cmd_clk_get_parent()
1339 req->clk_id = clk_id; in ti_sci_cmd_clk_get_parent()
1341 req->clk_id = 255; in ti_sci_cmd_clk_get_parent()
1342 req->clk_id_32 = clk_id; in ti_sci_cmd_clk_get_parent()
1351 resp = (struct ti_sci_msg_resp_get_clock_parent *)xfer->xfer_buf; in ti_sci_cmd_clk_get_parent()
1354 ret = -ENODEV; in ti_sci_cmd_clk_get_parent()
1356 if (resp->parent_id < 255) in ti_sci_cmd_clk_get_parent()
1357 *parent_id = resp->parent_id; in ti_sci_cmd_clk_get_parent()
1359 *parent_id = resp->parent_id_32; in ti_sci_cmd_clk_get_parent()
1363 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_clk_get_parent()
1369 * ti_sci_cmd_clk_get_num_parents() - Get num parents of the current clk source
1370 * @handle: pointer to TI SCI handle
1371 * @dev_id: Device identifier this request is for
1372 * @clk_id: Clock identifier for the device for this request.
1373 * Each device has it's own set of clock inputs. This indexes
1379 static int ti_sci_cmd_clk_get_num_parents(const struct ti_sci_handle *handle, in ti_sci_cmd_clk_get_num_parents() argument
1387 struct device *dev; in ti_sci_cmd_clk_get_num_parents()
1390 if (IS_ERR(handle)) in ti_sci_cmd_clk_get_num_parents()
1391 return PTR_ERR(handle); in ti_sci_cmd_clk_get_num_parents()
1392 if (!handle || !num_parents) in ti_sci_cmd_clk_get_num_parents()
1393 return -EINVAL; in ti_sci_cmd_clk_get_num_parents()
1395 info = handle_to_ti_sci_info(handle); in ti_sci_cmd_clk_get_num_parents()
1396 dev = info->dev; in ti_sci_cmd_clk_get_num_parents()
1406 req = (struct ti_sci_msg_req_get_clock_num_parents *)xfer->xfer_buf; in ti_sci_cmd_clk_get_num_parents()
1407 req->dev_id = dev_id; in ti_sci_cmd_clk_get_num_parents()
1409 req->clk_id = clk_id; in ti_sci_cmd_clk_get_num_parents()
1411 req->clk_id = 255; in ti_sci_cmd_clk_get_num_parents()
1412 req->clk_id_32 = clk_id; in ti_sci_cmd_clk_get_num_parents()
1421 resp = (struct ti_sci_msg_resp_get_clock_num_parents *)xfer->xfer_buf; in ti_sci_cmd_clk_get_num_parents()
1424 ret = -ENODEV; in ti_sci_cmd_clk_get_num_parents()
1426 if (resp->num_parents < 255) in ti_sci_cmd_clk_get_num_parents()
1427 *num_parents = resp->num_parents; in ti_sci_cmd_clk_get_num_parents()
1429 *num_parents = resp->num_parents_32; in ti_sci_cmd_clk_get_num_parents()
1433 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_clk_get_num_parents()
1439 * ti_sci_cmd_clk_get_match_freq() - Find a good match for frequency
1440 * @handle: pointer to TI SCI handle
1441 * @dev_id: Device identifier this request is for
1442 * @clk_id: Clock identifier for the device for this request.
1443 * Each device has it's own set of clock inputs. This indexes
1457 static int ti_sci_cmd_clk_get_match_freq(const struct ti_sci_handle *handle, in ti_sci_cmd_clk_get_match_freq() argument
1466 struct device *dev; in ti_sci_cmd_clk_get_match_freq()
1469 if (IS_ERR(handle)) in ti_sci_cmd_clk_get_match_freq()
1470 return PTR_ERR(handle); in ti_sci_cmd_clk_get_match_freq()
1471 if (!handle || !match_freq) in ti_sci_cmd_clk_get_match_freq()
1472 return -EINVAL; in ti_sci_cmd_clk_get_match_freq()
1474 info = handle_to_ti_sci_info(handle); in ti_sci_cmd_clk_get_match_freq()
1475 dev = info->dev; in ti_sci_cmd_clk_get_match_freq()
1485 req = (struct ti_sci_msg_req_query_clock_freq *)xfer->xfer_buf; in ti_sci_cmd_clk_get_match_freq()
1486 req->dev_id = dev_id; in ti_sci_cmd_clk_get_match_freq()
1488 req->clk_id = clk_id; in ti_sci_cmd_clk_get_match_freq()
1490 req->clk_id = 255; in ti_sci_cmd_clk_get_match_freq()
1491 req->clk_id_32 = clk_id; in ti_sci_cmd_clk_get_match_freq()
1493 req->min_freq_hz = min_freq; in ti_sci_cmd_clk_get_match_freq()
1494 req->target_freq_hz = target_freq; in ti_sci_cmd_clk_get_match_freq()
1495 req->max_freq_hz = max_freq; in ti_sci_cmd_clk_get_match_freq()
1503 resp = (struct ti_sci_msg_resp_query_clock_freq *)xfer->xfer_buf; in ti_sci_cmd_clk_get_match_freq()
1506 ret = -ENODEV; in ti_sci_cmd_clk_get_match_freq()
1508 *match_freq = resp->freq_hz; in ti_sci_cmd_clk_get_match_freq()
1511 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_clk_get_match_freq()
1517 * ti_sci_cmd_clk_set_freq() - Set a frequency for clock
1518 * @handle: pointer to TI SCI handle
1519 * @dev_id: Device identifier this request is for
1520 * @clk_id: Clock identifier for the device for this request.
1521 * Each device has it's own set of clock inputs. This indexes
1534 static int ti_sci_cmd_clk_set_freq(const struct ti_sci_handle *handle, in ti_sci_cmd_clk_set_freq() argument
1542 struct device *dev; in ti_sci_cmd_clk_set_freq()
1545 if (IS_ERR(handle)) in ti_sci_cmd_clk_set_freq()
1546 return PTR_ERR(handle); in ti_sci_cmd_clk_set_freq()
1547 if (!handle) in ti_sci_cmd_clk_set_freq()
1548 return -EINVAL; in ti_sci_cmd_clk_set_freq()
1550 info = handle_to_ti_sci_info(handle); in ti_sci_cmd_clk_set_freq()
1551 dev = info->dev; in ti_sci_cmd_clk_set_freq()
1561 req = (struct ti_sci_msg_req_set_clock_freq *)xfer->xfer_buf; in ti_sci_cmd_clk_set_freq()
1562 req->dev_id = dev_id; in ti_sci_cmd_clk_set_freq()
1564 req->clk_id = clk_id; in ti_sci_cmd_clk_set_freq()
1566 req->clk_id = 255; in ti_sci_cmd_clk_set_freq()
1567 req->clk_id_32 = clk_id; in ti_sci_cmd_clk_set_freq()
1569 req->min_freq_hz = min_freq; in ti_sci_cmd_clk_set_freq()
1570 req->target_freq_hz = target_freq; in ti_sci_cmd_clk_set_freq()
1571 req->max_freq_hz = max_freq; in ti_sci_cmd_clk_set_freq()
1579 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_clk_set_freq()
1581 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_cmd_clk_set_freq()
1584 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_clk_set_freq()
1590 * ti_sci_cmd_clk_get_freq() - Get current frequency
1591 * @handle: pointer to TI SCI handle
1592 * @dev_id: Device identifier this request is for
1593 * @clk_id: Clock identifier for the device for this request.
1594 * Each device has it's own set of clock inputs. This indexes
1600 static int ti_sci_cmd_clk_get_freq(const struct ti_sci_handle *handle, in ti_sci_cmd_clk_get_freq() argument
1607 struct device *dev; in ti_sci_cmd_clk_get_freq()
1610 if (IS_ERR(handle)) in ti_sci_cmd_clk_get_freq()
1611 return PTR_ERR(handle); in ti_sci_cmd_clk_get_freq()
1612 if (!handle || !freq) in ti_sci_cmd_clk_get_freq()
1613 return -EINVAL; in ti_sci_cmd_clk_get_freq()
1615 info = handle_to_ti_sci_info(handle); in ti_sci_cmd_clk_get_freq()
1616 dev = info->dev; in ti_sci_cmd_clk_get_freq()
1626 req = (struct ti_sci_msg_req_get_clock_freq *)xfer->xfer_buf; in ti_sci_cmd_clk_get_freq()
1627 req->dev_id = dev_id; in ti_sci_cmd_clk_get_freq()
1629 req->clk_id = clk_id; in ti_sci_cmd_clk_get_freq()
1631 req->clk_id = 255; in ti_sci_cmd_clk_get_freq()
1632 req->clk_id_32 = clk_id; in ti_sci_cmd_clk_get_freq()
1641 resp = (struct ti_sci_msg_resp_get_clock_freq *)xfer->xfer_buf; in ti_sci_cmd_clk_get_freq()
1644 ret = -ENODEV; in ti_sci_cmd_clk_get_freq()
1646 *freq = resp->freq_hz; in ti_sci_cmd_clk_get_freq()
1649 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_clk_get_freq()
1654 static int ti_sci_cmd_core_reboot(const struct ti_sci_handle *handle) in ti_sci_cmd_core_reboot() argument
1660 struct device *dev; in ti_sci_cmd_core_reboot()
1663 if (IS_ERR(handle)) in ti_sci_cmd_core_reboot()
1664 return PTR_ERR(handle); in ti_sci_cmd_core_reboot()
1665 if (!handle) in ti_sci_cmd_core_reboot()
1666 return -EINVAL; in ti_sci_cmd_core_reboot()
1668 info = handle_to_ti_sci_info(handle); in ti_sci_cmd_core_reboot()
1669 dev = info->dev; in ti_sci_cmd_core_reboot()
1679 req = (struct ti_sci_msg_req_reboot *)xfer->xfer_buf; in ti_sci_cmd_core_reboot()
1687 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_core_reboot()
1690 ret = -ENODEV; in ti_sci_cmd_core_reboot()
1695 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_core_reboot()
1701 * ti_sci_get_resource_range - Helper to get a range of resources assigned
1704 * @handle: Pointer to TISCI handle.
1705 * @dev_id: TISCI device ID.
1707 * from the given device.
1714 static int ti_sci_get_resource_range(const struct ti_sci_handle *handle, in ti_sci_get_resource_range() argument
1722 struct device *dev; in ti_sci_get_resource_range()
1725 if (IS_ERR(handle)) in ti_sci_get_resource_range()
1726 return PTR_ERR(handle); in ti_sci_get_resource_range()
1727 if (!handle || !desc) in ti_sci_get_resource_range()
1728 return -EINVAL; in ti_sci_get_resource_range()
1730 info = handle_to_ti_sci_info(handle); in ti_sci_get_resource_range()
1731 dev = info->dev; in ti_sci_get_resource_range()
1742 req = (struct ti_sci_msg_req_get_resource_range *)xfer->xfer_buf; in ti_sci_get_resource_range()
1743 req->secondary_host = s_host; in ti_sci_get_resource_range()
1744 req->type = dev_id & MSG_RM_RESOURCE_TYPE_MASK; in ti_sci_get_resource_range()
1745 req->subtype = subtype & MSG_RM_RESOURCE_SUBTYPE_MASK; in ti_sci_get_resource_range()
1753 resp = (struct ti_sci_msg_resp_get_resource_range *)xfer->xfer_buf; in ti_sci_get_resource_range()
1756 ret = -ENODEV; in ti_sci_get_resource_range()
1757 } else if (!resp->range_num && !resp->range_num_sec) { in ti_sci_get_resource_range()
1759 ret = -ENODEV; in ti_sci_get_resource_range()
1761 desc->start = resp->range_start; in ti_sci_get_resource_range()
1762 desc->num = resp->range_num; in ti_sci_get_resource_range()
1763 desc->start_sec = resp->range_start_sec; in ti_sci_get_resource_range()
1764 desc->num_sec = resp->range_num_sec; in ti_sci_get_resource_range()
1768 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_get_resource_range()
1774 * ti_sci_cmd_get_resource_range - Get a range of resources assigned to host
1776 * @handle: Pointer to TISCI handle.
1777 * @dev_id: TISCI device ID.
1779 * from the given device.
1785 static int ti_sci_cmd_get_resource_range(const struct ti_sci_handle *handle, in ti_sci_cmd_get_resource_range() argument
1789 return ti_sci_get_resource_range(handle, dev_id, subtype, in ti_sci_cmd_get_resource_range()
1795 * ti_sci_cmd_get_resource_range_from_shost - Get a range of resources
1797 * @handle: Pointer to TISCI handle.
1798 * @dev_id: TISCI device ID.
1800 * from the given device.
1808 int ti_sci_cmd_get_resource_range_from_shost(const struct ti_sci_handle *handle, in ti_sci_cmd_get_resource_range_from_shost() argument
1812 return ti_sci_get_resource_range(handle, dev_id, subtype, s_host, desc); in ti_sci_cmd_get_resource_range_from_shost()
1816 * ti_sci_manage_irq() - Helper api to configure/release the irq route between
1818 * @handle: Pointer to TISCI handle.
1820 * @src_id: Device ID of the IRQ source
1821 * @src_index: IRQ source index within the source device
1822 * @dst_id: Device ID of the IRQ destination
1823 * @dst_host_irq: IRQ number of the destination device
1824 * @ia_id: Device ID of the IA, if the IRQ flows through this IA
1834 static int ti_sci_manage_irq(const struct ti_sci_handle *handle, in ti_sci_manage_irq() argument
1844 struct device *dev; in ti_sci_manage_irq()
1847 if (IS_ERR(handle)) in ti_sci_manage_irq()
1848 return PTR_ERR(handle); in ti_sci_manage_irq()
1849 if (!handle) in ti_sci_manage_irq()
1850 return -EINVAL; in ti_sci_manage_irq()
1852 info = handle_to_ti_sci_info(handle); in ti_sci_manage_irq()
1853 dev = info->dev; in ti_sci_manage_irq()
1862 req = (struct ti_sci_msg_req_manage_irq *)xfer->xfer_buf; in ti_sci_manage_irq()
1863 req->valid_params = valid_params; in ti_sci_manage_irq()
1864 req->src_id = src_id; in ti_sci_manage_irq()
1865 req->src_index = src_index; in ti_sci_manage_irq()
1866 req->dst_id = dst_id; in ti_sci_manage_irq()
1867 req->dst_host_irq = dst_host_irq; in ti_sci_manage_irq()
1868 req->ia_id = ia_id; in ti_sci_manage_irq()
1869 req->vint = vint; in ti_sci_manage_irq()
1870 req->global_event = global_event; in ti_sci_manage_irq()
1871 req->vint_status_bit = vint_status_bit; in ti_sci_manage_irq()
1872 req->secondary_host = s_host; in ti_sci_manage_irq()
1880 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_manage_irq()
1882 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_manage_irq()
1885 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_manage_irq()
1891 * ti_sci_set_irq() - Helper api to configure the irq route between the
1893 * @handle: Pointer to TISCI handle.
1895 * @src_id: Device ID of the IRQ source
1896 * @src_index: IRQ source index within the source device
1897 * @dst_id: Device ID of the IRQ destination
1898 * @dst_host_irq: IRQ number of the destination device
1899 * @ia_id: Device ID of the IA, if the IRQ flows through this IA
1908 static int ti_sci_set_irq(const struct ti_sci_handle *handle, u32 valid_params, in ti_sci_set_irq() argument
1918 return ti_sci_manage_irq(handle, valid_params, src_id, src_index, in ti_sci_set_irq()
1925 * ti_sci_free_irq() - Helper api to free the irq route between the
1927 * @handle: Pointer to TISCI handle.
1929 * @src_id: Device ID of the IRQ source
1930 * @src_index: IRQ source index within the source device
1931 * @dst_id: Device ID of the IRQ destination
1932 * @dst_host_irq: IRQ number of the destination device
1933 * @ia_id: Device ID of the IA, if the IRQ flows through this IA
1942 static int ti_sci_free_irq(const struct ti_sci_handle *handle, u32 valid_params, in ti_sci_free_irq() argument
1952 return ti_sci_manage_irq(handle, valid_params, src_id, src_index, in ti_sci_free_irq()
1959 * ti_sci_cmd_set_irq() - Configure a host irq route between the requested
1961 * @handle: Pointer to TISCI handle.
1962 * @src_id: Device ID of the IRQ source
1963 * @src_index: IRQ source index within the source device
1964 * @dst_id: Device ID of the IRQ destination
1965 * @dst_host_irq: IRQ number of the destination device
1969 static int ti_sci_cmd_set_irq(const struct ti_sci_handle *handle, u16 src_id, in ti_sci_cmd_set_irq() argument
1974 return ti_sci_set_irq(handle, valid_params, src_id, src_index, dst_id, in ti_sci_cmd_set_irq()
1979 * ti_sci_cmd_set_event_map() - Configure an event based irq route between the
1981 * @handle: Pointer to TISCI handle.
1982 * @src_id: Device ID of the IRQ source
1983 * @src_index: IRQ source index within the source device
1984 * @ia_id: Device ID of the IA, if the IRQ flows through this IA
1991 static int ti_sci_cmd_set_event_map(const struct ti_sci_handle *handle, in ti_sci_cmd_set_event_map() argument
2000 return ti_sci_set_irq(handle, valid_params, src_id, src_index, 0, 0, in ti_sci_cmd_set_event_map()
2005 * ti_sci_cmd_free_irq() - Free a host irq route between the between the
2007 * @handle: Pointer to TISCI handle.
2008 * @src_id: Device ID of the IRQ source
2009 * @src_index: IRQ source index within the source device
2010 * @dst_id: Device ID of the IRQ destination
2011 * @dst_host_irq: IRQ number of the destination device
2015 static int ti_sci_cmd_free_irq(const struct ti_sci_handle *handle, u16 src_id, in ti_sci_cmd_free_irq() argument
2020 return ti_sci_free_irq(handle, valid_params, src_id, src_index, dst_id, in ti_sci_cmd_free_irq()
2025 * ti_sci_cmd_free_event_map() - Free an event map between the requested source
2027 * @handle: Pointer to TISCI handle.
2028 * @src_id: Device ID of the IRQ source
2029 * @src_index: IRQ source index within the source device
2030 * @ia_id: Device ID of the IA, if the IRQ flows through this IA
2037 static int ti_sci_cmd_free_event_map(const struct ti_sci_handle *handle, in ti_sci_cmd_free_event_map() argument
2046 return ti_sci_free_irq(handle, valid_params, src_id, src_index, 0, 0, in ti_sci_cmd_free_event_map()
2051 * ti_sci_cmd_rm_ring_cfg() - Configure a NAVSS ring
2052 * @handle: Pointer to TI SCI handle.
2060 static int ti_sci_cmd_rm_ring_cfg(const struct ti_sci_handle *handle, in ti_sci_cmd_rm_ring_cfg() argument
2067 struct device *dev; in ti_sci_cmd_rm_ring_cfg()
2070 if (IS_ERR_OR_NULL(handle)) in ti_sci_cmd_rm_ring_cfg()
2071 return -EINVAL; in ti_sci_cmd_rm_ring_cfg()
2073 info = handle_to_ti_sci_info(handle); in ti_sci_cmd_rm_ring_cfg()
2074 dev = info->dev; in ti_sci_cmd_rm_ring_cfg()
2084 req = (struct ti_sci_msg_rm_ring_cfg_req *)xfer->xfer_buf; in ti_sci_cmd_rm_ring_cfg()
2085 req->valid_params = params->valid_params; in ti_sci_cmd_rm_ring_cfg()
2086 req->nav_id = params->nav_id; in ti_sci_cmd_rm_ring_cfg()
2087 req->index = params->index; in ti_sci_cmd_rm_ring_cfg()
2088 req->addr_lo = params->addr_lo; in ti_sci_cmd_rm_ring_cfg()
2089 req->addr_hi = params->addr_hi; in ti_sci_cmd_rm_ring_cfg()
2090 req->count = params->count; in ti_sci_cmd_rm_ring_cfg()
2091 req->mode = params->mode; in ti_sci_cmd_rm_ring_cfg()
2092 req->size = params->size; in ti_sci_cmd_rm_ring_cfg()
2093 req->order_id = params->order_id; in ti_sci_cmd_rm_ring_cfg()
2094 req->virtid = params->virtid; in ti_sci_cmd_rm_ring_cfg()
2095 req->asel = params->asel; in ti_sci_cmd_rm_ring_cfg()
2103 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_rm_ring_cfg()
2104 ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL; in ti_sci_cmd_rm_ring_cfg()
2107 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_rm_ring_cfg()
2108 dev_dbg(dev, "RM_RA:config ring %u ret:%d\n", params->index, ret); in ti_sci_cmd_rm_ring_cfg()
2113 * ti_sci_cmd_rm_psil_pair() - Pair PSI-L source to destination thread
2114 * @handle: Pointer to TI SCI handle.
2115 * @nav_id: Device ID of Navigator Subsystem which should be used for
2117 * @src_thread: Source PSI-L thread ID
2118 * @dst_thread: Destination PSI-L thread ID
2122 static int ti_sci_cmd_rm_psil_pair(const struct ti_sci_handle *handle, in ti_sci_cmd_rm_psil_pair() argument
2129 struct device *dev; in ti_sci_cmd_rm_psil_pair()
2132 if (IS_ERR(handle)) in ti_sci_cmd_rm_psil_pair()
2133 return PTR_ERR(handle); in ti_sci_cmd_rm_psil_pair()
2134 if (!handle) in ti_sci_cmd_rm_psil_pair()
2135 return -EINVAL; in ti_sci_cmd_rm_psil_pair()
2137 info = handle_to_ti_sci_info(handle); in ti_sci_cmd_rm_psil_pair()
2138 dev = info->dev; in ti_sci_cmd_rm_psil_pair()
2148 req = (struct ti_sci_msg_psil_pair *)xfer->xfer_buf; in ti_sci_cmd_rm_psil_pair()
2149 req->nav_id = nav_id; in ti_sci_cmd_rm_psil_pair()
2150 req->src_thread = src_thread; in ti_sci_cmd_rm_psil_pair()
2151 req->dst_thread = dst_thread; in ti_sci_cmd_rm_psil_pair()
2159 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_rm_psil_pair()
2160 ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL; in ti_sci_cmd_rm_psil_pair()
2163 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_rm_psil_pair()
2169 * ti_sci_cmd_rm_psil_unpair() - Unpair PSI-L source from destination thread
2170 * @handle: Pointer to TI SCI handle.
2171 * @nav_id: Device ID of Navigator Subsystem which should be used for
2173 * @src_thread: Source PSI-L thread ID
2174 * @dst_thread: Destination PSI-L thread ID
2178 static int ti_sci_cmd_rm_psil_unpair(const struct ti_sci_handle *handle, in ti_sci_cmd_rm_psil_unpair() argument
2185 struct device *dev; in ti_sci_cmd_rm_psil_unpair()
2188 if (IS_ERR(handle)) in ti_sci_cmd_rm_psil_unpair()
2189 return PTR_ERR(handle); in ti_sci_cmd_rm_psil_unpair()
2190 if (!handle) in ti_sci_cmd_rm_psil_unpair()
2191 return -EINVAL; in ti_sci_cmd_rm_psil_unpair()
2193 info = handle_to_ti_sci_info(handle); in ti_sci_cmd_rm_psil_unpair()
2194 dev = info->dev; in ti_sci_cmd_rm_psil_unpair()
2204 req = (struct ti_sci_msg_psil_unpair *)xfer->xfer_buf; in ti_sci_cmd_rm_psil_unpair()
2205 req->nav_id = nav_id; in ti_sci_cmd_rm_psil_unpair()
2206 req->src_thread = src_thread; in ti_sci_cmd_rm_psil_unpair()
2207 req->dst_thread = dst_thread; in ti_sci_cmd_rm_psil_unpair()
2215 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_rm_psil_unpair()
2216 ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL; in ti_sci_cmd_rm_psil_unpair()
2219 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_rm_psil_unpair()
2225 * ti_sci_cmd_rm_udmap_tx_ch_cfg() - Configure a UDMAP TX channel
2226 * @handle: Pointer to TI SCI handle.
2235 static int ti_sci_cmd_rm_udmap_tx_ch_cfg(const struct ti_sci_handle *handle, in ti_sci_cmd_rm_udmap_tx_ch_cfg() argument
2242 struct device *dev; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2245 if (IS_ERR_OR_NULL(handle)) in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2246 return -EINVAL; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2248 info = handle_to_ti_sci_info(handle); in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2249 dev = info->dev; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2259 req = (struct ti_sci_msg_rm_udmap_tx_ch_cfg_req *)xfer->xfer_buf; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2260 req->valid_params = params->valid_params; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2261 req->nav_id = params->nav_id; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2262 req->index = params->index; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2263 req->tx_pause_on_err = params->tx_pause_on_err; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2264 req->tx_filt_einfo = params->tx_filt_einfo; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2265 req->tx_filt_pswords = params->tx_filt_pswords; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2266 req->tx_atype = params->tx_atype; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2267 req->tx_chan_type = params->tx_chan_type; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2268 req->tx_supr_tdpkt = params->tx_supr_tdpkt; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2269 req->tx_fetch_size = params->tx_fetch_size; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2270 req->tx_credit_count = params->tx_credit_count; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2271 req->txcq_qnum = params->txcq_qnum; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2272 req->tx_priority = params->tx_priority; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2273 req->tx_qos = params->tx_qos; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2274 req->tx_orderid = params->tx_orderid; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2275 req->fdepth = params->fdepth; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2276 req->tx_sched_priority = params->tx_sched_priority; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2277 req->tx_burst_size = params->tx_burst_size; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2278 req->tx_tdtype = params->tx_tdtype; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2279 req->extended_ch_type = params->extended_ch_type; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2287 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2288 ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL; in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2291 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2292 dev_dbg(dev, "TX_CH_CFG: chn %u ret:%u\n", params->index, ret); in ti_sci_cmd_rm_udmap_tx_ch_cfg()
2297 * ti_sci_cmd_rm_udmap_rx_ch_cfg() - Configure a UDMAP RX channel
2298 * @handle: Pointer to TI SCI handle.
2307 static int ti_sci_cmd_rm_udmap_rx_ch_cfg(const struct ti_sci_handle *handle, in ti_sci_cmd_rm_udmap_rx_ch_cfg() argument
2314 struct device *dev; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2317 if (IS_ERR_OR_NULL(handle)) in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2318 return -EINVAL; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2320 info = handle_to_ti_sci_info(handle); in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2321 dev = info->dev; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2331 req = (struct ti_sci_msg_rm_udmap_rx_ch_cfg_req *)xfer->xfer_buf; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2332 req->valid_params = params->valid_params; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2333 req->nav_id = params->nav_id; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2334 req->index = params->index; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2335 req->rx_fetch_size = params->rx_fetch_size; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2336 req->rxcq_qnum = params->rxcq_qnum; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2337 req->rx_priority = params->rx_priority; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2338 req->rx_qos = params->rx_qos; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2339 req->rx_orderid = params->rx_orderid; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2340 req->rx_sched_priority = params->rx_sched_priority; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2341 req->flowid_start = params->flowid_start; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2342 req->flowid_cnt = params->flowid_cnt; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2343 req->rx_pause_on_err = params->rx_pause_on_err; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2344 req->rx_atype = params->rx_atype; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2345 req->rx_chan_type = params->rx_chan_type; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2346 req->rx_ignore_short = params->rx_ignore_short; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2347 req->rx_ignore_long = params->rx_ignore_long; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2348 req->rx_burst_size = params->rx_burst_size; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2356 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2357 ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL; in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2360 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2361 dev_dbg(dev, "RX_CH_CFG: chn %u ret:%d\n", params->index, ret); in ti_sci_cmd_rm_udmap_rx_ch_cfg()
2366 * ti_sci_cmd_rm_udmap_rx_flow_cfg() - Configure UDMAP RX FLOW
2367 * @handle: Pointer to TI SCI handle.
2376 static int ti_sci_cmd_rm_udmap_rx_flow_cfg(const struct ti_sci_handle *handle, in ti_sci_cmd_rm_udmap_rx_flow_cfg() argument
2383 struct device *dev; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2386 if (IS_ERR_OR_NULL(handle)) in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2387 return -EINVAL; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2389 info = handle_to_ti_sci_info(handle); in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2390 dev = info->dev; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2400 req = (struct ti_sci_msg_rm_udmap_flow_cfg_req *)xfer->xfer_buf; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2401 req->valid_params = params->valid_params; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2402 req->nav_id = params->nav_id; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2403 req->flow_index = params->flow_index; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2404 req->rx_einfo_present = params->rx_einfo_present; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2405 req->rx_psinfo_present = params->rx_psinfo_present; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2406 req->rx_error_handling = params->rx_error_handling; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2407 req->rx_desc_type = params->rx_desc_type; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2408 req->rx_sop_offset = params->rx_sop_offset; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2409 req->rx_dest_qnum = params->rx_dest_qnum; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2410 req->rx_src_tag_hi = params->rx_src_tag_hi; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2411 req->rx_src_tag_lo = params->rx_src_tag_lo; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2412 req->rx_dest_tag_hi = params->rx_dest_tag_hi; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2413 req->rx_dest_tag_lo = params->rx_dest_tag_lo; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2414 req->rx_src_tag_hi_sel = params->rx_src_tag_hi_sel; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2415 req->rx_src_tag_lo_sel = params->rx_src_tag_lo_sel; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2416 req->rx_dest_tag_hi_sel = params->rx_dest_tag_hi_sel; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2417 req->rx_dest_tag_lo_sel = params->rx_dest_tag_lo_sel; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2418 req->rx_fdq0_sz0_qnum = params->rx_fdq0_sz0_qnum; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2419 req->rx_fdq1_qnum = params->rx_fdq1_qnum; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2420 req->rx_fdq2_qnum = params->rx_fdq2_qnum; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2421 req->rx_fdq3_qnum = params->rx_fdq3_qnum; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2422 req->rx_ps_location = params->rx_ps_location; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2430 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2431 ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL; in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2434 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2435 dev_dbg(info->dev, "RX_FL_CFG: %u ret:%d\n", params->flow_index, ret); in ti_sci_cmd_rm_udmap_rx_flow_cfg()
2440 * ti_sci_cmd_proc_request() - Command to request a physical processor control
2441 * @handle: Pointer to TI SCI handle
2446 static int ti_sci_cmd_proc_request(const struct ti_sci_handle *handle, in ti_sci_cmd_proc_request() argument
2453 struct device *dev; in ti_sci_cmd_proc_request()
2456 if (!handle) in ti_sci_cmd_proc_request()
2457 return -EINVAL; in ti_sci_cmd_proc_request()
2458 if (IS_ERR(handle)) in ti_sci_cmd_proc_request()
2459 return PTR_ERR(handle); in ti_sci_cmd_proc_request()
2461 info = handle_to_ti_sci_info(handle); in ti_sci_cmd_proc_request()
2462 dev = info->dev; in ti_sci_cmd_proc_request()
2472 req = (struct ti_sci_msg_req_proc_request *)xfer->xfer_buf; in ti_sci_cmd_proc_request()
2473 req->processor_id = proc_id; in ti_sci_cmd_proc_request()
2481 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_cmd_proc_request()
2483 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_cmd_proc_request()
2486 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_proc_request()
2492 * ti_sci_cmd_proc_release() - Command to release a physical processor control
2493 * @handle: Pointer to TI SCI handle
2498 static int ti_sci_cmd_proc_release(const struct ti_sci_handle *handle, in ti_sci_cmd_proc_release() argument
2505 struct device *dev; in ti_sci_cmd_proc_release()
2508 if (!handle) in ti_sci_cmd_proc_release()
2509 return -EINVAL; in ti_sci_cmd_proc_release()
2510 if (IS_ERR(handle)) in ti_sci_cmd_proc_release()
2511 return PTR_ERR(handle); in ti_sci_cmd_proc_release()
2513 info = handle_to_ti_sci_info(handle); in ti_sci_cmd_proc_release()
2514 dev = info->dev; in ti_sci_cmd_proc_release()
2524 req = (struct ti_sci_msg_req_proc_release *)xfer->xfer_buf; in ti_sci_cmd_proc_release()
2525 req->processor_id = proc_id; in ti_sci_cmd_proc_release()
2533 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_cmd_proc_release()
2535 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_cmd_proc_release()
2538 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_proc_release()
2544 * ti_sci_cmd_proc_handover() - Command to handover a physical processor
2547 * @handle: Pointer to TI SCI handle
2553 static int ti_sci_cmd_proc_handover(const struct ti_sci_handle *handle, in ti_sci_cmd_proc_handover() argument
2560 struct device *dev; in ti_sci_cmd_proc_handover()
2563 if (!handle) in ti_sci_cmd_proc_handover()
2564 return -EINVAL; in ti_sci_cmd_proc_handover()
2565 if (IS_ERR(handle)) in ti_sci_cmd_proc_handover()
2566 return PTR_ERR(handle); in ti_sci_cmd_proc_handover()
2568 info = handle_to_ti_sci_info(handle); in ti_sci_cmd_proc_handover()
2569 dev = info->dev; in ti_sci_cmd_proc_handover()
2579 req = (struct ti_sci_msg_req_proc_handover *)xfer->xfer_buf; in ti_sci_cmd_proc_handover()
2580 req->processor_id = proc_id; in ti_sci_cmd_proc_handover()
2581 req->host_id = host_id; in ti_sci_cmd_proc_handover()
2589 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_cmd_proc_handover()
2591 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_cmd_proc_handover()
2594 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_proc_handover()
2600 * ti_sci_cmd_proc_set_config() - Command to set the processor boot
2602 * @handle: Pointer to TI SCI handle
2610 static int ti_sci_cmd_proc_set_config(const struct ti_sci_handle *handle, in ti_sci_cmd_proc_set_config() argument
2619 struct device *dev; in ti_sci_cmd_proc_set_config()
2622 if (!handle) in ti_sci_cmd_proc_set_config()
2623 return -EINVAL; in ti_sci_cmd_proc_set_config()
2624 if (IS_ERR(handle)) in ti_sci_cmd_proc_set_config()
2625 return PTR_ERR(handle); in ti_sci_cmd_proc_set_config()
2627 info = handle_to_ti_sci_info(handle); in ti_sci_cmd_proc_set_config()
2628 dev = info->dev; in ti_sci_cmd_proc_set_config()
2638 req = (struct ti_sci_msg_req_set_config *)xfer->xfer_buf; in ti_sci_cmd_proc_set_config()
2639 req->processor_id = proc_id; in ti_sci_cmd_proc_set_config()
2640 req->bootvector_low = bootvector & TI_SCI_ADDR_LOW_MASK; in ti_sci_cmd_proc_set_config()
2641 req->bootvector_high = (bootvector & TI_SCI_ADDR_HIGH_MASK) >> in ti_sci_cmd_proc_set_config()
2643 req->config_flags_set = config_flags_set; in ti_sci_cmd_proc_set_config()
2644 req->config_flags_clear = config_flags_clear; in ti_sci_cmd_proc_set_config()
2652 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_cmd_proc_set_config()
2654 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_cmd_proc_set_config()
2657 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_proc_set_config()
2663 * ti_sci_cmd_proc_set_control() - Command to set the processor boot
2665 * @handle: Pointer to TI SCI handle
2672 static int ti_sci_cmd_proc_set_control(const struct ti_sci_handle *handle, in ti_sci_cmd_proc_set_control() argument
2680 struct device *dev; in ti_sci_cmd_proc_set_control()
2683 if (!handle) in ti_sci_cmd_proc_set_control()
2684 return -EINVAL; in ti_sci_cmd_proc_set_control()
2685 if (IS_ERR(handle)) in ti_sci_cmd_proc_set_control()
2686 return PTR_ERR(handle); in ti_sci_cmd_proc_set_control()
2688 info = handle_to_ti_sci_info(handle); in ti_sci_cmd_proc_set_control()
2689 dev = info->dev; in ti_sci_cmd_proc_set_control()
2699 req = (struct ti_sci_msg_req_set_ctrl *)xfer->xfer_buf; in ti_sci_cmd_proc_set_control()
2700 req->processor_id = proc_id; in ti_sci_cmd_proc_set_control()
2701 req->control_flags_set = control_flags_set; in ti_sci_cmd_proc_set_control()
2702 req->control_flags_clear = control_flags_clear; in ti_sci_cmd_proc_set_control()
2710 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_cmd_proc_set_control()
2712 ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV; in ti_sci_cmd_proc_set_control()
2715 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_proc_set_control()
2721 * ti_sci_cmd_proc_get_status() - Command to get the processor boot status
2722 * @handle: Pointer to TI SCI handle
2731 static int ti_sci_cmd_proc_get_status(const struct ti_sci_handle *handle, in ti_sci_cmd_proc_get_status() argument
2739 struct device *dev; in ti_sci_cmd_proc_get_status()
2742 if (!handle) in ti_sci_cmd_proc_get_status()
2743 return -EINVAL; in ti_sci_cmd_proc_get_status()
2744 if (IS_ERR(handle)) in ti_sci_cmd_proc_get_status()
2745 return PTR_ERR(handle); in ti_sci_cmd_proc_get_status()
2747 info = handle_to_ti_sci_info(handle); in ti_sci_cmd_proc_get_status()
2748 dev = info->dev; in ti_sci_cmd_proc_get_status()
2758 req = (struct ti_sci_msg_req_get_status *)xfer->xfer_buf; in ti_sci_cmd_proc_get_status()
2759 req->processor_id = proc_id; in ti_sci_cmd_proc_get_status()
2767 resp = (struct ti_sci_msg_resp_get_status *)xfer->tx_message.buf; in ti_sci_cmd_proc_get_status()
2770 ret = -ENODEV; in ti_sci_cmd_proc_get_status()
2772 *bv = (resp->bootvector_low & TI_SCI_ADDR_LOW_MASK) | in ti_sci_cmd_proc_get_status()
2773 (((u64)resp->bootvector_high << TI_SCI_ADDR_HIGH_SHIFT) & in ti_sci_cmd_proc_get_status()
2775 *cfg_flags = resp->config_flags; in ti_sci_cmd_proc_get_status()
2776 *ctrl_flags = resp->control_flags; in ti_sci_cmd_proc_get_status()
2777 *sts_flags = resp->status_flags; in ti_sci_cmd_proc_get_status()
2781 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_proc_get_status()
2787 * ti_sci_setup_ops() - Setup the operations structures
2792 struct ti_sci_ops *ops = &info->handle.ops; in ti_sci_setup_ops()
2793 struct ti_sci_core_ops *core_ops = &ops->core_ops; in ti_sci_setup_ops()
2794 struct ti_sci_dev_ops *dops = &ops->dev_ops; in ti_sci_setup_ops()
2795 struct ti_sci_clk_ops *cops = &ops->clk_ops; in ti_sci_setup_ops()
2796 struct ti_sci_rm_core_ops *rm_core_ops = &ops->rm_core_ops; in ti_sci_setup_ops()
2797 struct ti_sci_rm_irq_ops *iops = &ops->rm_irq_ops; in ti_sci_setup_ops()
2798 struct ti_sci_rm_ringacc_ops *rops = &ops->rm_ring_ops; in ti_sci_setup_ops()
2799 struct ti_sci_rm_psil_ops *psilops = &ops->rm_psil_ops; in ti_sci_setup_ops()
2800 struct ti_sci_rm_udmap_ops *udmap_ops = &ops->rm_udmap_ops; in ti_sci_setup_ops()
2801 struct ti_sci_proc_ops *pops = &ops->proc_ops; in ti_sci_setup_ops()
2803 core_ops->reboot_device = ti_sci_cmd_core_reboot; in ti_sci_setup_ops()
2805 dops->get_device = ti_sci_cmd_get_device; in ti_sci_setup_ops()
2806 dops->get_device_exclusive = ti_sci_cmd_get_device_exclusive; in ti_sci_setup_ops()
2807 dops->idle_device = ti_sci_cmd_idle_device; in ti_sci_setup_ops()
2808 dops->idle_device_exclusive = ti_sci_cmd_idle_device_exclusive; in ti_sci_setup_ops()
2809 dops->put_device = ti_sci_cmd_put_device; in ti_sci_setup_ops()
2811 dops->is_valid = ti_sci_cmd_dev_is_valid; in ti_sci_setup_ops()
2812 dops->get_context_loss_count = ti_sci_cmd_dev_get_clcnt; in ti_sci_setup_ops()
2813 dops->is_idle = ti_sci_cmd_dev_is_idle; in ti_sci_setup_ops()
2814 dops->is_stop = ti_sci_cmd_dev_is_stop; in ti_sci_setup_ops()
2815 dops->is_on = ti_sci_cmd_dev_is_on; in ti_sci_setup_ops()
2816 dops->is_transitioning = ti_sci_cmd_dev_is_trans; in ti_sci_setup_ops()
2817 dops->set_device_resets = ti_sci_cmd_set_device_resets; in ti_sci_setup_ops()
2818 dops->get_device_resets = ti_sci_cmd_get_device_resets; in ti_sci_setup_ops()
2820 cops->get_clock = ti_sci_cmd_get_clock; in ti_sci_setup_ops()
2821 cops->idle_clock = ti_sci_cmd_idle_clock; in ti_sci_setup_ops()
2822 cops->put_clock = ti_sci_cmd_put_clock; in ti_sci_setup_ops()
2823 cops->is_auto = ti_sci_cmd_clk_is_auto; in ti_sci_setup_ops()
2824 cops->is_on = ti_sci_cmd_clk_is_on; in ti_sci_setup_ops()
2825 cops->is_off = ti_sci_cmd_clk_is_off; in ti_sci_setup_ops()
2827 cops->set_parent = ti_sci_cmd_clk_set_parent; in ti_sci_setup_ops()
2828 cops->get_parent = ti_sci_cmd_clk_get_parent; in ti_sci_setup_ops()
2829 cops->get_num_parents = ti_sci_cmd_clk_get_num_parents; in ti_sci_setup_ops()
2831 cops->get_best_match_freq = ti_sci_cmd_clk_get_match_freq; in ti_sci_setup_ops()
2832 cops->set_freq = ti_sci_cmd_clk_set_freq; in ti_sci_setup_ops()
2833 cops->get_freq = ti_sci_cmd_clk_get_freq; in ti_sci_setup_ops()
2835 rm_core_ops->get_range = ti_sci_cmd_get_resource_range; in ti_sci_setup_ops()
2836 rm_core_ops->get_range_from_shost = in ti_sci_setup_ops()
2839 iops->set_irq = ti_sci_cmd_set_irq; in ti_sci_setup_ops()
2840 iops->set_event_map = ti_sci_cmd_set_event_map; in ti_sci_setup_ops()
2841 iops->free_irq = ti_sci_cmd_free_irq; in ti_sci_setup_ops()
2842 iops->free_event_map = ti_sci_cmd_free_event_map; in ti_sci_setup_ops()
2844 rops->set_cfg = ti_sci_cmd_rm_ring_cfg; in ti_sci_setup_ops()
2846 psilops->pair = ti_sci_cmd_rm_psil_pair; in ti_sci_setup_ops()
2847 psilops->unpair = ti_sci_cmd_rm_psil_unpair; in ti_sci_setup_ops()
2849 udmap_ops->tx_ch_cfg = ti_sci_cmd_rm_udmap_tx_ch_cfg; in ti_sci_setup_ops()
2850 udmap_ops->rx_ch_cfg = ti_sci_cmd_rm_udmap_rx_ch_cfg; in ti_sci_setup_ops()
2851 udmap_ops->rx_flow_cfg = ti_sci_cmd_rm_udmap_rx_flow_cfg; in ti_sci_setup_ops()
2853 pops->request = ti_sci_cmd_proc_request; in ti_sci_setup_ops()
2854 pops->release = ti_sci_cmd_proc_release; in ti_sci_setup_ops()
2855 pops->handover = ti_sci_cmd_proc_handover; in ti_sci_setup_ops()
2856 pops->set_config = ti_sci_cmd_proc_set_config; in ti_sci_setup_ops()
2857 pops->set_control = ti_sci_cmd_proc_set_control; in ti_sci_setup_ops()
2858 pops->get_status = ti_sci_cmd_proc_get_status; in ti_sci_setup_ops()
2862 * ti_sci_get_handle() - Get the TI SCI handle for a device
2863 * @dev: Pointer to device for which we want SCI handle
2868 * Return: pointer to handle if successful, else:
2869 * -EPROBE_DEFER if the instance is not ready
2870 * -ENODEV if the required node handler is missing
2871 * -EINVAL if invalid conditions are encountered.
2873 const struct ti_sci_handle *ti_sci_get_handle(struct device *dev) in ti_sci_get_handle()
2876 struct ti_sci_handle *handle = NULL; in ti_sci_get_handle() local
2880 pr_err("I need a device pointer\n"); in ti_sci_get_handle()
2881 return ERR_PTR(-EINVAL); in ti_sci_get_handle()
2883 ti_sci_np = of_get_parent(dev->of_node); in ti_sci_get_handle()
2886 return ERR_PTR(-EINVAL); in ti_sci_get_handle()
2891 if (ti_sci_np == info->dev->of_node) { in ti_sci_get_handle()
2892 handle = &info->handle; in ti_sci_get_handle()
2893 info->users++; in ti_sci_get_handle()
2900 if (!handle) in ti_sci_get_handle()
2901 return ERR_PTR(-EPROBE_DEFER); in ti_sci_get_handle()
2903 return handle; in ti_sci_get_handle()
2908 * ti_sci_put_handle() - Release the handle acquired by ti_sci_get_handle
2909 * @handle: Handle acquired by ti_sci_get_handle
2917 * if null was passed, it returns -EINVAL;
2919 int ti_sci_put_handle(const struct ti_sci_handle *handle) in ti_sci_put_handle() argument
2923 if (IS_ERR(handle)) in ti_sci_put_handle()
2924 return PTR_ERR(handle); in ti_sci_put_handle()
2925 if (!handle) in ti_sci_put_handle()
2926 return -EINVAL; in ti_sci_put_handle()
2928 info = handle_to_ti_sci_info(handle); in ti_sci_put_handle()
2930 if (!WARN_ON(!info->users)) in ti_sci_put_handle()
2931 info->users--; in ti_sci_put_handle()
2938 static void devm_ti_sci_release(struct device *dev, void *res) in devm_ti_sci_release()
2941 const struct ti_sci_handle *handle = *ptr; in devm_ti_sci_release() local
2944 ret = ti_sci_put_handle(handle); in devm_ti_sci_release()
2946 dev_err(dev, "failed to put handle %d\n", ret); in devm_ti_sci_release()
2950 * devm_ti_sci_get_handle() - Managed get handle
2951 * @dev: device for which we want SCI handle for.
2953 * NOTE: This releases the handle once the device resources are
2960 const struct ti_sci_handle *devm_ti_sci_get_handle(struct device *dev) in devm_ti_sci_get_handle()
2963 const struct ti_sci_handle *handle; in devm_ti_sci_get_handle() local
2967 return ERR_PTR(-ENOMEM); in devm_ti_sci_get_handle()
2968 handle = ti_sci_get_handle(dev); in devm_ti_sci_get_handle()
2970 if (!IS_ERR(handle)) { in devm_ti_sci_get_handle()
2971 *ptr = handle; in devm_ti_sci_get_handle()
2977 return handle; in devm_ti_sci_get_handle()
2982 * ti_sci_get_by_phandle() - Get the TI SCI handle using DT phandle
2983 * @np: device node
2989 * Return: pointer to handle if successful, else:
2990 * -EPROBE_DEFER if the instance is not ready
2991 * -ENODEV if the required node handler is missing
2992 * -EINVAL if invalid conditions are encountered.
2997 struct ti_sci_handle *handle = NULL; in ti_sci_get_by_phandle() local
3002 pr_err("I need a device pointer\n"); in ti_sci_get_by_phandle()
3003 return ERR_PTR(-EINVAL); in ti_sci_get_by_phandle()
3008 return ERR_PTR(-ENODEV); in ti_sci_get_by_phandle()
3012 if (ti_sci_np == info->dev->of_node) { in ti_sci_get_by_phandle()
3013 handle = &info->handle; in ti_sci_get_by_phandle()
3014 info->users++; in ti_sci_get_by_phandle()
3021 if (!handle) in ti_sci_get_by_phandle()
3022 return ERR_PTR(-EPROBE_DEFER); in ti_sci_get_by_phandle()
3024 return handle; in ti_sci_get_by_phandle()
3029 * devm_ti_sci_get_by_phandle() - Managed get handle using phandle
3030 * @dev: Device pointer requesting TISCI handle
3033 * NOTE: This releases the handle once the device resources are
3040 const struct ti_sci_handle *devm_ti_sci_get_by_phandle(struct device *dev, in devm_ti_sci_get_by_phandle()
3043 const struct ti_sci_handle *handle; in devm_ti_sci_get_by_phandle() local
3048 return ERR_PTR(-ENOMEM); in devm_ti_sci_get_by_phandle()
3049 handle = ti_sci_get_by_phandle(dev_of_node(dev), property); in devm_ti_sci_get_by_phandle()
3051 if (!IS_ERR(handle)) { in devm_ti_sci_get_by_phandle()
3052 *ptr = handle; in devm_ti_sci_get_by_phandle()
3058 return handle; in devm_ti_sci_get_by_phandle()
3063 * ti_sci_get_free_resource() - Get a free resource from TISCI resource.
3073 raw_spin_lock_irqsave(&res->lock, flags); in ti_sci_get_free_resource()
3074 for (set = 0; set < res->sets; set++) { in ti_sci_get_free_resource()
3075 struct ti_sci_resource_desc *desc = &res->desc[set]; in ti_sci_get_free_resource()
3076 int res_count = desc->num + desc->num_sec; in ti_sci_get_free_resource()
3078 free_bit = find_first_zero_bit(desc->res_map, res_count); in ti_sci_get_free_resource()
3080 __set_bit(free_bit, desc->res_map); in ti_sci_get_free_resource()
3081 raw_spin_unlock_irqrestore(&res->lock, flags); in ti_sci_get_free_resource()
3083 if (desc->num && free_bit < desc->num) in ti_sci_get_free_resource()
3084 return desc->start + free_bit; in ti_sci_get_free_resource()
3086 return desc->start_sec + free_bit; in ti_sci_get_free_resource()
3089 raw_spin_unlock_irqrestore(&res->lock, flags); in ti_sci_get_free_resource()
3096 * ti_sci_release_resource() - Release a resource from TISCI resource.
3105 raw_spin_lock_irqsave(&res->lock, flags); in ti_sci_release_resource()
3106 for (set = 0; set < res->sets; set++) { in ti_sci_release_resource()
3107 struct ti_sci_resource_desc *desc = &res->desc[set]; in ti_sci_release_resource()
3109 if (desc->num && desc->start <= id && in ti_sci_release_resource()
3110 (desc->start + desc->num) > id) in ti_sci_release_resource()
3111 __clear_bit(id - desc->start, desc->res_map); in ti_sci_release_resource()
3112 else if (desc->num_sec && desc->start_sec <= id && in ti_sci_release_resource()
3113 (desc->start_sec + desc->num_sec) > id) in ti_sci_release_resource()
3114 __clear_bit(id - desc->start_sec, desc->res_map); in ti_sci_release_resource()
3116 raw_spin_unlock_irqrestore(&res->lock, flags); in ti_sci_release_resource()
3121 * ti_sci_get_num_resources() - Get the number of resources in TISCI resource
3130 for (set = 0; set < res->sets; set++) in ti_sci_get_num_resources()
3131 count += res->desc[set].num + res->desc[set].num_sec; in ti_sci_get_num_resources()
3138 * devm_ti_sci_get_resource_sets() - Get a TISCI resources assigned to a device
3139 * @handle: TISCI handle
3140 * @dev: Device pointer to which the resource is assigned
3141 * @dev_id: TISCI device id to which the resource is assigned
3142 * @sub_types: Array of sub_types assigned corresponding to device
3149 devm_ti_sci_get_resource_sets(const struct ti_sci_handle *handle, in devm_ti_sci_get_resource_sets() argument
3150 struct device *dev, u32 dev_id, u32 *sub_types, in devm_ti_sci_get_resource_sets()
3159 return ERR_PTR(-ENOMEM); in devm_ti_sci_get_resource_sets()
3161 res->sets = sets; in devm_ti_sci_get_resource_sets()
3162 res->desc = devm_kcalloc(dev, res->sets, sizeof(*res->desc), in devm_ti_sci_get_resource_sets()
3164 if (!res->desc) in devm_ti_sci_get_resource_sets()
3165 return ERR_PTR(-ENOMEM); in devm_ti_sci_get_resource_sets()
3167 for (i = 0; i < res->sets; i++) { in devm_ti_sci_get_resource_sets()
3168 ret = handle->ops.rm_core_ops.get_range(handle, dev_id, in devm_ti_sci_get_resource_sets()
3170 &res->desc[i]); in devm_ti_sci_get_resource_sets()
3174 memset(&res->desc[i], 0, sizeof(res->desc[i])); in devm_ti_sci_get_resource_sets()
3179 dev_id, sub_types[i], res->desc[i].start, in devm_ti_sci_get_resource_sets()
3180 res->desc[i].num, res->desc[i].start_sec, in devm_ti_sci_get_resource_sets()
3181 res->desc[i].num_sec); in devm_ti_sci_get_resource_sets()
3184 res_count = res->desc[i].num + res->desc[i].num_sec; in devm_ti_sci_get_resource_sets()
3185 res->desc[i].res_map = devm_bitmap_zalloc(dev, res_count, in devm_ti_sci_get_resource_sets()
3187 if (!res->desc[i].res_map) in devm_ti_sci_get_resource_sets()
3188 return ERR_PTR(-ENOMEM); in devm_ti_sci_get_resource_sets()
3190 raw_spin_lock_init(&res->lock); in devm_ti_sci_get_resource_sets()
3195 return ERR_PTR(-EINVAL); in devm_ti_sci_get_resource_sets()
3199 * devm_ti_sci_get_of_resource() - Get a TISCI resource assigned to a device
3200 * @handle: TISCI handle
3201 * @dev: Device pointer to which the resource is assigned
3202 * @dev_id: TISCI device id to which the resource is assigned
3209 devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle, in devm_ti_sci_get_of_resource() argument
3210 struct device *dev, u32 dev_id, char *of_prop) in devm_ti_sci_get_of_resource()
3225 return ERR_PTR(-ENOMEM); in devm_ti_sci_get_of_resource()
3228 res = devm_ti_sci_get_resource_sets(handle, dev, dev_id, sub_types, in devm_ti_sci_get_of_resource()
3237 * devm_ti_sci_get_resource() - Get a resource range assigned to the device
3238 * @handle: TISCI handle
3239 * @dev: Device pointer to which the resource is assigned
3240 * @dev_id: TISCI device id to which the resource is assigned
3247 devm_ti_sci_get_resource(const struct ti_sci_handle *handle, struct device *dev, in devm_ti_sci_get_resource() argument
3250 return devm_ti_sci_get_resource_sets(handle, dev, dev_id, &sub_type, 1); in devm_ti_sci_get_resource()
3256 struct ti_sci_info *info = data->cb_data; in tisci_reboot_handler()
3257 const struct ti_sci_handle *handle = &info->handle; in tisci_reboot_handler() local
3259 ti_sci_cmd_core_reboot(handle); in tisci_reboot_handler()
3270 /* Limited by MBOX_TX_QUEUE_LEN. K2G can handle upto 128 messages! */
3280 /* Limited by MBOX_TX_QUEUE_LEN. K2G can handle upto 128 messages! */
3286 {.compatible = "ti,k2g-sci", .data = &ti_sci_pmmc_k2g_desc},
3287 {.compatible = "ti,am654-sci", .data = &ti_sci_pmmc_am654_desc},
3294 struct device *dev = &pdev->dev; in ti_sci_probe()
3300 int ret = -EINVAL; in ti_sci_probe()
3308 return -ENOMEM; in ti_sci_probe()
3310 info->dev = dev; in ti_sci_probe()
3311 info->desc = desc; in ti_sci_probe()
3312 ret = of_property_read_u32(dev->of_node, "ti,host-id", &h_id); in ti_sci_probe()
3315 info->host_id = info->desc->default_host_id; in ti_sci_probe()
3319 info->host_id = info->desc->default_host_id; in ti_sci_probe()
3321 info->host_id = h_id; in ti_sci_probe()
3325 INIT_LIST_HEAD(&info->node); in ti_sci_probe()
3326 minfo = &info->minfo; in ti_sci_probe()
3329 * Pre-allocate messages in ti_sci_probe()
3333 if (WARN_ON(desc->max_msgs >= in ti_sci_probe()
3334 1 << 8 * sizeof(((struct ti_sci_msg_hdr *)0)->seq))) in ti_sci_probe()
3335 return -EINVAL; in ti_sci_probe()
3337 minfo->xfer_block = devm_kcalloc(dev, in ti_sci_probe()
3338 desc->max_msgs, in ti_sci_probe()
3339 sizeof(*minfo->xfer_block), in ti_sci_probe()
3341 if (!minfo->xfer_block) in ti_sci_probe()
3342 return -ENOMEM; in ti_sci_probe()
3344 minfo->xfer_alloc_table = devm_bitmap_zalloc(dev, in ti_sci_probe()
3345 desc->max_msgs, in ti_sci_probe()
3347 if (!minfo->xfer_alloc_table) in ti_sci_probe()
3348 return -ENOMEM; in ti_sci_probe()
3350 /* Pre-initialize the buffer pointer to pre-allocated buffers */ in ti_sci_probe()
3351 for (i = 0, xfer = minfo->xfer_block; i < desc->max_msgs; i++, xfer++) { in ti_sci_probe()
3352 xfer->xfer_buf = devm_kcalloc(dev, 1, desc->max_msg_size, in ti_sci_probe()
3354 if (!xfer->xfer_buf) in ti_sci_probe()
3355 return -ENOMEM; in ti_sci_probe()
3357 xfer->tx_message.buf = xfer->xfer_buf; in ti_sci_probe()
3358 init_completion(&xfer->done); in ti_sci_probe()
3367 cl = &info->cl; in ti_sci_probe()
3368 cl->dev = dev; in ti_sci_probe()
3369 cl->tx_block = false; in ti_sci_probe()
3370 cl->rx_callback = ti_sci_rx_callback; in ti_sci_probe()
3371 cl->knows_txdone = true; in ti_sci_probe()
3373 spin_lock_init(&minfo->xfer_lock); in ti_sci_probe()
3374 sema_init(&minfo->sem_xfer_count, desc->max_msgs); in ti_sci_probe()
3376 info->chan_rx = mbox_request_channel_byname(cl, "rx"); in ti_sci_probe()
3377 if (IS_ERR(info->chan_rx)) { in ti_sci_probe()
3378 ret = PTR_ERR(info->chan_rx); in ti_sci_probe()
3382 info->chan_tx = mbox_request_channel_byname(cl, "tx"); in ti_sci_probe()
3383 if (IS_ERR(info->chan_tx)) { in ti_sci_probe()
3384 ret = PTR_ERR(info->chan_tx); in ti_sci_probe()
3402 info->handle.version.abi_major, info->handle.version.abi_minor, in ti_sci_probe()
3403 info->handle.version.firmware_revision, in ti_sci_probe()
3404 info->handle.version.firmware_description); in ti_sci_probe()
3407 list_add_tail(&info->node, &ti_sci_list); in ti_sci_probe()
3410 return of_platform_populate(dev->of_node, NULL, NULL, dev); in ti_sci_probe()
3412 if (!IS_ERR(info->chan_tx)) in ti_sci_probe()
3413 mbox_free_channel(info->chan_tx); in ti_sci_probe()
3414 if (!IS_ERR(info->chan_rx)) in ti_sci_probe()
3415 mbox_free_channel(info->chan_rx); in ti_sci_probe()
3416 debugfs_remove(info->d); in ti_sci_probe()
3423 .name = "ti-sci",
3433 MODULE_ALIAS("platform:ti-sci");