summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRanjani Vaidyanathan <ranjani.vaidyanathan@nxp.com>2021-10-06 11:54:26 -0500
committerPhilippe Schenker <philippe.schenker@toradex.com>2022-05-18 16:41:20 +0200
commit16dca2c7b2822eb3e0bec15e6a16a7d2ba434395 (patch)
treeec56605fe1047a2b2e25f7be376c388026471ff3 /include/linux
parentf04bac0476413576c8f5047c74325ecd7fd05b7a (diff)
MLK-25649-1 firmware: imx: imx-scu-irq: Add support for identifying SCU wakeup source from sysfs
Record SCU wakeup interrupt in /sys/power/pm_wakeup_irq The user can further identify the exact wakeup source by using the following interface: cat /sys/firmware/scu_wakeup_source/wakeup_src The above will print the wake groups and the irqs that could have contributed to waking up the kernel. For example if ON/OFF button was the wakeup source: cat /sys/firmware/scu_wakeup_source/wakeup_src Wakeup source group = 3, irq = 0x1 The user can refer to the SCFW API documentation to identify all the wake groups and irqs. Signed-off-by: Ranjani Vaidyanathan <ranjani.vaidyanathan@nxp.com> (cherry picked from commit d49daabfb43eddf94144560fc2eef58015311454) (cherry picked from commit fed9f95ad512fd4b4cca7c8bfd08a78ddcaebeb9)
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/firmware/imx/sci.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/include/linux/firmware/imx/sci.h b/include/linux/firmware/imx/sci.h
index e749594436bb..70fe789aa842 100644
--- a/include/linux/firmware/imx/sci.h
+++ b/include/linux/firmware/imx/sci.h
@@ -17,12 +17,34 @@
#include <linux/firmware/imx/svc/rm.h>
#include <linux/firmware/imx/svc/seco.h>
-#define IMX_SC_IRQ_GROUP_WAKE 3U /* Wakeup interrupts */
+#define IMX_SC_IRQ_NUM_GROUP 9
+
+#define IMX_SC_IRQ_GROUP_TEMP 0 /* Temp interrupts */
+#define IMX_SC_IRQ_GROUP_WDOG 1 /* Watchdog interrupts */
+#define IMX_SC_IRQ_GROUP_RTC 2 /* RTC interrupts */
+#define IMX_SC_IRQ_GROUP_WAKE 3 /* Wakeup interrupts */
+#define IMX_SC_IRQ_GROUP_SYSCTR 4 /* System counter interrupts */
+#define IMX_SC_IRQ_GROUP_REBOOTED 5 /* Partition reboot complete */
+#define IMX_SC_IRQ_GROUP_REBOOT 6 /* Partition reboot starting */
+#define IMX_SC_IRQ_GROUP_OFFED 7 /* Partition off complete */
+#define IMX_SC_IRQ_GROUP_OFF 8 /* Partition off starting */
+
+#define IMX_SC_IRQ_RTC BIT(0) /* RTC interrupt */
+#define IMX_SC_IRQ_WDOG BIT(0) /* Watch Dog interrupt */
+#define IMX_SC_IRQ_SYSCTR BIT(0) /* System Counter interrupt */
+#define IMX_SC_IRQ_BUTTON BIT(0) /* Button interrupt */
+#define IMX_SC_IRQ_PAD BIT(1) /* Pad wakeup */
+#define IMX_SC_IRQ_USR1 BIT(2) /* User defined 1 */
+#define IMX_SC_IRQ_USR2 BIT(3) /* User defined 2 */
+#define IMX_SC_IRQ_BC_PAD BIT(4) /* Pad wakeup (broadcast to all partitions) */
+#define IMX_SC_IRQ_SW_WAKE BIT(5) /* Software requested wake */
#define IMX_SC_IRQ_SECVIO BIT(6) /* Security violation */
+#define IMX_SC_IRQ_V2X_RESET BIT(7) /* V2X reset */
int imx_scu_enable_general_irq_channel(struct device *dev);
int imx_scu_irq_register_notifier(struct notifier_block *nb);
int imx_scu_irq_unregister_notifier(struct notifier_block *nb);
int imx_scu_irq_group_enable(u8 group, u32 mask, u8 enable);
int imx_scu_irq_get_status(u8 group, u32 *irq_status);
+
#endif /* _SC_SCI_H */