From 0d83819a21f87b4200372319120644dd252096d8 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Wed, 12 Jul 2023 11:52:36 -0600 Subject: [PATCH] Pad binary file to total flash size Signed-off-by: Tim Crawford --- src/arch/8051/toolchain.mk | 2 +- src/ec/ite/ec.mk | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/arch/8051/toolchain.mk b/src/arch/8051/toolchain.mk index a9a0725..cc85748 100644 --- a/src/arch/8051/toolchain.mk +++ b/src/arch/8051/toolchain.mk @@ -33,7 +33,7 @@ sim: $(BUILD)/ec.rom $(BUILD)/ec.rom: $(BUILD)/ec.ihx @echo " OBJCOPY $(subst $(obj)/,,$@)" mkdir -p $(@D) - objcopy -I ihex -O binary --gap-fill=0xFF $< $@ + objcopy -I ihex -O binary --gap-fill=0xFF --pad-to=$(CONFIG_EC_FLASH_SIZE) $< $@ # Link object files into Intel Hex file $(BUILD)/ec.ihx: $(OBJ) diff --git a/src/ec/ite/ec.mk b/src/ec/ite/ec.mk index 64147f2..134a5f4 100644 --- a/src/ec/ite/ec.mk +++ b/src/ec/ite/ec.mk @@ -27,3 +27,6 @@ ARCH=8051 # 64 KB is the max without banking CODE_SIZE=65536 + +# Total flash size: 128 KiB +CONFIG_EC_FLASH_SIZE = 131072