From bcaa87d603441b74b7f1cf504bf7cb03aa8dafc9 Mon Sep 17 00:00:00 2001 From: Xi Chen Date: Thu, 28 Jul 2022 13:45:18 +0800 Subject: [PATCH] mb/google/geralt: Fully calibrate DRAM Initialize and calibrate DRAM in romstage. DRAM full calibration logs: dram_init: dram init end (result: 0) DRAM-K: Full calibration passed in 50176 msecs TEST=Full calibration pass. BUG=b:233720142 Signed-off-by: Xi Chen Change-Id: I31f5693ffe4a1e30defbc8a96dc128de03d6b7e7 Reviewed-on: https://review.coreboot.org/c/coreboot/+/66278 Reviewed-by: Yidi Lin Reviewed-by: Yu-Ping Wu Tested-by: build bot (Jenkins) --- src/mainboard/google/geralt/Makefile.inc | 1 + src/mainboard/google/geralt/romstage.c | 2 ++ src/mainboard/google/geralt/sdram_configs.c | 15 +++++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 src/mainboard/google/geralt/sdram_configs.c diff --git a/src/mainboard/google/geralt/Makefile.inc b/src/mainboard/google/geralt/Makefile.inc index fc1a62648a..717ba16688 100644 --- a/src/mainboard/google/geralt/Makefile.inc +++ b/src/mainboard/google/geralt/Makefile.inc @@ -9,6 +9,7 @@ verstage-y += reset.c romstage-y += memlayout.ld romstage-y += chromeos.c romstage-y += romstage.c +romstage-y += sdram_configs.c ramstage-y += memlayout.ld ramstage-y += boardid.c diff --git a/src/mainboard/google/geralt/romstage.c b/src/mainboard/google/geralt/romstage.c index 0f04021bde..8f248ca8a6 100644 --- a/src/mainboard/google/geralt/romstage.c +++ b/src/mainboard/google/geralt/romstage.c @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -14,4 +15,5 @@ void platform_romstage_main(void) mt6359p_init(); clk_buf_init(); rtc_boot(); + mtk_dram_init(); } diff --git a/src/mainboard/google/geralt/sdram_configs.c b/src/mainboard/google/geralt/sdram_configs.c new file mode 100644 index 0000000000..c4766be235 --- /dev/null +++ b/src/mainboard/google/geralt/sdram_configs.c @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include + +const struct sdram_info *get_sdram_config(void) +{ + /* + * The MT8188 platform supports "dram adaptive" feature to automatically + * detect dram information, including channel, rank, die size..., and + * can automatically configure EMI settings. Therefore, we will be + * passing a placeholder param blob. + */ + static struct sdram_info params; + return ¶ms; +}