global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace
[platform/kernel/u-boot.git] / board / freescale / ls2080ardb / eth_ls2080rdb.c
index 62c7a7a..7034bc6 100644 (file)
@@ -6,12 +6,14 @@
 
 #include <common.h>
 #include <command.h>
+#include <net.h>
 #include <netdev.h>
 #include <malloc.h>
 #include <fsl_mdio.h>
 #include <miiphy.h>
 #include <phy.h>
 #include <fm_eth.h>
+#include <asm/global_data.h>
 #include <asm/io.h>
 #include <exports.h>
 #include <asm/arch/fsl_serdes.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int board_eth_init(bd_t *bis)
+int board_eth_init(struct bd_info *bis)
 {
+#ifndef CONFIG_DM_ETH
 #if defined(CONFIG_FSL_MC_ENET)
        int i, interface;
        struct memac_mdio_info mdio_info;
        struct mii_dev *dev;
-       struct ccsr_gur *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
+       struct ccsr_gur *gur = (void *)(CFG_SYS_FSL_GUTS_ADDR);
        u32 srds_s1;
        struct memac_mdio_controller *reg;
 
@@ -34,14 +37,14 @@ int board_eth_init(bd_t *bis)
                                FSL_CHASSIS3_RCWSR28_SRDS1_PRTCL_MASK;
        srds_s1 >>= FSL_CHASSIS3_RCWSR28_SRDS1_PRTCL_SHIFT;
 
-       reg = (struct memac_mdio_controller *)CONFIG_SYS_FSL_WRIOP1_MDIO1;
+       reg = (struct memac_mdio_controller *)CFG_SYS_FSL_WRIOP1_MDIO1;
        mdio_info.regs = reg;
        mdio_info.name = DEFAULT_WRIOP_MDIO1_NAME;
 
        /* Register the EMI 1 */
        fm_memac_mdio_init(bis, &mdio_info);
 
-       reg = (struct memac_mdio_controller *)CONFIG_SYS_FSL_WRIOP1_MDIO2;
+       reg = (struct memac_mdio_controller *)CFG_SYS_FSL_WRIOP1_MDIO2;
        mdio_info.regs = reg;
        mdio_info.name = DEFAULT_WRIOP_MDIO2_NAME;
 
@@ -98,6 +101,7 @@ int board_eth_init(bd_t *bis)
 
        cpu_eth_init(bis);
 #endif /* CONFIG_FSL_MC_ENET */
+#endif /* !CONFIG_DM_ETH */
 
 #ifdef CONFIG_PHY_AQUANTIA
        /*
@@ -111,7 +115,12 @@ int board_eth_init(bd_t *bis)
        gd->jt->mdio_phydev_for_ethname = mdio_phydev_for_ethname;
        gd->jt->miiphy_set_current_dev = miiphy_set_current_dev;
 #endif
+
+#ifdef CONFIG_DM_ETH
+       return 0;
+#else
        return pci_eth_init(bis);
+#endif
 }
 
 #if defined(CONFIG_RESET_PHY_R)