File tree Expand file tree Collapse file tree 3 files changed +32
-17
lines changed Expand file tree Collapse file tree 3 files changed +32
-17
lines changed Original file line number Diff line number Diff line change @@ -496,7 +496,8 @@ if(CONFIG_MCUBOOT_CLEANUP_ARM_CORE)
496
496
)
497
497
endif ()
498
498
499
- if (CONFIG_SOC_NRF54H20_PM_S2RAM_OVERRIDE)
499
+ if (CONFIG_SOC_PRE_RAM_HOOK)
500
+ zephyr_library_sources(${BOOT_DIR} /zephyr/nrf54h20_custom_s2ram.S)
500
501
zephyr_library_sources(${BOOT_DIR} /zephyr/nrf54h20_custom_s2ram.c)
501
502
endif ()
502
503
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2025, Nordic Semiconductor ASA
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ /**
8
+ * @file
9
+ * @brief ARM Cortex-M suspend-to-RAM resume intermediary code (S2RAM)
10
+ */
11
+
12
+ #include <zephyr/toolchain.h>
13
+ #include <zephyr/arch/cpu.h>
14
+
15
+ GTEXT(pm_s2ram_mark_check_and_mediate)
16
+
17
+ GTEXT(soc_pre_ram_hook)
18
+ SECTION_FUNC(TEXT, soc_pre_ram_hook)
19
+ #if DT_NODE_EXISTS(DT_NODELABEL(pm_s2ram_stack)) &&\
20
+ DT_NODE_HAS_COMPAT(DT_NODELABEL(pm_s2ram_stack), zephyr_memory_region)
21
+ ldr r0, =DT_REG_ADDR(DT_NODELABEL(pm_s2ram_stack)) + DT_REG_SIZE(DT_NODELABEL(pm_s2ram_stack))
22
+ #else
23
+ #error "The support of bridge for S2RAM resume requires dedicated small stack"
24
+ #endif
25
+ msr msp, r0
26
+ push {r0, lr}
27
+ bl pm_s2ram_mark_check_and_mediate
28
+ pop {r0, pc}
Original file line number Diff line number Diff line change @@ -30,18 +30,6 @@ volatile struct mcuboot_resume_s mcuboot_resume;
30
30
COND_CODE_0(DT_FIXED_PARTITION_EXISTS(DT_NODELABEL(node_label)), (0), \
31
31
(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL(node_label))))))
32
32
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
-
45
33
struct arm_vector_table {
46
34
uint32_t msp ;
47
35
uint32_t reset ;
@@ -52,13 +40,13 @@ struct arm_vector_table {
52
40
*/
53
41
#define APP_EXE_START_OFFSET 0x800 /* nRF54H20 */
54
42
55
- bool pm_s2ram_mark_check_and_clear (void )
43
+ void pm_s2ram_mark_check_and_mediate (void )
56
44
{
57
45
uint32_t reset_reason = nrf_resetinfo_resetreas_local_get (NRF_RESETINFO );
58
46
59
47
if (reset_reason != NRF_RESETINFO_RESETREAS_LOCAL_UNRETAINED_MASK ) {
60
48
/* Normal boot */
61
- return false ;
49
+ return ;
62
50
}
63
51
64
52
/* S2RAM resume expected, do doublecheck */
@@ -92,6 +80,4 @@ bool pm_s2ram_mark_check_and_clear(void)
92
80
93
81
resume_failed :
94
82
FIH_PANIC ;
95
-
96
- return true;
97
83
}
You can’t perform that action at this time.
0 commit comments