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 <vpalatin@chromium.org>

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 <vpalatin@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Vincent Palatin
2014-12-01 14:23:55 -08:00
committed by chrome-internal-fetch
parent cd96fddf3f
commit 2777252a20

View File

@@ -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)