1 /* 2 * (C) Copyright 2017 Rockchip Electronics Co., Ltd 3 * 4 * SPDX-License-Identifier: GPL-2.0+ 5 */ 6 7 #include <asm/suspend.h> 8 #include <common.h> 9 10 DECLARE_GLOBAL_DATA_PTR; 11 cpu_suspend_save(struct pm_ctx * ctx,unsigned long sp)12void cpu_suspend_save(struct pm_ctx *ctx, unsigned long sp) 13 { 14 gd->pm_ctx_phys = (phys_addr_t)ctx; 15 16 /* The content will be passed to cpu_do_resume as register sp */ 17 ctx->sp = sp; 18 ctx->cpu_resume_addr = (phys_addr_t)cpu_do_resume; 19 20 cpu_do_suspend(ctx->suspend_regs); 21 22 flush_dcache_all(); 23 } 24