coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <assert.h>
#include <commonlib/helpers.h>
#include <console/console.h>
#include <cpu/intel/model_206ax/model_206ax.h>
#include <device/mmio.h>
#include <device/pci_ops.h>
#include <northbridge/intel/sandybridge/chip.h>
#include <device/pci_def.h>
#include <delay.h>
#include <types.h>
#include "raminit_native.h"
#include "raminit_common.h"
#include "raminit_tables.h"
#include "sandybridge.h"
Go to the source code of this file.
Data Structures | |
struct | run |
Macros | |
#define | DEFAULT_PCI_MMIO_SIZE 2048 |
#define | CCC_MAX_PI (2 * QCLK_PI - 1) |
#define | RCVEN_COARSE_PI_LENGTH (2 * QCLK_PI) |
#define | TX_DQS_PI_LENGTH (2 * QCLK_PI) |
#define | CT_MIN_PI (-CCC_MAX_PI) |
#define | CT_MAX_PI (+CCC_MAX_PI + 1) |
#define | CT_PI_LENGTH (CT_MAX_PI - CT_MIN_PI + 1) |
#define | MIN_C320C_LEN 13 |
Variables | |
static const u32 | lane_base [] |
#define CCC_MAX_PI (2 * QCLK_PI - 1) |
Definition at line 908 of file raminit_common.c.
#define CT_MAX_PI (+CCC_MAX_PI + 1) |
Definition at line 1982 of file raminit_common.c.
#define CT_MIN_PI (-CCC_MAX_PI) |
Definition at line 1981 of file raminit_common.c.
Definition at line 1983 of file raminit_common.c.
#define DEFAULT_PCI_MMIO_SIZE 2048 |
Definition at line 367 of file raminit_common.c.
#define MIN_C320C_LEN 13 |
Definition at line 1985 of file raminit_common.c.
#define RCVEN_COARSE_PI_LENGTH (2 * QCLK_PI) |
Definition at line 1096 of file raminit_common.c.
#define TX_DQS_PI_LENGTH (2 * QCLK_PI) |
Definition at line 1552 of file raminit_common.c.
int aggressive_read_training | ( | ramctr_timing * | ctrl | ) |
Definition at line 2352 of file raminit_common.c.
References find_agrsv_read_margin(), FOR_ALL_CHANNELS, FOR_ALL_LANES, FOR_ALL_POPULATED_CHANNELS, FOR_ALL_POPULATED_RANKS, IOSAV_DC_MASK, ram_rank_timings::lanes, mchbar_write32(), NUM_CHANNELS, NUM_LANES, NUM_SLOTRANKS, printram, program_timings(), ram_rank_timings::ram_lane_timings::rx_dqs_n, ram_rank_timings::ram_lane_timings::rx_dqs_p, and ramctr_timing_st::timings.
Referenced by try_init_dram_ddr3().
int aggressive_write_training | ( | ramctr_timing * | ctrl | ) |
Definition at line 2413 of file raminit_common.c.
References run::all, ARRAY_SIZE, BIOS_EMERG, CAPID0_A, CAPID_WRTVREF, ramctr_timing_st::cpu, run::end, fill_pattern5(), FOR_ALL_CHANNELS, FOR_ALL_LANES, FOR_ALL_POPULATED_CHANNELS, FOR_ALL_POPULATED_RANKS, get_longest_zero_run(), HOST_BRIDGE, IOSAV_BYTE_SERROR_C_ch, IS_IVY_CPU, IS_IVY_CPU_D, IS_IVY_CPU_E, ram_rank_timings::lanes, MAKE_ERR, MAX, MAX_TX_DQ, mchbar_read32(), mchbar_write32(), MCMNTS_SPARE, run::middle, MIN, NUM_CHANNELS, NUM_LANES, NUM_PATTERNS, NUM_SLOTRANKS, pci_read_config32(), printk, printram, program_timings(), set_write_vref(), run::start, test_aggressive_write(), ramctr_timing_st::timings, ram_rank_timings::ram_lane_timings::tx_dq, and ramctr_timing_st::tx_dq_offset.
Referenced by try_init_dram_ddr3().
|
static |
Definition at line 1265 of file raminit_common.c.
References get_logic_delay_delta(), ram_rank_timings::io_latency, printram, ram_rank_timings::roundtrip_latency, and ramctr_timing_st::timings.
Referenced by receive_enable_calibration().
void channel_scrub | ( | ramctr_timing * | ctrl | ) |
Definition at line 2595 of file raminit_common.c.
References ARRAY_SIZE, iosav_ssq::bank, iosav_ssq::command, ramctr_timing_st::CWL, fill_pattern0(), FOR_ALL_POPULATED_CHANNELS, FOR_ALL_POPULATED_RANKS, ramctr_timing_st::info, IOSAV_ACT, IOSAV_PRE, iosav_run_queue(), IOSAV_WR, iosav_write_sequence(), MAX, iosav_ssq::sp_cmd_ctrl, SSQ_NA, SSQ_WR, ramctr_timing_st::tFAW, ramctr_timing_st::tRCD, ramctr_timing_st::tRP, ramctr_timing_st::tRRD, ramctr_timing_st::tWTR, and wait_for_iosav().
Referenced by init_dram_ddr3().
int channel_test | ( | ramctr_timing * | ctrl | ) |
Definition at line 2558 of file raminit_common.c.
References BIOS_EMERG, fill_pattern0(), FOR_ALL_CHANNELS, FOR_ALL_LANES, FOR_ALL_POPULATED_CHANNELS, IOSAV_By_BW_SERROR_C, IOSAV_By_ERROR_COUNT, IOSAV_By_ERROR_COUNT_ch, iosav_run_once_and_wait(), iosav_write_memory_test_sequence(), MAKE_ERR, MC_INIT_STATE_ch, mchbar_read32(), mchbar_write32(), printk, ramctr_timing_st::rankmap, and wait_for_iosav().
Referenced by try_init_dram_ddr3().
int command_training | ( | ramctr_timing * | ctrl | ) |
Definition at line 2057 of file raminit_common.c.
References BIOS_EMERG, DIV_ROUND_UP, fill_pattern5(), FOR_ALL_POPULATED_CHANNELS, MIN, printk, printram, program_timings(), ramctr_timing_st::rankmap, reprogram_320c(), ramctr_timing_st::tCMD, and try_cmd_stretch().
Referenced by try_init_dram_ddr3().
|
static |
Definition at line 1289 of file raminit_common.c.
References BIOS_WARNING, FOR_ALL_LANES, ram_rank_timings::io_latency, ram_rank_timings::lanes, MIN, printk, printram, ram_rank_timings::ram_lane_timings::rcven, and ramctr_timing_st::timings.
Referenced by receive_enable_calibration().
Definition at line 595 of file raminit_common.c.
References addr.
Referenced by get_power_down_mode(), and write_level_rank().
|
static |
Definition at line 1750 of file raminit_common.c.
References FOR_ALL_POPULATED_CHANNELS, iosav_run_once_and_wait(), iosav_write_zqcs_sequence(), MC_INIT_STATE_G, mchbar_clrbits32, mchbar_setbits32, ramctr_timing_st::rankmap, and SCHED_CBIT_ch.
Referenced by jedec_write_leveling(), and reprogram_320c().
|
static |
Definition at line 1047 of file raminit_common.c.
References GDCRTRAININGRESULT, lane_base, ram_rank_timings::lanes, mchbar_read32(), ram_rank_timings::ram_lane_timings::rcven, rcven(), and ramctr_timing_st::timings.
Referenced by find_rcven_pi_coarse(), find_roundtrip_latency(), and fine_tune_rcven_pi().
void dram_dimm_mapping | ( | ramctr_timing * | ctrl | ) |
Definition at line 242 of file raminit_common.c.
References FOR_ALL_CHANNELS, info, ramctr_timing_st::info, ramctr_timing_st::mad_dimm, dimm_attr_ddr3_st::ranks, dimm_attr_ddr3_st::size_mb, and dimm_attr_ddr3_st::width.
Referenced by try_init_dram_ddr3().
void dram_dimm_set_mapping | ( | ramctr_timing * | ctrl, |
int | training | ||
) |
Definition at line 290 of file raminit_common.c.
References ecc, ramctr_timing_st::ecc_enabled, FOR_ALL_CHANNELS, MAD_DIMM, ramctr_timing_st::mad_dimm, mchbar_write32(), and udelay().
Referenced by try_init_dram_ddr3().
void dram_find_common_params | ( | ramctr_timing * | ctrl | ) |
Definition at line 58 of file raminit_common.c.
References dimm_attr_ddr3_st::cas_supported, ramctr_timing_st::cas_supported, die(), dimm_attr_ddr3_st::dram_type, FOR_ALL_CHANNELS, ramctr_timing_st::info, MAX, MAX_CAS, MIN_CAS, SPD_MEMORY_TYPE_SDRAM_DDR3, dimm_attr_ddr3_st::tAA, ramctr_timing_st::tAA, dimm_attr_ddr3_st::tCK, ramctr_timing_st::tCK, dimm_attr_ddr3_st::tCMD, ramctr_timing_st::tCMD, dimm_attr_ddr3_st::tCWL, ramctr_timing_st::tCWL, dimm_attr_ddr3_st::tFAW, ramctr_timing_st::tFAW, dimm_attr_ddr3_st::tRAS, ramctr_timing_st::tRAS, dimm_attr_ddr3_st::tRCD, ramctr_timing_st::tRCD, dimm_attr_ddr3_st::tRFC, ramctr_timing_st::tRFC, dimm_attr_ddr3_st::tRP, ramctr_timing_st::tRP, dimm_attr_ddr3_st::tRRD, ramctr_timing_st::tRRD, dimm_attr_ddr3_st::tRTP, ramctr_timing_st::tRTP, dimm_attr_ddr3_st::tWR, ramctr_timing_st::tWR, dimm_attr_ddr3_st::tWTR, and ramctr_timing_st::tWTR.
Referenced by try_init_dram_ddr3().
void dram_jedecreset | ( | ramctr_timing * | ctrl | ) |
Definition at line 539 of file raminit_common.c.
References FOR_ALL_CHANNELS, IOSAV_STATUS_ch, MC_INIT_STATE, MC_INIT_STATE_ch, MC_INIT_STATE_G, mchbar_clrbits32, mchbar_read32(), mchbar_setbits32, mchbar_write32(), ramctr_timing_st::rankmap, RCOMP_TIMER, udelay(), and write_reset().
Referenced by reprogram_320c(), and try_init_dram_ddr3().
void dram_memorymap | ( | ramctr_timing * | ctrl, |
int | me_uma_size | ||
) |
Definition at line 369 of file raminit_common.c.
References BDSM, BGSM, BIOS_DEBUG, ramctr_timing_st::channel_size_mb, DEFAULT_PCI_MMIO_SIZE, GGC, HOST_BRIDGE, MAX, ME_STLEN_EN, MELCK, MESEG_BASE, MESEG_MASK, MIN, pci_read_config16(), pci_read_config32(), pci_write_config32(), printk, REMAPBASE, REMAPLIMIT, TOLUD, TOM, TOUUD, TSEGMB, and val.
Referenced by try_init_dram_ddr3().
|
static |
Definition at line 717 of file raminit_common.c.
References make_mr0(), iosav_ssq::rank, and write_mrreg().
Referenced by dram_mrscommands().
|
static |
Definition at line 762 of file raminit_common.c.
References make_mr1(), iosav_ssq::rank, and write_mrreg().
Referenced by dram_mrscommands().
|
static |
Definition at line 771 of file raminit_common.c.
References ramctr_timing_st::auto_self_refresh, ramctr_timing_st::cpu, ramctr_timing_st::CWL, ramctr_timing_st::extended_temperature_range, get_ODT(), IS_IVY_CPU, mchbar_read32(), mchbar_write32(), iosav_ssq::rank, ramctr_timing_st::rank_mirror, odtmap_st::rttwr, TC_MR2_SHADOW_ch, ramctr_timing_st::tCK, TCK_1066MHZ, and write_mrreg().
Referenced by dram_mrscommands().
|
static |
Definition at line 806 of file raminit_common.c.
References iosav_ssq::rank, and write_mrreg().
Referenced by dram_mrscommands().
void dram_mrscommands | ( | ramctr_timing * | ctrl | ) |
Definition at line 811 of file raminit_common.c.
References ARRAY_SIZE, BROADCAST_CH, iosav_ssq::command, dram_mr0(), dram_mr1(), dram_mr2(), dram_mr3(), FOR_ALL_CHANNELS, FOR_ALL_POPULATED_CHANNELS, FOR_ALL_POPULATED_RANKS, IOSAV_NOP, iosav_run_once_and_wait(), iosav_run_queue(), iosav_write_sequence(), iosav_write_zqcs_sequence(), IOSAV_ZQCS, MC_INIT_STATE_G, mchbar_clrbits32, mchbar_setbits32, ramctr_timing_st::rankmap, SCHED_CBIT_ch, iosav_ssq::sp_cmd_ctrl, SSQ_NA, and wait_for_iosav().
Referenced by reprogram_320c(), restore_timings(), and try_init_dram_ddr3().
|
static |
Definition at line 119 of file raminit_common.c.
References addr, ramctr_timing_st::cpu, IS_SANDY_CPU, IS_SANDY_CPU_C, mchbar_clrsetbits32(), mchbar_read32(), mchbar_write32(), tc_othp_reg::odt_delay_d0, tc_othp_reg::odt_delay_d1, printk, RAM_DEBUG, tc_othp_reg::raw, ramctr_timing_st::ref_card_offset, SCHED_SECOND_CBIT_ch, and TC_OTHP_ch.
Referenced by dram_timing_regs(), and set_read_write_timings().
void dram_timing_regs | ( | ramctr_timing * | ctrl | ) |
Definition at line 147 of file raminit_common.c.
References ramctr_timing_st::CAS, ramctr_timing_st::cpu, ramctr_timing_st::CWL, dram_odt_stretch(), FOR_ALL_CHANNELS, IS_IVY_CPU, mchbar_read32(), mchbar_write32(), MIN, tc_rfp_reg::oref_ri, tc_dtp_reg::overclock_tXP, printram, tc_dbp_reg::raw, tc_rap_reg::raw, tc_othp_reg::raw, tc_dtp_reg::raw, tc_rfp_reg::raw, tc_rftp_reg::raw, tc_srftp_reg::raw, ramctr_timing_st::tAONPD, TC_DBP_ch, TC_DTP_ch, TC_OTHP_ch, TC_RAP_ch, TC_RFP_ch, TC_RFTP_ch, TC_SRFTP_ch, ramctr_timing_st::tCK, ramctr_timing_st::tCKE, tDLLK, ramctr_timing_st::tFAW, ramctr_timing_st::tMOD, ramctr_timing_st::tRAS, tc_dbp_reg::tRCD, ramctr_timing_st::tRCD, tc_rftp_reg::tREFI, ramctr_timing_st::tREFI, ramctr_timing_st::tRFC, ramctr_timing_st::tRP, tc_rap_reg::tRRD, ramctr_timing_st::tRRD, ramctr_timing_st::tRTP, ramctr_timing_st::tWR, ramctr_timing_st::tWTR, ramctr_timing_st::tXP, tc_othp_reg::tXPDLL, ramctr_timing_st::tXPDLL, tc_srftp_reg::tXSDLL, and ramctr_timing_st::tXSOffset.
Referenced by try_init_dram_ddr3().
void dram_xover | ( | ramctr_timing * | ctrl | ) |
Definition at line 101 of file raminit_common.c.
References FOR_ALL_CHANNELS, GDCRCKPICODE_ch, GDCRCMDPICODING_ch, get_XOVER_CLK(), get_XOVER_CMD(), mchbar_write32(), printram, and ramctr_timing_st::rankmap.
Referenced by try_init_dram_ddr3().
void dram_zones | ( | ramctr_timing * | ctrl, |
int | training | ||
) |
Definition at line 308 of file raminit_common.c.
References ramctr_timing_st::channel_size_mb, MAD_CHNL, MAD_ZR, mchbar_read32(), mchbar_write32(), and val.
Referenced by init_dram_ddr3(), and try_init_dram_ddr3().
Definition at line 734 of file raminit_common.c.
Referenced by make_mr1().
|
static |
Definition at line 2800 of file raminit_common.c.
Referenced by final_registers().
|
static |
Definition at line 1508 of file raminit_common.c.
References addr, get_precedening_channels(), program_wdb_pattern_length(), sfence(), and write32().
Referenced by channel_scrub(), channel_test(), find_predefined_pattern(), read_mpr_training(), and write_training().
|
static |
Definition at line 1532 of file raminit_common.c.
References addr, get_precedening_channels(), num_of_channels(), program_wdb_pattern_length(), sfence(), and write32().
Referenced by train_write_flyby().
|
static |
Definition at line 1933 of file raminit_common.c.
References addr, ARRAY_SIZE, base, get_precedening_channels(), invert, num_of_channels(), offset, pattern, program_wdb_pattern_length(), sfence(), use_base, val, and write32().
Referenced by aggressive_write_training(), command_training(), and find_agrsv_read_margin().
void final_registers | ( | ramctr_timing * | ctrl | ) |
Definition at line 2806 of file raminit_common.c.
References BANDTIMERS_IVB, BANDTIMERS_SNB, BIOS_DEBUG, encode_wm(), FOR_ALL_CHANNELS, FOR_ALL_POPULATED_CHANNELS, get_power_down_mode(), MC_INIT_STATE_G, mchbar_clrbits32, mchbar_clrsetbits32(), mchbar_read32(), mchbar_setbits32, mchbar_write32(), ramctr_timing_st::mdll_wake_delay, MEM_TRML_ESTIMATION_CONFIG, MEM_TRML_INTERRUPT, MEM_TRML_THRESHOLDS_CONFIG, PM_BW_LIMIT_CONFIG, PM_CMD_PWR_ch, PM_DLL_CONFIG, PM_PDWN_CONFIG, PM_TRML_M_CONFIG_ch, printk, ramctr_timing_st::rankmap, tc_othp_reg::raw, tc_rfp_reg::raw, tc_rfp_reg::refresh_2x_control, SAPMCTL, SAPMTIMERS, SAPMTIMERS2_IVB, SSKPD, TC_OTHP_ch, TC_RFP_ch, TC_SRFTP_ch, TC_ZQCAL_ch, ramctr_timing_st::tCK, tc_othp_reg::tCPDED, and WMM_READ_CONFIG.
Referenced by init_dram_ddr3().
|
static |
Definition at line 2264 of file raminit_common.c.
References run::all, ARRAY_SIZE, BIOS_EMERG, ramctr_timing_st::edge_offset, run::end, fill_pattern5(), FOR_ALL_LANES, GDCRTRAININGMOD_ch, get_longest_zero_run(), IOSAV_By_BW_SERROR_C_ch, IOSAV_By_ERROR_COUNT_ch, IOSAV_BYTE_SERROR_C_ch, iosav_run_once_and_wait(), iosav_write_data_write_sequence(), ram_rank_timings::lanes, MAKE_ERR, MAX, MAX_EDGE_TIMING, mchbar_read32(), mchbar_write32(), run::middle, MIN, NUM_LANES, NUM_PATTERNS, printk, printram, program_timings(), gdcr_training_mod_reg::raw, ram_rank_timings::ram_lane_timings::rx_dqs_n, ram_rank_timings::ram_lane_timings::rx_dqs_p, run::start, ramctr_timing_st::timings, gdcr_training_mod_reg::vref_gen_ctl, and wait_for_iosav().
Referenced by aggressive_read_training().
|
static |
Definition at line 2152 of file raminit_common.c.
References ramctr_timing_st::CAS, fill_pattern0(), FOR_ALL_LANES, FOR_ALL_POPULATED_RANKS, IOSAV_By_BW_MASK_ch, IOSAV_By_BW_SERROR_C_ch, IOSAV_By_BW_SERROR_ch, iosav_run_once_and_wait(), iosav_write_read_mpr_sequence(), ram_rank_timings::lanes, mchbar_read32(), mchbar_write32(), program_timings(), ram_rank_timings::ram_lane_timings::rx_dqs_n, ram_rank_timings::ram_lane_timings::rx_dqs_p, ramctr_timing_st::timings, ramctr_timing_st::tMOD, and wait_for_iosav().
Referenced by read_mpr_training().
|
static |
Definition at line 1098 of file raminit_common.c.
References does_lane_work(), run::end, FOR_ALL_LANES, get_longest_zero_run(), ram_rank_timings::lanes, run::middle, NUM_LANES, printram, program_timings(), QCLK_PI, ram_rank_timings::ram_lane_timings::rcven, rcven(), RCVEN_COARSE_PI_LENGTH, run::start, test_rcven(), and ramctr_timing_st::timings.
Referenced by receive_enable_calibration().
|
static |
Definition at line 2107 of file raminit_common.c.
References run::all, BIOS_EMERG, ramctr_timing_st::CAS, FOR_ALL_LANES, get_longest_zero_run(), IOSAV_By_BW_SERROR_C_ch, IOSAV_By_ERROR_COUNT_ch, iosav_run_once_and_wait(), iosav_write_read_mpr_sequence(), ram_rank_timings::lanes, MAKE_ERR, MAX_EDGE_TIMING, mchbar_read32(), mchbar_write32(), run::middle, NUM_LANES, printk, printram, program_timings(), ram_rank_timings::ram_lane_timings::rx_dqs_n, ram_rank_timings::ram_lane_timings::rx_dqs_p, ramctr_timing_st::timings, ramctr_timing_st::tMOD, and wait_for_iosav().
Referenced by read_mpr_training().
|
static |
Definition at line 1179 of file raminit_common.c.
References BIOS_EMERG, does_lane_work(), FOR_ALL_LANES, ram_rank_timings::io_latency, ram_rank_timings::lanes, MAKE_ERR, NUM_LANES, printk, printram, program_timings(), QCLK_PI, ram_rank_timings::ram_lane_timings::rcven, ram_rank_timings::roundtrip_latency, test_rcven(), and ramctr_timing_st::timings.
Referenced by receive_enable_calibration().
|
static |
Definition at line 1129 of file raminit_common.c.
References does_lane_work(), FOR_ALL_LANES, ram_rank_timings::lanes, NUM_LANES, printram, program_timings(), QCLK_PI, ram_rank_timings::ram_lane_timings::rcven, test_rcven(), and ramctr_timing_st::timings.
Referenced by receive_enable_calibration().
|
static |
Definition at line 1622 of file raminit_common.c.
References val.
Referenced by train_write_flyby().
Definition at line 360 of file raminit_common.c.
References CAPID0_A, HOST_BRIDGE, and pci_read_config32().
Referenced by reinit_ctrl().
Definition at line 347 of file raminit_common.c.
References CAPID0_A, HOST_BRIDGE, and pci_read_config32().
Referenced by reinit_ctrl().
|
static |
Definition at line 1242 of file raminit_common.c.
References assert, BIOS_EMERG, FOR_ALL_LANES, ram_rank_timings::lanes, MAX, MIN, printk, ram_rank_timings::ram_lane_timings::rcven, and ramctr_timing_st::timings.
Referenced by align_rt_io_latency(), and receive_enable_calibration().
|
static |
Definition at line 1047 of file raminit_common.c.
Referenced by aggressive_write_training(), find_agrsv_read_margin(), find_rcven_pi_coarse(), find_read_mpr_margin(), try_cmd_stretch(), tx_dq_write_leveling(), and write_level_rank().
|
static |
Definition at line 722 of file raminit_common.c.
References ramctr_timing_st::rankmap.
Referenced by dram_mr2(), and make_mr1().
|
static |
Definition at line 601 of file raminit_common.c.
References ARRAY_SIZE, iosav_ssq::command, ddr3_mirror_mrreg(), IOSAV_MRS, iosav_run_once_and_wait(), iosav_write_sequence(), ramctr_timing_st::rank_mirror, iosav_ssq::sp_cmd_ctrl, SSQ_NA, ramctr_timing_st::tMOD, val, and wait_for_iosav().
Referenced by final_registers(), and make_mr0().
|
static |
Definition at line 1492 of file raminit_common.c.
References FOR_ALL_POPULATED_CHANNELS.
Referenced by fill_pattern0(), fill_pattern1(), and fill_pattern5().
Definition at line 36 of file raminit_common.c.
Referenced by dram_xover(), and program_timings().
Definition at line 41 of file raminit_common.c.
Referenced by dram_xover(), and program_timings().
|
static |
Definition at line 1786 of file raminit_common.c.
References disable_refresh_machine(), FOR_ALL_CHANNELS, FOR_ALL_POPULATED_CHANNELS, FOR_ALL_POPULATED_RANKS, GDCRTRAININGMOD, iosav_run_once_and_wait(), IOSAV_STATUS_ch, iosav_write_zqcs_sequence(), make_mr1(), MC_INIT_STATE_G, mchbar_clrbits32, mchbar_read32(), mchbar_setbits32, mchbar_write32(), gdcr_training_mod_reg::raw, SCHED_CBIT_ch, toggle_io_reset(), wait_for_iosav(), write_level_rank(), gdcr_training_mod_reg::write_leveling_mode, and write_mrreg().
Referenced by write_training().
|
static |
Definition at line 685 of file raminit_common.c.
References ramctr_timing_st::CAS, get_power_down_mode(), PDM_APD_DLL_OFF, PDM_DLL_OFF, and ramctr_timing_st::tWR.
Referenced by dram_mr0().
|
static |
Definition at line 749 of file raminit_common.c.
References encode_odt(), get_ODT(), and odtmap_st::rttnom.
Referenced by dram_mr1(), jedec_write_leveling(), and write_level_rank().
void normalize_training | ( | ramctr_timing * | ctrl | ) |
Definition at line 2532 of file raminit_common.c.
References FOR_ALL_CHANNELS, FOR_ALL_LANES, FOR_ALL_POPULATED_CHANNELS, FOR_ALL_POPULATED_RANKS, ram_rank_timings::io_latency, ram_rank_timings::lanes, MAX, printram, program_timings(), ram_rank_timings::ram_lane_timings::rcven, ram_rank_timings::roundtrip_latency, and ramctr_timing_st::timings.
Referenced by try_init_dram_ddr3().
|
static |
Definition at line 1524 of file raminit_common.c.
References FOR_ALL_POPULATED_CHANNELS.
Referenced by fill_pattern1(), and fill_pattern5().
void prepare_training | ( | ramctr_timing * | ctrl | ) |
Definition at line 2738 of file raminit_common.c.
References FOR_ALL_POPULATED_CHANNELS, mchbar_setbits32, TC_RAP_ch, udelay(), and wait_for_iosav().
Referenced by try_init_dram_ddr3().
void program_timings | ( | ramctr_timing * | ctrl, |
int | channel | ||
) |
Definition at line 910 of file raminit_common.c.
References BIOS_ERR, CCC_MAX_PI, gdcr_cmd_pi_coding_reg::cmd_logic_delay, gdcr_cmd_pi_coding_reg::cmd_pi_code, gdcr_cmd_pi_coding_reg::ctl_logic_delay_d0, gdcr_cmd_pi_coding_reg::ctl_logic_delay_d1, gdcr_cmd_pi_coding_reg::ctl_pi_code_d0, gdcr_cmd_pi_coding_reg::ctl_pi_code_d1, FOR_ALL_LANES, FOR_ALL_POPULATED_RANKS, GDCRCKLOGICDELAY_ch, GDCRCKPICODE_ch, GDCRCMDPICODING_ch, GDCRRX, GDCRTX, get_XOVER_CLK(), get_XOVER_CMD(), ram_rank_timings::io_latency, lane_base, ram_rank_timings::lanes, MAX, mchbar_read32(), mchbar_write32(), NUM_SLOTS, ramctr_timing_st::pi_code_offset, ram_rank_timings::pi_coding, printk, QCLK_PI, ramctr_timing_st::rankmap, gdcr_rx_reg::raw, gdcr_tx_reg::raw, gdcr_cmd_pi_coding_reg::raw, ram_rank_timings::ram_lane_timings::rcven, rcven(), gdcr_rx_reg::rcven_pi_code, ram_rank_timings::roundtrip_latency, ram_rank_timings::ram_lane_timings::rx_dqs_n, ram_rank_timings::ram_lane_timings::rx_dqs_p, SC_IO_LATENCY_ch, SC_ROUNDT_LAT_ch, ramctr_timing_st::timings, ram_rank_timings::ram_lane_timings::tx_dq, gdcr_tx_reg::tx_dq_pi_code, and ram_rank_timings::ram_lane_timings::tx_dqs.
Referenced by aggressive_read_training(), aggressive_write_training(), command_training(), find_agrsv_read_margin(), find_predefined_pattern(), find_rcven_pi_coarse(), find_read_mpr_margin(), find_roundtrip_latency(), fine_tune_rcven_pi(), normalize_training(), read_mpr_training(), receive_enable_calibration(), restore_timings(), test_command_training(), try_cmd_stretch(), tx_dq_write_leveling(), write_level_rank(), and write_training().
Definition at line 1503 of file raminit_common.c.
References IOSAV_DATA_CTL_ch, and mchbar_write8().
Referenced by fill_pattern0(), fill_pattern1(), and fill_pattern5().
int read_mpr_training | ( | ramctr_timing * | ctrl | ) |
Definition at line 2204 of file raminit_common.c.
References fill_pattern0(), find_predefined_pattern(), find_read_mpr_margin(), FOR_ALL_CHANNELS, FOR_ALL_LANES, FOR_ALL_POPULATED_CHANNELS, FOR_ALL_POPULATED_RANKS, GDCRTRAININGMOD, IOSAV_By_BW_MASK_ch, IOSAV_DC_MASK, ram_rank_timings::lanes, mchbar_write32(), NUM_CHANNELS, NUM_LANES, NUM_SLOTRANKS, printram, program_timings(), ram_rank_timings::ram_lane_timings::rx_dqs_n, ram_rank_timings::ram_lane_timings::rx_dqs_p, ramctr_timing_st::timings, and toggle_io_reset().
Referenced by try_init_dram_ddr3().
int receive_enable_calibration | ( | ramctr_timing * | ctrl | ) |
Definition at line 1312 of file raminit_common.c.
References align_rt_io_latency(), compute_final_logic_delay(), find_rcven_pi_coarse(), find_roundtrip_latency(), fine_tune_rcven_pi(), FOR_ALL_CHANNELS, FOR_ALL_LANES, FOR_ALL_POPULATED_CHANNELS, FOR_ALL_POPULATED_RANKS, GDCRTRAININGMOD, get_logic_delay_delta(), ram_rank_timings::io_latency, iosav_run_once_and_wait(), iosav_write_prea_sequence(), ram_rank_timings::lanes, mchbar_write32(), NUM_LANES, printram, program_timings(), QCLK_PI, gdcr_training_mod_reg::raw, ram_rank_timings::ram_lane_timings::rcven, gdcr_training_mod_reg::receive_enable_mode, ram_rank_timings::roundtrip_latency, ramctr_timing_st::timings, toggle_io_reset(), ramctr_timing_st::tRP, and wait_for_iosav().
|
static |
Definition at line 1968 of file raminit_common.c.
References disable_refresh_machine(), dram_jedecreset(), dram_mrscommands(), and toggle_io_reset().
Referenced by command_training(), and try_cmd_stretch().
void restore_timings | ( | ramctr_timing * | ctrl | ) |
Definition at line 2896 of file raminit_common.c.
References addr, ramctr_timing_st::cmd_stretch, dram_mrscommands(), FOR_ALL_CHANNELS, FOR_ALL_POPULATED_CHANNELS, GDCRCMDDEBUGMUXCFG_Cz_S, GDCRTRAININGMOD, GDCRTRAININGMOD_ch, IOSAV_DC_MASK, IOSAV_STATUS_ch, MC_INIT_STATE, MC_INIT_STATE_ch, MC_INIT_STATE_G, mchbar_clrbits32, mchbar_read32(), mchbar_setbits32, mchbar_write32(), printram, program_timings(), ramctr_timing_st::rankmap, tc_rap_reg::raw, RCOMP_TIMER, SCHED_CBIT_ch, TC_RAP_ch, TC_RWP_ch, ramctr_timing_st::tCKE, ramctr_timing_st::tFAW, tc_rap_reg::tRRD, ramctr_timing_st::tRRD, ramctr_timing_st::tRTP, ramctr_timing_st::tWR, ramctr_timing_st::tWTR, udelay(), wait_for_iosav(), and write_reset().
Referenced by try_init_dram_ddr3().
void set_normal_operation | ( | ramctr_timing * | ctrl | ) |
Definition at line 2790 of file raminit_common.c.
References FOR_ALL_POPULATED_CHANNELS, MC_INIT_STATE_ch, mchbar_clrbits32, mchbar_write32(), ramctr_timing_st::rankmap, and TC_RAP_ch.
Referenced by init_dram_ddr3().
void set_read_write_timings | ( | ramctr_timing * | ctrl | ) |
Definition at line 2754 of file raminit_common.c.
References dram_odt_stretch(), FOR_ALL_POPULATED_CHANNELS, FOR_ALL_POPULATED_RANKS, MAX, mchbar_write32(), MIN, ram_rank_timings::pi_coding, ramctr_timing_st::pi_coding_threshold, tc_rwp_reg::raw, ramctr_timing_st::ref_card_offset, TC_RWP_ch, ramctr_timing_st::tCK, TCK_1066MHZ, ramctr_timing_st::timings, tc_rwp_reg::tRRDR, tc_rwp_reg::tWRDRDD, and val.
Referenced by try_init_dram_ddr3().
void set_scrambling_seed | ( | ramctr_timing * | ctrl | ) |
Definition at line 2712 of file raminit_common.c.
References FOR_ALL_POPULATED_CHANNELS, mchbar_clrbits32, mchbar_write32(), NUM_CHANNELS, SCHED_CBIT_ch, SCRAMBLING_SEED_1_ch, SCRAMBLING_SEED_2_HI_ch, and SCRAMBLING_SEED_2_LO_ch.
Referenced by init_dram_ddr3().
Definition at line 2729 of file raminit_common.c.
References IS_SANDY_CPU, IS_SANDY_CPU_D0, IS_SANDY_CPU_D1, mchbar_write32(), and SC_WDBWM.
Referenced by try_init_dram_ddr3().
Definition at line 2407 of file raminit_common.c.
References GDCRCMDDEBUGMUXCFG_Cz_S, mchbar_clrsetbits32(), and udelay().
Referenced by aggressive_write_training().
Definition at line 21 of file raminit_common.c.
Referenced by fill_pattern0(), fill_pattern1(), and fill_pattern5().
|
static |
Definition at line 2398 of file raminit_common.c.
References iosav_run_once_and_wait(), iosav_write_aggressive_write_read_sequence(), and wait_for_iosav().
Referenced by aggressive_write_training().
|
static |
Definition at line 1886 of file raminit_common.c.
References FOR_ALL_LANES, IOSAV_By_ERROR_COUNT, IOSAV_By_ERROR_COUNT_ch, IOSAV_DATA_CTL_ch, IOSAV_n_ADDRESS_LFSR_ch, iosav_run_once_and_wait(), iosav_write_command_training_sequence(), ram_rank_timings::lanes, ramctr_timing_st::lanes, mchbar_read32(), mchbar_write32(), program_timings(), ramctr_timing_st::timings, ram_rank_timings::ram_lane_timings::tx_dq, and wait_for_iosav().
Referenced by try_cmd_stretch().
|
static |
Definition at line 1037 of file raminit_common.c.
References ramctr_timing_st::CAS, iosav_run_once_and_wait(), iosav_write_read_mpr_sequence(), ramctr_timing_st::tMOD, and wait_for_iosav().
Referenced by find_rcven_pi_coarse(), find_roundtrip_latency(), and fine_tune_rcven_pi().
|
static |
Definition at line 1404 of file raminit_common.c.
References FOR_ALL_LANES, IOSAV_By_BW_SERROR_C_ch, IOSAV_By_ERROR_COUNT_ch, iosav_run_once_and_wait(), iosav_write_misc_write_sequence(), iosav_write_prea_act_read_sequence(), MAX, mchbar_read32(), mchbar_write32(), ramctr_timing_st::tFAW, ramctr_timing_st::tRRD, and wait_for_iosav().
Referenced by tx_dq_write_leveling().
Definition at line 27 of file raminit_common.c.
References MC_INIT_STATE_G, mchbar_read32(), mchbar_write32(), and udelay().
Referenced by jedec_write_leveling(), read_mpr_training(), receive_enable_calibration(), and reprogram_320c().
|
static |
Definition at line 1642 of file raminit_common.c.
References ARRAY_SIZE, iosav_ssq::command, gdcr_training_mod_reg::dq_dqs_training_res, fill_pattern1(), FOR_ALL_LANES, FOR_ALL_POPULATED_CHANNELS, FOR_ALL_POPULATED_RANKS, GDCRTRAININGMOD, GDCRTRAININGRESULT1, GDCRTRAININGRESULT2, get_dqs_flyby_adjust(), ram_rank_timings::io_latency, IOSAV_ACT, IOSAV_DATA_CTL_ch, IOSAV_PRE, IOSAV_RD, iosav_run_once_and_wait(), iosav_write_misc_write_sequence(), iosav_write_sequence(), lane_base, ram_rank_timings::lanes, mchbar_read32(), mchbar_write32(), printram, QCLK_PI, gdcr_training_mod_reg::raw, ram_rank_timings::roundtrip_latency, iosav_ssq::sp_cmd_ctrl, SSQ_NA, SSQ_RD, ramctr_timing_st::timings, ramctr_timing_st::tRCD, ramctr_timing_st::tRP, ram_rank_timings::ram_lane_timings::tx_dqs, and wait_for_iosav().
Referenced by write_training().
|
static |
Definition at line 1987 of file raminit_common.c.
References run::all, ramctr_timing_st::cmd_stretch, CT_MAX_PI, CT_MIN_PI, CT_PI_LENGTH, run::end, FOR_ALL_POPULATED_RANKS, get_longest_zero_run(), run::length, MAKE_ERR, mchbar_write32(), run::middle, MIN_C320C_LEN, NUM_CHANNELS, NUM_SLOTRANKS, ram_rank_timings::pi_coding, printram, program_timings(), tc_rap_reg::raw, reprogram_320c(), ram_rank_timings::roundtrip_latency, run::start, TC_RAP_ch, ramctr_timing_st::tCKE, test_command_training(), ramctr_timing_st::tFAW, ramctr_timing_st::timings, tc_rap_reg::tRRD, ramctr_timing_st::tRRD, ramctr_timing_st::tRTP, ramctr_timing_st::tWR, and ramctr_timing_st::tWTR.
Referenced by command_training().
|
static |
Definition at line 1425 of file raminit_common.c.
References count, and printram.
Referenced by tx_dq_write_leveling().
|
static |
Definition at line 1444 of file raminit_common.c.
References run::all, ARRAY_SIZE, BIOS_EMERG, run::end, FOR_ALL_LANES, get_longest_zero_run(), IOSAV_By_ERROR_COUNT_ch, iosav_run_once_and_wait(), iosav_write_prea_sequence(), ram_rank_timings::lanes, run::length, MAKE_ERR, MAX_TX_DQ, mchbar_read32(), run::middle, NUM_LANES, printk, printram, program_timings(), run::start, test_tx_dq(), ramctr_timing_st::timings, ramctr_timing_st::tRP, ram_rank_timings::ram_lane_timings::tx_dq, tx_dq_threshold_process(), and wait_for_iosav().
Referenced by write_training().
|
static |
Definition at line 1554 of file raminit_common.c.
References run::all, BIOS_EMERG, ddr3_mirror_mrreg(), run::end, FOR_ALL_LANES, GDCRTRAININGMOD, GDCRTRAININGRESULT, get_longest_zero_run(), iosav_run_once_and_wait(), iosav_write_jedec_write_leveling_sequence(), lane_base, ram_rank_timings::lanes, MAKE_ERR, make_mr1(), mchbar_read32(), mchbar_write32(), run::middle, NUM_LANES, printk, printram, program_timings(), ramctr_timing_st::rank_mirror, gdcr_training_mod_reg::raw, run::start, ramctr_timing_st::timings, ram_rank_timings::ram_lane_timings::tx_dqs, TX_DQS_PI_LENGTH, wait_for_iosav(), and gdcr_training_mod_reg::write_leveling_mode.
Referenced by jedec_write_leveling().
|
static |
Definition at line 601 of file raminit_common.c.
Referenced by dram_mr0(), dram_mr1(), dram_mr2(), dram_mr3(), and jedec_write_leveling().
|
static |
Definition at line 519 of file raminit_common.c.
References iosav_run_queue(), iosav_write_zqcs_sequence(), ramctr_timing_st::rankmap, and wait_for_iosav().
Referenced by dram_jedecreset(), and restore_timings().
int write_training | ( | ramctr_timing * | ctrl | ) |
Definition at line 1844 of file raminit_common.c.
References fill_pattern0(), FOR_ALL_CHANNELS, FOR_ALL_POPULATED_CHANNELS, FOR_ALL_POPULATED_RANKS, jedec_write_leveling(), mchbar_setbits32, printram, program_timings(), TC_RWP_ch, train_write_flyby(), and tx_dq_write_leveling().
Referenced by try_init_dram_ddr3().
|
static |
Definition at line 901 of file raminit_common.c.
Referenced by does_lane_work(), program_timings(), train_write_flyby(), and write_level_rank().