diff options
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/system-target.h')
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/system-target.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/system-target.h b/firmware/target/mips/ingenic_jz47xx/system-target.h index caf1733158..1c2e7d7173 100644 --- a/firmware/target/mips/ingenic_jz47xx/system-target.h +++ b/firmware/target/mips/ingenic_jz47xx/system-target.h | |||
@@ -97,4 +97,28 @@ void dma_disable(void); | |||
97 | #define DMA_IRQ(n) (IRQ_DMA_0 + (n)) | 97 | #define DMA_IRQ(n) (IRQ_DMA_0 + (n)) |
98 | #define GPIO_IRQ(n) (IRQ_GPIO_0 + (n)) | 98 | #define GPIO_IRQ(n) (IRQ_GPIO_0 + (n)) |
99 | 99 | ||
100 | /*--------------------------------------------------------------------------- | ||
101 | * Put core in a power-saving state. | ||
102 | *--------------------------------------------------------------------------- | ||
103 | */ | ||
104 | static inline void core_sleep(void) | ||
105 | { | ||
106 | #if CONFIG_CPU == JZ4732 | ||
107 | __cpm_idle_mode(); | ||
108 | #endif | ||
109 | asm volatile(".set mips32r2 \n" | ||
110 | "mfc0 $8, $12 \n" /* mfc t0, $12 */ | ||
111 | "move $9, $8 \n" /* move t1, t0 */ | ||
112 | "la $10, 0x8000000 \n" /* la t2, 0x8000000 */ | ||
113 | "or $8, $8, $10 \n" /* Enable reduced power mode */ | ||
114 | "mtc0 $8, $12 \n" /* mtc t0, $12 */ | ||
115 | "wait \n" | ||
116 | "mtc0 $9, $12 \n" /* mtc t1, $12 */ | ||
117 | ".set mips0 \n" | ||
118 | ::: "t0", "t1", "t2" | ||
119 | ); | ||
120 | enable_irq(); | ||
121 | } | ||
122 | |||
123 | |||
100 | #endif /* __SYSTEM_TARGET_H_ */ | 124 | #endif /* __SYSTEM_TARGET_H_ */ |