Lines Matching +full:am654 +full:- +full:secure +full:- +full:proxy
1 // SPDX-License-Identifier: GPL-2.0+
6 * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
16 #include <linux/soc/ti/k3-sec-proxy.h>
25 * struct ti_sci_xfer - Structure representing a message flow
35 * struct ti_sci_desc - Description of SoC integration
47 * struct ti_sci_info - Structure representing a TI SCI instance
55 * @is_secure: Determines if the communication is through secure threads.
76 * ti_sci_setup_one_xfer() - Setup one message type
96 struct ti_sci_xfer *xfer = &info->xfer; in ti_sci_setup_one_xfer()
100 if (rx_message_size > info->desc->max_msg_size || in ti_sci_setup_one_xfer()
101 tx_message_size > info->desc->max_msg_size || in ti_sci_setup_one_xfer()
103 return ERR_PTR(-ERANGE); in ti_sci_setup_one_xfer()
105 info->seq = ~info->seq; in ti_sci_setup_one_xfer()
106 xfer->tx_message.buf = buf; in ti_sci_setup_one_xfer()
107 xfer->tx_message.len = tx_message_size; in ti_sci_setup_one_xfer()
108 xfer->rx_len = (u8)rx_message_size; in ti_sci_setup_one_xfer()
111 hdr->seq = info->seq; in ti_sci_setup_one_xfer()
112 hdr->type = msg_type; in ti_sci_setup_one_xfer()
113 hdr->host = info->host_id; in ti_sci_setup_one_xfer()
114 hdr->flags = msg_flags; in ti_sci_setup_one_xfer()
120 * ti_sci_get_response() - Receive response from mailbox channel
125 * Return: -ETIMEDOUT in case of no response, if transmit error,
133 struct k3_sec_proxy_msg *msg = &xfer->tx_message; in ti_sci_get_response()
139 ret = mbox_recv(chan, msg, info->desc->max_rx_timeout_us); in ti_sci_get_response()
141 dev_err(info->dev, "%s: Message receive failed. ret = %d\n", in ti_sci_get_response()
147 if (info->is_secure) { in ti_sci_get_response()
148 secure_hdr = (struct ti_sci_secure_msg_hdr *)msg->buf; in ti_sci_get_response()
149 msg->buf = (u32 *)((void *)msg->buf + sizeof(*secure_hdr)); in ti_sci_get_response()
153 hdr = (struct ti_sci_msg_hdr *)msg->buf; in ti_sci_get_response()
156 if (hdr->seq != info->seq) { in ti_sci_get_response()
157 dev_dbg(info->dev, "%s: Message for %d is not expected\n", in ti_sci_get_response()
158 __func__, hdr->seq); in ti_sci_get_response()
162 if (msg->len > info->desc->max_msg_size) { in ti_sci_get_response()
163 dev_err(info->dev, "%s: Unable to handle %zu xfer (max %d)\n", in ti_sci_get_response()
164 __func__, msg->len, info->desc->max_msg_size); in ti_sci_get_response()
165 return -EINVAL; in ti_sci_get_response()
168 if (msg->len < xfer->rx_len) { in ti_sci_get_response()
169 dev_err(info->dev, "%s: Recv xfer %zu < expected %d length\n", in ti_sci_get_response()
170 __func__, msg->len, xfer->rx_len); in ti_sci_get_response()
177 * ti_sci_do_xfer() - Do one transfer
186 struct k3_sec_proxy_msg *msg = &xfer->tx_message; in ti_sci_do_xfer()
187 u8 secure_buf[info->desc->max_msg_size]; in ti_sci_do_xfer()
191 if (info->is_secure) { in ti_sci_do_xfer()
195 memcpy(&secure_buf[sizeof(secure_hdr)], xfer->tx_message.buf, in ti_sci_do_xfer()
196 xfer->tx_message.len); in ti_sci_do_xfer()
198 xfer->tx_message.buf = (u32 *)secure_buf; in ti_sci_do_xfer()
199 xfer->tx_message.len += sizeof(secure_hdr); in ti_sci_do_xfer()
200 xfer->rx_len += sizeof(secure_hdr); in ti_sci_do_xfer()
204 ret = mbox_send(&info->chan_tx, msg); in ti_sci_do_xfer()
206 dev_err(info->dev, "%s: Message sending failed. ret = %d\n", in ti_sci_do_xfer()
211 return ti_sci_get_response(info, xfer, &info->chan_rx); in ti_sci_do_xfer()
215 * ti_sci_cmd_get_revision() - command to get the revision of the SCI entity
234 return -EINVAL; in ti_sci_cmd_get_revision()
243 dev_err(info->dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_get_revision()
249 dev_err(info->dev, "Mbox communication fail %d\n", ret); in ti_sci_cmd_get_revision()
253 rev_info = (struct ti_sci_msg_resp_version *)xfer->tx_message.buf; in ti_sci_cmd_get_revision()
255 ver = &handle->version; in ti_sci_cmd_get_revision()
256 ver->abi_major = rev_info->abi_major; in ti_sci_cmd_get_revision()
257 ver->abi_minor = rev_info->abi_minor; in ti_sci_cmd_get_revision()
258 ver->firmware_revision = rev_info->firmware_revision; in ti_sci_cmd_get_revision()
259 strncpy(ver->firmware_description, rev_info->firmware_description, in ti_sci_cmd_get_revision()
260 sizeof(ver->firmware_description)); in ti_sci_cmd_get_revision()
266 * ti_sci_is_response_ack() - Generic ACK/NACK message checkup
275 return hdr->flags & TI_SCI_FLAG_RESP_GENERIC_ACK ? true : false; in ti_sci_is_response_ack()
279 * cmd_set_board_config_using_msg() - Common command to send board configuration
300 return -EINVAL; in cmd_set_board_config_using_msg()
309 dev_err(info->dev, "Message alloc failed(%d)\n", ret); in cmd_set_board_config_using_msg()
318 dev_err(info->dev, "Mbox send fail %d\n", ret); in cmd_set_board_config_using_msg()
322 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in cmd_set_board_config_using_msg()
325 return -ENODEV; in cmd_set_board_config_using_msg()
331 * ti_sci_cmd_set_board_config() - Command to send board configuration message
347 * ti_sci_cmd_set_board_config_rm() - Command to send board resource
365 * ti_sci_cmd_set_board_config_security() - Command to send board security
383 * ti_sci_cmd_set_board_config_pm() - Command to send board power and clock
400 * ti_sci_set_device_state() - Set device state helper
420 return -EINVAL; in ti_sci_set_device_state()
429 dev_err(info->dev, "Message alloc failed(%d)\n", ret); in ti_sci_set_device_state()
437 dev_err(info->dev, "Mbox send fail %d\n", ret); in ti_sci_set_device_state()
441 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_set_device_state()
444 return -ENODEV; in ti_sci_set_device_state()
450 * ti_sci_get_device_state() - Get device state helper
473 return -EINVAL; in ti_sci_get_device_state()
476 return -EINVAL; in ti_sci_get_device_state()
485 dev_err(info->dev, "Message alloc failed(%d)\n", ret); in ti_sci_get_device_state()
496 resp = (struct ti_sci_msg_resp_get_device_state *)xfer->tx_message.buf; in ti_sci_get_device_state()
498 return -ENODEV; in ti_sci_get_device_state()
501 *clcnt = resp->context_loss_count; in ti_sci_get_device_state()
503 *resets = resp->resets; in ti_sci_get_device_state()
505 *p_state = resp->programmed_state; in ti_sci_get_device_state()
507 *c_state = resp->current_state; in ti_sci_get_device_state()
513 * ti_sci_cmd_get_device() - command to request for device managed by TISCI
517 * Request for the device - NOTE: the client MUST maintain integrity of
533 * ti_sci_cmd_idle_device() - Command to idle a device managed by TISCI
537 * Request for the device - NOTE: the client MUST maintain integrity of
551 * ti_sci_cmd_put_device() - command to release a device managed by TISCI
555 * Request for the device - NOTE: the client MUST maintain integrity of
568 * ti_sci_cmd_dev_is_valid() - Is the device valid
584 * ti_sci_cmd_dev_get_clcnt() - Get context loss counter
598 * ti_sci_cmd_dev_is_idle() - Check if the device is requested to be idle
612 return -EINVAL; in ti_sci_cmd_dev_is_idle()
624 * ti_sci_cmd_dev_is_stop() - Check if the device is requested to be stopped
639 return -EINVAL; in ti_sci_cmd_dev_is_stop()
655 * ti_sci_cmd_dev_is_on() - Check if the device is requested to be ON
670 return -EINVAL; in ti_sci_cmd_dev_is_on()
686 * ti_sci_cmd_dev_is_trans() - Check if the device is currently transitioning
700 return -EINVAL; in ti_sci_cmd_dev_is_trans()
712 * ti_sci_cmd_set_device_resets() - command to set resets for device managed
732 return -EINVAL; in ti_sci_cmd_set_device_resets()
741 dev_err(info->dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_set_device_resets()
749 dev_err(info->dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_set_device_resets()
753 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_cmd_set_device_resets()
756 return -ENODEV; in ti_sci_cmd_set_device_resets()
762 * ti_sci_cmd_get_device_resets() - Get reset state for device managed
778 * ti_sci_set_clock_state() - Set clock state helper
802 return -EINVAL; in ti_sci_set_clock_state()
811 dev_err(info->dev, "Message alloc failed(%d)\n", ret); in ti_sci_set_clock_state()
820 dev_err(info->dev, "Mbox send fail %d\n", ret); in ti_sci_set_clock_state()
824 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_set_clock_state()
827 return -ENODEV; in ti_sci_set_clock_state()
833 * ti_sci_cmd_get_clock_state() - Get clock state helper
857 return -EINVAL; in ti_sci_cmd_get_clock_state()
860 return -EINVAL; in ti_sci_cmd_get_clock_state()
869 dev_err(info->dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_get_clock_state()
877 dev_err(info->dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_get_clock_state()
881 resp = (struct ti_sci_msg_resp_get_clock_state *)xfer->tx_message.buf; in ti_sci_cmd_get_clock_state()
884 return -ENODEV; in ti_sci_cmd_get_clock_state()
887 *programmed_state = resp->programmed_state; in ti_sci_cmd_get_clock_state()
889 *current_state = resp->current_state; in ti_sci_cmd_get_clock_state()
895 * ti_sci_cmd_get_clock() - Get control of a clock from TI SCI
922 * ti_sci_cmd_idle_clock() - Idle a clock which is in our control
941 * ti_sci_cmd_put_clock() - Release a clock from our control back to TISCI
960 * ti_sci_cmd_clk_is_auto() - Is the clock being auto managed
977 return -EINVAL; in ti_sci_cmd_clk_is_auto()
988 * ti_sci_cmd_clk_is_on() - Is the clock ON
1006 return -EINVAL; in ti_sci_cmd_clk_is_on()
1021 * ti_sci_cmd_clk_is_off() - Is the clock OFF
1039 return -EINVAL; in ti_sci_cmd_clk_is_off()
1054 * ti_sci_cmd_clk_set_parent() - Set the clock source of a specific device clock
1076 return -EINVAL; in ti_sci_cmd_clk_set_parent()
1085 dev_err(info->dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_clk_set_parent()
1094 dev_err(info->dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_clk_set_parent()
1098 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_cmd_clk_set_parent()
1101 return -ENODEV; in ti_sci_cmd_clk_set_parent()
1107 * ti_sci_cmd_clk_get_parent() - Get current parent clock source
1129 return -EINVAL; in ti_sci_cmd_clk_get_parent()
1138 dev_err(info->dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_clk_get_parent()
1146 dev_err(info->dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_clk_get_parent()
1150 resp = (struct ti_sci_msg_resp_get_clock_parent *)xfer->tx_message.buf; in ti_sci_cmd_clk_get_parent()
1153 ret = -ENODEV; in ti_sci_cmd_clk_get_parent()
1155 *parent_id = resp->parent_id; in ti_sci_cmd_clk_get_parent()
1161 * ti_sci_cmd_clk_get_num_parents() - Get num parents of the current clk source
1184 return -EINVAL; in ti_sci_cmd_clk_get_num_parents()
1193 dev_err(info->dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_clk_get_num_parents()
1201 dev_err(info->dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_clk_get_num_parents()
1206 xfer->tx_message.buf; in ti_sci_cmd_clk_get_num_parents()
1209 ret = -ENODEV; in ti_sci_cmd_clk_get_num_parents()
1211 *num_parents = resp->num_parents; in ti_sci_cmd_clk_get_num_parents()
1217 * ti_sci_cmd_clk_get_match_freq() - Find a good match for frequency
1249 return -EINVAL; in ti_sci_cmd_clk_get_match_freq()
1258 dev_err(info->dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_clk_get_match_freq()
1269 dev_err(info->dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_clk_get_match_freq()
1273 resp = (struct ti_sci_msg_resp_query_clock_freq *)xfer->tx_message.buf; in ti_sci_cmd_clk_get_match_freq()
1276 ret = -ENODEV; in ti_sci_cmd_clk_get_match_freq()
1278 *match_freq = resp->freq_hz; in ti_sci_cmd_clk_get_match_freq()
1284 * ti_sci_cmd_clk_set_freq() - Set a frequency for clock
1314 return -EINVAL; in ti_sci_cmd_clk_set_freq()
1323 dev_err(info->dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_clk_set_freq()
1334 dev_err(info->dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_clk_set_freq()
1338 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_cmd_clk_set_freq()
1341 return -ENODEV; in ti_sci_cmd_clk_set_freq()
1347 * ti_sci_cmd_clk_get_freq() - Get current frequency
1369 return -EINVAL; in ti_sci_cmd_clk_get_freq()
1378 dev_err(info->dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_clk_get_freq()
1386 dev_err(info->dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_clk_get_freq()
1390 resp = (struct ti_sci_msg_resp_get_clock_freq *)xfer->tx_message.buf; in ti_sci_cmd_clk_get_freq()
1393 ret = -ENODEV; in ti_sci_cmd_clk_get_freq()
1395 *freq = resp->freq_hz; in ti_sci_cmd_clk_get_freq()
1401 * ti_sci_cmd_core_reboot() - Command to request system reset
1417 return -EINVAL; in ti_sci_cmd_core_reboot()
1426 dev_err(info->dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_core_reboot()
1436 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_cmd_core_reboot()
1439 return -ENODEV; in ti_sci_cmd_core_reboot()
1445 * ti_sci_cmd_proc_request() - Command to request a physical processor control
1463 return -EINVAL; in ti_sci_cmd_proc_request()
1472 dev_err(info->dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_proc_request()
1479 dev_err(info->dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_proc_request()
1483 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_cmd_proc_request()
1486 ret = -ENODEV; in ti_sci_cmd_proc_request()
1492 * ti_sci_cmd_proc_release() - Command to release a physical processor control
1510 return -EINVAL; in ti_sci_cmd_proc_release()
1519 dev_err(info->dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_proc_release()
1526 dev_err(info->dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_proc_release()
1530 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_cmd_proc_release()
1533 ret = -ENODEV; in ti_sci_cmd_proc_release()
1539 * ti_sci_cmd_proc_handover() - Command to handover a physical processor
1560 return -EINVAL; in ti_sci_cmd_proc_handover()
1569 dev_err(info->dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_proc_handover()
1577 dev_err(info->dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_proc_handover()
1581 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_cmd_proc_handover()
1584 ret = -ENODEV; in ti_sci_cmd_proc_handover()
1590 * ti_sci_cmd_set_proc_boot_cfg() - Command to set the processor boot
1613 return -EINVAL; in ti_sci_cmd_set_proc_boot_cfg()
1622 dev_err(info->dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_set_proc_boot_cfg()
1634 dev_err(info->dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_set_proc_boot_cfg()
1638 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_cmd_set_proc_boot_cfg()
1641 ret = -ENODEV; in ti_sci_cmd_set_proc_boot_cfg()
1647 * ti_sci_cmd_set_proc_boot_ctrl() - Command to set the processor boot
1669 return -EINVAL; in ti_sci_cmd_set_proc_boot_ctrl()
1678 dev_err(info->dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_set_proc_boot_ctrl()
1687 dev_err(info->dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_set_proc_boot_ctrl()
1691 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_cmd_set_proc_boot_ctrl()
1694 ret = -ENODEV; in ti_sci_cmd_set_proc_boot_ctrl()
1700 * ti_sci_cmd_proc_auth_boot_image() - Command to authenticate and load the
1720 return -EINVAL; in ti_sci_cmd_proc_auth_boot_image()
1729 dev_err(info->dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_proc_auth_boot_image()
1739 dev_err(info->dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_proc_auth_boot_image()
1743 resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_cmd_proc_auth_boot_image()
1746 ret = -ENODEV; in ti_sci_cmd_proc_auth_boot_image()
1752 * ti_sci_cmd_get_proc_boot_status() - Command to get the processor boot status
1771 return -EINVAL; in ti_sci_cmd_get_proc_boot_status()
1780 dev_err(info->dev, "Message alloc failed(%d)\n", ret); in ti_sci_cmd_get_proc_boot_status()
1787 dev_err(info->dev, "Mbox send fail %d\n", ret); in ti_sci_cmd_get_proc_boot_status()
1792 xfer->tx_message.buf; in ti_sci_cmd_get_proc_boot_status()
1795 return -ENODEV; in ti_sci_cmd_get_proc_boot_status()
1796 *bv = (resp->bootvector_low & TISCI_ADDR_LOW_MASK) | in ti_sci_cmd_get_proc_boot_status()
1797 (((u64)resp->bootvector_high << in ti_sci_cmd_get_proc_boot_status()
1799 *cfg_flags = resp->config_flags; in ti_sci_cmd_get_proc_boot_status()
1800 *ctrl_flags = resp->control_flags; in ti_sci_cmd_get_proc_boot_status()
1801 *sts_flags = resp->status_flags; in ti_sci_cmd_get_proc_boot_status()
1807 * ti_sci_setup_ops() - Setup the operations structures
1812 struct ti_sci_ops *ops = &info->handle.ops; in ti_sci_setup_ops()
1813 struct ti_sci_board_ops *bops = &ops->board_ops; in ti_sci_setup_ops()
1814 struct ti_sci_dev_ops *dops = &ops->dev_ops; in ti_sci_setup_ops()
1815 struct ti_sci_clk_ops *cops = &ops->clk_ops; in ti_sci_setup_ops()
1816 struct ti_sci_core_ops *core_ops = &ops->core_ops; in ti_sci_setup_ops()
1817 struct ti_sci_proc_ops *pops = &ops->proc_ops; in ti_sci_setup_ops()
1819 bops->board_config = ti_sci_cmd_set_board_config; in ti_sci_setup_ops()
1820 bops->board_config_rm = ti_sci_cmd_set_board_config_rm; in ti_sci_setup_ops()
1821 bops->board_config_security = ti_sci_cmd_set_board_config_security; in ti_sci_setup_ops()
1822 bops->board_config_pm = ti_sci_cmd_set_board_config_pm; in ti_sci_setup_ops()
1824 dops->get_device = ti_sci_cmd_get_device; in ti_sci_setup_ops()
1825 dops->idle_device = ti_sci_cmd_idle_device; in ti_sci_setup_ops()
1826 dops->put_device = ti_sci_cmd_put_device; in ti_sci_setup_ops()
1827 dops->is_valid = ti_sci_cmd_dev_is_valid; in ti_sci_setup_ops()
1828 dops->get_context_loss_count = ti_sci_cmd_dev_get_clcnt; in ti_sci_setup_ops()
1829 dops->is_idle = ti_sci_cmd_dev_is_idle; in ti_sci_setup_ops()
1830 dops->is_stop = ti_sci_cmd_dev_is_stop; in ti_sci_setup_ops()
1831 dops->is_on = ti_sci_cmd_dev_is_on; in ti_sci_setup_ops()
1832 dops->is_transitioning = ti_sci_cmd_dev_is_trans; in ti_sci_setup_ops()
1833 dops->set_device_resets = ti_sci_cmd_set_device_resets; in ti_sci_setup_ops()
1834 dops->get_device_resets = ti_sci_cmd_get_device_resets; in ti_sci_setup_ops()
1836 cops->get_clock = ti_sci_cmd_get_clock; in ti_sci_setup_ops()
1837 cops->idle_clock = ti_sci_cmd_idle_clock; in ti_sci_setup_ops()
1838 cops->put_clock = ti_sci_cmd_put_clock; in ti_sci_setup_ops()
1839 cops->is_auto = ti_sci_cmd_clk_is_auto; in ti_sci_setup_ops()
1840 cops->is_on = ti_sci_cmd_clk_is_on; in ti_sci_setup_ops()
1841 cops->is_off = ti_sci_cmd_clk_is_off; in ti_sci_setup_ops()
1843 cops->set_parent = ti_sci_cmd_clk_set_parent; in ti_sci_setup_ops()
1844 cops->get_parent = ti_sci_cmd_clk_get_parent; in ti_sci_setup_ops()
1845 cops->get_num_parents = ti_sci_cmd_clk_get_num_parents; in ti_sci_setup_ops()
1847 cops->get_best_match_freq = ti_sci_cmd_clk_get_match_freq; in ti_sci_setup_ops()
1848 cops->set_freq = ti_sci_cmd_clk_set_freq; in ti_sci_setup_ops()
1849 cops->get_freq = ti_sci_cmd_clk_get_freq; in ti_sci_setup_ops()
1851 core_ops->reboot_device = ti_sci_cmd_core_reboot; in ti_sci_setup_ops()
1853 pops->proc_request = ti_sci_cmd_proc_request; in ti_sci_setup_ops()
1854 pops->proc_release = ti_sci_cmd_proc_release; in ti_sci_setup_ops()
1855 pops->proc_handover = ti_sci_cmd_proc_handover; in ti_sci_setup_ops()
1856 pops->set_proc_boot_cfg = ti_sci_cmd_set_proc_boot_cfg; in ti_sci_setup_ops()
1857 pops->set_proc_boot_ctrl = ti_sci_cmd_set_proc_boot_ctrl; in ti_sci_setup_ops()
1858 pops->proc_auth_boot_image = ti_sci_cmd_proc_auth_boot_image; in ti_sci_setup_ops()
1859 pops->get_proc_boot_status = ti_sci_cmd_get_proc_boot_status; in ti_sci_setup_ops()
1863 * ti_sci_get_handle_from_sysfw() - Get the TI SCI handle of the SYSFW
1873 return ERR_PTR(-EINVAL); in ti_sci_get_handle_from_sysfw()
1878 return ERR_PTR(-EINVAL); in ti_sci_get_handle_from_sysfw()
1880 struct ti_sci_handle *handle = &info->handle; in ti_sci_get_handle_from_sysfw()
1883 return ERR_PTR(-EINVAL); in ti_sci_get_handle_from_sysfw()
1889 * ti_sci_get_handle() - Get the TI SCI handle for a device
1898 return ERR_PTR(-EINVAL); in ti_sci_get_handle()
1906 * ti_sci_get_by_phandle() - Get the TI SCI handle using DT phandle
1925 return ERR_PTR(-EINVAL); in ti_sci_get_by_phandle()
1928 if (ofnode_equal(dev_ofnode(entry->dev), node)) { in ti_sci_get_by_phandle()
1934 return ERR_PTR(-ENODEV); in ti_sci_get_by_phandle()
1936 return &info->handle; in ti_sci_get_by_phandle()
1940 * ti_sci_of_to_info() - generate private data from device tree
1950 ret = mbox_get_by_name(dev, "tx", &info->chan_tx); in ti_sci_of_to_info()
1957 ret = mbox_get_by_name(dev, "rx", &info->chan_rx); in ti_sci_of_to_info()
1965 ret = mbox_get_by_name(dev, "notify", &info->chan_notify); in ti_sci_of_to_info()
1971 info->host_id = dev_read_u32_default(dev, "ti,host-id", in ti_sci_of_to_info()
1972 info->desc->host_id); in ti_sci_of_to_info()
1974 info->is_secure = dev_read_bool(dev, "ti,secure-host"); in ti_sci_of_to_info()
1980 * ti_sci_probe() - Basic probe
1993 info->desc = (void *)dev_get_driver_data(dev); in ti_sci_probe()
2001 info->dev = dev; in ti_sci_probe()
2002 info->seq = 0xA; in ti_sci_probe()
2004 list_add_tail(&info->list, &ti_sci_list); in ti_sci_probe()
2007 ret = ti_sci_cmd_get_revision(&info->handle); in ti_sci_probe()
2012 /* Description for AM654 */
2021 .compatible = "ti,k2g-sci",