From d94db1de5dbf8b183c57ef3cdb93daf7b1b8a57d Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 28 Dec 2017 08:23:34 +0000 Subject: [PATCH] Revert accidentally committed parts of 1b9b5602. --- artiq/firmware/Cargo.lock | 31 ----------- artiq/firmware/Cargo.toml | 2 +- artiq/firmware/bootloader/Cargo.toml | 18 ------ artiq/firmware/bootloader/Makefile | 18 ------ artiq/firmware/bootloader/bootloader.ld | 46 ---------------- artiq/firmware/bootloader/build.rs | 6 -- artiq/firmware/bootloader/main.rs | 73 ------------------------- artiq/gateware/amp/soc.py | 1 - 8 files changed, 1 insertion(+), 194 deletions(-) delete mode 100644 artiq/firmware/bootloader/Cargo.toml delete mode 100644 artiq/firmware/bootloader/Makefile delete mode 100644 artiq/firmware/bootloader/bootloader.ld delete mode 100644 artiq/firmware/bootloader/build.rs delete mode 100644 artiq/firmware/bootloader/main.rs diff --git a/artiq/firmware/Cargo.lock b/artiq/firmware/Cargo.lock index dd4bf58f7..a60de7ea9 100644 --- a/artiq/firmware/Cargo.lock +++ b/artiq/firmware/Cargo.lock @@ -42,16 +42,6 @@ dependencies = [ "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "bootloader" -version = "0.0.0" -dependencies = [ - "board 0.0.0", - "build_artiq 0.0.0", - "crc 1.6.0 (git+git://github.com/whitequark/crc-rs?rev=51cd356)", - "rlibc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "build_artiq" version = "0.0.0" @@ -59,11 +49,6 @@ dependencies = [ "walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "build_const" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "build_misoc" version = "0.0.0" @@ -92,14 +77,6 @@ name = "compiler_builtins" version = "0.1.0" source = "git+https://github.com/m-labs/compiler-builtins?rev=97916b1#97916b17ca542eac0524b8570c7d05913891a0dc" -[[package]] -name = "crc" -version = "1.6.0" -source = "git+git://github.com/whitequark/crc-rs?rev=51cd356#51cd3560aa9d3823061f2bb46797d8c61f4cfa9e" -dependencies = [ - "build_const 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "cslice" version = "0.3.0" @@ -198,11 +175,6 @@ dependencies = [ "std_artiq 0.0.0", ] -[[package]] -name = "rlibc" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "runtime" version = "0.0.0" @@ -290,12 +262,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [metadata] "checksum bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c30d3802dfb7281680d6285f2ccdaa8c2d8fee41f93805dba5c4cf50dc23cf" -"checksum build_const 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e90dc84f5e62d2ebe7676b83c22d33b6db8bd27340fb6ffbff0a364efa0cb9c9" "checksum byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "652805b7e73fada9d85e9a6682a4abd490cb52d96aeecc12e33a0de34dfd0d23" "checksum cc 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a9b13a57efd6b30ecd6598ebdb302cca617930b5470647570468a65d12ef9719" "checksum compiler_builtins 0.1.0 (git+https://github.com/m-labs/compiler-builtins?rev=97916b1)" = "" "checksum compiler_builtins 0.1.0 (git+https://github.com/rust-lang-nursery/compiler-builtins?rev=631b568)" = "" -"checksum crc 1.6.0 (git+git://github.com/whitequark/crc-rs?rev=51cd356)" = "" "checksum cslice 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0f8cb7306107e4b10e64994de6d3274bd08996a7c1322a27b86482392f96be0a" "checksum fringe 1.1.0 (git+https://github.com/m-labs/libfringe?rev=bd23494)" = "" "checksum gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)" = "5e33ec290da0d127825013597dbdfc28bee4964690c7ce1166cbc2a7bd08b1bb" @@ -304,7 +274,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "880f77541efa6e5cc74e76910c9884d9859683118839d6a1dc3b11e63512565b" "checksum log_buffer 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ec57723b84bbe7bdf76aa93169c9b59e67473317c6de3a83cb2a0f8ccb2aa493" "checksum managed 0.4.0 (git+https://github.com/m-labs/rust-managed.git?rev=629a6786a1cf1692015f464ed16c04eafa5cb8d1)" = "" -"checksum rlibc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc874b127765f014d792f16763a81245ab80500e2ad921ed4ee9e82481ee08fe" "checksum rustc-cfg 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "56a596b5718bf5e059d59a30af12f7f462a152de147aa462b70892849ee18704" "checksum same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d931a44fdaa43b8637009e7632a02adc4f2b2e0733c08caa4cf00e8da4a117a7" "checksum smoltcp 0.4.0 (git+https://github.com/m-labs/smoltcp?rev=507d2fe)" = "" diff --git a/artiq/firmware/Cargo.toml b/artiq/firmware/Cargo.toml index 0f2007873..af13ba5ff 100644 --- a/artiq/firmware/Cargo.toml +++ b/artiq/firmware/Cargo.toml @@ -1,2 +1,2 @@ [workspace] -members = ["bootloader", "runtime", "ksupport", "satman"] +members = ["runtime", "ksupport", "satman"] diff --git a/artiq/firmware/bootloader/Cargo.toml b/artiq/firmware/bootloader/Cargo.toml deleted file mode 100644 index cbf8ccef7..000000000 --- a/artiq/firmware/bootloader/Cargo.toml +++ /dev/null @@ -1,18 +0,0 @@ -[package] -authors = ["M-Labs"] -name = "bootloader" -version = "0.0.0" -build = "build.rs" - -[lib] -name = "bootloader" -crate-type = ["staticlib"] -path = "main.rs" - -[build-dependencies] -build_artiq = { path = "../libbuild_artiq" } - -[dependencies] -rlibc = "1.0" -crc = { git = "git://github.com/whitequark/crc-rs", rev = "51cd356", default-features = false } -board = { path = "../libboard", features = ["uart_console"] } diff --git a/artiq/firmware/bootloader/Makefile b/artiq/firmware/bootloader/Makefile deleted file mode 100644 index f247c0994..000000000 --- a/artiq/firmware/bootloader/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -include ../include/generated/variables.mak -include $(MISOC_DIRECTORY)/software/common.mak - -RUSTFLAGS += -Cpanic=abort - -all:: bootloader.bin - -.PHONY: $(RUSTOUT)/libbootloader.a -$(RUSTOUT)/libbootloader.a: - $(cargo) --manifest-path $(BOOTLOADER_DIRECTORY)/Cargo.toml -- \ - -Clto - -bootloader.elf: $(RUSTOUT)/libbootloader.a - $(link) -T $(BOOTLOADER_DIRECTORY)/bootloader.ld - -%.bin: %.elf - $(objcopy) -O binary - $(MSCIMG) $@ diff --git a/artiq/firmware/bootloader/bootloader.ld b/artiq/firmware/bootloader/bootloader.ld deleted file mode 100644 index 8fe809a49..000000000 --- a/artiq/firmware/bootloader/bootloader.ld +++ /dev/null @@ -1,46 +0,0 @@ -INCLUDE generated/output_format.ld -INCLUDE generated/regions.ld -ENTRY(_reset_handler) - -SECTIONS -{ - .vectors : - { - _begin = .; - *(.vectors) - } > rom - - .text : - { - *(.text .text.*) - } > rom - - .rodata : - { - *(.rodata.*) - . = ALIGN(4); - _end = .; - } > rom - - .crc ALIGN(4) : - { - _crc = .; - . += 4; - } - - .bss ALIGN(4) : - { - _fbss = .; - *(.bss .bss.*) - . = ALIGN(4); - _ebss = .; - } > sram - - .stack : - { - /* Ensure we have a certain amount of space available for stack. */ - . = ORIGIN(sram) + LENGTH(sram) - 0x800; - . = ORIGIN(sram) + LENGTH(sram) - 4; - _fstack = .; - } > sram -} diff --git a/artiq/firmware/bootloader/build.rs b/artiq/firmware/bootloader/build.rs deleted file mode 100644 index 0a7d63df9..000000000 --- a/artiq/firmware/bootloader/build.rs +++ /dev/null @@ -1,6 +0,0 @@ -extern crate build_artiq; - -fn main() { - build_artiq::misoc_cfg(); - build_artiq::git_describe(); -} diff --git a/artiq/firmware/bootloader/main.rs b/artiq/firmware/bootloader/main.rs deleted file mode 100644 index ec9f54bbf..000000000 --- a/artiq/firmware/bootloader/main.rs +++ /dev/null @@ -1,73 +0,0 @@ -#![no_std] -#![feature(lang_items)] - -extern crate rlibc; -extern crate crc; -#[macro_use] -extern crate board; - -use core::slice; - -fn check_integrity() -> bool { - extern { - static _begin: u8; - static _end: u8; - static _crc: u32; - } - - unsafe { - let length = &_end as *const u8 as usize - - &_begin as *const u8 as usize; - let bios = slice::from_raw_parts(&_begin as *const u8, length); - crc::crc32::checksum_ieee(bios) == _crc - } -} - -fn initialize_sdram() -> bool { - unsafe { - board::sdram_phy::initialize(); - - true - } -} - -#[no_mangle] -pub extern fn main() -> i32 { - println!(""); - println!(r" _ ____ _____ ___ ___ "); - println!(r" / \ | _ \_ _|_ _/ _ \ "); - println!(r" / _ \ | |_) || | | | | | |"); - println!(r" / ___ \| _ < | | | | |_| |"); - println!(r"/_/ \_\_| \_\|_| |___\__\_\"); - println!(""); - println!("ARTIQ Bootloader"); - println!("Copyright (c) 2017 M-Labs Limited"); - println!("Version {}", include_str!(concat!(env!("OUT_DIR"), "/git-describe"))); - println!(""); - - if !check_integrity() { - panic!("Bootloader CRC failed"); - } else { - println!("Bootloader CRC passed"); - } - - if !initialize_sdram() { - panic!("SDRAM initialization failed") - } else { - println!("SDRAM initialized"); - } - - loop {} -} - -#[no_mangle] -pub extern fn exception(vect: u32, _regs: *const u32, pc: u32, ea: u32) { - panic!("exception {} at PC {:#08x}, EA {:#08x}", vect, pc, ea) -} - -#[no_mangle] -#[lang = "panic_fmt"] -pub extern fn panic_fmt(args: core::fmt::Arguments, file: &'static str, line: u32) -> ! { - println!("panic at {}:{}: {}", file, line, args); - loop {} -} diff --git a/artiq/gateware/amp/soc.py b/artiq/gateware/amp/soc.py index 16ab97396..d237822eb 100644 --- a/artiq/gateware/amp/soc.py +++ b/artiq/gateware/amp/soc.py @@ -48,7 +48,6 @@ def build_artiq_soc(soc, argdict): builder = Builder(soc, **argdict) builder.add_software_package("libm") builder.add_software_package("libunwind") - builder.add_software_package("bootloader", os.path.join(artiq_dir, "firmware", "bootloader")) builder.add_software_package("ksupport", os.path.join(artiq_dir, "firmware", "ksupport")) builder.add_software_package("runtime", os.path.join(artiq_dir, "firmware", "runtime")) try: