summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2020-11-14 16:52:33 +0100
committerFelix Held <felix-coreboot@felixheld.de>2020-11-22 20:35:41 +0000
commitc6d2feaee53cfce3ca54d389b51593fc86e25576 (patch)
treeb86f3ce8f5fab979ea21c9258f54a7e78e374450 /src
parent9426721807e0f531ea198ff932b8548d48550780 (diff)
nb/intel/sandybridge: Do not rewrite write leveling sequence
There's no need to reprogram the exact same sequence over a hundred times. Move it out of the timB loop, and drop the `test_timB` function. Tested on Asus P8H61-M PRO, still boots. Change-Id: I375e325cf8b5369889b9cb059c3675cd00bdbb3f Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/47616 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src')
-rw-r--r--src/northbridge/intel/sandybridge/raminit_common.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/src/northbridge/intel/sandybridge/raminit_common.c b/src/northbridge/intel/sandybridge/raminit_common.c
index b9a35f0992..57c376b1aa 100644
--- a/src/northbridge/intel/sandybridge/raminit_common.c
+++ b/src/northbridge/intel/sandybridge/raminit_common.c
@@ -1696,24 +1696,6 @@ static void precharge(ramctr_timing *ctrl)
}
}
-static void test_timB(ramctr_timing *ctrl, int channel, int slotrank)
-{
- u32 mr1reg = make_mr1(ctrl, slotrank, channel) | 1 << 7;
- int bank = 1;
-
- if (ctrl->rank_mirror[channel][slotrank])
- ddr3_mirror_mrreg(&bank, &mr1reg);
-
- wait_for_iosav(channel);
-
- iosav_write_jedec_write_leveling_sequence(ctrl, channel, slotrank, bank, mr1reg);
-
- /* Execute command queue */
- iosav_run_once(channel);
-
- wait_for_iosav(channel);
-}
-
static int discover_timB(ramctr_timing *ctrl, int channel, int slotrank)
{
int timB;
@@ -1729,13 +1711,26 @@ static int discover_timB(ramctr_timing *ctrl, int channel, int slotrank)
};
MCHBAR32(GDCRTRAININGMOD) = training_mod.raw;
+ u32 mr1reg = make_mr1(ctrl, slotrank, channel) | 1 << 7;
+ int bank = 1;
+
+ if (ctrl->rank_mirror[channel][slotrank])
+ ddr3_mirror_mrreg(&bank, &mr1reg);
+
+ wait_for_iosav(channel);
+
+ iosav_write_jedec_write_leveling_sequence(ctrl, channel, slotrank, bank, mr1reg);
+
for (timB = 0; timB < 128; timB++) {
FOR_ALL_LANES {
ctrl->timings[channel][slotrank].lanes[lane].timB = timB;
}
program_timings(ctrl, channel);
- test_timB(ctrl, channel, slotrank);
+ /* Execute command queue */
+ iosav_run_once(channel);
+
+ wait_for_iosav(channel);
FOR_ALL_LANES {
statistics[lane][timB] = !((MCHBAR32(lane_base[lane] +