Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35164 )
Change subject: mediatek/mt8183: Use calibration result do fast calibration ......................................................................
Patch Set 8:
(3 comments)
https://review.coreboot.org/c/coreboot/+/35164/7/src/soc/mediatek/mt8183/emi... File src/soc/mediatek/mt8183/emi.c:
https://review.coreboot.org/c/coreboot/+/35164/7/src/soc/mediatek/mt8183/emi... PS7, Line 370: if DUAL_FREQ_K : current_freqsel = freq_tbl[DRAM_DFS_SHUFFLE_3]; : params = &freq_params[DRAM_DFS_SHUFFLE_3]; : #else : current_freqsel = freq_tbl[DRAM_DFS_SHUFFLE_1]; : params = &freq_params[DRAM_DFS_SHUFFLE_1]; : #endif int freq_index = DRAM_DFS_SHUFFULE_1;
if (CONFIG(MT8183_DRAM_DUAL_FREQ)) freq_index = DRAM_DFS_SHUFFLE_3;
current_freqsel = freq_tbl[freq_index]; params = &freq_params[freq_index];
https://review.coreboot.org/c/coreboot/+/35164/7/src/soc/mediatek/mt8183/emi... PS7, Line 381: #if DUAL_FREQ_K isn't this 'multiple frequency' than 'dual'?
I think we should change this to
static void dram_calibrate(int shuffle) { const u8 *const freq_tbl = freq_shuffle;
if (CONFIG(MT8183_DRAM_EMCP)) { freq_tbl = freq_shuffle_emcp; }
current_freqsel = freq_tbl[shuffle]; params = &freq_params[shuffle];
dfs_init_for_calibration(params, current_freqsel); do_calib(params, current_freqsel); }
void mt_set_emi(...) { if (CONFIG(MT8183_DRAM_MULTI_FREQUENCY)) { dram_calibrate(DRAM_DFS_SHUFFLE_3); dram_calibrate(DRAM_DFS_SHUFFLE_2); } dram_calibrate(DRAM_DFS_SHUFFLE_1); after_calib(); }
https://review.coreboot.org/c/coreboot/+/35164/7/src/soc/mediatek/mt8183/inc... File src/soc/mediatek/mt8183/include/soc/dramc_pi_api.h:
https://review.coreboot.org/c/coreboot/+/35164/7/src/soc/mediatek/mt8183/inc... PS7, Line 41: #define DUAL_FREQ_K 0 Move this to a KConfig.