From patchwork Tue Apr 16 21:53:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10904223 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 106C113B5 for ; Tue, 16 Apr 2019 21:54:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EADF628A0E for ; Tue, 16 Apr 2019 21:54:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF6B428535; Tue, 16 Apr 2019 21:54:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 804B228A0E for ; Tue, 16 Apr 2019 21:54:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=12GMx5O20LCI50PptxR8n7McSI9g29wUP89eV/6KHC0=; b=rHS/N95QrRpGOx RaNv+dPrjcpfZjzkHdvDHhXKxKXBC5Bc+Nrtvu+Gv79mLuuTo0CcpVLNrRy/miMRk7ZLOHM5sn/pK q3Wpqx6T/wRTP+KggA5bFwuJ2MLoEFcOMMNoE4oq8lHFj74bKetigB0kK3KrBXEStcXRMGSqvvQxg /Qw7ZjiLK7YMghqiEYWNTvPrKt74a/HEqmeZnjx7ljR9bpXD+GAjOvtJnBE8L0e2JznoT0L6N6mvd osu7FH0WAjZz+RhFn5EJsWhMj6WvtJpip9d6VsT+ch9+TzjDWRD6JqSiCkcWYl2QRJpBpz2/wXSmK 69wi8XvwM9IkxQpG0pTA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGW26-0008Og-Fp; Tue, 16 Apr 2019 21:54:26 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGW1t-00088T-P7 for linux-rockchip@lists.infradead.org; Tue, 16 Apr 2019 21:54:15 +0000 Received: by mail-pf1-x444.google.com with SMTP id i17so11056541pfo.6 for ; Tue, 16 Apr 2019 14:54:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XsFf4LEh0pktHURaMfPnlhrkOmI1Owbh5PPEFMjaE6c=; b=iAutK9hipedEuHpce3EVCQiVHg1QIADXgE6iqLm1r6d1fj7U2UxC7EQiQB9cxDi8Ii SfBS68X6Kezeq3ah8uFonHpSA+3J6bahOeI5qcPe3sJRjsHoOFtB8xueB7usSKAPIseB t4vRGdujBdSPadp44iYqSkCoHtvKGS+e621f4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XsFf4LEh0pktHURaMfPnlhrkOmI1Owbh5PPEFMjaE6c=; b=OkCF1OXUpC6FTI3R8s5NF5nGE869yXzQd2c0Irr70r4wf3WUAVJZtM9GBGSo76I0zY wwuATreFAreBqxMyGwdra/pMJaJ9bJWsRJKEPtHDMTH7RkdXCq/i9mJY9fSGFyRlWDaL lEJo+ynHXhh3zZzITpTzHOVErTVK6OxfPoh8PckT82dfpiHni6VJe6uVAk5s0frgbhlS H7y+MFo6vHGFmqwPhALYpRj1DKY9PBNZmalfKTQUeVosDsDEORCDotA/X24X5hXc3WKe CdeZNfLYHPSz00ZJS668fddlnPdE/v/m6IP3wCRaj7hfHaJcboj9d5w0RUakm8XIJKXD Fr3g== X-Gm-Message-State: APjAAAXZbZ0IUrtf4o+gVW/wEeeXJDXCoTR9sde0BTXsT8XtqiMrfdIP h38GZFUQHXXaw2OkfRf1ir7IEg== X-Google-Smtp-Source: APXvYqx9Echs2wcQSIcKJnQgMM0GXGhmDvbnb5yHOmCUV3xMZ9JzJrqQ4WwBfzBGesIzMap8lN9mAQ== X-Received: by 2002:a63:4144:: with SMTP id o65mr75004207pga.241.1555451653028; Tue, 16 Apr 2019 14:54:13 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id b6sm8156770pgt.58.2019.04.16.14.54.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 14:54:12 -0700 (PDT) From: Douglas Anderson To: Rob Herring , Minas Harutyunyan , Heiko Stuebner , Felipe Balbi Subject: [PATCH v2 1/4] dt-bindings: usb: dwc2: Document quirk to reset PHY upon wakeup Date: Tue, 16 Apr 2019 14:53:48 -0700 Message-Id: <20190416215351.242246-2-dianders@chromium.org> X-Mailer: git-send-email 2.21.0.593.g511ec345e18-goog In-Reply-To: <20190416215351.242246-1-dianders@chromium.org> References: <20190416215351.242246-1-dianders@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190416_145413_810244_019D546A X-CRM114-Status: GOOD ( 10.41 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, linux-usb@vger.kernel.org, amstan@chromium.org, Greg Kroah-Hartman , Randy Li , Douglas Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, mka@chromium.org, ryandcase@chromium.org, Elaine Zhang , jwerner@chromium.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Rockchip rk3288 there's a hardware quirk where we need to assert the reset signal to the PHY when we get a remote wakeup on one of the two ports. Document this quirk in the bindings. Signed-off-by: Douglas Anderson Reviewed-by: Matthias Kaehlcke --- Changes in v2: None Documentation/devicetree/bindings/usb/dwc2.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/dwc2.txt b/Documentation/devicetree/bindings/usb/dwc2.txt index 6dc3c4a34483..f70f3aee4bfc 100644 --- a/Documentation/devicetree/bindings/usb/dwc2.txt +++ b/Documentation/devicetree/bindings/usb/dwc2.txt @@ -37,6 +37,8 @@ Refer to phy/phy-bindings.txt for generic phy consumer properties - g-rx-fifo-size: size of rx fifo size in gadget mode. - g-np-tx-fifo-size: size of non-periodic tx fifo size in gadget mode. - g-tx-fifo-size: size of periodic tx fifo per endpoint (except ep0) in gadget mode. +- snps,reset-phy-on-wake: If present indicates that we need to reset the PHY when + we detect a wakeup. This is due to a hardware errata. Deprecated properties: - g-use-dma: gadget DMA mode is automatically detected From patchwork Tue Apr 16 21:53:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10904225 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F1A413B5 for ; Tue, 16 Apr 2019 21:54:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D11D28A0F for ; Tue, 16 Apr 2019 21:54:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5890528535; Tue, 16 Apr 2019 21:54:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BBE8728535 for ; Tue, 16 Apr 2019 21:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eRLwcWLFSEDiWCvCFvvGR/uAW3xCpOwKFcRobrUXjLg=; b=odevHOQwS9bgWu LGKuGXBFFzifQT15dV5GtDNIDRbvNa7nw4/+e9MOZhI4fN58YGwCdKm5HYEsESj3PUpti9Kh7JHrL lOVBDpqEP/dLQgRzAoQynYwlI/9OE+6i4ltZScOV8w4AJEZ/9XZr3dy43yvrGs7m6xGjmx8FvNoW/ a9bIg23y5/sdhPc5dohdpEoo4msSeR9zJK7qLOBOAo2F/3M5Nqm2H/qvHKUQ4Vga4jM3YXI0FhV3Z 0ppuNOKxo7jbCeqoCwTtmkkiYO99/oV94JES/BedS/F8OBvVIjmTHyMLg/aUOcxJHz2dF2FVgHf5N 0O8PL7iLB/fm2VUIHLxw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGW28-0008Qj-BI; Tue, 16 Apr 2019 21:54:28 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGW1u-00088s-Ta for linux-rockchip@lists.infradead.org; Tue, 16 Apr 2019 21:54:16 +0000 Received: by mail-pf1-x441.google.com with SMTP id e24so11042124pfi.12 for ; Tue, 16 Apr 2019 14:54:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NhuTBkbvTznNaFrq+/UUrhs6fQWEX2O1Uah2moqJDlM=; b=IjV8HYykawLHC7qSQF8ZCPMx2iXuKBbg6BrwsSdi/sqT47SwXT7yS/1daiZcQbYyEQ KAvZU3uR3Rj9qST+yJTgRatoMZxGub6HGOfObi6/qchoOc/cycdo2i3ljJ0AUIc3N4bk n1XYDraCquh0eaM6EmEVthxg/KhawnI/5vy4E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NhuTBkbvTznNaFrq+/UUrhs6fQWEX2O1Uah2moqJDlM=; b=KFOO1IgSQj6Fe8ZQTPJ+/Xlo6/S27VVwhREgRsyYjiBdzPwU+pr4YvDQx6zrJhQA3Z m5QDHnVJSOuexM9iOoJbIspJFndU5rwtCOBliODmpfX0ucH5Hz9xJH5znzE9oxPtVuF3 9x/JHSTVsDZyg9IATXmNN9bBsQk42FFPDlG/SZRA35CRfFHjv+dVU4qQhipUmUE3Q1ob VwyE+cu8NSJiPg2+WV/DmLDJlbK2B4YhZmoHFWhhTHuL9rzrLDZ/1VjIFqhkLynhSO0R M8fgJ5cr8TgBWQ8ihVZA4YDwXeClXUNhikl9GNd9xc4h3mABeUPbQw2sNra8hOOPcYFK Gcfw== X-Gm-Message-State: APjAAAVKKr4fMkYpJdNKTBSmJ84oaCIsBZjtVYj8z4r7FnDEuFrrLGfK S4HKCjEsg7VnySxZQPJKyfjlBw== X-Google-Smtp-Source: APXvYqwWfoKWZsdXqWpwL1pK8HNiauVy7bRxPDqc5xd2wCgGg0sCdZsMJe7mMKv0YKBeuGVe0i7uyg== X-Received: by 2002:a63:ef0a:: with SMTP id u10mr61563309pgh.199.1555451654170; Tue, 16 Apr 2019 14:54:14 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id b6sm8156770pgt.58.2019.04.16.14.54.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 14:54:13 -0700 (PDT) From: Douglas Anderson To: Rob Herring , Minas Harutyunyan , Heiko Stuebner , Felipe Balbi Subject: [PATCH v2 2/4] usb: dwc2: optionally assert phy reset when waking up Date: Tue, 16 Apr 2019 14:53:49 -0700 Message-Id: <20190416215351.242246-3-dianders@chromium.org> X-Mailer: git-send-email 2.21.0.593.g511ec345e18-goog In-Reply-To: <20190416215351.242246-1-dianders@chromium.org> References: <20190416215351.242246-1-dianders@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190416_145414_950407_0E5D7516 X-CRM114-Status: GOOD ( 20.73 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-usb@vger.kernel.org, amstan@chromium.org, Greg Kroah-Hartman , Randy Li , Douglas Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, mka@chromium.org, ryandcase@chromium.org, Yunzhi Li , Elaine Zhang , jwerner@chromium.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On the rk3288 USB host-only port (the one that's not the OTG-enabled port) the PHY can get into a bad state when a wakeup is asserted (not just a wakeup from full system suspend but also a wakeup from autosuspend). We can get the PHY out of its bad state by asserting its "port reset", but unfortunately that seems to assert a reset onto the USB bus so it could confuse things if we don't actually deenumerate / reenumerate the device. We can also get the PHY out of its bad state by fully resetting it using the reset from the CRU (clock reset unit), which does a more full reset. The CRU-based reset appears to actually cause devices on the bus to be removed and reinserted, which fixes the problem (albeit in a hacky way). It's unfortunate that we need to do a full re-enumeration of devices at wakeup time, but this is better than alternative of letting the bus get wedged. Signed-off-by: Douglas Anderson Signed-off-by: Yunzhi Li --- Changes in v2: - Cancel the work when dwc2 is freed (Matthias). drivers/usb/dwc2/core.h | 5 +++++ drivers/usb/dwc2/core_intr.c | 12 ++++++++++++ drivers/usb/dwc2/hcd.c | 18 +++++++++++++++--- drivers/usb/dwc2/platform.c | 9 +++++++++ 4 files changed, 41 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h index 30bab8463c96..f30748f4fe7e 100644 --- a/drivers/usb/dwc2/core.h +++ b/drivers/usb/dwc2/core.h @@ -859,6 +859,8 @@ struct dwc2_hregs_backup { * @gadget_enabled: Peripheral mode sub-driver initialization indicator. * @ll_hw_enabled: Status of low-level hardware resources. * @hibernated: True if core is hibernated + * @reset_phy_on_wake: Quirk saying that we should assert PHY reset on a + * remote wakeup. * @frame_number: Frame number read from the core. For both device * and host modes. The value ranges are from 0 * to HFNUM_MAX_FRNUM. @@ -972,6 +974,7 @@ struct dwc2_hregs_backup { * @status_buf_dma: DMA address for status_buf * @start_work: Delayed work for handling host A-cable connection * @reset_work: Delayed work for handling a port reset + * @phy_reset_work: Work structure for doing a PHY reset * @otg_port: OTG port number * @frame_list: Frame list * @frame_list_dma: Frame list DMA address @@ -1045,6 +1048,7 @@ struct dwc2_hsotg { unsigned int gadget_enabled:1; unsigned int ll_hw_enabled:1; unsigned int hibernated:1; + unsigned int reset_phy_on_wake:1; u16 frame_number; struct phy *phy; @@ -1147,6 +1151,7 @@ struct dwc2_hsotg { struct delayed_work start_work; struct delayed_work reset_work; + struct work_struct phy_reset_work; u8 otg_port; u32 *frame_list; dma_addr_t frame_list_dma; diff --git a/drivers/usb/dwc2/core_intr.c b/drivers/usb/dwc2/core_intr.c index 19ae2595f1c3..16ff33574116 100644 --- a/drivers/usb/dwc2/core_intr.c +++ b/drivers/usb/dwc2/core_intr.c @@ -435,6 +435,18 @@ static void dwc2_handle_wakeup_detected_intr(struct dwc2_hsotg *hsotg) /* Restart the Phy Clock */ pcgcctl &= ~PCGCTL_STOPPCLK; dwc2_writel(hsotg, pcgcctl, PCGCTL); + + /* + * If we've got this quirk then the PHY is stuck upon + * wakeup. Assert reset. This will propagate out and + * eventually we'll re-enumerate the device. Not great + * but the best we can do. We can't call phy_reset() + * at interrupt time but there's no hurry, so we'll + * schedule it for later. + */ + if (hsotg->reset_phy_on_wake) + schedule_work(&hsotg->phy_reset_work); + mod_timer(&hsotg->wkp_timer, jiffies + msecs_to_jiffies(71)); } else { diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 3f087962f498..e272d020012e 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -4376,6 +4376,17 @@ static void dwc2_hcd_reset_func(struct work_struct *work) spin_unlock_irqrestore(&hsotg->lock, flags); } +static void dwc2_hcd_phy_reset_func(struct work_struct *work) +{ + struct dwc2_hsotg *hsotg = container_of(work, struct dwc2_hsotg, + phy_reset_work); + int ret; + + ret = phy_reset(hsotg->phy); + if (ret) + dev_warn(hsotg->dev, "PHY reset failed\n"); +} + /* * ========================================================================= * Linux HC Driver Functions @@ -5130,6 +5141,8 @@ static void dwc2_hcd_free(struct dwc2_hsotg *hsotg) destroy_workqueue(hsotg->wq_otg); } + cancel_work_sync(&hsotg->phy_reset_work); + del_timer(&hsotg->wkp_timer); } @@ -5271,11 +5284,10 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg) hsotg->hc_ptr_array[i] = channel; } - /* Initialize hsotg start work */ + /* Initialize work */ INIT_DELAYED_WORK(&hsotg->start_work, dwc2_hcd_start_func); - - /* Initialize port reset work */ INIT_DELAYED_WORK(&hsotg->reset_work, dwc2_hcd_reset_func); + INIT_WORK(&hsotg->phy_reset_work, dwc2_hcd_phy_reset_func); /* * Allocate space for storing data on status transactions. Normally no diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c index c0b64d483552..9b65b766e0b9 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c @@ -481,6 +481,15 @@ static int dwc2_driver_probe(struct platform_device *dev) hsotg->gadget_enabled = 1; } + hsotg->reset_phy_on_wake = + of_property_read_bool(dev->dev.of_node, + "snps,reset-phy-on-wake"); + if (hsotg->reset_phy_on_wake && !hsotg->phy) { + dev_warn(hsotg->dev, + "Quirk reset-phy-on-wake only supports generic PHYs\n"); + hsotg->reset_phy_on_wake = false; + } + if (hsotg->dr_mode != USB_DR_MODE_PERIPHERAL) { retval = dwc2_hcd_init(hsotg); if (retval) { From patchwork Tue Apr 16 21:53:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10904235 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F1E2513B5 for ; Tue, 16 Apr 2019 21:54:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6766271FD for ; Tue, 16 Apr 2019 21:54:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA107288CE; Tue, 16 Apr 2019 21:54:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 304A0271FD for ; Tue, 16 Apr 2019 21:54:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DvVIydjQ3so99CsOVtAtMm8FIcWav08J9bER67fzjFI=; b=fL+91dUY2BTNjq dBKJQ0z8N/00VzVr+v2dwxJlpLpHvGuU9TDcioGtMWOpEef8XCsTFY9pNEd+Lj8tOaW+265wFbv31 Tv6uCw7SnqpB8kg9bSpfGHsaJkJQ9K6IPhpHvXyZPwaZcVYfFaHYPuIwfjWezKPhcpQeKhxyfcnUy HF4r35ljg1vzDjS+cTuON6YQ2q3BOIAAC9LwdAOuloL1HNlb0Cvrgvy+WVClUtre+YbURbHavv8d6 uoLzcc4Z1WnnVJr7f5CsgjfJe2VjAhg5R9l6kmHmxRjT5MTYUxuAdMrHo/4f1RGuIZeWhvZXVB2WN iQZZicVNEka8L6RIKSHQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGW2O-0000Ih-TM; Tue, 16 Apr 2019 21:54:44 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGW1w-00089D-6J for linux-rockchip@lists.infradead.org; Tue, 16 Apr 2019 21:54:18 +0000 Received: by mail-pl1-x643.google.com with SMTP id w23so10994011ply.4 for ; Tue, 16 Apr 2019 14:54:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JQcpLLY5KK4GVOCCGHD2Lb4pmJlBo3NKSgPvy82sxxs=; b=jet7qqlVkuzSyJBHgzdOZoBdkDRzb97FPPvS6OsfblhPaOgPly4QVhABda+QsNoBQK jSX0iOEXcTriDz+NlJkB35upNjg0ZfCLEuDRTmv+qErSFyncQ4yXwxyteneTHds73VxI +R8BqVW1892eo6PNlyEr32+pD7W05ojOAxm8w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JQcpLLY5KK4GVOCCGHD2Lb4pmJlBo3NKSgPvy82sxxs=; b=MKT0ZCzMZd8d58gKAMa1eB6MK+tt7ar8GEmbUSE+Hv65iV0CC4HKwxPAZmtyCH21GR toohnVk6y9btfr4l3gO1t28orRAz+9DQJtVNc7kG9fCJJM59L8iYD2WKs7ZGEMw5jT6L U9Jn6N0xjBfaPIQ/Ki3rlJZyfEpe0HRjh+Qo/J66MT3u3ZlA05+9y1A0EcrI88jGhdKU BKlvOi+/JKxayS4T1nHvssdfoKTAv3pN4qp6941II494jluYtkQuu6FCWw9AO1E4Bahm fuNnaUeIm2hUJKiyBi4D/cU2HXaibW9n/2qiF40Vt47wib3Lxww4Mwtv6DSNDt1KyPFR Owig== X-Gm-Message-State: APjAAAU9Nv5dBo7wvwbzq4SLN2NrPpiu4Z24B5ciR7VgswIc5sgityMB knYXng8O3NpyEJgNrGoI0+p8wg== X-Google-Smtp-Source: APXvYqwe5Q3sUUtcLGPdwFIhZi1gZhbtsybtUcA04et5Y4lRysaMcw+0xjOT5eMBQpQRdD8EFX89zg== X-Received: by 2002:a17:902:e302:: with SMTP id cg2mr81457671plb.285.1555451655465; Tue, 16 Apr 2019 14:54:15 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id b6sm8156770pgt.58.2019.04.16.14.54.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 14:54:14 -0700 (PDT) From: Douglas Anderson To: Rob Herring , Minas Harutyunyan , Heiko Stuebner , Felipe Balbi Subject: [PATCH v2 3/4] ARM: dts: rockchip: Hook resets up to USB PHYs on rk3288. Date: Tue, 16 Apr 2019 14:53:50 -0700 Message-Id: <20190416215351.242246-4-dianders@chromium.org> X-Mailer: git-send-email 2.21.0.593.g511ec345e18-goog In-Reply-To: <20190416215351.242246-1-dianders@chromium.org> References: <20190416215351.242246-1-dianders@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190416_145416_394788_E2DFEA4F X-CRM114-Status: GOOD ( 11.01 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, linux-usb@vger.kernel.org, amstan@chromium.org, Randy Li , Douglas Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, mka@chromium.org, ryandcase@chromium.org, Elaine Zhang , jwerner@chromium.org, linux-arm-kernel@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Let's hook up the resets to the three USB PHYs on rk3288 as per the bindings. This is in preparation for a future patch that will set the "snps,reset-phy-on-wake" on the host port. Signed-off-by: Douglas Anderson --- Changes in v2: None arch/arm/boot/dts/rk3288.dtsi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi index 74c9517c4f92..7e70ecf2b95a 100644 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -909,6 +909,8 @@ clocks = <&cru SCLK_OTGPHY0>; clock-names = "phyclk"; #clock-cells = <0>; + resets = <&cru SRST_USBOTG_PHY>; + reset-names = "phy-reset"; }; usbphy1: usb-phy@334 { @@ -917,6 +919,8 @@ clocks = <&cru SCLK_OTGPHY1>; clock-names = "phyclk"; #clock-cells = <0>; + resets = <&cru SRST_USBHOST0_PHY>; + reset-names = "phy-reset"; }; usbphy2: usb-phy@348 { @@ -925,6 +929,8 @@ clocks = <&cru SCLK_OTGPHY2>; clock-names = "phyclk"; #clock-cells = <0>; + resets = <&cru SRST_USBHOST1_PHY>; + reset-names = "phy-reset"; }; }; }; From patchwork Tue Apr 16 21:53:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10904237 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 97CA813B5 for ; Tue, 16 Apr 2019 21:54:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7BFAD271FD for ; Tue, 16 Apr 2019 21:54:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6CFD6288CE; Tue, 16 Apr 2019 21:54:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A1DC6271FD for ; Tue, 16 Apr 2019 21:54:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=l9+r6dN5KPlDuycC9Yx3b0cupM8+94pq8csxePyA/kc=; b=NqwW8OIjQxW1GF xt/O0MB01aiXn7v+l0UISAHzNRvGvL9QWDD16V4Tr+po7g0qBhgjJKA66VC9OByW200D/G4tD+njH PGmfhDjUqLKK6PSeRl8Gxq8y0+1L+ZKGu5W2gievvVBnegcqXIg6E5WPCkVwUfscwQu9M7lVFDxwg XYZceZNIMg+b/TlHW3FEoCunlKF8C8ACRhpKJVefFVJAkEk/9kGmWatcWGjxTOTNiLanJUGevNjN+ B5mLI/y/61wOF8ENILsKW1vf2313YXmQY0ZOU4QjQfBPN6vrxrxM1naoJvM2lANFSqv4o0K7tlfJd JCmPj0hKZHbLf6+KdDHQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGW2Q-0000KZ-Mr; Tue, 16 Apr 2019 21:54:46 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGW1x-0008Aw-K6 for linux-rockchip@lists.infradead.org; Tue, 16 Apr 2019 21:54:21 +0000 Received: by mail-pg1-x543.google.com with SMTP id p6so10970637pgh.9 for ; Tue, 16 Apr 2019 14:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cWXcwUO99R4dLB/IuZUC9gJlZE5FQWRDL44srQDPsqk=; b=ejBtaPnR9q05b/fAPX24cAvnXMkUKl8dv74zXRQ/flOfxwW2g+52dgsY64NuNdME22 uPRaVNQIDZwDLbenk3fXkr5sCpbUoQQx3iz6VI/N4wTVQq5I+lf9isXR5BnHdcl04m0i qMRY/ItYRRoO2Pj+l2mtAwkwcK8tNs2AKNPyA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cWXcwUO99R4dLB/IuZUC9gJlZE5FQWRDL44srQDPsqk=; b=K281kiA1gEeeScJTd8xuaYI4bTmlbqgvTJR/hjy1m3hzk6NqS7A1SLo4FJSlmvey3m joKVh0LoaQ2ZN054uTp+wu6K1e9jaMnf0MM65Op2BL2Evxk7rYCyaJn734jKoyMwM23T F2gtMjcbfVxz4FK7q0sckulr4WMNe5g2hm0K1giL4aHdXIbCfnaFudJpACviGwjtCoGU 7fQX11I7JpIJScdckBjdYv65gYTp8RWvJNTWHLmG+yihi5opMUfclsD9JBFRX12fDLh8 p1+iG7V47EXeRZXcBivUHmyYas8UO5qpR0IzdiLgSPjlkNCODOeRl5/RSiJVuHL/pCTH 371Q== X-Gm-Message-State: APjAAAUXS5XshYVZQ3FVcu2GycsBVYrFaikS04bIIeFEORd9tQiUy3GQ W4QTHfUL8JXj9QFDqA4LRt6dZg== X-Google-Smtp-Source: APXvYqxxdYR0fLJUpsHaTgteMM1jkatPh1TgL1h1tZn2iyQSTF5t4CnY+DzCpefDu9PaKb6nKGydpA== X-Received: by 2002:a63:af0a:: with SMTP id w10mr54056203pge.67.1555451656875; Tue, 16 Apr 2019 14:54:16 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id b6sm8156770pgt.58.2019.04.16.14.54.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 14:54:16 -0700 (PDT) From: Douglas Anderson To: Rob Herring , Minas Harutyunyan , Heiko Stuebner , Felipe Balbi Subject: [PATCH v2 4/4] ARM: dts: rockchip: Add quirk for resetting rk3288's dwc2 host on wakeup Date: Tue, 16 Apr 2019 14:53:51 -0700 Message-Id: <20190416215351.242246-5-dianders@chromium.org> X-Mailer: git-send-email 2.21.0.593.g511ec345e18-goog In-Reply-To: <20190416215351.242246-1-dianders@chromium.org> References: <20190416215351.242246-1-dianders@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190416_145417_882078_D4263E84 X-CRM114-Status: GOOD ( 10.86 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, linux-usb@vger.kernel.org, amstan@chromium.org, Randy Li , Douglas Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, mka@chromium.org, ryandcase@chromium.org, Elaine Zhang , jwerner@chromium.org, linux-arm-kernel@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The "host" USB port on rk3288 has a hardware errata where we've got to assert a PHY reset whenever we see a remote wakeup. Add that quirk property to the device tree. Signed-off-by: Douglas Anderson Reviewed-by: Matthias Kaehlcke --- Changes in v2: None arch/arm/boot/dts/rk3288.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi index 7e70ecf2b95a..aa017abf4f42 100644 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -621,6 +621,7 @@ dr_mode = "host"; phys = <&usbphy2>; phy-names = "usb2-phy"; + snps,reset-phy-on-wake; status = "disabled"; };