#include <linux/kernel.h>\r
+#include <linux/reboot.h>\r
+\r
#include <asm/io.h>\r
#include <asm/proc-fns.h>\r
#include <asm/cacheflush.h>\r
-#include <mach/rk29_iomap.h>\r
-#include <mach/cru.h>\r
-#include <linux/clk.h>\r
-\r
-#include <linux/mm.h>\r
-#include <linux/sched.h>\r
-#include <linux/mmzone.h>\r
-#include <linux/rtc.h>\r
#include <asm/tlb.h>\r
#include <asm/traps.h>\r
#include <asm/sections.h>\r
#include <asm/mach/map.h>\r
#include <asm/stacktrace.h>\r
\r
-\r
-\r
-\r
+#include <mach/rk29_iomap.h>\r
+#include <mach/cru.h>\r
\r
#define cru_readl(offset) readl(RK29_CRU_BASE + offset)\r
#define cru_writel(v, offset) do { writel(v, RK29_CRU_BASE + offset); readl(RK29_CRU_BASE + offset); } while (0)\r
\r
static inline void delay_500ns(void)\r
{\r
- int delay = 12;\r
+ int delay = 13;\r
+ barrier();\r
while (delay--)\r
barrier();\r
}\r
volatile unsigned int * pGRF_GPIO2L_IOMUX = (volatile unsigned int *)(REG_FILE_BASE_ADDR + 0x58);\r
#define GPIO2_BASE_ADDR RK29_GPIO2_BASE\r
volatile unsigned int *pGPIO2_DIR = (volatile unsigned int *)(GPIO2_BASE_ADDR + 0x4);\r
- volatile unsigned int *pGPIO2_LEVEL = (volatile unsigned int *)GPIO2_BASE_ADDR;\r
\r
// iomux pwm2 to gpio2_a[3]\r
*pGRF_GPIO2L_IOMUX &= ~(0x3<<6);\r
\r
void rk29_arch_reset(int mode, const char *cmd)\r
{\r
- u32 pll, reg;\r
+ u32 reg;\r
+\r
+ /* from panic? */\r
+ if (system_state != SYSTEM_RESTART)\r
+ machine_power_off();\r
\r
local_irq_disable();\r
local_fiq_disable();\r
"mcr p15, 0, %0, c1, c0, 0\n\t"\r
// "mcr p15, 0, %0, c8, c7, 0 @ invalidate whole TLB\n\t"\r
// "mcr p15, 0, %0, c7, c5, 6 @ invalidate BTC\n\t"\r
- :: "r" (reg));\r
+ : "=r" (reg));\r
\r
asm("b 1f\n\t"\r
".align 5\n\t"\r