16 #include <linux/kernel.h>
19 #include <asm/reboot.h>
27 static void jz4740_halt(
void)
38 #define JZ_REG_WDT_DATA 0x00
39 #define JZ_REG_WDT_COUNTER_ENABLE 0x04
40 #define JZ_REG_WDT_COUNTER 0x08
41 #define JZ_REG_WDT_CTRL 0x0c
43 static void jz4740_restart(
char *
command)
59 #define JZ_REG_RTC_CTRL 0x00
60 #define JZ_REG_RTC_HIBERNATE 0x20
61 #define JZ_REG_RTC_WAKEUP_FILTER 0x24
62 #define JZ_REG_RTC_RESET_COUNTER 0x28
64 #define JZ_RTC_CTRL_WRDY BIT(7)
65 #define JZ_RTC_WAKEUP_FILTER_MASK 0x0000FFE0
66 #define JZ_RTC_RESET_COUNTER_MASK 0x00000FE0
68 static inline void jz4740_rtc_wait_ready(
void __iomem *rtc_base)
77 static void jz4740_power_off(
void)
80 unsigned long wakeup_filter_ticks;
81 unsigned long reset_counter_ticks;
92 jz4740_rtc_wait_ready(rtc_base);
104 jz4740_rtc_wait_ready(rtc_base);
107 jz4740_rtc_wait_ready(rtc_base);