summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2019-07-30 17:39:48 -0600
committerCommit Bot <commit-bot@chromium.org>2019-07-31 18:55:47 +0000
commitb224441aaaa5dd08274811d65bb795b4abc231d8 (patch)
tree67a222ad5600dc362686c5e86195836a74bb4f53
parent03ab9c1df5c16553b37288fea52911f7d8f62c38 (diff)
downloadchrome-ec-b224441aaaa5dd08274811d65bb795b4abc231d8.tar.gz
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 <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1727569 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r--common/main.c9
-rw-r--r--common/system.c32
-rw-r--r--core/cortex-m/ec.lds.S13
-rw-r--r--include/config.h6
4 files changed, 0 insertions, 60 deletions
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
diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S
index 402abfe39d..93eb70550b 100644
--- a/core/cortex-m/ec.lds.S
+++ b/core/cortex-m/ec.lds.S
@@ -50,11 +50,6 @@ MEMORY
IRAM (rw) : ORIGIN = CONFIG_RAM_BASE, LENGTH = CONFIG_RAM_SIZE
#ifdef CONFIG_EXTERNAL_STORAGE
-#ifdef CONFIG_REPLACE_LOADER_WITH_BSS_SLOW
- LDR_REGION(rw) : \
- ORIGIN = CONFIG_PROGRAM_MEMORY_BASE + CONFIG_LOADER_MEM_OFF, \
- LENGTH = CONFIG_LOADER_SIZE
-#endif /* defined(CONFIG_REPLACE_LOADER_WITH_BSS_SLOW) */
CDRAM (rx) : \
ORIGIN = CONFIG_PROGRAM_MEMORY_BASE + FW_MEM_OFF(SECTION), \
LENGTH = FW_SIZE(SECTION)
@@ -317,18 +312,11 @@ SECTIONS
. += (__deferred_funcs_end - __deferred_funcs) * (8 / 4);
__deferred_until_end = .;
-#ifdef CONFIG_REPLACE_LOADER_WITH_BSS_SLOW
- . = ALIGN(4);
- __bss_end = .;
-#endif /* defined(CONFIG_REPLACE_LOADER_WITH_BSS_SLOW) */
} > IRAM
.bss.slow : {
/* Region of RAM reclaimed from the little firmware(LFW). */
*(.bss.slow)
-#ifdef CONFIG_REPLACE_LOADER_WITH_BSS_SLOW
- } > LDR_REGION
-#else
/*
* Not replacing the loader, so .bss.slow is part of .bss. It needs to
* be followed by __bss_end so that .bss.slow will be zeroed by init.
@@ -336,7 +324,6 @@ SECTIONS
. = ALIGN(4);
__bss_end = .;
} > IRAM
-#endif /* defined(CONFIG_REPLACE_LOADER_WITH_BSS_SLOW) */
.data : {
. = ALIGN(4);
diff --git a/include/config.h b/include/config.h
index 14a7344f7a..723347b12a 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1772,12 +1772,6 @@
#undef CONFIG_FW_PSTATE_SIZE
/*
- * Reuse the space that was occupied in RAM by the little firmware (LFW) loader
- * with the section ".bss.slow" instead.
- */
-#undef CONFIG_REPLACE_LOADER_WITH_BSS_SLOW
-
-/*
* Read-only / read-write image configuration.
* Images may reside on storage (ex. external or internal SPI) at a different
* offset than when copied to program memory. Hence, two sets of offsets,