From owner-svn-src-all@freebsd.org Tue Mar 6 22:45:45 2018 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 AD9A8F3656E; Tue, 6 Mar 2018 22:45:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 620F96F78C; Tue, 6 Mar 2018 22:45:45 +0000 (UTC) (envelope-from kevans@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 5D18419160; Tue, 6 Mar 2018 22:45:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w26MjjSj073835; Tue, 6 Mar 2018 22:45:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w26MjjJK073834; Tue, 6 Mar 2018 22:45:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803062245.w26MjjJK073834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 6 Mar 2018 22:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330554 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 330554 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 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: Tue, 06 Mar 2018 22:45:45 -0000 Author: kevans Date: Tue Mar 6 22:45:45 2018 New Revision: 330554 URL: https://svnweb.freebsd.org/changeset/base/330554 Log: aw_usbphy: Move later to SUPPORTDEV pass vbus-supply properties may be specified for each PHY. These properties reference a regulator that we must turn on/off as we turn the PHY on/off. However, if the usbphy comes up before the regulator in question (as is the case with GPIO-controlled regulators), then we will fail to grab a handle to the regulator and control it as the PHY power state changes. Fix it by just attaching the usbphy driver later. We don't really need it at RESOURCE, we just need it to be before DEFAULT when ehci/ohci attach. In particular, this fixes the USB NIC on a board that we don't yet supported- without this, it will not power on and if_ure cannot attach. Tested on: various boards [manu] Tested on: OrangePi R1 [Rap2 (irc)] Reported by: Rap2 (irc, "Cannot find USB NIC") Modified: head/sys/arm/allwinner/aw_usbphy.c Modified: head/sys/arm/allwinner/aw_usbphy.c ============================================================================== --- head/sys/arm/allwinner/aw_usbphy.c Tue Mar 6 21:45:23 2018 (r330553) +++ head/sys/arm/allwinner/aw_usbphy.c Tue Mar 6 22:45:45 2018 (r330554) @@ -418,7 +418,7 @@ static driver_t awusbphy_driver = { }; static devclass_t awusbphy_devclass; - +/* aw_usbphy needs to come up after regulators/gpio/etc, but before ehci/ohci */ EARLY_DRIVER_MODULE(awusbphy, simplebus, awusbphy_driver, awusbphy_devclass, - 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); + 0, 0, BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(awusbphy, 1);