diff options
author | 2020-12-17 22:39:45 +0000 | |
---|---|---|
committer | 2020-12-17 22:39:45 +0000 | |
commit | bbe75a06999b3574bea576b8fc1d5ddcc507fb8b (patch) | |
tree | 419a6c315aedf6bedb906c159e56e2dc39d69974 | |
parent | Reset pin 3 of the GPIOAO bank to input mode to work around a hardware (diff) | |
download | wireguard-openbsd-bbe75a06999b3574bea576b8fc1d5ddcc507fb8b.tar.xz wireguard-openbsd-bbe75a06999b3574bea576b8fc1d5ddcc507fb8b.zip |
Only enable the USB 3.0 port and PHY if it is enabled on a board.
-rw-r--r-- | sys/dev/fdt/amldwusb.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/fdt/amldwusb.c b/sys/dev/fdt/amldwusb.c index d78752c5e28..667b966c6fd 100644 --- a/sys/dev/fdt/amldwusb.c +++ b/sys/dev/fdt/amldwusb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: amldwusb.c,v 1.2 2020/05/18 10:41:29 kettenis Exp $ */ +/* $OpenBSD: amldwusb.c,v 1.3 2020/12/17 22:39:45 kettenis Exp $ */ /* * Copyright (c) 2019 Mark kettenis <kettenis@openbsd.org> * @@ -131,7 +131,6 @@ struct cfdriver amldwusb_cd = { void amldwusb_init_usb2(struct amldwusb_softc *); void amldwusb_init_usb3(struct amldwusb_softc *); -void amldwusb_init_phys(struct amldwusb_softc *); int amldwusb_match(struct device *parent, void *match, void *aux) @@ -186,12 +185,15 @@ amldwusb_attach(struct device *parent, struct device *self, void *aux) reg |= (0xff << USB_R5_ID_DIG_TH_SHIFT); HWRITE4(sc, USB_R5, reg); - amldwusb_init_usb3(sc); - /* Initialize PHYs. */ phy_enable(faa->fa_node, "usb2-phy0"); phy_enable(faa->fa_node, "usb2-phy1"); - phy_enable(faa->fa_node, "usb3-phy0"); + + /* Only enable USB 3.0 logic and PHY if we have one. */ + if (OF_getindex(faa->fa_node, "usb3-phy0", "phy-names") >= 0) { + amldwusb_init_usb3(sc); + phy_enable(faa->fa_node, "usb3-phy0"); + } simplebus_attach(parent, &sc->sc_sbus.sc_dev, faa); } |