2 * Copyright 2014 Freescale Semiconductor, Inc.
4 * SPDX-License-Identifier: GPL-2.0+
8 #include <asm/immap_85xx.h>
11 DECLARE_GLOBAL_DATA_PTR;
13 void __weak board_mem_sleep_setup(void)
17 void __weak board_sleep_prepare(void)
21 bool is_warm_boot(void)
23 struct ccsr_gur __iomem *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
25 if (in_be32(&gur->scrtsr[0]) & DCFG_CCSR_CRSTSR_WDRFR)
31 void fsl_dp_disable_console(void)
33 gd->flags |= GD_FLG_SILENT | GD_FLG_DISABLE_CONSOLE;
37 * When wakeup from deep sleep, the first 128 bytes space
38 * will be used to do DDR training which corrupts the data
39 * in there. This function will restore them.
41 static void dp_ddr_restore(void)
43 volatile u64 *src, *dst;
45 struct ccsr_scfg __iomem *scfg = (void *)CONFIG_SYS_MPC85xx_SCFG;
47 /* get the address of ddr date from SPARECR3 */
48 src = (u64 *)in_be32(&scfg->sparecr[2]);
49 dst = (u64 *)CONFIG_SYS_SDRAM_BASE;
51 for (i = 0; i < DDR_BUFF_LEN / 8; i++)
57 static void dp_resume_prepare(void)
61 board_sleep_prepare();
64 #if defined(CONFIG_RAMBOOT_PBL)
70 int fsl_dp_resume(void)
73 void (*kernel_resume)(void);
74 struct ccsr_scfg __iomem *scfg = (void *)CONFIG_SYS_MPC85xx_SCFG;
81 /* Get the entry address and jump to kernel */
82 start_addr = in_be32(&scfg->sparecr[1]);
83 debug("Entry address is 0x%08x\n", start_addr);
84 kernel_resume = (void (*)(void))start_addr;