[arch][riscv][sbi] add the pmu extension, tweak boot messages, qemu-virt use reset calls

This commit is contained in:
Travis Geiselbrecht
2022-05-29 14:48:04 -07:00
parent b3dd72ab1d
commit 095aca80f1
4 changed files with 68 additions and 21 deletions

View File

@@ -220,10 +220,17 @@ void platform_halt(platform_halt_action suggested_action,
switch (suggested_action) {
case HALT_ACTION_SHUTDOWN:
dprintf(ALWAYS, "Shutting down... (reason = %d)\n", reason);
#if RISCV_S_MODE
// try to use SBI as a cleaner way to stop
sbi_system_reset(SBI_RESET_TYPE_SHUTDOWN, SBI_RESET_REASON_NONE);
#endif
*power_reset_reg = 0x5555;
break;
case HALT_ACTION_REBOOT:
dprintf(ALWAYS, "Rebooting... (reason = %d)\n", reason);
#if RISCV_S_MODE
sbi_system_reset(SBI_RESET_TYPE_COLD_REBOOT, SBI_RESET_REASON_NONE);
#endif
*power_reset_reg = 0x7777;
break;
case HALT_ACTION_HALT: