Xi Chen has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/50294 )
Change subject: Add mediatek mt8192 dram vendor code ......................................................................
Add mediatek mt8192 dram vendor code
Move coreboot mt8192 soc dram code to vendor folder, it's more convinient to maintain mediatek dram codes.
Signed-off-by: Xi Chen xixi.chen@mediatek.com Change-Id: I3853204578069c6abf52689ea6f5d88841414bd4 --- M src/soc/mediatek/mt8192/Kconfig M src/soc/mediatek/mt8192/Makefile.inc M src/vendorcode/Makefile.inc A src/vendorcode/mediatek/Makefile.inc A src/vendorcode/mediatek/mt8192/Kconfig A src/vendorcode/mediatek/mt8192/Makefile.inc R src/vendorcode/mediatek/mt8192/dpm.c R src/vendorcode/mediatek/mt8192/dramc_ana_init_config.c R src/vendorcode/mediatek/mt8192/dramc_dig_config.c R src/vendorcode/mediatek/mt8192/dramc_dvfs.c R src/vendorcode/mediatek/mt8192/dramc_param.c R src/vendorcode/mediatek/mt8192/dramc_pi_basic_api.c R src/vendorcode/mediatek/mt8192/dramc_pi_calibration_api.c R src/vendorcode/mediatek/mt8192/dramc_pi_main.c R src/vendorcode/mediatek/mt8192/dramc_power.c R src/vendorcode/mediatek/mt8192/dramc_subsys_config.c R src/vendorcode/mediatek/mt8192/dramc_tracking.c R src/vendorcode/mediatek/mt8192/dramc_utility.c R src/vendorcode/mediatek/mt8192/emi.c R src/vendorcode/mediatek/mt8192/include/soc/dpm.h R src/vendorcode/mediatek/mt8192/include/soc/dramc_ac_timing.h R src/vendorcode/mediatek/mt8192/include/soc/dramc_common_mt8192.h R src/vendorcode/mediatek/mt8192/include/soc/dramc_param.h R src/vendorcode/mediatek/mt8192/include/soc/dramc_pi_api.h R src/vendorcode/mediatek/mt8192/include/soc/dramc_power.h R src/vendorcode/mediatek/mt8192/include/soc/dramc_register.h R src/vendorcode/mediatek/mt8192/include/soc/dramc_register_bits_def.h R src/vendorcode/mediatek/mt8192/include/soc/emi.h R src/vendorcode/mediatek/mt8192/memory.c 29 files changed, 62 insertions(+), 44 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/50294/1
diff --git a/src/soc/mediatek/mt8192/Kconfig b/src/soc/mediatek/mt8192/Kconfig index beadaf2..cc09262 100644 --- a/src/soc/mediatek/mt8192/Kconfig +++ b/src/soc/mediatek/mt8192/Kconfig @@ -16,43 +16,6 @@ select VBOOT_SEPARATE_VERSTAGE select VBOOT_RETURN_FROM_VERSTAGE
-config DEBUG_DRAM - bool "Output verbose DRAM related debug messages" - default y - help - This option enables additional DRAM related debug messages. - -config MT8192_DRAM_EMCP - bool - default y - help - The eMCP platform should select this option to run at different DRAM - frequencies. - -config MT8192_DRAM_DVFS - bool - default n - help - This option enables DRAM calibration with multiple frequencies (low, - medium and high frequency groups, with total 7 frequencies) for DVFS - feature. All supported data rates are: 800, 1200, 1600, 1866, 2400, - 3200, 4266. - -config MT8192_DRAM_DVFS_LIMIT_FREQ_CNT - bool - default y - select MT8192_DRAM_DVFS - help - This options limit DRAM frequency calibration count from total 7 to 3, - other frequency will directly use the low frequency shu result. - -config MEMORY_TEST - bool - default y - help - This option enables memory basic compare test to verify the DRAM read - or write is as expected. - config DPM_DM_FIRMWARE string default "dpm.dm" diff --git a/src/soc/mediatek/mt8192/Makefile.inc b/src/soc/mediatek/mt8192/Makefile.inc index d41a23c..972c1e9 100644 --- a/src/soc/mediatek/mt8192/Makefile.inc +++ b/src/soc/mediatek/mt8192/Makefile.inc @@ -28,15 +28,11 @@
romstage-y += ../common/auxadc.c romstage-y += ../common/cbmem.c -romstage-y += dramc_pi_main.c dramc_pi_basic_api.c dramc_pi_calibration_api.c -romstage-y += dramc_utility.c dramc_dvfs.c dramc_tracking.c dramc_power.c -romstage-y += dramc_subsys_config.c dramc_ana_init_config.c dramc_dig_config.c -romstage-y += emi.c romstage-y += ../common/flash_controller.c romstage-y += ../common/gpio.c gpio.c romstage-y += ../common/i2c.c i2c.c +romstage-y += ../common/memory_test.c romstage-y += ../common/mmu_operations.c mmu_operations.c -romstage-y += memory.c dramc_param.c ../common/memory_test.c romstage-y += ../common/pll.c pll.c romstage-$(CONFIG_SPI_FLASH) += ../common/spi.c spi.c romstage-y += ../common/timer.c @@ -48,12 +44,10 @@ ramstage-y += ../common/auxadc.c ramstage-y += ../common/ddp.c ddp.c ramstage-y += devapc.c -ramstage-y += dpm.c ramstage-y += ../common/dsi.c ../common/mtk_mipi_dphy.c ramstage-y += ../common/flash_controller.c ramstage-y += ../common/gpio.c gpio.c ramstage-y += ../common/i2c.c i2c.c -ramstage-y += emi.c ramstage-$(CONFIG_SPI_FLASH) += ../common/spi.c spi.c ramstage-y += ../common/mcu.c ramstage-y += mcupm.c @@ -97,6 +91,7 @@
CPPFLAGS_common += -Isrc/soc/mediatek/mt8192/include CPPFLAGS_common += -Isrc/soc/mediatek/common/include +CPPFLAGS_common += -Isrc/vendorcode/mediatek/mt8192/include
$(objcbfs)/bootblock.bin: $(objcbfs)/bootblock.raw.bin ./util/mtkheader/gen-bl-img.py mt8183 sf $< $@ diff --git a/src/vendorcode/Makefile.inc b/src/vendorcode/Makefile.inc index 8ccb0d0..36a13bb 100644 --- a/src/vendorcode/Makefile.inc +++ b/src/vendorcode/Makefile.inc @@ -4,3 +4,4 @@ subdirs-y += siemens subdirs-y += cavium subdirs-y += eltan +subdirs-y += mediatek diff --git a/src/vendorcode/mediatek/Makefile.inc b/src/vendorcode/mediatek/Makefile.inc new file mode 100644 index 0000000..d100489 --- /dev/null +++ b/src/vendorcode/mediatek/Makefile.inc @@ -0,0 +1 @@ +subdirs-y += mt8192 diff --git a/src/vendorcode/mediatek/mt8192/Kconfig b/src/vendorcode/mediatek/mt8192/Kconfig new file mode 100644 index 0000000..3b31953 --- /dev/null +++ b/src/vendorcode/mediatek/mt8192/Kconfig @@ -0,0 +1,40 @@ +if SOC_MEDIATEK_MT8192 + +config DEBUG_DRAM + bool "Output verbose DRAM related debug messages" + default y + help + This option enables additional DRAM related debug messages. + +config MT8192_DRAM_EMCP + bool + default y + help + The eMCP platform should select this option to run at different DRAM + frequencies. + +config MT8192_DRAM_DVFS + bool + default n + help + This option enables DRAM calibration with multiple frequencies (low, + medium and high frequency groups, with total 7 frequencies) for DVFS + feature. All supported data rates are: 800, 1200, 1600, 1866, 2400, + 3200, 4266. + +config MT8192_DRAM_DVFS_LIMIT_FREQ_CNT + bool + default y + select MT8192_DRAM_DVFS + help + This options limit DRAM frequency calibration count from total 7 to 3, + other frequency will directly use the low frequency shu result. + +config MEMORY_TEST + bool + default y + help + This option enables memory basic compare test to verify the DRAM read + or write is as expected. + +endif diff --git a/src/vendorcode/mediatek/mt8192/Makefile.inc b/src/vendorcode/mediatek/mt8192/Makefile.inc new file mode 100644 index 0000000..20fd124 --- /dev/null +++ b/src/vendorcode/mediatek/mt8192/Makefile.inc @@ -0,0 +1,18 @@ +ifeq ($(CONFIG_SOC_MEDIATEK_MT8192),y) + +romstage-y += dramc_pi_main.c dramc_pi_basic_api.c dramc_pi_calibration_api.c +romstage-y += dramc_utility.c dramc_dvfs.c dramc_tracking.c dramc_power.c +romstage-y += dramc_subsys_config.c dramc_ana_init_config.c dramc_dig_config.c +romstage-y += emi.c +romstage-y += memory.c dramc_param.c + +ramstage-y += dpm.c +ramstage-y += emi.c + +BL31_MAKEARGS += PLAT=mt8192 + +CPPFLAGS_common += -Isrc/soc/mediatek/mt8192/include +CPPFLAGS_common += -Isrc/soc/mediatek/common/include +CPPFLAGS_common += -Isrc/vendorcode/mediatek/mt8192/include + +endif diff --git a/src/soc/mediatek/mt8192/dpm.c b/src/vendorcode/mediatek/mt8192/dpm.c similarity index 100% rename from src/soc/mediatek/mt8192/dpm.c rename to src/vendorcode/mediatek/mt8192/dpm.c diff --git a/src/soc/mediatek/mt8192/dramc_ana_init_config.c b/src/vendorcode/mediatek/mt8192/dramc_ana_init_config.c similarity index 100% rename from src/soc/mediatek/mt8192/dramc_ana_init_config.c rename to src/vendorcode/mediatek/mt8192/dramc_ana_init_config.c diff --git a/src/soc/mediatek/mt8192/dramc_dig_config.c b/src/vendorcode/mediatek/mt8192/dramc_dig_config.c similarity index 100% rename from src/soc/mediatek/mt8192/dramc_dig_config.c rename to src/vendorcode/mediatek/mt8192/dramc_dig_config.c diff --git a/src/soc/mediatek/mt8192/dramc_dvfs.c b/src/vendorcode/mediatek/mt8192/dramc_dvfs.c similarity index 100% rename from src/soc/mediatek/mt8192/dramc_dvfs.c rename to src/vendorcode/mediatek/mt8192/dramc_dvfs.c diff --git a/src/soc/mediatek/mt8192/dramc_param.c b/src/vendorcode/mediatek/mt8192/dramc_param.c similarity index 100% rename from src/soc/mediatek/mt8192/dramc_param.c rename to src/vendorcode/mediatek/mt8192/dramc_param.c diff --git a/src/soc/mediatek/mt8192/dramc_pi_basic_api.c b/src/vendorcode/mediatek/mt8192/dramc_pi_basic_api.c similarity index 100% rename from src/soc/mediatek/mt8192/dramc_pi_basic_api.c rename to src/vendorcode/mediatek/mt8192/dramc_pi_basic_api.c diff --git a/src/soc/mediatek/mt8192/dramc_pi_calibration_api.c b/src/vendorcode/mediatek/mt8192/dramc_pi_calibration_api.c similarity index 100% rename from src/soc/mediatek/mt8192/dramc_pi_calibration_api.c rename to src/vendorcode/mediatek/mt8192/dramc_pi_calibration_api.c diff --git a/src/soc/mediatek/mt8192/dramc_pi_main.c b/src/vendorcode/mediatek/mt8192/dramc_pi_main.c similarity index 100% rename from src/soc/mediatek/mt8192/dramc_pi_main.c rename to src/vendorcode/mediatek/mt8192/dramc_pi_main.c diff --git a/src/soc/mediatek/mt8192/dramc_power.c b/src/vendorcode/mediatek/mt8192/dramc_power.c similarity index 100% rename from src/soc/mediatek/mt8192/dramc_power.c rename to src/vendorcode/mediatek/mt8192/dramc_power.c diff --git a/src/soc/mediatek/mt8192/dramc_subsys_config.c b/src/vendorcode/mediatek/mt8192/dramc_subsys_config.c similarity index 100% rename from src/soc/mediatek/mt8192/dramc_subsys_config.c rename to src/vendorcode/mediatek/mt8192/dramc_subsys_config.c diff --git a/src/soc/mediatek/mt8192/dramc_tracking.c b/src/vendorcode/mediatek/mt8192/dramc_tracking.c similarity index 100% rename from src/soc/mediatek/mt8192/dramc_tracking.c rename to src/vendorcode/mediatek/mt8192/dramc_tracking.c diff --git a/src/soc/mediatek/mt8192/dramc_utility.c b/src/vendorcode/mediatek/mt8192/dramc_utility.c similarity index 100% rename from src/soc/mediatek/mt8192/dramc_utility.c rename to src/vendorcode/mediatek/mt8192/dramc_utility.c diff --git a/src/soc/mediatek/mt8192/emi.c b/src/vendorcode/mediatek/mt8192/emi.c similarity index 100% rename from src/soc/mediatek/mt8192/emi.c rename to src/vendorcode/mediatek/mt8192/emi.c diff --git a/src/soc/mediatek/mt8192/include/soc/dpm.h b/src/vendorcode/mediatek/mt8192/include/soc/dpm.h similarity index 100% rename from src/soc/mediatek/mt8192/include/soc/dpm.h rename to src/vendorcode/mediatek/mt8192/include/soc/dpm.h diff --git a/src/soc/mediatek/mt8192/include/soc/dramc_ac_timing.h b/src/vendorcode/mediatek/mt8192/include/soc/dramc_ac_timing.h similarity index 100% rename from src/soc/mediatek/mt8192/include/soc/dramc_ac_timing.h rename to src/vendorcode/mediatek/mt8192/include/soc/dramc_ac_timing.h diff --git a/src/soc/mediatek/mt8192/include/soc/dramc_common_mt8192.h b/src/vendorcode/mediatek/mt8192/include/soc/dramc_common_mt8192.h similarity index 100% rename from src/soc/mediatek/mt8192/include/soc/dramc_common_mt8192.h rename to src/vendorcode/mediatek/mt8192/include/soc/dramc_common_mt8192.h diff --git a/src/soc/mediatek/mt8192/include/soc/dramc_param.h b/src/vendorcode/mediatek/mt8192/include/soc/dramc_param.h similarity index 100% rename from src/soc/mediatek/mt8192/include/soc/dramc_param.h rename to src/vendorcode/mediatek/mt8192/include/soc/dramc_param.h diff --git a/src/soc/mediatek/mt8192/include/soc/dramc_pi_api.h b/src/vendorcode/mediatek/mt8192/include/soc/dramc_pi_api.h similarity index 100% rename from src/soc/mediatek/mt8192/include/soc/dramc_pi_api.h rename to src/vendorcode/mediatek/mt8192/include/soc/dramc_pi_api.h diff --git a/src/soc/mediatek/mt8192/include/soc/dramc_power.h b/src/vendorcode/mediatek/mt8192/include/soc/dramc_power.h similarity index 100% rename from src/soc/mediatek/mt8192/include/soc/dramc_power.h rename to src/vendorcode/mediatek/mt8192/include/soc/dramc_power.h diff --git a/src/soc/mediatek/mt8192/include/soc/dramc_register.h b/src/vendorcode/mediatek/mt8192/include/soc/dramc_register.h similarity index 100% rename from src/soc/mediatek/mt8192/include/soc/dramc_register.h rename to src/vendorcode/mediatek/mt8192/include/soc/dramc_register.h diff --git a/src/soc/mediatek/mt8192/include/soc/dramc_register_bits_def.h b/src/vendorcode/mediatek/mt8192/include/soc/dramc_register_bits_def.h similarity index 100% rename from src/soc/mediatek/mt8192/include/soc/dramc_register_bits_def.h rename to src/vendorcode/mediatek/mt8192/include/soc/dramc_register_bits_def.h diff --git a/src/soc/mediatek/mt8192/include/soc/emi.h b/src/vendorcode/mediatek/mt8192/include/soc/emi.h similarity index 100% rename from src/soc/mediatek/mt8192/include/soc/emi.h rename to src/vendorcode/mediatek/mt8192/include/soc/emi.h diff --git a/src/soc/mediatek/mt8192/memory.c b/src/vendorcode/mediatek/mt8192/memory.c similarity index 100% rename from src/soc/mediatek/mt8192/memory.c rename to src/vendorcode/mediatek/mt8192/memory.c