summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/glados/board.h3
-rw-r--r--board/kunimitsu/board.h3
-rw-r--r--chip/mec1322/build.mk3
-rwxr-xr-xchip/mec1322/util/pack_ec.py14
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"))