diff options
author | Jes B. Klinke <jbk@chromium.org> | 2023-01-24 14:38:39 -0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-01-25 20:38:23 +0000 |
commit | f37804a6bdb895e60c484902a91aae79e64f2e25 (patch) | |
tree | 6615ad08a54e9c1f123f870434f80d7d3373f19b | |
parent | 18f8cc0d6976fe6a367fb872b848f2d311e6a4ac (diff) | |
download | chrome-ec-f37804a6bdb895e60c484902a91aae79e64f2e25.tar.gz |
common: Allow boards to opt out of image padding
The HyperDebug board uses the DFU bootloader in the same way as Servo V4
is going to, meaning that the RO section is 4kB and the RW section takes
up the rest of the 512kB flash space. Currently, less than 64kB of
actual code is in the RW.
In order to make image files smaller, and speed up DFU flashing by a
factor of ten, I want the option of not having the ec.bin image padded
to the size of the flash space. This CL introduces a
CONFIG_IMAGE_PADDING, which defaults to being enabled.
TEST=make BOARD=hyperdebug, then flash the smaller image using DFU
BUG=b:192262089
Change-Id: I12cdd4f7b7a3e48c9c7640bafa2d6f10e4ca24f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4193070
Commit-Queue: Jes Klinke <jbk@chromium.org>
Tested-by: Jes Klinke <jbk@chromium.org>
Reviewed-by: Wai-Hong Tam <waihong@google.com>
-rw-r--r-- | common/firmware_image.lds.S | 2 | ||||
-rw-r--r-- | include/config.h | 3 | ||||
-rw-r--r-- | util/config_allowed.txt | 1 |
3 files changed, 6 insertions, 0 deletions
diff --git a/common/firmware_image.lds.S b/common/firmware_image.lds.S index 5bcd6efb5f..e62818eebb 100644 --- a/common/firmware_image.lds.S +++ b/common/firmware_image.lds.S @@ -126,9 +126,11 @@ SECTIONS } > FLASH =0xff #endif #endif +#ifdef CONFIG_IMAGE_PADDING .padding : AT(IMAGE_PADDING_AT) { BYTE(0xff); } > FLASH =0xff +#endif #ifdef CONFIG_IPI /* The section holds address of IPI buffer but no symbols. */ diff --git a/include/config.h b/include/config.h index ee9b354835..a448cf0147 100644 --- a/include/config.h +++ b/include/config.h @@ -2097,6 +2097,9 @@ /* Base address of program memory (physical address of AP) */ #undef CONFIG_PROGRAM_MEMORY_BASE_LOAD +/* ec.bin image will be padded to match flash size. */ +#define CONFIG_IMAGE_PADDING + /* * EC code can reside on internal or external storage. Only one of these * CONFIGs should be defined. CONFIG_INTERNAL_STORAGE implies XIP diff --git a/util/config_allowed.txt b/util/config_allowed.txt index 116b81f653..160e208c21 100644 --- a/util/config_allowed.txt +++ b/util/config_allowed.txt @@ -500,6 +500,7 @@ CONFIG_I2C_SCL_GATE_PORT CONFIG_I2C_UPDATE_IF_CHANGED CONFIG_I2C_XFER_BOARD_CALLBACK CONFIG_I2C_XFER_LARGE_TRANSFER +CONFIG_IMAGE_PADDING CONFIG_INA231 CONFIG_INA3221 CONFIG_INDUCTIVE_CHARGING |