summaryrefslogtreecommitdiff
path: root/src/soc/mediatek/common
diff options
context:
space:
mode:
authorYidi Lin <yidi.lin@mediatek.com>2021-04-19 13:58:07 +0800
committerHung-Te Lin <hungte@chromium.org>2021-04-21 08:56:36 +0000
commitab686715f29ffd323a5880685b587981abddeac6 (patch)
tree613cd806c756f699379eb178030e6ec06ce0611b /src/soc/mediatek/common
parente5d3b4e36e1e9ac6701a6f337b601420c7d88779 (diff)
src/mediatek: Move mt8192 eint driver to common
The eint driver can be shared by multiple platforms so we want to move it to common/. BRANCH=asurada TEST=emerge-asurada coreboot Signed-off-by: Yidi Lin <yidi.lin@mediatek.com> Change-Id: Id8e0b631d5079e51213831ed17aa540e0afadd4b Reviewed-on: https://review.coreboot.org/c/coreboot/+/52506 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Diffstat (limited to 'src/soc/mediatek/common')
-rw-r--r--src/soc/mediatek/common/eint_event.c10
-rw-r--r--src/soc/mediatek/common/include/soc/eint_event.h20
2 files changed, 30 insertions, 0 deletions
diff --git a/src/soc/mediatek/common/eint_event.c b/src/soc/mediatek/common/eint_event.c
new file mode 100644
index 0000000000..b3538a1ddf
--- /dev/null
+++ b/src/soc/mediatek/common/eint_event.c
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <soc/eint_event.h>
+
+void unmask_eint_event_mask(void)
+{
+ int i;
+ for (i = 0; i < ARRAY_SIZE(mtk_eint_event->eint_event_mask_clr); i++)
+ write32(&mtk_eint_event->eint_event_mask_clr[i], 0xffffffff);
+}
diff --git a/src/soc/mediatek/common/include/soc/eint_event.h b/src/soc/mediatek/common/include/soc/eint_event.h
new file mode 100644
index 0000000000..98db7b04e8
--- /dev/null
+++ b/src/soc/mediatek/common/include/soc/eint_event.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef SOC_MEDIATEK_COMMON_EINT_EVENT_H
+#define SOC_MEDIATEK_COMMON_EINT_EVENT_H
+
+#include <device/mmio.h>
+#include <soc/addressmap.h>
+
+/* eint event mask cler register */
+struct eint_event_reg {
+ uint32_t eint_event_mask_clr[7];
+};
+
+/* eint_base + 0x880 is eint_event_mask_clr register with access type W1C. */
+static struct eint_event_reg *const mtk_eint_event = (void *)(EINT_BASE + 0x880);
+
+/* unmask eint event, eint can wakeup by spm */
+void unmask_eint_event_mask(void);
+
+#endif