mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
add some artifacts for an early sample run
These are a bit rushed but wanted to be able to have some serialization/tracking in the earliest samples sent to 'alpha-zero' developers.
This commit is contained in:
parent
cafd760bf5
commit
254780b382
6 changed files with 33 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -4,6 +4,7 @@ target
|
||||||
/emulation/obj
|
/emulation/obj
|
||||||
# auto-generated
|
# auto-generated
|
||||||
services/xous-ticktimer/src/version.rs
|
services/xous-ticktimer/src/version.rs
|
||||||
|
bao1x-boot/boot1/src/version.rs
|
||||||
apps/i18n.json
|
apps/i18n.json
|
||||||
services/gam/src/apps.rs
|
services/gam/src/apps.rs
|
||||||
services/status/src/app_autogen.rs
|
services/status/src/app_autogen.rs
|
||||||
|
|
|
||||||
8
bao1x-boot/blobs/README.md
Normal file
8
bao1x-boot/blobs/README.md
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
# Binary Data Used in Programming
|
||||||
|
|
||||||
|
## One-Way Counter Defaults
|
||||||
|
|
||||||
|
These blobs are burned into the one-way counter array to force some counters to be
|
||||||
|
tripped, thus pre-configuring the behavior of a given board.
|
||||||
|
|
||||||
|
* `dabao-owc.bin`: Sets board type to `dabao`, and sets wait on boot to true
|
||||||
BIN
bao1x-boot/blobs/dabao-owc.bin
Normal file
BIN
bao1x-boot/blobs/dabao-owc.bin
Normal file
Binary file not shown.
|
|
@ -8,6 +8,7 @@ mod platform;
|
||||||
mod repl;
|
mod repl;
|
||||||
mod secboot;
|
mod secboot;
|
||||||
mod uf2;
|
mod uf2;
|
||||||
|
mod version;
|
||||||
|
|
||||||
use alloc::collections::VecDeque;
|
use alloc::collections::VecDeque;
|
||||||
use core::{
|
use core::{
|
||||||
|
|
@ -28,6 +29,8 @@ use crate::platform::usb::glue;
|
||||||
use crate::secboot::boot_or_die;
|
use crate::secboot::boot_or_die;
|
||||||
use crate::{delay, platform::irq::disable_all_irqs};
|
use crate::{delay, platform::irq::disable_all_irqs};
|
||||||
|
|
||||||
|
const RELEASE_DESCRIPTION: &'static str = "Dabao Alpha-0 Sample";
|
||||||
|
|
||||||
static UART_RX: Mutex<RefCell<VecDeque<u8>>> = Mutex::new(RefCell::new(VecDeque::new()));
|
static UART_RX: Mutex<RefCell<VecDeque<u8>>> = Mutex::new(RefCell::new(VecDeque::new()));
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
static USB_RX: Mutex<RefCell<VecDeque<u8>>> = Mutex::new(RefCell::new(VecDeque::new()));
|
static USB_RX: Mutex<RefCell<VecDeque<u8>>> = Mutex::new(RefCell::new(VecDeque::new()));
|
||||||
|
|
@ -72,7 +75,7 @@ pub unsafe extern "C" fn rust_entry() -> ! {
|
||||||
crate::println_d!("TX_IDLE: {:?}", crate::platform::usb::TX_IDLE.load(Ordering::SeqCst));
|
crate::println_d!("TX_IDLE: {:?}", crate::platform::usb::TX_IDLE.load(Ordering::SeqCst));
|
||||||
let perclk: u32;
|
let perclk: u32;
|
||||||
(board_type, perclk) = crate::platform::early_init(board_type);
|
(board_type, perclk) = crate::platform::early_init(board_type);
|
||||||
crate::println!("\n~~Boot1 up!~~\n");
|
crate::println!("\n~~Boot1 up! ({}: {})~~\n", crate::version::SEMVER, RELEASE_DESCRIPTION);
|
||||||
crate::println!("Configured board type: {:?}", board_type);
|
crate::println!("Configured board type: {:?}", board_type);
|
||||||
if board_type == BoardTypeCoding::Baosec {
|
if board_type == BoardTypeCoding::Baosec {
|
||||||
IS_BAOSEC.store(true, Ordering::SeqCst);
|
IS_BAOSEC.store(true, Ordering::SeqCst);
|
||||||
|
|
|
||||||
|
|
@ -208,6 +208,14 @@ impl Repl {
|
||||||
"Boot partition is: {:?}",
|
"Boot partition is: {:?}",
|
||||||
owc.get_decoded::<bao1x_api::offsets::AltBootCoding>()
|
owc.get_decoded::<bao1x_api::offsets::AltBootCoding>()
|
||||||
);
|
);
|
||||||
|
crate::println!("Semver is: {}", crate::version::SEMVER);
|
||||||
|
crate::println!("Description is: {}", crate::RELEASE_DESCRIPTION);
|
||||||
|
// TODO: replace this with a proper API, this is a hack to allow an initial
|
||||||
|
// alpha run of boards to be churned out on short notice. The hard-coded number
|
||||||
|
// below ostensibly belongs to "data slot 0". For this run, it's just an incrementing
|
||||||
|
// number, but in the future it might be a truncated hash, or randomly generated number.
|
||||||
|
let sn = unsafe { core::slice::from_raw_parts(0x603d_c000 as *const u32, 4) };
|
||||||
|
crate::println!("Device serializer: {:08x}-{:08x}-{:08x}-{:08x}", sn[3], sn[2], sn[1], sn[0]);
|
||||||
crate::println!("Revocations:");
|
crate::println!("Revocations:");
|
||||||
crate::println!("Stage key0 key1 key2 key3");
|
crate::println!("Stage key0 key1 key2 key3");
|
||||||
let key_array = [
|
let key_array = [
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ pub(crate) fn generate_version(add_timestamp: bool) {
|
||||||
let semver = String::from_utf8_lossy(&gitver);
|
let semver = String::from_utf8_lossy(&gitver);
|
||||||
|
|
||||||
let version_file = "services/xous-ticktimer/src/version.rs";
|
let version_file = "services/xous-ticktimer/src/version.rs";
|
||||||
|
let boot_version_file = "bao1x-boot/boot1/src/version.rs";
|
||||||
|
|
||||||
// Read the existing file to see if it needs to be updated.
|
// Read the existing file to see if it needs to be updated.
|
||||||
let mut existing_data = Vec::new();
|
let mut existing_data = Vec::new();
|
||||||
|
|
@ -39,12 +40,14 @@ pub(crate) fn generate_version(add_timestamp: bool) {
|
||||||
write!(new_data, "#[allow(dead_code)]\npub const TIMESTAMP: &'static str = \"unavailable\";\n")
|
write!(new_data, "#[allow(dead_code)]\npub const TIMESTAMP: &'static str = \"unavailable\";\n")
|
||||||
.expect("couldn't add our timestamp");
|
.expect("couldn't add our timestamp");
|
||||||
}
|
}
|
||||||
|
let mut semver_code = Vec::new();
|
||||||
writeln!(
|
writeln!(
|
||||||
new_data,
|
semver_code,
|
||||||
"pub const SEMVER: &'static str = \"{}\";",
|
"pub const SEMVER: &'static str = \"{}\";",
|
||||||
semver.strip_suffix("\r\n").or(semver.strip_suffix('\n')).unwrap_or(&semver)
|
semver.strip_suffix("\r\n").or(semver.strip_suffix('\n')).unwrap_or(&semver)
|
||||||
)
|
)
|
||||||
.expect("couldn't add our semver");
|
.expect("couldn't add our semver");
|
||||||
|
new_data.extend_from_slice(&semver_code);
|
||||||
|
|
||||||
if existing_data != new_data {
|
if existing_data != new_data {
|
||||||
let mut vfile = OpenOptions::new()
|
let mut vfile = OpenOptions::new()
|
||||||
|
|
@ -55,6 +58,14 @@ pub(crate) fn generate_version(add_timestamp: bool) {
|
||||||
.open(version_file)
|
.open(version_file)
|
||||||
.expect("Can't open our version file for writing");
|
.expect("Can't open our version file for writing");
|
||||||
vfile.write_all(&new_data).expect("couldn't write new timestamp to version.rs");
|
vfile.write_all(&new_data).expect("couldn't write new timestamp to version.rs");
|
||||||
|
let mut vfile = OpenOptions::new()
|
||||||
|
.read(true)
|
||||||
|
.write(true)
|
||||||
|
.create(true)
|
||||||
|
.truncate(true)
|
||||||
|
.open(boot_version_file)
|
||||||
|
.expect("Can't open our version file for writing");
|
||||||
|
vfile.write_all(&semver_code).expect("couldn't write semver to version.rs");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue