]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/boundary/nitrogen6x/nitrogen6x.c
imx: reorganize IMX code as other SOCs
[people/ms/u-boot.git] / board / boundary / nitrogen6x / nitrogen6x.c
index d46b8db232c98a655123a67f5252fae254468586..17fd6f56eafb3fdebd3410a679b1f1a09eef97d1 100644 (file)
 #include <asm/arch/sys_proto.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/mxc_i2c.h>
-#include <asm/imx-common/sata.h>
-#include <asm/imx-common/spi.h>
-#include <asm/imx-common/boot_mode.h>
-#include <asm/imx-common/video.h>
+#include <asm/mach-imx/iomux-v3.h>
+#include <asm/mach-imx/mxc_i2c.h>
+#include <asm/mach-imx/sata.h>
+#include <asm/mach-imx/spi.h>
+#include <asm/mach-imx/boot_mode.h>
+#include <asm/mach-imx/video.h>
 #include <mmc.h>
 #include <fsl_esdhc.h>
 #include <micrel.h>
@@ -31,7 +31,7 @@
 #include <i2c.h>
 #include <input.h>
 #include <netdev.h>
-#include <usb/ehci-fsl.h>
+#include <usb/ehci-ci.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 #define GP_USB_OTG_PWR IMX_GPIO_NR(3, 22)
@@ -387,20 +387,17 @@ 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
 
 #ifdef CONFIG_CI_UDC
@@ -408,6 +405,12 @@ int board_eth_init(bd_t *bis)
        usb_eth_initialize(bis);
 #endif
        return 0;
+
+free_phydev:
+       free(phydev);
+free_bus:
+       free(bus);
+       return ret;
 }
 
 static void setup_buttons(void)
@@ -900,7 +903,7 @@ int board_init(void)
        setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
        setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2);
 
-#ifdef CONFIG_CMD_SATA
+#ifdef CONFIG_SATA
        setup_sata();
 #endif