From 9aee42f0f27ef121a156a0ae2730e747fc0040a9 Mon Sep 17 00:00:00 2001 From: occheung Date: Thu, 15 Jul 2021 15:41:36 +0800 Subject: [PATCH] rv32/boot: remove hotswap Signed-off-by: occheung --- .../libboard_misoc/riscv32imac/boot.rs | 32 +------------------ 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/artiq/firmware/libboard_misoc/riscv32imac/boot.rs b/artiq/firmware/libboard_misoc/riscv32imac/boot.rs index 19f7b6fa6..32e9cfbc3 100644 --- a/artiq/firmware/libboard_misoc/riscv32imac/boot.rs +++ b/artiq/firmware/libboard_misoc/riscv32imac/boot.rs @@ -1,7 +1,6 @@ -use super::{irq, cache}; +use super::cache; pub unsafe fn reset() -> ! { - irq::set_ie(false); llvm_asm!(r#" j _reset_handler nop @@ -10,7 +9,6 @@ pub unsafe fn reset() -> ! { } pub unsafe fn jump(addr: usize) -> ! { - irq::set_ie(false); cache::flush_cpu_icache(); llvm_asm!(r#" jalr x0, 0($0) @@ -18,31 +16,3 @@ pub unsafe fn jump(addr: usize) -> ! { "# : : "r"(addr) : : "volatile"); loop {} } - -pub unsafe fn hotswap(firmware: &[u8]) -> ! { - irq::set_ie(false); - llvm_asm!(r#" - # This loop overwrites itself, but it's structured in such a way - # that before that happens, it loads itself into I$$ fully. - lui a1, %hi(_reset_handler) - ori a1, a1, %lo(_reset_handler) - or a4, a1, zero - 0: bnez a2, 1f - nop - jr a4 - nop - 1: lw a3, 0(a0) - sw a3, 0(a1) - addi a0, a0, 4 - addi a1, a1, 4 - addi a2, a2, -4 - bnez a2, 0b - nop - "# - : - : "{a0}"(firmware.as_ptr() as usize), - "{a2}"(firmware.len()) - : - : "volatile"); - loop {} -}