From owner-svn-src-head@FreeBSD.ORG Mon Sep 24 16:34:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DDB9106566B; Mon, 24 Sep 2012 16:34:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 600E18FC0A; Mon, 24 Sep 2012 16:34:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8OGYETo054465; Mon, 24 Sep 2012 16:34:14 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8OGYEXa054463; Mon, 24 Sep 2012 16:34:14 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209241634.q8OGYEXa054463@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 24 Sep 2012 16:34:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240890 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 24 Sep 2012 16:34:14 -0000 Author: hselasky Date: Mon Sep 24 16:34:13 2012 New Revision: 240890 URL: http://svn.freebsd.org/changeset/base/240890 Log: DWC OTG host mode improvements: - Make HSIC selection dynamic. - Make LOW speed USB devices work through HIGH speed USB HUB. Modified: head/sys/dev/usb/controller/dwc_otg.c Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Mon Sep 24 15:16:06 2012 (r240889) +++ head/sys/dev/usb/controller/dwc_otg.c Mon Sep 24 16:34:13 2012 (r240890) @@ -101,12 +101,18 @@ __FBSDID("$FreeBSD$"); GINTMSK_HCHINTMSK | \ GINTSTS_PRTINT) -#define DWC_OTG_USE_HSIC 0 +static int dwc_otg_use_hsic; + +static SYSCTL_NODE(_hw_usb, OID_AUTO, dwc_otg, CTLFLAG_RW, 0, "USB DWC OTG"); + +SYSCTL_INT(_hw_usb_dwc_otg, OID_AUTO, use_hsic, CTLFLAG_RD, + &dwc_otg_use_hsic, 0, "DWC OTG uses HSIC interface"); + +TUNABLE_INT("hw.usb.dwc_otg.use_hsic", &dwc_otg_use_hsic); #ifdef USB_DEBUG static int dwc_otg_debug; -static SYSCTL_NODE(_hw_usb, OID_AUTO, dwc_otg, CTLFLAG_RW, 0, "USB DWC OTG"); SYSCTL_INT(_hw_usb_dwc_otg, OID_AUTO, debug, CTLFLAG_RW, &dwc_otg_debug, 0, "DWC OTG debug level"); #endif @@ -701,6 +707,15 @@ dwc_otg_host_setup_tx(struct dwc_otg_td } } + /* treat NYET like NAK, if SPLIT transactions are used */ + if (hcint & HCINT_NYET) { + if (td->hcsplt != 0) { + DPRINTF("CH=%d NYET+SPLIT\n", td->channel); + hcint &= ~HCINT_NYET; + hcint |= HCINT_NAK; + } + } + /* channel must be disabled before we can complete the transfer */ if (hcint & (HCINT_ERRORS | HCINT_RETRY | @@ -1041,6 +1056,15 @@ dwc_otg_host_data_rx(struct dwc_otg_td * } } + /* treat NYET like NAK, if SPLIT transactions are used */ + if (hcint & HCINT_NYET) { + if (td->hcsplt != 0) { + DPRINTF("CH=%d NYET+SPLIT\n", td->channel); + hcint &= ~HCINT_NYET; + hcint |= HCINT_NAK; + } + } + /* channel must be disabled before we can complete the transfer */ if (hcint & (HCINT_ERRORS | HCINT_RETRY | @@ -1391,6 +1415,15 @@ dwc_otg_host_data_tx(struct dwc_otg_td * } } + /* treat NYET like NAK, if SPLIT transactions are used */ + if (hcint & HCINT_NYET) { + if (td->hcsplt != 0) { + DPRINTF("CH=%d NYET+SPLIT\n", td->channel); + hcint &= ~HCINT_NYET; + hcint |= HCINT_NAK; + } + } + /* channel must be disabled before we can complete the transfer */ if (hcint & (HCINT_ERRORS | HCINT_RETRY | @@ -2979,7 +3012,7 @@ dwc_otg_init(struct dwc_otg_softc *sc) } /* select HSIC or non-HSIC mode */ - if (DWC_OTG_USE_HSIC) { + if (dwc_otg_use_hsic) { DWC_OTG_WRITE_4(sc, DOTG_GUSBCFG, GUSBCFG_PHYIF | GUSBCFG_TRD_TIM_SET(5) | temp);