summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasahisa KOJIMA <kojima.masahisa@socionext.com>2018-02-28 17:04:51 +0900
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2018-02-28 08:36:27 +0000
commit3a5604ade17a8f921d36dff440ab3961490deac9 (patch)
treea960687870428cb5b3b62aed54d210c8e46d9b60
parent7d0afe144a4ac35f321dddace37a5bdc11d80453 (diff)
synquacer: add multiple GPIO poweroff sequence
In some hardware problem, GPIO low output is not effective. This issue rarely happen. As a software workaround, continuouslly perform GPIO poweroff sequence until poweroff succeeds. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
-rw-r--r--plat/arm/css/common/css_pm.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/plat/arm/css/common/css_pm.c b/plat/arm/css/common/css_pm.c
index 6893e914..2c6db590 100644
--- a/plat/arm/css/common/css_pm.c
+++ b/plat/arm/css/common/css_pm.c
@@ -234,7 +234,7 @@ void css_pwr_domain_suspend_finish(
******************************************************************************/
void __dead2 css_system_off(void)
{
- uint32_t *gpio = (uint32_t *)0x51000000;
+ volatile uint32_t *gpio = (uint32_t *)0x51000000;
uint32_t i;
/* set PD[9] high to power off the system */
@@ -245,14 +245,19 @@ void __dead2 css_system_off(void)
for (i = 0; i < 1000000; i++)
__asm__("nop");
- gpio[1] &= ~0x2; /* set low */
- dmbst();
+ while (1) {
+ gpio[1] &= ~0x2; /* set low */
+ dmbst();
- for (i = 0; i < 1000000; i++)
- __asm__("nop");
+ for (i = 0; i < 1000000; i++)
+ __asm__("nop");
- gpio[1] |= 0x2; /* set high */
- dmbst();
+ gpio[1] |= 0x2; /* set high */
+ dmbst();
+
+ for (i = 0; i < 100000000; i++)
+ __asm__("nop");
+ }
wfi();
ERROR("CSS System Off: operation not handled.\n");