From b224441aaaa5dd08274811d65bb795b4abc231d8 Mon Sep 17 00:00:00 2001 From: Jack Rosenthal Date: Tue, 30 Jul 2019 17:39:48 -0600 Subject: cleanup: remove CONFIG_REPLACE_LOADER_WITH_BSS_SLOW This option was only used with kunimitsu, which was removed from the EC codebase a long time ago. The EC code won't even compile with this option enabled anymore. Remove it! BUG=chromium:989301 BRANCH=none TEST=buildall Change-Id: I8ede226ec1e7b300ded6bb1769d82e142db1b0aa Signed-off-by: Jack Rosenthal Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1727569 Reviewed-by: Denis Brockus Reviewed-by: Daisuke Nojiri --- common/main.c | 9 --------- common/system.c | 32 -------------------------------- 2 files changed, 41 deletions(-) (limited to 'common') diff --git a/common/main.c b/common/main.c index 56c9eb762a..069b20dd17 100644 --- a/common/main.c +++ b/common/main.c @@ -39,15 +39,6 @@ test_mockable __keep int main(void) { -#ifdef CONFIG_REPLACE_LOADER_WITH_BSS_SLOW - /* - * Now that we have started execution, we no longer need the loader. - * Instead, variables placed in the .bss.slow section will use this - * space. Therefore, clear out this region now. - */ - memset((void *)(CONFIG_PROGRAM_MEMORY_BASE + CONFIG_LOADER_MEM_OFF), 0, - CONFIG_LOADER_SIZE); -#endif /* defined(CONFIG_REPLACE_LOADER_WITH_BSS_SLOW) */ /* * Pre-initialization (pre-verified boot) stage. Initialization at * this level should do as little as possible, because verified boot diff --git a/common/system.c b/common/system.c index 86f576b7be..0c1a958cfc 100644 --- a/common/system.c +++ b/common/system.c @@ -506,10 +506,6 @@ const char *system_image_copy_t_to_string(enum system_image_copy_t copy) static void jump_to_image(uintptr_t init_addr) { void (*resetvec)(void); -#ifdef CONFIG_REPLACE_LOADER_WITH_BSS_SLOW - uint8_t *buf; - int rv; -#endif /* defined(CONFIG_REPLACE_LOADER_WITH_BSS_SLOW) */ /* * Jumping to any image asserts the signal to the Silego chip that that @@ -548,32 +544,6 @@ static void jump_to_image(uintptr_t init_addr) /* Call other hooks; these may add tags */ hook_notify(HOOK_SYSJUMP); -#ifdef CONFIG_REPLACE_LOADER_WITH_BSS_SLOW - /* - * We've used the region in which the loader resided as data space for - * the .bss.slow section. Therefore, we need to reload the loader from - * the external storage back into program memory so that we can load a - * different image. - */ - buf = (uint8_t *)(CONFIG_PROGRAM_MEMORY_BASE + CONFIG_LOADER_MEM_OFF); - rv = flash_read((CONFIG_EC_PROTECTED_STORAGE_OFF + - CONFIG_LOADER_STORAGE_OFF), - CONFIG_LOADER_SIZE, buf); - /* - * If there's a problem with the flash_read, we might randomly crash in - * the loader. There's nothing we can really do at this point. On - * reset, we'll just load the loader from external flash again and boot - * from RO. Log a message to indicate what happened though. - */ - if (rv) { - CPRINTS("ldr fail!"); - cflush(); - } - - /* Now that the lfw is loaded again, get the reset vector. */ - init_addr = system_get_lfw_address(); -#endif /* defined(CONFIG_REPLACE_LOADER_WITH_BSS_SLOW) */ - /* Disable interrupts before jump */ interrupt_disable(); @@ -629,10 +599,8 @@ test_mockable int system_run_image_copy(enum system_image_copy_t copy) return EC_ERROR_INVAL; #ifdef CONFIG_EXTERNAL_STORAGE -#ifndef CONFIG_REPLACE_LOADER_WITH_BSS_SLOW /* Jump to loader */ init_addr = system_get_lfw_address(); -#endif /* !defined(CONFIG_REPLACE_LOADER_WITH_BSS_SLOW) */ system_set_image_copy(copy); #else #ifdef CONFIG_FW_RESET_VECTOR -- cgit v1.2.1