From 5111132ef0a3c357bbdbdae16bf5298f66cea44d Mon Sep 17 00:00:00 2001 From: Star Chen Date: Fri, 6 Aug 2021 15:08:30 +0800 Subject: [PATCH] ICAP: prevent sayma from using it (#1740) --- artiq/firmware/libboard_misoc/spiflash.rs | 1 + artiq/firmware/runtime/main.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/artiq/firmware/libboard_misoc/spiflash.rs b/artiq/firmware/libboard_misoc/spiflash.rs index 7b1244775..9b5ca31f5 100644 --- a/artiq/firmware/libboard_misoc/spiflash.rs +++ b/artiq/firmware/libboard_misoc/spiflash.rs @@ -114,6 +114,7 @@ pub unsafe fn write(mut addr: usize, mut data: &[u8]) { } } +#[cfg(any(soc_platform = "kasli", soc_platform = "metlino", soc_platform = "kc705"))] pub unsafe fn reload () -> ! { csr::icap::iprog_write(1); loop {} diff --git a/artiq/firmware/runtime/main.rs b/artiq/firmware/runtime/main.rs index df103d7ef..e57e34f7a 100644 --- a/artiq/firmware/runtime/main.rs +++ b/artiq/firmware/runtime/main.rs @@ -332,7 +332,8 @@ pub fn panic_impl(info: &core::panic::PanicInfo) -> ! { println!("{:#08x}", ip - 2 * 4); }); - if config::read_str("panic_reset", |r| r == Ok("1")) && cfg!(has_spiflash) { + if config::read_str("panic_reset", |r| r == Ok("1")) && + cfg!(any(soc_platform = "kasli", soc_platform = "metlino", soc_platform = "kc705")) { println!("restarting..."); unsafe { kernel::stop();