From ebfd698e57c902e2f39a0cfc1bc2b02665e47ec6 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Wed, 13 Nov 2013 16:06:34 -0800 Subject: [PATCH] arm: Remove CAR_MIGRATE Kconfig and associated cruft This is essentially a revert of commit 5a1469d5. The CAR_MIGRATE mechanism is only useful to migrate variables from a special region (e.g. cache as RAM) into DRAM-backed CBMEM between different parts of the romstage (it does not persist into ramstage). Since ARM devices use SRAM for which there is no reason to become inaccessible in later parts of the romstage, this mechanism isn't useful for them. Removing it makes the romstage.ld script much simpler, which has the nice side-effect of putting the BSS at the end of the memory image (so that cbfstool can actually figure out that it doesn't need to be part of the ROM image). BUG=None TEST=Still boots and the romstage BSS is no longer part of the load size in the CBFS image. Change-Id: I50e91d8bd51b5deb19446d9da48699edecbef6ea Signed-off-by: Julius Werner Reviewed-on: https://chromium-review.googlesource.com/176761 Reviewed-by: David Hendricks --- src/arch/arm/include/arch/early_variables.h | 31 +++------------------ src/arch/arm/romstage.ld | 31 +-------------------- src/soc/samsung/exynos5250/Kconfig | 1 - src/soc/samsung/exynos5420/Kconfig | 1 - 4 files changed, 5 insertions(+), 59 deletions(-) diff --git a/src/arch/arm/include/arch/early_variables.h b/src/arch/arm/include/arch/early_variables.h index 0c866a09ce..fc472e0882 100644 --- a/src/arch/arm/include/arch/early_variables.h +++ b/src/arch/arm/include/arch/early_variables.h @@ -20,40 +20,17 @@ #ifndef ARCH_EARLY_VARIABLES_H #define ARCH_EARLY_VARIABLES_H -#ifdef __PRE_RAM__ -#define CAR_GLOBAL __attribute__((section(".car.global_data"))) -#define CAR_CBMEM __attribute__((section(".car.cbmem_console"))) -#else -#define CAR_GLOBAL -#define CAR_CBMEM +#if CONFIG_CAR_MIGRATION + #error "This is ARM, silly... we don't have CAR here." #endif -#if CONFIG_CAR_MIGRATION && defined(__PRE_RAM__) -#define CAR_MIGRATE_ATTR __attribute__ ((used,section (".car.migrate"))) +#define CAR_GLOBAL +#define CAR_CBMEM -/* Call migrate_fn_() when CAR globals are migrated. */ -#define CAR_MIGRATE(migrate_fn_) \ - static void (* const migrate_fn_ ## _ptr)(void) CAR_MIGRATE_ATTR = \ - migrate_fn_; - -/* Get the correct pointer for the CAR global variable. */ -void *car_get_var_ptr(void *var); - -/* Get and set a primitive type global variable. */ -#define car_get_var(var) \ - *(typeof(var) *)car_get_var_ptr(&(var)) -#define car_set_var(var, val) \ - do { car_get_var(var) = (val); } while(0) - -/* Migrate the CAR variables to memory. */ -void car_migrate_variables(void); - -#else #define CAR_MIGRATE(migrate_fn_) static inline void *car_get_var_ptr(void *var) { return var; } #define car_get_var(var) (var) #define car_set_var(var, val) do { (var) = (val); } while (0) static inline void car_migrate_variables(void) { } -#endif #endif diff --git a/src/arch/arm/romstage.ld b/src/arch/arm/romstage.ld index bdf669db82..d5d9ddecdd 100644 --- a/src/arch/arm/romstage.ld +++ b/src/arch/arm/romstage.ld @@ -33,7 +33,6 @@ ENTRY(stage_entry) SECTIONS { - /* TODO make this a configurable option (per chipset). */ . = CONFIG_ROMSTAGE_BASE; .romtext . : { @@ -48,11 +47,7 @@ SECTIONS *(.rodata); *(.machine_param); *(.data); - . = ALIGN(16); - _car_migrate_start = .; - *(.car.migrate); - _car_migrate_end = .; - . = ALIGN(16); + . = ALIGN(8); _erom = .; } @@ -70,32 +65,8 @@ SECTIONS _ebss = .; - .car.data . : { - . = ALIGN(8); - _car_data_start = .; - *(.car.global_data); - . = ALIGN(8); - /* The cbmem_console section comes last to take advantage of - * a zero-sized array to hold the memconsole contents that - * grows to a bound of CONFIG_CONSOLE_CAR_BUFFER_SIZE. However, - * collisions within the cache-as-ram region cannot be - * statically checked because the cache-as-ram region usage is - * cpu/chipset dependent. */ - *(.car.cbmem_console); - _car_data_end = .; - } - _end = .; - /* TODO: check if we are running out of SRAM. Below check is not good - * enough though because SRAM has different size on different CPUs - * and not all SRAM is available to the romstage. On Exynos, some is - * used for BL1, the bootblock and the stack. - * - * _bogus = ASSERT((_end - _start + EXPECTED_CBMEM_CONSOLE_SIZE <= \ - * 0x54000), "SRAM area is too full"); - */ - /* Discard the sections we don't need/want */ /DISCARD/ : { *(.comment) diff --git a/src/soc/samsung/exynos5250/Kconfig b/src/soc/samsung/exynos5250/Kconfig index 982008b7fc..f61da9354c 100644 --- a/src/soc/samsung/exynos5250/Kconfig +++ b/src/soc/samsung/exynos5250/Kconfig @@ -5,7 +5,6 @@ config CPU_SAMSUNG_EXYNOS5250 select HAVE_UART_SPECIAL select EARLY_CONSOLE select DYNAMIC_CBMEM - select CAR_MIGRATION select ARM_BOOTBLOCK_ARMV7 select ARM_ROMSTAGE_ARMV7 select ARM_RAMSTAGE_ARMV7 diff --git a/src/soc/samsung/exynos5420/Kconfig b/src/soc/samsung/exynos5420/Kconfig index d53064a5fe..19e19f9871 100644 --- a/src/soc/samsung/exynos5420/Kconfig +++ b/src/soc/samsung/exynos5420/Kconfig @@ -6,7 +6,6 @@ config CPU_SAMSUNG_EXYNOS5420 select EARLY_CONSOLE select RELOCATABLE_MODULES select DYNAMIC_CBMEM - select CAR_MIGRATION select ARM_BOOTBLOCK_ARMV7 select ARM_ROMSTAGE_ARMV7 select ARM_RAMSTAGE_ARMV7