From owner-svn-src-head@FreeBSD.ORG Tue Oct 14 20:45:13 2008 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 0170A1065687 for ; Tue, 14 Oct 2008 20:45:13 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.31]) by mx1.freebsd.org (Postfix) with ESMTP id AC1E78FC24 for ; Tue, 14 Oct 2008 20:45:12 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by yw-out-2324.google.com with SMTP id 9so576236ywe.13 for ; Tue, 14 Oct 2008 13:45:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=pIbr0BBYSqOkENYsQ6X/OV7oFZjVvrMzx+0rZFSQiVg=; b=OkzhTuAvr7nSAyezPEb++RALlUuSnsIrOGZsvg2nc9FJFwINLg5IEp+IsMkm25Jisf SNKeIbNYsNNKYcGT86xP7FeINDCLjCwdRCJS9MRG9H6xX9+TdphfXEBxk6bQ4hr3YF6H ftOZL8SteKYaMKtCkIsjs2QZwJpjTwQnweQ/0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=hdyNwnE+m5OfcXNKLygWrufWfQ9L1sWAO+AqUVYQC0lAsSIE0YhSMn0rwoZgzcHBNr cvLZ4fyG2LnFjfiNfss5rjCeaM8Y8suj7lNUm55FxHc4W4IC9Zm20KMcjnYCsNTd+dDr Qhf0ai0eoH8P6OeK0Hw5GGwkAnXbfl9jPGFsU= Received: by 10.103.170.13 with SMTP id x13mr2003muo.27.1224015761414; Tue, 14 Oct 2008 13:22:41 -0700 (PDT) Received: by 10.103.239.14 with HTTP; Tue, 14 Oct 2008 13:22:41 -0700 (PDT) Message-ID: <3bbf2fe10810141322o5ee27a2eka8a3a902ced6fc97@mail.gmail.com> Date: Tue, 14 Oct 2008 22:22:41 +0200 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Rafal Jaworowski" In-Reply-To: <200810140705.m9E75K3x098307@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200810140705.m9E75K3x098307@svn.freebsd.org> X-Google-Sender-Auth: 702ec6ba63711b08 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r183866 - head/sys/dev/usb 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: Tue, 14 Oct 2008 20:45:13 -0000 2008/10/14, Rafal Jaworowski : > Author: raj > Date: Tue Oct 14 07:05:20 2008 > New Revision: 183866 > URL: http://svn.freebsd.org/changeset/base/183866 > > Log: > Mbus attachment for USB EHCI integrated controller on Marvell chips. > > This includes workarounds required for the ehci(4) to handle some non-standard > behaviour of these devices. > > Obtained from: Marvell, Semihalf > > Added: > head/sys/dev/usb/ehci_mbus.c (contents, props changed) > Modified: > head/sys/dev/usb/ehci.c > head/sys/dev/usb/ehcivar.h > > Modified: head/sys/dev/usb/ehci.c > ============================================================================== > --- head/sys/dev/usb/ehci.c Tue Oct 14 04:09:33 2008 (r183865) > +++ head/sys/dev/usb/ehci.c Tue Oct 14 07:05:20 2008 (r183866) > @@ -351,8 +351,12 @@ ehci_hcreset(ehci_softc_t *sc) > for (i = 0; i < 100; i++) { > usb_delay_ms(&sc->sc_bus, 1); > hcr = EOREAD4(sc, EHCI_USBCMD) & EHCI_CMD_HCRESET; > - if (!hcr) > + if (!hcr) { > + if (sc->sc_flags & EHCI_SCFLG_SETMODE) > + EOWRITE4(sc, 0x68, 0x3); > + > return (USBD_NORMAL_COMPLETION); > + } > } > printf("%s: reset timeout\n", device_get_nameunit(sc->sc_bus.bdev)); > return (USBD_IOERROR); > @@ -2194,7 +2198,18 @@ ehci_root_ctrl_start(usbd_xfer_handle xf > v = EOREAD4(sc, EHCI_PORTSC(index)); > DPRINTFN(8,("ehci_root_ctrl_start: port status=0x%04x\n", > v)); > + > i = UPS_HIGH_SPEED; > + > + if (sc->sc_flags & EHCI_SCFLG_FORCESPEED) { > + if ((v & 0xc000000) == 0x8000000) > + i = UPS_HIGH_SPEED; > + else if ((v & 0xc000000) == 0x4000000) > + i = UPS_LOW_SPEED; > + else > + i = 0; > + } > + > if (v & EHCI_PS_CS) i |= UPS_CURRENT_CONNECT_STATUS; > if (v & EHCI_PS_PE) i |= UPS_PORT_ENABLED; > if (v & EHCI_PS_SUSP) i |= UPS_SUSPEND; > @@ -2249,7 +2264,11 @@ ehci_root_ctrl_start(usbd_xfer_handle xf > goto ret; > } > /* Terminate reset sequence. */ > - EOWRITE4(sc, port, v); > + if (sc->sc_flags & EHCI_SCFLG_NORESTERM) > + ; > + else > + EOWRITE4(sc, port, v); > + > /* Wait for HC to complete reset. */ > usb_delay_ms(&sc->sc_bus, EHCI_PORT_RESET_COMPLETE); > if (sc->sc_dying) { > > Added: head/sys/dev/usb/ehci_mbus.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/usb/ehci_mbus.c Tue Oct 14 07:05:20 2008 (r183866) > @@ -0,0 +1,318 @@ > +/*- > + * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. > + * All rights reserved. > + * > + * Developed by Semihalf. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * 3. Neither the name of MARVELL nor the names of contributors > + * may be used to endorse or promote products derived from this software > + * without specific prior written permission. > + * > + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +/* > + * MBus attachment driver for the USB Enhanced Host Controller. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include "opt_bus.h" > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include Why this includes lockmgr? I don't think it needs. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein