glados: kunimitsu: Change image size to 100K.

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>
This commit is contained in:
Aseda Aboagye
2015-10-07 14:52:31 -07:00
committed by chrome-bot
parent 9ed620f04b
commit d42ee9ef36
4 changed files with 16 additions and 7 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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"))