Commit graph

251 commits

Author SHA1 Message Date
bunnie
03c3f61ba3 fixes to encrypt/decrypt routines to adjust offsets etc. 2024-04-08 23:54:36 +08:00
bunnie
36173fde95 adjust ram available size when swap is enabled 2024-04-08 23:54:24 +08:00
bunnie
58ce8a2923 make resume not a default feature in renode
this is compensated for in xtask to put it back into
your usual builds, but it allows us to not have it in the
swap config.
2024-04-08 23:43:45 +08:00
bunnie
cd140769ac add code to map swap page tables into swapper memory space 2024-04-08 12:41:08 +08:00
bunnie
2b5fabb2fd add swap pt routines 2024-04-08 12:40:42 +08:00
bunnie
25cbf0dc67 add swap pt map handling 2024-04-08 12:40:23 +08:00
bunnie
287ad58c8a add the swapper PID as a constant 2024-04-08 12:39:52 +08:00
bunnie
379d4e81c5 cleanup swap top mod now that most of the implementation is done 2024-04-08 12:39:29 +08:00
bunnie
30b5be7a79 remove superfluous import 2024-04-08 12:39:07 +08:00
bunnie
6ce157b20d add swap handling to minielf 2024-04-08 12:38:42 +08:00
bunnie
63a8b51fe9 gate SDBG behind feature flag 2024-04-08 12:38:02 +08:00
bunnie
2ce579b221 phase 1 changes for swap 2024-04-07 22:37:40 +08:00
bunnie
26efde0a71 track address of the decrypt buffer 2024-04-07 22:36:54 +08:00
bunnie
a478af445d fix IniS arg copying. lay down boilerplate for phase 1 copy
the hard part - the core inner loop of the copy -- is still
to be done.
2024-04-07 19:01:09 +08:00
bunnie
8aa20e65f6 match new API for accessing swap 2024-04-07 19:00:18 +08:00
bunnie
bd54417e44 add routines for shuttling encrypted data to/from swap RAM region
RAM is assumed to be off-chip, and thus the data is encrypted
in the region. We also encrypt it in the Precursor case, even
though it's on-chip, because we want to capture this as a test case
in a known working environment.

Also incorporate some routines to generate the per-boot random
key for swap encryption.
2024-04-07 18:58:54 +08:00
bunnie
c07f33a169 track the current free page in swap ram 2024-04-07 18:58:31 +08:00
bunnie
417fa16a22 add rand_chacha as a dependency for the loader
this is needed in the cramium-soc case because the raw TRNG
does not have a whitener, it should not be used directly to
generate keys.
2024-04-07 18:57:23 +08:00
bunnie
f2a8603e55 merge encrypted swap argument structure into kernel arguments 2024-04-07 14:29:25 +08:00
bunnie
999cb320ed add a function to nab the decrypt buffer
HIGHLY unsafe, but saves us a decryption operation as we
interleave between the various states of the loader.
2024-04-07 14:28:31 +08:00
bunnie
35082c4688 add crc handling to loader
for patching the argument structure
2024-04-07 14:28:05 +08:00
bunnie
c53515fc63 coalesce swap hal into boot config object; read initial swap args
this worked, so it validates the encryption/decryption of the swap
at least!
2024-04-07 00:41:18 +08:00
bunnie
f86d63aa41 add tracking for swap-specific data structures in bootconfig 2024-04-07 00:40:33 +08:00
bunnie
c7e1f22cfa fix pointer issue in resolving swap config
also a bunch of latent debug in case we need to muck around again
2024-04-07 00:39:34 +08:00
bunnie
8f94ecaf6c limit AAD to 64 bytes 2024-04-07 00:39:05 +08:00
bunnie
71336ebf3e start to sketch in bits and pieces of the swap HAL
this is far from complete but needed to check in for the
build check to pass
2024-04-06 23:04:03 +08:00
bunnie
4bb7c87646 gate loader todo behind feature flag 2024-04-06 23:01:33 +08:00
bunnie
903b2219db gate loader features behind flag 2024-04-06 23:01:04 +08:00
bunnie
32857a70b0 add platform-dependent drivers for swap
precursor does direct memory mapping
cramium uses a qspi interface
2024-04-06 22:59:43 +08:00
bunnie
dddbc3c163 add aes-gcm-siv dependency to loader 2024-04-06 22:58:20 +08:00
bunnie
8bae95ef72 put placeholders for inis handling, phase 2 2024-04-06 07:47:18 -07:00
bunnie
c354b75d97 put placeholders to handle inis in phase1 2024-04-06 07:47:18 -07:00
bunnie
c37349778e put todo! placeholders for minielf handling of inis 2024-04-06 07:47:18 -07:00
bunnie
cdbd5dc0f4 add structure to differentiate image type
we now have three image types: inie, inif, inis; migrate
away from a simple "xip" flag to something that can differentiate
between all three options.
2024-04-06 07:47:18 -07:00
bunnie
13790fc5e4
remove debug-print from loader
this shouldn't be here in main.
2024-04-05 16:12:11 +08:00
bunnie
fbffd9878f absorb engine25519-as warning fixes 2024-03-25 08:07:26 +08:00
bunnie
7c944fb4db upgrade zeroize to latest API level 2024-02-08 14:02:58 +08:00
bunnie
37d35b8e27 add small memory option for fonts to loader 2024-01-29 03:34:03 +08:00
bunnie
e4b0362024 make space for fonts in loader + sig verification code 2024-01-28 16:02:12 +08:00
bunnie
f432968678 add fonts back into the loader for the cramium target 2024-01-28 02:15:48 +08:00
bunnie
474d42ff87 pull in improved API to loader 2024-01-27 16:53:15 +08:00
bunnie
1e93171575 turn of rkyv derives in kernel and loader, as these are no-std 2024-01-23 03:59:49 +08:00
bunnie
d981bbe550 add more features to the loader for the cramium target
this *shouldn't* break other builds because the loader has
its arguments set by xtask for every target explicitly.
2024-01-21 01:14:51 +08:00
bunnie
6786efbb01 add PL230/PIO test to bringup section 2024-01-20 21:32:20 +08:00
bunnie
47dbecfd0b print trng status on bringup boot 2024-01-20 16:17:02 +08:00
bunnie
798183fe95 add TRNG output to board bring-up test 2024-01-20 01:26:30 +08:00
bunnie
0e14761641 cleanup loader code path
- print a banner on boot even without bringup
- stylistic improvements
2024-01-19 23:21:40 +08:00
bunnie
f12ddb09cb uart Rx in loader now seems to work. 2024-01-18 19:09:49 +08:00
bunnie
6f81024c77 refactor loader to use cramium-hal primitives
this is instead of the raw bitbang stuff we were doing before.
2024-01-18 18:02:23 +08:00
bunnie
659796916a chore: cleanup typos in docs, comments 2024-01-15 02:16:43 +08:00