diff options
author | Aseda Aboagye <aaboagye@google.com> | 2015-10-07 14:52:31 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-10-13 21:58:04 -0700 |
commit | d42ee9ef36fbdd54b5b18dc90215313d7f41a682 (patch) | |
tree | 91c59816c96b734d0342f8f86ac6b0b2e3e0c932 | |
parent | 9ed620f04bf7ba4593e45e2688194f56a796c984 (diff) | |
download | chrome-ec-d42ee9ef36fbdd54b5b18dc90215313d7f41a682.tar.gz |
glados: kunimitsu: Change image size to 100K.stabilize-smaug-7547.B
The MEC1322 is optimized for 96k code RAM and 32k data RAM, therefore
the default MEC1322 boards should follow this.
On GLaDOS and Kunimitsu, we cannot fit all of the data in data RAM,
therefore we adjust this boundary slightly.
This should not be moved further as this represents when we are truly
out of space.
128k image:
-3k loader
-1k for shmem/panic info
-24k RAM for RO/RW
-100k for RO/RW .text and .rodata
BUG=chrome-os-partner:46058
BUG=chrome-os-partner:46063
BUG=chrome-os-partner:45690
BRANCH=None
TEST=make -j buildall tests
TEST=Flash GLaDOS, verify AP and EC boot.
Change-Id: Ie53ef6dc607333968bee8f296e7c21ed629e357b
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/305362
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r-- | board/glados/board.h | 3 | ||||
-rw-r--r-- | board/kunimitsu/board.h | 3 | ||||
-rw-r--r-- | chip/mec1322/build.mk | 3 | ||||
-rwxr-xr-x | chip/mec1322/util/pack_ec.py | 14 |
4 files changed, 16 insertions, 7 deletions
diff --git a/board/glados/board.h b/board/glados/board.h index 01b17ab2ea..e3f44a3ccb 100644 --- a/board/glados/board.h +++ b/board/glados/board.h @@ -50,6 +50,9 @@ #define CONFIG_POWER_BUTTON #define CONFIG_POWER_BUTTON_X86 #define CONFIG_POWER_COMMON +/* All data won't fit in data RAM. So, moving boundary slightly. */ +#undef CONFIG_RO_SIZE +#define CONFIG_RO_SIZE (100 * 1024) #define CONFIG_SCI_GPIO GPIO_PCH_SCI_L #define CONFIG_USB_CHARGER #define CONFIG_USB_MUX_PI3USB30532 diff --git a/board/kunimitsu/board.h b/board/kunimitsu/board.h index f4436cbc82..cf43dc8b8a 100644 --- a/board/kunimitsu/board.h +++ b/board/kunimitsu/board.h @@ -73,6 +73,9 @@ #define CONFIG_POWER_BUTTON_X86 #define CONFIG_POWER_COMMON #define CONFIG_POWER_SHUTDOWN_PAUSE_IN_S5 +/* All data won't fit in data RAM. So, moving boundary slightly. */ +#undef CONFIG_RO_SIZE +#define CONFIG_RO_SIZE (100 * 1024) #define CONFIG_SCI_GPIO GPIO_PCH_SCI_L #define CONFIG_USB_CHARGER #define CONFIG_USB_MUX_PI3USB30532 diff --git a/chip/mec1322/build.mk b/chip/mec1322/build.mk index 587dbe3847..064fb4879c 100644 --- a/chip/mec1322/build.mk +++ b/chip/mec1322/build.mk @@ -36,7 +36,8 @@ cmd_obj_to_bin = $(OBJCOPY) --gap-fill=0xff -O binary $< $@.tmp1 ; \ --loader_file $(mec1322-lfw-flat) \ --payload_key ${SCRIPTDIR}/rsakey_sign_payload.pem \ --header_key ${SCRIPTDIR}/rsakey_sign_header.pem \ - --spi_size ${CHIP_SPI_SIZE_KB} ; rm -f $@.tmp1 + --spi_size ${CHIP_SPI_SIZE_KB} \ + --image_size $(_rw_size); rm -f $@.tmp1 mec1322-lfw = chip/mec1322/lfw/ec_lfw mec1322-lfw-flat = $(out)/RW/$(mec1322-lfw)-lfw.flat diff --git a/chip/mec1322/util/pack_ec.py b/chip/mec1322/util/pack_ec.py index c306e34e5c..236d364b2c 100755 --- a/chip/mec1322/util/pack_ec.py +++ b/chip/mec1322/util/pack_ec.py @@ -18,7 +18,6 @@ LOAD_ADDR = 0x100000 HEADER_SIZE = 0x140 SPI_CLOCK_LIST = [48, 24, 12, 8] SPI_READ_CMD_LIST = [0x3, 0xb, 0x3b] -IMAGE_SIZE = 97 * 1024 CRC_TABLE = [0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15, 0x38, 0x3f, 0x36, 0x31, 0x24, 0x23, 0x2a, 0x2d] @@ -133,11 +132,11 @@ def BuildTag(args): tag.append(Crc8(0, tag)) return tag -def PacklfwRoImage(rorw_file, loader_file): +def PacklfwRoImage(rorw_file, loader_file, image_size): """TODO:Clean up to get rid of Temp file and just use memory to save data""" """Create a temp file with the - first IMAGE_SIZE bytes from the rorw file and the + first image_size bytes from the rorw file and the bytes from the loader_file appended return the filename""" fo=tempfile.NamedTemporaryFile(delete=False) # Need to keep file around @@ -145,7 +144,7 @@ def PacklfwRoImage(rorw_file, loader_file): pro = fin1.read() fo.write(pro) with open(rorw_file, 'rb') as fin: - ro = fin.read(IMAGE_SIZE) + ro = fin.read(image_size) fo.write(ro) fo.close() return fo.name @@ -191,6 +190,9 @@ def parseargs(): parser.add_argument("--spi_read_cmd", type=int, help="SPI read command. 0x3, 0xB, or 0x3B.", default=0xb) + parser.add_argument("--image_size", type=int, + help="Size of a single image.", + default=(96 * 1024)) return parser.parse_args() # Debug helper routine @@ -208,7 +210,7 @@ def main(): spi_list = [] - rorofile=PacklfwRoImage(args.input, args.loader_file) + rorofile=PacklfwRoImage(args.input, args.loader_file, args.image_size) payload = GetPayload(rorofile) payload_len = len(payload) #print payload_len @@ -217,7 +219,7 @@ def main(): header_signature = SignByteArray(header, args.header_key) tag = BuildTag(args) # truncate the RW to 128k - payloadrw = GetPayloadFromOffset(args.input,IMAGE_SIZE)[:128*1024] + payloadrw = GetPayloadFromOffset(args.input,args.image_size)[:128*1024] os.remove(rorofile) # clean up the temp file spi_list.append((args.header_loc, header, "header")) |