summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorgi Vlaev <g-vlaev@ti.com>2023-01-31 07:12:40 -0600
committerPraneeth Bajjuri <praneeth@ti.com>2023-02-08 11:35:31 -0600
commit5707dea5e402ae25f12ff92c31e5c4c64215e136 (patch)
tree131a9ea0625de00f31c698efec6df50af06a20c6 /include
parentf7159c3fb483695e5f0257b236b88be6d28fe85f (diff)
firmware: ti_sci: Introduce Power Management Ops
Upstream: https://lore.kernel.org/all/20221128140522.49474-3-g-vlaev@ti.com/ Introduce power management ops supported by the TISCI Low Power Mode API [1]. These messages are currently supported only on AM62x platforms. 1) TISCI_MSG_LPM_WAKE_REASON Get which wake up source woke the SoC from Low Power Mode. The wake up source IDs will be common for all K3 platforms. 2) TISCI_MSG_SET_IO_ISOLATION Control the IO isolation for Low Power Mode. [1] https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/pm/lpm.html Signed-off-by: Georgi Vlaev <g-vlaev@ti.com> [backport: Selected relevant hunks for ti-linux-5.10.y] Signed-off-by: Vibhore Vardhan <vibhore@ti.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/soc/ti/ti_sci_protocol.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/linux/soc/ti/ti_sci_protocol.h b/include/linux/soc/ti/ti_sci_protocol.h
index 8adcb45d4b5c..f2d1d74ab8fc 100644
--- a/include/linux/soc/ti/ti_sci_protocol.h
+++ b/include/linux/soc/ti/ti_sci_protocol.h
@@ -195,9 +195,47 @@ struct ti_sci_clk_ops {
u64 *current_freq);
};
+/* TISCI LPM wake up sources */
+#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_WKUP_I2C0 0x00
+#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_WKUP_UART0 0x10
+#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_MCU_GPIO0 0x20
+#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_WKUP_ICEMELTER0 0x30
+#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_WKUP_TIMER0 0x40
+#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_WKUP_TIMER1 0x41
+#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_WKUP_RTC0 0x50
+#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_RESET 0x60
+#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_USB0 0x70
+#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_USB1 0x71
+#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_MAIN_IO 0x80
+#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_MCU_IO 0x81
+#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_CAN_IO 0x82
+#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_INVALID 0xFF
+
+/* TISCI LPM IO isolation control values */
+#define TISCI_MSG_VALUE_IO_ENABLE 1
+#define TISCI_MSG_VALUE_IO_DISABLE 0
+
+/**
+ * struct ti_sci_pm_ops - Low Power Mode (LPM) control operations
+ * @prepare_sleep: Prepare to enter low power mode
+ * - mode: Low power mode to enter.
+ * - ctx_lo: Low 32-bits of physical address for context save.
+ * - ctx_hi: High 32-bits of physical address for context save.
+ * - ctx_lo: 'true' if frequency change is desired.
+ * - debug_flags: JTAG control flags for debug.
+ * @lpm_wake_reason: Get the wake up source that woke the SoC from LPM
+ * - source: The wake up source that woke soc from LPM.
+ * - timestamp: Timestamp at which soc woke.
+ * @set_io_isolation: Enable or disable IO isolation
+ * - state: The desired state of the IO isolation.
+ */
struct ti_sci_pm_ops {
int (*prepare_sleep)(const struct ti_sci_handle *handle, u8 mode,
u32 ctx_lo, u32 ctx_hi, u32 flags);
+ int (*lpm_wake_reason)(const struct ti_sci_handle *handle,
+ u32 *source, u64 *timestamp);
+ int (*set_io_isolation)(const struct ti_sci_handle *handle,
+ u8 state);
};
/**