Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp720631ybh; Tue, 10 Mar 2020 07:06:34 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvea10o9Dr8WYLX/CcYT98rrBcEVbMq8vicfqodCMRVemND5NxTlBiUP1+Ec8zzMf3ZpFxD X-Received: by 2002:a9d:3661:: with SMTP id w88mr8591332otb.223.1583849194092; Tue, 10 Mar 2020 07:06:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583849194; cv=none; d=google.com; s=arc-20160816; b=fkCPl/WZ2Jy0/pir6bk0ELILEzM7MdUowfiwQUv9jZa7jeqrl1yk7mE5C0wljkrGsm HolQ7J3mXoAxv4evZh45AAoOuAFR7Tm0Zorqoly9nHpLkD1Ry+BGh/j9I4cn/+wJeLRJ CRmJxnWqHoVMbwoe1weX67kXG3LCBRj6KLc3v+R8yeo+p85/6J/c/U5gYMgQht+LzK1A 5RdneEEaMQOrujmyE++RthldS5tH/OVNr+bDIMqjkWasKEwQXXfq07DAPvzzvx8yi81j tAMxXNVRRrbCz0B948UYxypKAvR33PPAnLK0hQNb7NQs1ipwIX9LUs4dqBYrHVlqEgLv gHfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=+M2ImOfSig8tnMBvl4N/YU4BgtZU4gh4Pxzrb2iRpeM=; b=gYD4QYVL9FIkF0wJRr1gSVJffxnpomoc49PN6rnz4LKzfY5pDyzLwaKp+X3jl6BHUK QSBfoQTpi3QxBtD3JQoHexSUxS1/Wwf9riZCkL6nb3O6rz3LlId9/oQlYV1Qrlz3aCUS 5foohrSQkBI7YtrNppsZFhRoxSuCZNn1WbLdXoZb4/XbsGGto/4drjk8Dgo8caLTv2MN ajzNu8VfzokVgys5mSNvsqAT+usJ6WGbWGXcHV/Dua59wkK/Ovc6Yp8F9I5IF6niWKJ9 rbL3rwpGm4S++f3dDY6BY0Lzg2WYu+KHJJLEZh9pLDopnqSLA9lkVhiimvjwJ6MkBbKl XvcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m15si7595377otq.324.2020.03.10.07.06.01; Tue, 10 Mar 2020 07:06:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727103AbgCJODq (ORCPT + 99 others); Tue, 10 Mar 2020 10:03:46 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:37870 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726539AbgCJODq (ORCPT ); Tue, 10 Mar 2020 10:03:46 -0400 Received: (qmail 1809 invoked by uid 2102); 10 Mar 2020 10:03:45 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 10 Mar 2020 10:03:45 -0400 Date: Tue, 10 Mar 2020 10:03:45 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Lubomir Rintel cc: Greg Kroah-Hartman , , Subject: Re: [PATCH 1/2] USB: EHCI: ehci-mv: switch the HSIC HCI to HSIC mode In-Reply-To: <20200309130014.548168-1-lkundrak@v3.sk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 9 Mar 2020, Lubomir Rintel wrote: > Turns out the undocumented and reserved bits of port status/control > register of the root port need to be set to use the HCI in HSIC mode. > > Typically the firmware does this, but that is not always good enough, > because the bits get lost if the HSIC clock is disabled (e.g. when > ehci-mv is build as a module). > > This supplements commit 7b104f890ade ("USB: EHCI: ehci-mv: add HSIC > support"). > > Signed-off-by: Lubomir Rintel Acked-by: Alan Stern > --- > drivers/usb/host/ehci-mv.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c > index bd4f6ef534d96..ddb668963955f 100644 > --- a/drivers/usb/host/ehci-mv.c > +++ b/drivers/usb/host/ehci-mv.c > @@ -110,6 +110,7 @@ static int mv_ehci_probe(struct platform_device *pdev) > struct resource *r; > int retval = -ENODEV; > u32 offset; > + u32 status; > > if (usb_disabled()) > return -ENODEV; > @@ -213,6 +214,14 @@ static int mv_ehci_probe(struct platform_device *pdev) > device_wakeup_enable(hcd->self.controller); > } > > + if (of_usb_get_phy_mode(pdev->dev.of_node) == USBPHY_INTERFACE_MODE_HSIC) { > + status = ehci_readl(ehci, &ehci->regs->port_status[0]); > + /* These "reserved" bits actually enable HSIC mode. */ > + status |= BIT(25); > + status &= ~GENMASK(31, 30); > + ehci_writel(ehci, status, &ehci->regs->port_status[0]); > + } > + > dev_info(&pdev->dev, > "successful find EHCI device with regs 0x%p irq %d" > " working in %s mode\n", hcd->regs, hcd->irq, >