From f6bf8f9bf1d99afe34924ae24329889ac4d63de0 Mon Sep 17 00:00:00 2001 From: bunnie Date: Wed, 4 Feb 2026 15:57:09 +0800 Subject: [PATCH] modify pddb size on key testing this allows for faster reboots through CI cycles as a state transition from secure->insecure always triggers a PDDB format --- libs/bao1x-api/Cargo.toml | 3 +++ libs/bao1x-api/src/offsets/baosec.rs | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/bao1x-api/Cargo.toml b/libs/bao1x-api/Cargo.toml index aeb417d07..0614934f1 100644 --- a/libs/bao1x-api/Cargo.toml +++ b/libs/bao1x-api/Cargo.toml @@ -26,6 +26,9 @@ arbitrary-int = "1.2" num_enum = { version = "0.5", default-features = false } [features] +# testing flag that causes the PDDB to be small +key-testing = [] + std = ["derive-rkyv", "xous-names", "xous-ipc"] derive-rkyv = ["rkyv"] bio = [] diff --git a/libs/bao1x-api/src/offsets/baosec.rs b/libs/bao1x-api/src/offsets/baosec.rs index 3b82d6516..a60ba4c3f 100644 --- a/libs/bao1x-api/src/offsets/baosec.rs +++ b/libs/bao1x-api/src/offsets/baosec.rs @@ -2,7 +2,6 @@ use xous::arch::PAGE_SIZE; use crate::offsets::{PartitionAccess, RwPerms, SlotIndex}; -// we actually have 16MiB on the initial prototypes, but constraining to smaller for cost reduction pub const SPI_FLASH_LEN: usize = 8192 * 1024; pub const SPI_FLASH_ID_MASK: u32 = 0xff_ff_ff; @@ -29,7 +28,10 @@ pub const SWAP_HEADER_LEN: usize = PAGE_SIZE; // PDDB takes up "the rest of the space" - about 4MiB envisioned. Should be // "enough" for storing a few hundred, passwords, dozens of x.509 certs, dozens of private keys, etc. pub const PDDB_ORIGIN: usize = SWAP_FLASH_ORIGIN + SWAP_FLASH_RESERVED_LEN; +#[cfg(not(feature = "key-testing"))] pub const PDDB_LEN: usize = SPI_FLASH_LEN - PDDB_ORIGIN; +#[cfg(feature = "key-testing")] +pub const PDDB_LEN: usize = 256 * 1024; // 256k - big enough to do something with, but much faster to init // Location of on-chip application segment, as offset from RRAM start pub const APP_RRAM_OFFSET: usize = 0;