summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-10-17 17:46:50 -0700
committerRandall Spangler <rspangler@chromium.org>2012-10-17 17:55:36 -0700
commit3a9b255d070d9401a7a108449aa4522936c48f62 (patch)
tree1dba2624eed4fedd144b88c988332b438ab26a66
parent90a18599bb3ee0b0f49617a950805eb6bb77dd3f (diff)
downloadchrome-ec-3a9b255d070d9401a7a108449aa4522936c48f62.tar.gz
link: host command params must be 32-bit aligned
This fixes a problem where flash writes would fail because the source buffer was not 32-bit aligned. BUG=chrome-os-partner:15435 BRANCH=link TEST=from a root shell, localhost ~ # echo 1234567812345678123456781234567 > /tmp/data localhost ~ # ls -l /tmp/data -rw-r--r-- 1 root root 32 Oct 17 17:28 /tmp/data localhost ~ # ectool flasherase 0x3a000 0x4000 Erasing 16384 bytes at offset 237568... done. localhost ~ # ectool flashwrite 0x3a000 /tmp/data Reading 32 bytes from /tmp/data... Writing to offset 237568... done. If that doesn't crash, the fix works (prior to this fix, that would reboot the system). Change-Id: I8d197e7ef7a1c74825916bd788f7d450088a55cc Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35916 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
-rw-r--r--chip/lm4/lpc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/chip/lm4/lpc.c b/chip/lm4/lpc.c
index 2d61336653..c22b967661 100644
--- a/chip/lm4/lpc.c
+++ b/chip/lm4/lpc.c
@@ -35,7 +35,8 @@ static uint8_t acpi_mem_test; /* Test byte in ACPI memory space */
static uint32_t host_events; /* Currently pending SCI/SMI events */
static uint32_t event_mask[3]; /* Event masks for each type */
static struct host_cmd_handler_args host_cmd_args;
-static uint8_t params_copy[EC_HOST_PARAM_SIZE];
+/* Params must be 32-bit aligned */
+static uint8_t params_copy[EC_HOST_PARAM_SIZE] __attribute__((aligned(4)));
static int init_done;
static uint8_t * const cmd_params = (uint8_t *)LPC_POOL_CMD_DATA +