diff options
author | Yu-Ping Wu <yupingso@chromium.org> | 2019-10-24 15:51:19 +0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-10-28 11:58:24 +0000 |
commit | 947916eb2d2648c1cf605a6c660b705876835ea5 (patch) | |
tree | 651cc1cc827091b621338f729c21773627d42645 /src/soc/mediatek/mt8183/include | |
parent | 845652b8bbaeca8373bcf574e12e7d4e406b72e9 (diff) | |
download | coreboot-947916eb2d2648c1cf605a6c660b705876835ea5.tar.xz |
soc/mediatek/mt8183: Pass MR values as function arguments
To make data flow more explicit, global variables 'MR01Value' and
'MR13Value' are replaced with local variables, which are passed as
function arguments.
BRANCH=kukui
BUG=none
TEST=1. emerge-kukui coreboot
2. Fast calibration succeeded
Change-Id: Id21483092c86c3ae7dbb1173a2b943defe41a379
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36286
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Diffstat (limited to 'src/soc/mediatek/mt8183/include')
-rw-r--r-- | src/soc/mediatek/mt8183/include/soc/dramc_common_mt8183.h | 6 | ||||
-rw-r--r-- | src/soc/mediatek/mt8183/include/soc/dramc_pi_api.h | 12 | ||||
-rw-r--r-- | src/soc/mediatek/mt8183/include/soc/emi.h | 10 |
3 files changed, 19 insertions, 9 deletions
diff --git a/src/soc/mediatek/mt8183/include/soc/dramc_common_mt8183.h b/src/soc/mediatek/mt8183/include/soc/dramc_common_mt8183.h index 5ea9a52423..4da948ec4a 100644 --- a/src/soc/mediatek/mt8183/include/soc/dramc_common_mt8183.h +++ b/src/soc/mediatek/mt8183/include/soc/dramc_common_mt8183.h @@ -59,4 +59,10 @@ enum { CBT_BYTE_MODE1 }; +enum { + FSP_0 = 0, + FSP_1, + FSP_MAX +}; + #endif /* _DRAMC_COMMON_MT8183_H_ */ diff --git a/src/soc/mediatek/mt8183/include/soc/dramc_pi_api.h b/src/soc/mediatek/mt8183/include/soc/dramc_pi_api.h index 40a516da1d..54f009e9f0 100644 --- a/src/soc/mediatek/mt8183/include/soc/dramc_pi_api.h +++ b/src/soc/mediatek/mt8183/include/soc/dramc_pi_api.h @@ -45,12 +45,6 @@ enum dram_te_op { }; enum { - FSP_0 = 0, - FSP_1, - FSP_MAX -}; - -enum { PASS_RANGE_NA = 0x7fff }; @@ -107,15 +101,15 @@ void dramc_set_broadcast(u32 onoff); u32 dramc_get_broadcast(void); u8 get_freq_fsq(u8 freq_group); void dramc_init(const struct sdram_params *params, u8 freq_group, - const struct dram_impedance *impedance); + struct dram_shared_data *shared); void dramc_sw_impedance_save_reg(u8 freq_group, const struct dram_impedance *impedance); void dramc_sw_impedance_cal(const struct sdram_params *params, u8 term_option, struct dram_impedance *impedance); void dramc_apply_config_before_calibration(u8 freq_group); -void dramc_apply_config_after_calibration(void); +void dramc_apply_config_after_calibration(const struct mr_value *mr); int dramc_calibrate_all_channels(const struct sdram_params *pams, - u8 freq_group); + u8 freq_group, const struct mr_value *mr); void dramc_hw_gating_onoff(u8 chn, bool onoff); void dramc_enable_phy_dcm(bool bEn); void dramc_mode_reg_write(u8 chn, u8 mr_idx, u8 value); diff --git a/src/soc/mediatek/mt8183/include/soc/emi.h b/src/soc/mediatek/mt8183/include/soc/emi.h index 1b894803bd..255a323d1a 100644 --- a/src/soc/mediatek/mt8183/include/soc/emi.h +++ b/src/soc/mediatek/mt8183/include/soc/emi.h @@ -86,6 +86,16 @@ struct dram_impedance { u32 data[ODT_MAX][4]; }; +struct mr_value { + u8 MR01Value[FSP_MAX]; + u8 MR13Value; +}; + +struct dram_shared_data { + struct dram_impedance impedance; + struct mr_value mr; +}; + extern const u8 phy_mapping[CHANNEL_MAX][16]; int complex_mem_test(u8 *start, unsigned int len); |