From owner-svn-src-head@freebsd.org Sun Feb 12 00:52:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41D20CCEA74; Sun, 12 Feb 2017 00:52:24 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id ECF8B1B91; Sun, 12 Feb 2017 00:52:23 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1C0qNwJ064275; Sun, 12 Feb 2017 00:52:23 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1C0qMTl064272; Sun, 12 Feb 2017 00:52:22 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201702120052.v1C0qMTl064272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 12 Feb 2017 00:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313674 - in head/sys: arm/freescale/imx dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2017 00:52:24 -0000 Author: ian Date: Sun Feb 12 00:52:22 2017 New Revision: 313674 URL: https://svnweb.freebsd.org/changeset/base/313674 Log: Enable usb low and full speed devices connected to the imx6 root hubs. This enables the PHY circuitry for UTMI+ level 2 and 3, and sets the flag to tell the ehci code that the root hub has a transaction translator in it. For imx6 we can use the standard ehci_get_port_speed_portsc() function to find out what speed device is connected to the port. Modified: head/sys/arm/freescale/imx/imx6_usbphy.c head/sys/dev/usb/controller/ehci_imx.c Modified: head/sys/arm/freescale/imx/imx6_usbphy.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_usbphy.c Sat Feb 11 23:45:50 2017 (r313673) +++ head/sys/arm/freescale/imx/imx6_usbphy.c Sun Feb 12 00:52:22 2017 (r313674) @@ -143,6 +143,10 @@ usbphy_attach(device_t dev) bus_write_4(sc->mem_res, CTRL_SET_REG, CTRL_SFTRST); bus_write_4(sc->mem_res, CTRL_CLR_REG, CTRL_SFTRST | CTRL_CLKGATE); + /* Set UTMI+ level 2+3 bits to enable low and full speed devices. */ + bus_write_4(sc->mem_res, CTRL_SET_REG, + CTRL_ENUTMILEVEL2 | CTRL_ENUTMILEVEL3); + /* Power up: clear all bits in the powerdown register. */ bus_write_4(sc->mem_res, PWD_REG, 0); Modified: head/sys/dev/usb/controller/ehci_imx.c ============================================================================== --- head/sys/dev/usb/controller/ehci_imx.c Sat Feb 11 23:45:50 2017 (r313673) +++ head/sys/dev/usb/controller/ehci_imx.c Sun Feb 12 00:52:22 2017 (r313674) @@ -298,8 +298,9 @@ imx_ehci_attach(device_t dev) * Set flags that affect ehci_init() behavior, and hook our post-reset * code into the standard controller code. */ - esc->sc_flags |= EHCI_SCFLG_NORESTERM; + esc->sc_flags |= EHCI_SCFLG_NORESTERM | EHCI_SCFLG_TT; esc->sc_vendor_post_reset = imx_ehci_post_reset; + esc->sc_vendor_get_port_speed = ehci_get_port_speed_portsc; err = ehci_init(esc); if (err != 0) {