* [1]:= 1:WDT will be cleeared and disabled after timeout occurs
* [0]:= 1:WDT enable
*/
- __ast_moutdwm(regs, 0x1E785004, 0x00000010);
- __ast_moutdwm(regs, 0x1E785008, 0x00004755);
- __ast_moutdwm(regs, 0x1E78500c, 0x00000033);
+ __ast_moutdwm(regs, AST_REG_WDT04(0), 0x00000010);
+ __ast_moutdwm(regs, AST_REG_WDT08(0), 0x00004755);
+ __ast_moutdwm(regs, AST_REG_WDT0C(0), 0x00000033);
udelay(1000);
}
static void reset_mmc_2500(struct ast_device *ast)
{
- ast_moutdwm(ast, 0x1E78505C, 0x00000004);
- ast_moutdwm(ast, 0x1E785044, 0x00000001);
- ast_moutdwm(ast, 0x1E785048, 0x00004755);
- ast_moutdwm(ast, 0x1E78504C, 0x00000013);
+ ast_moutdwm(ast, AST_REG_WDT1C(1), 0x00000004);
+ ast_moutdwm(ast, AST_REG_WDT04(1), 0x00000001);
+ ast_moutdwm(ast, AST_REG_WDT08(1), 0x00004755);
+ ast_moutdwm(ast, AST_REG_WDT0C(1), 0x00000013);
mdelay(100);
- ast_moutdwm(ast, 0x1E785054, 0x00000077);
+ ast_moutdwm(ast, AST_REG_WDT14(1), 0x00000077);
ast_moutdwm(ast, AST_REG_MCR00, AST_REG_MCR00_PROTECTION_KEY);
}
ast_2500_patch_ahb(ast->regs);
/* Disable watchdog */
- ast_moutdwm(ast, 0x1E78502C, 0x00000000);
- ast_moutdwm(ast, 0x1E78504C, 0x00000000);
+ ast_moutdwm(ast, AST_REG_WDT2C(0), 0x00000000);
+ ast_moutdwm(ast, AST_REG_WDT0C(1), 0x00000000);
/*
* Reset USB port to patch USB unknown device issue
#define AST_REG_A2P(__offset) (AST_REG_A2P_BASE + (__offset))
#define AST_REG_A2P58 AST_REG_A2P(0x58)
+/*
+ * Watchdog timer (0x1e785000 - 0x1e785fff)
+ */
+
+#define AST_REG_WDT_BASE(__n) (0x1e785000 + (__n) * 0x40)
+#define AST_REG_WDT(__n, __offset) (AST_REG_WDT_BASE((__n)) + (__offset))
+#define AST_REG_WDT04(__n) AST_REG_WDT((__n), 0x04)
+#define AST_REG_WDT08(__n) AST_REG_WDT((__n), 0x08)
+#define AST_REG_WDT0C(__n) AST_REG_WDT((__n), 0x0c)
+#define AST_REG_WDT14(__n) AST_REG_WDT((__n), 0x14)
+#define AST_REG_WDT1C(__n) AST_REG_WDT((__n), 0x1c)
+#define AST_REG_WDT2C(__n) AST_REG_WDT((__n), 0x2c)
+
#endif