colibri_imx7: migrate to DM_ETH
authorIgor Opaniuk <igor.opaniuk@toradex.com>
Mon, 4 Nov 2019 10:12:04 +0000 (11:12 +0100)
committerStefano Babic <sbabic@denx.de>
Tue, 7 Jan 2020 09:26:56 +0000 (10:26 +0100)
Migrate to DM_ETH and remove hardcoded pinmux configuration.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
board/toradex/colibri_imx7/colibri_imx7.c
configs/colibri_imx7_defconfig
configs/colibri_imx7_emmc_defconfig
include/configs/colibri_imx7.h

index b0914a9ead50f6c537e0a26081c477a15bcefa4c..77197e0fbb013a532b1a25852e318ff7bb48cb85 100644 (file)
@@ -159,50 +159,12 @@ void board_preboot_os(void)
        gpio_direction_output(GPIO_BL_ON, 0);
 }
 
-#ifdef CONFIG_FEC_MXC
-static iomux_v3_cfg_t const fec1_pads[] = {
-#ifndef CONFIG_COLIBRI_IMX7_EXT_PHYCLK
-       MX7D_PAD_GPIO1_IO12__CCM_ENET_REF_CLK1 | MUX_PAD_CTRL(ENET_PAD_CTRL) | MUX_MODE_SION,
-#else
-       MX7D_PAD_GPIO1_IO12__CCM_ENET_REF_CLK1 | MUX_PAD_CTRL(ENET_PAD_CTRL),
-#endif
-       MX7D_PAD_SD2_CD_B__ENET1_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL_MII),
-       MX7D_PAD_SD2_WP__ENET1_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL_MII),
-       MX7D_PAD_ENET1_RGMII_RD0__ENET1_RGMII_RD0 | MUX_PAD_CTRL(ENET_RX_PAD_CTRL),
-       MX7D_PAD_ENET1_RGMII_RD1__ENET1_RGMII_RD1 | MUX_PAD_CTRL(ENET_RX_PAD_CTRL),
-       MX7D_PAD_ENET1_RGMII_RXC__ENET1_RX_ER | MUX_PAD_CTRL(ENET_RX_PAD_CTRL),
-       MX7D_PAD_ENET1_RGMII_RX_CTL__ENET1_RGMII_RX_CTL   | MUX_PAD_CTRL(ENET_RX_PAD_CTRL),
-       MX7D_PAD_ENET1_RGMII_TD0__ENET1_RGMII_TD0 | MUX_PAD_CTRL(ENET_PAD_CTRL),
-       MX7D_PAD_ENET1_RGMII_TD1__ENET1_RGMII_TD1 | MUX_PAD_CTRL(ENET_PAD_CTRL),
-       MX7D_PAD_ENET1_RGMII_TX_CTL__ENET1_RGMII_TX_CTL | MUX_PAD_CTRL(ENET_PAD_CTRL),
-};
-
-static void setup_iomux_fec(void)
-{
-       imx_iomux_v3_setup_multiple_pads(fec1_pads, ARRAY_SIZE(fec1_pads));
-}
-#endif
-
 static void setup_iomux_uart(void)
 {
        imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
 }
 
 #ifdef CONFIG_FEC_MXC
-int board_eth_init(bd_t *bis)
-{
-       int ret;
-
-       setup_iomux_fec();
-
-       ret = fecmxc_initialize_multi(bis, 0,
-               CONFIG_FEC_MXC_PHYADDR, IMX_FEC_BASE);
-       if (ret)
-               printf("FEC1 MXC: %s:failed\n", __func__);
-
-       return ret;
-}
-
 static int setup_fec(void)
 {
        struct iomuxc_gpr_base_regs *const iomuxc_gpr_regs
@@ -226,12 +188,6 @@ static int setup_fec(void)
        return set_clk_enet(ENET_50MHZ);
 }
 
-int board_phy_config(struct phy_device *phydev)
-{
-       if (phydev->drv->config)
-               phydev->drv->config(phydev);
-       return 0;
-}
 #endif
 
 int board_early_init_f(void)
index 29ddd7d3e9c7a6ae9c9c30f7d02ed83524713773..75051c584d0ddb4eac8160564d3d86d7b2f40c36 100644 (file)
@@ -66,6 +66,9 @@ CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
 CONFIG_PHY_MICREL_KSZ8XXX=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
+CONFIG_FEC_MXC=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
index ac2fa0e1e4ee9a0f1ce0a1d712311b594647a452..9b42a5b466a21fc35c9ab6eacb5caaad7cbb69ab 100644 (file)
@@ -62,6 +62,9 @@ CONFIG_MTD=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
 CONFIG_PHY_MICREL_KSZ8XXX=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
+CONFIG_FEC_MXC=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
index 88e1be1ef58b13af7284e21aabb93af39ef8c5f2..603ea3a053a13f537206ff10c2460a325c0d86f8 100644 (file)
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN          (32 * SZ_1M)
 
-/* Network */
-#define CONFIG_FEC_MXC
-#define CONFIG_FEC_XCV_TYPE             RMII
-#define CONFIG_ETHPRIME                 "FEC"
-#define CONFIG_FEC_MXC_PHYADDR          0
-
-#define CONFIG_TFTP_TSIZE
-
-/* ENET1 */
-#define IMX_FEC_BASE                   ENET_IPS_BASE_ADDR
-
 /* MMC Config*/
 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
 #ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND