diff --git a/plat/mediatek/mt8192/plat_mt_gic.c b/plat/mediatek/common/drivers/gic600/mt_gic_v3.c similarity index 100% rename from plat/mediatek/mt8192/plat_mt_gic.c rename to plat/mediatek/common/drivers/gic600/mt_gic_v3.c diff --git a/plat/mediatek/mt8192/include/mt_gic_v3.h b/plat/mediatek/common/drivers/gic600/mt_gic_v3.h similarity index 100% rename from plat/mediatek/mt8192/include/mt_gic_v3.h rename to plat/mediatek/common/drivers/gic600/mt_gic_v3.h diff --git a/plat/mediatek/mt8192/include/platform_def.h b/plat/mediatek/mt8192/include/platform_def.h index 540463d66741ba6bfa80c393ff54c633e62c48c8..2468dd6c5291be1ec4d83186a4649ae8c00e5ab1 100644 --- a/plat/mediatek/mt8192/include/platform_def.h +++ b/plat/mediatek/mt8192/include/platform_def.h @@ -61,7 +61,7 @@ #define SYS_COUNTER_FREQ_IN_MHZ 13 /******************************************************************************* - * GIC-400 & interrupt handling related constants + * GIC-600 & interrupt handling related constants ******************************************************************************/ /* Base MTK_platform compatible GIC memory map */ diff --git a/plat/mediatek/mt8192/platform.mk b/plat/mediatek/mt8192/platform.mk index e45f649c860264c585f27eaf9ec78e36f6aee329..109dac0b9a472253bd33deeb8db6ec0f29522441 100644 --- a/plat/mediatek/mt8192/platform.mk +++ b/plat/mediatek/mt8192/platform.mk @@ -8,7 +8,8 @@ MTK_PLAT := plat/mediatek MTK_PLAT_SOC := ${MTK_PLAT}/${PLAT} PLAT_INCLUDES := -I${MTK_PLAT}/common/ \ - -I${MTK_PLAT}/common/drivers/uart/ \ + -I${MTK_PLAT}/common/drivers/gic600/ \ + -I${MTK_PLAT}/common/drivers/uart/ \ -I${MTK_PLAT}/common/lpm/ \ -I${MTK_PLAT_SOC}/include/ \ -I${MTK_PLAT_SOC}/drivers/ \ @@ -40,6 +41,7 @@ BL31_SOURCES += common/desc_image_load.c \ lib/cpus/aarch64/cortex_a55.S \ lib/cpus/aarch64/cortex_a76.S \ plat/common/plat_gicv3.c \ + ${MTK_PLAT}/common/drivers/gic600/mt_gic_v3.c \ ${MTK_PLAT}/common/drivers/pmic_wrap/pmic_wrap_init_v2.c \ ${MTK_PLAT}/common/drivers/rtc/rtc_common.c \ ${MTK_PLAT}/common/drivers/uart/uart.c \ @@ -54,7 +56,6 @@ BL31_SOURCES += common/desc_image_load.c \ ${MTK_PLAT_SOC}/drivers/rtc/rtc.c \ ${MTK_PLAT_SOC}/plat_pm.c \ ${MTK_PLAT_SOC}/plat_topology.c \ - ${MTK_PLAT_SOC}/plat_mt_gic.c \ ${MTK_PLAT_SOC}/plat_mt_cirq.c \ ${MTK_PLAT_SOC}/plat_sip_calls.c \ ${MTK_PLAT_SOC}/drivers/dcm/mtk_dcm.c \ diff --git a/plat/mediatek/mt8195/bl31_plat_setup.c b/plat/mediatek/mt8195/bl31_plat_setup.c index 5b50336b910c580ee4a75cd536e703680d4e5cd2..6168d3545e220b2edb69d0288b5b53f5638d5117 100644 --- a/plat/mediatek/mt8195/bl31_plat_setup.c +++ b/plat/mediatek/mt8195/bl31_plat_setup.c @@ -15,6 +15,7 @@ #include /* Platform Includes */ +#include #include #include @@ -79,6 +80,9 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, ******************************************************************************/ void bl31_platform_setup(void) { + /* Initialize the GIC driver, CPU and distributor interfaces */ + mt_gic_driver_init(); + mt_gic_init(); } /******************************************************************************* diff --git a/plat/mediatek/mt8195/include/platform_def.h b/plat/mediatek/mt8195/include/platform_def.h index 73f609af34c8d4fc7451578d02fe4822f6b16ba9..59f0284f478ff6673ee87b053b6f5a90aefa364e 100644 --- a/plat/mediatek/mt8195/include/platform_def.h +++ b/plat/mediatek/mt8195/include/platform_def.h @@ -36,6 +36,13 @@ #define SYS_COUNTER_FREQ_IN_TICKS 13000000 #define SYS_COUNTER_FREQ_IN_MHZ 13 +/******************************************************************************* + * 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) + /******************************************************************************* * Platform binary types for linking ******************************************************************************/ diff --git a/plat/mediatek/mt8195/platform.mk b/plat/mediatek/mt8195/platform.mk index c89ca90172ebdf520c395098eb7d2eefc258663a..08dcfa29d5bdd9602b82e2858ea7b5214a96f79b 100644 --- a/plat/mediatek/mt8195/platform.mk +++ b/plat/mediatek/mt8195/platform.mk @@ -8,8 +8,10 @@ MTK_PLAT := plat/mediatek MTK_PLAT_SOC := ${MTK_PLAT}/${PLAT} PLAT_INCLUDES := -I${MTK_PLAT}/common/ \ + -I${MTK_PLAT}/common/drivers/gic600/ \ -I${MTK_PLAT_SOC}/include/ +GICV3_SUPPORT_GIC600 := 1 include drivers/arm/gic/v3/gicv3.mk include lib/xlat_tables_v2/xlat_tables.mk @@ -25,6 +27,7 @@ BL31_SOURCES += common/desc_image_load.c \ lib/cpus/aarch64/cortex_a55.S \ lib/cpus/aarch64/cortex_a78.S \ plat/common/plat_gicv3.c \ + ${MTK_PLAT}/common/drivers/gic600/mt_gic_v3.c \ ${MTK_PLAT}/common/mtk_plat_common.c \ ${MTK_PLAT}/common/params_setup.c \ ${MTK_PLAT_SOC}/aarch64/platform_common.c \