File tree Expand file tree Collapse file tree 3 files changed +23
-3
lines changed
Expand file tree Collapse file tree 3 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -349,11 +349,11 @@ zephyr_udc0: &usbhs {
349349
350350/ {
351351 soc {
352- /* run-time common S2RAM cpu context RAM */
353- pm_s2ram : cpuapp_s2ram@22007fe0 {
352+ /* run-time common mcuboot S2RAM support section */
353+ mcuboot_s2ram : cpuapp_s2ram@22007fe0 {
354354 compatible = "zephyr,memory-region", "mmio-sram";
355355 reg = <0x22007fe0 32>;
356- zephyr,memory-region = "pm_s2ram_context ";
356+ zephyr,memory-region = "mcuboot_s2ram_context ";
357357 };
358358 };
359359};
Original file line number Diff line number Diff line change @@ -219,10 +219,24 @@ static void fpu_restore(_fpu_context_t *backup)
219219#endif /* !defined(CONFIG_FPU_SHARING) */
220220#endif /* defined(CONFIG_FPU) */
221221
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+ struct mcuboot_resume_s _mcuboot_resume ;
229+
230+ #define SET_MCUBOOT_RESUME_MAGIC () do {_mcuboot_resume.magic = MCUBOOT_S2RAM_RESUME_MAGIC;} while (0)
231+ #else
232+ #define SET_MCUBOOT_RESUME_MAGIC ()
233+ #endif
234+
222235int soc_s2ram_suspend (pm_s2ram_system_off_fn_t system_off )
223236{
224237 int ret ;
225238
239+ SET_MCUBOOT_RESUME_MAGIC ();
226240 scb_save (& backup_data .scb_context );
227241#if defined(CONFIG_FPU )
228242#if !defined(CONFIG_FPU_SHARING )
Original file line number Diff line number Diff line change 1010#ifndef _ZEPHYR_SOC_ARM_NORDIC_NRF_PM_S2RAM_H_
1111#define _ZEPHYR_SOC_ARM_NORDIC_NRF_PM_S2RAM_H_
1212
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+
1319/**
1420 * @brief Save CPU state on suspend
1521 *
You can’t perform that action at this time.
0 commit comments