Rizwan Qureshi (rizwan.qureshi@intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16331
-gerrit
commit 9394065972f3cce869159210ad76ca3231845b1a Author: Rizwan Qureshi rizwan.qureshi@intel.com Date: Fri Aug 26 21:08:50 2016 +0530
arch/x86: Make postcar library available irrespective of CONFIG_POSTCAR_STAGE
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.
Change-Id: I322b12577d74268d03fe42a9744648763693cddd Signed-off-by: Rizwan Qureshi rizwan.qureshi@intel.com --- src/arch/x86/Makefile.inc | 2 +- src/arch/x86/include/arch/cpu.h | 3 +++ src/arch/x86/postcar_loader.c | 17 +++++++++++------ 3 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc index 9b16add..38a2a8c 100644 --- a/src/arch/x86/Makefile.inc +++ b/src/arch/x86/Makefile.inc @@ -213,7 +213,7 @@ romstage-y += memcpy.c romstage-y += memmove.c romstage-y += memset.c romstage-$(CONFIG_X86_TOP4G_BOOTMEDIA_MAP) += mmap_boot.c -romstage-$(CONFIG_POSTCAR_STAGE) += postcar_loader.c +romstage-y += postcar_loader.c romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
ifneq ($(CONFIG_ROMCC),y) diff --git a/src/arch/x86/include/arch/cpu.h b/src/arch/x86/include/arch/cpu.h index 5c26bcf..400e1ba 100644 --- a/src/arch/x86/include/arch/cpu.h +++ b/src/arch/x86/include/arch/cpu.h @@ -273,6 +273,9 @@ int postcar_frame_init(struct postcar_frame *pcf, size_t stack_size); void postcar_frame_add_mtrr(struct postcar_frame *pcf, uintptr_t addr, size_t size, int type);
+/* Push used MTRR and Max MTRRs on to the stack */ +void postcar_commit_mtrrs(struct postcar_frame *pcf); + /* * Load and run a program that takes control of execution that * tears down CAR and loads ramstage. The postcar_frame object diff --git a/src/arch/x86/postcar_loader.c b/src/arch/x86/postcar_loader.c index cc1d460..7f27a7e 100644 --- a/src/arch/x86/postcar_loader.c +++ b/src/arch/x86/postcar_loader.c @@ -84,6 +84,16 @@ 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); +} + void run_postcar_phase(struct postcar_frame *pcf) { struct prog prog = @@ -93,12 +103,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");