forked from Imagelibrary/rtems
@@ -1,5 +1,5 @@
|
|||||||
/* @ingroup riscv_generic
|
/*
|
||||||
* @brief riscv_generic BSP Fatal_halt handler.
|
* Copyright (c) 2018 embedded brains GmbH
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 University of York.
|
* Copyright (c) 2015 University of York.
|
||||||
* Hesham Almatary <hesham@alumni.york.ac.uk>
|
* Hesham Almatary <hesham@alumni.york.ac.uk>
|
||||||
@@ -27,14 +27,27 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <bsp/riscv.h>
|
#include <bsp/riscv.h>
|
||||||
|
#include <bsp/fdt.h>
|
||||||
|
|
||||||
|
#include <libfdt.h>
|
||||||
|
|
||||||
void _CPU_Fatal_halt(uint32_t source, uint32_t error)
|
void _CPU_Fatal_halt(uint32_t source, uint32_t error)
|
||||||
{
|
{
|
||||||
|
const char *fdt;
|
||||||
|
int node;
|
||||||
|
volatile uintptr_t *sifive_test;
|
||||||
|
|
||||||
#if RISCV_ENABLE_HTIF_SUPPORT != 0
|
#if RISCV_ENABLE_HTIF_SUPPORT != 0
|
||||||
htif_poweroff();
|
htif_poweroff();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
fdt = bsp_fdt_get();
|
||||||
|
node = fdt_node_offset_by_compatible(fdt, -1, "sifive,test0");
|
||||||
|
sifive_test = riscv_fdt_get_address(fdt, node);
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
/* Do nothing */
|
if (sifive_test != NULL) {
|
||||||
|
*sifive_test = 0x5555;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user