]> git.sur5r.net Git - u-boot/blobdiff - board/freescale/mx31pdk/mx31pdk.c
Merge branch 'master' of git://git.denx.de/u-boot
[u-boot] / board / freescale / mx31pdk / mx31pdk.c
index 0e7e0ce3477e32297be6b67dd558fcfddf3b6af7..895396cd6231ce037493629f8742c70598ba7ef0 100644 (file)
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>
 #include <watchdog.h>
+#include <power/pmic.h>
+#include <fsl_pmic.h>
+#include <errno.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_HW_WATCHDOG
-void hw_watchdog_reset(void)
-{
-       mxc_hw_watchdog_reset();
-}
-#endif
-
 int dram_init(void)
 {
        /* dram_init must store complete ramsize in gd->ram_size */
@@ -79,8 +75,23 @@ int board_init(void)
 
 int board_late_init(void)
 {
+       u32 val;
+       struct pmic *p;
+       int ret;
+
+       ret = pmic_init(I2C_PMIC);
+       if (ret)
+               return ret;
+
+       p = pmic_get("FSL_PMIC");
+       if (!p)
+               return -ENODEV;
+       /* Enable RTC battery */
+       pmic_reg_read(p, REG_POWER_CTL0, &val);
+       pmic_reg_write(p, REG_POWER_CTL0, val | COINCHEN);
+       pmic_reg_write(p, REG_INT_STATUS1, RTCRSTI);
 #ifdef CONFIG_HW_WATCHDOG
-       mxc_hw_watchdog_enable();
+       hw_watchdog_init();
 #endif
        return 0;
 }