From patchwork Tue Sep 16 22:46:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Bresticker X-Patchwork-Id: 4921461 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AC6CE9F3ED for ; Tue, 16 Sep 2014 22:47:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 02C572017D for ; Tue, 16 Sep 2014 22:49:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E6ED220109 for ; Tue, 16 Sep 2014 22:49:06 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XU1W7-0007IJ-Vh; Tue, 16 Sep 2014 22:46:35 +0000 Received: from mail-vc0-x233.google.com ([2607:f8b0:400c:c03::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XU1Vx-00077D-3K for linux-arm-kernel@lists.infradead.org; Tue, 16 Sep 2014 22:46:26 +0000 Received: by mail-vc0-f179.google.com with SMTP id im17so557021vcb.38 for ; Tue, 16 Sep 2014 15:46:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ZdV6CpZNyQ/ehiyi8qx9puop7UBqKZ+2ASkSvovkYLw=; b=J4F0W/tEauJ8i0DpkXGS3fqjZE383odMpnu1UPAV1YVZrhYhSrQGeuZKSMgGt9tFgP amN1uelIAntWYzoWoKcQGyXi3Oe4l7xKC04z/4t8Td8k3YgV0hrjxiBIG7lS7JjeNKs2 hNvlks9YjvgXYhGyjThdqvxgvUBYwl2P+bDb70J3SqgSkuv1vhmjDSFaLD/d64zMQREM Ihsx/91ESGRqcNCc4K0O4ddXaA3bYTmsSDcDcy1keblP+v5zt7oG+8i8Hz0OEcI6uVCM Vqhwe9yJvmm4G9Nrpa3vrTisYv1eUDIskS6jf9gT9Ipg/Ll3OX1MqQyISllv0bX9n8rW pgjA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ZdV6CpZNyQ/ehiyi8qx9puop7UBqKZ+2ASkSvovkYLw=; b=XrmAFrF5BO5s1TbbhYcEbPtFNGX+EX48IVbXx3SARopq03x8MgvP5GtiPwAhyuL/yp 3osSX69j1m05w5sDRAW57/lrxDEncCGo7WPDNegQ1aHysukytIQGY4dSu4CqFvNxVeoV fcguukgKR7RHm20NWOZtqyK23jwue2DPxHEBE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ZdV6CpZNyQ/ehiyi8qx9puop7UBqKZ+2ASkSvovkYLw=; b=OM6MjgIkQw/wbl6BELUll39Hl1dscfoqLjMGFIFHJ35zU27WtO2Po9IlfRMwHUkSvC F2DLw22HWyvOZu6FlWqpc6RHc0omo1V+J/1aBrqdBKrj4OvRiqL+1e2qfRu0s7y2YD59 oCVIseMjx4+zs/njO/fVNRNReD04Cxsec3dUWW1Y8nqiCZqe1D3hKLN6F9McH2eSwIw9 fDRErhv6NVUx6zoXulVFHxwJpuNWNcft1Na3ojNichg04fMe2TS9Vyi2qXl5BBry9rzz 7iJ4jTSTZw8mGNILASiYj9EpacjnYH3icBKfY7FyU34czHgkXLnx7wYlw6bOW9T+ug6e foIw== X-Gm-Message-State: ALoCoQnUX1oQeAB2GCEiIf8nnRdj4ykt1L5UNnM7kp1vNpGOnzvyzEe7mdGz1miWkhAUsHcyIrKg MIME-Version: 1.0 X-Received: by 10.52.137.2 with SMTP id qe2mr27134023vdb.11.1410907562869; Tue, 16 Sep 2014 15:46:02 -0700 (PDT) Received: by 10.52.168.200 with HTTP; Tue, 16 Sep 2014 15:46:02 -0700 (PDT) In-Reply-To: References: <1409693701-16520-1-git-send-email-abrestic@chromium.org> <54172B3F.9030901@wwwdotorg.org> <54185698.7020600@wwwdotorg.org> Date: Tue, 16 Sep 2014 15:46:02 -0700 X-Google-Sender-Auth: K8jdA6EiAFo_wqIZfC3srsdtyO4 Message-ID: Subject: Re: [PATCH v3 0/9] Tegra xHCI support From: Andrew Bresticker To: Stephen Warren X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140916_154625_291804_801F029B X-CRM114-Status: GOOD ( 22.91 ) X-Spam-Score: -0.8 (/) Cc: Mark Rutland , "devicetree@vger.kernel.org" , "linux-usb@vger.kernel.org" , Russell King , Mathias Nyman , Pawel Moll , Ian Campbell , Greg Kroah-Hartman , Linus Walleij , Jassi Brar , "linux-kernel@vger.kernel.org" , Arnd Bergmann , Kishon Vijay Abraham I , Grant Likely , Rob Herring , Thierry Reding , "linux-arm-kernel@lists.infradead.org" , Kumar Gala , "linux-tegra@vger.kernel.org" , Alan Stern , Tomeu Vizoso X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Sep 16, 2014 at 9:57 AM, Andrew Bresticker wrote: > On Tue, Sep 16, 2014 at 8:26 AM, Stephen Warren wrote: >> On 09/15/2014 01:30 PM, Andrew Bresticker wrote: >>> >>> On Mon, Sep 15, 2014 at 11:09 AM, Stephen Warren >>> wrote: >>>> >>>> On 09/15/2014 11:06 AM, Andrew Bresticker wrote: >>>>> >>>>> On Mon, Sep 15, 2014 at 12:00 AM, Tomeu Vizoso >>>>> wrote: >>>>>> >>>>>> On 12 September 2014 18:37, Andrew Bresticker >>>>>> wrote: >>>>>>> >>>>>>> On Tue, Sep 9, 2014 at 1:21 AM, Tomeu Vizoso >>>>>>> wrote: >>>>>>>> >>>>>>>> On 8 September 2014 18:22, Andrew Bresticker >>>>>>>> wrote: >>>>>>>>> >>>>>>>>> On Mon, Sep 8, 2014 at 8:34 AM, Tomeu Vizoso >>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>> On 2 September 2014 23:34, Andrew Bresticker >>>>>>>>>> wrote: >>>>>>>>>>> >>>>>>>>>>> Tested on Venice2, Jetson TK1, and Big with a variety of USB2.0 >>>>>>>>>>> and >>>>>>>>>>> USB3.0 memory sticks and ethernet dongles using controller >>>>>>>>>>> firmware >>>>>>>>>>> recently posted by Andrew Chew [2]. >> >> ... >>>>> >>>>> Stephen, Thierry, have either of you had a chance to test this series? >>>> >>>> >>>> I haven't had a chance to yet. I just went to try it out, and found that >>>> it >>>> depends on a whole slew of other patches that I don't have. Is there a >>>> git >>>> branch somewhere to save me having to track down all the dependencies? >>> >>> >>> Yes, Tomeu has the branch he used for testing here: >>> http://cgit.collabora.com/git/user/tomeu/linux.git/log/?h=3.17rc4-xhci >> >> >> Hmm. That git server was quite reluctant to cough up its bits, but it did >> eventually. >> >>> You'll also need the firmware Andrew Chew posted: >>> https://patchwork.ozlabs.org/patch/384013/ >> >> >> The XHCI driver can't load its firmware unless it's a module; if I make it >> built-in, it fails immediately with error -2 during "Direct firmware >> loading". The driver needs to work with either immediate or deferred >> firmware loading. > > If you want the driver to be built-in, you'll either need to build the > firmware in as well (i.e. EXTRA_FIRMWARE) or enable > FW_LOADER_USER_HELPER_FALLBACK to load with userspace/uevent (though > apparently this is deprecated). > >> The following USB2 devices had problems: >> >> 0b95:7720 ASIX Electronics Corp. AX88772 >> >>> [ 489.140536] usb 1-3: new high-speed USB device number 81 using >>> xhci-tegra >>> [ 489.260860] usb 1-3: device descriptor read/64, error -71 >>> [ 489.370804] xhci-tegra 70090000.usb: Setup ERROR: setup context command >>> for slot 1. >>> [ 489.378463] usb 1-3: hub failed to enable device, error -22 >>> [ 489.500531] usb 1-3: new high-speed USB device number 82 using >>> xhci-tegra >>> [ 489.655708] usb 1-3: can't set config #1, error -71 >>> [ 489.661231] usb 1-3: USB disconnect, device number 82 >>> [ 489.940531] usb 1-3: new high-speed USB device number 83 using >>> xhci-tegra >>> [ 490.060860] usb 1-3: device descriptor read/64, error -71 >>> [ 490.170805] xhci-tegra 70090000.usb: Setup ERROR: setup context command >>> for slot 1. >>> [ 490.178462] usb 1-3: hub failed to enable device, error -22 >> >> (repeats over and over) >> >> 15a4:1336 Afatech Technologies, Inc. SDHC/MicroSD/MMC/MS/M2/CF/XD Flash Card >> Reader >> >> The power light comes on, and the activity light just keeps flashing fast. >> Usually the activity light flashes a couple times and then turns off. There >> is nothing in dmesg at all for this device. >> >> 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB >> >> Not detected. There is nothing in dmesg at all for this device. >> >> 1bcf:0c31 Sunplus Innovation Technology Inc. SPIF30x Serial-ATA bridge >> >> Not detected. There is nothing in dmesg at all for this device. > > Thanks, I'll try to figure out what's going on here. Grr... this is due to the unfortunate UTMI pad controller design on Tegra. Here's the issue: When UTMI pad 0 is assigned to the EHCI controller (as is currently the case on Jetson-TK1), the UTMI parameters from UTMIP_BIAS_CFG0 in the global UTMI pad register space are used regardless of the owner of the UTMI pads. If pad 0 is assigned to the XUSB controller, then parameters in USB2_BIAS_PAD_CTL0 in the XUSB register space are used for all UTMI pads (again, regardless of ownership). I wasn't able to reproduce before because I always TFTP booted and U-Boot programs the UTMI parameters correctly when starting the EHCI controllers. I suspect you and Tomeu were booting without starting the EHCI controllers and thus were stuck with the POR values. The easiest way to fix this is to just assign UTMI port 0 (i.e. the OTG port) to the XUSB controller. AFAIK, device mode on Tegra isn't supported yet in the kernel, so this shouldn't break any existing use cases. If we wanted to support device mode in the future, it would just have to be done with the XUSB controller instead. The alternative is some ugly driver that programs the correct register set depending on which controller UTMI port 0 is assigned to. BTW, here's a patch to assign UTMI port 0 to XUSB: diff --git a/arch/arm/boot/dts/tegra124-jetson-tk1.dts b/arch/arm/boot/dts/tegra124-jetson-tk1.dts index a473750..dacb0d0 100644 --- a/arch/arm/boot/dts/tegra124-jetson-tk1.dts +++ b/arch/arm/boot/dts/tegra124-jetson-tk1.dts @@ -1644,7 +1644,7 @@ padctl_default: pinmux { otg { - nvidia,lanes = "otg-1", "otg-2"; + nvidia,lanes = "otg-0", "otg-1", "otg-2"; nvidia,function = "xusb"; };