*
* Authors:
* Anup Patel <anup.patel@wdc.com>
+ * Nick Kossifidis <mick@ics.forth.gr>
*/
#include <sbi/riscv_encoding.h>
+#include <sbi/riscv_io.h>
#include <sbi/sbi_const.h>
#include <sbi/sbi_hart.h>
#include <sbi/sbi_platform.h>
#define VIRT_HART_STACK_SIZE 8192
#define VIRT_TEST_ADDR 0x100000
+#define VIRT_TEST_FINISHER_FAIL 0x3333
+#define VIRT_TEST_FINISHER_PASS 0x5555
#define VIRT_CLINT_ADDR 0x2000000
static int virt_system_down(u32 type)
{
- /* For now nothing to do. */
+ /* Tell the "finisher" that the simulation
+ * was successful so that QEMU exits
+ */
+ writew(VIRT_TEST_FINISHER_PASS, (void *)VIRT_TEST_ADDR);
+
return 0;
}