From a371b2552516ece785a77342407b09f147a6d40c Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 31 Dec 2017 09:21:28 +0000 Subject: [PATCH] bootloader: allow using without Ethernet. --- artiq/firmware/bootloader/main.rs | 9 +++++++-- artiq/gateware/targets/sayma_amc_drtio_satellite.py | 5 ++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/artiq/firmware/bootloader/main.rs b/artiq/firmware/bootloader/main.rs index 454cfd8c1..87cdfb67d 100644 --- a/artiq/firmware/bootloader/main.rs +++ b/artiq/firmware/bootloader/main.rs @@ -10,8 +10,9 @@ extern crate board; use core::{ptr, slice}; use crc::crc32; use byteorder::{ByteOrder, BigEndian}; -use smoltcp::wire::{EthernetAddress, IpAddress, IpCidr}; -use board::{boot, cache, clock, config, ethmac}; +use board::{boot, cache}; +#[cfg(has_ethmac)] +use board::{clock, config, ethmac}; use board::uart_console::Console; fn check_integrity() -> bool { @@ -139,7 +140,10 @@ fn flash_boot() { } } +#[cfg(has_ethmac)] fn network_boot() { + use smoltcp::wire::{EthernetAddress, IpAddress, IpCidr}; + println!("Initializing network..."); let eth_addr = match config::read_str("mac", |r| r.map(|s| s.parse())) { @@ -197,6 +201,7 @@ pub extern fn main() -> i32 { if startup() { println!(""); flash_boot(); + #[cfg(has_ethmac)] network_boot(); } else { println!("Halting."); diff --git a/artiq/gateware/targets/sayma_amc_drtio_satellite.py b/artiq/gateware/targets/sayma_amc_drtio_satellite.py index dc6d35ef5..6b83ceb8a 100755 --- a/artiq/gateware/targets/sayma_amc_drtio_satellite.py +++ b/artiq/gateware/targets/sayma_amc_drtio_satellite.py @@ -110,8 +110,11 @@ def main(): args = parser.parse_args() soc = Satellite(**soc_sdram_argdict(args)) + firmware_dir = os.path.join(artiq_dir, "firmware") builder = Builder(soc, **builder_argdict(args)) - builder.add_software_package("satman", os.path.join(artiq_dir, "firmware", "satman")) + builder.software_packages = [] + builder.add_software_package("bootloader", os.path.join(firmware_dir, "bootloader")) + builder.add_software_package("satman", os.path.join(firmware_dir, "satman")) builder.build()