From 8c2f39714f4d6b8f2ab9692669474fb5ada3ed37 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Fri, 3 Jul 2015 21:11:25 +0200 Subject: intel raminit: rename register Found while doing code review. Rename reg_4004_b30 to cmd_stretch. Found in 4th-gen-core-family-desktop-vol-2-datasheet.pdf chapter 4.2.1. Change-Id: Ib07059625ed458332708562e836803f2b587d5d8 Signed-off-by: Patrick Rudolph Reviewed-on: http://review.coreboot.org/10789 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer Reviewed-by: Paul Menzel Reviewed-by: Philipp Deppenwiese Reviewed-by: Nicolas Reinecke --- src/northbridge/intel/sandybridge/raminit_native.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/northbridge/intel') diff --git a/src/northbridge/intel/sandybridge/raminit_native.c b/src/northbridge/intel/sandybridge/raminit_native.c index 8d1feccb75..3740a02706 100644 --- a/src/northbridge/intel/sandybridge/raminit_native.c +++ b/src/northbridge/intel/sandybridge/raminit_native.c @@ -136,7 +136,7 @@ typedef struct ramctr_timing_st { int ref_card_offset[NUM_CHANNELS]; u32 mad_dimm[NUM_CHANNELS]; int channel_size_mb[NUM_CHANNELS]; - u32 reg_4004_b30[NUM_CHANNELS]; + u32 cmd_stretch[NUM_CHANNELS]; int reg_c14_offset; int reg_320c_range_threshold; @@ -2683,7 +2683,7 @@ static void reprogram_320c(ramctr_timing * ctrl) #define MIN_C320C_LEN 13 -static int try_reg_4004_b30(ramctr_timing * ctrl, int r4004b30) +static int try_cmd_stretch(ramctr_timing * ctrl, int cmd_stretch) { struct ram_rank_timings saved_timings[NUM_CHANNELS][NUM_SLOTRANKS]; int channel, slotrank; @@ -2695,7 +2695,7 @@ static int try_reg_4004_b30(ramctr_timing * ctrl, int r4004b30) } FOR_ALL_POPULATED_CHANNELS { - ctrl->reg_4004_b30[channel] = r4004b30; + ctrl->cmd_stretch[channel] = cmd_stretch; } FOR_ALL_POPULATED_CHANNELS @@ -2706,14 +2706,14 @@ static int try_reg_4004_b30(ramctr_timing * ctrl, int r4004b30) | (ctrl->tWTR << 12) | (ctrl->tFAW << 16) | (ctrl->tWR << 24) - | (ctrl->reg_4004_b30[channel] << 30); + | (ctrl->cmd_stretch[channel] << 30); FOR_ALL_CHANNELS { int delta = 0; - if (ctrl->reg_4004_b30[channel] == 2) + if (ctrl->cmd_stretch[channel] == 2) delta = 2; - else if (ctrl->reg_4004_b30[channel] == 0) + else if (ctrl->cmd_stretch[channel] == 0) delta = 4; FOR_ALL_POPULATED_RANKS { @@ -2764,7 +2764,8 @@ static void command_training(ramctr_timing * ctrl) write32(DEFAULT_MCHBAR + 0x4288 + 0x400 * channel, 0x1f); } - if (!try_reg_4004_b30(ctrl, 0) && !try_reg_4004_b30(ctrl, 2)) + /* try command rate 1T and 2T */ + if (!try_cmd_stretch(ctrl, 0) && !try_cmd_stretch(ctrl, 2)) die("c320c discovery failed"); FOR_ALL_POPULATED_CHANNELS { @@ -3621,7 +3622,7 @@ static void restore_timings(ramctr_timing * ctrl) | (ctrl->tWTR << 12) | (ctrl->tFAW << 16) | (ctrl->tWR << 24) - | (ctrl->reg_4004_b30[channel] << 30); + | (ctrl->cmd_stretch[channel] << 30); udelay(1); -- cgit v1.2.3