From 0f5e01a9620bfac2311a2fef82bfb3dc3ab59c1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Fri, 9 Aug 2019 07:11:07 +0300 Subject: arch/x86: Flip option NO_CAR_GLOBAL_MIGRATION MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is easier to track CAR_GLOBAL_MIGRATION which is the approach to be deprecated with the next release. This change enforces new policy; POSTCAR_STAGE=y is not allowed together with CAR_GLOBAL_MIGRATION=y. Change-Id: I0dbad6a14e68bf566ac0f151dc8ea259e5ae2250 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/34804 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/arch/x86/Kconfig | 5 +++-- src/arch/x86/car.ld | 6 +++--- src/arch/x86/include/arch/early_variables.h | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src/arch/x86') diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig index 631d981e45..2ace7f753d 100644 --- a/src/arch/x86/Kconfig +++ b/src/arch/x86/Kconfig @@ -222,8 +222,9 @@ config VERSTAGE_ADDR # Use the post CAR infrastructure for tearing down cache-as-ram # from a program loaded in RAM and subsequently loading ramstage. config POSTCAR_STAGE - def_bool n - select NO_CAR_GLOBAL_MIGRATION + def_bool y + depends on ARCH_X86 + depends on !CAR_GLOBAL_MIGRATION config VERSTAGE_DEBUG_SPINLOOP bool diff --git a/src/arch/x86/car.ld b/src/arch/x86/car.ld index 5802b02896..5351fc7bb8 100644 --- a/src/arch/x86/car.ld +++ b/src/arch/x86/car.ld @@ -76,7 +76,7 @@ * cbmem console. This is useful for clearing this area on a per-stage * basis when more than one stage uses cache-as-ram for CAR_GLOBALs. */ _car_global_start = .; -#if CONFIG(NO_CAR_GLOBAL_MIGRATION) +#if !CONFIG(CAR_GLOBAL_MIGRATION) /* Allow global unitialized variables when CAR_GLOBALs are not used. */ *(.bss) *(.bss.*) @@ -84,7 +84,7 @@ *(.sbss.*) #else /* .car.global_data objects only around when - * !CONFIG_NO_CAR_GLOBAL_MIGRATION is employed. */ + * CONFIG_CAR_GLOBAL_MIGRATION is employed. */ *(.car.global_data); #endif . = ALIGN(ARCH_POINTER_ALIGN_SIZE); @@ -107,7 +107,7 @@ .illegal_globals . : { *(EXCLUDE_FILE ("*/libagesa.*.a:" "*/romstage*/buildOpts.o" "*/romstage*/agesawrapper.o" "*/vendorcode/amd/agesa/*" "*/vendorcode/amd/cimx/*") .data) *(EXCLUDE_FILE ("*/libagesa.*.a:" "*/romstage*/buildOpts.o" "*/romstage*/agesawrapper.o" "*/vendorcode/amd/agesa/*" "*/vendorcode/amd/cimx/*") .data.*) -#if !CONFIG(NO_CAR_GLOBAL_MIGRATION) +#if CONFIG(CAR_GLOBAL_MIGRATION) *(.bss) *(.bss.*) *(.sbss) diff --git a/src/arch/x86/include/arch/early_variables.h b/src/arch/x86/include/arch/early_variables.h index a69c230596..4860e49b11 100644 --- a/src/arch/x86/include/arch/early_variables.h +++ b/src/arch/x86/include/arch/early_variables.h @@ -20,7 +20,7 @@ #include #include -#if ENV_CACHE_AS_RAM && !CONFIG(NO_CAR_GLOBAL_MIGRATION) +#if ENV_CACHE_AS_RAM && CONFIG(CAR_GLOBAL_MIGRATION) asm(".section .car.global_data,\"w\",@nobits"); asm(".previous"); #ifdef __clang__ @@ -83,8 +83,8 @@ static inline size_t car_object_offset(void *ptr) /* * We might end up here if: * 1. ENV_CACHE_AS_RAM is not set for the stage or - * 2. ENV_CACHE_AS_RAM is set for the stage but CONFIG_NO_CAR_GLOBAL_MIGRATION - * is also set. In this case, there is no need to migrate CAR global + * 2. ENV_CACHE_AS_RAM is set for the stage but CONFIG_CAR_GLOBAL_MIGRATION + * is not set. In this case, there is no need to migrate CAR global * variables. But, since we might still be running out of CAR, car_active needs * to return 1 if ENV_CACHE_AS_RAM is set. */ @@ -101,6 +101,6 @@ static inline int car_active(void) { return 0; } #define car_get_var(var) (var) #define car_sync_var(var) (var) #define car_set_var(var, val) (var) = (val) -#endif /* ENV_CACHE_AS_RAM && !CONFIG(NO_CAR_GLOBAL_MIGRATION) */ +#endif /* ENV_CACHE_AS_RAM && CONFIG(CAR_GLOBAL_MIGRATION) */ #endif /* ARCH_EARLY_VARIABLES_H */ -- cgit v1.2.3