From 9dc82bd7668adfc1f9e1ff29cc26f8fadaed6f09 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 5 Nov 2019 15:31:08 +0800 Subject: [PATCH] bootloader: add no_flash_boot config option to force network boot --- artiq/firmware/bootloader/main.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/artiq/firmware/bootloader/main.rs b/artiq/firmware/bootloader/main.rs index 59a29aa99..3d2ae4fbd 100644 --- a/artiq/firmware/bootloader/main.rs +++ b/artiq/firmware/bootloader/main.rs @@ -14,7 +14,7 @@ use board_misoc::{ident, cache, sdram, boot, mem as board_mem}; #[cfg(has_slave_fpga_cfg)] use board_misoc::slave_fpga; #[cfg(has_ethmac)] -use board_misoc::{clock, ethmac, net_settings}; +use board_misoc::{clock, ethmac, config, net_settings}; use board_misoc::uart_console::Console; fn check_integrity() -> bool { @@ -420,9 +420,13 @@ pub extern fn main() -> i32 { if startup() { println!(""); - #[cfg(has_slave_fpga_cfg)] - load_slave_fpga(); - flash_boot(); + if !config::read_str("no_flash_boot", |r| r == Ok("1")) { + #[cfg(has_slave_fpga_cfg)] + load_slave_fpga(); + flash_boot(); + } else { + println!("Flash booting has been disabled."); + } #[cfg(has_ethmac)] network_boot(); } else {