Hello,
on a custom OMAP L138 Board we run linux.
Using DEEPSLEEP with external wakeup is not working reliable.
Very often the transition to DEEPSLEEP is working fine.
But sometimes the system is unable to go to DEEPSLEEP.
Using the internal RTC to wake up from DEEPSLEEP is showing the same
error.
We found that the systems hangs in arch/arm/mach-davinci/sleep.S
in davinci_ddr_psc_config.
In case of error
the check for Transition Complete in PTSTAT register (ptstat_done) never returns
after enabling the Power Domain Transiton Command.
Code from arch/arm/mach-davinci/sleep.S:
[...]
/*
* Disables or Enables DDR2 LPSC
* Register Usage:
* r0: Enable or Disable LPSC r0 = 0x3 => Enable, r0 = 0x2 => Disable LPSC
* r1: contains virtual base for DDR2 Power and Sleep controller (PSC)
* r2: contains PSC number for DDR2
*/
ENTRY(davinci_ddr_psc_config)
/* Set next state in mdctl for DDR2 */
mov r6, #MDCTL
add r6, r6, r2, lsl #2
ldr ip, [r1, r6]
bic ip, ip, #MDSTAT_STATE_MASK
orr ip, ip, r0
str ip, [r1, r6]
/* Enable the Power Domain Transition Command */
ldr ip, [r1, #PTCMD]
orr ip, ip, #0x1
str ip, [r1, #PTCMD]
/* Check for Transition Complete (PTSTAT) */
ptstat_done:
ldr ip, [r1, #PTSTAT]
and ip, ip, #0x1
cmp ip, #0x0
bne ptstat_done
/* Check for DDR2 clock disable completion; */
mov r6, #MDSTAT
add r6, r6, r2, lsl #2
ddr2clk_stop_done:
ldr ip, [r1, r6]
and ip, ip, #MDSTAT_STATE_MASK
cmp ip, r0
bne ddr2clk_stop_done
[...]
In the Manual spruh77a: in 9.3.2 Module State Transitions,
the first step is: wait for the GOSTAT[x] bit in PTSTAT to clear to 0.
This step is not implemented in sleep.S so we tested this with the step added.
The problem is the same.
We also replaced the "Check for Transition Complete" with a delay.
The error occoured, but in this case the freeze seems to be in the next
step ("Check for DDR2 clock disable completion").
What can prenvent the Power Domain Transition Command from completion?
Regards,
Bastian.