From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peng Fan Date: Thu, 13 Apr 2017 14:09:58 +0800 Subject: [U-Boot] [PATCH V2 10/12] imx: mx7dsabresd: reset ENET_RST_B In-Reply-To: <1492063800-17290-1-git-send-email-peng.fan@nxp.com> References: <1492063800-17290-1-git-send-email-peng.fan@nxp.com> Message-ID: <1492063800-17290-10-git-send-email-peng.fan@nxp.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Reset ENET_RST_B to make ENET function stable. Since DM_GPIO enabled, we use "gpio_spi at 0_5" which corresponds to ENET_RST_B. Signed-off-by: Peng Fan Cc: Stefano Babic --- V2: None board/freescale/mx7dsabresd/mx7dsabresd.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/board/freescale/mx7dsabresd/mx7dsabresd.c b/board/freescale/mx7dsabresd/mx7dsabresd.c index d6ba364..f7a5f0d 100644 --- a/board/freescale/mx7dsabresd/mx7dsabresd.c +++ b/board/freescale/mx7dsabresd/mx7dsabresd.c @@ -232,6 +232,23 @@ int mmc_map_to_kernel_blk(int dev_no) int board_eth_init(bd_t *bis) { int ret; + unsigned int gpio; + + ret = gpio_lookup_name("gpio_spi at 0_5", NULL, NULL, &gpio); + if (ret) { + printf("GPIO: 'gpio_spi at 0_5' not found\n"); + return -ENODEV; + } + + ret = gpio_request(gpio, "fec_rst"); + if (ret && ret != -EBUSY) { + printf("gpio: requesting pin %u failed\n", gpio); + return ret; + } + + gpio_direction_output(gpio, 0); + udelay(500); + gpio_direction_output(gpio, 1); setup_iomux_fec(); -- 2.6.2