diff --git a/src/soc/mediatek/mt8189/Makefile.mk b/src/soc/mediatek/mt8189/Makefile.mk index 57666fc1d2..0a5a652d92 100644 --- a/src/soc/mediatek/mt8189/Makefile.mk +++ b/src/soc/mediatek/mt8189/Makefile.mk @@ -12,6 +12,7 @@ all-y += ../common/uart.c bootblock-y += ../common/bootblock.c bootblock.c bootblock-y += efuse.c +bootblock-y += ../common/lastbus_v2.c lastbus.c bootblock-y += ../common/mmu_operations.c bootblock-y += ../common/mtcmos.c mtcmos.c bootblock-y += ../common/wdt.c ../common/wdt_req.c wdt.c diff --git a/src/soc/mediatek/mt8189/bootblock.c b/src/soc/mediatek/mt8189/bootblock.c index 8465a4974f..adf3938187 100644 --- a/src/soc/mediatek/mt8189/bootblock.c +++ b/src/soc/mediatek/mt8189/bootblock.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only OR MIT */ #include +#include #include #include #include @@ -9,6 +10,7 @@ void bootblock_soc_init(void) { mtk_mmu_init(); + lastbus_init(); mtk_wdt_init(); mt_pll_init(); mtcmos_init(); diff --git a/src/soc/mediatek/mt8189/include/soc/addressmap.h b/src/soc/mediatek/mt8189/include/soc/addressmap.h index 8c633c5f17..abc9f972f0 100644 --- a/src/soc/mediatek/mt8189/include/soc/addressmap.h +++ b/src/soc/mediatek/mt8189/include/soc/addressmap.h @@ -33,8 +33,11 @@ enum { APMIXED_BASE = IO_PHYS + 0x0000C000, DEVAPC_INFRA_SECU_AO_BASE = IO_PHYS + 0x0001C000, INFRA_AO_BCRM_BASE = IO_PHYS + 0x00022000, + INFRA_AO_DEBUG_BASE = IO_PHYS + 0x00023000, + INFRA_AO1_DEBUG_BASE = IO_PHYS + 0x0002B000, DEVAPC_INFRA_AO_BASE = IO_PHYS + 0x00030000, DEVAPC_INFRA_AO1_BASE = IO_PHYS + 0x00034000, + EMISYS_NAO_DEBUG_BASE = IO_PHYS + 0x00042000, INFRACFG_BASE = IO_PHYS + 0x0020E000, EMI0_BASE = IO_PHYS + 0x00219000, EMI0_MPU_BASE = IO_PHYS + 0x00226000, @@ -58,6 +61,7 @@ enum { AUXADC_BASE = IO_PHYS + 0x01019000, PERI_AO_BCRM_BASE = IO_PHYS + 0x01035000, PERICFG_AO_BASE = IO_PHYS + 0x01036000, + PERI_PAR_AO_DEBUG_BASE = IO_PHYS + 0x01037000, DEVAPC_PERI_PAR_AO_BASE = IO_PHYS + 0x0103C000, AUDIO_BASE = IO_PHYS + 0x01050000, SSUSB_IPPC_BASE_P0 = IO_PHYS + 0x01203E00, @@ -137,6 +141,7 @@ enum { VLP_CK_BASE = IO_PHYS + 0x0C012000, PMICSPI_MST_BASE = IO_PHYS + 0x0C013000, DEVAPC_VLP_AO_BASE = IO_PHYS + 0x0C018000, + VLP_AO_DEBUG_BASE = IO_PHYS + 0x0C01D000, SSPM_SRAM_BASE = IO_PHYS + 0x0C300000, SSPM_CFG_BASE = IO_PHYS + 0x0C340000, SCP_IIC_BASE = IO_PHYS + 0x0C80A000, diff --git a/src/soc/mediatek/mt8189/lastbus.c b/src/soc/mediatek/mt8189/lastbus.c new file mode 100644 index 0000000000..f488ecee8a --- /dev/null +++ b/src/soc/mediatek/mt8189/lastbus.c @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR MIT */ + +#include +#include +#include + +static const struct lastbus_monitor monitors[] = { + { + .name = "debug_ctrl_ao_INFRA_AO", + .base = INFRA_AO_DEBUG_BASE, + .num_ports = 43, + .bus_freq_mhz = 78, + }, + { + .name = "debug_ctrl_ao_INFRA_AO1", + .base = INFRA_AO1_DEBUG_BASE, + .num_ports = 12, + .bus_freq_mhz = 78, + }, + { + .name = "debug_ctrl_ao_EMISYS_NAO", + .base = EMISYS_NAO_DEBUG_BASE, + .num_ports = 11, + .bus_freq_mhz = 728, + }, + { + .name = "debug_ctrl_ao_PERI_PAR_AO", + .base = PERI_PAR_AO_DEBUG_BASE, + .num_ports = 23, + .bus_freq_mhz = 78, + }, + { + .name = "debug_ctrl_ao_VLP_AO", + .base = VLP_AO_DEBUG_BASE, + .num_ports = 12, + .bus_freq_mhz = 156, + }, +}; + +const struct lastbus_config lastbus_cfg = { + .latch_platform = "MT8189", + .timeout_ms = 200, + .timeout_type = 0, + .num_used_monitors = ARRAY_SIZE(monitors), + .monitors = monitors, +};