From ba817cc1a940c3db9ccfcb3746255c053671ca3b Mon Sep 17 00:00:00 2001 From: bunnie Date: Mon, 29 Sep 2025 16:20:43 +0800 Subject: [PATCH] add uf2 identifier for baochip-1x just pulled it out of a uuid generator, checked it has no collisions. At some point, maybe some official repo will allow us to be "real" but ain't nobody got time for those politics today. --- libs/bao1x-api/src/lib.rs | 4 ++++ libs/bao1x-api/src/offsets.rs | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/libs/bao1x-api/src/lib.rs b/libs/bao1x-api/src/lib.rs index c4e9a3b25..a9b96d444 100644 --- a/libs/bao1x-api/src/lib.rs +++ b/libs/bao1x-api/src/lib.rs @@ -17,6 +17,10 @@ pub mod sce; pub mod signatures; pub use offsets::*; +/// UF2 Family ID. Randomly generated, no collisions with the known list, still to be merged +/// into the "official" list +pub const BAOCHIP_1X_UF2_FAMILY: u32 = 0xa7d7_6373; + /// Constants used by both emulation and hardware implementations pub const PERCLK: u32 = 100_000_000; pub const SERVER_NAME_KBD: &str = "_Matrix keyboard driver_"; diff --git a/libs/bao1x-api/src/offsets.rs b/libs/bao1x-api/src/offsets.rs index 89b5dc549..b89ea4971 100644 --- a/libs/bao1x-api/src/offsets.rs +++ b/libs/bao1x-api/src/offsets.rs @@ -6,6 +6,11 @@ pub const BOOT1_START: usize = 0x6002_0000; pub const LOADER_START: usize = 0x6006_0000; pub const BAREMETAL_START: usize = LOADER_START; pub const KERNEL_START: usize = 0x6008_0000; +// loadable apps all "start" at this address for UF2 updates +// however these are remapped into external flash based on a defragmentation table +// and app ID. The app ID also has to get encoded into this offset, likely to be +// stuck in bits 24-27, to give up to 16 app slots of up to 8MiB in size. +pub const APP_START_UF2: usize = 0x7000_0000; // Define a trait with just the offset pub trait OneWayEncoding: TryFrom {