diff options
author | Albert Chaulk <achaulk@chromium.org> | 2013-04-02 13:20:52 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-06-24 15:44:41 -0700 |
commit | 92f22e7c2a1ca08034ac3ad21b2af60347c1c4fb (patch) | |
tree | c9a0e1fe9c558274a32b205434b2e80dd589139d /firmware | |
parent | 98624d37447d01a9a78d9e0a1f55cbbce2ee99e4 (diff) | |
download | vboot-92f22e7c2a1ca08034ac3ad21b2af60347c1c4fb.tar.gz |
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
TEST=MTD version of run_cgpt_tests.sh passes
BRANCH=none
Original-Change-Id: I2f52637d82962f4d805aa827c5c37685f10e76ea
Reviewed-on: https://gerrit.chromium.org/gerrit/47172
Tested-by: Albert Chaulk <achaulk@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
(cherry picked from commit 931544744ba410dad267064b87d504b0b4c24772)
Change-Id: If9364155fb2c030645adc6ee6f3fbe5373bcc153
Reviewed-on: https://gerrit.chromium.org/gerrit/49793
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
Reviewed-by: Albert Chaulk <achaulk@chromium.org>
Tested-by: Albert Chaulk <achaulk@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/lib/flash_ts.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/firmware/lib/flash_ts.c b/firmware/lib/flash_ts.c index 5e74460c..e5e461d9 100644 --- a/firmware/lib/flash_ts.c +++ b/firmware/lib/flash_ts.c @@ -21,7 +21,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) @@ -121,6 +121,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)); } @@ -344,7 +345,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; } |