board: arm: convert makefiles to Kbuild style
[oweals/u-boot.git] / board / hale / tt01 / tt01.c
index 143fcefedf55e710c055d92d859eebc2ec225724..011aed08417ad008d4f48cebc5a577b8d47f2176 100644 (file)
@@ -3,34 +3,19 @@
  * (C) Copyright 2009 Magnus Lilja <lilja.magnus@gmail.com>
  * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <netdev.h>
 #include <command.h>
-#include <pmic.h>
+#include <power/pmic.h>
 #include <fsl_pmic.h>
 #include <mc13783.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/io.h>
+#include <errno.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -178,7 +163,7 @@ int board_init(void)
 int board_late_init(void)
 {
 #ifdef CONFIG_HW_WATCHDOG
-       mxc_hw_watchdog_enable();
+       hw_watchdog_init();
 #endif
 
        return 0;
@@ -195,14 +180,21 @@ int board_mmc_init(bd_t *bis)
 {
        u32 val;
        struct pmic *p;
+       int ret;
 
        /*
        * this is the first driver to use the pmic, so call
        * pmic_init() here. board_late_init() is too late for
        * the MMC driver.
        */
-       pmic_init();
-       p = get_pmic();
+
+       ret = pmic_init(I2C_PMIC);
+       if (ret)
+               return ret;
+
+       p = pmic_get("FSL_PMIC");
+       if (!p)
+               return -ENODEV;
 
        /* configure pins for SDHC1 only */
        mx31_gpio_mux(IOMUX_MODE(MUX_CTL_SD1_CLK, MUX_CTL_FUNC));