]> git.sur5r.net Git - u-boot/blobdiff - board/udoo/udoo.c
efi_loader: new functions to print loaded image information
[u-boot] / board / udoo / udoo.c
index a8bd90a42a81d6b26199533267585a746594ded5..562f0d863e02c443fd4adfff5ddc9aaad1247783 100644 (file)
 #include <asm/arch/iomux.h>
 #include <malloc.h>
 #include <asm/arch/mx6-pins.h>
-#include <asm/errno.h>
+#include <linux/errno.h>
 #include <asm/gpio.h>
-#include <asm/imx-common/iomux-v3.h>
-#include <asm/imx-common/sata.h>
+#include <asm/mach-imx/iomux-v3.h>
+#include <asm/mach-imx/sata.h>
 #include <mmc.h>
 #include <fsl_esdhc.h>
 #include <asm/arch/crm_regs.h>
@@ -191,23 +191,26 @@ int board_eth_init(bd_t *bis)
 #ifdef CONFIG_FEC_MXC
        bus = fec_get_miibus(base, -1);
        if (!bus)
-               return 0;
+               return -EINVAL;
        /* scan phy 4,5,6,7 */
        phydev = phy_find_by_mask(bus, (0xf << 4), PHY_INTERFACE_MODE_RGMII);
 
        if (!phydev) {
-               free(bus);
-               return 0;
+               ret = -EINVAL;
+               goto free_bus;
        }
        printf("using phy at %d\n", phydev->addr);
        ret  = fec_probe(bis, -1, base, bus, phydev);
-       if (ret) {
-               printf("FEC MXC: %s:failed\n", __func__);
-               free(phydev);
-               free(bus);
-       }
+       if (ret)
+               goto free_phydev;
 #endif
        return 0;
+
+free_phydev:
+       free(phydev);
+free_bus:
+       free(bus);
+       return ret;
 }
 
 int board_mmc_init(bd_t *bis)
@@ -241,9 +244,8 @@ int board_init(void)
        /* address of boot parameters */
        gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
-#ifdef CONFIG_CMD_SATA
-       if (is_cpu_type(MXC_CPU_MX6Q))
-               setup_sata();
+#ifdef CONFIG_SATA
+       setup_sata();
 #endif
        return 0;
 }
@@ -252,9 +254,9 @@ int board_late_init(void)
 {
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
        if (is_cpu_type(MXC_CPU_MX6Q))
-               setenv("board_rev", "MX6Q");
+               env_set("board_rev", "MX6Q");
        else
-               setenv("board_rev", "MX6DL");
+               env_set("board_rev", "MX6DL");
 #endif
        return 0;
 }