mx53evk: Use gpio_direction_input prior to gpio_get_value
[oweals/u-boot.git] / board / freescale / mx31pdk / mx31pdk.c
index 0e7e0ce3477e32297be6b67dd558fcfddf3b6af7..1d7b4f6d99be9f43866d046ba6be2a00a4dab3de 100644 (file)
@@ -30,6 +30,8 @@
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>
 #include <watchdog.h>
+#include <pmic.h>
+#include <fsl_pmic.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -69,16 +71,34 @@ int board_early_init_f(void)
        return 0;
 }
 
+void enable_caches(void)
+{
+       icache_enable();
+       dcache_enable();
+}
+
 int board_init(void)
 {
        /* adress of boot parameters */
        gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
 
+       enable_caches();
+
        return 0;
 }
 
 int board_late_init(void)
 {
+       u32 val;
+       struct pmic *p;
+
+       pmic_init();
+       p = get_pmic();
+
+       /* 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();
 #endif