# HG changeset patch # User Mychaela Falconia # Date 1558823751 0 # Node ID a04a145098f1f776fc072ed8fa25a5b41fc9bf25 # Parent 44a1de4264d88b7f7e03844077bcac14e8b44fbf target-utils: poweroff command does VRPCAUX cleanup for nTESTRESET diff -r 44a1de4264d8 -r a04a145098f1 target-utils/libbase/abbdrv.c --- a/target-utils/libbase/abbdrv.c Sat May 25 22:20:34 2019 +0000 +++ b/target-utils/libbase/abbdrv.c Sat May 25 22:35:51 2019 +0000 @@ -115,8 +115,16 @@ abb_power_off() { abb_init(); + /* + * If we booted via nTESTRESET, we need to clean up some state + * in a secret undocumented Iota register before we do the DEVOFF, + * otherwise subsequent switch-on via regular PWON button + * won't work correctly. + */ + abb_unlock_page2(); + abb_reg_write(VRPCAUX, 0x07); serial_flush(); - abb_reg_write(VRPCDEV, 0x01); + abb_reg_write(VRPCDEV, 0x01); /* DEVOFF */ /* * TWL3025 datasheet seems to indicate that the time for the DEVOFF * command to take effect is 5 cycles of the 32.768 kHz clock.