FSP 1.0: Fix CAR issues - broken timestamps and console
FSP 1.0 has a fixed-size temporary cache size and address and the entire cache is migrated in the FSP FspInitEntry() function. Previous code expected the symbol _car_data_start to be the same as CONFIG_DCACHE_RAM_BASE and _car_data_end to be the same as _preram_cbmem_console. FSP 1.0 is the only one that migrates _preram_cbmem_console. Others leave that where it is and extract the early console data in cbmemc_reinit(). Special handling is needed to handle that. Commit dd6fa93d broke both assumptions and so broke the timestamp table and console. The fix is to use CONFIG_DCACHE_RAM_BASE when calculating the offset and to use _preram_cbmem_console instead of _car_data_end for the console check. Change-Id: I6db109269b3537f7cb1300357c483ff2a745ffa7 Signed-off-by: Ben Gardner <gardner.ben@gmail.com> Reviewed-on: http://review.coreboot.org/12511 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
parent
b9434aa853
commit
e597e63e49
@ -18,6 +18,7 @@
|
|||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
#include <cbmem.h>
|
#include <cbmem.h>
|
||||||
#include <arch/early_variables.h>
|
#include <arch/early_variables.h>
|
||||||
|
#include <symbols.h>
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_PLATFORM_USES_FSP1_0)
|
#if IS_ENABLED(CONFIG_PLATFORM_USES_FSP1_0)
|
||||||
#include <drivers/intel/fsp1_0/fsp_util.h>
|
#include <drivers/intel/fsp1_0/fsp_util.h>
|
||||||
@ -63,15 +64,16 @@ void *car_get_var_ptr(void *var)
|
|||||||
#if IS_ENABLED(CONFIG_PLATFORM_USES_FSP1_0)
|
#if IS_ENABLED(CONFIG_PLATFORM_USES_FSP1_0)
|
||||||
migrated_base=(char *)find_saved_temp_mem(
|
migrated_base=(char *)find_saved_temp_mem(
|
||||||
*(void **)CBMEM_FSP_HOB_PTR);
|
*(void **)CBMEM_FSP_HOB_PTR);
|
||||||
|
/* FSP 1.0 migrates the entire DCACHE RAM */
|
||||||
|
offset = (char *)var - (char *)CONFIG_DCACHE_RAM_BASE;
|
||||||
#else
|
#else
|
||||||
migrated_base = cbmem_find(CBMEM_ID_CAR_GLOBALS);
|
migrated_base = cbmem_find(CBMEM_ID_CAR_GLOBALS);
|
||||||
|
offset = (char *)var - (char *)_car_start;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (migrated_base == NULL)
|
if (migrated_base == NULL)
|
||||||
die( "CAR: Could not find migration base!\n");
|
die( "CAR: Could not find migration base!\n");
|
||||||
|
|
||||||
offset = (char *)var - (char *)_car_start;
|
|
||||||
|
|
||||||
return &migrated_base[offset];
|
return &migrated_base[offset];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,16 +91,20 @@ void *car_sync_var_ptr(void *var)
|
|||||||
if (mig_var == var)
|
if (mig_var == var)
|
||||||
return mig_var;
|
return mig_var;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Migrate the cbmem console pointer for FSP 1.0 platforms. Otherwise,
|
||||||
|
* keep console buffer in CAR until cbmemc_reinit() moves it.
|
||||||
|
*/
|
||||||
|
if (*mig_var == _preram_cbmem_console) {
|
||||||
|
if (IS_ENABLED(CONFIG_PLATFORM_USES_FSP1_0))
|
||||||
|
*mig_var += (char *)mig_var - (char *)var;
|
||||||
|
return mig_var;
|
||||||
|
}
|
||||||
|
|
||||||
/* It's already pointing outside car.global_data. */
|
/* It's already pointing outside car.global_data. */
|
||||||
if (*mig_var < _car_start || *mig_var > _car_end)
|
if (*mig_var < _car_start || *mig_var > _car_end)
|
||||||
return mig_var;
|
return mig_var;
|
||||||
|
|
||||||
#if !IS_ENABLED(CONFIG_PLATFORM_USES_FSP1_0)
|
|
||||||
/* Keep console buffer in CAR until cbmemc_reinit() moves it. */
|
|
||||||
if (*mig_var == _car_end)
|
|
||||||
return mig_var;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Move the pointer by the same amount the variable storing it was
|
/* Move the pointer by the same amount the variable storing it was
|
||||||
* moved by.
|
* moved by.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user