From c069412ec34fd11a5bc16153105aada027d0a490 Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Sat, 28 Sep 2019 22:23:21 +0000 Subject: [PATCH] dwc: Add more delay for chip reset On rockchip board it seems that the value in the DTS are not enough for reseting the chip, I don't know if the value are really incorrect or if DELAY is not precise enough or if the rockchip gpio driver have some "lag" of some kind or not. For now just add more delay. --- sys/dev/dwc/if_dwc.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/dev/dwc/if_dwc.c b/sys/dev/dwc/if_dwc.c index a01c03aafd1..aeb0255aba7 100644 --- a/sys/dev/dwc/if_dwc.c +++ b/sys/dev/dwc/if_dwc.c @@ -1074,16 +1074,13 @@ dwc_reset(device_t dev) if (OF_hasprop(node, "snps,reset-active-low")) pin_value = GPIO_PIN_HIGH; - if (flags & GPIO_ACTIVE_LOW) - pin_value = !pin_value; - GPIO_PIN_SETFLAGS(gpio, pin, GPIO_PIN_OUTPUT); GPIO_PIN_SET(gpio, pin, pin_value); - DELAY(delay_prop[0]); + DELAY(delay_prop[0] * 5); GPIO_PIN_SET(gpio, pin, !pin_value); - DELAY(delay_prop[1]); + DELAY(delay_prop[1] * 5); GPIO_PIN_SET(gpio, pin, pin_value); - DELAY(delay_prop[2]); + DELAY(delay_prop[2] * 5); return (0); }