From 2777252a2093fa91a4f905314b288ac970d6076c Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Mon, 1 Dec 2014 14:23:55 -0800 Subject: [PATCH] g: add core reset Until we implement a proper reset of the microcontroller, add a reset of the Cortex-M3 CPU core in system_reset() in order to avoid getting stuck in a weird loop if we get a panic. Signed-off-by: Vincent Palatin BRANCH=none BUG=none TEST=trigger a data abort and verify we are not going into a panic loop. Change-Id: Ie046379e6a9469bd683fa774cdc9abb10a14e8f1 Reviewed-on: https://chromium-review.googlesource.com/233109 Tested-by: Vincent Palatin Reviewed-by: Bill Richardson Commit-Queue: Vincent Palatin --- chip/g/system.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/chip/g/system.c b/chip/g/system.c index b2d12325f5..342998b6ce 100644 --- a/chip/g/system.c +++ b/chip/g/system.c @@ -3,6 +3,7 @@ * found in the LICENSE file. */ +#include "cpu.h" #include "system.h" #include "registers.h" @@ -14,7 +15,11 @@ void system_pre_init(void) /* TODO(crosbug.com/p/33818): How do we force a reset? */ void system_reset(int flags) { - + /* Until we have a full microcontroller, at least reset the CPU core */ + CPU_NVIC_APINT = 0x05fa0004; + /* should be gone here */ + while (1) + ; } const char *system_get_chip_vendor(void)