Skip to content

Commit 90f8935

Browse files
committed
[nrf noup] boot/zephyr: improve S2RAM resume support using dedicated API
nrf-squash! [nrf noup] boot/zephyr: nRF54h20 resume from S2RAM (hardened) CONFIG_PM_S2RAM_RESUME_INTERMEDIARY=y allow to rework the resume from S2RAM code to work without PM_S2RAM mocking. Its allow to implement only what really needed from the MCUboot perspective. Signed-off-by: Andrzej Puzdrowski <[email protected]>
1 parent d0796dc commit 90f8935

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

boot/zephyr/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ zephyr_library_sources(
491491
)
492492
endif()
493493

494-
if(CONFIG_SOC_NRF54H20_PM_S2RAM_OVERRIDE)
494+
if(CONFIG_ARCH_PM_S2RAM_RESUME)
495495
zephyr_library_sources(${BOOT_DIR}/zephyr/nrf54h20_custom_s2ram.c)
496496
endif()
497497

boot/zephyr/nrf54h20_custom_s2ram.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,6 @@ volatile struct mcuboot_resume_s mcuboot_resume;
3030
COND_CODE_0(DT_FIXED_PARTITION_EXISTS(DT_NODELABEL(node_label)), (0), \
3131
(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL(node_label))))))
3232

33-
34-
int soc_s2ram_suspend(pm_s2ram_system_off_fn_t system_off)
35-
{
36-
(void)(system_off);
37-
return -1;
38-
}
39-
40-
void pm_s2ram_mark_set(void)
41-
{
42-
/* empty */
43-
}
44-
4533
struct arm_vector_table {
4634
uint32_t msp;
4735
uint32_t reset;
@@ -52,13 +40,13 @@ struct arm_vector_table {
5240
*/
5341
#define APP_EXE_START_OFFSET 0x800 /* nRF54H20 */
5442

55-
bool pm_s2ram_mark_check_and_clear(void)
43+
void pm_s2ram_mark_check_and_mediate(void)
5644
{
5745
uint32_t reset_reason = nrf_resetinfo_resetreas_local_get(NRF_RESETINFO);
5846

5947
if (reset_reason != NRF_RESETINFO_RESETREAS_LOCAL_UNRETAINED_MASK) {
6048
/* Normal boot */
61-
return false;
49+
return;
6250
}
6351

6452
/* S2RAM resume expected, do doublecheck */
@@ -92,6 +80,4 @@ bool pm_s2ram_mark_check_and_clear(void)
9280

9381
resume_failed:
9482
FIH_PANIC;
95-
96-
return true;
9783
}

0 commit comments

Comments
 (0)