Skip to content
Snippets Groups Projects
Commit 1a56fcea authored by Tang Yuantian's avatar Tang Yuantian Committed by York Sun
Browse files

fsl/deepsleep: avoid the DDR restore from being optimized out


Function dp_ddr_restore is to restore the first 128-byte space
of DDR. However those codes may be optimized out by compiler
since the destination address is at 0x0. In order to avoid
compiler optimization, we restore the space from high address,
which is not at 0x0, to low address.

Signed-off-by: default avatarTang Yuantian <Yuantian.Tang@freescale.com>
Reviewed-by: default avatarYork Sun <yorksun@freescale.com>
parent 438031e1
No related branches found
No related tags found
No related merge requests found
...@@ -43,16 +43,16 @@ void fsl_dp_disable_console(void) ...@@ -43,16 +43,16 @@ void fsl_dp_disable_console(void)
*/ */
static void dp_ddr_restore(void) static void dp_ddr_restore(void)
{ {
volatile u64 *src, *dst; u64 *src, *dst;
int i; int i;
struct ccsr_scfg __iomem *scfg = (void *)CONFIG_SYS_MPC85xx_SCFG; struct ccsr_scfg __iomem *scfg = (void *)CONFIG_SYS_MPC85xx_SCFG;
/* get the address of ddr date from SPARECR3 */ /* get the address of ddr date from SPARECR3 */
src = (u64 *)in_be32(&scfg->sparecr[2]); src = (u64 *)(in_be32(&scfg->sparecr[2]) + DDR_BUFF_LEN - 8);
dst = (u64 *)CONFIG_SYS_SDRAM_BASE; dst = (u64 *)(CONFIG_SYS_SDRAM_BASE + DDR_BUFF_LEN - 8);
for (i = 0; i < DDR_BUFF_LEN / 8; i++) for (i = 0; i < DDR_BUFF_LEN / 8; i++)
*dst++ = *src++; *dst-- = *src--;
flush_dcache(); flush_dcache();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment