Skip to content

Commit

Permalink
Add PSA support in old update client
Browse files Browse the repository at this point in the history
1. Add configuration UPDATE_CLIENT_STORAGE_PSA for PSA Firmware Update
2. Fix compile errors for PSA targets having no ARM_UC_FEATURE_PAL_FLASHIAP support
3. Support in-transit hash validation for targets like PSA having no read permission and unable to do read-back hash validation from storage
  • Loading branch information
ccli8 committed Aug 23, 2021
1 parent d7edc52 commit 4bda366
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions update-client-hub/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
"delta-storage-size": {
"help": "Total storage allocated for delta image. This config item is only for multicast update.",
"value": null
},
"in-transit-hash-validation": {
"help": "Calculate payload hash in transit and not by reading back from storage. Useful on platforms without read permission.",
"value": 0
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,18 @@ ARM_UC_FEATURE_SIMPLE_COAP_SOURCE
#define ARM_UC_FEATURE_PAL_LINUX 0
#define ARM_UC_FEATURE_PAL_RTL8195AM 1

#elif defined(UPDATE_CLIENT_STORAGE_PSA)
#define ARM_UC_FEATURE_PAL_FLASHIAP 0
#define ARM_UC_FEATURE_PAL_FLASHIAP_MCUBOOT 0
#define ARM_UC_FEATURE_PAL_BLOCKDEVICE 0
#define ARM_UC_FEATURE_PAL_FILESYSTEM 0
#define ARM_UC_FEATURE_PAL_LINUX 0
#define ARM_UC_FEATURE_PAL_RTL8195AM 0
#define ARM_UC_FEATURE_PAL_PSA 1
/* Disable ARM_UC_FEATURE_DELTA_PAAL which relies on ARM_UC_FEATURE_PAL_FLASHIAP */
#undef ARM_UC_FEATURE_DELTA_PAAL
#define ARM_UC_FEATURE_DELTA_PAAL 0

#else /* support legacy configuration method for storage */

#if defined(ARM_UC_USE_PAL_BLOCKDEVICE) && (ARM_UC_USE_PAL_BLOCKDEVICE == 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,14 @@ static void arm_uc_internal_event_handler(uintptr_t event)
{
switch (event) {
case ARM_UC_PAAL_EVENT_FINALIZE_DONE:
#if defined(ARM_UC_FEATURE_PAL_PSA) && (ARM_UC_FEATURE_PAL_PSA == 1)
/* PAL using like PSA FWU API doesn't support storage read of firmware candidate (no psa_fwu_read()).
* Disable storage hash validation. */
event = UCFM_EVENT_FINALIZE_DONE;
arm_uc_signal_ucfm_handler(event);
#else
event_handler_finalize();
#endif
break;
case ARM_UC_PAAL_EVENT_READ_DONE:
if (ARM_UC_HUB_getState() == ARM_UC_HUB_STATE_WAIT_FOR_MULTICAST ||
Expand Down

0 comments on commit 4bda366

Please sign in to comment.