Commit graph

3632 commits

Author SHA1 Message Date
bunnie
73fba43d04 fix emulation mode for baochip target after bringing up metal 2025-05-22 23:48:28 +08:00
bunnie
942a64ea3b fix saturation bug in index computation code 2025-05-21 18:22:30 +08:00
bunnie
f6aa07c20f add domain separator for gen2 keys 2025-05-21 18:22:12 +08:00
bunnie
4526e04abc cleanup some debug output in xous-swapper 2025-05-21 18:21:41 +08:00
bunnie
938f808a8a revert debug flag 2025-05-21 18:05:57 +08:00
bunnie
3004c4ab7f work around a weird feature flag not behaving as we expect 2025-05-21 18:04:02 +08:00
bunnie
8c7edaf107 add a "fake" implementation for the keystore
allows us to test pddb crate before final hardware arrives
2025-05-21 18:03:08 +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
fe190ea4f1 cleanup warning 2025-05-21 10:23:37 +08:00
bunnie
b63371a56f turn off autotest for now 2025-05-21 10:23:15 +08:00
bunnie
dd5e19878c update flash test routine to remove write flag request 2025-05-21 10:22:27 +08:00
bunnie
1810825744 add block erase routine 2025-05-21 10:20:23 +08:00
bunnie
6c9edc26a3 cleanup some of the HAL dependencies in PDDB
still have some...mysterious...problems around feature
flags that aren't being invoked when i think they should be.

but let's commit this checkpoint because I suspect I may need to
roll back to here several times and I try to figure out the
root cause of the issues.
2025-05-20 14:39:47 +08:00
bunnie
821c6ce47c cleanup dependency tree going down to the cramium-hal layer
remove features that we don't need so as to make the tree as
simple as possible to descend

in particular if we're just pinging the HAL layer for some simple
constants we don't have to pull in the hairball of std targets
2025-05-20 14:38:03 +08:00
bunnie
5d288ec9a8 cleanup dependencies to allow for hosted builds 2025-05-18 09:25:33 +08:00
bunnie
4251686c1f make the flash test optional based on the configuration
allow the console to be built for hosted targets
2025-05-18 09:25:01 +08:00
bunnie
9b13f46741 cleanup notes in toml file so i don't forget to toggle a loader flag 2025-05-18 04:41:21 +08:00
bunnie
de06522499 cleanup debug statement 2025-05-18 04:40:38 +08:00
bunnie
1a34847b19 implement the writepage mechanism
1 - lock the CPU
2 - go into userspace to do the write
3 - on exit from userspace, mark the page as swapped in the original
process so that if it tries to read the data it fetches a new clean
copy
4 - free the page from the RPT so the data can be grabbed later
5 - unlock the CPU
2025-05-18 04:30:52 +08:00
bunnie
24a70b0eb5 implement writepage mechanism, deprecate sync/dirty
writepage uses a *direct* memory message (no rkyv) for efficiency
this saves us an extra page spent on the sideband data shuffling
by loading those args directly into the cpu registers that
get shuttled along with a memory message (the now increasingly
misnamed "advisory" fields of length/valid).
2025-05-18 04:29:06 +08:00
bunnie
4c69961448 rework the test program
this uses the new writepage mechanism, and also tests a couple
of cases. not hard edge cases, but enough that we're not just
testing the 0 case.
2025-05-18 04:28:15 +08:00
bunnie
0bf3366911 attempted cleanup on the sync api to improve the race condition
unfortunately this doesn't get us all the way there. There
is always a chance that the call that marks a page as dirty
is not coupled closely enough to the actual update of the page
data. Without actual hardware support for this we can't use this
approach.
2025-05-17 16:28:57 +08:00
bunnie
7cad369a82 test cases for flash writing on real hardware
reading works fine

writing is still a work in progress.
2025-05-17 16:28:24 +08:00
bunnie
5db2b3449e remove unused "spinor" implementation now that access is delegated to swapper
the explicity "spinor" interface is no longer needed (or even
compatible!) because we now have the swap-mapped spinor layer

the main concern I have at this point is there is a potential race
condition between marking a page as dirty and when the data is actually
updated on the page. Some locking might be necessary to fix this,
but possibly it might be sufficient just to mark a page as dirty
immediately before it's written?

another option might be to handle the writes in an interrupt context
so that the write data + dirty mark are atomic. Need to think about
this a bit.
2025-05-16 19:16:20 +08:00
bunnie
432c2a528e implement dealloc dirty and write to flash
These routines provide for two types of behaviors:

1. deallocating dirty pages. Here, pages are unmapped from RAM
after they are committed to FLASH.

2. write dirty pages to flash. Here, pages are kept mapped in RAM
for future use, but the dirty bit is cleared. This allows the
pages to be quickly released in case of memory pressure.
2025-05-16 19:07:07 +08:00
bunnie
5e2472fa7f add dummy routines so code compiles for precursor target 2025-05-16 19:06:40 +08:00
bunnie
c68d8b1a77 prelim take at a HAL for cramium targets for flash read/write 2025-05-16 19:06:17 +08:00
bunnie
22a72125bd add precursor-hal to dependencies for xous-swapper 2025-05-16 19:05:52 +08:00
bunnie
7533e09f70 move swap abi into lib section; add syscall wrappers for dirty/sync 2025-05-16 19:05:09 +08:00
bunnie
3f96f876c7 more renode tests for flash access 2025-05-16 19:04:30 +08:00
bunnie
e47ed41726 add some prelim test routines for flash access 2025-05-16 19:04:12 +08:00
bunnie
230c577af0 update progress 2025-05-15 11:58:44 +08:00
bunnie
e34dbb4e6f implement a demonstration of successful map decoding of the spi flash request
this just puts dummy data in, next set of commits will do "live"
ROM access.
2025-05-15 11:58:03 +08:00
bunnie
148679af42 more constants location cleanup 2025-05-15 11:56:51 +08:00
bunnie
409e381c2d fix some bit-rotted constants in xous-swapper debug 2025-05-15 11:56:28 +08:00
bunnie
b962bfe26d add some test code for spi flash mapping
this is just to facilitate renode-based testing
2025-05-15 11:55:25 +08:00
bunnie
e2379821e6 republish xous-rs to fix cargo test 2025-05-11 15:36:17 +08:00
bunnie
8a4959056b bump version for xous crate update - commit so we can publish crates 2025-05-11 14:45:24 +08:00
bunnie
ed345ba4d7 cleanup dependency hacks from debbuging pddb issue 2025-05-11 14:42:26 +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
52ee66e1a5 migrate kernel-to-board platform constants for swapper 2025-05-11 12:46:01 +08:00
bunnie
805ebd22a3 revert a couple things that were not meant to be committed 2025-05-11 12:45:29 +08:00
bunnie
4ef4b22cfc incorporate hal migration into bao-console 2025-05-11 12:41:39 +08:00
bunnie
ca04a3ea82 incorporate arch migrations into early-settings 2025-05-11 12:37:51 +08:00
bunnie
ee6fb3ef4f arch migrations make PDDB_LEN harder to reach in modals
this constant was just used to create a "realistic" test case
instead of trying to add the dependency we just hard-code the
constant into the test case, because in the end what we wanted
was that specific constant to test a specific edge case of
a progress bar.
2025-05-11 12:36:46 +08:00
bunnie
42c6417e46 incorporate rach mirgations into net 2025-05-11 12:36:33 +08:00
bunnie
6de085657a incorporate arch migrations into dns 2025-05-11 12:36:20 +08:00
bunnie
a71873cb7a incorporate migrations into root-keys 2025-05-11 12:34:17 +08:00
bunnie
b6ab55c6b8 incorporate arch migration into shellchat 2025-05-11 12:33:50 +08:00