From b8724cd9a55b8f9d233f4ac3164fad7681517308 Mon Sep 17 00:00:00 2001 From: Jarried Lin Date: Fri, 1 Nov 2024 15:16:51 +0800 Subject: soc/mediatek/mt8196: Add dram calibration support Add support for MT8196 DRAM calibration. DRAM parameters and related constants are added in dramc_param.h and dramc_soc.h. As MT8196's dramc_param struct size is different from other MediaTek SoCs, replace the hardcoded RW_MRC_CACHE size in common code with a constant derived from chromeos.fmd. The common emi.c can be reused for MT8196 as well, so remove the duplicate mt8196/emi.{c,h}. Enable MEDIATEK_DRAM_BLOB_FAST_INIT to allow running DRAM fast calibration via the DRAM blob. Test=Build pass BUG=b:317009620 Change-Id: Ifeaf73e31b29ef376a28ca2721dba0d4866d6e8b Signed-off-by: Crystal Guo Reviewed-on: https://review.coreboot.org/c/coreboot/+/85098 Reviewed-by: Yu-Ping Wu Reviewed-by: Yidi Lin Tested-by: build bot (Jenkins) --- src/soc/mediatek/common/memory.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/soc/mediatek/common') diff --git a/src/soc/mediatek/common/memory.c b/src/soc/mediatek/common/memory.c index 72ea37eea3..089c6affac 100644 --- a/src/soc/mediatek/common/memory.c +++ b/src/soc/mediatek/common/memory.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -13,12 +14,8 @@ #include #include -/* This must be defined in chromeos.fmd in same name and size. */ -#define CAL_REGION_RW_MRC_CACHE "RW_MRC_CACHE" -#define CAL_REGION_RW_MRC_CACHE_SIZE 0x2000 - -_Static_assert(sizeof(struct dramc_param) <= CAL_REGION_RW_MRC_CACHE_SIZE, - "sizeof(struct dramc_param) exceeds " CAL_REGION_RW_MRC_CACHE); +_Static_assert(sizeof(struct dramc_param) <= FMAP_SECTION_RW_MRC_CACHE_SIZE, + "sizeof(struct dramc_param) exceeds RW_MRC_CACHE size"); const char *get_dram_geometry_str(u32 ddr_geometry); const char *get_dram_type_str(u32 ddr_type); -- cgit v1.2.3