Module Name: src
Committed By: hkenken
Date: Wed Nov 13 07:56:11 UTC 2019
Modified Files:
src/sys/arch/arm/imx/fdt: if_enet_imx.c
Log Message:
Add support "phy-reset-post-delay".
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/imx/fdt/if_enet_imx.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/arm/imx/fdt/if_enet_imx.c
diff -u src/sys/arch/arm/imx/fdt/if_enet_imx.c:1.6 src/sys/arch/arm/imx/fdt/if_enet_imx.c:1.7
--- src/sys/arch/arm/imx/fdt/if_enet_imx.c:1.6 Tue Nov 12 08:40:57 2019
+++ src/sys/arch/arm/imx/fdt/if_enet_imx.c Wed Nov 13 07:56:10 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_enet_imx.c,v 1.6 2019/11/12 08:40:57 hkenken Exp $ */
+/* $NetBSD: if_enet_imx.c,v 1.7 2019/11/13 07:56:10 hkenken Exp $ */
/*-
* Copyright (c) 2019 Genetec Corporation. All rights reserved.
* Written by Hashimoto Kenichi for Genetec Corporation.
@@ -25,7 +25,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_enet_imx.c,v 1.6 2019/11/12 08:40:57 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_enet_imx.c,v 1.7 2019/11/13 07:56:10 hkenken Exp $");
#include "opt_fdt.h"
@@ -195,19 +195,23 @@ enet_init_clocks(struct enet_softc *sc)
static void
enet_phy_reset(struct enet_fdt_softc *sc, const int phandle)
{
- int error;
+ u_int msec;
sc->sc_pin_reset = fdtbus_gpio_acquire(phandle, "phy-reset-gpios", GPIO_PIN_OUTPUT);
if (sc->sc_pin_reset == NULL)
return;
- u_int msec;
- error = of_getprop_uint32(phandle, "phy-reset-duration", &msec);
- if (error)
+ if (of_getprop_uint32(phandle, "phy-reset-duration", &msec))
msec = 1;
/* Reset */
fdtbus_gpio_write(sc->sc_pin_reset, 1);
delay(msec * 1000);
fdtbus_gpio_write(sc->sc_pin_reset, 0);
+
+ /* Post delay */
+ if (!of_getprop_uint32(phandle, "phy-reset-post-delay", &msec))
+ msec = 0;
+
+ delay(msec * 1000);
}