From 535bbbb7749d846d48d17f4f9f6d12701e489d2f Mon Sep 17 00:00:00 2001 From: Vic Yang Date: Fri, 9 Jan 2015 11:11:00 -0800 Subject: [PATCH] mec1322: Specify SPI flash size in KB For boards without a shared SPI, it's reasonable to use a SPI flash smaller than 1MB. Change the script to allow this. BRANCH=None BUG=chrome-os-partner:35308 TEST=Build strago and check the size of ec.spi.bin. Change-Id: Iabf7065d158be5f82c55e182e430858a12b18b6e Signed-off-by: Vic Yang Reviewed-on: https://chromium-review.googlesource.com/241111 Tested-by: Vic Yang Reviewed-by: Randall Spangler Commit-Queue: Vic Yang --- board/strago/build.mk | 2 +- chip/mec1322/build.mk | 2 +- chip/mec1322/util/pack_ec.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/board/strago/build.mk b/board/strago/build.mk index 4a0bc00f08..d6559b43c9 100644 --- a/board/strago/build.mk +++ b/board/strago/build.mk @@ -8,7 +8,7 @@ # the IC is SMSC MEC1322 / external SPI is 4MB / external clock is crystal CHIP:=mec1322 -CHIP_SPI_SIZE_MB:=4 +CHIP_SPI_SIZE_KB:=4096 board-y=board.o # As this file is read more than once, must put the rules diff --git a/chip/mec1322/build.mk b/chip/mec1322/build.mk index 0c6284c420..abd69b227d 100644 --- a/chip/mec1322/build.mk +++ b/chip/mec1322/build.mk @@ -30,4 +30,4 @@ SCRIPTDIR:=./chip/${CHIP}/util cmd_pack_package = ${SCRIPTDIR}/pack_ec.py -o $@ -i $^ \ --payload_key ${SCRIPTDIR}/rsakey_sign_payload.pem \ --header_key ${SCRIPTDIR}/rsakey_sign_header.pem \ - --spi_size ${CHIP_SPI_SIZE_MB} + --spi_size ${CHIP_SPI_SIZE_KB} diff --git a/chip/mec1322/util/pack_ec.py b/chip/mec1322/util/pack_ec.py index 46aebe5564..360b7a5914 100755 --- a/chip/mec1322/util/pack_ec.py +++ b/chip/mec1322/util/pack_ec.py @@ -143,8 +143,8 @@ def main(): help="PEM key file for signing payload", default="rsakey_sign_payload.pem") parser.add_argument("-s", "--spi_size", type=int, - help="Size of the SPI flash in MB", - default=4) + help="Size of the SPI flash in KB", + default=4096) parser.add_argument("-l", "--header_loc", type=int, help="Location of header in SPI flash", default=0x170000) @@ -162,7 +162,7 @@ def main(): default=0xb) args = parser.parse_args() - spi_size = args.spi_size * 1024 * 1024 + spi_size = args.spi_size * 1024 spi_list = [] payload = GetPayload(args.input)