summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/tcc780x/cowond2/power-cowond2.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/firmware/target/arm/tcc780x/cowond2/power-cowond2.c b/firmware/target/arm/tcc780x/cowond2/power-cowond2.c
index d8a58570e4..2439676acc 100644
--- a/firmware/target/arm/tcc780x/cowond2/power-cowond2.c
+++ b/firmware/target/arm/tcc780x/cowond2/power-cowond2.c
@@ -16,9 +16,7 @@
16 * KIND, either express or implied. 16 * KIND, either express or implied.
17 * 17 *
18 ****************************************************************************/ 18 ****************************************************************************/
19#include "config.h"
20#include "cpu.h" 19#include "cpu.h"
21#include <stdbool.h>
22#include "kernel.h" 20#include "kernel.h"
23#include "system.h" 21#include "system.h"
24#include "power.h" 22#include "power.h"
@@ -61,6 +59,22 @@ void charger_enable(bool on)
61 59
62void power_off(void) 60void power_off(void)
63{ 61{
62 /* Disable interrupts on this core */
63 set_interrupt_status(IRQ_FIQ_DISABLED, IRQ_FIQ_STATUS);
64
65 /* Mask them on both cores */
66 CPU_INT_CLR = -1;
67 COP_INT_CLR = -1;
68
69 /* Shutdown: stop XIN oscillator */
70 CLKCTRL &= ~(1 << 31);
71
72 /* Halt everything and wait for device to power off */
73 while (1)
74 {
75 CPU_CTL = PROC_SLEEP;
76 COP_CTL = PROC_SLEEP;
77 }
64} 78}
65 79
66void ide_power_enable(bool on) 80void ide_power_enable(bool on)