Commit graph

381 commits

Author SHA1 Message Date
bunnie
d75624cfe4 reduce fclk on target, reoragnize feature flags into groups
Not all chips can hit rated speed, so for bringup we're defaulting
to the slower setting.
2024-06-19 21:33:14 +08:00
bunnie
8838fa6162 add loader test mode for entropy output 2024-06-18 00:08:57 +08:00
bunnie
c6a0f7f629 apply more autoformat. Why did that not trigger on save? 2024-06-16 02:34:46 +08:00
bunnie
8414f08aae autoformat the logo file 2024-06-16 02:10:27 +08:00
bunnie
d40e92b52d add code to dump the TRNG output via the DUART
gotta move on to other things, can't fully debug the USB
serial thing now. :-/
2024-06-16 02:07:33 +08:00
bunnie
28ab6ae311 add a quick-on boot logo in the loader
the swap load can take a little while, so a graphic at power-on
makes the UI feel more smooth
2024-06-16 01:53:45 +08:00
bunnie
975b44f894 improve visibility of setup_port so it can be re-used 2024-06-16 01:53:00 +08:00
bunnie
84fe4c96ff fix seeding algorithm
- use proper seeding of entire state
- chacha8 does not evolve internal state when extracting the seed,
so we have to run the cipher some to force mixing of the seed
state.
2024-06-15 00:37:38 +08:00
bunnie
7743d96e91
Merge branch 'main' into trng-test 2024-06-14 19:17:11 +08:00
bunnie
0fd6ad7c0e
Merge branch 'main' into new-rust-warnings 2024-06-14 19:14:02 +08:00
bunnie
0036c46ea1 clean up warnings in the latest rust 2024-06-14 19:10:18 +08:00
bunnie
eceea1db0b re-introduce the boot delay 2024-06-14 16:08:45 +08:00
bunnie
f91cab4f5d harden swap key generation
trng entropy rate is low, so get a lot of it before using anything
out of the pool.
2024-06-14 16:08:15 +08:00
bunnie
b72a00dd2d restore fonts into loader 2024-06-13 22:04:30 +08:00
bunnie
76fb67dbe6 add global SFR setup for TRNG proper operation inside loader 2024-06-13 15:43:18 +08:00
bunnie
cf99fd99eb trng baseline test code 2024-06-13 00:35:02 +08:00
bunnie
ac7b58b702 trying to back-trace to a working bootloader state 2024-06-10 18:45:44 +08:00
bunnie
99be442d16 working demo of first couple packets in loader 2024-06-09 23:51:30 +08:00
bunnie
971bfea83d more telemetry on boot
also, it seems that some amount of boot setup is necessary
for stability? unsure, this has to be chased out, but later.
2024-06-08 00:52:11 +08:00
bunnie
9f43e1df0a fix edgecase in nocopy section
do not try to decrypt data for sections that are nocopy,
this can lead to spurious decryption errors
2024-06-06 22:19:42 +08:00
bunnie
519ae31485 loader mods to harmonize with driver bounds 2024-06-06 17:55:10 +08:00
bunnie
8ef46fd081 move usb driver to a common location 2024-06-06 03:58:35 +08:00
bunnie
4261e70d3f update usb test 2024-06-05 22:54:27 +08:00
bunnie
65df5b3066 remove uccr structure
the ram-mapped uccr structure does not guarantee synchronization
well enough. go back to UTRA functions. This gets us to the point
of setup packets!
2024-06-05 22:50:48 +08:00
bunnie
545b51e8d3 rote port of C driver into Rust
lots of terrible stuff going on, nothing tested, but we have
a baseline of whatever they put in C directly forced into Rust.

A lot of really naughty things going on with raw pointers in this
driver -- it's going to be a challenge to oxidize.
2024-06-05 02:24:12 +08:00
bunnie
df6528edcf refactor to use structured usb object 2024-06-03 17:04:47 +08:00
bunnie
9673624a4e add usb register model and basic init structs 2024-06-03 17:04:21 +08:00
bunnie
e415fd44e7 start to lay in foundations for USB integration 2024-06-01 13:35:31 +08:00
bunnie
5f42ee6ecf move PFD into happy zone
apparently we were not running it in its recommended band before.
2024-05-31 22:34:28 +08:00
bunnie
968440ec7e add stand-alone IRQ testing to the loader environment
The loader bringup now has some IRQ testing built into it.
Couldn't actually get an IRQ to trigger, but it has to do something
more with me not getting the RV IRQ machine bits configured right
than anything else. However, the stub is useful for confirming
which IRQ bits actually fire on the UDMA UART implementation,
which is the big point. There's an ambiguity in the wiring
of the UDMA block which isn't explained at all, which is the
fact that there's an RX interrupt and an RX_CHAR interrupt.

I still don't know what RX_CHAR does, but the RX interrupt
does fire when a character is received, so that's the one
we're going to use.
2024-05-31 03:36:08 +08:00
bunnie
8d0a1f2ae6 reminder to self about some tech debt 2024-05-24 23:57:47 +08:00
bunnie
3fd383a7aa approximate cram target better in precursor staging environment 2024-05-23 16:51:20 +08:00
bunnie
aa8d84f007 print a message if memory reads timeout 2024-05-23 14:48:11 +08:00
bunnie
818372a604 report timeouts during the SPIM test in the loader 2024-05-22 18:10:32 +08:00
bunnie
e705dba13f quite down swap debug in loader 2024-05-21 17:57:41 +08:00
bunnie
32a9413f34 cleanup warnings when debug-print is off 2024-05-21 17:57:24 +08:00
bunnie
bae408b466 fix app_uart default memory mapping
was pointing to the wrong uart initially >_<
2024-05-21 16:33:11 +08:00
bunnie
71d7a2a3ae update api in test routine 2024-05-21 16:33:03 +08:00
bunnie
2e1ad6e1a4 remove T:Copy bounds on bzero
not quite sure why it is even there, might just be a thing from
really old code we never removed. Removing this allows us to
specify pointer types to non-copy elements, making Rust do
the hard work of figuring out how big of a block we need to zero.
2024-05-21 16:02:59 +08:00
bunnie
0153b3b96e allow guard memory to be differentiated across platforms 2024-05-21 16:00:56 +08:00
bunnie
8b487361b2 clean up bzero
some errors were made in clearing memory because we weren't
using the Rust type system to our advantage. This cleans up
the phase 1 loader to use the native types of the block plus
the slice length we intend to create to block-zero the correct
region size.

also simplify mem::size_of to size_of
2024-05-21 15:58:10 +08:00
bunnie
a57945e2c0 add helper to extract vaddr prefixes (used by swapper to fliter candidates) 2024-05-21 03:46:29 +08:00
bunnie
b7becf27e7 quiet down warnings when debug-print is off
because the print! macro becomes a dummy when debug printing is
off, we get a bunch of warnings about unused variables because
the print! arguments aren't used. Add _ before variable names
to quiet these warnings.
2024-05-21 01:52:30 +08:00
bunnie
75e938680d fix page table explanation to match reality better 2024-05-21 01:03:19 +08:00
bunnie
37109b19a8 fix ordering of the SwapAlloc for BinaryHeap impl 2024-05-16 03:52:22 +08:00
bunnie
e75f6d80db tone down some debug output 2024-05-16 03:51:59 +08:00
bunnie
03515934df clarify function of the thread context area 2024-05-16 03:51:38 +08:00
bunnie
6d01e69faf fix debug formatting 2024-05-16 03:51:03 +08:00
bunnie
ef5388a30e ensure that process descriptors aren't swapped out 2024-05-15 02:38:24 +08:00
bunnie
f66debdd01 make susres page ownership not hard coded; mark PTs as wired
also marks the ProcessImpl page as wired too
2024-05-15 02:31:40 +08:00