diff options
author | 2016-08-23 21:43:51 +0000 | |
---|---|---|
committer | 2016-08-23 21:43:51 +0000 | |
commit | 87d7d4d2075a38aeab5020842bc2a3a9e96817cd (patch) | |
tree | b841e6b0919b103eb246b008ce66a41be3ef31af | |
parent | Add functions to assert/deassert all reset signals for a device. (diff) | |
download | wireguard-openbsd-87d7d4d2075a38aeab5020842bc2a3a9e96817cd.tar.xz wireguard-openbsd-87d7d4d2075a38aeab5020842bc2a3a9e96817cd.zip |
Deassert all reset signals for the controller. Add support for more recent
SoCs that have a separate clock for each PHY.
-rw-r--r-- | sys/arch/armv7/sunxi/sxiehci.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/arch/armv7/sunxi/sxiehci.c b/sys/arch/armv7/sunxi/sxiehci.c index b379e90a172..7a77d0dd070 100644 --- a/sys/arch/armv7/sunxi/sxiehci.c +++ b/sys/arch/armv7/sunxi/sxiehci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sxiehci.c,v 1.7 2016/08/22 18:31:07 kettenis Exp $ */ +/* $OpenBSD: sxiehci.c,v 1.8 2016/08/23 21:43:51 kettenis Exp $ */ /* * Copyright (c) 2005 David Gwynne <dlg@openbsd.org> @@ -133,6 +133,7 @@ sxiehci_attach(struct device *parent, struct device *self, void *aux) printf("\n"); clock_enable_all(sc->sc_node); + reset_deassert_all(sc->sc_node); sxiehci_attach_phy(sc); /* Disable interrupts, so we don't get any spurious ones. */ @@ -200,7 +201,19 @@ sxiehci_attach_phy(struct sxiehci_softc *sc) return; pinctrl_byname(node, "default"); - clock_enable(node, "usb_phy"); + + /* + * On sun4i, sun5i and sun7i, there is a single clock. The + * more recent SoCs have a separate clock for each PHY. + */ + if (OF_is_compatible(node, "allwinner,sun4i-a10-usb-phy") || + OF_is_compatible(node, "allwinner,sun5i-a13-usb-phy") || + OF_is_compatible(node, "allwinner,sun7i-a20-usb-phy")) { + clock_enable(node, "usb_phy"); + } else { + snprintf(name, sizeof(name), "usb%d_phy", phys[1]); + clock_enable(node, name); + } snprintf(name, sizeof(name), "usb%d_reset", phys[1]); reset_deassert(node, name); |