2818 reboot function
author吴庆棋 <wqq@rock-chips.com>
Sat, 12 Jun 2010 06:53:37 +0000 (06:53 +0000)
committer黄涛 <huangtao@rock-chips.com>
Mon, 21 Jun 2010 05:35:27 +0000 (13:35 +0800)
arch/arm/mach-rk2818/include/mach/system.h

index 7baec047d6a79dad77fc37348036c8dd725d2619..d9675530606611c499f2581e2ac39c8cd6c5a876 100644 (file)
  * GNU General Public License for more details.
  *
  */
+ /***************
+*       DEBUG
+****************/
+#define RESTART_DEBUG
+#ifdef RESTART_DEBUG
+#define restart_dbg(format, arg...) \
+       printk("RESTART_DEBUG : " format "\n" , ## arg)
+#else
+#define restart_dbg(format, arg...) do {} while (0)
+#endif
 
-#include <mach/hardware.h>
+#ifdef CONFIG_RK2818_POWER
+extern  int rk2818_restart( int        mode, const char *cmd) ;
 
-static inline void arch_idle(void)
+static inline void arch_reset(int  mode, const char *cmd)
 {
-       cpu_do_idle();
+       
+       /*
+       *  debug trace
+       */
+       restart_dbg("%s->%s->%d->mode=%d cmd=%s",__FILE__,__FUNCTION__,__LINE__,mode,cmd);
+       rk2818_restart( mode, cmd) ;
 }
 
-static inline void arch_reset(char mode, const char *cmd)
+#else
+static inline void arch_reset(int  mode, const char *cmd)
 {
-       for (;;) ;  /* depends on IPC w/ other core */
+       
+       /*
+       *  debug trace
+       */
+       restart_dbg("%s->%s->%d->mode=%c cmd=%s",__FILE__,__FUNCTION__,__LINE__,mode,cmd);
+       printk("Can't reboot. Please open rk2818 power manage!!\n");
+       for(;;);
+}
+#endif
+
+static inline void arch_idle(void)
+{
+       cpu_do_idle();
 }