commit | 46d6b412f55f0a6697199c7cf62929a8b4c997d9 | [log] [tgz] |
---|---|---|
author | Sylvain Munaut <tnt@246tNt.com> | Thu Oct 29 13:19:05 2020 +0100 |
committer | Sylvain Munaut <tnt@246tNt.com> | Thu Oct 29 13:19:05 2020 +0100 |
tree | 63221d01fec1bfbdf71436badcba1c185af058a2 | |
parent | 4ea7d27764affd317169a80c6cafe3b4df79bde3 [diff] [blame] |
firmware/ice40-riscv: Create a reboot() function instead of direct access to registers. Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Change-Id: Iaee092c5ef651f0350b3f46386ed79fdbe06afcb
diff --git a/firmware/ice40-riscv/icE1usb/misc.c b/firmware/ice40-riscv/icE1usb/misc.c index 4fdd2f5..dca126a 100644 --- a/firmware/ice40-riscv/icE1usb/misc.c +++ b/firmware/ice40-riscv/icE1usb/misc.c
@@ -56,3 +56,9 @@ { return misc_regs->e1_tick[0].tx; } + +void +reboot(int fw) +{ + misc_regs->warmboot = (1 << 2) | (fw << 0); +}