From 2c475fc39b8d61cb61eeb1fdfee677065214af82 Mon Sep 17 00:00:00 2001 From: Albert Chaulk Date: Tue, 2 Apr 2013 13:20:52 -0700 Subject: Bugfixes & MTD create command Fix some bugs in the cgpt implementation of the flash I/O functions & load logic, it was validating too much at load time. Implement the create command for MTD BUG=chromium:221745 BRANCH=cros/embedded TEST=MTD version of run_cgpt_tests.sh passes Change-Id: I2f52637d82962f4d805aa827c5c37685f10e76ea Reviewed-on: https://gerrit.chromium.org/gerrit/47172 Tested-by: Albert Chaulk Reviewed-by: Bill Richardson Reviewed-by: Randall Spangler Commit-Queue: Albert Chaulk --- firmware/lib/flash_ts.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'firmware/lib/flash_ts.c') diff --git a/firmware/lib/flash_ts.c b/firmware/lib/flash_ts.c index 5f041749..25a46c17 100644 --- a/firmware/lib/flash_ts.c +++ b/firmware/lib/flash_ts.c @@ -13,7 +13,7 @@ // These match the linux driver #define FLASH_TS_MAGIC 0x53542a46 -#define FLASH_TS_HEADER_SIZE 24 +#define FLASH_TS_HEADER_SIZE 16 #define FLASH_TS_MAX_SIZE 16384 #define FLASH_TS_MAX_ELEMENT_SIZE (FLASH_TS_MAX_SIZE - FLASH_TS_HEADER_SIZE) @@ -113,6 +113,7 @@ static void flash_ts_scan_partition(flash_ts_state *ts) { } // It's good & newer than our current version + VBDEBUG(("Found good version %d\n", ts->temp.version)); ts->current_block = block; Memcpy(&ts->current, &ts->temp, sizeof(ts->current)); } @@ -336,7 +337,7 @@ int flash_ts_set(const char *key, const char *value) { if (ts->length + keylen + 1 + value_len + 1 > FLASH_TS_MAX_ELEMENT_SIZE) { // Not enough space, restore previous - VBDEBUG(("Not enough space to write %d data bytes\n", value_len)); + VBDEBUG(("Not enough space to write %d data bytes\n", (int)value_len)); Memcpy(&state.current, &state.temp, sizeof(state.temp)); return -1; } -- cgit v1.2.1