arm-trusted-firmware/plat/arm/board/juno/juno_err.c
Manish V Badarkhe aa79421c16 refactor(plat/arm): use mmio* functions to read/write NVFLAGS registers
Used mmio* functions to read/write NVFLAGS registers to avoid
possibile reordering of instructions by compiler.

Change-Id: Iae50ac30e5413259cf8554f0fff47512ad83b0fd
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-07-06 16:32:38 +01:00

27 lines
587 B
C

/*
* Copyright (c) 2015-2021, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <errno.h>
#include <arch_helpers.h>
#include <drivers/arm/sp805.h>
#include <plat/arm/common/plat_arm.h>
#include <platform_def.h>
/*
* Juno error handler
*/
void __dead2 plat_arm_error_handler(int err)
{
/* Propagate the err code in the NV-flags register */
mmio_write_32(V2M_SYS_NVFLAGS_ADDR, (uint32_t)err);
/* Setup the watchdog to reset the system as soon as possible */
sp805_refresh(ARM_SP805_TWDG_BASE, 1U);
for (;;)
wfi();
}