Add CUSTOM_ENCRYPT_KEY option and Fixes for PolarFire SDCard edge cases
#659
+102
−78
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
PolarFire SoC improvements: Add
CUSTOM_ENCRYPT_KEYoption for custom encryption key storage and fix MMC/eMMC write issues in the mpfs250 HAL.Commits
1. Support for CUSTOM_ENCRYPT_KEY
Adds the
CUSTOM_ENCRYPT_KEYbuild option, allowing customers to supply their own implementation for encryption key storage and retrieval.Use case: Useful when encryption keys need to be stored in secure hardware (HSM, secure enclave, TPM) or custom non-volatile storage rather than the default flash-based implementation.
How to enable:
CUSTOM_ENCRYPT_KEY=1to your.configOBJS_EXTRA=src/custom_encrypt_key.oRequired custom functions:
int wolfBoot_set_encrypt_key(const uint8_t *key, const uint8_t *nonce);
int wolfBoot_get_encrypt_key(uint8_t *key, uint8_t *nonce);
int wolfBoot_erase_encrypt_key(void);
int wolfBoot_initialize_encryption(void);
2. Fixes for mmc_write (mpfs250 HAL)
Fixes reliability issues with MMC/eMMC write operations on PolarFire SoC.
Key changes:
mmc_irq_handler()for proper interrupt-driven updatesmmc_send_cmd_internal()for consistencyTest results: