summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2017-04-13 06:09:58 (GMT)
committerStefano Babic <sbabic@denx.de>2017-05-18 09:24:34 (GMT)
commit709fef513120cfc9a18bfcee42d466bd3d04b3a4 (patch)
tree34d9755cde3cd153e89ac5b3c13c05087be3c514
parent6fbbcfdf06cffe38a8cec31ba14e404435527e35 (diff)
downloadu-boot-709fef513120cfc9a18bfcee42d466bd3d04b3a4.tar.xz
imx: mx7dsabresd: reset ENET_RST_B
Reset ENET_RST_B to make ENET function stable. Since DM_GPIO enabled, we use "gpio_spi@0_5" which corresponds to ENET_RST_B. Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de>
-rw-r--r--board/freescale/mx7dsabresd/mx7dsabresd.c17
1 files changed, 17 insertions, 0 deletions
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@0_5", NULL, NULL, &gpio);
+ if (ret) {
+ printf("GPIO: 'gpio_spi@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();