From b1b44d34e39e52edfe5521d0671d685962529885 Mon Sep 17 00:00:00 2001 From: Rizwan Qureshi Date: Fri, 26 Aug 2016 21:08:50 +0530 Subject: arch/x86: Always compile postcar library in romstage postcar_loader.c has a useful library of funtions for setting up stack and MTRRs. Make it available in romstage irrespective of CONFIG_POSTCAR_STAGE for use in stack setup after Dram init. The final step of moving the used and max MTRRs on to stack is moved to a new function, that can be used outside of postcar phase. Change-Id: I322b12577d74268d03fe42a9744648763693cddd Signed-off-by: Rizwan Qureshi Reviewed-on: https://review.coreboot.org/16331 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/arch/x86/postcar_loader.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/arch/x86/postcar_loader.c') diff --git a/src/arch/x86/postcar_loader.c b/src/arch/x86/postcar_loader.c index cc1d460585..b5d8db0e1b 100644 --- a/src/arch/x86/postcar_loader.c +++ b/src/arch/x86/postcar_loader.c @@ -84,6 +84,17 @@ void postcar_frame_add_mtrr(struct postcar_frame *pcf, pcf->num_var_mttrs++; } +void *postcar_commit_mtrrs(struct postcar_frame *pcf) +{ + /* + * Place the number of used variable MTRRs on stack then max number + * of variable MTRRs supported in the system. + */ + stack_push(pcf, pcf->num_var_mttrs); + stack_push(pcf, pcf->max_var_mttrs); + return (void *) pcf->stack; +} + void run_postcar_phase(struct postcar_frame *pcf) { struct prog prog = @@ -93,12 +104,7 @@ void run_postcar_phase(struct postcar_frame *pcf) .prog = &prog, }; - /* - * Place the number of used variable MTRRs on stack then max number - * of variable MTRRs supported in the system. - */ - stack_push(pcf, pcf->num_var_mttrs); - stack_push(pcf, pcf->max_var_mttrs); + postcar_commit_mtrrs(pcf); if (prog_locate(&prog)) die("Failed to locate after CAR program.\n"); -- cgit v1.2.3