mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
commit
b0a70f385f
9 changed files with 69 additions and 7 deletions
|
|
@ -68,6 +68,7 @@ enum-iterator = "0.6.0"
|
||||||
board-baosec = [
|
board-baosec = [
|
||||||
"bao1x-hal-service",
|
"bao1x-hal-service",
|
||||||
"ux-api/board-baosec",
|
"ux-api/board-baosec",
|
||||||
|
"ux-api/bip39entry",
|
||||||
"blitstr2/board-baosec",
|
"blitstr2/board-baosec",
|
||||||
"usb-bao1x/board-baosec",
|
"usb-bao1x/board-baosec",
|
||||||
"persistent_store/board-baosec",
|
"persistent_store/board-baosec",
|
||||||
|
|
@ -75,6 +76,7 @@ board-baosec = [
|
||||||
]
|
]
|
||||||
hosted-baosec = [
|
hosted-baosec = [
|
||||||
"bao1x-emu",
|
"bao1x-emu",
|
||||||
|
"ux-api/bip39entry",
|
||||||
"ux-api/hosted-baosec",
|
"ux-api/hosted-baosec",
|
||||||
"usb-bao1x/hosted-baosec",
|
"usb-bao1x/hosted-baosec",
|
||||||
"ctap-crypto/hosted-baosec",
|
"ctap-crypto/hosted-baosec",
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ bao1x = [
|
||||||
"utralib/bao1x",
|
"utralib/bao1x",
|
||||||
"linked_list_allocator",
|
"linked_list_allocator",
|
||||||
"bao1x-hal/loader-baosec",
|
"bao1x-hal/loader-baosec",
|
||||||
|
"bao1x-hal/security",
|
||||||
"bao1x-api",
|
"bao1x-api",
|
||||||
# "bao1x-hal/debug-print-duart",
|
# "bao1x-hal/debug-print-duart",
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ bao1x = [
|
||||||
"utralib/bao1x",
|
"utralib/bao1x",
|
||||||
"linked_list_allocator",
|
"linked_list_allocator",
|
||||||
"bao1x-hal/loader-baosec",
|
"bao1x-hal/loader-baosec",
|
||||||
|
"bao1x-hal/security",
|
||||||
# "bao1x-hal/debug-print-duart",
|
# "bao1x-hal/debug-print-duart",
|
||||||
"bao1x-api",
|
"bao1x-api",
|
||||||
# needed for the boot logo
|
# needed for the boot logo
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ bao1x = [
|
||||||
"utralib/bao1x",
|
"utralib/bao1x",
|
||||||
"linked_list_allocator",
|
"linked_list_allocator",
|
||||||
"bao1x-hal/debug-print-uart",
|
"bao1x-hal/debug-print-uart",
|
||||||
|
"bao1x-hal/security",
|
||||||
"bao1x-api",
|
"bao1x-api",
|
||||||
"digest",
|
"digest",
|
||||||
"sha2-bao1x",
|
"sha2-bao1x",
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,6 @@ board-baosec = [
|
||||||
"utralib/bao1x",
|
"utralib/bao1x",
|
||||||
"ux-api/board-baosec",
|
"ux-api/board-baosec",
|
||||||
"ux-api/std",
|
"ux-api/std",
|
||||||
"sigcheck",
|
|
||||||
] # USB form factor token
|
] # USB form factor token
|
||||||
loader-baosec = [
|
loader-baosec = [
|
||||||
"utralib/bao1x",
|
"utralib/bao1x",
|
||||||
|
|
@ -79,7 +78,6 @@ loader-baosec = [
|
||||||
"axp2101",
|
"axp2101",
|
||||||
"bmp180",
|
"bmp180",
|
||||||
"ux-api/loader-baosec",
|
"ux-api/loader-baosec",
|
||||||
"sigcheck",
|
|
||||||
]
|
]
|
||||||
kernel = []
|
kernel = []
|
||||||
kernel-baosec = ["utralib/bao1x", "kernel"]
|
kernel-baosec = ["utralib/bao1x", "kernel"]
|
||||||
|
|
@ -93,11 +91,10 @@ board-baosor = [
|
||||||
"axp2101",
|
"axp2101",
|
||||||
"utralib/bao1x",
|
"utralib/bao1x",
|
||||||
"ux-api/std",
|
"ux-api/std",
|
||||||
"sigcheck",
|
|
||||||
] # Precursor form factor
|
] # Precursor form factor
|
||||||
loader-baosor = []
|
loader-baosor = []
|
||||||
board-dabao = ["utralib/bao1x", "sigcheck"] # Dev board form factor
|
board-dabao = ["utralib/bao1x"] # Dev board form factor
|
||||||
loader-dabao = ["sigcheck"]
|
loader-dabao = []
|
||||||
verilator-only = ["utralib/bao1x"]
|
verilator-only = ["utralib/bao1x"]
|
||||||
mpw = ["utralib/bao1x"]
|
mpw = ["utralib/bao1x"]
|
||||||
hdl-test = ["utralib/bao1x"]
|
hdl-test = ["utralib/bao1x"]
|
||||||
|
|
@ -107,6 +104,7 @@ debug-print-duart = ["debug-print", "debug-countermeasures"]
|
||||||
debug-print-uart = ["debug-print"]
|
debug-print-uart = ["debug-print"]
|
||||||
debug-countermeasures = []
|
debug-countermeasures = []
|
||||||
debug-wfi = []
|
debug-wfi = []
|
||||||
|
security = ["sigcheck"]
|
||||||
|
|
||||||
udma-stress-test = [
|
udma-stress-test = [
|
||||||
] # For RTL simulation testing - aggravates a key corner case
|
] # For RTL simulation testing - aggravates a key corner case
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ pub mod buram;
|
||||||
pub mod clocks;
|
pub mod clocks;
|
||||||
#[cfg(not(feature = "hosted-baosec"))]
|
#[cfg(not(feature = "hosted-baosec"))]
|
||||||
pub mod coreuser;
|
pub mod coreuser;
|
||||||
#[cfg(all(not(feature = "hosted-baosec"), not(feature = "kernel")))]
|
#[cfg(feature = "security")]
|
||||||
pub mod hardening;
|
pub mod hardening;
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
pub mod i2c;
|
pub mod i2c;
|
||||||
|
|
@ -48,7 +48,7 @@ pub mod mbox;
|
||||||
pub mod rram;
|
pub mod rram;
|
||||||
#[cfg(not(feature = "hosted-baosec"))]
|
#[cfg(not(feature = "hosted-baosec"))]
|
||||||
pub mod rtc;
|
pub mod rtc;
|
||||||
#[cfg(all(not(feature = "hosted-baosec"), not(feature = "kernel")))]
|
#[cfg(feature = "security")]
|
||||||
pub mod sigcheck;
|
pub mod sigcheck;
|
||||||
#[cfg(not(feature = "hosted-baosec"))]
|
#[cfg(not(feature = "hosted-baosec"))]
|
||||||
pub mod sram_trim;
|
pub mod sram_trim;
|
||||||
|
|
|
||||||
|
|
@ -106,12 +106,14 @@ board-baosec = [
|
||||||
"digest",
|
"digest",
|
||||||
"ux-api/loader-baosec",
|
"ux-api/loader-baosec",
|
||||||
"aes/loader-baosec",
|
"aes/loader-baosec",
|
||||||
|
"bao1x-hal/security",
|
||||||
]
|
]
|
||||||
board-baosor = ["bao1x-hal/loader-baosor"]
|
board-baosor = ["bao1x-hal/loader-baosor"]
|
||||||
board-dabao = [
|
board-dabao = [
|
||||||
"bao1x-hal/loader-dabao",
|
"bao1x-hal/loader-dabao",
|
||||||
"bao1x-hal/board-dabao",
|
"bao1x-hal/board-dabao",
|
||||||
"aes/loader-dabao",
|
"aes/loader-dabao",
|
||||||
|
"bao1x-hal/security",
|
||||||
]
|
]
|
||||||
atsama5d27 = ["utralib/atsama5d27", "armv7", "dep:atsama5d27"]
|
atsama5d27 = ["utralib/atsama5d27", "armv7", "dep:atsama5d27"]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -267,6 +267,12 @@ pub fn sign_image(
|
||||||
target,
|
target,
|
||||||
);
|
);
|
||||||
return Err(String::from("Image doesn't fit").into());
|
return Err(String::from("Image doesn't fit").into());
|
||||||
|
} else {
|
||||||
|
println!(
|
||||||
|
"=== Kernel is {} bytes: {} bytes free remaining ===",
|
||||||
|
dest_file.len(),
|
||||||
|
target - dest_file.len()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(dest_file)
|
Ok(dest_file)
|
||||||
|
|
|
||||||
|
|
@ -794,6 +794,57 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
// builder.add_feature("modal-testing");
|
// builder.add_feature("modal-testing");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Some("baosec-lite") => {
|
||||||
|
let board = "board-baosec";
|
||||||
|
let sigblock_size = 0x300;
|
||||||
|
update_flash_origin(
|
||||||
|
"loader/src/platform/bao1x/link.x",
|
||||||
|
(bao1x_api::LOADER_START + sigblock_size + STATICS_LEN) as u32,
|
||||||
|
)?;
|
||||||
|
// select the board
|
||||||
|
builder.set_board(board);
|
||||||
|
builder.add_feature(board);
|
||||||
|
builder.add_loader_feature(board);
|
||||||
|
builder.add_kernel_feature(board);
|
||||||
|
builder.set_sigblock_size(sigblock_size);
|
||||||
|
|
||||||
|
// needs a filesystem, which has to be implemented in...128k :-O
|
||||||
|
let bao_rram_pkgs = [
|
||||||
|
"xous-ticktimer",
|
||||||
|
"keystore",
|
||||||
|
"xous-log",
|
||||||
|
"xous-names",
|
||||||
|
"usb-bao1x",
|
||||||
|
"bao1x-hal-service",
|
||||||
|
"modals",
|
||||||
|
"bao-video",
|
||||||
|
"vault2",
|
||||||
|
]
|
||||||
|
.to_vec();
|
||||||
|
let bao_swap_pkgs = [].to_vec();
|
||||||
|
if !builder.is_swap_set() {
|
||||||
|
// reserve 3MiB for system services: ultimately, "pddb, modals, and bao-video"
|
||||||
|
builder.set_swap(0, bao1x_api::offsets::baosec::SWAP_RAM_LEN as _);
|
||||||
|
}
|
||||||
|
|
||||||
|
builder.add_loader_feature("debug-print");
|
||||||
|
// the following feature needs to be uncommented if we also enable
|
||||||
|
builder.add_kernel_feature("v2p");
|
||||||
|
builder.target_bao1x_soc();
|
||||||
|
|
||||||
|
for service in bao_rram_pkgs {
|
||||||
|
builder.add_service(service, LoaderRegion::Flash);
|
||||||
|
}
|
||||||
|
builder.add_services(&get_cratespecs());
|
||||||
|
for service in bao_swap_pkgs {
|
||||||
|
builder.add_service(service, LoaderRegion::Swap);
|
||||||
|
}
|
||||||
|
for app in get_cratespecs() {
|
||||||
|
builder.add_service(&app, LoaderRegion::Swap);
|
||||||
|
}
|
||||||
|
// builder.add_feature("modal-testing");
|
||||||
|
}
|
||||||
|
|
||||||
Some("baosec-improper-keystore") => {
|
Some("baosec-improper-keystore") => {
|
||||||
let board = "board-baosec";
|
let board = "board-baosec";
|
||||||
let sigblock_size = 0x300;
|
let sigblock_size = 0x300;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue