2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 11:18:27 +08:00

bootloader: allow using without Ethernet.

This commit is contained in:
whitequark 2017-12-31 09:21:28 +00:00
parent 70ebe431fd
commit a371b25525
2 changed files with 11 additions and 3 deletions

View File

@ -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.");

View File

@ -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()