From patchwork Mon Oct 7 17:55:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 11178261 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 2474D15AB for ; Mon, 7 Oct 2019 17:56:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0267120684 for ; Mon, 7 Oct 2019 17:56:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zkLe1lXI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729261AbfJGR4G (ORCPT ); Mon, 7 Oct 2019 13:56:06 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:43763 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728545AbfJGR4D (ORCPT ); Mon, 7 Oct 2019 13:56:03 -0400 Received: by mail-pf1-f195.google.com with SMTP id a2so9112997pfo.10 for ; Mon, 07 Oct 2019 10:56:01 -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=zkLe1lXI/kTfrysTVpJMwuaXco3MElI5JuoKHwGdd9huySPjwcnc3rUpITt2/11Zm5 tiXNO9v9vnVvIIZd94wdw/YiU4qkXUd98CG1rM8X+hL7q76fc91jo2CiIuKtM0jtJ9rL v/kOPD4SUR/VvcEUI+ziPVYPSPfQsN3CGSoWEWAGNtH2cGERQn01eSXsazGSuW5VlQBc XCg5L0bLn/3dNIkIPJ/E/0FVK8XV2n51gVKvv+dTLBeaGJMwc+fIFiXuQ8Yn0/Sq28RE 2z+dVzuJX2OsLboR4aXc7T1Ei8Y1KCFzodNnELOhDZ0euq7lSepkr59SyAKucel2Bn9c bjmw== 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=KY04RIJvGmDoGEzCSu9cmzsOe448bXM5uvaMbf8ha/BdNoee0XmotruzbLdpNPpZQZ j/okFBb6TnxxKki7aQ6mvRhD2WFlroM2K9c/Nbq9GL9EgeEA8QlVrl02iU1/i9lJLOW/ Lk3okyHzXYr/tk6ujXJSQZLgKEx9dQZfYSsmrGiGDa10chXAryY+O/kQrLoR3fazVOd9 d7Opb68x4m3Dq4p4ZSwet/0Zeun3o8TEJnlmqzr9uJnNS1S5wIwAwTehqFELQsXdzy6Z hDcVPjbJJwxUSpfLyJv3zuIg9fTEhiIUUFPmXNuzyT5A8SL5+fmPv6F9OjSFAVRCzqoe JaxQ== X-Gm-Message-State: APjAAAUwFCU9GWsRhQg8rA9+tbhbrcbcRk90ywzy0XnlWNnSKXLW/IPo jx9nruqGklOwEsLgTXnpeeSTrQ== X-Google-Smtp-Source: APXvYqzR09qKYZDkL9zavOHzE5V/dTeZBEetwtzxc9ol5SRT48VvfuWeKP1zcPB5Go2sfBi0OZM/lA== X-Received: by 2002:a62:1516:: with SMTP id 22mr33771701pfv.87.1570470961345; Mon, 07 Oct 2019 10:56:01 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id k15sm3820096pgt.25.2019.10.07.10.55.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2019 10:56:00 -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: [RFC][PATCH v2 1/5] dt-bindings: usb: dwc3: Add a property to do a CGTL soft reset on mode switching Date: Mon, 7 Oct 2019 17:55:49 +0000 Message-Id: <20191007175553.66940-2-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191007175553.66940-1-john.stultz@linaro.org> References: <20191007175553.66940-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 Mon Oct 7 17:55:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 11178269 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 29BB31862 for ; Mon, 7 Oct 2019 17:56:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 09154206C2 for ; Mon, 7 Oct 2019 17:56:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UYzDC4h0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729453AbfJGR4H (ORCPT ); Mon, 7 Oct 2019 13:56:07 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:36770 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729266AbfJGR4E (ORCPT ); Mon, 7 Oct 2019 13:56:04 -0400 Received: by mail-pf1-f193.google.com with SMTP id y22so9147978pfr.3 for ; Mon, 07 Oct 2019 10:56:04 -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=UYzDC4h0moF6TQzBOgkcjKP7aKolNPTebeHscocKWyaubmFmhXEoRiaMdF5qy5ogAn mM09zumDqTlgW8ItdSALOkUZzEib3H67BIfdpf8Tcnhgtxgg588fAu1zMcQcOffL3GHj qKcJDmojl03dF9EWsgoSkdYCy5r5oCQx38zrCIcqPx4hFsKip6dNApLHQ5WDXIgZns5c 4cE7lgRV9iUVqM0hBX91Ni7uZU3+5WG5d9/+wgk1oSY1yoP3Z1Y+ecl0V37tSKe19lrX iELOP5B+MFN2IHQFsm3QMYYUlkQy45Q0XNI+ibrrKGNRFGNiWNZSZcYQAK/4EVIfmach kjfg== 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=SSgchGsgpmWR38h+hEpWkpdEbCdVr5f65lW9t09z9SLc8asbhjfmzMAog8PAlDHkgK /6YsAoES11RcRLhZuTdJ4RSrnaXbiLiav6Blsqon4XkSDK28xCXYQOrZ4Waw6IhoELp7 PttIdgV8SZIuZiyvCqoU3iX14Hw4IKGL5bvGddFzxRQb5ImX9OCKn7vPmZ4xQA5KhSOR +7mE6xPdqjWb96e0DWBn48XZ0a7086/3RGNUDxBWwqGs9YjUft00vIUEINJUw0l+Gsbu EYyGah5X0tLhPWdjtrKzireBK02JTIPIS9t8dMjVWf+v9tSxbVKwxs6I635/YSn+mBPc PvzQ== X-Gm-Message-State: APjAAAVlR0eVVtsJXB8uWjgwhYTgMDZ+gxv9ODT/6fxk0HveeFHxiNcq juqWsNpv5llgndomub2w16DK6w== X-Google-Smtp-Source: APXvYqyP5ZSRlyeJVHXlGMo3HFliZL7HfRt+pmiWd6boT4KjdSiMtolf+T6RLS6pFrH4tgGXlUcUKw== X-Received: by 2002:a62:7597:: with SMTP id q145mr33121812pfc.181.1570470963551; Mon, 07 Oct 2019 10:56:03 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id k15sm3820096pgt.25.2019.10.07.10.56.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2019 10:56:02 -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: [RFC][PATCH v2 2/5] usb: dwc3: Execute GCTL Core Soft Reset while switch mdoe for Hisilicon Kirin Soc Date: Mon, 7 Oct 2019 17:55:50 +0000 Message-Id: <20191007175553.66940-3-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191007175553.66940-1-john.stultz@linaro.org> References: <20191007175553.66940-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 Mon Oct 7 17:55:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 11178263 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 C1C021864 for ; Mon, 7 Oct 2019 17:56:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A0603206C0 for ; Mon, 7 Oct 2019 17:56:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="x1nWDenY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729346AbfJGR4H (ORCPT ); Mon, 7 Oct 2019 13:56:07 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:35326 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729441AbfJGR4G (ORCPT ); Mon, 7 Oct 2019 13:56:06 -0400 Received: by mail-pf1-f196.google.com with SMTP id 205so9145565pfw.2 for ; Mon, 07 Oct 2019 10:56:05 -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=x1nWDenY+0OgbS5Si4sl4DdYea+ca+L0YaFIzXKakFAoV8rokW8Wv4O9U4fSg4XRT3 C36yiu+wbHF79WBypFf0D+jFIoGAugRVQALrQvA4zgQpwlAKaFe18wS0DG4ys81258Xg wgVcnDbTcYXFQ5a8ynD7RjXxF6GJRLeReKA3BBb1Pledy4pQNOgHWFZE4HNvX4cuLe2Y AnKZ+FLYTAUg3PJjrc2pUo26D4LnXuAiz8pV5Z9XiIjb7C+LtjsvwGCKtkfwh7TF0mNW tcEOos93Wrae9VkosnEAjX2oowhtK4u159OFqQL2v1Hlwc9MHeD5i9FPvfFkifEd8ISf lhyA== 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=IndMrIHJ/hm4XVDn9+qsZ+LakGWCdzwJtV17ZSuje7ukmZ0hM5IeofJEf112Ib+B5a dIN3yaXGBc/7yPn4pTL8+p7IhK2nTOlGCtisw8TTgnmQer4+77fvT81inqWaqqNxexMq +6ByYnZCEoP0HRfvoI6wAsyXfj4+jq7vErKOYDdm69eEDTlSfhbgFc07waDcpISgH68B 0dNawnag2FI7lGloX00yHxHqSJR4DwhJ5f8WjzetrGP/Cs5VDTBXpYUxczhz2LYGYoQs EXBtZXohcouXxYyTVNz53/jZHeFsHe3z2X+WLwnsHTG2OddStzubrwq8c7SxIG40j/4s GSPg== X-Gm-Message-State: APjAAAUq2FTi0SPIz92c5zECMiWs+r8gkqJ+Rs9ZnJh0kwGdvQyPJLHD +U6eAvFm6seEwUnEAoTFToMp4w== X-Google-Smtp-Source: APXvYqwMP8ygmDxBtrmpiUIThUb/AoKHCnnSdgO0txYlKecbRvRqSCa7T55269OWxjGj1A/VvCtLzg== X-Received: by 2002:a62:ab04:: with SMTP id p4mr34552992pff.227.1570470965054; Mon, 07 Oct 2019 10:56:05 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id k15sm3820096pgt.25.2019.10.07.10.56.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2019 10:56:04 -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: [RFC][PATCH v2 3/5] usb: dwc3: Increase timeout for CmdAct cleared by device controller Date: Mon, 7 Oct 2019 17:55:51 +0000 Message-Id: <20191007175553.66940-4-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191007175553.66940-1-john.stultz@linaro.org> References: <20191007175553.66940-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 Mon Oct 7 17:55:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 11178267 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 A3CED15AB for ; Mon, 7 Oct 2019 17:56:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 82499206C0 for ; Mon, 7 Oct 2019 17:56:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SlY3eXwv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729458AbfJGR4I (ORCPT ); Mon, 7 Oct 2019 13:56:08 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:36953 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729451AbfJGR4H (ORCPT ); Mon, 7 Oct 2019 13:56:07 -0400 Received: by mail-pl1-f196.google.com with SMTP id u20so7212113plq.4 for ; Mon, 07 Oct 2019 10:56:07 -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=7/b3yUeZa8CC2Us86GgYloZCqUlnEcjewTRh+R9Lbvk=; b=SlY3eXwvCRPmzMOhMJJSBUGa/3rX3D4MUbmP0Ohh4buo2qrQ3DCJIvh8hRcWXRpawv QB80v4EAGe5Dvtan+jOEazC5pe64LQb01TslpzL+J7t1hzRTuRhYCdxhfYXQBbAcI/Zq bFxGsoLTeC4mNqGdjuOKXVihqfjxr5ufHsZZa3pYGj05xoNRFOuWY4wLGePQIJcoC8ry GMomuuVRq9oKJMX/OvfgT19utBjL+NR1tT6xgcPkd9EQbEpXfqCeNm1eY8PSUaRHYgO2 PtJ+Dk4z1VlTkcHKjqtWtn47m3uJ2kJuZ2V8bSDM59Id/tThwdsiUSNhuXTu2pNkEHZM iIRg== 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=7/b3yUeZa8CC2Us86GgYloZCqUlnEcjewTRh+R9Lbvk=; b=aGVfwak788K3nVkadZF1PKvrN6ThzACuWLWEZ4tLOtamB8v7DnQ89EZppFDk/ECCQG Aq+NAFwFJ/LsIxHSRXXKU1r8I3U61VIhM8Sq/7U0L5yWVCkgVaMWJgoBKR+IimpQL5ji RwYYWbuj2semz/GEMBLSqdVk4W9LGBtPPyujHxcjqEwcKstECjRHrc7hpxd2UOJXh+m9 X/QJ/2G0V8TbpVCDxQJ63nyXCzTTvRuXR7eielSKfBX/gkcFR7TowulTpunkZd/yka9B qiZFQF+tRhB9OKYs1YpGqfEEqKOVemlr2YMDcUkfRuZlzh0szMDIXSKddk8L1nLypma1 q3hQ== X-Gm-Message-State: APjAAAUSJqwK5eH5aa8Puc+5jxMgIc2U7KczzkdEVvk1AKog07o3ZVBd K3WieE0WzwDwO6zSZb6Wdx3CUQ== X-Google-Smtp-Source: APXvYqxzIFObkEZ3b71NwneTkjqqzC3Nj0N3NNcomwCN9GSXlPRZnaHZIfK+yVDlQ0vpXSE4EK6AaQ== X-Received: by 2002:a17:902:820f:: with SMTP id x15mr29187700pln.230.1570470966697; Mon, 07 Oct 2019 10:56:06 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id k15sm3820096pgt.25.2019.10.07.10.56.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2019 10:56:06 -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: [RFC][PATCH v2 4/5] dt-bindings: usb: dwc3: of-simple: add compatible for HiSi Date: Mon, 7 Oct 2019 17:55:52 +0000 Message-Id: <20191007175553.66940-5-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191007175553.66940-1-john.stultz@linaro.org> References: <20191007175553.66940-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 --- v2: Tweaked clock names as clk_usb3phy_ref didn't seem right. --- .../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..3a3e5c320f2a --- /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_abb_usb" USB 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_abb_usb", "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 Mon Oct 7 17:55:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 11178265 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 11B5915AB for ; Mon, 7 Oct 2019 17:56:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E2F1520684 for ; Mon, 7 Oct 2019 17:56:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="iD2o9He3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729469AbfJGR4J (ORCPT ); Mon, 7 Oct 2019 13:56:09 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:38692 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729463AbfJGR4J (ORCPT ); Mon, 7 Oct 2019 13:56:09 -0400 Received: by mail-pf1-f195.google.com with SMTP id h195so9130792pfe.5 for ; Mon, 07 Oct 2019 10:56:08 -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=iD2o9He3U69q6RpgqdzxaCMFlm/KSulpW5frmlBOgF4pZ0uYO5c4gejji2HqtrMSQt 8JhD9FTrk7VwS9GB2wrv8Hba0ZUIEQWc9WuQjOP7YxIOKTfoneOS2w/L0Yeb+Ppfbn79 SWF99J20b4fqvta/nclqz+QzVDbV4tZIOQhTbnETRWBCpLXosYrqEgWPHgV0nEEVG5IE T9jbitj49uv/eck9gVcH09akU4ZrdFhTPVaX7LcuokFH39wF81h2s3f+Kx5TVU38lUwk +Sz21hlnZ3RyMbV0oqLJKa6oZqZICMTUv8vFFP0PxLuGOnFixbMAk5Z4XfOwdpENVbIe XJww== 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=a8kzQJk3TQTooS5chUrmTutNuFafzMPBUf4jO1YkSSacQhinisX1nBUVo1Bigo0INc 3RlkrwyIr4BNX2tI5mzj+ZadUYehz+9k/plSTvsD98bXC7fH+QQ7lXGG6t/nYIhIEMOo z1Ot3mmMdwgmlyrfYzWRDG6mZrdX5Y8aQqNl4QjECprDwNAjF0px+1g9EPIIlwkM6RdO btn9/rB9RcMGCLRrI2p50wp+i7zKe9J7I3I3dOl/I96uzIus2v0gfKyhq2FYc4Eeq+mk VlEmQJ/E4DxqKWZr0y9wLqL3vUFTfSO8r1Ho5BfJTdiqxl7jpnr474O4wRcRZ/O5saMr GD+Q== X-Gm-Message-State: APjAAAVwvqSlkhtKyZCgndhwDbcAa5Z3vfutHwisaOCl5iXijLW5/uBb X8j0cYX+nc6m+xoUP2OG3C2WQg== X-Google-Smtp-Source: APXvYqz1K67CyWo0e/emHrkBQnZS3p/dyk4OrQ9OdF6w4uS+MO8fNgdny3guoMksP8tvRCj3SarDBw== X-Received: by 2002:a17:90a:fa0d:: with SMTP id cm13mr610912pjb.70.1570470968394; Mon, 07 Oct 2019 10:56:08 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id k15sm3820096pgt.25.2019.10.07.10.56.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2019 10:56:07 -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: [RFC][PATCH v2 5/5] usb: dwc3: dwc3-of-simple: Add support for dwc3 of Hisilicon Soc Platform Date: Mon, 7 Oct 2019 17:55:53 +0000 Message-Id: <20191007175553.66940-6-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191007175553.66940-1-john.stultz@linaro.org> References: <20191007175553.66940-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);