diff options
author | Yu-Ping Wu <yupingso@chromium.org> | 2019-10-03 08:49:23 +0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-10-18 12:21:56 +0000 |
commit | 4d4ccced31f87fd98f1b0783438dbc5480b355f5 (patch) | |
tree | 2144e037b45d9846c8d8261bf8b78ac38b380fe3 /src/soc/mediatek/mt8183/include | |
parent | cea735cf127e090fbb5fa588bd5d7bd3c959e49f (diff) | |
download | coreboot-4d4ccced31f87fd98f1b0783438dbc5480b355f5.tar.xz |
soc/mediatek/mt8183: Pass impedance data as a function argument
To make data flow more explicit, global variable 'impedance' is replaced
with a local variable, which is passed as a function argument.
BUG=none
BRANCH=kukui
TEST=Krane boots correctly
Change-Id: I0f6dacc33fda013a3476a10d9899821b7297e770
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35766
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 | 3 | ||||
-rw-r--r-- | src/soc/mediatek/mt8183/include/soc/dramc_pi_api.h | 11 | ||||
-rw-r--r-- | src/soc/mediatek/mt8183/include/soc/emi.h | 4 |
3 files changed, 13 insertions, 5 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 ef6eaf162c..5ea9a52423 100644 --- a/src/soc/mediatek/mt8183/include/soc/dramc_common_mt8183.h +++ b/src/soc/mediatek/mt8183/include/soc/dramc_common_mt8183.h @@ -37,7 +37,8 @@ enum { enum dram_odt_type { ODT_OFF = 0, - ODT_ON + ODT_ON, + ODT_MAX }; enum { 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 afd6718424..65ec075f71 100644 --- a/src/soc/mediatek/mt8183/include/soc/dramc_pi_api.h +++ b/src/soc/mediatek/mt8183/include/soc/dramc_pi_api.h @@ -105,13 +105,16 @@ void dramc_runtime_config(void); 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); -void dramc_sw_impedance_save_reg(u8 freq_group); -void dramc_sw_impedance_cal(const struct sdram_params *params, u8 term_option); +void dramc_init(const struct sdram_params *params, u8 freq_group, + const struct dram_impedance *impedance); +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); int dramc_calibrate_all_channels(const struct sdram_params *pams, - u8 freq_group); + u8 freq_group); 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 1a364fb7a6..1b894803bd 100644 --- a/src/soc/mediatek/mt8183/include/soc/emi.h +++ b/src/soc/mediatek/mt8183/include/soc/emi.h @@ -82,6 +82,10 @@ enum { LP4X_DDRFREQ_MAX, }; +struct dram_impedance { + u32 data[ODT_MAX][4]; +}; + extern const u8 phy_mapping[CHANNEL_MAX][16]; int complex_mem_test(u8 *start, unsigned int len); |