From e4d46b9e90f4e1fd0e6f0ec0a64da7b2dba97c7a Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Wed, 10 Dec 2008 18:34:16 +0000 Subject: [PATCH] early_mtrr_init() nukes all MTRRs including those which we use for CAR. That means if it ever gets called while CAR is active, our stack will be dropped and mayhem will ensue. Besides that, it just replicated stage0.S functionality which already nukes all MTRRs before enabling CAR. We could move XIP ROM caching from stage0.S to early_mtrr_init(). It would probably slow down booting a bit, but the amount of asm code would be reduced. Thanks to Corey for telling me that early_mtrr_init() broke booting for him. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Ronald G. Minnich git-svn-id: svn://coreboot.org/repository/coreboot-v3@1067 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- arch/x86/stage1_mtrr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/stage1_mtrr.c b/arch/x86/stage1_mtrr.c index 2810348c26..035f06fd2a 100644 --- a/arch/x86/stage1_mtrr.c +++ b/arch/x86/stage1_mtrr.c @@ -67,6 +67,11 @@ void cache_cbmem(int type) enable_cache(); } +/* early_mtrr_init was only usable for ROMCC compiled code. It nukes CAR. + * The only remaining purpose would be to enable ROM caching here instead of + * in stage0.S and even that is debatable. + */ +#if 0 /* the fixed and variable MTTRs are power-up with random values, * clear them to MTRR_TYPE_UNCACHEABLE for safty. */ @@ -130,6 +135,7 @@ void early_mtrr_init(void) do_early_mtrr_init(mtrr_msrs); enable_cache(); } +#endif int early_mtrr_init_detected(void) {