]> 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 9f8bc53e711c02fd40ed9f2b58b35417a24a277a..895396cd6231ce037493629f8742c70598ba7ef0 100644 (file)
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>
 #include <watchdog.h>
-#include <pmic.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 */
@@ -83,16 +77,21 @@ int board_late_init(void)
 {
        u32 val;
        struct pmic *p;
+       int ret;
 
-       pmic_init();
-       p = get_pmic();
+       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;
 }