Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iMXRT support #28

Merged
merged 14 commits into from Oct 23, 2023
Merged

iMXRT support #28

merged 14 commits into from Oct 23, 2023

Conversation

thebolt
Copy link
Contributor

@thebolt thebolt commented Oct 23, 2023

This adds support for ARMv7M / iMXRT as well as a few minor bugfixes found while doing the port.

This means that defconfig does not have to be copied to .config.
Also it properly expands to a full config, so the Makefile has
access to all config values, including default values
Allows setting a custom main linker file, and also supply a different
default for when building into a flash (execute-in-place XIP) and ram
combination.
Previously it would result in NULL ptr dereferences if less than
CONFIG_CRYPTO_MAX_HASH_OPS or CONFIG_CRYPTO_MAX_DSA_OPS operations
had been registered
Adds basic support for ARMv7-M CPUs (most commonly Cortex-M4 and M7 range),
without support for MMU.
This adds (limited) iMXRT support, with certain things missing or not
implemented yet. Notable parts not yet supported:

 - Key revokation, including querying for revoked keys.
 - SLC fusing
 - UART/console is hard-coded
 - No boot reason detection
On bare metal systems we might not want to verify the partitions inside
a bpak header, so split auth_header into two functions to allow reuse
of the hashing and signature verification part.
This version of the helper will copy partitions from one source range
to a destination range, such as from (memory mapped) flash to RAM and
do payload hashing of it for boot authentication.

In the future this could be accelerated via the crypto api for platforms
that has accelerators that do copy+hash in one go, such as iMXRT
…processing

This lets board logic totally control the reading/copying and authentication
of the next image to boot. Potentially dangerous but required to handle
cases where for example board-specific logic decides between multiple
in-memory boot images.
When _not_ selecting all of the CONFIG_MBEDTLS_MD_ values, ensure
to only build and register the parts configured and built with.
Select asm optimizations as well as ECP optimizations. Slightly increases
binary size but payoff is big.
@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

Merging #28 (1785dd2) into master (ca877e2) will decrease coverage by 1.61%.
The diff coverage is 33.33%.

@@            Coverage Diff             @@
##           master      #28      +/-   ##
==========================================
- Coverage   68.15%   66.54%   -1.61%     
==========================================
  Files          54       54              
  Lines        2795     2828      +33     
==========================================
- Hits         1905     1882      -23     
- Misses        890      946      +56     
Files Coverage Δ
src/crypto.c 35.63% <100.00%> (-31.79%) ⬇️
src/drivers/crypto/mbedtls/mbedtls_pb.c 94.18% <ø> (ø)
src/main.c 50.00% <ø> (ø)
src/boot/boot.c 75.17% <42.10%> (-0.39%) ⬇️
src/boot/image_helpers.c 71.42% <22.22%> (-11.91%) ⬇️

... and 1 file with indirect coverage changes

@jonasblixt jonasblixt merged commit f39c785 into jonasblixt:master Oct 23, 2023
1 of 4 checks passed
@thebolt thebolt deleted the imxrt-support branch October 24, 2023 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants