From patchwork Fri Apr 12 22:41:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10899173 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 1366A186E for ; Fri, 12 Apr 2019 22:42:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E199D28F1E for ; Fri, 12 Apr 2019 22:42:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D562728F20; Fri, 12 Apr 2019 22:42:29 +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 866F828748 for ; Fri, 12 Apr 2019 22:42:29 +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=KvnN6u/e/hQnbpMD19kIB/s/8KX2usYEV/a9qaD+xI8=; b=jeTv+cOYjh5R1b y0hpoe23mgEKK4gbhTQQ/ZbzXLlY4EVKgj2456stUHZPq4Nf45U8SzHgldfl5mnvJ6i3F2yfRAtoO zhNUphC9gJG80c4fKDZJBRRjvPezUK9WSEV5giM+Si9Ev5wl6hU63Vah3vXA+yOdxA6I9HWgKkEDZ rbai6ZfWojK4h3zbUoiu68bvUr8F01DzY8ONtRbTOGirjXblOsIA2KZHhoHs5s5Ej89R6J27nrFnd pRx0/ECeGeeM0zseofBl4EXQF2fUQjxnGpiBFMUAK4DT2RCui7Wi6n8L0ck5P+wZZwTuDABdNaqTM uxY1iOcxrpF6iqSK6ICg==; 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 1hF4sM-0002c8-Fv; Fri, 12 Apr 2019 22:42:26 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hF4sC-0002Qr-U8 for linux-rockchip@lists.infradead.org; Fri, 12 Apr 2019 22:42:18 +0000 Received: by mail-pl1-x641.google.com with SMTP id w23so5790470ply.4 for ; Fri, 12 Apr 2019 15:42:16 -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=kWLUeccQHJNmQbwFQHETrVq/WCQE28hsAbD/ch2jk/0=; b=iNMu0LcBBkEoblkNikvLsoe0iRPOEcYwdGkme5UBFA+0XD/4tIOYO3Vx+bjaKXVji7 M9To4tbMSajbIxOowKsnAp4q+36Y4WzW03NdM1LpN81G934TCBDxl1SozQCahv/f3raJ 4+lFk6UNxhDm3Ecv5oEwAFbQCwkJy4u1t8ZN4= 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=kWLUeccQHJNmQbwFQHETrVq/WCQE28hsAbD/ch2jk/0=; b=EOc/+9wLRgMSJ44bGxTDQ+EiaejO/D2mJcvK1FazuzqdZvkqje5qpGWHK/GGW6UfnL LMR0WP+/c61+/ngagmv1W/vcjTPNDnFIUOpngSGE5vtKyFMmFETlhlPOCBolSouJKtzV pPQShF8lbItj0sSWetIafrjWRdlt7JRri/d0p65W6Ub0MZqr+9l6/sDGljF8EcOIzyJd LV2uyY5XaP120xRT2EwLgSm9iLlF6BaYASWi4vvAhZ3JhVjzSlSP+cdHM1igLHNL7zyh UPQ5OyPNBMmVUracu6MRTv8l2uc3uwlHms7OvLxeXq39V66RhMgRPRWar42ceB8qxL5+ TxJA== X-Gm-Message-State: APjAAAUmZzq0Tz7nQ5d6IsHcJIE0yiNaiHUFSoQYXl5UUzhwWPOnIRMH sCgWBWHWTcX3A0V7JI4Ey1fQnA== X-Google-Smtp-Source: APXvYqxcV0ZgFhV+rNuPFw2kv/DYtmiXsbIMqoDb86eGxEMGMKNVH9kszsGPxxLMa87ZWhMQFr0SUg== X-Received: by 2002:a17:902:e508:: with SMTP id ck8mr58797653plb.96.1555108936236; Fri, 12 Apr 2019 15:42: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 j22sm57170579pfn.129.2019.04.12.15.42.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 15:42:15 -0700 (PDT) From: Douglas Anderson To: Rob Herring , Minas Harutyunyan , Heiko Stuebner , Felipe Balbi Subject: [PATCH 1/4] dt-bindings: usb: dwc2: Document quirk to reset PHY upon wakeup Date: Fri, 12 Apr 2019 15:41:46 -0700 Message-Id: <20190412224149.106971-2-dianders@chromium.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog In-Reply-To: <20190412224149.106971-1-dianders@chromium.org> References: <20190412224149.106971-1-dianders@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190412_154216_966828_B2CB66C9 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, 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 --- 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 Fri Apr 12 22:41:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10899177 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 B1E2D1708 for ; Fri, 12 Apr 2019 22:42:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E93028748 for ; Fri, 12 Apr 2019 22:42:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8277F28F20; Fri, 12 Apr 2019 22:42: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 DD6A328748 for ; Fri, 12 Apr 2019 22:42: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=AhyICSedbFNvaXPbGnFD23V0yiRVqJgW8j5nkx1m5CM=; b=FmIpnkbEvCATAB 1dPgyK4+fX6pPczYyX/aMHj+rf6+/QPdfGbBR6wfoEwQGYofoy8tOLOprM9bUMI3PTXoI6cYz2LMY Eyu769adAoDs+SQAuBRT0QNl5+oCpAfQYfvyeOCKZKFXzoh+ofTAuTdT6lzxE8U1kMcRirWIPanJH +zccKt8KZLGTWgeVtIN2FkhRyHiPMRCFb2QuWevCHq3OjW+M/EjVGu8iy0fYrgvNFEL/IlWUGIqTK BJsMzr30cRNPTvJoON4P0/LHdFs5hZGpm6P4/fGoG9ufGS2R7SvKSatWNzSWmqHOKB112sj/LBHTF K2t6ZEg6RPtgOA7FT/SA==; 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 1hF4sO-0002fM-6J; Fri, 12 Apr 2019 22:42:28 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hF4sE-0002RI-4f for linux-rockchip@lists.infradead.org; Fri, 12 Apr 2019 22:42:20 +0000 Received: by mail-pf1-x442.google.com with SMTP id z5so5805045pfn.3 for ; Fri, 12 Apr 2019 15:42: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=m7bMG3CshorQmg1lKkeTmGf1nYdxxwbwlljLNgyUqRE=; b=fbSrJK0g0fV9BeN6bDPthd9lwEe9RLJC+eoaMbx0RbbjJBVQAYnXPHCBoED/Iwmtoy 43NBpBf2SWtGJXyPHTMBb6VifLYayinWnZmQZQc/fNKtRQB8E+htKim93DGLixzSaRGI 9XLSySNPGmeKLiswXK6NlSTK6HU0CXSn6zWis= 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=m7bMG3CshorQmg1lKkeTmGf1nYdxxwbwlljLNgyUqRE=; b=txjyy9A6LdnDYA7AtywKThEa92qzEQYECOqaDwlHdNNpApoURIvfMrOm5QcIwtRGKy Qwn183ZEA286CzuyIiHusNpRE+ZxzcMfxhYgnOBSEE+otsLd0Yze0DjkR2hdl7Wpx1b/ OTAuWXAdxehquAe0A3x8N8zNPAjdYB+PoYiqhjhlDJCYZcc/YYWEqftJRjKbXynvwvXX k378stmS1K5mK+MhWwdOhkupvFIt7Itb3qjFT5AnkOMxCk7ztYlpKq0u59C7l5DuoGpT uhFwx/WS7TbF212po6/NYCH3EjL5bLkaaDf0LbGsTcdU+dggg0wydTc2dsAxjYZefawH uhEw== X-Gm-Message-State: APjAAAUXxZSaaBOFbclOEwnB6a92UfuRKOepIVXEdOKnaalrD685uMfE GZ2XsjIESZXCr7F8enUY+k4SXw== X-Google-Smtp-Source: APXvYqweeBTDzcVs0mDhVE440cgj90OdEU1JkqINcR2OMkCnTKxWPM/VbLWGNBobMDyb4Goe8LhlsA== X-Received: by 2002:a63:6193:: with SMTP id v141mr56642537pgb.392.1555108937371; Fri, 12 Apr 2019 15:42:17 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id j22sm57170579pfn.129.2019.04.12.15.42.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 15:42:16 -0700 (PDT) From: Douglas Anderson To: Rob Herring , Minas Harutyunyan , Heiko Stuebner , Felipe Balbi Subject: [PATCH 2/4] usb: dwc2: optionally assert phy reset when waking up Date: Fri, 12 Apr 2019 15:41:47 -0700 Message-Id: <20190412224149.106971-3-dianders@chromium.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog In-Reply-To: <20190412224149.106971-1-dianders@chromium.org> References: <20190412224149.106971-1-dianders@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190412_154218_178535_D63BC6A9 X-CRM114-Status: GOOD ( 20.47 ) 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 --- drivers/usb/dwc2/core.h | 5 +++++ drivers/usb/dwc2/core_intr.c | 12 ++++++++++++ drivers/usb/dwc2/hcd.c | 16 +++++++++++++--- drivers/usb/dwc2/platform.c | 9 +++++++++ 4 files changed, 39 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..332349148d3f 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 @@ -5271,11 +5282,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 Fri Apr 12 22:41: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: 10899189 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 A220F1708 for ; Fri, 12 Apr 2019 22:42:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82CBE28748 for ; Fri, 12 Apr 2019 22:42:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7684428F20; Fri, 12 Apr 2019 22:42:48 +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 2AC0C28748 for ; Fri, 12 Apr 2019 22:42:48 +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=aX8IpyT2kCgGy9PRvHGpdEB6mvIO80HriVQUFtfv/7g=; b=UbhOKjr0ikAVaG POZJ1uqY8KHD6RdGsFsld70QEUBxs8ru+6Kxh0LsA6GDGf2EM5hlNV4woRWpataBZyXUl0er1qbUp sW0CPQ5Sc/jyjx+csF+s8pepilX13HfkBhCm1ejk+FCs7SNPFrDNfsJta085Z4j8/YQcE50Bf/q/z l4xsgdCrZ6oanqjqyn/XYDmQL3o14pSFrMjFo01Cscwac5mJ2wwSjn6wO7woeVMYhO1u1rQrk/y2L VStxalmxJLrXiOpd7/kojN5pkZ1iOh4BR+snksu2dVwYtlzbmxm3rEtMLqVLBsgCKaBJIGjJ2R1xK ay2JM2Ds/JrUHv7Hdhsw==; 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 1hF4se-0002zM-Fw; Fri, 12 Apr 2019 22:42:44 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hF4sF-0002Rr-7t for linux-rockchip@lists.infradead.org; Fri, 12 Apr 2019 22:42:22 +0000 Received: by mail-pf1-x443.google.com with SMTP id e24so5780784pfi.12 for ; Fri, 12 Apr 2019 15:42:18 -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=QzD3qq/PMUVMpjWUpPygcIhbopx0mZxT37qNcK5sZeg=; b=I51Nr8NvO7I03CvvyUyTROENQTyD5o14qi2nx7dIdi+6gWVZccni3+8Y7liLPOoM6S y9AG/P3jxdIb+NZo10L2IGrB8/rc53LHv3xCCHWPWM+fMXpDiqO5LcdzLIgZz+NkIkQb YE2yvYHVcGNlyAKI03VIkTIuDLRqZg1dLbm2k= 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=QzD3qq/PMUVMpjWUpPygcIhbopx0mZxT37qNcK5sZeg=; b=fzge8hbjuysRwDtK6OeasOJAxriuFZ+vc0MnRhj7NFBYkIX4stCZOiUXwngr5Gja98 lFLVyBCO7iE9HXNQslRKcgNz+T6DhywzFOTJ4UOMXfdqsV6b/w8coDmc953ItWi6VpIk 5+qo932dpk0FuZgNU4dA86RyG6sAX/3uyDctWMr5hU7SIzorhYKShD+v4bPXqvW1nN68 i+Y23FcTIl+op7npJgc9vQRdl2oZWSreUYtm2kPdP8I0d7vbXA9zIiPPG8abPxEB7Hqr G/sWp8IZG/FJjPEAixEa8Wl60qsVgTcLCTBUKbm356umKEnP3eHKIrKJVipyH9pRMiUS Dbuw== X-Gm-Message-State: APjAAAXJEqMELEwqezvbLJFk/GcIwUKyuR03UXgcWMeNR3qbXLV9zrib kVksQKxczQT0kccn+Lc0dPKUMQ== X-Google-Smtp-Source: APXvYqwsHgmjXC6uKa5IaBxOFT2e9eBfb4WK9JupK/WhHmuI1mKfXXGN9jIgHYYXdygBtHRX1fxrvA== X-Received: by 2002:aa7:8384:: with SMTP id u4mr59216540pfm.214.1555108938477; Fri, 12 Apr 2019 15:42:18 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id j22sm57170579pfn.129.2019.04.12.15.42.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 15:42:17 -0700 (PDT) From: Douglas Anderson To: Rob Herring , Minas Harutyunyan , Heiko Stuebner , Felipe Balbi Subject: [PATCH 3/4] ARM: dts: rockchip: Hook resets up to USB PHYs on rk3288. Date: Fri, 12 Apr 2019 15:41:48 -0700 Message-Id: <20190412224149.106971-4-dianders@chromium.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog In-Reply-To: <20190412224149.106971-1-dianders@chromium.org> References: <20190412224149.106971-1-dianders@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190412_154219_498180_64501FF3 X-CRM114-Status: GOOD ( 11.11 ) 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 Reviewed-by: Matthias Kaehlcke --- 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 2e604f0afa98..92e0600595f8 100644 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -905,6 +905,8 @@ clocks = <&cru SCLK_OTGPHY0>; clock-names = "phyclk"; #clock-cells = <0>; + resets = <&cru SRST_USBOTG_PHY>; + reset-names = "phy-reset"; }; usbphy1: usb-phy@334 { @@ -913,6 +915,8 @@ clocks = <&cru SCLK_OTGPHY1>; clock-names = "phyclk"; #clock-cells = <0>; + resets = <&cru SRST_USBHOST0_PHY>; + reset-names = "phy-reset"; }; usbphy2: usb-phy@348 { @@ -921,6 +925,8 @@ clocks = <&cru SCLK_OTGPHY2>; clock-names = "phyclk"; #clock-cells = <0>; + resets = <&cru SRST_USBHOST1_PHY>; + reset-names = "phy-reset"; }; }; }; From patchwork Fri Apr 12 22:41: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: 10899187 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 8671F13B5 for ; Fri, 12 Apr 2019 22:42:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6506128748 for ; Fri, 12 Apr 2019 22:42:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 58C3928F20; Fri, 12 Apr 2019 22:42:47 +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 1554F28748 for ; Fri, 12 Apr 2019 22:42:47 +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=/HRzbCQQ5h4wgEMfWtDV8YVybjttyGlx1GuqPJC4lP4=; b=isJZqXYWdeGAM6 QjhdhpBsddC5QICBkNbKj/M5twfI+A4iHyAkk4j/xsACfH6pPJwUOjt19Ybb6/J2ZLQ5sD8yhX0J/ wKj1sFzz665BNouNl9viGj9VRNemuYOPRsiOLJEmKmLFgOkl94cuk52gFnf3AUapaiF84lXxGTJTD JikvAJZLPRLp29yWRJsYX0DNBwH/uWpy5s2KcCBVANf+0XO9Q8Wyg1raRPHwGxIwQXzhkvG4qE52B UWkjQ6sTnxOVdiypZf9+xfLYMTXXDT5EZ/m86TfFgMNDSZtR3eG/BNiRFH08xrFfY0tgD5OAtwcZ1 HnAUMUP5K/Hcx61GTXaA==; 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 1hF4sd-0002xQ-5B; Fri, 12 Apr 2019 22:42:43 +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 1hF4sG-0002UI-JS for linux-rockchip@lists.infradead.org; Fri, 12 Apr 2019 22:42:22 +0000 Received: by mail-pf1-x444.google.com with SMTP id h5so5816461pfo.0 for ; Fri, 12 Apr 2019 15:42:20 -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=/YuEmfQg8iFJSPB8k83tnNDUSXUSqQSeLxTTSLbTTIw=; b=P5nTYPh6nN+ghxubaHuPvzgMsTS6c1Xt/Xvkr9w2rsv7ycd0UBEp43vGHPMABrMA44 8M1S92pVD/nXq/g4qcsJrJE3pQ5hdDPeaPGzBY08joVJz2pRCq+R/45s9T/NDQcNvwmK 0SeL6Og/rn6RzOK+wrkEtwZYp1WhY7HOYCVIs= 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=/YuEmfQg8iFJSPB8k83tnNDUSXUSqQSeLxTTSLbTTIw=; b=DGuZct/pVBtzFN7L858FTOqgkp/t6qlvQUpF+t0xaKtwMmqGVhFG2NqQ0GGj2sOUC+ MYAbjwsRt8jcqAouCkCr1ROi25Dlg0BgDzbCK8r5p9ZfmKzRA1LvauaGOQHTt+M0T8P5 dZVkPzwulNj7ut73y3JgsLiR3fT/CIFZQmI09qL9qj1gTexZJuHJ/EvQGM983Bxr0ENK TrJad1IJkkRag/XVCyVv+8mdzWmeZDYhgjw7R783ejsfyScugpIKDkPE+ViPCl+2ZjCV A/O1+IHfp/YfGS2SEMW/Z7E3Qqiwap1JrQCMe+v8uHuGmLr+Chjws9mBaB1wVWy6NSSa 75yQ== X-Gm-Message-State: APjAAAWlRtg2wPTYL26PYeYuRFW6SHlOVQ2VLsJG4Z+IDHIG4hxiAxBq zEuMctIrZeno8xhNUfeLNmcXeQ== X-Google-Smtp-Source: APXvYqz6+8oEj+Agjb0SozX8O6BNiaCaZRMvO2ErsDU5sbBvwehG9ytDclHC9I/t9H4hjjFzy2iowQ== X-Received: by 2002:a63:25c4:: with SMTP id l187mr57149864pgl.202.1555108940140; Fri, 12 Apr 2019 15:42:20 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id j22sm57170579pfn.129.2019.04.12.15.42.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 15:42:19 -0700 (PDT) From: Douglas Anderson To: Rob Herring , Minas Harutyunyan , Heiko Stuebner , Felipe Balbi Subject: [PATCH 4/4] ARM: dts: rockchip: Add quirk for resetting rk3288's dwc2 host on wakeup Date: Fri, 12 Apr 2019 15:41:49 -0700 Message-Id: <20190412224149.106971-5-dianders@chromium.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog In-Reply-To: <20190412224149.106971-1-dianders@chromium.org> References: <20190412224149.106971-1-dianders@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190412_154221_033378_C6EF40BD X-CRM114-Status: GOOD ( 11.07 ) 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 --- 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 92e0600595f8..6367c1b50fd7 100644 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -617,6 +617,7 @@ dr_mode = "host"; phys = <&usbphy2>; phy-names = "usb2-phy"; + snps,reset-phy-on-wake; status = "disabled"; };