Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/fdt Add support for Meson GXL USB3 controller



details:   https://anonhg.NetBSD.org/src/rev/b7b23693f197
branches:  trunk
changeset: 450597:b7b23693f197
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Fri Apr 19 19:05:56 2019 +0000

description:
Add support for Meson GXL USB3 controller

diffstat:

 sys/dev/fdt/dwc3_fdt.c |  15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diffs (43 lines):

diff -r 4407f0e0467a -r b7b23693f197 sys/dev/fdt/dwc3_fdt.c
--- a/sys/dev/fdt/dwc3_fdt.c    Fri Apr 19 18:36:25 2019 +0000
+++ b/sys/dev/fdt/dwc3_fdt.c    Fri Apr 19 19:05:56 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc3_fdt.c,v 1.6 2018/08/12 19:10:14 jmcneill Exp $ */
+/* $NetBSD: dwc3_fdt.c,v 1.7 2019/04/19 19:05:56 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwc3_fdt.c,v 1.6 2018/08/12 19:10:14 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc3_fdt.c,v 1.7 2019/04/19 19:05:56 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -197,6 +197,7 @@
 {
        const char * const compatible[] = {
                "allwinner,sun50i-h6-dwc3",
+               "amlogic,meson-gxl-dwc3",
                "rockchip,rk3328-dwc3",
                "rockchip,rk3399-dwc3",
                "samsung,exynos5250-dwusb3",
@@ -272,12 +273,10 @@
        aprint_normal(" (rev. %d.%03x)\n", rev >> 12, rev & 0xfff);
 
        /* Enable PHY devices */
-       phy = fdtbus_phy_get(dwc3_phandle, "usb2-phy");
-       if (phy && fdtbus_phy_enable(phy, true) != 0)
-               aprint_error_dev(self, "couldn't enable usb2-phy\n");
-       phy = fdtbus_phy_get(dwc3_phandle, "usb3-phy");
-       if (phy && fdtbus_phy_enable(phy, true) != 0)
-               aprint_error_dev(self, "couldn't enable usb3-phy\n");
+       for (n = 0; (phy = fdtbus_phy_get_index(dwc3_phandle, n)) != NULL; n++) {
+               if (fdtbus_phy_enable(phy, true) != 0)
+                       aprint_error_dev(self, "couldn't enable phy #%d\n", n);
+       }
 
        dwc3_fdt_soft_reset(sc);
        dwc3_fdt_enable_phy(sc, dwc3_phandle);



Home | Main Index | Thread Index | Old Index