Commit graph

392 commits

Author SHA1 Message Date
bunnie
30ca5dec71 adjust disk space usage for lite platform 2026-04-05 23:23:11 +08:00
bunnie
3ac87613d1 add UI feedback on baosec targets for PDDB init
useful for MP flow progress monitoring
2026-03-06 19:17:43 +08:00
bunnie
49456db837 fix typos 2025-11-30 21:32:08 +08:00
bunnie
6df070e95e notify waiters that mount is successful 2025-11-27 17:57:24 +08:00
bunnie
69b77f3072 allow gen2 to use the seeded trng fill 2025-11-18 19:35:59 +08:00
bunnie
c3c86e857b improve pddb init 2025-11-12 22:08:01 +08:00
bunnie
f4b88ce964 fix deps in other build modes 2025-11-12 15:27:00 +08:00
bunnie
dd42267eb9 fix mount/format on boot ordering
pddb is working again in hardware, this time with real keys
2025-11-11 08:18:57 +08:00
bunnie
fa8325c2ed cleanup pddb for gen2 targets
gate out modals entirely from gen2 pddb

passwords in gen2 are now entirely handled outside of the
respective service crates, cleaning up the APIs

some history - on gen1 (precursor) devices, the thesis was to
reduce the amount of distance a password has to travel from
the point of a user entering it to the point of use. I think this
is academically interesting, but it pulls in a lot of code
into each service to manage the passwords, conflating services
with UI layers.

it was a nice experiment.

in gen2 (and hopefully beyond) targets, we now commit to
the idea that something else is passing in the sensitive key
materials. This means that, in fact, keying material has to
transition between process spaces, which increases the attack
surface to recover this. However, it also makes the crates
more portable and maintainable.

This is mitigated partially by the fact that in gen2 targets
the entirety of the code base runs within a piece of silicon,
so "sniffing" (passive observation of data going to memory)
attacks are a good bit harder.
2025-11-08 03:52:39 +08:00
bunnie
179e178e96 fix up formatting that changed due to the flag day 2025-09-18 21:31:54 +08:00
bunnie
1255bf12d9 FLAG DAY: fix all names to harmonize around 'bao1x'
The code base had evolved through several code names, interim
names, company names and chip names that alternatively did or did
not exist.

Baochip is the definitive name of the company, and the Baochip1x
(full part number BAO1X2S4F-WA) is the definitivey part number of
the SoC. For convenience, the part number is shortened to 'bao1x'
in most feature flags and variable references.

This commit fixes all of the odd names and removes some unmaintained
early targets.
2025-09-18 21:25:51 +08:00
bunnie
ecbac27e76 fix rustc-1.89 warnings 2025-08-19 19:45:29 +08:00
bunnie
6741cba3bd fix hosted mode config issue 2025-05-23 13:18:04 +08:00
bunnie
73fba43d04 fix emulation mode for baochip target after bringing up metal 2025-05-22 23:48:28 +08:00
bunnie
f6aa07c20f add domain separator for gen2 keys 2025-05-21 18:22:12 +08:00
bunnie
183916b548 first attempt at layering in a real SPI HAL into PDDB for gen2 targets 2025-05-21 10:23:51 +08:00
bunnie
230c577af0 update progress 2025-05-15 11:58:44 +08:00
bunnie
f76dd23067 fix weird PDDB dependency issue
more of a work-around than anything else. the observation is
the PDDB_A* series of constants aren't used outide of the crate
for gen2-targets and so we just remove it as a dependency in
the lib.rs side of things.

This clears up the cargo error we're getting. still don't know
why the dependency tree is not working for that particular target,
but someone is pulling a pddb dependency and it's not obvious who.
2025-05-11 14:40:19 +08:00
bunnie
fbcb59c69e migrations applied to pddb
still broken, there is a weird dependency problem on
board-baosec target that is still to be debugged, but
wanted to get everything committed so i can try bigger
experiments without losing state
2025-05-11 12:59:00 +08:00
bunnie
58f20057b4 update strategy 2025-05-10 08:22:38 +08:00
bunnie
c7225d227d migrate pddb size to board:: and fix boot init
the policy is to format the PDDB automatically on boot if
it can't be mounted.

Need to think about whether this is the right thing to do
or not for the product: if there is any sort of error, it will
just wipe the PDDB entirely, making it unrecoverable.

That being said, why would there be an error? if that happens,
something bad probably happened to the hardware. I feel like
if the SPI interface is reliable this shouldn't be a problem.
So the solution is to make sure the hardware is reliable...
on the other hand, fundamentally, SPI flash can wear out, so
this could aggravate problems at EOL for the device (i.e.
it will take small problems and "amplify them up" into a huge
problem).

The trade-off is...the auto-format makes the token "just work"
on boot. Maybe the right thing to do is to add some code that
checks to see if we're in a true blank state, and if so,
autoformat; and if it looks like something was there before,
prompt for a format?

tbd.
2025-05-08 16:06:42 +08:00
bunnie
fe599c2fe0 migrate lengths to board:: for gen2; fix opcode numbering bug
opcode numbering bug only affects test mode, fortunately. just
bit-rot from tests long not run...
2025-05-08 16:03:48 +08:00
bunnie
1a3b9131d1 reduce debug out put as this makes it hard to see what's going on in CI 2025-05-06 12:54:34 +08:00
bunnie
ef97e33ae4 fix pddb in doc-deps target 2025-05-06 03:15:51 +08:00
bunnie
89d6b0e81f debug checkpoint
left off at trying to debug the PDDB mount process.
2025-05-06 02:07:31 +08:00
bunnie
15dd0a7f17 cleanup warnings 2025-05-06 02:07:16 +08:00
bunnie
8e161d7e9d we're at least booting now and talking to the pddb service 2025-05-06 01:51:29 +08:00
bunnie
a4e86eead5 cleanup some gen1/gen2 differences 2025-05-06 01:49:42 +08:00
bunnie
1ee1239494 fix hosted mode lifetime issue 2025-05-05 01:52:43 +08:00
bunnie
34e9a1f1ce gen2 apis now compiling clean
system doesn't work yet because none of the keystore is there, but
at least we don't have conflicting/missing APIs
2025-05-05 01:49:39 +08:00
bunnie
c8db01c563 re-org rootkeys-api into common and generation-specific libraries 2025-05-04 19:05:58 +08:00
bunnie
9d6223d0b2 pddb migrations for keystore-api 2025-05-04 18:34:33 +08:00
bunnie
22433fa25c reconfigure toml files for pddb target testing
OK, i think this gets us to the starting point of shaving down
the PDDB crate from the restored baseline
2025-05-04 17:03:00 +08:00
bunnie
f9c42f6176 rollback pddb to previous known good state
restart the refactor process now that the modals arc is finished.
2025-05-04 16:40:13 +08:00
bunnie
142d55a2b7 this was meant to be committed with the previous commit 2025-05-04 16:34:12 +08:00
bunnie
abbffaaf20 more restructuring of pddb codebase
in particular, spinor driver stub does not belong in this crate
2025-05-04 03:34:01 +08:00
bunnie
e7a2c97ca3 some progress on compatibility 2025-04-29 22:32:59 +08:00
bunnie
54ba8c9cf7
Merge branch 'main' into pddb-feat-down 2025-02-01 22:29:55 +08:00
bunnie
4f14a67504 formatting changes due to changes in nightly rust
needed to get a clean check on gh
2025-02-01 22:26:40 +08:00
bunnie
858d7a739f part way through the main module, we have more clarity on the task
i think it's becoming clearer at this point that other elements
need to be implemented before we can attack this. leaving notes
and bread crumbs so I can come back to this branch later
2025-02-01 02:37:33 +08:00
bunnie
ecaab9041f add the hw module 2025-02-01 02:37:09 +08:00
bunnie
deb2b6ac53 add an interim shim for the spinor implementation
The Spinor struct will be pulled into the PDDB for the cramium
version. This is done in part to reduce the number of servers
(keep the memory footprint light) and also because the physical
spinor hardware is owned by the swapper crate (because the ROM
shares a bus with the swap RAM). So, all that is needed in
this case is a thin shim that can adapt the two APIs to be
compatible with each other.

THe currently checked in code is just a copy of the existing
spinor code tho - it has no bearing on reality, it's just there
as a placeholder that contains all the APIs.
2025-02-01 02:35:26 +08:00
bunnie
aea415cca8 figure out changes necessary at the external API level 2025-02-01 02:35:09 +08:00
bunnie
2ace34abee cleanup static mut warning in hosted mode 2024-12-02 18:54:44 +08:00
bunnie
e4e6db8bc9 fix implicit lifetime warning 2024-12-02 18:54:26 +08:00
bunnie
043dfd84ae update formatting to latest nightly rules 2024-09-24 01:49:45 +08:00
bunnie
2e9b19d62d fail, don't panic on serialization failure
this allows us to handle the error. probably should propagate
on to xous-ipc
2024-09-23 19:02:19 +08:00
bunnie
8cd1cef679 cleanup bulk read on PDDB
we don't have to pass a "size" field anymore; since we're end-offset
from pos, just pass pos and use that to chain records.
2024-09-23 18:07:50 +08:00
bunnie
cdc841124d fix a xous-ipc change but now conflated with reformatting 2024-09-23 14:18:45 +08:00
bunnie
4c7c9312c1 change xous-ipc api to 0.10.0 2024-09-23 00:24:48 +08:00