diff --git a/plat/mediatek/mt8192/plat_mt_cirq.c b/plat/mediatek/common/mtk_cirq.c similarity index 99% rename from plat/mediatek/mt8192/plat_mt_cirq.c rename to plat/mediatek/common/mtk_cirq.c index 9002b7ee1..de3798684 100644 --- a/plat/mediatek/mt8192/plat_mt_cirq.c +++ b/plat/mediatek/common/mtk_cirq.c @@ -10,8 +10,7 @@ #include #include -#include -#include +#include static struct cirq_events cirq_all_events = { .spi_start = CIRQ_SPI_START, diff --git a/plat/mediatek/mt8192/include/plat_mt_cirq.h b/plat/mediatek/common/mtk_cirq.h similarity index 93% rename from plat/mediatek/mt8192/include/plat_mt_cirq.h rename to plat/mediatek/common/mtk_cirq.h index bb8b4577f..6e63bb834 100644 --- a/plat/mediatek/mt8192/include/plat_mt_cirq.h +++ b/plat/mediatek/common/mtk_cirq.h @@ -8,6 +8,7 @@ #define PLAT_MT_CIRQ_H #include +#include enum { IRQ_MASK_HEADER = 0xF1F1F1F1, @@ -35,13 +36,6 @@ struct mtk_irq_mask { /* * Define hardware register */ - -#define SYS_CIRQ_BASE U(0x10204000) -#define CIRQ_REG_NUM U(14) -#define CIRQ_IRQ_NUM U(439) -#define CIRQ_SPI_START U(64) -#define MD_WDT_IRQ_BIT_ID U(110) - #define CIRQ_STA_BASE (SYS_CIRQ_BASE + U(0x000)) #define CIRQ_ACK_BASE (SYS_CIRQ_BASE + U(0x080)) #define CIRQ_MASK_BASE (SYS_CIRQ_BASE + U(0x100)) diff --git a/plat/mediatek/mt8192/drivers/mcdi/mt_lp_irqremain.c b/plat/mediatek/mt8192/drivers/mcdi/mt_lp_irqremain.c index 809518fff..e74d3e7bc 100644 --- a/plat/mediatek/mt8192/drivers/mcdi/mt_lp_irqremain.c +++ b/plat/mediatek/mt8192/drivers/mcdi/mt_lp_irqremain.c @@ -6,8 +6,8 @@ #include #include +#include #include -#include #define EDMA0_IRQ_ID U(448) #define MDLA_IRQ_ID U(446) diff --git a/plat/mediatek/mt8192/drivers/spm/constraints/mt_spm_rc_bus26m.c b/plat/mediatek/mt8192/drivers/spm/constraints/mt_spm_rc_bus26m.c index 92fd25fd3..f66b8ec93 100644 --- a/plat/mediatek/mt8192/drivers/spm/constraints/mt_spm_rc_bus26m.c +++ b/plat/mediatek/mt8192/drivers/spm/constraints/mt_spm_rc_bus26m.c @@ -24,7 +24,7 @@ #ifndef ATF_PLAT_CIRQ_UNSUPPORT #include -#include +#include #endif #define CONSTRAINT_BUS26M_ALLOW \ diff --git a/plat/mediatek/mt8192/include/platform_def.h b/plat/mediatek/mt8192/include/platform_def.h index 2468dd6c5..76a9c24ae 100644 --- a/plat/mediatek/mt8192/include/platform_def.h +++ b/plat/mediatek/mt8192/include/platform_def.h @@ -68,6 +68,12 @@ #define BASE_GICD_BASE MT_GIC_BASE #define MT_GIC_RDIST_BASE (MT_GIC_BASE + 0x40000) +#define SYS_CIRQ_BASE (IO_PHYS + 0x204000) +#define CIRQ_REG_NUM 14 +#define CIRQ_IRQ_NUM 439 +#define CIRQ_SPI_START 64 +#define MD_WDT_IRQ_BIT_ID 110 + /******************************************************************************* * Platform binary types for linking ******************************************************************************/ diff --git a/plat/mediatek/mt8192/platform.mk b/plat/mediatek/mt8192/platform.mk index 109dac0b9..e1657a721 100644 --- a/plat/mediatek/mt8192/platform.mk +++ b/plat/mediatek/mt8192/platform.mk @@ -46,6 +46,7 @@ BL31_SOURCES += common/desc_image_load.c \ ${MTK_PLAT}/common/drivers/rtc/rtc_common.c \ ${MTK_PLAT}/common/drivers/uart/uart.c \ ${MTK_PLAT}/common/lpm/mt_lp_rm.c \ + ${MTK_PLAT}/common/mtk_cirq.c \ ${MTK_PLAT}/common/mtk_plat_common.c \ ${MTK_PLAT}/common/mtk_sip_svc.c \ ${MTK_PLAT}/common/params_setup.c \ @@ -56,7 +57,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_cirq.c \ ${MTK_PLAT_SOC}/plat_sip_calls.c \ ${MTK_PLAT_SOC}/drivers/dcm/mtk_dcm.c \ ${MTK_PLAT_SOC}/drivers/dcm/mtk_dcm_utils.c \ diff --git a/plat/mediatek/mt8195/include/platform_def.h b/plat/mediatek/mt8195/include/platform_def.h index 59f0284f4..dd1e99d03 100644 --- a/plat/mediatek/mt8195/include/platform_def.h +++ b/plat/mediatek/mt8195/include/platform_def.h @@ -43,6 +43,11 @@ #define BASE_GICD_BASE MT_GIC_BASE #define MT_GIC_RDIST_BASE (MT_GIC_BASE + 0x40000) +#define SYS_CIRQ_BASE (IO_PHYS + 0x204000) +#define CIRQ_REG_NUM 23 +#define CIRQ_IRQ_NUM 730 +#define CIRQ_SPI_START 96 +#define MD_WDT_IRQ_BIT_ID 141 /******************************************************************************* * Platform binary types for linking ******************************************************************************/ diff --git a/plat/mediatek/mt8195/platform.mk b/plat/mediatek/mt8195/platform.mk index 08dcfa29d..f7cd29e2c 100644 --- a/plat/mediatek/mt8195/platform.mk +++ b/plat/mediatek/mt8195/platform.mk @@ -28,6 +28,7 @@ BL31_SOURCES += common/desc_image_load.c \ lib/cpus/aarch64/cortex_a78.S \ plat/common/plat_gicv3.c \ ${MTK_PLAT}/common/drivers/gic600/mt_gic_v3.c \ + ${MTK_PLAT}/common/mtk_cirq.c \ ${MTK_PLAT}/common/mtk_plat_common.c \ ${MTK_PLAT}/common/params_setup.c \ ${MTK_PLAT_SOC}/aarch64/platform_common.c \