Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/sunxi Add sun4i (A10) and sun7i (A20) USB PHY s...



details:   https://anonhg.NetBSD.org/src/rev/70b01130867b
branches:  trunk
changeset: 356636:70b01130867b
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Fri Oct 06 22:25:05 2017 +0000

description:
Add sun4i (A10) and sun7i (A20) USB PHY support

diffstat:

 sys/arch/arm/sunxi/sunxi_usbphy.c |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diffs (67 lines):

diff -r ea18b75458c9 -r 70b01130867b sys/arch/arm/sunxi/sunxi_usbphy.c
--- a/sys/arch/arm/sunxi/sunxi_usbphy.c Fri Oct 06 21:21:22 2017 +0000
+++ b/sys/arch/arm/sunxi/sunxi_usbphy.c Fri Oct 06 22:25:05 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_usbphy.c,v 1.8 2017/09/09 11:58:34 jmcneill Exp $ */
+/* $NetBSD: sunxi_usbphy.c,v 1.9 2017/10/06 22:25:05 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_usbphy.c,v 1.8 2017/09/09 11:58:34 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_usbphy.c,v 1.9 2017/10/06 22:25:05 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -74,15 +74,19 @@
 static void sunxi_usbphy_attach(device_t, device_t, void *);
 
 enum sunxi_usbphy_type {
+       USBPHY_A10 = 1,
        USBPHY_A13,
+       USBPHY_A20,
        USBPHY_A31,
        USBPHY_H3,
        USBPHY_A64,
 };
 
 static const struct of_compat_data compat_data[] = {
+       { "allwinner,sun4i-a10-usb-phy",        USBPHY_A10 },
        { "allwinner,sun5i-a13-usb-phy",        USBPHY_A13 },
        { "allwinner,sun6i-a31-usb-phy",        USBPHY_A31 },
+       { "allwinner,sun7i-a20-usb-phy",        USBPHY_A20 },
        { "allwinner,sun8i-h3-usb-phy",         USBPHY_H3 },
        { "allwinner,sun50i-a64-usb-phy",       USBPHY_A64 },
        { NULL }
@@ -135,7 +139,9 @@
        uint32_t val;
 
        switch (sc->sc_type) {
+       case USBPHY_A10:
        case USBPHY_A13:
+       case USBPHY_A20:
        case USBPHY_A31:
                reg = PHYCTL_A10;
                break;
@@ -213,6 +219,8 @@
                disc_thresh = 0x2;
                phy0_reroute = false;
                break;
+       case USBPHY_A10:
+       case USBPHY_A20:
        case USBPHY_A31:
                disc_thresh = 0x3;
                phy0_reroute = false;
@@ -222,6 +230,9 @@
                disc_thresh = 0x3;
                phy0_reroute = true;
                break;
+       default:
+               aprint_error_dev(dev, "unsupported board\n");
+               return ENXIO;
        }
 
        if (phy->phy_bsh) {



Home | Main Index | Thread Index | Old Index