coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
raminit_common.c File Reference
#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"
Include dependency graph for raminit_common.c:

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
 

Functions

static void sfence (void)
 
static void toggle_io_reset (void)
 
static u32 get_XOVER_CLK (u8 rankmap)
 
static u32 get_XOVER_CMD (u8 rankmap)
 
void dram_find_common_params (ramctr_timing *ctrl)
 
void dram_xover (ramctr_timing *ctrl)
 
static void dram_odt_stretch (ramctr_timing *ctrl, int channel)
 
void dram_timing_regs (ramctr_timing *ctrl)
 
void dram_dimm_mapping (ramctr_timing *ctrl)
 
void dram_dimm_set_mapping (ramctr_timing *ctrl, int training)
 
void dram_zones (ramctr_timing *ctrl, int training)
 
bool get_host_ecc_forced (void)
 
bool get_host_ecc_cap (void)
 
void dram_memorymap (ramctr_timing *ctrl, int me_uma_size)
 
static void write_reset (ramctr_timing *ctrl)
 
void dram_jedecreset (ramctr_timing *ctrl)
 
static void ddr3_mirror_mrreg (int *bank, u32 *addr)
 
static void write_mrreg (ramctr_timing *ctrl, int channel, int slotrank, int reg, u32 val)
 
static enum power_down_mode get_power_down_mode (ramctr_timing *ctrl)
 
static u32 make_mr0 (ramctr_timing *ctrl, u8 rank)
 
static void dram_mr0 (ramctr_timing *ctrl, u8 rank, int channel)
 
static odtmap get_ODT (ramctr_timing *ctrl, int channel)
 
static u32 encode_odt (u32 odt)
 
static u32 make_mr1 (ramctr_timing *ctrl, u8 rank, int channel)
 
static void dram_mr1 (ramctr_timing *ctrl, u8 rank, int channel)
 
static void dram_mr2 (ramctr_timing *ctrl, u8 rank, int channel)
 
static void dram_mr3 (ramctr_timing *ctrl, u8 rank, int channel)
 
void dram_mrscommands (ramctr_timing *ctrl)
 
void program_timings (ramctr_timing *ctrl, int channel)
 
static void test_rcven (ramctr_timing *ctrl, int channel, int slotrank)
 
static int does_lane_work (ramctr_timing *ctrl, int channel, int slotrank, int lane)
 
static struct run get_longest_zero_run (int *seq, int sz)
 
static void find_rcven_pi_coarse (ramctr_timing *ctrl, int channel, int slotrank, int *upperA)
 
static void fine_tune_rcven_pi (ramctr_timing *ctrl, int channel, int slotrank, int *upperA)
 
static int find_roundtrip_latency (ramctr_timing *ctrl, int channel, int slotrank, int *upperA)
 
static int get_logic_delay_delta (ramctr_timing *ctrl, int channel, int slotrank)
 
static int align_rt_io_latency (ramctr_timing *ctrl, int channel, int slotrank, int prev)
 
static void compute_final_logic_delay (ramctr_timing *ctrl, int channel, int slotrank)
 
int receive_enable_calibration (ramctr_timing *ctrl)
 
static void test_tx_dq (ramctr_timing *ctrl, int channel, int slotrank)
 
static void tx_dq_threshold_process (int *data, const int count)
 
static int tx_dq_write_leveling (ramctr_timing *ctrl, int channel, int slotrank)
 
static int get_precedening_channels (ramctr_timing *ctrl, int target_channel)
 
static void program_wdb_pattern_length (int channel, const unsigned int num_cachelines)
 
static void fill_pattern0 (ramctr_timing *ctrl, int channel, u32 a, u32 b)
 
static int num_of_channels (const ramctr_timing *ctrl)
 
static void fill_pattern1 (ramctr_timing *ctrl, int channel)
 
static int write_level_rank (ramctr_timing *ctrl, int channel, int slotrank)
 
static int get_dqs_flyby_adjust (u64 val)
 
static void train_write_flyby (ramctr_timing *ctrl)
 
static void disable_refresh_machine (ramctr_timing *ctrl)
 
static int jedec_write_leveling (ramctr_timing *ctrl)
 
int write_training (ramctr_timing *ctrl)
 
static int test_command_training (ramctr_timing *ctrl, int channel, int slotrank)
 
static void fill_pattern5 (ramctr_timing *ctrl, int channel, int patno)
 
static void reprogram_320c (ramctr_timing *ctrl)
 
static int try_cmd_stretch (ramctr_timing *ctrl, int channel, int cmd_stretch)
 
int command_training (ramctr_timing *ctrl)
 
static int find_read_mpr_margin (ramctr_timing *ctrl, int channel, int slotrank, int *edges)
 
static void find_predefined_pattern (ramctr_timing *ctrl, const int channel)
 
int read_mpr_training (ramctr_timing *ctrl)
 
static int find_agrsv_read_margin (ramctr_timing *ctrl, int channel, int slotrank, int *edges)
 
int aggressive_read_training (ramctr_timing *ctrl)
 
static void test_aggressive_write (ramctr_timing *ctrl, int channel, int slotrank)
 
static void set_write_vref (const int channel, const u8 wr_vref)
 
int aggressive_write_training (ramctr_timing *ctrl)
 
void normalize_training (ramctr_timing *ctrl)
 
int channel_test (ramctr_timing *ctrl)
 
void channel_scrub (ramctr_timing *ctrl)
 
void set_scrambling_seed (ramctr_timing *ctrl)
 
void set_wmm_behavior (const u32 cpu)
 
void prepare_training (ramctr_timing *ctrl)
 
void set_read_write_timings (ramctr_timing *ctrl)
 
void set_normal_operation (ramctr_timing *ctrl)
 
static int encode_wm (int ns)
 
void final_registers (ramctr_timing *ctrl)
 
void restore_timings (ramctr_timing *ctrl)
 

Variables

static const u32 lane_base []
 

Macro Definition Documentation

◆ CCC_MAX_PI

#define CCC_MAX_PI   (2 * QCLK_PI - 1)

Definition at line 908 of file raminit_common.c.

◆ CT_MAX_PI

#define CT_MAX_PI   (+CCC_MAX_PI + 1)

Definition at line 1982 of file raminit_common.c.

◆ CT_MIN_PI

#define CT_MIN_PI   (-CCC_MAX_PI)

Definition at line 1981 of file raminit_common.c.

◆ CT_PI_LENGTH

#define CT_PI_LENGTH   (CT_MAX_PI - CT_MIN_PI + 1)

Definition at line 1983 of file raminit_common.c.

◆ DEFAULT_PCI_MMIO_SIZE

#define DEFAULT_PCI_MMIO_SIZE   2048

Definition at line 367 of file raminit_common.c.

◆ MIN_C320C_LEN

#define MIN_C320C_LEN   13

Definition at line 1985 of file raminit_common.c.

◆ RCVEN_COARSE_PI_LENGTH

#define RCVEN_COARSE_PI_LENGTH   (2 * QCLK_PI)

Definition at line 1096 of file raminit_common.c.

◆ TX_DQS_PI_LENGTH

#define TX_DQS_PI_LENGTH   (2 * QCLK_PI)

Definition at line 1552 of file raminit_common.c.

Function Documentation

◆ aggressive_read_training()

◆ aggressive_write_training()

◆ align_rt_io_latency()

static int align_rt_io_latency ( ramctr_timing ctrl,
int  channel,
int  slotrank,
int  prev 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ channel_scrub()

◆ channel_test()

◆ command_training()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_final_logic_delay()

static void compute_final_logic_delay ( ramctr_timing ctrl,
int  channel,
int  slotrank 
)
static

◆ ddr3_mirror_mrreg()

static void ddr3_mirror_mrreg ( int *  bank,
u32 addr 
)
static

Definition at line 595 of file raminit_common.c.

References addr.

Referenced by get_power_down_mode(), and write_level_rank().

Here is the caller graph for this function:

◆ disable_refresh_machine()

static void disable_refresh_machine ( ramctr_timing ctrl)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ does_lane_work()

static int does_lane_work ( ramctr_timing ctrl,
int  channel,
int  slotrank,
int  lane 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dram_dimm_mapping()

void dram_dimm_mapping ( ramctr_timing ctrl)

◆ dram_dimm_set_mapping()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dram_find_common_params()

◆ dram_jedecreset()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dram_memorymap()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dram_mr0()

static void dram_mr0 ( ramctr_timing ctrl,
u8  rank,
int  channel 
)
static

Definition at line 717 of file raminit_common.c.

References make_mr0(), iosav_ssq::rank, and write_mrreg().

Referenced by dram_mrscommands().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dram_mr1()

static void dram_mr1 ( ramctr_timing ctrl,
u8  rank,
int  channel 
)
static

Definition at line 762 of file raminit_common.c.

References make_mr1(), iosav_ssq::rank, and write_mrreg().

Referenced by dram_mrscommands().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dram_mr2()

static void dram_mr2 ( ramctr_timing ctrl,
u8  rank,
int  channel 
)
static

◆ dram_mr3()

static void dram_mr3 ( ramctr_timing ctrl,
u8  rank,
int  channel 
)
static

Definition at line 806 of file raminit_common.c.

References iosav_ssq::rank, and write_mrreg().

Referenced by dram_mrscommands().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dram_mrscommands()

◆ dram_odt_stretch()

static void dram_odt_stretch ( ramctr_timing ctrl,
int  channel 
)
static

◆ dram_timing_regs()

◆ dram_xover()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dram_zones()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ encode_odt()

static u32 encode_odt ( u32  odt)
static

Definition at line 734 of file raminit_common.c.

Referenced by make_mr1().

Here is the caller graph for this function:

◆ encode_wm()

static int encode_wm ( int  ns)
static

Definition at line 2800 of file raminit_common.c.

Referenced by final_registers().

Here is the caller graph for this function:

◆ fill_pattern0()

static void fill_pattern0 ( ramctr_timing ctrl,
int  channel,
u32  a,
u32  b 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fill_pattern1()

static void fill_pattern1 ( ramctr_timing ctrl,
int  channel 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fill_pattern5()

static void fill_pattern5 ( ramctr_timing ctrl,
int  channel,
int  patno 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ final_registers()

◆ find_agrsv_read_margin()

◆ find_predefined_pattern()

◆ find_rcven_pi_coarse()

static void find_rcven_pi_coarse ( ramctr_timing ctrl,
int  channel,
int  slotrank,
int *  upperA 
)
static

◆ find_read_mpr_margin()

◆ find_roundtrip_latency()

static int find_roundtrip_latency ( ramctr_timing ctrl,
int  channel,
int  slotrank,
int *  upperA 
)
static

◆ fine_tune_rcven_pi()

static void fine_tune_rcven_pi ( ramctr_timing ctrl,
int  channel,
int  slotrank,
int *  upperA 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_dqs_flyby_adjust()

static int get_dqs_flyby_adjust ( u64  val)
static

Definition at line 1622 of file raminit_common.c.

References val.

Referenced by train_write_flyby().

Here is the caller graph for this function:

◆ get_host_ecc_cap()

bool get_host_ecc_cap ( void  )

Definition at line 360 of file raminit_common.c.

References CAPID0_A, HOST_BRIDGE, and pci_read_config32().

Referenced by reinit_ctrl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_host_ecc_forced()

bool get_host_ecc_forced ( void  )

Definition at line 347 of file raminit_common.c.

References CAPID0_A, HOST_BRIDGE, and pci_read_config32().

Referenced by reinit_ctrl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_logic_delay_delta()

static int get_logic_delay_delta ( ramctr_timing ctrl,
int  channel,
int  slotrank 
)
static

◆ get_longest_zero_run()

static struct run get_longest_zero_run ( int *  seq,
int  sz 
)
static

◆ get_ODT()

static odtmap get_ODT ( ramctr_timing ctrl,
int  channel 
)
static

Definition at line 722 of file raminit_common.c.

References ramctr_timing_st::rankmap.

Referenced by dram_mr2(), and make_mr1().

Here is the caller graph for this function:

◆ get_power_down_mode()

static enum power_down_mode get_power_down_mode ( ramctr_timing ctrl)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_precedening_channels()

static int get_precedening_channels ( ramctr_timing ctrl,
int  target_channel 
)
static

Definition at line 1492 of file raminit_common.c.

References FOR_ALL_POPULATED_CHANNELS.

Referenced by fill_pattern0(), fill_pattern1(), and fill_pattern5().

Here is the caller graph for this function:

◆ get_XOVER_CLK()

static u32 get_XOVER_CLK ( u8  rankmap)
static

Definition at line 36 of file raminit_common.c.

Referenced by dram_xover(), and program_timings().

Here is the caller graph for this function:

◆ get_XOVER_CMD()

static u32 get_XOVER_CMD ( u8  rankmap)
static

Definition at line 41 of file raminit_common.c.

Referenced by dram_xover(), and program_timings().

Here is the caller graph for this function:

◆ jedec_write_leveling()

◆ make_mr0()

static u32 make_mr0 ( ramctr_timing ctrl,
u8  rank 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_mr1()

static u32 make_mr1 ( ramctr_timing ctrl,
u8  rank,
int  channel 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ normalize_training()

◆ num_of_channels()

static int num_of_channels ( const ramctr_timing ctrl)
static

Definition at line 1524 of file raminit_common.c.

References FOR_ALL_POPULATED_CHANNELS.

Referenced by fill_pattern1(), and fill_pattern5().

Here is the caller graph for this function:

◆ prepare_training()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ program_timings()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ program_wdb_pattern_length()

static void program_wdb_pattern_length ( int  channel,
const unsigned int  num_cachelines 
)
static

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_mpr_training()

◆ receive_enable_calibration()

◆ reprogram_320c()

static void reprogram_320c ( ramctr_timing ctrl)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ restore_timings()

◆ set_normal_operation()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_read_write_timings()

◆ set_scrambling_seed()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_wmm_behavior()

void set_wmm_behavior ( const u32  cpu)

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_write_vref()

static void set_write_vref ( const int  channel,
const u8  wr_vref 
)
static

Definition at line 2407 of file raminit_common.c.

References GDCRCMDDEBUGMUXCFG_Cz_S, mchbar_clrsetbits32(), and udelay().

Referenced by aggressive_write_training().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sfence()

static void sfence ( void  )
static

Definition at line 21 of file raminit_common.c.

Referenced by fill_pattern0(), fill_pattern1(), and fill_pattern5().

Here is the caller graph for this function:

◆ test_aggressive_write()

static void test_aggressive_write ( ramctr_timing ctrl,
int  channel,
int  slotrank 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_command_training()

static int test_command_training ( ramctr_timing ctrl,
int  channel,
int  slotrank 
)
static

◆ test_rcven()

static void test_rcven ( ramctr_timing ctrl,
int  channel,
int  slotrank 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_tx_dq()

static void test_tx_dq ( ramctr_timing ctrl,
int  channel,
int  slotrank 
)
static

◆ toggle_io_reset()

static void toggle_io_reset ( void  )
static

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ train_write_flyby()

◆ try_cmd_stretch()

◆ tx_dq_threshold_process()

static void tx_dq_threshold_process ( int *  data,
const int  count 
)
static

Definition at line 1425 of file raminit_common.c.

References count, and printram.

Referenced by tx_dq_write_leveling().

Here is the caller graph for this function:

◆ tx_dq_write_leveling()

◆ write_level_rank()

◆ write_mrreg()

static void write_mrreg ( ramctr_timing ctrl,
int  channel,
int  slotrank,
int  reg,
u32  val 
)
static

Definition at line 601 of file raminit_common.c.

Referenced by dram_mr0(), dram_mr1(), dram_mr2(), dram_mr3(), and jedec_write_leveling().

Here is the caller graph for this function:

◆ write_reset()

static void write_reset ( ramctr_timing ctrl)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_training()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ lane_base

const u32 lane_base[]
static
Initial value:
= {
}
#define LANEBASE_B3
Definition: mchbar.h:281
#define LANEBASE_B1
Definition: mchbar.h:279
#define LANEBASE_ECC
Definition: mchbar.h:282
#define LANEBASE_B6
Definition: mchbar.h:285
#define LANEBASE_B2
Definition: mchbar.h:280
#define LANEBASE_B5
Definition: mchbar.h:284
#define LANEBASE_B0
Definition: mchbar.h:278
#define LANEBASE_B4
Definition: mchbar.h:283
#define LANEBASE_B7
Definition: mchbar.h:286

Definition at line 901 of file raminit_common.c.

Referenced by does_lane_work(), program_timings(), train_write_flyby(), and write_level_rank().