![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <assert.h>
#include <console/console.h>
#include <delay.h>
#include <device/mmio.h>
#include <soc/emi.h>
#include <soc/dramc_register.h>
#include <soc/dramc_param.h>
#include <soc/dramc_pi_api.h>
#include <soc/spm.h>
#include <timer.h>
Go to the source code of this file.
Data Structures | |
struct | win_perbit_dly |
struct | vref_perbit_dly |
struct | tx_dly_tune |
struct | per_byte_dly |
Macros | |
#define | WRITE_LEVELING_MOVD_DQS 1 |
#define | TEST2_1_CAL 0x55000000 |
#define | TEST2_2_CAL 0xaa000400 |
Enumerations | |
enum | { RX_VREF_BEGIN = 0 , RX_VREF_END = 31 , RX_VREF_STEP = 1 , TX_VREF_BEGIN = 0 , TX_VREF_END = 50 , TX_VREF_STEP = 2 } |
enum | { FIRST_DQ_DELAY = 0 , FIRST_DQS_DELAY = -48 , MAX_DQDLY_TAPS = 16 , MAX_RX_DQDLY_TAPS = 63 } |
enum | CAL_TYPE { RX_WIN_RD_DQC = 0 , RX_WIN_TEST_ENG , TX_WIN_DQ_ONLY , TX_WIN_DQ_DQM } |
enum | RX_TYPE { RX_DQ = 0 , RX_DQM , RX_DQS } |
Functions | |
static void | dramc_auto_refresh_switch (u8 chn, bool option) |
static u16 | dramc_mode_reg_read (u8 chn, u8 mr_idx) |
void | dramc_mode_reg_write (u8 chn, u8 mr_idx, u8 value) |
static u8 | dramc_mode_reg_read_by_rank (u8 chn, u8 rank, u8 mr_idx) |
static void | dramc_mode_reg_write_by_rank (u8 chn, u8 rank, u8 mr_idx, u8 value) |
static void | move_dramc_delay (u32 *reg_0, u32 *reg_1, u8 shift, s8 shift_coarse_tune) |
static void | move_dramc_tx_dqs (u8 chn, u8 byte, s8 shift_coarse_tune) |
static void | move_dramc_tx_dqs_oen (u8 chn, u8 byte, s8 shift_coarse_tune) |
static void | move_dramc_tx_dq (u8 chn, u8 rank, u8 byte, s8 shift_coarse_tune) |
static void | move_dramc_tx_dq_oen (u8 chn, u8 rank, u8 byte, s8 shift_coarse_tune) |
static void | write_leveling_move_dqs_instead_of_clk (u8 chn) |
static void | dramc_write_leveling (u8 chn, u8 rank, u8 freq_group, const u8 wr_level[CHANNEL_MAX][RANK_MAX][DQS_NUMBER]) |
static void | cbt_set_perbit_delay_cell (u8 chn, u8 rank) |
static void | set_dram_mr_cbt_on_off (u8 chn, u8 rank, u8 fsp, bool cbt_on, struct mr_value *mr, u32 cbt_mode) |
static void | cbt_set_fsp (u8 chn, u8 rank, u8 fsp, struct mr_value *mr) |
static void | o1_path_on_off (u8 cbt_on) |
static void | cbt_entry (u8 chn, u8 rank, u8 fsp, struct mr_value *mr, u32 cbt_mode) |
static void | cbt_exit (u8 chn, u8 rank, u8 fsp, struct mr_value *mr, u32 cbt_mode) |
static void | cbt_set_vref (u8 chn, u8 rank, u8 vref, bool is_final, u32 cbt_mode) |
static void | cbt_set_ca_clk_result (u8 chn, u8 rank, const struct sdram_params *params) |
static u8 | get_cbt_vref_pinmux_value (u8 chn, u8 vref_level, u32 cbt_mode) |
static void | cbt_dramc_dfs_direct_jump (u8 shu_level, bool run_dvfs) |
static void | cbt_switch_freq (cbt_freq freq, bool run_dvfs) |
static void | dramc_cmd_bus_training (u8 chn, u8 rank, u8 freq_group, const struct sdram_params *params, struct mr_value *mr, bool run_dvfs) |
static void | dramc_read_dbi_onoff (size_t chn, bool on) |
static void | dramc_write_dbi_onoff (size_t chn, bool onoff) |
static void | dramc_phy_dcm_2_channel (u8 chn, bool en) |
void | dramc_enable_phy_dcm (u8 chn, bool en) |
static void | dramc_reset_delay_chain_before_calibration (size_t chn) |
void | dramc_hw_gating_onoff (u8 chn, bool on) |
static void | dramc_rx_input_delay_tracking_init_by_freq (u8 chn, u8 freq_group) |
void | dramc_apply_config_before_calibration (u8 freq_group, u32 cbt_mode) |
static void | dramc_set_mr13_vrcg_to_normal (u8 chn, const struct mr_value *mr, u32 rk_num) |
void | dramc_apply_config_after_calibration (const struct mr_value *mr, u32 rk_num) |
static void | dramc_rx_dqs_isi_pulse_cg_switch (u8 chn, bool flag) |
static void | dramc_set_rank_engine2 (u8 chn, u8 rank) |
static void | dramc_engine2_setpat (u8 chn, bool test_pat) |
static void | dramc_engine2_init (u8 chn, u8 rank, u32 t2_1, u32 t2_2, bool test_pat) |
static void | dramc_engine2_check_complete (u8 chn, u8 status) |
static void | dramc_engine2_compare (u8 chn, enum dram_te_op wr) |
static u32 | dramc_engine2_run (u8 chn, enum dram_te_op wr) |
static void | dramc_engine2_end (u8 chn, u32 dummy_rd) |
static bool | dramc_find_gating_window (u32 result_r, u32 result_f, u32 *debug_cnt, u8 dly_coarse_large, u8 dly_coarse_0p5t, u8 *pass_begin, u8 *pass_count, u8 *pass_count_1, u8 *dly_fine_xt, u8 *dqs_high, u8 *dqs_done) |
static void | dramc_find_dly_tune (u8 chn, u8 dly_coarse_large, u8 dly_coarse_0p5t, u8 dly_fine_xt, u8 *dqs_high, u8 *dly_coarse_large_cnt, u8 *dly_coarse_0p5t_cnt, u8 *dly_fine_tune_cnt, u8 *dqs_trans, u8 *dqs_done) |
static void | dram_phy_reset (u8 chn) |
static void | dramc_set_gating_mode (u8 chn, bool mode) |
static void | dramc_rx_dqs_gating_cal_pre (u8 chn, u8 rank) |
static void | set_selph_gating_value (uint32_t *addr, u8 dly, u8 dly_p1) |
static void | dramc_write_dqs_gating_result (u8 chn, u8 rank, u8 *best_coarse_tune2t, u8 *best_coarse_tune0p5t, u8 *best_coarse_tune2t_p1, u8 *best_coarse_tune0p5t_p1) |
static void | dramc_rx_dqs_gating_cal_partial (u8 chn, u8 rank, u32 coarse_start, u32 coarse_end, u8 freqDiv, u8 *pass_begin, u8 *pass_count, u8 *pass_count_1, u8 *dqs_done, u8 *dqs_high, u8 *dqs_transition, u8 *dly_coarse_large_cnt, u8 *dly_coarse_0p5t_cnt, u8 *dly_fine_tune_cnt) |
static void | dramc_rx_dqs_gating_cal (u8 chn, u8 rank, u8 freq_group, const struct sdram_params *params, const bool fast_calib, const struct mr_value *mr) |
static void | dramc_rx_rd_dqc_init (u8 chn, u8 rank) |
static u32 | dramc_rx_rd_dqc_run (u8 chn) |
static void | dramc_rx_rd_dqc_end (u8 chn) |
static void | dramc_rx_vref_pre_setting (u8 chn) |
static void | dramc_set_rx_vref (u8 chn, u8 vref) |
static void | dramc_set_tx_vref (u8 chn, u8 rank, u8 value) |
static void | dramc_set_vref (u8 chn, u8 rank, enum CAL_TYPE type, u8 vref) |
static void | dramc_transfer_dly_tune (u8 chn, u32 dly, u32 adjust_center, struct tx_dly_tune *dly_tune) |
static void | dramc_set_rx_dly_factor (u8 chn, u8 rank, enum RX_TYPE type, u32 val) |
static void | dramc_set_tx_dly_factor (u8 chn, u8 rk, enum CAL_TYPE type, u8 *dq_small_reg, u32 dly) |
static u32 | dramc_get_smallest_dqs_dly (u8 chn, u8 rank, const struct sdram_params *params) |
static void | dramc_get_dly_range (u8 chn, u8 rank, enum CAL_TYPE type, u8 freq_group, u16 *pre_cal, s16 *begin, s16 *end, const struct sdram_params *params) |
static int | dramc_check_dqdqs_win (struct win_perbit_dly *perbit_dly, s16 dly, s16 dly_end, bool fail_bit) |
static void | dramc_set_vref_dly (struct vref_perbit_dly *vref_dly, struct win_perbit_dly delay[]) |
static bool | dramk_calc_best_vref (enum CAL_TYPE type, u8 vref, struct vref_perbit_dly *vref_dly, struct win_perbit_dly delay[], u32 *win_min_max) |
static void | dramc_set_rx_dqdqs_dly (u8 chn, u8 rank, s32 dly) |
static void | dramc_set_tx_best_dly_factor (u8 chn, u8 rank_start, u8 type, struct per_byte_dly *tx_perbyte_dly, u16 *dq_precal_dly, u8 use_delay_cell, u32 *byte_dly_cell) |
static void | dramc_set_rx_best_dly_factor (u8 chn, u8 rank, struct win_perbit_dly *dly, s32 *dqsdly_byte, s32 *dqmdly_byte) |
static void | dramc_set_dqdqs_dly (u8 chn, u8 rank, enum CAL_TYPE type, u8 *small_value, s32 dly) |
static void | dramc_set_tx_dly_center (struct per_byte_dly *center_dly, const struct win_perbit_dly *vref_dly) |
static u32 | get_freq_group_clock (u8 freq_group) |
static void | dramc_set_tx_best_dly (u8 chn, u8 rank, bool bypass_tx, struct win_perbit_dly *vref_dly, enum CAL_TYPE type, u8 freq_group, u16 *tx_dq_precal_result, u16 dly_cell_unit, const struct sdram_params *params, const bool fast_calib) |
static int | dramc_set_rx_best_dly (u8 chn, u8 rank, struct win_perbit_dly *perbit_dly) |
static void | dramc_get_vref_prop (u8 rank, enum CAL_TYPE type, u8 fsp, u8 *vref_scan_en, u8 *vref_begin, u8 *vref_end) |
static u32 | dram_k_perbit (u8 chn, enum CAL_TYPE type) |
static void | dramc_window_perbit_cal_partial (u8 chn, u8 rank, s16 dly_begin, s16 dly_end, s16 dly_step, enum CAL_TYPE type, u8 *small_value, u8 vref_scan_enable, struct win_perbit_dly *win_perbit) |
static u8 | dramc_window_perbit_cal (u8 chn, u8 rank, u8 freq_group, enum CAL_TYPE type, const struct sdram_params *params, const bool fast_calib) |
static void | dramc_dle_factor_handler (u8 chn, u8 val, u8 freq_group) |
static u8 | dramc_rx_datlat_cal (u8 chn, u8 rank, u8 freq_group, const struct sdram_params *params, const bool fast_calib, bool *test_passed) |
static void | dramc_dual_rank_rx_datlat_cal (u8 chn, u8 freq_group, u8 datlat0, u8 datlat1) |
static void | dramc_rx_dqs_gating_post_process (u8 chn, u8 freq_group, u32 rk_num) |
static void | start_dqsosc (u8 chn) |
static void | dqsosc_auto (u8 chn, u8 rank, u8 freq_group, u16 *osc_thrd_inc, u16 *osc_thrd_dec) |
void | dramc_hw_dqsosc (u8 chn, u32 rk_num) |
static void | dqsosc_shu_settings (u8 chn, u8 freq_group, u16 *osc_thrd_inc, u16 *osc_thrd_dec) |
void | dramc_dqs_precalculation_preset (void) |
void | get_dram_info_after_cal (u8 *density_result, u32 rk_num) |
int | dramc_calibrate_all_channels (const struct sdram_params *pams, u8 freq_group, struct mr_value *mr, bool run_dvfs) |
Variables | |
static const u8 | lp4_ca_mapping_pop [CHANNEL_MAX][CA_NUM_LP4] |
#define TEST2_1_CAL 0x55000000 |
Definition at line 31 of file dramc_pi_calibration_api.c.
#define TEST2_2_CAL 0xaa000400 |
Definition at line 32 of file dramc_pi_calibration_api.c.
#define WRITE_LEVELING_MOVD_DQS 1 |
Definition at line 30 of file dramc_pi_calibration_api.c.
anonymous enum |
Enumerator | |
---|---|
RX_VREF_BEGIN | |
RX_VREF_END | |
RX_VREF_STEP | |
TX_VREF_BEGIN | |
TX_VREF_END | |
TX_VREF_STEP |
Definition at line 14 of file dramc_pi_calibration_api.c.
anonymous enum |
Enumerator | |
---|---|
FIRST_DQ_DELAY | |
FIRST_DQS_DELAY | |
MAX_DQDLY_TAPS | |
MAX_RX_DQDLY_TAPS |
Definition at line 23 of file dramc_pi_calibration_api.c.
enum CAL_TYPE |
Enumerator | |
---|---|
RX_WIN_RD_DQC | |
RX_WIN_TEST_ENG | |
TX_WIN_DQ_ONLY | |
TX_WIN_DQ_DQM |
Definition at line 34 of file dramc_pi_calibration_api.c.
enum RX_TYPE |
Enumerator | |
---|---|
RX_DQ | |
RX_DQM | |
RX_DQS |
Definition at line 41 of file dramc_pi_calibration_api.c.
Definition at line 427 of file dramc_pi_calibration_api.c.
References ch, CHANNEL_MAX, dramc_dbg, mtk_spm_regs::dramc_dpy_clk_sw_con, mtk_spm, READ32_BITFIELD, SET32_BITFIELDS, mtk_spm_regs::spm_power_on_val0, and udelay().
Referenced by cbt_switch_freq().
Definition at line 328 of file dramc_pi_calibration_api.c.
References ch, CKE_FIXOFF, CKE_FIXON, dramc_cke_fix_onoff(), o1_path_on_off(), SET32_BITFIELDS, set_dram_mr_cbt_on_off(), and udelay().
Referenced by dramc_cmd_bus_training().
Definition at line 347 of file dramc_pi_calibration_api.c.
References ch, CKE_FIXON, dramc_cke_fix_onoff(), o1_path_on_off(), SET32_BITFIELDS, set_dram_mr_cbt_on_off(), and udelay().
Referenced by dramc_cmd_bus_training().
|
static |
Definition at line 377 of file dramc_pi_calibration_api.c.
References ch, lp4_ca_mapping_pop, params, SET32_BITFIELDS, and udelay().
Referenced by dramc_cmd_bus_training().
Definition at line 294 of file dramc_pi_calibration_api.c.
References BIT, dramc_mode_reg_write_by_rank(), FSP_0, and mr_value::MR13Value.
Referenced by dramc_cmd_bus_training().
Definition at line 257 of file dramc_pi_calibration_api.c.
References ch, and SET32_BITFIELDS.
Referenced by dramc_cmd_bus_training().
Definition at line 359 of file dramc_pi_calibration_api.c.
References BIT, ch, dramc_dbg, dramc_mode_reg_write_by_rank(), SET32_BITFIELDS, and udelay().
Referenced by dramc_cmd_bus_training().
Definition at line 510 of file dramc_pi_calibration_api.c.
References cbt_dramc_dfs_direct_jump(), CBT_LOW_FREQ, DRAM_DFS_SHUFFLE_1, and DRAM_DFS_SHUFFLE_MAX.
Referenced by dramc_cmd_bus_training().
|
static |
Definition at line 2500 of file dramc_pi_calibration_api.c.
References addr, ARRAY_SIZE, ch, CKE_FIXON, DRAM_DFS_SHUFFLE_MAX, dramc_cke_fix_onoff(), dramc_dbg, dramc_mode_reg_read(), dramc_mode_reg_write(), get_freq_group_clock(), MR23_DEFAULT_VALUE, read32(), SET32_BITFIELDS, start_dqsosc(), udelay(), value, and write32().
Referenced by dramc_calibrate_all_channels().
|
static |
Definition at line 2610 of file dramc_pi_calibration_api.c.
References ch, die(), LP4X_DDR1600, LP4X_DDR2400, LP4X_DDR3200, LP4X_DDR3600, MR23_DEFAULT_VALUE, RANK_0, RANK_MAX, and SET32_BITFIELDS.
Referenced by dramc_calibrate_all_channels().
Definition at line 2106 of file dramc_pi_calibration_api.c.
References dramc_engine2_run(), dramc_engine2_setpat(), dramc_rx_rd_dqc_run(), RX_WIN_RD_DQC, RX_WIN_TEST_ENG, TE_OP_WRITE_READ_CHECK, and type.
Definition at line 1089 of file dramc_pi_calibration_api.c.
References ch, clrbits32, SET32_BITFIELDS, setbits32, and udelay().
Referenced by dramc_dle_factor_handler(), dramc_rx_dqs_gating_cal(), dramc_rx_dqs_gating_cal_partial(), dramc_set_rx_best_dly_factor(), and dramc_set_rx_dqdqs_dly().
Definition at line 816 of file dramc_pi_calibration_api.c.
References ch, CHANNEL_MAX, CKE_DYNAMIC, clrbits32, clrsetbits32, DRAM_DFS_SHUFFLE_MAX, dramc_cke_fix_onoff(), dramc_set_mr13_vrcg_to_normal(), setbits32, and write32().
Referenced by after_calib().
Definition at line 736 of file dramc_pi_calibration_api.c.
References CBT_R0_BYTE_R1_NORMAL, CBT_R0_NORMAL_R1_BYTE, CBT_R0_R1_BYTE, CBT_R0_R1_NORMAL, ch, CHANNEL_MAX, clrbits32, clrsetbits32, DRAM_DFS_SHUFFLE_1, DRAM_DFS_SHUFFLE_MAX, dramc_enable_phy_dcm(), dramc_hw_gating_onoff(), dramc_read_dbi_onoff(), dramc_reset_delay_chain_before_calibration(), dramc_rx_input_delay_tracking_init_by_freq(), dramc_write_dbi_onoff(), LP4X_DDR3200, LP4X_DDR3600, and setbits32.
Referenced by dfs_init_for_calibration(), and init_dram().
Definition at line 81 of file dramc_pi_calibration_api.c.
References ch, READ32_BITFIELD, SET32_BITFIELDS, and udelay().
Referenced by dramc_calibrate_all_channels(), dramc_cmd_bus_training(), and dramc_write_leveling().
int dramc_calibrate_all_channels | ( | const struct sdram_params * | pams, |
u8 | freq_group, | ||
struct mr_value * | mr, | ||
bool | run_dvfs | ||
) |
Definition at line 3101 of file dramc_pi_calibration_api.c.
References CHANNEL_MAX, die(), dqsosc_auto(), dqsosc_shu_settings(), dramc_auto_refresh_switch(), dramc_cmd_bus_training(), dramc_dbg, dramc_dual_rank_rx_datlat_cal(), DRAMC_PARAM_SOURCE_FLASH, DRAMC_PARAM_SOURCE_SDRAM_CONFIG, dramc_rx_datlat_cal(), dramc_rx_dqs_gating_cal(), dramc_rx_dqs_gating_post_process(), dramc_window_perbit_cal(), dramc_write_leveling(), RANK_0, RANK_MAX, sdram_params::rank_num, RX_WIN_RD_DQC, RX_WIN_TEST_ENG, sdram_params::source, TX_WIN_DQ_DQM, TX_WIN_DQ_ONLY, and sdram_params::wr_level.
Referenced by run_calib().
|
static |
Definition at line 1678 of file dramc_pi_calibration_api.c.
References win_perbit_dly::best_first, win_perbit_dly::best_last, win_perbit_dly::first_pass, win_perbit_dly::last_pass, and PASS_RANGE_NA.
Referenced by dramc_window_perbit_cal_partial().
|
static |
Definition at line 518 of file dramc_pi_calibration_api.c.
References addr, ARRAY_SIZE, cbt_entry(), cbt_exit(), CBT_HIGH_FREQ, CBT_LOW_FREQ, cbt_mrr_pinmux_mapping(), cbt_set_ca_clk_result(), cbt_set_fsp(), cbt_set_perbit_delay_cell(), cbt_set_vref(), cbt_switch_freq(), ch, dramc_auto_refresh_switch(), FSP_1, get_cbt_vref_pinmux_value(), get_freq_fsq(), params, RANK_1, read32(), SET32_BITFIELDS, set_mrr_pinmux_mapping(), udelay(), value, and write32().
Referenced by dramc_calibrate_all_channels().
Definition at line 2313 of file dramc_pi_calibration_api.c.
References ch, dram_phy_reset(), LP4X_DDR3200, LP4X_DDR3600, MAX, SET32_BITFIELDS, and val.
Referenced by dramc_dual_rank_rx_datlat_cal(), and dramc_rx_datlat_cal().
Definition at line 2688 of file dramc_pi_calibration_api.c.
References ch, CHANNEL_MAX, DIV_ROUND_CLOSEST, DRAM_DFS_SHUFFLE_MAX, dramc_dbg, get_shu_freq(), HW_REG_SHUFFLE_MAX, dramc_ao_regs_rk::pre_tdqsck, RANK_0, RANK_MAX, READ32_BITFIELD, and SET32_BITFIELDS.
Referenced by dramc_runtime_config().
Definition at line 2407 of file dramc_pi_calibration_api.c.
References dramc_dle_factor_handler(), and MAX.
Referenced by dramc_calibrate_all_channels().
Definition at line 642 of file dramc_pi_calibration_api.c.
References ch, clrbits32, clrsetbits32, DRAM_DFS_SHUFFLE_MAX, dramc_phy_dcm_2_channel(), mask, setbits32, value, and write32().
Referenced by dramc_apply_config_before_calibration(), and dramc_runtime_config().
Definition at line 920 of file dramc_pi_calibration_api.c.
References ch, dramc_dbg, read32(), and wait_us.
Referenced by dramc_engine2_compare().
|
static |
Definition at line 935 of file dramc_pi_calibration_api.c.
References ch, dramc_engine2_check_complete(), read32(), SET32_BITFIELDS, TE_OP_WRITE_READ_CHECK, and udelay().
Referenced by dramc_engine2_run().
Definition at line 974 of file dramc_pi_calibration_api.c.
References ch, clrbits32, and write32().
Referenced by dramc_rx_datlat_cal(), dramc_rx_dqs_gating_cal(), and dramc_window_perbit_cal().
Definition at line 893 of file dramc_pi_calibration_api.c.
References ch, dramc_engine2_setpat(), dramc_set_rank_engine2(), and SET32_BITFIELDS.
Referenced by dramc_rx_datlat_cal(), dramc_rx_dqs_gating_cal(), and dramc_window_perbit_cal().
|
static |
Definition at line 951 of file dramc_pi_calibration_api.c.
References ch, dramc_engine2_compare(), read32(), SET32_BITFIELDS, TE_OP_READ_CHECK, TE_OP_WRITE_READ_CHECK, and udelay().
Referenced by dram_k_perbit(), dramc_rx_datlat_cal(), and dramc_rx_dqs_gating_cal_partial().
Definition at line 869 of file dramc_pi_calibration_api.c.
References ch, and SET32_BITFIELDS.
Referenced by dram_k_perbit(), and dramc_engine2_init().
|
static |
Definition at line 1047 of file dramc_pi_calibration_api.c.
References ch, DQS_GW_FINE_STEP, DQS_NUMBER, dramc_dbg, and read32().
Referenced by dramc_rx_dqs_gating_cal_partial().
|
static |
Definition at line 980 of file dramc_pi_calibration_api.c.
References DQS_GW_FINE_END, DQS_GW_FINE_STEP, DQS_NUMBER, dramc_dbg, and GATING_GOLDEND_DQSCNT.
Referenced by dramc_rx_dqs_gating_cal_partial().
|
static |
Definition at line 1634 of file dramc_pi_calibration_api.c.
References die(), dramc_err, dramc_get_smallest_dqs_dly(), LP4X_DDR1600, LP4X_DDR2400, LP4X_DDR3200, LP4X_DDR3600, MAX_RX_DQDLY_TAPS, MIN, params, RX_WIN_RD_DQC, RX_WIN_TEST_ENG, TX_WIN_DQ_DQM, TX_WIN_DQ_ONLY, and type.
Referenced by dramc_window_perbit_cal().
|
static |
Definition at line 1616 of file dramc_pi_calibration_api.c.
References ch, DQS_NUMBER, MIN, params, and read32().
Referenced by dramc_get_dly_range().
|
static |
Definition at line 2080 of file dramc_pi_calibration_api.c.
References FSP_0, RANK_0, RX_VREF_END, RX_WIN_TEST_ENG, TX_VREF_BEGIN, TX_VREF_END, TX_WIN_DQ_ONLY, and type.
Referenced by dramc_window_perbit_cal().
Definition at line 2570 of file dramc_pi_calibration_api.c.
References ch, DRAM_DFS_SHUFFLE_1, DRAM_DFS_SHUFFLE_2, DRAM_DFS_SHUFFLE_3, DRAM_DFS_SHUFFLE_MAX, get_shu_freq(), RANK_MAX, and SET32_BITFIELDS.
Referenced by dramc_runtime_config().
Definition at line 699 of file dramc_pi_calibration_api.c.
References ch, and clrsetbits32.
Referenced by dramc_apply_config_before_calibration(), dramc_runtime_config(), and dramc_rx_dqs_gating_cal_pre().
Definition at line 95 of file dramc_pi_calibration_api.c.
References ch, dramc_dbg, READ32_BITFIELD, SET32_BITFIELDS, udelay(), and value.
Referenced by dqsosc_auto(), and dramc_mode_reg_read_by_rank().
Definition at line 133 of file dramc_pi_calibration_api.c.
References ch, dramc_dbg, dramc_mode_reg_read(), READ32_BITFIELD, SET32_BITFIELDS, and value.
Referenced by get_dram_info_after_cal().
Definition at line 114 of file dramc_pi_calibration_api.c.
References ch, CKE_FIXON, dramc_cke_fix_onoff(), dramc_dbg, read32(), READ32_BITFIELD, SET32_BITFIELDS, udelay(), value, and write32().
Referenced by dqsosc_auto(), dramc_mode_reg_init(), and dramc_mode_reg_write_by_rank().
Definition at line 146 of file dramc_pi_calibration_api.c.
References ch, dramc_dbg, dramc_mode_reg_write(), READ32_BITFIELD, SET32_BITFIELDS, and value.
Referenced by cbt_set_fsp(), cbt_set_vref(), dramc_rx_dqs_gating_cal(), dramc_set_mr13_vrcg_to_normal(), dramc_set_tx_vref(), and set_dram_mr_cbt_on_off().
Definition at line 625 of file dramc_pi_calibration_api.c.
References ch, clrbits32, clrsetbits32, and DRAM_DFS_SHUFFLE_MAX.
Referenced by dramc_enable_phy_dcm().
Definition at line 613 of file dramc_pi_calibration_api.c.
References ch, and SET32_BITFIELDS.
Referenced by dramc_apply_config_before_calibration().
Definition at line 686 of file dramc_pi_calibration_api.c.
References dramc_ddrphy_regs_shu_rk::b, dramc_ddrphy_regs_shu_rk::ca_cmd, ch, clrbits32, dramc_ddrphy_regs_shu_rk::dq, and RANK_MAX.
Referenced by dramc_apply_config_before_calibration().
|
static |
Definition at line 2341 of file dramc_pi_calibration_api.c.
References ch, DATLAT_TAP_NUMBER, dramc_dbg, dramc_dle_factor_handler(), dramc_engine2_end(), dramc_engine2_init(), dramc_engine2_run(), dramc_err, params, read32(), READ32_BITFIELD, SET32_BITFIELDS, TE_OP_WRITE_READ_CHECK, TEST2_1_CAL, and TEST2_2_CAL.
Referenced by dramc_calibrate_all_channels().
|
static |
Definition at line 1307 of file dramc_pi_calibration_api.c.
References addr, ARRAY_SIZE, ch, die(), DQS_GW_FINE_STEP, DQS_NUMBER, dram_phy_reset(), dramc_dbg, dramc_engine2_end(), dramc_engine2_init(), dramc_mode_reg_write_by_rank(), dramc_rx_dqs_gating_cal_partial(), dramc_rx_dqs_gating_cal_pre(), dramc_rx_dqs_isi_pulse_cg_switch(), dramc_write_dqs_gating_result(), get_freq_fsq(), LP4X_DDR1600, LP4X_DDR2400, LP4X_DDR3200, LP4X_DDR3600, mr_value::MR01Value, params, read32(), RX_DLY_DQSIENSTB_LOOP, RX_DQS_CTL_LOOP, TEST2_1_CAL, value, write32(), and WRITE32_BITFIELDS.
Referenced by dramc_calibrate_all_channels().
|
static |
Definition at line 1212 of file dramc_pi_calibration_api.c.
References ch, DQS_BIT_NUMBER, DQS_GW_FINE_END, DQS_NUMBER, dram_phy_reset(), dramc_dbg, dramc_engine2_run(), dramc_find_dly_tune(), dramc_find_gating_window(), dramc_set_gating_mode(), read32(), READ32_BITFIELD, RX_DQS_CTL_LOOP, SET32_BITFIELDS, set_selph_gating_value(), TE_OP_READ_CHECK, udelay(), value, and WRITE32_BITFIELDS.
Referenced by dramc_rx_dqs_gating_cal().
Definition at line 1127 of file dramc_pi_calibration_api.c.
References ch, dramc_hw_gating_onoff(), SET32_BITFIELDS, and udelay().
Referenced by dramc_rx_dqs_gating_cal().
Definition at line 2413 of file dramc_pi_calibration_api.c.
References ch, clrsetbits32, DQS_NUMBER, dramc_dbg, LP4X_DDR3200, LP4X_DDR3600, MAX, MIN, RANK_MAX, read32(), READ32_BITFIELD, and SET32_BITFIELDS.
Referenced by dramc_calibrate_all_channels().
Definition at line 854 of file dramc_pi_calibration_api.c.
References ch, and clrsetbits32.
Referenced by dramc_rx_dqs_gating_cal(), and dramc_write_dqs_gating_result().
Definition at line 708 of file dramc_pi_calibration_api.c.
References ch, clrbits32, clrsetbits32, die(), LP4X_DDR1600, LP4X_DDR2400, LP4X_DDR3200, and LP4X_DDR3600.
Referenced by dramc_apply_config_before_calibration().
Definition at line 1471 of file dramc_pi_calibration_api.c.
References ch, and SET32_BITFIELDS.
Referenced by dramc_window_perbit_cal().
Definition at line 1432 of file dramc_pi_calibration_api.c.
References ch, clrbits32, DQ_DATA_WIDTH, phy_mapping, and SET32_BITFIELDS.
Referenced by dramc_window_perbit_cal().
Definition at line 1453 of file dramc_pi_calibration_api.c.
References ch, dramc_dbg, read32(), SET32_BITFIELDS, and wait_us.
Referenced by dram_k_perbit().
Definition at line 1476 of file dramc_pi_calibration_api.c.
References ch, and SET32_BITFIELDS.
Referenced by dramc_window_perbit_cal().
|
static |
Definition at line 1919 of file dramc_pi_calibration_api.c.
References dramc_set_rx_dqdqs_dly(), dramc_set_tx_dly_factor(), RX_WIN_RD_DQC, RX_WIN_TEST_ENG, and type.
Referenced by dramc_window_perbit_cal_partial().
Definition at line 1103 of file dramc_pi_calibration_api.c.
References ch, clrbits32, clrsetbits32, setbits32, and udelay().
Referenced by dramc_rx_dqs_gating_cal_partial().
Definition at line 806 of file dramc_pi_calibration_api.c.
References ch, clrbits32, DRAM_DFS_SHUFFLE_MAX, dramc_mode_reg_write_by_rank(), and mr_value::MR13Value.
Referenced by dramc_apply_config_after_calibration().
Definition at line 861 of file dramc_pi_calibration_api.c.
References ch, and SET32_BITFIELDS.
Referenced by dramc_engine2_init().
|
static |
Definition at line 2048 of file dramc_pi_calibration_api.c.
References win_perbit_dly::best_dqdly, DQS_BIT_NUMBER, DQS_NUMBER, dramc_set_rx_best_dly_factor(), and win_perbit_dly::win_center.
Referenced by dramc_window_perbit_cal().
|
static |
Definition at line 1891 of file dramc_pi_calibration_api.c.
References win_perbit_dly::best_dqdly, ch, clrsetbits32, DQS_BIT_NUMBER, DQS_NUMBER, dram_phy_reset(), and value.
Referenced by dramc_set_rx_best_dly().
Definition at line 1531 of file dramc_pi_calibration_api.c.
References ch, dramc_err, RX_DQ, RX_DQM, RX_DQS, SET32_BITFIELDS, type, val, and WRITE32_BITFIELDS.
Referenced by dramc_set_rx_dqdqs_dly(), and dramc_window_perbit_cal().
Definition at line 1807 of file dramc_pi_calibration_api.c.
References dram_phy_reset(), dramc_set_rx_dly_factor(), RX_DQ, RX_DQM, and RX_DQS.
Referenced by dramc_set_dqdqs_dly().
Definition at line 1482 of file dramc_pi_calibration_api.c.
References ch, dramc_dbg, and SET32_BITFIELDS.
Referenced by dramc_set_vref().
|
static |
Definition at line 1982 of file dramc_pi_calibration_api.c.
References win_perbit_dly::best_first, win_perbit_dly::best_last, DQ_DATA_WIDTH, DQS_BIT_NUMBER, DQS_NUMBER, dramc_dbg, dramc_set_tx_best_dly_factor(), dramc_set_tx_dly_center(), per_byte_dly::final_dly, FSP_1, get_freq_fsq(), get_freq_group_clock(), per_byte_dly::max_center, per_byte_dly::min_center, params, TX_WIN_DQ_ONLY, type, and win_perbit_dly::win_center.
Referenced by dramc_window_perbit_cal().
|
static |
Definition at line 1821 of file dramc_pi_calibration_api.c.
References ch, clrsetbits32, tx_dly_tune::coarse_tune_large, tx_dly_tune::coarse_tune_large_oen, tx_dly_tune::coarse_tune_small, tx_dly_tune::coarse_tune_small_oen, DQS_NUMBER, dramc_transfer_dly_tune(), tx_dly_tune::fine_tune, RANK_MAX, SET32_BITFIELDS, TX_WIN_DQ_ONLY, type, and write32().
Referenced by dramc_set_tx_best_dly().
|
static |
Definition at line 1927 of file dramc_pi_calibration_api.c.
References DQS_BIT_NUMBER, DQS_NUMBER, dramc_dbg, per_byte_dly::max_center, per_byte_dly::min_center, and win_perbit_dly::win_center.
Referenced by dramc_set_tx_best_dly().
|
static |
Definition at line 1565 of file dramc_pi_calibration_api.c.
References ch, clrsetbits32, tx_dly_tune::coarse_tune_large, tx_dly_tune::coarse_tune_large_oen, tx_dly_tune::coarse_tune_small, tx_dly_tune::coarse_tune_small_oen, dramc_dbg, dramc_transfer_dly_tune(), tx_dly_tune::fine_tune, SET32_BITFIELDS, TX_WIN_DQ_DQM, TX_WIN_DQ_ONLY, and type.
Referenced by dramc_set_dqdqs_dly().
Definition at line 1490 of file dramc_pi_calibration_api.c.
References dramc_mode_reg_write_by_rank(), and value.
Referenced by dramc_set_vref().
Definition at line 1495 of file dramc_pi_calibration_api.c.
References dramc_set_rx_vref(), dramc_set_tx_vref(), RX_WIN_TEST_ENG, and type.
Referenced by dramc_window_perbit_cal().
|
static |
Definition at line 1709 of file dramc_pi_calibration_api.c.
References win_perbit_dly::best_dqdly, win_perbit_dly::best_first, win_perbit_dly::best_last, delay(), DQ_DATA_WIDTH, vref_perbit_dly::perbit_dly, and win_perbit_dly::win_center.
Referenced by dramk_calc_best_vref().
|
static |
Definition at line 1503 of file dramc_pi_calibration_api.c.
References tx_dly_tune::coarse_tune_large, tx_dly_tune::coarse_tune_large_oen, tx_dly_tune::coarse_tune_small, tx_dly_tune::coarse_tune_small_oen, tx_dly_tune::fine_tune, and TX_DQ_COARSE_TUNE_TO_FINE_TUNE_TAP.
Referenced by dramc_set_tx_best_dly_factor(), and dramc_set_tx_dly_factor().
|
static |
Definition at line 2166 of file dramc_pi_calibration_api.c.
References win_perbit_dly::best_first, win_perbit_dly::best_last, vref_perbit_dly::best_vref, ch, clrbits32, DQ_DATA_WIDTH, DQS_NUMBER, dramc_dbg, dramc_engine2_end(), dramc_engine2_init(), dramc_get_dly_range(), dramc_get_vref_prop(), dramc_rx_rd_dqc_end(), dramc_rx_rd_dqc_init(), dramc_rx_vref_pre_setting(), dramc_set_rx_best_dly(), dramc_set_rx_dly_factor(), dramc_set_tx_best_dly(), dramc_set_vref(), dramc_window_perbit_cal_partial(), dramk_calc_best_vref(), FIRST_DQ_DELAY, win_perbit_dly::first_pass, FSP_0, FSP_1, get_freq_fsq(), win_perbit_dly::last_pass, vref_perbit_dly::max_win_sum, params, PASS_RANGE_NA, vref_perbit_dly::perbit_dly, read32(), RX_DQ, RX_DQM, RX_WIN_RD_DQC, RX_WIN_TEST_ENG, setbits32, TEST2_1_CAL, TEST2_2_CAL, TX_WIN_DQ_DQM, TX_WIN_DQ_ONLY, type, and write32().
Referenced by dramc_calibrate_all_channels().
|
static |
Definition at line 2123 of file dramc_pi_calibration_api.c.
References DQ_DATA_WIDTH, DQS_BIT_NUMBER, dram_k_perbit(), dramc_check_dqdqs_win(), dramc_dbg, dramc_set_dqdqs_dly(), and type.
Referenced by dramc_window_perbit_cal().
Definition at line 620 of file dramc_pi_calibration_api.c.
References ch, and SET32_BITFIELDS.
Referenced by dramc_apply_config_before_calibration().
|
static |
Definition at line 1153 of file dramc_pi_calibration_api.c.
References ch, clrsetbits32, DQS_NUMBER, dramc_dbg, and dramc_rx_dqs_isi_pulse_cg_switch().
Referenced by dramc_rx_dqs_gating_cal().
|
static |
Definition at line 231 of file dramc_pi_calibration_api.c.
References ch, DQS_NUMBER, dramc_auto_refresh_switch(), move_dramc_tx_dq(), move_dramc_tx_dq_oen(), RANK_0, SET32_BITFIELDS, and write_leveling_move_dqs_instead_of_clk().
Referenced by dramc_calibrate_all_channels().
|
static |
Definition at line 1723 of file dramc_pi_calibration_api.c.
References vref_perbit_dly::best_vref, delay(), DQ_DATA_WIDTH, dramc_dbg, dramc_err, dramc_set_vref_dly(), vref_perbit_dly::max_win_sum, RX_WIN_RD_DQC, RX_WIN_TEST_ENG, TX_WIN_DQ_DQM, TX_WIN_DQ_ONLY, and type.
Referenced by dramc_window_perbit_cal().
Definition at line 405 of file dramc_pi_calibration_api.c.
References BIT, dramc_dbg, and phy_mapping.
Referenced by dramc_cmd_bus_training().
Definition at line 3052 of file dramc_pi_calibration_api.c.
References CHANNEL_A, dramc_dbg, dramc_mode_reg_read_by_rank(), dramc_show, and RANK_0.
Referenced by run_calib().
Definition at line 1952 of file dramc_pi_calibration_api.c.
References die(), LP4X_DDR1600, LP4X_DDR2400, LP4X_DDR3200, and LP4X_DDR3600.
Referenced by dqsosc_auto(), and dramc_set_tx_best_dly().
Definition at line 157 of file dramc_pi_calibration_api.c.
References clrsetbits32, DQ_DIV_MASK, DQ_DIV_SHIFT, and read32().
Referenced by move_dramc_tx_dq(), move_dramc_tx_dq_oen(), move_dramc_tx_dqs(), and move_dramc_tx_dqs_oen().
Definition at line 193 of file dramc_pi_calibration_api.c.
References ch, and move_dramc_delay().
Referenced by dramc_write_leveling(), and write_leveling_move_dqs_instead_of_clk().
Definition at line 204 of file dramc_pi_calibration_api.c.
References ch, move_dramc_delay(), and OEN_SHIFT.
Referenced by dramc_write_leveling(), and write_leveling_move_dqs_instead_of_clk().
Definition at line 180 of file dramc_pi_calibration_api.c.
References ch, and move_dramc_delay().
Referenced by write_leveling_move_dqs_instead_of_clk().
Definition at line 186 of file dramc_pi_calibration_api.c.
References ch, move_dramc_delay(), and OEN_SHIFT.
Referenced by write_leveling_move_dqs_instead_of_clk().
Definition at line 310 of file dramc_pi_calibration_api.c.
References ch, CHANNEL_MAX, SET32_BITFIELDS, and udelay().
Referenced by cbt_entry(), and cbt_exit().
|
static |
Definition at line 268 of file dramc_pi_calibration_api.c.
References ch, dramc_mode_reg_write_by_rank(), FSP_1, mr_value::MR13Value, and SET32_BITFIELDS.
Referenced by cbt_entry(), and cbt_exit().
Definition at line 1146 of file dramc_pi_calibration_api.c.
References addr, and clrsetbits32.
Referenced by dramc_rx_dqs_gating_cal_partial().
Definition at line 2489 of file dramc_pi_calibration_api.c.
References ch, dramc_err, READ32_BITFIELD, SET32_BITFIELDS, and wait_us.
Referenced by dqsosc_auto().
Definition at line 218 of file dramc_pi_calibration_api.c.
References DQS_NUMBER, move_dramc_tx_dq(), move_dramc_tx_dq_oen(), move_dramc_tx_dqs(), move_dramc_tx_dqs_oen(), RANK_0, RANK_MAX, and WRITE_LEVELING_MOVD_DQS.
Referenced by dramc_write_leveling().
|
static |
Definition at line 76 of file dramc_pi_calibration_api.c.
Referenced by cbt_set_ca_clk_result().