Commit graph

8608 commits

Author SHA1 Message Date
bunnie
4c1933414c fix off-by-one error in clip rect definition 2025-05-23 10:54:55 +08:00
bunnie
0f7ad13c08 only set dirty bits for precursor-like targets
This was introducing a mysterious "line" artifact on text rendering
in new systems.

Probably need to do some real on-device testing of this change
because the automated tests won't catch a dirty bit error on
the LCD.
2025-05-23 10:52:55 +08:00
bunnie
73fba43d04 fix emulation mode for baochip target after bringing up metal 2025-05-22 23:48:28 +08:00
bunnie
829f7e5b50
Merge pull request #647 from betrusted-io/pddb-baosec-bringup
Pddb baosec bringup
2025-05-21 18:25:49 +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
1d19076d4b commit test config 2025-05-21 18:06:10 +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
29017766f4 handle no domain separator case in keystore 2025-05-21 18:02:43 +08:00
bunnie
04c7933c87 handle case of write pages being swapped out upon write release 2025-05-21 18:02:21 +08:00
bunnie
831100a1f0 minor dependency cleanup 2025-05-21 10:24:43 +08:00
bunnie
163d9430ea current debug config
stash it here for now as we are going to roll back to see what's
going on.
2025-05-21 10:24:15 +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
70975fbff3 cleanup dependencies 2025-05-21 10:20:59 +08:00
bunnie
1810825744 add block erase routine 2025-05-21 10:20:23 +08:00
bunnie
19455d1bc0 add block erase routine 2025-05-21 10:20:04 +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
fa3ab1dea1 cleanup dependencies a bit
cramium-soc i think should be deprecated everywhere because
it is redundant with the board targets: anywhere you see a board
target that includes the crossbar soc it should also transitively
pull in the cramium-soc dependency equivalents.

we'll chase this out more later, but for now we're just trying
to get the PDDB to compile
2025-05-20 14:35:42 +08:00
bunnie
a26da3c3b2
Merge pull request #646 from betrusted-io/pddb-baosec-bringup
Fix hosted mode build targets
2025-05-18 09:32:49 +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
7947949589 add constant to precursor board file
this helps with cross-target builds...
2025-05-18 09:24:33 +08:00
bunnie
23c2b77ace fix hosted build 2025-05-18 09:24:22 +08:00
bunnie
90769df340
Merge pull request #645 from betrusted-io/pddb-baosec-bringup
Pddb baosec bringup
2025-05-18 04:49:38 +08:00
bunnie
d4a713b1ac cleanup build config 2025-05-18 04:41:41 +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
b1a8b6fdae cleanup some debug 2025-05-18 04:33:49 +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
640ee93820 cleanup loader
add a note about the dirty flag - it's not "dead" per se, I
think it is helpful to leave a bread crumb for future hw revs
that might have hardware-enforced dirty bit setting on the PTE.
2025-05-18 04:27:26 +08:00
bunnie
dff4dded64 remove yield_slice() in std target
This is a bad idea because yield_slice() causes the active
process to hand off to a new one (without an IRQ). However,
the idea of most flash operations is we really want them
atomic - we can't have something else decide to go and muck
with flash while say, we are waiting for a page erase to
complete. So, implement spin locking to block the CPU
during phases where the hardware operation is non-interruptable.
2025-05-18 04:25:37 +08:00
bunnie
289028fa48 deprecate sync/dirty and emplace the writepage syscall 2025-05-18 04:25:18 +08:00
bunnie
dfd82c94b8 refactor write page syscall for explicitly managed writing
this is a much simpler, race condition-free version of flash
writing which has the penalty of requiring a copy of the page
to be made by the caller before the write. However the
copy is mostly already paid for because on the initial access
to the page, we had to copy the flash into RAM.
2025-05-18 04:23:53 +08:00
bunnie
788efb3056 cleanup dirty-bit attempt to track pages 2025-05-18 04:23:20 +08:00
bunnie
3f3f64788c intermediate config on baosec target for debugging the flash writing 2025-05-17 16:30:06 +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
3a8e00eb3c map in the SPIM FLASH IFRAM pages to the swapper 2025-05-17 16:28:02 +08:00
bunnie
1a5a0a1388 attempt to fix race conditions is dirty/flush loop in swapper
this ultimately failed, we're going to try a different approach
2025-05-17 16:27:17 +08:00
bunnie
979ce7a589 add missing args to flush syscall 2025-05-17 16:26:51 +08:00
bunnie
d5d5f8bb74 lockfile changes due to prior commit 2025-05-16 19:18:46 +08:00