summaryrefslogtreecommitdiff
path: root/src/soc/mediatek/mt8186/pmif.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/mediatek/mt8186/pmif.c')
-rw-r--r--src/soc/mediatek/mt8186/pmif.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/soc/mediatek/mt8186/pmif.c b/src/soc/mediatek/mt8186/pmif.c
new file mode 100644
index 0000000000..b9096092d4
--- /dev/null
+++ b/src/soc/mediatek/mt8186/pmif.c
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+/*
+ * This file is created based on MT8186 Functional Specification
+ * Chapter number: 3.7
+ */
+
+#include <device/mmio.h>
+#include <soc/pmif.h>
+
+#define SLEEP_PROT_CTRL 0x3F0
+
+DEFINE_BITFIELD(SPM_SLEEP_REQ_SEL, 1, 0)
+DEFINE_BITFIELD(SCP_SLEEP_REQ_SEL, 10, 9)
+
+void pmif_spmi_set_lp_mode(void)
+{
+ SET32_BITFIELDS((void *)(PMIF_BASE + SLEEP_PROT_CTRL),
+ SPM_SLEEP_REQ_SEL, 0,
+ SCP_SLEEP_REQ_SEL, 0);
+}