From patchwork Wed Sep 25 23:42:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 11161725 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F1111912 for ; Wed, 25 Sep 2019 23:42:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CE06521D7F for ; Wed, 25 Sep 2019 23:42:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="l2vPkiRm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732306AbfIYXmd (ORCPT ); Wed, 25 Sep 2019 19:42:33 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:44904 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732271AbfIYXmc (ORCPT ); Wed, 25 Sep 2019 19:42:32 -0400 Received: by mail-pl1-f193.google.com with SMTP id q15so131928pll.11 for ; Wed, 25 Sep 2019 16:42:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BqAPbs/wZUWEhGivyo3NLB3Z3ocJiJHq8gLjsQrSOVI=; b=l2vPkiRmlXdJHN6GeFN8Z8GiZhmhg12dGgNyE97gFX1t7ha+98miz02tsg7Iek0dCg YoIg336NYQakybahq3pjXQV13OnYmh9bWgL1jRY5E9CDaycXkOrtT5JroxmvjkHypxwI gnxiap1CkAzXLcRY+iCMlLe9fxDBjp8FCX88MgFfNwx8Vr2u+lX9qbsEuSBaq2xUjRcm znMZhxhAgK1OX2g9PYKludIijQYdXzfey0dI+iQlBB6LHM21pWsoyNUlz7DGJE/4PwO3 E1Bc5MEG371EEWMJNAGOFduBccgOxXKkgNPh/klrf+8pgvOIaRzM2e43J2lr/WYyce8k JjZQ== 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; bh=BqAPbs/wZUWEhGivyo3NLB3Z3ocJiJHq8gLjsQrSOVI=; b=N2M0QZYTJI1pJyWrDDueNufYvDM7h02F/iE0gbqqkzuFZ+yNZYO69nPfvqxNzLuXEl 7OFVYCucQHJM74PoXLe52pp5YUR5vaW5bpLBCNz6ZxtbOj7goHqWALq4Ri82ui4smDQi 9aAc3FTJgLhX1iUz9s4+aVJD3Q2bykV5tXey/SZoo1SABrzcU1HunVtRhaoMbKqJmPIM AP1D4KIKzp2eyQVJ1mn/LRmC+y8Hi6dOvdnSmDLK3p0Gc11cahcqVBRjOjL5r+oQpCfb nyiv6y9egiZ1hbd/QgJCyTaMygiSnrnqQl+8kyqKrImQboXSt9U5NXEtxOZbfmm+z1ql IasA== X-Gm-Message-State: APjAAAVPBO4O7Wr6/Tp2hfR3epRv8j8aMWyQlVEsfakKEgzs+jEVAx0q jua4jxXDJarmpc3FiXWBx00tfQ== X-Google-Smtp-Source: APXvYqzMUd03gD/db63Y3t5pD+j0LGb6omLi0D1rmvHroR9ZzP4ylqsiPQgYxlYCCvBxuIxa9kobfw== X-Received: by 2002:a17:902:6bc5:: with SMTP id m5mr707175plt.169.1569454951894; Wed, 25 Sep 2019 16:42:31 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id d1sm131127pfc.98.2019.09.25.16.42.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 16:42:31 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Greg Kroah-Hartman , Felipe Balbi , Andy Shevchenko , Rob Herring , Mark Rutland , Yu Chen , Matthias Brugger , Chunfeng Yun , linux-usb@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 1/5] dt-bindings: usb: dwc3: Add a property to do a CGTL soft reset on mode switching Date: Wed, 25 Sep 2019 23:42:20 +0000 Message-Id: <20190925234224.95216-2-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190925234224.95216-1-john.stultz@linaro.org> References: <20190925234224.95216-1-john.stultz@linaro.org> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Provide a dt-binding for quirk needed to do a GCTL soft reset on mode switching Cc: Greg Kroah-Hartman Cc: Felipe Balbi Cc: Andy Shevchenko Cc: Rob Herring Cc: Mark Rutland Cc: Yu Chen Cc: Matthias Brugger Cc: Chunfeng Yun Cc: linux-usb@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: John Stultz --- Documentation/devicetree/bindings/usb/dwc3.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt index 66780a47ad85..cf4ef6c22fb3 100644 --- a/Documentation/devicetree/bindings/usb/dwc3.txt +++ b/Documentation/devicetree/bindings/usb/dwc3.txt @@ -77,6 +77,8 @@ Optional properties: during HS transmit. - snps,dis_metastability_quirk: when set, disable metastability workaround. CAUTION: use only if you are absolutely sure of it. + - snps,gctl-reset-quirk: when set, GCTL soft reset will be executed on mode + switch. - snps,is-utmi-l1-suspend: true when DWC3 asserts output signal utmi_l1_suspend_n, false when asserts utmi_sleep_n - snps,hird-threshold: HIRD threshold From patchwork Wed Sep 25 23:42:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 11161723 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A9678912 for ; Wed, 25 Sep 2019 23:42:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8802821D80 for ; Wed, 25 Sep 2019 23:42:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="l1rHJE7h" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732973AbfIYXmw (ORCPT ); Wed, 25 Sep 2019 19:42:52 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:43409 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732369AbfIYXmg (ORCPT ); Wed, 25 Sep 2019 19:42:36 -0400 Received: by mail-pg1-f195.google.com with SMTP id v27so275650pgk.10 for ; Wed, 25 Sep 2019 16:42:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YKLbWLWjJ/GA5qz2gzrLI3oAv45tZggVEaoyYmAEWtc=; b=l1rHJE7hxxmeTFkh1J9YV8QMV1yV0qFXV/DmDWNsLVb2CYq7qYSUgzimth3Sm/WpfC YWcrIQUFR2O2toA2iR/QzLOROQiwG171rBZSbi0sjNtVqYU9zdends52ay6d2mJkaVFC FtShBLWc9mElkWRSKgv70PgTH40gn+Tc8nJi53MKUQNJZuSmlje0XLRZvVRfk85PwRL0 W3vhi922biTqSjfQTQnZD+R33u6YXHQoFZ8QthoyMdEBFMRdrQrhrzyFhUDHaSDfyRVv EP6IDGGBXKPs00w/3avZo8yti/H9cxL6e/7vcJNssTDqNu5lRTEuw3edBZQUJPxyoXYH XP2Q== 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; bh=YKLbWLWjJ/GA5qz2gzrLI3oAv45tZggVEaoyYmAEWtc=; b=HcQhK8A2LVCECpGyQJuncoQ+iUGqS4sRBrhmGJ7DPZ18lKRyP7OLM4uOSGYKdiGtot DFfafvdv1xTS+/J5w6K/S6bl6BB/0lekWJrtsX+Am68MqkVnQ+3QHEZTEUPTHTZFTco3 9akTwrgmtOLjcPq2Bm68RpSv5VAOaspUcFNqUk+jpfySaNDeRfKLNPHUb9bCgZQtsQM0 h/RGdigqkPVAh4eLalwfNDabnrWgMfrjirdPxlKEfJ4gjuvmAMLKSKn95im/SJkYgxTB Jls7q7r/+Fs6MDcHBIQq4q86qa2PkA3TNNE1Rvj3Ts2+TupKhVgOXHsEPlgZTHqVpidt ny2w== X-Gm-Message-State: APjAAAWeECYh5WLAbmUiMFZ7319smTSmnb9nBX3e4kS/ww9h/32M1IWh P5+Ny9hWG5INmSQWYMFdWMt6TQ== X-Google-Smtp-Source: APXvYqx/aC5q8MMHMmA8YIA0gNGSPcJcNCThJHGYsY3eE0QwFH+ToKX9bx4/+M03ERzZoDMMHZ0kbg== X-Received: by 2002:a63:ff1a:: with SMTP id k26mr471666pgi.154.1569454954359; Wed, 25 Sep 2019 16:42:34 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id d1sm131127pfc.98.2019.09.25.16.42.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 16:42:33 -0700 (PDT) From: John Stultz To: lkml Cc: Yu Chen , Greg Kroah-Hartman , Felipe Balbi , Andy Shevchenko , Rob Herring , Mark Rutland , Matthias Brugger , Chunfeng Yun , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, John Stultz Subject: [PATCH 2/5] usb: dwc3: Execute GCTL Core Soft Reset while switch mode for Hisilicon Kirin Soc Date: Wed, 25 Sep 2019 23:42:21 +0000 Message-Id: <20190925234224.95216-3-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190925234224.95216-1-john.stultz@linaro.org> References: <20190925234224.95216-1-john.stultz@linaro.org> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Yu Chen A GCTL soft reset should be executed when switch mode for dwc3 core of Hisilicon Kirin Soc. Cc: Greg Kroah-Hartman Cc: Felipe Balbi Cc: Andy Shevchenko Cc: Rob Herring Cc: Mark Rutland Cc: Yu Chen Cc: Matthias Brugger Cc: Chunfeng Yun Cc: linux-usb@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: Yu Chen Signed-off-by: John Stultz --- drivers/usb/dwc3/core.c | 20 ++++++++++++++++++++ drivers/usb/dwc3/core.h | 3 +++ 2 files changed, 23 insertions(+) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 999ce5e84d3c..440261432421 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -112,6 +112,19 @@ void dwc3_set_prtcap(struct dwc3 *dwc, u32 mode) dwc->current_dr_role = mode; } +static void dwc3_gctl_core_soft_reset(struct dwc3 *dwc) +{ + u32 reg; + + reg = dwc3_readl(dwc->regs, DWC3_GCTL); + reg |= DWC3_GCTL_CORESOFTRESET; + dwc3_writel(dwc->regs, DWC3_GCTL, reg); + + reg = dwc3_readl(dwc->regs, DWC3_GCTL); + reg &= ~DWC3_GCTL_CORESOFTRESET; + dwc3_writel(dwc->regs, DWC3_GCTL, reg); +} + static void __dwc3_set_mode(struct work_struct *work) { struct dwc3 *dwc = work_to_dwc(work); @@ -156,6 +169,10 @@ static void __dwc3_set_mode(struct work_struct *work) dwc3_set_prtcap(dwc, dwc->desired_dr_role); + /* Execute a GCTL Core Soft Reset when switch mode */ + if (dwc->gctl_reset_quirk) + dwc3_gctl_core_soft_reset(dwc); + spin_unlock_irqrestore(&dwc->lock, flags); switch (dwc->desired_dr_role) { @@ -1316,6 +1333,9 @@ static void dwc3_get_properties(struct dwc3 *dwc) dwc->dis_metastability_quirk = device_property_read_bool(dev, "snps,dis_metastability_quirk"); + dwc->gctl_reset_quirk = device_property_read_bool(dev, + "snps,gctl-reset-quirk"); + dwc->lpm_nyet_threshold = lpm_nyet_threshold; dwc->tx_de_emphasis = tx_de_emphasis; diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 1c8b349379af..b3cb6eec3f8f 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -1029,6 +1029,7 @@ struct dwc3_scratchpad_array { * 2 - No de-emphasis * 3 - Reserved * @dis_metastability_quirk: set to disable metastability quirk. + * @gctl_reset_quirk: set to do a gctl soft-reset while switch operation mode. * @imod_interval: set the interrupt moderation interval in 250ns * increments or 0 to disable. */ @@ -1219,6 +1220,8 @@ struct dwc3 { unsigned dis_metastability_quirk:1; + unsigned gctl_reset_quirk:1; + u16 imod_interval; }; From patchwork Wed Sep 25 23:42:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 11161721 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 49741912 for ; Wed, 25 Sep 2019 23:42:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 27E4D21D7F for ; Wed, 25 Sep 2019 23:42:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="XvDA+NkZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732528AbfIYXmh (ORCPT ); Wed, 25 Sep 2019 19:42:37 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:36804 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732377AbfIYXmg (ORCPT ); Wed, 25 Sep 2019 19:42:36 -0400 Received: by mail-pl1-f196.google.com with SMTP id f19so409198plr.3 for ; Wed, 25 Sep 2019 16:42:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oFS6SaDoQ5fogHAHlhUMYfV/B7rrjNj6XYxhAXSXdHY=; b=XvDA+NkZlQlzPntPpjyLnCwo/WMpiawNV16X6mS3GsH4vcvrLxIwDzxYjPuOD4qfwe bTRHEmnPfk0/rdKZnFAtoCQ/uIhxYV+bdRcwqF4ULyV+nZYiAAeF3Hi+sb9L4Czig47U /yVBx0tgtnVfRk5pxFgslL0VtxWhQD9bw6cQnOCIGsZHsRmU5hkfrqI011qcoF/iRPYA i3HVbdthKqwyEnRg6KjgxzIkY/XUU6CHm6+e6rL7aUTdfykUhIvWnKW4kc9siqTAtV45 O2D9wxGy8ZzlLJort0W50oCWJ+aH9H4HR9Veu43IDm7Sm29yvfGM/qaBLLF3Fzsi11R4 0JtA== 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; bh=oFS6SaDoQ5fogHAHlhUMYfV/B7rrjNj6XYxhAXSXdHY=; b=D+ObvQaIVS5cRA2MidIBRYfRYZWJd+gifEJuPTZyaba50wyFGh6QR+TKsWekelj2v6 UbIXM7JbMgFw8xFj81jmzqLm6TDKyU1g7WVOU+S+p9BpMUv/SLbkrYQ1mu/ij0hUK74f QHtLFxxIMGpZHF15Ycllf0O/TuC6F1k17NCIrY02q22qHH5MjqLJYWqRSwFiw2vU16Mu c1ly/EMgJaEQD05jlAP525zAoarVc8yNIvFA7uxkksTsCp5WJRnnuUCkfPcbyc10N75F v/STqMmSqD04cMp7+YrZxDmP/EehUeq7sYFWBIOp5wIA+gC8xDtpnSUatH97oWRLtp7P /QJQ== X-Gm-Message-State: APjAAAUfj5Em3HQyC2br0uEiS6KK0RvmYoIzQHSuSfCfGTnDt+E+r4/q KmlbYzDuOi9CWIWh3Za27ycVaw== X-Google-Smtp-Source: APXvYqyOtcEZXkAQw/XIO3JzERDkezLxycWYYHw08A6acjxATTtdAu3X9Fx8RAKp+WZv6SnW21J0rw== X-Received: by 2002:a17:902:aa07:: with SMTP id be7mr738556plb.172.1569454956010; Wed, 25 Sep 2019 16:42:36 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id d1sm131127pfc.98.2019.09.25.16.42.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 16:42:35 -0700 (PDT) From: John Stultz To: lkml Cc: Yu Chen , Greg Kroah-Hartman , Felipe Balbi , Andy Shevchenko , Rob Herring , Mark Rutland , Matthias Brugger , Chunfeng Yun , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, John Stultz Subject: [PATCH 3/5] usb: dwc3: Increase timeout for CmdAct cleared by device controller Date: Wed, 25 Sep 2019 23:42:22 +0000 Message-Id: <20190925234224.95216-4-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190925234224.95216-1-john.stultz@linaro.org> References: <20190925234224.95216-1-john.stultz@linaro.org> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Yu Chen It needs more time for the device controller to clear the CmdAct of DEPCMD on Hisilicon Kirin Soc. Cc: Greg Kroah-Hartman Cc: Felipe Balbi Cc: Andy Shevchenko Cc: Rob Herring Cc: Mark Rutland Cc: Yu Chen Cc: Matthias Brugger Cc: Chunfeng Yun Cc: linux-usb@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: Yu Chen Signed-off-by: John Stultz --- drivers/usb/dwc3/gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 8adb59f8e4f1..81907e163252 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -270,7 +270,7 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned cmd, { const struct usb_endpoint_descriptor *desc = dep->endpoint.desc; struct dwc3 *dwc = dep->dwc; - u32 timeout = 1000; + u32 timeout = 5000; u32 saved_config = 0; u32 reg; From patchwork Wed Sep 25 23:42:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 11161719 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8499C13BD for ; Wed, 25 Sep 2019 23:42:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 630C121D80 for ; Wed, 25 Sep 2019 23:42:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="F2fzRlaL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732970AbfIYXmt (ORCPT ); Wed, 25 Sep 2019 19:42:49 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:37417 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732696AbfIYXmi (ORCPT ); Wed, 25 Sep 2019 19:42:38 -0400 Received: by mail-pg1-f195.google.com with SMTP id c17so303591pgg.4 for ; Wed, 25 Sep 2019 16:42:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PmHyEUv1I7IOVWdSAFJf5v6u4/LdnM00Z/zUoJS1vWs=; b=F2fzRlaLxb7Dor1xMHruTiW3m8u0J71MgkiCzmctu3CaYBMx9IqtG0t1zNrX+rO5HU Lmm2w1A7qm0FeajykEQHXtAEU9inq9YurkMfU5LlHwVzUfkQ4cjhLNqDae8zgQnHjmWS XxP4pApy0dbOcpsjTnPOOS9M9aGKKRAtCeONkyUl1+VCst4I217sYUWXL607uYicsNqA 7agGaZFFLEzvqTbsXgYcs1/F3F13cyeI4mwamCJyftXMV7a1gzHmDptgKaP1YnA0m73K nJfO5SbB9E5w4KLCqkKegUw3tjhBE9LwErWfabsl6HStujRiVYKvSZo/DDlEZJ3ljK+H F4pQ== 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; bh=PmHyEUv1I7IOVWdSAFJf5v6u4/LdnM00Z/zUoJS1vWs=; b=TtrfmKTfxo0ptK5yaFp0tWpUcTjG52OwzMPHD+gheprMteddYWHQmD2QYbL0D2xyyS C56qbkYC1rxH2szUtMqB3SJTF9/IIbUPMmm/Uv3MJkVdcNeH7CvE/aUk9CekqeXD/aHg uORzBq4X5LqMpQg1X0+kFgl395gaQ2Gp6eKdHGq3Jhp8YqsJOid5RRbbEJBWhVAaRQbu SKiTjTiQl9rtpFDdaCfXh1gptJXMIwpF2jCQHXsfi0mtd0qFpy0VDEtQbpGeKSk2xNVM aXz9DqUqxY9IjMUxHHHxVai1IQIH3vysorbCmILnxL+IJX8UVzGluL6o1NowU3ts9iEG E3Qw== X-Gm-Message-State: APjAAAVHv1DyHycfW/NXnOPGbZPak4tHUljPDAenYF2cHj3FrM8+4MPY rcQky5id0sqHKP4Uhm3d6xQ6gw== X-Google-Smtp-Source: APXvYqzckYaJvastZyMKVUDhmfHnddTevUdoy7ojBqVA4rHuXKdLY2ZSTQjIvMnlLnPMg3zPgDgdaQ== X-Received: by 2002:a17:90a:ff18:: with SMTP id ce24mr267275pjb.123.1569454957565; Wed, 25 Sep 2019 16:42:37 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id d1sm131127pfc.98.2019.09.25.16.42.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 16:42:36 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Greg Kroah-Hartman , Felipe Balbi , Andy Shevchenko , Rob Herring , Mark Rutland , Yu Chen , Matthias Brugger , Chunfeng Yun , linux-usb@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 4/5] dt-bindings: usb: dwc3: of-simple: add compatible for HiSi Date: Wed, 25 Sep 2019 23:42:23 +0000 Message-Id: <20190925234224.95216-5-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190925234224.95216-1-john.stultz@linaro.org> References: <20190925234224.95216-1-john.stultz@linaro.org> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Add necessary compatible flag for HiSi's DWC3 so dwc3-of-simple will probe. Cc: Greg Kroah-Hartman Cc: Felipe Balbi Cc: Andy Shevchenko Cc: Rob Herring Cc: Mark Rutland Cc: Yu Chen Cc: Matthias Brugger Cc: Chunfeng Yun Cc: linux-usb@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: John Stultz --- .../devicetree/bindings/usb/hisi,dwc3.txt | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/hisi,dwc3.txt diff --git a/Documentation/devicetree/bindings/usb/hisi,dwc3.txt b/Documentation/devicetree/bindings/usb/hisi,dwc3.txt new file mode 100644 index 000000000000..dc31b8a3c006 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/hisi,dwc3.txt @@ -0,0 +1,52 @@ +HiSi SuperSpeed DWC3 USB SoC controller + +Required properties: +- compatible: should contain "hisilicon,hi3660-dwc3" for HiSi SoC +- clocks: A list of phandle + clock-specifier pairs for the + clocks listed in clock-names +- clock-names: Should contain the following: + "clk_usb3phy_ref" Phy reference clk + "aclk_usb3otg" USB3 OTG aclk + +- assigned-clocks: Should be: + HI3660_ACLK_GATE_USB3OTG +- assigned-clock-rates: Should be: + 229Mhz (229000000) for HI3660_ACLK_GATE_USB3OTG + +Optional properties: +- resets: Phandle to reset control that resets core and wrapper. + +Required child node: +A child node must exist to represent the core DWC3 IP block. The name of +the node is not important. The content of the node is defined in dwc3.txt. + +Example device nodes: + + usb3: hisi_dwc3 { + compatible = "hisilicon,hi3660-dwc3"; + #address-cells = <2>; + #size-cells = <2>; + ranges; + + clocks = <&crg_ctrl HI3660_CLK_ABB_USB>, + <&crg_ctrl HI3660_ACLK_GATE_USB3OTG>; + clock-names = "clk_usb3phy_ref", "aclk_usb3otg"; + + assigned-clocks = <&crg_ctrl HI3660_ACLK_GATE_USB3OTG>; + assigned-clock-rates = <229 000 000>; + resets = <&crg_rst 0x90 8>, + <&crg_rst 0x90 7>, + <&crg_rst 0x90 6>, + <&crg_rst 0x90 5>; + + dwc3: dwc3@ff100000 { + compatible = "snps,dwc3"; + reg = <0x0 0xff100000 0x0 0x100000>; + interrupts = <0 159 4>, <0 161 4>; + phys = <&usb_phy>; + phy-names = "usb3-phy"; + dr_mode = "otg"; + + ... + }; + }; From patchwork Wed Sep 25 23:42:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 11161717 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DEEA6912 for ; Wed, 25 Sep 2019 23:42:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BDF0121D7B for ; Wed, 25 Sep 2019 23:42:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SwSWOlZd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732774AbfIYXml (ORCPT ); Wed, 25 Sep 2019 19:42:41 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:40831 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732925AbfIYXmk (ORCPT ); Wed, 25 Sep 2019 19:42:40 -0400 Received: by mail-pg1-f193.google.com with SMTP id w10so290105pgj.7 for ; Wed, 25 Sep 2019 16:42:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1oH7lj03wYz79i/zPzaUWTT6QxHftIiKZMYorEdLMBo=; b=SwSWOlZdAHc54NN1P9/DI2Ev3uZ/2WR8GFuUWdKYhLAOmYqLprdUfFmMCJEqLxlumz 3gOwyocfMNPC5M7hckWXzk3Rb4ZOTIPwsJgqDLfh/tJuTauP3QP7ouMIgG2co4Dxsh2N ONNf//SkblbTzF6TOSU4VjZUHtJE/eqTSl+FUEtAm/JAnmTR7oFsPZnkStJMlK3EmNyU x+D9tbHrBIS6nv+BjgNvZ2Pnzwkar4rUHApgf6W2gTINQOWudc0WUMvfGmCPFC4pDIcP ztFQcEf7Wwl1j8gw1Vtii9E6qVYU6UfUWSHm+di9rXUEWL1caDGAOutBXIaEGkH8m8tx Jstw== 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; bh=1oH7lj03wYz79i/zPzaUWTT6QxHftIiKZMYorEdLMBo=; b=GvTTpPG4ulTQj+PXSulKmLTk6IXW44WMwUyg3S4uFiB4ulEfYya0arkW0H1yWz+7wN FEHS1lNLSB71cyRbXL86r20pbtje8z5+UB+ET558OYx8YLNDMJWS3EJb6N8s43hsiqaK MzCvV9Wf5h7K/d0IrZP/g4nEb2qMt+cGFl4M6H2mYIvKvH6WKxJWiKxs3rLN038HQfC+ Lfd49BxkzOXhRxeb+xe/7U9MQqnRd5QnYUOSNVTJf+5iRzv4/Mp5LBQIfwXMEEjYIlDZ 2p/vdZS2XgrkzYcjjBlzSWjBK4/8FdsrrMCi0Xc5EsAKAjkrPPsVI2/2scbWCWDyEmrw oEuw== X-Gm-Message-State: APjAAAW3/p82m+LAgKqh2i0XsUM9JZwQM3ZENopYlAgLjesyS0j4Bw6V dhHDCdBg/BRsvw5o8eFNffEQpg== X-Google-Smtp-Source: APXvYqxBu00R/fhIXx8pELMq6NqJTAGfty4xq7C26/kBFDvAHrojlE9S5uCP8hyRBRU/G8IJBrwdGw== X-Received: by 2002:a63:221f:: with SMTP id i31mr441694pgi.251.1569454960022; Wed, 25 Sep 2019 16:42:40 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id d1sm131127pfc.98.2019.09.25.16.42.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 16:42:39 -0700 (PDT) From: John Stultz To: lkml Cc: Yu Chen , Greg Kroah-Hartman , Felipe Balbi , Andy Shevchenko , Rob Herring , Mark Rutland , Matthias Brugger , Chunfeng Yun , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, John Stultz Subject: [PATCH 5/5] usb: dwc3: dwc3-of-simple: Add support for dwc3 of Hisilicon Soc Platform Date: Wed, 25 Sep 2019 23:42:24 +0000 Message-Id: <20190925234224.95216-6-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190925234224.95216-1-john.stultz@linaro.org> References: <20190925234224.95216-1-john.stultz@linaro.org> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Yu Chen This patch adds support for the poweron and shutdown of dwc3 core on Hisilicon Soc Platform. Cc: Greg Kroah-Hartman Cc: Felipe Balbi Cc: Andy Shevchenko Cc: Rob Herring Cc: Mark Rutland Cc: Yu Chen Cc: Matthias Brugger Cc: Chunfeng Yun Cc: linux-usb@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: Yu Chen Signed-off-by: John Stultz --- drivers/usb/dwc3/dwc3-of-simple.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c index bdac3e7d7b18..78617500edee 100644 --- a/drivers/usb/dwc3/dwc3-of-simple.c +++ b/drivers/usb/dwc3/dwc3-of-simple.c @@ -51,7 +51,8 @@ static int dwc3_of_simple_probe(struct platform_device *pdev) * Some controllers need to toggle the usb3-otg reset before trying to * initialize the PHY, otherwise the PHY times out. */ - if (of_device_is_compatible(np, "rockchip,rk3399-dwc3")) + if (of_device_is_compatible(np, "rockchip,rk3399-dwc3") || + of_device_is_compatible(np, "hisilicon,hi3660-dwc3")) simple->need_reset = true; if (of_device_is_compatible(np, "amlogic,meson-axg-dwc3") || @@ -183,6 +184,7 @@ static const struct of_device_id of_dwc3_simple_match[] = { { .compatible = "amlogic,meson-axg-dwc3" }, { .compatible = "amlogic,meson-gxl-dwc3" }, { .compatible = "allwinner,sun50i-h6-dwc3" }, + { .compatible = "hisilicon,hi3660-dwc3" }, { /* Sentinel */ } }; MODULE_DEVICE_TABLE(of, of_dwc3_simple_match);