Nico Huber (nico.huber@secunet.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3257
-gerrit
commit 25ab0a15c516c79df281e6a487ed473ab8483939 Author: Nico Huber nico.huber@secunet.com Date: Tue May 14 12:28:42 2013 +0200
intel/gm45: Add more debug output to read/write training
This adds debug output for the timing values of the edges found during read and write training.
Change-Id: Idb7c84b514716c7265b94890c39b7225de7800dc Signed-off-by: Nico Huber nico.huber@secunet.com --- .../intel/gm45/raminit_read_write_training.c | 26 +++++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/src/northbridge/intel/gm45/raminit_read_write_training.c b/src/northbridge/intel/gm45/raminit_read_write_training.c index 0a23901..a4ba4ef 100644 --- a/src/northbridge/intel/gm45/raminit_read_write_training.c +++ b/src/northbridge/intel/gm45/raminit_read_write_training.c @@ -56,6 +56,13 @@ typedef struct { int t; int p; } read_timing_t; +static void print_read_timing(const int msg_lvl, const char *const msg, + const int lane, const int channel, + const read_timing_t *const timing) +{ + printk(msg_lvl, "%s for byte lane %d on channel %d: %d.%d\n", + msg, lane, channel, timing->t, timing->p); +} static int normalize_read_timing(read_timing_t *const timing) { while (timing->p >= READ_TIMING_P_BOUND) { @@ -182,6 +189,7 @@ static void read_training_per_lane(const int channel, const int lane, lower.p = 0; if (read_training_find_lower(channel, lane, addresses, &lower) < 0) die("Read training failure: lower bound.\n"); + print_read_timing(BIOS_SPEW, "Lower bound", lane, channel, &lower);
/*** Search upper bound. ***/
@@ -191,6 +199,7 @@ static void read_training_per_lane(const int channel, const int lane, if (read_training_find_upper(channel, lane, addresses, &upper) < 0) /* Overflow on upper edge is not fatal. */ printk(BIOS_WARNING, "Read training failure: upper bound.\n"); + print_read_timing(BIOS_SPEW, "Upper bound", lane, channel, &upper);
/*** Calculate and program mean value. ***/
@@ -201,8 +210,7 @@ static void read_training_per_lane(const int channel, const int lane, lower.t = mean_p >> READ_TIMING_P_SHIFT; lower.p = mean_p & (READ_TIMING_P_BOUND - 1); program_read_timing(channel, lane, &lower); - printk(BIOS_DEBUG, "Final timings for byte lane %d on channel %d: " - "%d.%d\n", lane, channel, lower.t, lower.p); + print_read_timing(BIOS_DEBUG, "Final timings", lane, channel, &lower); } static void perform_read_training(const dimminfo_t *const dimms) { @@ -341,6 +349,13 @@ typedef struct { const int t_bound; int p; } write_timing_t; +static void print_write_timing(const int msg_lvl, const char *const msg, + const int group, const int channel, + const write_timing_t *const timing) +{ + printk(msg_lvl, "%s for group %d on channel %d: %d.%d.%d\n", + msg, group, channel, timing->f, timing->t, timing->p); +} static int normalize_write_timing(write_timing_t *const timing) { while (timing->p >= WRITE_TIMING_P_BOUND) { @@ -516,6 +531,7 @@ static void write_training_per_group(const int ch, const int group, if (write_training_find_lower(ch, group, addresses, masks, memclk1067, &lower) < 0) die("Write training failure: lower bound.\n"); + print_write_timing(BIOS_SPEW, "Lower bound", group, ch, &lower);
/*** Search upper bound. ***/
@@ -527,6 +543,7 @@ static void write_training_per_group(const int ch, const int group, if (write_training_find_upper(ch, group, addresses, masks, memclk1067, &upper) < 0) printk(BIOS_WARNING, "Write training failure: upper bound.\n"); + print_write_timing(BIOS_SPEW, "Upper bound", group, ch, &upper);
/*** Calculate and program mean value. ***/
@@ -540,10 +557,7 @@ static void write_training_per_group(const int ch, const int group, lower.t = (mean_p >> WRITE_TIMING_P_SHIFT) % lower.t_bound; lower.p = mean_p & (WRITE_TIMING_P_BOUND - 1); program_write_timing(ch, group, &lower, memclk1067); - - printk(BIOS_DEBUG, "Final timings for group %d" - " on channel %d: %d.%d.%d\n", - group, ch, lower.f, lower.t, lower.p); + print_write_timing(BIOS_DEBUG, "Final timings", group, ch, &lower); } static void perform_write_training(const int memclk1067, const dimminfo_t *const dimms)