summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/lib/board.c
diff options
context:
space:
mode:
authorTang Yuantian <yuantian.tang@freescale.com>2014-04-17 15:33:46 +0800
committerYork Sun <yorksun@freescale.com>2014-04-22 17:58:49 -0700
commitaade20046b7ab5bd9b2afe84ccb31f0adf0c5e1e (patch)
tree238878efdee4574890334657a984c1c2d564fe91 /arch/powerpc/lib/board.c
parent5aef4c86f3629b937cee159c3d44c0d0e9762a42 (diff)
downloadblackbird-obmc-uboot-aade20046b7ab5bd9b2afe84ccb31f0adf0c5e1e.tar.gz
blackbird-obmc-uboot-aade20046b7ab5bd9b2afe84ccb31f0adf0c5e1e.zip
mpc85xx/t104x: Add deep sleep framework support
When T104x soc wakes up from deep sleep, control is passed to the primary core that starts executing uboot. After re-initialized some IP blocks, like DDRC, kernel will take responsibility to continue to restore environment it leaves before. Signed-off-by: Tang Yuantian <Yuantian.Tang@freescale.com> Reviewed-by: York Sun <yorksun@freescale.com>
Diffstat (limited to 'arch/powerpc/lib/board.c')
-rw-r--r--arch/powerpc/lib/board.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index f86c6f3e8f..8b03d3aa07 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -343,6 +343,13 @@ void board_init_f(ulong bootflag)
#ifdef CONFIG_PRAM
ulong reg;
#endif
+#ifdef CONFIG_DEEP_SLEEP
+ const ccsr_gur_t *gur = (void __iomem *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+ struct ccsr_scfg *scfg = (void *)CONFIG_SYS_MPC85xx_SCFG;
+ u32 start_addr;
+ typedef void (*func_t)(void);
+ func_t kernel_resume;
+#endif
/* Pointer is writable since we allocated a register for it */
gd = (gd_t *) (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
@@ -360,6 +367,15 @@ void board_init_f(ulong bootflag)
if ((*init_fnc_ptr) () != 0)
hang();
+#ifdef CONFIG_DEEP_SLEEP
+ /* Jump to kernel in deep sleep case */
+ if (in_be32(&gur->scrtsr[0]) & (1 << 3)) {
+ start_addr = in_be32(&scfg->sparecr[1]);
+ kernel_resume = (func_t)start_addr;
+ kernel_resume();
+ }
+#endif
+
#ifdef CONFIG_POST
post_bootmode_init();
post_run(NULL, POST_ROM | post_bootmode_get(NULL));
OpenPOWER on IntegriCloud