mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
Merge pull request #796 from betrusted-io/out-of-tree
Out of tree build support
This commit is contained in:
commit
829a793d21
14 changed files with 285 additions and 350 deletions
111
Cargo.lock
generated
111
Cargo.lock
generated
|
|
@ -357,7 +357,7 @@ version = "0.1.0"
|
|||
dependencies = [
|
||||
"aes",
|
||||
"arbitrary-int",
|
||||
"bao1x-api",
|
||||
"bao1x-api 0.1.0",
|
||||
"bao1x-emu",
|
||||
"bao1x-hal",
|
||||
"bao1x-hal-service",
|
||||
|
|
@ -390,7 +390,7 @@ dependencies = [
|
|||
name = "bao-video"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bao1x-api",
|
||||
"bao1x-api 0.1.0",
|
||||
"bao1x-emu",
|
||||
"bao1x-hal",
|
||||
"bao1x-hal-service",
|
||||
|
|
@ -430,11 +430,26 @@ dependencies = [
|
|||
"xous-ipc 0.10.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bao1x-api"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a1d0db1ac203881cde1947add52dd318d5f9c3fe90b9ebe7e255bca19c884b8a"
|
||||
dependencies = [
|
||||
"arbitrary-int",
|
||||
"bitbybit",
|
||||
"bytemuck",
|
||||
"num-derive 0.4.2",
|
||||
"num-traits",
|
||||
"num_enum 0.5.11",
|
||||
"xous 0.9.70 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bao1x-boot0"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bao1x-api",
|
||||
"bao1x-api 0.1.0",
|
||||
"bao1x-hal",
|
||||
"critical-section",
|
||||
"digest 0.10.7",
|
||||
|
|
@ -451,7 +466,7 @@ dependencies = [
|
|||
name = "bao1x-boot1"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bao1x-api",
|
||||
"bao1x-api 0.1.0",
|
||||
"bao1x-hal",
|
||||
"base64 0.22.1",
|
||||
"critical-section",
|
||||
|
|
@ -473,7 +488,7 @@ dependencies = [
|
|||
name = "bao1x-emu"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bao1x-api",
|
||||
"bao1x-api 0.1.0",
|
||||
"log",
|
||||
"minifb",
|
||||
"num-derive 0.4.2",
|
||||
|
|
@ -495,7 +510,7 @@ name = "bao1x-hal"
|
|||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"arbitrary-int",
|
||||
"bao1x-api",
|
||||
"bao1x-api 0.1.0",
|
||||
"bitbybit",
|
||||
"bitfield",
|
||||
"bitflags 1.3.2",
|
||||
|
|
@ -525,7 +540,7 @@ name = "bao1x-hal-service"
|
|||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"arbitrary-int",
|
||||
"bao1x-api",
|
||||
"bao1x-api 0.1.0",
|
||||
"bao1x-hal",
|
||||
"bio-lib",
|
||||
"bitbybit",
|
||||
|
|
@ -591,7 +606,7 @@ dependencies = [
|
|||
name = "baremetal"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bao1x-api",
|
||||
"bao1x-api 0.1.0",
|
||||
"bao1x-hal",
|
||||
"base64 0.22.1",
|
||||
"critical-section",
|
||||
|
|
@ -699,7 +714,7 @@ name = "bio-lib"
|
|||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"arbitrary-int",
|
||||
"bao1x-api",
|
||||
"bao1x-api 0.1.0",
|
||||
"bao1x-hal",
|
||||
"bitbybit",
|
||||
"log",
|
||||
|
|
@ -1694,7 +1709,7 @@ version = "0.1.0"
|
|||
dependencies = [
|
||||
"aes",
|
||||
"arbitrary-int",
|
||||
"bao1x-api",
|
||||
"bao1x-api 0.1.0",
|
||||
"bao1x-emu",
|
||||
"bao1x-hal",
|
||||
"bao1x-hal-service",
|
||||
|
|
@ -3374,7 +3389,7 @@ dependencies = [
|
|||
"aes",
|
||||
"aes-gcm-siv",
|
||||
"aes-kw",
|
||||
"bao1x-api",
|
||||
"bao1x-api 0.1.0",
|
||||
"bao1x-emu",
|
||||
"bao1x-hal",
|
||||
"bao1x-hal-service",
|
||||
|
|
@ -3572,7 +3587,7 @@ dependencies = [
|
|||
"aes-gcm-siv",
|
||||
"armv7",
|
||||
"atsama5d27",
|
||||
"bao1x-api",
|
||||
"bao1x-api 0.1.0",
|
||||
"bao1x-hal",
|
||||
"com_rs 0.1.0 (git+https://github.com/betrusted-io/com_rs?branch=main)",
|
||||
"crc 1.8.1",
|
||||
|
|
@ -3769,7 +3784,7 @@ dependencies = [
|
|||
name = "modals"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bao1x-api",
|
||||
"bao1x-api 0.1.0",
|
||||
"bao1x-emu",
|
||||
"bao1x-hal-service",
|
||||
"bit_field",
|
||||
|
|
@ -5558,7 +5573,7 @@ dependencies = [
|
|||
name = "sha2-bao1x"
|
||||
version = "0.10.9"
|
||||
dependencies = [
|
||||
"bao1x-api",
|
||||
"bao1x-api 0.1.0",
|
||||
"digest 0.10.7",
|
||||
"utralib 0.1.27",
|
||||
]
|
||||
|
|
@ -6275,34 +6290,6 @@ dependencies = [
|
|||
"winnow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tools"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"aes-gcm-siv",
|
||||
"bao1x-api",
|
||||
"base64 0.20.0",
|
||||
"bitflags 1.3.2",
|
||||
"byteorder",
|
||||
"clap 2.34.0",
|
||||
"crc 1.8.1",
|
||||
"csv",
|
||||
"ed25519-dalek",
|
||||
"env_logger 0.7.1",
|
||||
"hex-literal 1.0.0",
|
||||
"log",
|
||||
"pem",
|
||||
"pkcs8 0.8.0",
|
||||
"rand 0.8.5",
|
||||
"ring",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2",
|
||||
"svd2utra 0.1.25",
|
||||
"xmas-elf",
|
||||
"xous-semver",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tracing"
|
||||
version = "0.1.40"
|
||||
|
|
@ -6552,7 +6539,7 @@ dependencies = [
|
|||
name = "usb-bao1x"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bao1x-api",
|
||||
"bao1x-api 0.1.0",
|
||||
"bao1x-emu",
|
||||
"bao1x-hal",
|
||||
"bao1x-hal-service",
|
||||
|
|
@ -6882,7 +6869,7 @@ version = "0.1.0"
|
|||
dependencies = [
|
||||
"arrayref",
|
||||
"backup-vault2",
|
||||
"bao1x-api",
|
||||
"bao1x-api 0.1.0",
|
||||
"bao1x-emu",
|
||||
"bao1x-hal",
|
||||
"bao1x-hal-service",
|
||||
|
|
@ -7619,7 +7606,7 @@ name = "xous-kernel"
|
|||
version = "0.9.38"
|
||||
dependencies = [
|
||||
"armv7",
|
||||
"bao1x-api",
|
||||
"bao1x-api 0.1.0",
|
||||
"bao1x-hal",
|
||||
"bitflags 1.3.2",
|
||||
"critical-section",
|
||||
|
|
@ -7720,7 +7707,7 @@ version = "0.1.0"
|
|||
dependencies = [
|
||||
"aes",
|
||||
"aes-gcm-siv",
|
||||
"bao1x-api",
|
||||
"bao1x-api 0.1.0",
|
||||
"bao1x-hal",
|
||||
"loader",
|
||||
"log",
|
||||
|
|
@ -7738,7 +7725,7 @@ dependencies = [
|
|||
name = "xous-ticktimer"
|
||||
version = "0.1.32"
|
||||
dependencies = [
|
||||
"bao1x-api",
|
||||
"bao1x-api 0.1.0",
|
||||
"loader",
|
||||
"log",
|
||||
"num-derive 0.4.2",
|
||||
|
|
@ -7755,6 +7742,34 @@ dependencies = [
|
|||
"xous-semver",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "xous-tools"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"aes-gcm-siv",
|
||||
"bao1x-api 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"base64 0.20.0",
|
||||
"bitflags 1.3.2",
|
||||
"byteorder",
|
||||
"clap 2.34.0",
|
||||
"crc 1.8.1",
|
||||
"csv",
|
||||
"ed25519-dalek",
|
||||
"env_logger 0.7.1",
|
||||
"hex-literal 1.0.0",
|
||||
"log",
|
||||
"pem",
|
||||
"pkcs8 0.8.0",
|
||||
"rand 0.8.5",
|
||||
"ring",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2",
|
||||
"svd2utra 0.1.25",
|
||||
"xmas-elf",
|
||||
"xous-semver",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "xous-tts-backend"
|
||||
version = "0.1.6"
|
||||
|
|
@ -7789,7 +7804,7 @@ name = "xtask"
|
|||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"atty",
|
||||
"bao1x-api",
|
||||
"bao1x-api 0.1.0",
|
||||
"chrono",
|
||||
"filetime",
|
||||
"lazy_static",
|
||||
|
|
|
|||
|
|
@ -2,6 +2,13 @@
|
|||
name = "bao1x-api"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
description = "Baochip-1x API Crate"
|
||||
license = "Apache-2.0"
|
||||
|
||||
# Maintainer's note: changes to things like the size of the signature field or
|
||||
# offsets in memory will require a version bump and publish to crates.io, so that
|
||||
# it can be picked up by the xous-tools package, which is also published to
|
||||
# crates.io.
|
||||
|
||||
[dependencies]
|
||||
xous = "0.9.70"
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ pub fn keystore(sid: SID) -> ! {
|
|||
if store.is_collateral_erased() {
|
||||
log::info!("{}COLLATERAL.ERASED,{}", BOOKEND_START, BOOKEND_END);
|
||||
} else {
|
||||
panic!("Collateral is not erased - protocol error for Baochip firmwares!");
|
||||
log::error!("Collateral is not erased - protocol error for Baochip firmwares!");
|
||||
log::info!("{}COLLATERAL.FAIL,{}", BOOKEND_START, BOOKEND_END);
|
||||
}
|
||||
|
||||
let mut msg_opt = None;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
[package]
|
||||
authors = ["Sean Cross <sean@xobs.io>"]
|
||||
default-run = "create-image"
|
||||
authors = ["Sean Cross <sean@xobs.io>", "bunnie <bunnie@baochip.com>"]
|
||||
default-run = "xous-app-uf2"
|
||||
edition = "2018"
|
||||
name = "tools"
|
||||
name = "xous-tools"
|
||||
version = "0.1.0"
|
||||
description = "A set of tools for managing Xous ecosystem binaries"
|
||||
license = "Apache-2.0"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
|
|
@ -26,32 +28,37 @@ pkcs8 = { version = "0.8.0", features = ["pem"] }
|
|||
base64 = "0.20.0"
|
||||
rand = "0.8.5"
|
||||
aes-gcm-siv = "0.11.1"
|
||||
bao1x-api = { path = "../libs/bao1x-api" }
|
||||
hex-literal = "1.0.0"
|
||||
byteorder = "1.2"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
|
||||
[[bin]]
|
||||
name = "copy-object"
|
||||
# Maintainer's note: bao1x-api has to be bumped anytime parameters such as the
|
||||
# size of the signature block or offsets in RRAM are changed, so that it can be
|
||||
# absorbed into this package.
|
||||
# bao1x-api = { path = "../libs/bao1x-api" }
|
||||
bao1x-api = "0.1.0" # use crates.io to refer to this
|
||||
|
||||
[[bin]]
|
||||
name = "create-image"
|
||||
name = "xous-copy-object"
|
||||
|
||||
[[bin]]
|
||||
name = "make-renode-boot"
|
||||
name = "xous-create-image"
|
||||
|
||||
[[bin]]
|
||||
name = "make-tags"
|
||||
name = "xous-make-tags"
|
||||
|
||||
[[bin]]
|
||||
name = "read-tags"
|
||||
name = "xous-read-tags"
|
||||
|
||||
[[bin]]
|
||||
name = "sign-image"
|
||||
name = "xous-sign-image"
|
||||
|
||||
[[bin]]
|
||||
name = "create-detached-app"
|
||||
name = "xous-create-detached-app"
|
||||
|
||||
[[bin]]
|
||||
name = "xous-app-uf2"
|
||||
|
||||
[features]
|
||||
precursor = []
|
||||
|
|
|
|||
|
|
@ -1,227 +0,0 @@
|
|||
extern crate crc;
|
||||
|
||||
use std::collections::VecDeque;
|
||||
use std::convert::TryInto;
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
|
||||
use tools::elf::{process_minielf, process_program, read_minielf};
|
||||
use tools::sign_image::sign_image;
|
||||
use tools::tags::inie::IniE;
|
||||
use tools::tags::memory::{MemoryRegion, MemoryRegions};
|
||||
use tools::tags::pnam::ProcessNames;
|
||||
use tools::tags::xkrn::XousKernel;
|
||||
use tools::xous_arguments::XousArguments;
|
||||
|
||||
struct RamConfig {
|
||||
offset: u32,
|
||||
size: u32,
|
||||
name: u32,
|
||||
regions: MemoryRegions,
|
||||
memory_required: u32,
|
||||
}
|
||||
|
||||
fn csr_to_config(hv: tools::utils::CsrConfig, ram_config: &mut RamConfig) {
|
||||
let mut found_ram_name = None;
|
||||
fn round_mem(src: u32) -> u32 { (src + 4095) & !4095 }
|
||||
// Look for the largest "ram" block, which we'll treat as main memory
|
||||
for (k, v) in &hv.regions {
|
||||
if k.find("ram").is_some() && v.length > ram_config.size {
|
||||
ram_config.size = round_mem(v.length);
|
||||
ram_config.offset = v.start;
|
||||
found_ram_name = Some(k.clone());
|
||||
}
|
||||
}
|
||||
|
||||
if found_ram_name.is_none() {
|
||||
eprintln!("Error: Couldn't find a memory region named \"ram\" in config file");
|
||||
return;
|
||||
}
|
||||
|
||||
// Now that we know which block is ram, add the other regions.
|
||||
let found_ram_name = MemoryRegion::make_name(&found_ram_name.unwrap());
|
||||
for (k, v) in &hv.regions {
|
||||
ram_config.memory_required += round_mem(v.length) / 4096;
|
||||
let region_name = MemoryRegion::make_name(k);
|
||||
// Don't add the RAM section to the extra regions block.
|
||||
if region_name == found_ram_name {
|
||||
ram_config.name = region_name;
|
||||
continue;
|
||||
}
|
||||
// Don't add empty sections.
|
||||
if round_mem(v.length) == 0 {
|
||||
continue;
|
||||
}
|
||||
ram_config.regions.add(MemoryRegion::new(v.start, round_mem(v.length), region_name));
|
||||
}
|
||||
}
|
||||
fn create_image(init_programs: &[String]) -> std::io::Result<Vec<u8>> {
|
||||
env_logger::init();
|
||||
|
||||
let mut ram_config = RamConfig {
|
||||
offset: Default::default(),
|
||||
size: Default::default(),
|
||||
name: MemoryRegion::make_name("sram"),
|
||||
regions: MemoryRegions::new(),
|
||||
memory_required: 0,
|
||||
};
|
||||
|
||||
let mut process_names = ProcessNames::new();
|
||||
|
||||
let soc_svd_file = include_bytes!("../../../utralib/renode/renode.svd");
|
||||
let desc = svd2utra::parse_svd(soc_svd_file.as_slice()).unwrap();
|
||||
let mut map = std::collections::BTreeMap::new();
|
||||
|
||||
let mut csr_top = 0;
|
||||
for peripheral in desc.peripherals {
|
||||
if peripheral.base > csr_top {
|
||||
csr_top = peripheral.base;
|
||||
}
|
||||
}
|
||||
for region in desc.memory_regions {
|
||||
// Ignore the "CSR" region and manually reconstruct it, because this
|
||||
// region is largely empty and we want to avoid allocating too much space.
|
||||
if region.name == "CSR" {
|
||||
const PAGE_SIZE: usize = 4096;
|
||||
// round to the nearest page, then add one page as the last entry in the csr_top
|
||||
// is an alloatable page, and not an end-stop.
|
||||
let length = if csr_top - region.base & (PAGE_SIZE - 1) == 0 {
|
||||
csr_top - region.base
|
||||
} else {
|
||||
((csr_top - region.base) & !(PAGE_SIZE - 1)) + PAGE_SIZE
|
||||
} + PAGE_SIZE;
|
||||
map.insert(
|
||||
region.name.to_lowercase(),
|
||||
tools::utils::CsrMemoryRegion {
|
||||
start: region.base.try_into().unwrap(),
|
||||
length: length.try_into().unwrap(),
|
||||
},
|
||||
);
|
||||
} else {
|
||||
map.insert(
|
||||
region.name.to_lowercase(),
|
||||
tools::utils::CsrMemoryRegion {
|
||||
start: region.base.try_into().unwrap(),
|
||||
length: region.size.try_into().unwrap(),
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
csr_to_config(tools::utils::CsrConfig { regions: map }, &mut ram_config);
|
||||
|
||||
let mut args = XousArguments::new(ram_config.offset, ram_config.size, ram_config.name);
|
||||
|
||||
if !ram_config.regions.is_empty() {
|
||||
args.add(ram_config.regions);
|
||||
}
|
||||
|
||||
let kernel =
|
||||
process_program(include_bytes!("../../../target/riscv32imac-unknown-xous-elf/release/xous-kernel"))
|
||||
.expect("unable to read kernel");
|
||||
process_names.set(1, "kernel");
|
||||
|
||||
let pid = 2;
|
||||
let init = process_minielf(include_bytes!(
|
||||
"../../../target/riscv32imac-unknown-xous-elf/release/xous-ticktimer"
|
||||
))
|
||||
.expect("couldn't parse init file");
|
||||
args.add(IniE::new(init.entry_point, init.sections, init.program));
|
||||
process_names.set(pid, "xous-ticktimer");
|
||||
|
||||
let pid = pid + 1;
|
||||
let init =
|
||||
process_minielf(include_bytes!("../../../target/riscv32imac-unknown-xous-elf/release/xous-log"))
|
||||
.expect("couldn't parse init file");
|
||||
args.add(IniE::new(init.entry_point, init.sections, init.program));
|
||||
process_names.set(pid, "xous-log");
|
||||
|
||||
let pid = pid + 1;
|
||||
let init =
|
||||
process_minielf(include_bytes!("../../../target/riscv32imac-unknown-xous-elf/release/xous-names"))
|
||||
.expect("couldn't parse init file");
|
||||
args.add(IniE::new(init.entry_point, init.sections, init.program));
|
||||
process_names.set(pid, "xous-names");
|
||||
|
||||
let pid = pid + 1;
|
||||
let init =
|
||||
process_minielf(include_bytes!("../../../target/riscv32imac-unknown-xous-elf/release/xous-susres"))
|
||||
.expect("couldn't parse init file");
|
||||
args.add(IniE::new(init.entry_point, init.sections, init.program));
|
||||
process_names.set(pid, "xous-susres");
|
||||
|
||||
let mut pid = pid + 1;
|
||||
for init_path in init_programs {
|
||||
let program_name = std::path::Path::new(&init_path);
|
||||
println!("Adding {} to output", program_name.display());
|
||||
process_names.set(
|
||||
pid,
|
||||
program_name
|
||||
.file_stem()
|
||||
.expect("program had no name")
|
||||
.to_str()
|
||||
.expect("program name is not valid utf-8"),
|
||||
);
|
||||
let init = read_minielf(init_path).expect("couldn't parse init file");
|
||||
args.add(IniE::new(init.entry_point, init.sections, init.program));
|
||||
pid += 1;
|
||||
}
|
||||
|
||||
let xkrn = XousKernel::new(
|
||||
kernel.text_offset,
|
||||
kernel.text_size,
|
||||
kernel.data_offset,
|
||||
kernel.data_size,
|
||||
kernel.bss_size,
|
||||
kernel.entry_point,
|
||||
kernel.program,
|
||||
);
|
||||
args.add(xkrn);
|
||||
|
||||
args.add(process_names);
|
||||
|
||||
// Add tags for init and kernel. These point to the actual data, which should
|
||||
// immediately follow the tags. Therefore, we must know the length of the tags
|
||||
// before we create them.
|
||||
let mut f = vec![];
|
||||
args.write(&mut f).expect("Couldn't write to args");
|
||||
|
||||
println!("Arguments: {}", args);
|
||||
|
||||
println!("Runtime will require {} bytes to track memory allocations", ram_config.memory_required);
|
||||
Ok(f)
|
||||
}
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let mut args: VecDeque<String> = std::env::args().collect();
|
||||
println!("Args: {:?}", args);
|
||||
let program = args
|
||||
.pop_front()
|
||||
.ok_or_else(|| std::io::Error::new(std::io::ErrorKind::Other, "program name not present"))?;
|
||||
let output_filename = args
|
||||
.pop_front()
|
||||
.ok_or_else(|| std::io::Error::new(std::io::ErrorKind::Other, "output filename not present"))?;
|
||||
args.make_contiguous();
|
||||
|
||||
if args.len() == 0 {
|
||||
return Err("no init programs specified".into());
|
||||
}
|
||||
println!("Program: {}", program);
|
||||
println!("Output file: {}", output_filename);
|
||||
println!("Init args: {:?}", args);
|
||||
let xous_presign_img = create_image(args.as_slices().0)?;
|
||||
|
||||
let xous_pkey = pem::parse(include_bytes!("../../../devkey/dev.key"))?;
|
||||
if xous_pkey.tag != "PRIVATE KEY" {
|
||||
println!("Xous image key was a {}, not a PRIVATE KEY", xous_pkey.tag);
|
||||
return Err("invalid xous image private key type".into());
|
||||
}
|
||||
println!("Signing output image");
|
||||
let xous_img = sign_image(&xous_presign_img, &xous_pkey, false, &None, Some([0u8; 16]))?;
|
||||
|
||||
let mut output_file = File::create(&output_filename)?;
|
||||
output_file.write_all(&xous_img)?;
|
||||
|
||||
println!("Successfully wrote {}", output_filename);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
132
tools/src/bin/xous-app-uf2.rs
Normal file
132
tools/src/bin/xous-app-uf2.rs
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
#[macro_use]
|
||||
extern crate clap;
|
||||
|
||||
extern crate crc;
|
||||
|
||||
use std::fs::File;
|
||||
use std::io::{Cursor, Write};
|
||||
|
||||
use clap::{App, Arg};
|
||||
use xous_tools::elf::read_minielf;
|
||||
use xous_tools::sign_image::bin_to_uf2;
|
||||
use xous_tools::swap_writer::SwapWriter;
|
||||
use xous_tools::tags::inif::IniF;
|
||||
use xous_tools::tags::inis::IniS;
|
||||
use xous_tools::tags::pnam::ProcessNames;
|
||||
use xous_tools::xous_arguments::XousArgumentCode;
|
||||
use xous_tools::xous_arguments::XousArguments;
|
||||
|
||||
const DEV_KEY_PEM: &'static str = "-----BEGIN PRIVATE KEY-----\nMC4CAQAwBQYDK2VwBCIEIKindlyNoteThisIsADevKeyDontUseForProduction\n-----END PRIVATE KEY-----";
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
env_logger::init();
|
||||
let matches = App::new("Xous Detached App UF2 Creator for Developer Images")
|
||||
.version(crate_version!())
|
||||
.author("bunnie <bunnie@baochip.com>")
|
||||
.about("Create a detached app image for Xous, signed for developer images, using the latest defaults")
|
||||
.arg(
|
||||
Arg::with_name("elf")
|
||||
.short("f")
|
||||
.long("elf")
|
||||
.takes_value(true)
|
||||
.multiple(true)
|
||||
.number_of_values(1)
|
||||
.required(true)
|
||||
.help("List of ELF files to incorporate in the detached app"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("swap")
|
||||
.long("swap")
|
||||
.takes_value(false)
|
||||
.help("When specified, creates a swap image"),
|
||||
)
|
||||
.get_matches();
|
||||
|
||||
let mut process_names = ProcessNames::new();
|
||||
|
||||
let mut pid: u32 = 1;
|
||||
|
||||
let mut args = if matches.is_present("swap") {
|
||||
XousArguments::new(
|
||||
0,
|
||||
bao1x_api::offsets::baosec::SWAP_RAM_LEN as _,
|
||||
u32::from_le_bytes(*b"Swap") as XousArgumentCode,
|
||||
)
|
||||
} else {
|
||||
// There is no kernel in this image, so the RAM section has no meaning. Set to 0.
|
||||
let mut args = XousArguments::new(0, 0, 0);
|
||||
args.set_detached_offset(
|
||||
(bao1x_api::offsets::dabao::APP_RRAM_START - bao1x_api::offsets::KERNEL_START) as u32 - 0x1000,
|
||||
);
|
||||
args
|
||||
};
|
||||
if let Some(init_paths) = matches.values_of("elf") {
|
||||
for init_path in init_paths {
|
||||
let program_name = std::path::Path::new(init_path);
|
||||
process_names.set(
|
||||
pid,
|
||||
program_name
|
||||
.file_stem()
|
||||
.expect("program had no name")
|
||||
.to_str()
|
||||
.expect("program name is not valid utf-8"),
|
||||
);
|
||||
pid += 1;
|
||||
let init = read_minielf(init_path).expect("couldn't parse init file");
|
||||
if matches.is_present("swap") {
|
||||
args.add(IniS::new(init.entry_point, init.sections, init.program));
|
||||
} else {
|
||||
args.add(IniF::new(init.entry_point, init.sections, init.program, init.alignment_offset));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
args.add(process_names);
|
||||
|
||||
println!("Programs: {}", args);
|
||||
|
||||
let private_key = pem::parse(DEV_KEY_PEM)?;
|
||||
|
||||
if matches.is_present("swap") {
|
||||
let mut swap_buffer = SwapWriter::new();
|
||||
args.write(&mut swap_buffer)?;
|
||||
|
||||
// Create the swap target image and encrypt swap_buffer to it
|
||||
let mut swap = Cursor::new(Vec::new());
|
||||
swap_buffer.encrypt_to(&mut swap, &private_key)?;
|
||||
|
||||
// generate a uf2 file
|
||||
let swap_uf2 = "swap.uf2";
|
||||
let uf2_blob =
|
||||
bin_to_uf2(&swap.into_inner(), bao1x_api::BAOCHIP_1X_UF2_FAMILY, bao1x_api::SWAP_START_UF2 as _)?;
|
||||
let mut f =
|
||||
File::create(swap_uf2).unwrap_or_else(|_| panic!("Couldn't create output file {}", swap_uf2));
|
||||
f.write(&uf2_blob)?;
|
||||
println!("Created swap UF2 at {}", swap_uf2);
|
||||
} else {
|
||||
let mut source = Cursor::new(Vec::new());
|
||||
args.write(&mut source).expect("Couldn't write out ELF files");
|
||||
|
||||
let result = xous_tools::sign_image::sign_image(
|
||||
&source.get_ref(),
|
||||
&private_key,
|
||||
false,
|
||||
&None,
|
||||
None,
|
||||
true,
|
||||
bao1x_api::signatures::SIGBLOCK_LEN,
|
||||
xous_tools::sign_image::Version::Bao1xV1,
|
||||
Some("app"),
|
||||
)?;
|
||||
|
||||
let app_uf2 = "apps.uf2";
|
||||
let uf2_blob =
|
||||
bin_to_uf2(&result, bao1x_api::BAOCHIP_1X_UF2_FAMILY, bao1x_api::dabao::APP_RRAM_START as _)?;
|
||||
let mut f =
|
||||
File::create(app_uf2).unwrap_or_else(|_| panic!("Couldn't create output file {}", app_uf2));
|
||||
f.write(&uf2_blob)?;
|
||||
println!("Created app UF2 at {}", app_uf2);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ use std::io::Write;
|
|||
use std::path::{Path, PathBuf};
|
||||
use std::process;
|
||||
|
||||
use tools::elf;
|
||||
use xous_tools::elf;
|
||||
|
||||
fn main() {
|
||||
env_logger::init();
|
||||
|
|
@ -6,11 +6,11 @@ extern crate crc;
|
|||
use std::fs::File;
|
||||
|
||||
use clap::{App, Arg};
|
||||
use tools::elf::read_minielf;
|
||||
use tools::tags::inif::IniF;
|
||||
use tools::tags::pnam::ProcessNames;
|
||||
use tools::utils::parse_u32;
|
||||
use tools::xous_arguments::XousArguments;
|
||||
use xous_tools::elf::read_minielf;
|
||||
use xous_tools::tags::inif::IniF;
|
||||
use xous_tools::tags::pnam::ProcessNames;
|
||||
use xous_tools::utils::parse_u32;
|
||||
use xous_tools::xous_arguments::XousArguments;
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
env_logger::init();
|
||||
|
|
@ -8,19 +8,19 @@ use std::fs::File;
|
|||
use std::io::Read;
|
||||
|
||||
use clap::{App, Arg};
|
||||
use tools::elf::{read_minielf, read_program};
|
||||
use tools::sign_image::convert_to_uf2;
|
||||
use tools::swap_writer::SwapWriter;
|
||||
use tools::tags::bflg::Bflg;
|
||||
use tools::tags::inie::IniE;
|
||||
use tools::tags::inif::IniF;
|
||||
use tools::tags::inis::IniS;
|
||||
use tools::tags::memory::{MemoryRegion, MemoryRegions};
|
||||
use tools::tags::pnam::ProcessNames;
|
||||
use tools::tags::swap::Swap;
|
||||
use tools::tags::xkrn::XousKernel;
|
||||
use tools::utils::{parse_csr_csv, parse_u32};
|
||||
use tools::xous_arguments::XousArguments;
|
||||
use xous_tools::elf::{read_minielf, read_program};
|
||||
use xous_tools::sign_image::convert_to_uf2;
|
||||
use xous_tools::swap_writer::SwapWriter;
|
||||
use xous_tools::tags::bflg::Bflg;
|
||||
use xous_tools::tags::inie::IniE;
|
||||
use xous_tools::tags::inif::IniF;
|
||||
use xous_tools::tags::inis::IniS;
|
||||
use xous_tools::tags::memory::{MemoryRegion, MemoryRegions};
|
||||
use xous_tools::tags::pnam::ProcessNames;
|
||||
use xous_tools::tags::swap::Swap;
|
||||
use xous_tools::tags::xkrn::XousKernel;
|
||||
use xous_tools::utils::{parse_csr_csv, parse_u32};
|
||||
use xous_tools::xous_arguments::XousArguments;
|
||||
|
||||
const DEVKEY_PATH: &str = "devkey/dev.key";
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ struct RamConfig {
|
|||
memory_required: u32,
|
||||
}
|
||||
|
||||
fn csr_to_config(hv: tools::utils::CsrConfig, ram_config: &mut RamConfig) {
|
||||
fn csr_to_config(hv: xous_tools::utils::CsrConfig, ram_config: &mut RamConfig) {
|
||||
let mut found_ram_name = None;
|
||||
fn round_mem(src: u32) -> u32 { (src + 4095) & !4095 }
|
||||
// Look for the largest memory block, which we'll treat as main memory
|
||||
|
|
@ -283,7 +283,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
} + PAGE_SIZE;
|
||||
map.insert(
|
||||
region.name.to_lowercase(),
|
||||
tools::utils::CsrMemoryRegion {
|
||||
xous_tools::utils::CsrMemoryRegion {
|
||||
start: region.base.try_into().unwrap(),
|
||||
length: length.try_into().unwrap(),
|
||||
},
|
||||
|
|
@ -291,7 +291,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
} else {
|
||||
map.insert(
|
||||
region.name.to_lowercase(),
|
||||
tools::utils::CsrMemoryRegion {
|
||||
xous_tools::utils::CsrMemoryRegion {
|
||||
start: region.base.try_into().unwrap(),
|
||||
length: region.size.try_into().unwrap(),
|
||||
},
|
||||
|
|
@ -325,7 +325,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
println!("{:10}: {:x} - {:x}", region.name, region.base, region.base + region.size);
|
||||
map.insert(
|
||||
region.name.to_lowercase(),
|
||||
tools::utils::CsrMemoryRegion {
|
||||
xous_tools::utils::CsrMemoryRegion {
|
||||
start: region.base.try_into().unwrap(),
|
||||
length: region.size.try_into().unwrap(),
|
||||
},
|
||||
|
|
@ -334,7 +334,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
}
|
||||
}
|
||||
|
||||
csr_to_config(tools::utils::CsrConfig { regions: map }, &mut ram_config);
|
||||
csr_to_config(xous_tools::utils::CsrConfig { regions: map }, &mut ram_config);
|
||||
}
|
||||
|
||||
// Swap has an architecture-dependent meaning.
|
||||
|
|
@ -525,7 +525,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
let mut sf =
|
||||
File::create(sf_dbg).unwrap_or_else(|_| panic!("Couldn't create debug file {}", sf_dbg));
|
||||
// serialize the unencrypted header into the debug image
|
||||
let header = tools::swap_writer::SwapHeader::new(buf_len);
|
||||
let header = xous_tools::swap_writer::SwapHeader::new(buf_len);
|
||||
sf.write(&header.serialize()?)?;
|
||||
// directly write our unencrypted data from sargs into file sf. It's an exact copy of
|
||||
// what ended up in swap_buffer.
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
use std::fs::File;
|
||||
|
||||
use tools::tags::memory::{MemoryRegion, MemoryRegions};
|
||||
use tools::tags::xkrn::XousKernel;
|
||||
use tools::xous_arguments::{XousArguments, XousSize};
|
||||
use xous_tools::tags::memory::{MemoryRegion, MemoryRegions};
|
||||
use xous_tools::tags::xkrn::XousKernel;
|
||||
use xous_tools::xous_arguments::{XousArguments, XousSize};
|
||||
|
||||
const RAM_START: XousSize = 0x4000_0000;
|
||||
const RAM_SIZE: XousSize = 4 * 1024 * 1024;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
use std::io::{Error, ErrorKind};
|
||||
|
||||
use clap::{App, Arg, crate_version};
|
||||
use tools::sign_image::{convert_to_uf2, load_pem, sign_file};
|
||||
use xous_tools::sign_image::{convert_to_uf2, load_pem, sign_file};
|
||||
|
||||
const DEVKEY_PATH: &str = "devkey/dev.key";
|
||||
|
||||
|
|
@ -126,9 +126,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
// precursor uses the older style because we are avoiding updating the boot ROM in the SoC to avoid
|
||||
// bricking.
|
||||
let version = if matches.is_present("bao1x") {
|
||||
tools::sign_image::Version::Bao1xV1
|
||||
xous_tools::sign_image::Version::Bao1xV1
|
||||
} else {
|
||||
tools::sign_image::Version::Loader
|
||||
xous_tools::sign_image::Version::Loader
|
||||
};
|
||||
sign_file(
|
||||
&loader_image,
|
||||
|
|
@ -167,9 +167,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
}
|
||||
println!("Signing kernel");
|
||||
let version = if matches.is_present("bao1x") {
|
||||
tools::sign_image::Version::Bao1xV1
|
||||
xous_tools::sign_image::Version::Bao1xV1
|
||||
} else {
|
||||
tools::sign_image::Version::LoaderPrehash
|
||||
xous_tools::sign_image::Version::LoaderPrehash
|
||||
};
|
||||
sign_file(
|
||||
&kernel_image,
|
||||
|
|
@ -949,9 +949,9 @@ impl Builder {
|
|||
.args([
|
||||
"run",
|
||||
"--package",
|
||||
"tools",
|
||||
"xous-tools",
|
||||
"--bin",
|
||||
"copy-object",
|
||||
"xous-copy-object",
|
||||
"--",
|
||||
&loader[0],
|
||||
presign_file.as_os_str().to_str().unwrap(),
|
||||
|
|
@ -981,9 +981,9 @@ impl Builder {
|
|||
.args([
|
||||
"run",
|
||||
"--package",
|
||||
"tools",
|
||||
"xous-tools",
|
||||
"--bin",
|
||||
"sign-image",
|
||||
"xous-sign-image",
|
||||
"--",
|
||||
"--loader-image",
|
||||
presign_file.to_str().unwrap(),
|
||||
|
|
@ -1075,9 +1075,9 @@ impl Builder {
|
|||
.args([
|
||||
"run",
|
||||
"--package",
|
||||
"tools",
|
||||
"xous-tools",
|
||||
"--bin",
|
||||
"copy-object",
|
||||
"xous-copy-object",
|
||||
"--",
|
||||
&loader[0],
|
||||
loader_presign.as_os_str().to_str().unwrap(),
|
||||
|
|
@ -1094,9 +1094,9 @@ impl Builder {
|
|||
.args([
|
||||
"run",
|
||||
"--package",
|
||||
"tools",
|
||||
"xous-tools",
|
||||
"--bin",
|
||||
"sign-image",
|
||||
"xous-sign-image",
|
||||
"--",
|
||||
"--loader-image",
|
||||
loader_presign.to_str().unwrap(),
|
||||
|
|
@ -1120,9 +1120,9 @@ impl Builder {
|
|||
.args([
|
||||
"run",
|
||||
"--package",
|
||||
"tools",
|
||||
"xous-tools",
|
||||
"--bin",
|
||||
"sign-image",
|
||||
"xous-sign-image",
|
||||
"--",
|
||||
"--loader-image",
|
||||
loader_presign.to_str().unwrap(),
|
||||
|
|
@ -1148,9 +1148,9 @@ impl Builder {
|
|||
.args([
|
||||
"run",
|
||||
"--package",
|
||||
"tools",
|
||||
"xous-tools",
|
||||
"--bin",
|
||||
"sign-image",
|
||||
"xous-sign-image",
|
||||
"--",
|
||||
"--kernel-image",
|
||||
output_bundle.to_str().unwrap(),
|
||||
|
|
@ -1175,9 +1175,9 @@ impl Builder {
|
|||
.args([
|
||||
"run",
|
||||
"--package",
|
||||
"tools",
|
||||
"xous-tools",
|
||||
"--bin",
|
||||
"sign-image",
|
||||
"xous-sign-image",
|
||||
"--",
|
||||
"--kernel-image",
|
||||
output_bundle.to_str().unwrap(),
|
||||
|
|
@ -1213,7 +1213,7 @@ impl Builder {
|
|||
memory_spec: Vec<String>,
|
||||
) -> Result<PathBuf, DynError> {
|
||||
let stream = self.stream.as_str();
|
||||
let mut args = vec!["run", "--package", "tools", "--bin", "create-image"];
|
||||
let mut args = vec!["run", "--package", "xous-tools", "--bin", "xous-create-image"];
|
||||
args.push("--features");
|
||||
if self.utra_target.contains("renode") {
|
||||
args.push("renode");
|
||||
|
|
@ -1304,7 +1304,7 @@ impl Builder {
|
|||
fn create_detached_image(&self, inif: &[String]) -> Result<PathBuf, DynError> {
|
||||
assert!(self.board == "board-dabao", "Detached app images are only supported on dabao target");
|
||||
let stream = self.stream.as_str();
|
||||
let mut args = vec!["run", "--package", "tools", "--bin", "create-detached-app"];
|
||||
let mut args = vec!["run", "--package", "xous-tools", "--bin", "xous-create-detached-app"];
|
||||
args.push("--features");
|
||||
args.push("bao1x");
|
||||
args.push("--");
|
||||
|
|
@ -1341,9 +1341,9 @@ impl Builder {
|
|||
.args([
|
||||
"run",
|
||||
"--package",
|
||||
"tools",
|
||||
"xous-tools",
|
||||
"--bin",
|
||||
"sign-image",
|
||||
"xous-sign-image",
|
||||
"--",
|
||||
"--kernel-image",
|
||||
output_file.to_str().unwrap(),
|
||||
|
|
|
|||
|
|
@ -638,7 +638,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
builder.set_board(board);
|
||||
builder.add_loader_feature(board);
|
||||
builder.add_loader_feature("bao1x-usb");
|
||||
let sigblock_size = 0x300;
|
||||
let sigblock_size = bao1x_api::signatures::SIGBLOCK_LEN;
|
||||
update_flash_origin(
|
||||
"baremetal/src/platform/bao1x/link.x",
|
||||
(bao1x_api::BAREMETAL_START + sigblock_size + STATICS_LEN) as u32,
|
||||
|
|
@ -651,7 +651,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
builder.set_board(board);
|
||||
builder.add_loader_feature(board);
|
||||
builder.add_loader_feature("bao1x-usb");
|
||||
let sigblock_size = 0x300;
|
||||
let sigblock_size = bao1x_api::signatures::SIGBLOCK_LEN;
|
||||
update_flash_origin(
|
||||
"baremetal/src/platform/bao1x/link.x",
|
||||
(bao1x_api::BAREMETAL_START + sigblock_size + STATICS_LEN) as u32,
|
||||
|
|
@ -660,7 +660,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
}
|
||||
|
||||
Some("baremetal-bao1x-evb") => {
|
||||
let sigblock_size = 0x300;
|
||||
let sigblock_size = bao1x_api::signatures::SIGBLOCK_LEN;
|
||||
update_flash_origin(
|
||||
"baremetal/src/platform/bao1x/link.x",
|
||||
(0x6100_0000 + sigblock_size + STATICS_LEN) as u32,
|
||||
|
|
@ -672,7 +672,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
}
|
||||
|
||||
Some("bao1x-boot0") => {
|
||||
let sigblock_size = 0x300;
|
||||
let sigblock_size = bao1x_api::signatures::SIGBLOCK_LEN;
|
||||
update_flash_origin(
|
||||
"bao1x-boot/boot0/link.x",
|
||||
(bao1x_api::BOOT0_START + sigblock_size + STATICS_LEN) as u32,
|
||||
|
|
@ -684,7 +684,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
}
|
||||
|
||||
Some("bao1x-boot1") => {
|
||||
let sigblock_size = 0x300;
|
||||
let sigblock_size = bao1x_api::signatures::SIGBLOCK_LEN;
|
||||
update_flash_origin(
|
||||
"bao1x-boot/boot1/src/platform/bao1x/link.x",
|
||||
(bao1x_api::BOOT1_START + sigblock_size + STATICS_LEN) as u32,
|
||||
|
|
@ -697,7 +697,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
}
|
||||
|
||||
Some("bao1x-alt-boot1") => {
|
||||
let sigblock_size = 0x300;
|
||||
let sigblock_size = bao1x_api::signatures::SIGBLOCK_LEN;
|
||||
update_flash_origin(
|
||||
"bao1x-boot/boot1/src/platform/bao1x/link.x",
|
||||
(bao1x_api::LOADER_START + sigblock_size + STATICS_LEN) as u32,
|
||||
|
|
@ -711,7 +711,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
}
|
||||
|
||||
Some("bao1x-boot1-lite") => {
|
||||
let sigblock_size = 0x300;
|
||||
let sigblock_size = bao1x_api::signatures::SIGBLOCK_LEN;
|
||||
update_flash_origin(
|
||||
"bao1x-boot/boot1/src/platform/bao1x/link.x",
|
||||
(bao1x_api::BOOT1_START + sigblock_size + STATICS_LEN) as u32,
|
||||
|
|
@ -725,7 +725,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
}
|
||||
|
||||
Some("bao1x-alt-boot1-lite") => {
|
||||
let sigblock_size = 0x300;
|
||||
let sigblock_size = bao1x_api::signatures::SIGBLOCK_LEN;
|
||||
update_flash_origin(
|
||||
"bao1x-boot/boot1/src/platform/bao1x/link.x",
|
||||
(bao1x_api::LOADER_START + sigblock_size + STATICS_LEN) as u32,
|
||||
|
|
@ -751,7 +751,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
|
||||
Some("baosec-improper-keystore") => {
|
||||
let board = "board-baosec";
|
||||
let sigblock_size = 0x300;
|
||||
let sigblock_size = bao1x_api::signatures::SIGBLOCK_LEN;
|
||||
update_flash_origin(
|
||||
"loader/src/platform/bao1x/link.x",
|
||||
(bao1x_api::LOADER_START + sigblock_size + STATICS_LEN) as u32,
|
||||
|
|
@ -797,7 +797,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
|
||||
Some("dabao") => {
|
||||
let board = "board-dabao";
|
||||
let sigblock_size = 0x300;
|
||||
let sigblock_size = bao1x_api::signatures::SIGBLOCK_LEN;
|
||||
update_flash_origin(
|
||||
"loader/src/platform/bao1x/link.x",
|
||||
(bao1x_api::LOADER_START + sigblock_size + STATICS_LEN) as u32,
|
||||
|
|
@ -1139,7 +1139,7 @@ fn update_flash_origin<P: AsRef<Path>>(path: P, new_origin: u32) -> std::io::Res
|
|||
|
||||
fn baosec_common(builder: &mut Builder) -> std::io::Result<()> {
|
||||
let board = "board-baosec";
|
||||
let sigblock_size = 0x300;
|
||||
let sigblock_size = bao1x_api::signatures::SIGBLOCK_LEN;
|
||||
update_flash_origin(
|
||||
"loader/src/platform/bao1x/link.x",
|
||||
(bao1x_api::LOADER_START + sigblock_size + STATICS_LEN) as u32,
|
||||
|
|
|
|||
Loading…
Reference in a new issue