From 1649bbc3d69363883212490f4f22cccdb427a4a3 Mon Sep 17 00:00:00 2001 From: Xiangfu Liu Date: Thu, 1 Oct 2009 02:51:40 -0400 Subject: [PATCH] make poweroff command work --- target/linux/xburst/files-2.6.31/arch/mips/jz4740/reset.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/linux/xburst/files-2.6.31/arch/mips/jz4740/reset.c b/target/linux/xburst/files-2.6.31/arch/mips/jz4740/reset.c index 83577d868..359700ab4 100644 --- a/target/linux/xburst/files-2.6.31/arch/mips/jz4740/reset.c +++ b/target/linux/xburst/files-2.6.31/arch/mips/jz4740/reset.c @@ -21,7 +21,7 @@ void jz_restart(char *command) { - printk("Restarting after 4 ms\n"); + printk(KERN_NOTICE "Restarting after 4 ms\n"); REG_WDT_TCSR = WDT_TCSR_PRESCALE4 | WDT_TCSR_EXT_EN; REG_WDT_TCNT = 0; REG_WDT_TDR = JZ_EXTAL/1000; /* reset after 4ms */ @@ -32,7 +32,9 @@ void jz_restart(char *command) void jz_halt(void) { - printk(KERN_NOTICE "\n** You can safely turn off the power\n"); + /* Put CPU to power down mode */ + while (!(REG_RTC_RCR & RTC_RCR_WRDY)); + REG_RTC_HCR = RTC_HCR_PD; while (1) __asm__(".set\tmips3\n\t"