Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/rockchip Enable gpio reset logic
details: https://anonhg.NetBSD.org/src/rev/a76ef84d7bdc
branches: trunk
changeset: 319964:a76ef84d7bdc
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sun Jun 17 00:33:05 2018 +0000
description:
Enable gpio reset logic
diffstat:
sys/arch/arm/rockchip/rk_gmac.c | 25 +++++++++----------------
1 files changed, 9 insertions(+), 16 deletions(-)
diffs (56 lines):
diff -r 38ed61d200ef -r a76ef84d7bdc sys/arch/arm/rockchip/rk_gmac.c
--- a/sys/arch/arm/rockchip/rk_gmac.c Sat Jun 16 23:44:26 2018 +0000
+++ b/sys/arch/arm/rockchip/rk_gmac.c Sun Jun 17 00:33:05 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_gmac.c,v 1.1 2018/06/16 00:19:04 jmcneill Exp $ */
+/* $NetBSD: rk_gmac.c,v 1.2 2018/06/17 00:33:05 jmcneill Exp $ */
/*-
* Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rk_gmac.c,v 1.1 2018/06/16 00:19:04 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_gmac.c,v 1.2 2018/06/17 00:33:05 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -79,11 +79,10 @@
static int
rk_gmac_reset(const int phandle)
{
-#if notyet
struct fdtbus_gpio_pin *pin_reset;
const u_int *reset_delay_us;
bool reset_active_low;
- int len, val;
+ int len;
if (!of_hasprop(phandle, "snps,reset-gpio"))
return 0;
@@ -98,18 +97,12 @@
reset_active_low = of_hasprop(phandle, "snps,reset-active-low");
- val = reset_active_low ? 1 : 0;
-
- fdtbus_gpio_write(pin_reset, val);
- if (be32toh(reset_delay_us[0]) > 0)
- delay(be32toh(reset_delay_us[0]));
- fdtbus_gpio_write(pin_reset, !val);
- if (be32toh(reset_delay_us[1]) > 0)
- delay(be32toh(reset_delay_us[1]));
- fdtbus_gpio_write(pin_reset, val);
- if (be32toh(reset_delay_us[2]) > 0)
- delay(be32toh(reset_delay_us[2]));
-#endif
+ fdtbus_gpio_write_raw(pin_reset, reset_active_low ? 1 : 0);
+ delay(be32toh(reset_delay_us[0]));
+ fdtbus_gpio_write_raw(pin_reset, reset_active_low ? 0 : 1);
+ delay(be32toh(reset_delay_us[1]));
+ fdtbus_gpio_write_raw(pin_reset, reset_active_low ? 1 : 0);
+ delay(be32toh(reset_delay_us[2]));
return 0;
}
Home |
Main Index |
Thread Index |
Old Index