Fix the location of "Setting variable MTRR" printk.

Without that fix the debugging is harder because the person debugging
  coreboot will see the following twice(note the repeated MTRR number):
    Setting variable MTRR 0, base:    0MB, range: 4096MB, type WB
    [...]
    Setting variable MTRR 1, base: 4096MB, range:  512MB, type WB
    Setting variable MTRR 1, base: 4608MB, range:  256MB, type WB
    Setting variable MTRR 1, base: 3072MB, range: 1024MB, type UC
  instead of the following twice:
    Setting variable MTRR 0, base:    0MB, range: 4096MB, type WB
    [...]
    Setting variable MTRR 1, base: 3072MB, range: 1024MB, type UC

Thanks to kmalkki on #coreboot's Freenode IRC channel for the idea:
  May 25 23:57:17 <kmalkki>	I would add (move) that "Setting variable MTRR..." debug at the end of set_var_mtrrs()

Change-Id: I9f4b7110ba34d017a58d8cc5fb06a7b1c3d0c8aa
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Reviewed-on: http://review.coreboot.org/1058
Tested-by: build bot (Jenkins)
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2012-05-26 00:13:22 +02:00 committed by Patrick Georgi
parent 3b3a1a1ee6
commit 7c2d058d61
1 changed files with 6 additions and 5 deletions

View File

@ -140,6 +140,12 @@ static void set_var_mtrr(
wrmsr (MTRRphysMask_MSR(reg), mask);
enable_cache();
printk(BIOS_DEBUG, "Setting variable MTRR %d, base: %4ldMB, range: %4ldMB, type %s\n",
reg, basek >>10, sizek >> 10,
(type==MTRR_TYPE_UNCACHEABLE)?"UC":
((type==MTRR_TYPE_WRBACK)?"WB":"Other")
);
}
/* fms: find most sigificant bit set, stolen from Linux Kernel Source. */
@ -284,11 +290,6 @@ static unsigned int range_to_mtrr(unsigned int reg,
align = max_align;
}
sizek = 1 << align;
printk(BIOS_DEBUG, "Setting variable MTRR %d, base: %4ldMB, range: %4ldMB, type %s\n",
reg, range_startk >>10, sizek >> 10,
(type==MTRR_TYPE_UNCACHEABLE)?"UC":
((type==MTRR_TYPE_WRBACK)?"WB":"Other")
);
/* if range is above 4GB, MTRR is needed
* only if above4gb flag is set