summaryrefslogtreecommitdiff
path: root/board/zinger/runtime.c
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2014-05-13 13:02:26 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-05-17 20:14:23 +0000
commit5fd33410770fbc9b29432fe6ca81a763e6b47ec4 (patch)
treeed81c35caa3cf5f5dd39f9c5eb245dbbd8b9c8d6 /board/zinger/runtime.c
parent00cf95783210c5b94565b0e0d480271dcef490ca (diff)
downloadchrome-ec-5fd33410770fbc9b29432fe6ca81a763e6b47ec4.tar.gz
zinger: add support to flash RW firmware
Allow flashing the RW firmware by sending Vendor-Defined Messages over the USB-PD link. This is not the secure update whose design is still under discussion, it's a simple update with integrity check. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=chrome-os-partner:28330 TEST=using the following CLs, ./util/flash_pd.py ./build/zinger/ec.RW.flat and see Zinger booting on RW, repeat the operations with different builds of the RW firmware. Change-Id: Icd90eb92f7321ccd66341a50b9dabd73c59c68c1 Reviewed-on: https://chromium-review.googlesource.com/197948 Reviewed-by: Alec Berg <alecaberg@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/zinger/runtime.c')
-rw-r--r--board/zinger/runtime.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/board/zinger/runtime.c b/board/zinger/runtime.c
index 9393c8fe50..0598bd93fd 100644
--- a/board/zinger/runtime.c
+++ b/board/zinger/runtime.c
@@ -91,6 +91,17 @@ uint32_t task_wait_event(int timeout_us)
return evt;
}
+void cpu_reset(void)
+{
+ /* Disable interrupts */
+ asm volatile("cpsid i");
+ /* reboot the CPU */
+ CPU_NVIC_APINT = 0x05fa0004;
+ /* Spin and wait for reboot; should never return */
+ while (1)
+ ;
+}
+
/* --- stubs --- */
void __hw_timer_enable_clock(int n, int enable)
{ /* Done in hardware init */ }