aboutsummaryrefslogtreecommitdiff
path: root/plat/brcm/board/common/err.c
blob: 1fc73c4816829c156bc52f16abca8a282d74ed71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * Copyright (c) 2016 - 2020, Broadcom
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <stdint.h>

#include <arch_helpers.h>
#include <common/debug.h>
#include <drivers/console.h>
#include <lib/mmio.h>

#include <platform_def.h>

#define L0_RESET 0x2

/*
 * Brcm error handler
 */
void plat_error_handler(int err)
{
	INFO("L0 reset...\n");

	/* Ensure the characters are flushed out */
	console_flush();

	mmio_write_32(CRMU_SOFT_RESET_CTRL, L0_RESET);

	/*
	 * In case we get here:
	 * Loop until the watchdog resets the system
	 */
	while (1) {
		wfi();
	}
}