Skip to content

Commit 0f8905c

Browse files
committed
[nrf fromlist] platform: Add empty HW counter lock implementation
Add a dummy, empty function to all existing HW based counters implementations. Upstream PR #: 2543 Signed-off-by: Tomasz Chyrowicz <[email protected]>
1 parent 4efde5a commit 0f8905c

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

boot/cypress/MCUBootApp/cy_security_cnt.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,12 @@ boot_nv_security_counter_update(uint32_t image_id, uint32_t img_security_cnt)
4242
/* Do nothing. */
4343
return 0;
4444
}
45+
46+
int32_t
47+
boot_nv_security_counter_lock(uint32_t image_id)
48+
{
49+
(void)image_id;
50+
51+
/* Do nothing. */
52+
return 0;
53+
}

sim/mcuboot-sys/csupport/security_cnt.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,10 @@ int32_t boot_nv_security_counter_update(uint32_t image_id, uint32_t img_security
4040
return sim_set_nv_counter_for_image(image_id, img_security_cnt);
4141
}
4242

43+
int32_t boot_nv_security_counter_lock(uint32_t image_id) {
44+
MCUBOOT_LOG_INF("Locking security counter value for image: %d\n", image_id);
45+
46+
return sim_set_nv_counter_for_image(image_id, img_security_cnt);
47+
}
48+
4349
#endif /* MCUBOOT_HW_ROLLBACK_PROT */

0 commit comments

Comments
 (0)