Commit graph

10340 commits

Author SHA1 Message Date
bunnie
3928240081 re-org of boot sequence to 'draft final' sequence
boot0, boot1 targets added to xtask, image creation setup
to relocate the start points of each image to these locations.
2025-09-29 13:27:11 +08:00
bunnie
003af0295a lockfile updates 2025-09-27 00:31:38 +08:00
bunnie
63e2834e9d return the key index that passed from sigcheck 2025-09-27 00:31:24 +08:00
bunnie
6768f87ce8 vendor in the curve25519-dalek for bao1x boot
The *only* change is to make fiat-crypto a non-optional dependency.
For some reason the .cargo/config.toml only half-activates the
feature, in that in the .rs code files the feature is included
but in the Cargo.toml file the dependency is, for some reason,
not enabled.
2025-09-27 00:30:10 +08:00
bunnie
2d0c456929 add vendored-in ed25519-dalek crate for boot environment
Light-fingered changes include:

- debug UART integration for debugging things
- patching the sha2 crate to use hardware acceleration

Most changes are in Cargo.toml, with the exception of the debug.rs
module that was introduced for print-debugging.
2025-09-27 00:29:09 +08:00
bunnie
84777e7d23 select fiat-crypto for default backend on baremetal builds 2025-09-26 22:57:56 +08:00
bunnie
bfede0a1f8 update builder api to match latest features for image signing 2025-09-26 22:57:39 +08:00
bunnie
f8967ebaec fix offsets in one way counter implementation 2025-09-26 22:57:27 +08:00
bunnie
2f3cf06c16 helps to actually copy the data into the hash engine 2025-09-26 22:57:10 +08:00
bunnie
f76b85c95e signature checking now works
also some light benchmarking code.
2025-09-26 22:56:49 +08:00
bunnie
094207fe40 add signatures API
this allows us to generate signatures using the same API
that we use to check 'em.
2025-09-26 22:56:19 +08:00
bunnie
d502aed5af refactor image creation to be cleaner
use struct-based API and bytemuck instead of manual byte serialization.
this is for the bao1x target, precursor still uses the legacy code.
2025-09-26 22:55:39 +08:00
bunnie
5b51da3ec0 add boot0 in help for xtask 2025-09-25 16:13:53 +08:00
bunnie
afba3040b3 cleanup print debugs in sha2 for bootloader 2025-09-25 16:13:25 +08:00
bunnie
a035bb669c add initial signature check code on bao1x 2025-09-25 16:13:09 +08:00
bunnie
889262d20c remove font mapping from bao-video; fonts are now in our space by default 2025-09-25 16:12:47 +08:00
bunnie
a8f90dd71b cleanup fonts out of the loader for bao1x target 2025-09-25 16:12:26 +08:00
bunnie
9434bb5383 style_macro is how fonts are added to bao1x
By adding a resolver to a given glyph set, the glyph set is
automatically pulled into the image.

Glyph set is now co-located in the bao-video process, instead
of the loader.

The orignial argument for putting the font data in the loader
is that it's a large, static blob; by putting it in the loader,
updates can be more compact, and fonts don't need to be schlepped
over every time you have an application update.

This came with consequences. It made verifying the loader more
complicated (because its memory space is split between the graphics
manager and root keys). It also means we have to fix the partition
size for the loader at "fairly large" for fonts, even if we don't
need all of them in all of the configs.

With baochip, we have swap memory! Off-chip memory is cheap and
only the fonts actually used by the host get mapped into main memory.
This means we don't have as much of a trade-off in terms of
cost for fonts if we put them in off-chip swap storage. Also,
the updates are split between swap and main memory, and the roadmap
includes an item for swap to be individually loadable programs
so that if the video server doesn't need an update, it won't be
pulled into the update set.
2025-09-25 16:08:36 +08:00
bunnie
7724e38ca1 cleand up fontmap 2025-09-25 16:08:27 +08:00
bunnie
2d5039568c genearted artifacts corresponding to template update 2025-09-25 16:08:06 +08:00
bunnie
f30ab0d98e remove fonts from loader for bao1x: update codegen template 2025-09-25 16:07:31 +08:00
bunnie
945ef16e37
Merge branch 'main' into bl0 2025-09-25 14:48:34 +08:00
bunnie
4cb93d258d
Merge pull request #687 from mammothbane/main
xtask: exit after printing help
2025-09-25 14:48:01 +08:00
Nathan Perry
fee06f0a32
xtask: exit after printing help
Causes the xtask build to print an error and exit if it doesn't
recognize the task argument. Just ran into this as a result of the
cramsoc -> bao1x rename in 1255bf1 -- the build wasn't recognizing
`baremetal-cramsoc` anymore but was proceeding with the compile anyway,
without setting the target or loader features.
2025-09-24 21:28:51 -04:00
bunnie
c1ab8972fa update boot offsets to handle embedded signature block 2025-09-25 00:00:13 +08:00
bunnie
bd7ca4fa32 add signature header to boot/baremetal regions
also make the link.x file update based on changes to that region's
length.
2025-09-24 23:59:12 +08:00
bunnie
198e584369 add adjustable signature sector sizes
can be smaller than 4k now because on baochip the erase sector
size is just 32 bytes.
2025-09-24 23:50:13 +08:00
bunnie
0fe5fcdc35 this autogenerated file should not be in the tree 2025-09-24 01:09:19 +08:00
bunnie
254fe8a879 ignore autogen file 2025-09-24 01:07:05 +08:00
bunnie
b3763af7d6 updates to lockfile for new crates 2025-09-24 01:05:44 +08:00
bunnie
a458b6a5cc change voltage target for lower frequencies 2025-09-24 01:05:25 +08:00
bunnie
c117d8020e add targets for boot0 2025-09-24 01:04:31 +08:00
bunnie
26fefa7e5b add modules and bitflags to bitbybit migration todo 2025-09-24 01:03:43 +08:00
bunnie
cd182e9efc remove Drop on no-std
this saves a whole bunch of glue code that never gets called
in no-std
2025-09-24 01:03:09 +08:00
bunnie
d02df71bf1 beginnings of ACRAM support 2025-09-24 01:02:53 +08:00
bunnie
497bb74624 add combohash support 2025-09-24 01:02:39 +08:00
bunnie
39142b4c18 add scaffolding for bao1x-boot and also the sha2 implementation for baremetal 2025-09-24 01:02:07 +08:00
bunnie
eb53319773
Merge pull request #685 from betrusted-io/fixups
fix missing api in precursor target from previous PR
2025-09-21 23:37:25 +08:00
bunnie
ff6ff8841a fix missing api in precursor target from previous PR
also fixup some warnings from the new rustc.
2025-09-21 23:33:37 +08:00
bunnie
902bb23b20
Merge pull request #684 from betrusted-io/autostatics
Autostatics
2025-09-21 21:56:23 +08:00
bunnie
936be0311d update dependencies for auto-statics 2025-09-21 21:53:01 +08:00
bunnie
6e19c4b871 convert baremetal to use autostatics 2025-09-21 21:52:38 +08:00
bunnie
110d39936d convert loader to use autostatics 2025-09-21 21:52:24 +08:00
bunnie
19ebb5196c update xtask to handle new autostatics method 2025-09-21 21:52:10 +08:00
bunnie
a3a7bf9f3a add a format for passing static initialized data to baremetal
a small, 256-byte record is added to the top of baremetal records
that is a "poke table" that incorporates what values to put where
for baremetal targets, as well as a zeroization region.

This is generally more efficient because most values are set to
zero, and the only things that generally have a non-zero value
are 'static' variables, which are used extremely sparingly.
2025-09-21 21:50:48 +08:00
bunnie
024c8131bc extend image builder to handle baking in statics 2025-09-21 21:50:31 +08:00
bunnie
8d19be2784
Merge pull request #683 from betrusted-io/verilate-fixes
Verilate fixes
2025-09-20 22:41:45 +08:00
bunnie
901e8e1ee2 ignore the soc.svd target if it appears in utralib 2025-09-20 22:16:45 +08:00
bunnie
5151553028 fix dabao target for lib1x-hal
this is the "effective" traget for simulation: no external
peripherals expected.
2025-09-20 22:16:16 +08:00
bunnie
4f8169c3d9 fixup rand for simulation target
TRNG doesn't exist in simulation - substitute it for a
deterministic PRNG when the simulation target is specified.
2025-09-20 22:13:16 +08:00