]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
feat(mt8188): initialize GIC
authorRex-BC Chen <rex-bc.chen@mediatek.com>
Fri, 8 Jul 2022 05:58:33 +0000 (13:58 +0800)
committerBo-Chen Chen <rex-bc.chen@mediatek.com>
Mon, 5 Sep 2022 05:52:20 +0000 (13:52 +0800)
Initialize GIC for mt8188.

TEST=build pass
BUG=b:236331724

Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Change-Id: I5acf77d654f1bbce32e9fbb3f3567600b7db10ed

plat/mediatek/drivers/gic600/mt_gic_v3.c
plat/mediatek/drivers/gic600/mt_gic_v3.h
plat/mediatek/drivers/gic600/rules.mk [new file with mode: 0644]
plat/mediatek/include/mt8188/platform_def.h
plat/mediatek/mt8188/platform.mk

index 7652c4f0b4a1aaedd0f77a784870405afee573ba..cca5d0a56a36560f9d291994d552b0037ca5bdc9 100644 (file)
@@ -12,7 +12,7 @@
 #include <bl31/interrupt_mgmt.h>
 #include <common/bl_common.h>
 #include <common/debug.h>
-
+#include <lib/mtk_init/mtk_init.h>
 #include <mt_gic_v3.h>
 #include <mtk_plat_common.h>
 #include <plat/common/platform.h>
@@ -194,3 +194,15 @@ void mt_irq_set_pending(uint32_t irq)
        mmio_write_32(BASE_GICD_BASE + GICD_ISPENDR +
                irq / 32 * 4, bit);
 }
+
+int mt_gic_one_init(void)
+{
+       INFO("[%s] GIC initialization\n", __func__);
+
+       /* Initialize the GIC driver, CPU and distributor interfaces */
+       mt_gic_driver_init();
+       mt_gic_init();
+
+       return 0;
+}
+MTK_PLAT_SETUP_0_INIT(mt_gic_one_init);
index 98835f0f53d7a9d2ffaa637cf741fb4f4ed382e2..31513ef41cd98ff11b806fea28abf2e72daea865 100644 (file)
@@ -23,5 +23,6 @@ void gic_sgi_save_all(void);
 void gic_sgi_restore_all(void);
 uint32_t mt_irq_get_pending(uint32_t irq);
 void mt_irq_set_pending(uint32_t irq);
+int mt_gic_one_init(void);
 
 #endif /* MT_GIC_V3_H */
diff --git a/plat/mediatek/drivers/gic600/rules.mk b/plat/mediatek/drivers/gic600/rules.mk
new file mode 100644 (file)
index 0000000..3070591
--- /dev/null
@@ -0,0 +1,14 @@
+#
+# Copyright (c) 2022, MediaTek Inc. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+LOCAL_DIR := $(call GET_LOCAL_DIR)
+
+MODULE := gic600
+LOCAL_SRCS-y := $(LOCAL_DIR)/mt_gic_v3.c
+
+PLAT_INCLUDES += -I${LOCAL_DIR}
+
+$(eval $(call MAKE_MODULE,$(MODULE),$(LOCAL_SRCS-y),$(MTK_BL)))
index 946ac0413ce8dbf295b1f193b40f3fd30462fe85..c09139cf15d59792fd67d52d633e31dc6b38b32b 100644 (file)
 #define UART0_BASE     (IO_PHYS + 0x01002000)
 #define UART_BAUDRATE  (115200)
 
+/*******************************************************************************
+ * GIC-600 & interrupt handling related constants
+ ******************************************************************************/
+/* Base MTK_platform compatible GIC memory map */
+#define BASE_GICD_BASE         (MT_GIC_BASE)
+#define MT_GIC_RDIST_BASE      (MT_GIC_BASE + 0x40000)
+
 /*******************************************************************************
  * System counter frequency related constants
  ******************************************************************************/
index 08cebf0367adc98520e22ad40fa06999a10f49ab..82c4ce1384b216b1442eb2e7705515310c4e4528 100644 (file)
@@ -22,6 +22,7 @@ PLAT_INCLUDES := -I${MTK_PLAT}/common \
 MODULES-y += $(MTK_PLAT)/common
 MODULES-y += $(MTK_PLAT)/lib/mtk_init
 MODULES-y += $(MTK_PLAT)/lib/pm
+MODULES-y += $(MTK_PLAT)/drivers/gic600
 MODULES-y += $(MTK_PLAT)/drivers/timer
 
 PLAT_BL_COMMON_SOURCES := common/desc_image_load.c \