File tree Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -357,14 +357,21 @@ zephyr_udc0: &usbhs {
357
357
};
358
358
359
359
/* temporary stack for S2RAM resume logic */
360
- pm_s2ram_stack: cpuapp_s2ram_stack@22007fd0 {
360
+ pm_s2ram_stack: cpuapp_s2ram_stack@22007fcc {
361
361
compatible = "zephyr,memory-region", "mmio-sram";
362
- reg = <0x22007fd0 16>;
362
+ reg = <0x22007fcc 16>;
363
363
zephyr,memory-region = "pm_s2ram_stack";
364
364
};
365
365
366
+ /* run-time common mcuboot S2RAM support section */
367
+ mcuboot_s2ram: cpuapp_s2ram@22007fdc {
368
+ compatible = "zephyr,memory-region", "mmio-sram";
369
+ reg = <0x22007fdc 4>;
370
+ zephyr,memory-region = "mcuboot_s2ram_context";
371
+ };
372
+
366
373
/* run-time common S2RAM cpu context RAM */
367
- pm_s2ram: cpuapp_s2ram@22007fe0 {
374
+ pm_s2ram: cpuapp_s2ram@22007fe0 {
368
375
compatible = "zephyr,memory-region", "mmio-sram";
369
376
reg = <0x22007fe0 32>;
370
377
zephyr,memory-region = "pm_s2ram_context";
Original file line number Diff line number Diff line change @@ -219,10 +219,24 @@ static void fpu_restore(_fpu_context_t *backup)
219
219
#endif /* !defined(CONFIG_FPU_SHARING) */
220
220
#endif /* defined(CONFIG_FPU) */
221
221
222
+ #if DT_NODE_EXISTS (DT_NODELABEL (mcuboot_s2ram )) && \
223
+ DT_NODE_HAS_COMPAT (DT_NODELABEL (mcuboot_s2ram ), zephyr_memory_region )
224
+ /* Linker section name is given by `zephyr,memory-region` property of
225
+ * `zephyr,memory-region` compatible DT node with nodelabel `mcuboot_s2ram`.
226
+ */
227
+ __attribute__((section (DT_PROP (DT_NODELABEL (mcuboot_s2ram ), zephyr_memory_region ))))
228
+ volatile struct mcuboot_resume_s _mcuboot_resume ;
229
+
230
+ #define SET_MCUBOOT_RESUME_MAGIC () _mcuboot_resume.magic = MCUBOOT_S2RAM_RESUME_MAGIC
231
+ #else
232
+ #define SET_MCUBOOT_RESUME_MAGIC ()
233
+ #endif
234
+
222
235
int soc_s2ram_suspend (pm_s2ram_system_off_fn_t system_off )
223
236
{
224
237
int ret ;
225
238
239
+ SET_MCUBOOT_RESUME_MAGIC ();
226
240
scb_save (& backup_data .scb_context );
227
241
#if defined(CONFIG_FPU )
228
242
#if !defined(CONFIG_FPU_SHARING )
Original file line number Diff line number Diff line change 10
10
#ifndef _ZEPHYR_SOC_ARM_NORDIC_NRF_PM_S2RAM_H_
11
11
#define _ZEPHYR_SOC_ARM_NORDIC_NRF_PM_S2RAM_H_
12
12
13
+ #define MCUBOOT_S2RAM_RESUME_MAGIC 0x75832419
14
+
15
+ struct mcuboot_resume_s {
16
+ uint32_t magic ; /* magic value to identify valid structure */
17
+ };
18
+
13
19
/**
14
20
* @brief Save CPU state on suspend
15
21
*
You can’t perform that action at this time.
0 commit comments