summaryrefslogtreecommitdiff
path: root/plat/ti
diff options
context:
space:
mode:
authorAndrew F. Davis <afd@ti.com>2018-05-04 19:06:12 +0000
committerAndrew F. Davis <afd@ti.com>2018-08-22 10:57:19 -0500
commit7b8f3e2db3d523aa3d4ae1797899c91286240ad7 (patch)
tree77c39ed92eab32ed0ee0f309a7c45ada7d7b1c4d /plat/ti
parent6d1dfef6bf6422007aaa738c2d390070621e7a90 (diff)
ti: k3: drivers: ti_sci: Add support for Core control
Since system controller now has control over SoC power management, core operation such as reset need to be explicitly requested to reboot the SoC. Add support for this here. Signed-off-by: Andrew F. Davis <afd@ti.com> Reviewed-by: Andreas Dannenberg <dannenberg@ti.com>
Diffstat (limited to 'plat/ti')
-rw-r--r--plat/ti/k3/common/drivers/ti_sci/ti_sci.c35
-rw-r--r--plat/ti/k3/common/drivers/ti_sci/ti_sci.h9
2 files changed, 44 insertions, 0 deletions
diff --git a/plat/ti/k3/common/drivers/ti_sci/ti_sci.c b/plat/ti/k3/common/drivers/ti_sci/ti_sci.c
index f45118c4..f5d2ce18 100644
--- a/plat/ti/k3/common/drivers/ti_sci/ti_sci.c
+++ b/plat/ti/k3/common/drivers/ti_sci/ti_sci.c
@@ -1118,6 +1118,41 @@ int ti_sci_clock_get_freq(uint32_t dev_id, uint8_t clk_id, uint64_t *freq)
}
/**
+ * ti_sci_core_reboot() - Command to request system reset
+ *
+ * Return: 0 if all goes well, else appropriate error message
+ */
+int ti_sci_core_reboot(void)
+{
+ struct ti_sci_msg_req_reboot req;
+ struct ti_sci_msg_hdr resp;
+
+ struct ti_sci_xfer xfer;
+ int ret;
+
+ ret = ti_sci_setup_one_xfer(TI_SCI_MSG_SYS_RESET,
+ TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ &req, sizeof(req),
+ &resp, sizeof(resp),
+ &xfer);
+ if (ret) {
+ ERROR("Message alloc failed (%d)\n", ret);
+ return ret;
+ }
+
+ ret = ti_sci_do_xfer(&xfer);
+ if (ret) {
+ ERROR("Transfer send failed (%d)\n", ret);
+ return ret;
+ }
+
+ if (!ti_sci_is_response_ack(&resp))
+ return -ENODEV;
+
+ return 0;
+}
+
+/**
* ti_sci_init() - Basic initialization
*
* Return: 0 if all goes well, else appropriate error message
diff --git a/plat/ti/k3/common/drivers/ti_sci/ti_sci.h b/plat/ti/k3/common/drivers/ti_sci/ti_sci.h
index fc6b5b01..df0c13ec 100644
--- a/plat/ti/k3/common/drivers/ti_sci/ti_sci.h
+++ b/plat/ti/k3/common/drivers/ti_sci/ti_sci.h
@@ -153,6 +153,15 @@ int ti_sci_clock_set_freq(uint32_t dev_id, uint8_t clk_id,
int ti_sci_clock_get_freq(uint32_t dev_id, uint8_t clk_id, uint64_t *freq);
/**
+ * Core control operations
+ *
+ * - ti_sci_core_reboot() - Command to request system reset
+ *
+ * Return: 0 if all went well, else returns appropriate error value.
+ */
+int ti_sci_core_reboot(void);
+
+/**
* ti_sci_init() - Basic initialization
*
* Return: 0 if all goes good, else appropriate error message.