arch/x86: Fix typo with MTRR

Change-Id: I67a470c2c2a659d5355fdd0939d0572c1ff3e291
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/21519
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Sumeet R Pawnikar <sumeet.r.pawnikar@intel.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
This commit is contained in:
Kyösti Mälkki 2017-09-12 10:36:49 +03:00
parent 7673f2f5e9
commit a097fb8fff
2 changed files with 9 additions and 9 deletions

View File

@ -261,8 +261,8 @@ asmlinkage void car_stage_entry(void);
struct postcar_frame { struct postcar_frame {
uintptr_t stack; uintptr_t stack;
uint32_t upper_mask; uint32_t upper_mask;
int max_var_mttrs; int max_var_mtrrs;
int num_var_mttrs; int num_var_mtrrs;
}; };
/* /*

View File

@ -39,8 +39,8 @@ static void postcar_frame_prepare(struct postcar_frame *pcf)
msr = rdmsr(MTRR_CAP_MSR); msr = rdmsr(MTRR_CAP_MSR);
pcf->upper_mask = (1 << (cpu_phys_address_size() - 32)) - 1; pcf->upper_mask = (1 << (cpu_phys_address_size() - 32)) - 1;
pcf->max_var_mttrs = msr.lo & MTRR_CAP_VCNT; pcf->max_var_mtrrs = msr.lo & MTRR_CAP_VCNT;
pcf->num_var_mttrs = 0; pcf->num_var_mtrrs = 0;
} }
int postcar_frame_init(struct postcar_frame *pcf, size_t stack_size) int postcar_frame_init(struct postcar_frame *pcf, size_t stack_size)
@ -82,9 +82,9 @@ void postcar_frame_add_mtrr(struct postcar_frame *pcf,
uint32_t size_msb; uint32_t size_msb;
uint32_t mtrr_size; uint32_t mtrr_size;
if (pcf->num_var_mttrs >= pcf->max_var_mttrs) { if (pcf->num_var_mtrrs >= pcf->max_var_mtrrs) {
printk(BIOS_ERR, "No more variable MTRRs: %d\n", printk(BIOS_ERR, "No more variable MTRRs: %d\n",
pcf->max_var_mttrs); pcf->max_var_mtrrs);
return; return;
} }
@ -106,7 +106,7 @@ void postcar_frame_add_mtrr(struct postcar_frame *pcf,
stack_push(pcf, ~(mtrr_size - 1) | MTRR_PHYS_MASK_VALID); stack_push(pcf, ~(mtrr_size - 1) | MTRR_PHYS_MASK_VALID);
stack_push(pcf, 0); stack_push(pcf, 0);
stack_push(pcf, addr | type); stack_push(pcf, addr | type);
pcf->num_var_mttrs++; pcf->num_var_mtrrs++;
size -= mtrr_size; size -= mtrr_size;
addr += mtrr_size; addr += mtrr_size;
@ -119,8 +119,8 @@ void *postcar_commit_mtrrs(struct postcar_frame *pcf)
* Place the number of used variable MTRRs on stack then max number * Place the number of used variable MTRRs on stack then max number
* of variable MTRRs supported in the system. * of variable MTRRs supported in the system.
*/ */
stack_push(pcf, pcf->num_var_mttrs); stack_push(pcf, pcf->num_var_mtrrs);
stack_push(pcf, pcf->max_var_mttrs); stack_push(pcf, pcf->max_var_mtrrs);
return (void *) pcf->stack; return (void *) pcf->stack;
} }