summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/soc/mediatek/mt8186/Makefile.inc1
-rw-r--r--src/soc/mediatek/mt8186/bootblock.c2
-rw-r--r--src/soc/mediatek/mt8186/gic.c20
-rw-r--r--src/soc/mediatek/mt8186/include/soc/gic.h13
4 files changed, 36 insertions, 0 deletions
diff --git a/src/soc/mediatek/mt8186/Makefile.inc b/src/soc/mediatek/mt8186/Makefile.inc
index 37c1b3c9de8f..4c89f3d6b9e4 100644
--- a/src/soc/mediatek/mt8186/Makefile.inc
+++ b/src/soc/mediatek/mt8186/Makefile.inc
@@ -3,6 +3,7 @@ ifeq ($(CONFIG_SOC_MEDIATEK_MT8186),y)
bootblock-y += bootblock.c
bootblock-y += ../common/eint_event.c
bootblock-y += ../common/flash_controller.c
+bootblock-y += gic.c
bootblock-y += ../common/gpio.c gpio.c
bootblock-y += ../common/mmu_operations.c
bootblock-y += ../common/pll.c pll.c
diff --git a/src/soc/mediatek/mt8186/bootblock.c b/src/soc/mediatek/mt8186/bootblock.c
index 17fd27e53f77..d5b288a1687d 100644
--- a/src/soc/mediatek/mt8186/bootblock.c
+++ b/src/soc/mediatek/mt8186/bootblock.c
@@ -2,6 +2,7 @@
#include <bootblock_common.h>
#include <soc/eint_event.h>
+#include <soc/gic.h>
#include <soc/mmu_operations.h>
#include <soc/pll.h>
#include <soc/wdt.h>
@@ -12,4 +13,5 @@ void bootblock_soc_init(void)
mtk_wdt_init();
mt_pll_init();
unmask_eint_event_mask();
+ mtk_gic_preinit();
}
diff --git a/src/soc/mediatek/mt8186/gic.c b/src/soc/mediatek/mt8186/gic.c
new file mode 100644
index 000000000000..ac077647af6e
--- /dev/null
+++ b/src/soc/mediatek/mt8186/gic.c
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+/*
+ * This file is created based on MT8186 Functional Specification
+ * Chapter number: 4.3
+ */
+
+#include <device/mmio.h>
+#include <soc/addressmap.h>
+#include <soc/gic.h>
+
+void mtk_gic_preinit(void)
+{
+ int i;
+
+ for (i = 3; i < 15; i++) {
+ write32((void *)((uintptr_t)MCUSYS_BASE + 0xA600 + i * 4), 0);
+ write32((void *)((uintptr_t)MCUSYS_BASE + 0xA650 + i * 4), 0xFFFFFFFF);
+ }
+}
diff --git a/src/soc/mediatek/mt8186/include/soc/gic.h b/src/soc/mediatek/mt8186/include/soc/gic.h
new file mode 100644
index 000000000000..7e1110771767
--- /dev/null
+++ b/src/soc/mediatek/mt8186/include/soc/gic.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+/*
+ * This file is created based on MT8186 Functional Specification
+ * Chapter number: 4.3
+ */
+
+#ifndef SOC_MEDIATEK_MT8186_GIC_H
+#define SOC_MEDIATEK_MT8186_GIC_H
+
+void mtk_gic_preinit(void);
+
+#endif