From: Jagan Teki <jagan@openedev.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 06/13] icorem6: Use CONFIG_DM_ETH support
Date: Tue, 6 Dec 2016 00:00:53 +0100 [thread overview]
Message-ID: <1480978860-4351-7-git-send-email-jagan@openedev.com> (raw)
In-Reply-To: <1480978860-4351-1-git-send-email-jagan@openedev.com>
From: Jagan Teki <jagan@amarulasolutions.com>
Use CONFIG_DM_ETH and remove board_eth_init code
from board files.
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
arch/arm/cpu/armv7/mx6/Kconfig | 1 +
board/engicam/icorem6/icorem6.c | 71 ------------------------------------
configs/imx6qdl_icore_mmc_defconfig | 1 -
configs/imx6qdl_icore_nand_defconfig | 1 -
4 files changed, 1 insertion(+), 73 deletions(-)
diff --git a/arch/arm/cpu/armv7/mx6/Kconfig b/arch/arm/cpu/armv7/mx6/Kconfig
index 8c96ba3..f1ec75d 100644
--- a/arch/arm/cpu/armv7/mx6/Kconfig
+++ b/arch/arm/cpu/armv7/mx6/Kconfig
@@ -108,6 +108,7 @@ config TARGET_MX6Q_ICORE
select MX6QDL
select OF_CONTROL
select DM
+ select DM_ETH
select DM_GPIO
select DM_MMC
select DM_THERMAL
diff --git a/board/engicam/icorem6/icorem6.c b/board/engicam/icorem6/icorem6.c
index c152007..587775e 100644
--- a/board/engicam/icorem6/icorem6.c
+++ b/board/engicam/icorem6/icorem6.c
@@ -7,8 +7,6 @@
*/
#include <common.h>
-#include <miiphy.h>
-#include <netdev.h>
#include <asm/io.h>
#include <asm/gpio.h>
@@ -27,80 +25,11 @@ DECLARE_GLOBAL_DATA_PTR;
PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \
PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST | PAD_CTL_HYS)
-#define ENET_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
- PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \
- PAD_CTL_DSE_40ohm | PAD_CTL_HYS)
-
static iomux_v3_cfg_t const uart4_pads[] = {
IOMUX_PADS(PAD_KEY_COL0__UART4_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL)),
IOMUX_PADS(PAD_KEY_ROW0__UART4_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL)),
};
-static iomux_v3_cfg_t const enet_pads[] = {
- IOMUX_PADS(PAD_ENET_CRS_DV__ENET_RX_EN | MUX_PAD_CTRL(ENET_PAD_CTRL)),
- IOMUX_PADS(PAD_GPIO_16__ENET_REF_CLK | MUX_PAD_CTRL(ENET_PAD_CTRL | PAD_CTL_SRE_FAST)),
- IOMUX_PADS(PAD_ENET_TX_EN__ENET_TX_EN | MUX_PAD_CTRL(ENET_PAD_CTRL)),
- IOMUX_PADS(PAD_ENET_RXD1__ENET_RX_DATA1 | MUX_PAD_CTRL(ENET_PAD_CTRL)),
- IOMUX_PADS(PAD_ENET_RXD0__ENET_RX_DATA0 | MUX_PAD_CTRL(ENET_PAD_CTRL)),
- IOMUX_PADS(PAD_ENET_TXD1__ENET_TX_DATA1 | MUX_PAD_CTRL(ENET_PAD_CTRL)),
- IOMUX_PADS(PAD_ENET_TXD0__ENET_TX_DATA0 | MUX_PAD_CTRL(ENET_PAD_CTRL)),
- IOMUX_PADS(PAD_ENET_MDC__ENET_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL)),
- IOMUX_PADS(PAD_ENET_MDIO__ENET_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL)),
- IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | MUX_PAD_CTRL(NO_PAD_CTRL)),
-};
-
-#ifdef CONFIG_FEC_MXC
-#define ENET_PHY_RST IMX_GPIO_NR(7, 12)
-static int setup_fec(void)
-{
- struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
- struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
- s32 timeout = 100000;
- u32 reg = 0;
- int ret;
-
- /* Enable fec clock */
- setbits_le32(&ccm->CCGR1, MXC_CCM_CCGR1_ENET_MASK);
-
- /* use 50MHz */
- ret = enable_fec_anatop_clock(0, ENET_50MHZ);
- if (ret)
- return ret;
-
- /* Enable PLLs */
- reg = readl(&anatop->pll_enet);
- reg &= ~BM_ANADIG_PLL_SYS_POWERDOWN;
- writel(reg, &anatop->pll_enet);
- reg = readl(&anatop->pll_enet);
- reg |= BM_ANADIG_PLL_SYS_ENABLE;
- while (timeout--) {
- if (readl(&anatop->pll_enet) & BM_ANADIG_PLL_SYS_LOCK)
- break;
- }
- if (timeout <= 0)
- return -EIO;
- reg &= ~BM_ANADIG_PLL_SYS_BYPASS;
- writel(reg, &anatop->pll_enet);
-
- /* reset the phy */
- gpio_direction_output(ENET_PHY_RST, 0);
- udelay(10000);
- gpio_set_value(ENET_PHY_RST, 1);
-
- return 0;
-}
-
-int board_eth_init(bd_t *bis)
-{
- int ret;
-
- SETUP_IOMUX_PADS(enet_pads);
- setup_fec();
-
- return ret = cpu_eth_init(bis);
-}
-#endif
-
#ifdef CONFIG_NAND_MXS
#define GPMI_PAD_CTRL0 (PAD_CTL_PKE | PAD_CTL_PUE | PAD_CTL_PUS_100K_UP)
diff --git a/configs/imx6qdl_icore_mmc_defconfig b/configs/imx6qdl_icore_mmc_defconfig
index fcf4934..31f40b4 100644
--- a/configs/imx6qdl_icore_mmc_defconfig
+++ b/configs/imx6qdl_icore_mmc_defconfig
@@ -30,7 +30,6 @@ CONFIG_CMD_FS_GENERIC=y
CONFIG_OF_LIBFDT=y
CONFIG_FEC_MXC=y
CONFIG_MXC_UART=y
-CONFIG_NETDEVICES=y
CONFIG_IMX_THERMAL=y
CONFIG_PINCTRL=y
CONFIG_PINCTRL_IMX6=y
diff --git a/configs/imx6qdl_icore_nand_defconfig b/configs/imx6qdl_icore_nand_defconfig
index 4919d44..3410e4c 100644
--- a/configs/imx6qdl_icore_nand_defconfig
+++ b/configs/imx6qdl_icore_nand_defconfig
@@ -24,7 +24,6 @@ CONFIG_OF_LIBFDT=y
CONFIG_FEC_MXC=y
CONFIG_MXC_UART=y
CONFIG_NAND_MXS=y
-CONFIG_NETDEVICES=y
CONFIG_IMX_THERMAL=y
# CONFIG_BLK is not set
# CONFIG_DM_MMC_OPS is not set
--
1.9.1
next prev parent reply other threads:[~2016-12-05 23:00 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-05 23:00 [U-Boot] [PATCH v3 00/13] imx6: icorem6: Add dm-eth, framebuffer and I2C support Jagan Teki
2016-12-05 23:00 ` [U-Boot] [PATCH v3 01/13] net: fec_mxc: Remove unneeded eth_device arg from fec_get_hwaddr Jagan Teki
2016-12-05 23:00 ` [U-Boot] [PATCH v3 02/13] net: fec_mxc: Convert into driver model Jagan Teki
2016-12-09 18:22 ` Joe Hershberger
2016-12-09 22:26 ` Jagan Teki
2016-12-05 23:00 ` [U-Boot] [PATCH v3 03/13] net: fec_mxc: Driver cleanups Jagan Teki
2016-12-05 23:00 ` [U-Boot] [PATCH v3 04/13] dm: net: fec: Add .read_rom_hwaddr Jagan Teki
2016-12-05 23:00 ` [U-Boot] [PATCH v3 05/13] ARM: dts: imx6qdl-icore: Add FEC support Jagan Teki
2016-12-05 23:00 ` Jagan Teki [this message]
2016-12-05 23:00 ` [U-Boot] [PATCH v3 07/13] video: Kconfig: Add VIDEO_IPV3 entry Jagan Teki
2016-12-05 23:00 ` [U-Boot] [PATCH v3 08/13] imx6: icorem6: Add framebuffer support Jagan Teki
2016-12-05 23:00 ` [U-Boot] [PATCH v3 09/13] imx6: icorem6: Add custom splashscreen support Jagan Teki
2016-12-05 23:00 ` [U-Boot] [PATCH v3 10/13] i2c: Kconfig: Add SYS_I2C_MXC entry Jagan Teki
2016-12-06 14:06 ` Heiko Schocher
2016-12-06 15:45 ` Jagan Teki
2016-12-06 14:47 ` Fabio Estevam
2016-12-06 15:44 ` Jagan Teki
2016-12-05 23:00 ` [U-Boot] [PATCH v3 11/13] i2c: mxc: Print hex instead of decimal for bus address Jagan Teki
2016-12-06 14:07 ` Heiko Schocher
2016-12-05 23:00 ` [U-Boot] [PATCH v3 12/13] i2c: mxc: Make 'no gpio pinctrl state' print as debug Jagan Teki
2016-12-06 14:08 ` Heiko Schocher
2016-12-05 23:01 ` [U-Boot] [PATCH v3 13/13] imx6: icorem6: Add I2C support Jagan Teki
2016-12-06 14:10 ` Heiko Schocher
2016-12-06 17:25 ` Jagan Teki
2016-12-07 16:01 ` [U-Boot] [PATCH v3 00/13] imx6: icorem6: Add dm-eth, framebuffer and " Jagan Teki
2016-12-13 12:36 ` Jagan Teki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1480978860-4351-7-git-send-email-jagan@openedev.com \
--to=jagan@openedev.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.