From 0b1779718ed45ffd63afc16fd380485dcd5ded34 Mon Sep 17 00:00:00 2001 From: Jarried Lin Date: Sat, 18 Jan 2025 23:40:56 +0800 Subject: [PATCH] soc/mediatek/mt8196: Add unmask eint event for bootblock EINT event mask register is used to mask EINT wakeup source. All wakeup sources are masked by default. Since most MediaTek SoCs do not have this design, we can't modify the kernel EINT upstream driver to solve the issue "Can't wake using power button (cros_ec) or touchpad". So we add a driver here to unmask all wakeup sources. TEST=write eint data successfully. BUG=b:317009620 Change-Id: I4bf3820a89172186b8f51591f8760787affbb7a3 Signed-off-by: Chhao Chang Reviewed-on: https://review.coreboot.org/c/coreboot/+/84025 Reviewed-by: Yidi Lin Tested-by: build bot (Jenkins) Reviewed-by: Yu-Ping Wu --- src/soc/mediatek/mt8196/Makefile.mk | 1 + src/soc/mediatek/mt8196/bootblock.c | 2 ++ src/soc/mediatek/mt8196/eint_event_info.c | 13 +++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 src/soc/mediatek/mt8196/eint_event_info.c diff --git a/src/soc/mediatek/mt8196/Makefile.mk b/src/soc/mediatek/mt8196/Makefile.mk index 80dac20cd2..0ef442f44f 100644 --- a/src/soc/mediatek/mt8196/Makefile.mk +++ b/src/soc/mediatek/mt8196/Makefile.mk @@ -15,6 +15,7 @@ bootblock-y += bootblock.c bootblock-y += ../common/bootblock.c bootblock.c bootblock-y += cksys.c bootblock-y += ../common/early_init.c +bootblock-y += ../common/eint_event.c eint_event_info.c bootblock-y += ../common/lastbus_v2.c lastbus.c bootblock-y += mminfra.c bootblock-y += ../common/mmu_operations.c diff --git a/src/soc/mediatek/mt8196/bootblock.c b/src/soc/mediatek/mt8196/bootblock.c index bd3c418d54..891a195637 100644 --- a/src/soc/mediatek/mt8196/bootblock.c +++ b/src/soc/mediatek/mt8196/bootblock.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -26,4 +27,5 @@ void bootblock_soc_init(void) mt_pll_post_init(); mtcmos_post_init(); early_init_clear(); + unmask_eint_event_mask(); } diff --git a/src/soc/mediatek/mt8196/eint_event_info.c b/src/soc/mediatek/mt8196/eint_event_info.c new file mode 100644 index 0000000000..5917b76e81 --- /dev/null +++ b/src/soc/mediatek/mt8196/eint_event_info.c @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR MIT */ + +#include +#include + +const struct eint_event_info eint_event[] = { + {EINT_E_BASE, 75}, + {EINT_S_BASE, 29}, + {EINT_W_BASE, 58}, + {EINT_N_BASE, 47}, + {EINT_C_BASE, 25}, + {}, +};