diff options
author | Jarried Lin <jarried.lin@mediatek.corp-partner.google.com> | 2024-11-01 15:16:51 +0800 |
---|---|---|
committer | Yu-Ping Wu <yupingso@google.com> | 2024-11-13 02:27:04 +0000 |
commit | b8724cd9a55b8f9d233f4ac3164fad7681517308 (patch) | |
tree | 0a5e960476de5dfe509b4eeb16d7712366b1bfaf /src/soc/mediatek/common | |
parent | 2919a85be872d80d499de2c3f3421ccf83c68fd3 (diff) |
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 <crystal.guo@mediatek.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85098
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Yidi Lin <yidilin@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/mediatek/common')
-rw-r--r-- | src/soc/mediatek/common/memory.c | 9 |
1 files changed, 3 insertions, 6 deletions
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 <cbmem.h> #include <commonlib/bsd/mem_chip_info.h> #include <console/console.h> +#include <fmap_config.h> #include <soc/dramc_common.h> #include <mrc_cache.h> #include <soc/dramc_param.h> @@ -13,12 +14,8 @@ #include <symbols.h> #include <timer.h> -/* 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); |