FreeCalypso > hg > freecalypso-tools
comparison target-utils/libbase/abbdrv.c @ 500:a04a145098f1
target-utils: poweroff command does VRPCAUX cleanup for nTESTRESET
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 25 May 2019 22:35:51 +0000 |
parents | 44a1de4264d8 |
children |
comparison
equal
deleted
inserted
replaced
499:44a1de4264d8 | 500:a04a145098f1 |
---|---|
113 | 113 |
114 void | 114 void |
115 abb_power_off() | 115 abb_power_off() |
116 { | 116 { |
117 abb_init(); | 117 abb_init(); |
118 /* | |
119 * If we booted via nTESTRESET, we need to clean up some state | |
120 * in a secret undocumented Iota register before we do the DEVOFF, | |
121 * otherwise subsequent switch-on via regular PWON button | |
122 * won't work correctly. | |
123 */ | |
124 abb_unlock_page2(); | |
125 abb_reg_write(VRPCAUX, 0x07); | |
118 serial_flush(); | 126 serial_flush(); |
119 abb_reg_write(VRPCDEV, 0x01); | 127 abb_reg_write(VRPCDEV, 0x01); /* DEVOFF */ |
120 /* | 128 /* |
121 * TWL3025 datasheet seems to indicate that the time for the DEVOFF | 129 * TWL3025 datasheet seems to indicate that the time for the DEVOFF |
122 * command to take effect is 5 cycles of the 32.768 kHz clock. | 130 * command to take effect is 5 cycles of the 32.768 kHz clock. |
123 * We'll do an ARM-timed delay of 10 ms before returning from | 131 * We'll do an ARM-timed delay of 10 ms before returning from |
124 * this function. | 132 * this function. |