From owner-svn-src-all@freebsd.org Wed Feb 27 21:04:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7704415052E3; Wed, 27 Feb 2019 21:04:42 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 073CD8FD15; Wed, 27 Feb 2019 21:04:42 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E338522553; Wed, 27 Feb 2019 21:04:41 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1RL4fM1025871; Wed, 27 Feb 2019 21:04:41 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1RL4fiR025868; Wed, 27 Feb 2019 21:04:41 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201902272104.x1RL4fiR025868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 27 Feb 2019 21:04:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344634 - in head/sys: arm64/conf conf dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm64/conf conf dev/usb/controller X-SVN-Commit-Revision: 344634 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 073CD8FD15 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 21:04:42 -0000 Author: manu Date: Wed Feb 27 21:04:40 2019 New Revision: 344634 URL: https://svnweb.freebsd.org/changeset/base/344634 Log: xhci_mv: Move the driver to generic_xhci Marvell XHCI is in fact generic-xhci, so move the driver and add the compatible string. While here, get and enable the phy if the dtb provide one. The xhci bindings state that phys should be in a 'phys' property but Marvell DTS uses 'usb-phy', only add support for 'usb-phy' for now. Sponsored-by: Rubicon Communications, LCC ("Netgate") Added: head/sys/dev/usb/controller/generic_xhci.c - copied, changed from r344633, head/sys/dev/usb/controller/xhci_mv.c Deleted: head/sys/dev/usb/controller/xhci_mv.c Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Wed Feb 27 20:52:35 2019 (r344633) +++ head/sys/arm64/conf/GENERIC Wed Feb 27 21:04:40 2019 (r344634) @@ -196,7 +196,6 @@ device ohci # OHCI USB interface device ehci # EHCI USB interface (USB 2.0) device ehci_mv # Marvell EHCI USB interface device xhci # XHCI PCI->USB interface (USB 3.0) -device xhci_mv # Marvell XHCI USB interface device usb # USB Bus (required) device ukbd # Keyboard device umass # Disks/Mass storage - Requires scbus and da Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Wed Feb 27 20:52:35 2019 (r344633) +++ head/sys/conf/files.arm64 Wed Feb 27 21:04:40 2019 (r344634) @@ -233,8 +233,8 @@ dev/usb/controller/ehci_mv.c optional ehci_mv fdt dev/usb/controller/generic_ehci.c optional ehci acpi dev/usb/controller/generic_ohci.c optional ohci fdt dev/usb/controller/generic_usb_if.m optional ohci fdt -dev/usb/controller/xhci_mv.c optional xhci_mv fdt dev/usb/controller/usb_nop_xceiv.c optional fdt ext_resources +dev/usb/controller/generic_xhci.c optional xhci fdt dev/vnic/mrml_bridge.c optional vnic fdt dev/vnic/nic_main.c optional vnic pci dev/vnic/nicvf_main.c optional vnic pci pci_iov Copied and modified: head/sys/dev/usb/controller/generic_xhci.c (from r344633, head/sys/dev/usb/controller/xhci_mv.c) ============================================================================== --- head/sys/dev/usb/controller/xhci_mv.c Wed Feb 27 20:52:35 2019 (r344633, copy source) +++ head/sys/dev/usb/controller/generic_xhci.c Wed Feb 27 21:04:40 2019 (r344634) @@ -64,6 +64,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef EXT_RESOURCES +#include +#endif + #define XHCI_HC_DEVSTR "Marvell Integrated USB 3.0 controller" #define XHCI_HC_VENDOR "Marvell" @@ -76,6 +80,7 @@ static struct ofw_compat_data compat_data[] = { {"marvell,armada-380-xhci", true}, {"marvell,armada3700-xhci", true}, {"marvell,armada-8k-xhci", true}, + {"generic-xhci", true}, {NULL, false} }; @@ -99,6 +104,10 @@ xhci_attach(device_t dev) { struct xhci_softc *sc = device_get_softc(dev); int err = 0, rid = 0; +#ifdef EXT_RESOURCES + phandle_t node; + phy_t phy; +#endif sc->sc_bus.parent = dev; sc->sc_bus.devices = sc->sc_devices; @@ -123,6 +132,13 @@ xhci_attach(device_t dev) xhci_detach(dev); return (ENXIO); } + +#ifdef EXT_RESOURCES + node = ofw_bus_get_node(dev); + if (phy_get_by_ofw_property(dev, node, "usb-phy", &phy) == 0) + if (phy_enable(phy) != 0) + device_printf(dev, "Cannot enable phy\n"); +#endif sc->sc_bus.bdev = device_add_child(dev, "usbus", -1); if (sc->sc_bus.bdev == NULL) {