From patchwork Fri Jul 26 18:17:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13743031 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D0837C3DA49 for ; Fri, 26 Jul 2024 18:18:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6hlY/jskfFjLvf2CkYp2cXADUxnfZgmP+k1J65XVhjQ=; b=FwKcMY78+9cZ6DjLyF5BprXQMC dzvs7iM4+g2qgNXRsFQW9R7e58Dtb2ElyZq6yg9xBSxeYY7c9JZmhBJN+fmux352uJtivY2uU93UF ax/e6aK8TIs3Rl3KJq0IRMVhE8YVidGFALTFSVJnelwmrDB+g+wrjEsT6Bi3L8SzCuCCcTIS+BaGu MRrD+1dOZiLydGuIkBTz/T4Ha2B7NvrCCgOcDsZA3GCZJ5yGjVtxRYAMVUoNv9RroBjsBbdc3tVF5 KSA4iB3i9s4PlN7xrkvBOior2nbwrKSsxTZ2DRlqAgNr8QljYCdkhSjEglJWdb8WlC6Vtij4ulKtI CyorA+Gw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPWM-00000004dVj-3bYI; Fri, 26 Jul 2024 18:18:26 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPVu-00000004dLm-3Rm1 for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 18:18:01 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 02AC0C0003; Fri, 26 Jul 2024 18:17:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1722017874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6hlY/jskfFjLvf2CkYp2cXADUxnfZgmP+k1J65XVhjQ=; b=J4/6+VLeoBY7oJ1KT8elG55jruOUf7u4wlH+m+huKtpF7fvSHgd0BTXZsSU+xkK42AzJzE W4lARncevLveoRibHvSQxNz7HwccX9G9EaCAD/P3noX1SjjO36pDx53y7O3Ib2zeuv11HR l/zptPpvGHWmm7+9iQKYuTkTZqQwMd3RH1plH/t5n7q0J07dIGXU6QLcm9d/VFG4aSp0P7 bHrhBHja9AQL7D7KlElfEaTQ2Q69SY31OuGX7qP01+4pvN/NT0z/c4uEuP+v3BK87e0By9 SxpFy4Kt2GY8vBa5lfuaOCqp92i6J/36bDOWVp+3kNBimCJYLi5VUcdObrVjVQ== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 26 Jul 2024 20:17:49 +0200 Subject: [PATCH v5 01/12] dt-bindings: usb: ti,j721e-usb: fix compatible list MIME-Version: 1.0 Message-Id: <20240726-s2r-cdns-v5-1-8664bfb032ac@bootlin.com> References: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> In-Reply-To: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Roger Quadros , Peter Chen , Pawel Laszczak , Mathias Nyman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kevin Hilman , =?utf-8?q?Gr=C3=A9gory_Clement?= , Thomas Petazzoni , =?utf-8?q?Th=C3=A9o_Lebru?= =?utf-8?q?n?= , Conor Dooley X-Mailer: b4 0.14.0 X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_111759_540351_64CD8B7C X-CRM114-Status: UNSURE ( 8.28 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Compatible can be A or B+A, not A or B or A+B. B got added afterwards, we want B+A not A+B. A=ti,j721e-usb and B=ti,am64-usb. Reviewed-by: Rob Herring Reviewed-by: Conor Dooley Signed-off-by: Théo Lebrun Reviewed-by: Roger Quadros --- Documentation/devicetree/bindings/usb/ti,j721e-usb.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/ti,j721e-usb.yaml b/Documentation/devicetree/bindings/usb/ti,j721e-usb.yaml index 95ff9791baea..653a89586f4e 100644 --- a/Documentation/devicetree/bindings/usb/ti,j721e-usb.yaml +++ b/Documentation/devicetree/bindings/usb/ti,j721e-usb.yaml @@ -13,10 +13,9 @@ properties: compatible: oneOf: - const: ti,j721e-usb - - const: ti,am64-usb - items: - - const: ti,j721e-usb - const: ti,am64-usb + - const: ti,j721e-usb reg: maxItems: 1 From patchwork Fri Jul 26 18:17:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13743035 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BA132C3DA49 for ; Fri, 26 Jul 2024 18:20:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wUvbczHasNSXYbLrtASntXaaRYM876jaQmbG3YSsJHs=; b=ONMTKenZDCrNGzbbHfRA5VghCw EkNcSE4Ps1JA57iw0d/oufyeWbpTpDth+Fzrmxml+yGX+CIkN4y7UA5ctO6gcoZSfQeNq9r4sfchW /qpJi5es/XZGv33PdcVSP4izSl/JtFPy9K9MIth1VP4xtdrdNW3kZ1k7nE7rhyCjgS7LW3O0nfZ9a tUOcjmlkwUXZDqcLVkIyc2adqMamLctGcUMmyU2R2TnlC9hrH7b6ddaT+6sLYP+ZiPwhARR4Olj0G 1CLAOfehSxrRYPovKwE27NaOSsT1K4dqqHo/v3yn3jl4cZAGUIg2klUBqa3VvlKl7xWeskR2Q71ut qNJA7mlA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPXr-00000004e1C-1uuZ; Fri, 26 Jul 2024 18:19:59 +0000 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPVw-00000004dLr-2HRV for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 18:18:03 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id CCB57C0005; Fri, 26 Jul 2024 18:17:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1722017875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wUvbczHasNSXYbLrtASntXaaRYM876jaQmbG3YSsJHs=; b=JGmQ6y8iMVspfKfeIgjSAH4IQ9SYmrlcCs4vVSk/ja0JTxjpsrDPd8cGRslr7gZ9/mWLMU 0wAow8JJj9jEiGSfQ9iaPNrGR5JOrXXE5XeQM433RAkDyoS1WqWiz/ASEaUvoS72CZr7ou HMdVE2t9jnQxDN4vt6lUClUh7LK/q/A0hddvZ3NfgVTjxXoLhUPxdO+KxDbZjmDf9NPG5F 66/SYgrLhx0I9LFTdl/SN5PmCwNrNSnYCu77naOMLaLiQ1dqf+F7RoN8Yb6J8Wjo/ZJbOF PMDvbC4vmZPMGDi1bIygRWjP1PGydtMUt4ol3IGMALu6pg7RsHEIO9X3OkMmjQ== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 26 Jul 2024 20:17:50 +0200 Subject: [PATCH v5 02/12] dt-bindings: usb: ti,j721e-usb: add ti,j7200-usb compatible MIME-Version: 1.0 Message-Id: <20240726-s2r-cdns-v5-2-8664bfb032ac@bootlin.com> References: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> In-Reply-To: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Roger Quadros , Peter Chen , Pawel Laszczak , Mathias Nyman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kevin Hilman , =?utf-8?q?Gr=C3=A9gory_Clement?= , Thomas Petazzoni , =?utf-8?q?Th=C3=A9o_Lebru?= =?utf-8?q?n?= X-Mailer: b4 0.14.0 X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_111800_797495_0773742D X-CRM114-Status: UNSURE ( 9.30 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On J7200, the controller & its wrapper are reset on resume. It has the same behavior as ti,j721e-usb with a different SoC integration. Signed-off-by: Théo Lebrun --- Documentation/devicetree/bindings/usb/ti,j721e-usb.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/ti,j721e-usb.yaml b/Documentation/devicetree/bindings/usb/ti,j721e-usb.yaml index 653a89586f4e..038fdf173841 100644 --- a/Documentation/devicetree/bindings/usb/ti,j721e-usb.yaml +++ b/Documentation/devicetree/bindings/usb/ti,j721e-usb.yaml @@ -14,7 +14,9 @@ properties: oneOf: - const: ti,j721e-usb - items: - - const: ti,am64-usb + - enum: + - const: ti,am64-usb + - const: ti,j7200-usb - const: ti,j721e-usb reg: From patchwork Fri Jul 26 18:17:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13743034 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 73985C3DA49 for ; Fri, 26 Jul 2024 18:19:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=kZDH+vYVZ0sd+e3v/cz3AWvqXHr6SWRTVQNIEwVs3rE=; b=NTM1NuUUyrDO81ZOayTlJQmCbs CRltVzcCSjo2Z8qSPA1EVgnHLm8tAgdSXP4Ag8lNt60TnlHa5ki8mnw59bwLnEC/rhS9u1Cd1khdO ehG+MtiFSdG9qrybQvit4ciowoiW17ZgMQNoZHOS88yCNw0tYGngBhtwc0BlD0O2CQbNpEZF6q0zl 9N7H/EwxejqBFJOjVWW454DFNswdnXt+QUkZqRAIa7T2CAA1jSP2udmR2Ob6NsqZAJR4rwqzBo7ie j6TpOMbr0Fo0jhHGX60IciV8oKKS0xfjdS/FvAxYy3cRYg4pAG716R3NiSQNSryosYhKlo715e/hm 8+PpR6Ig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPXV-00000004duY-1AT2; Fri, 26 Jul 2024 18:19:37 +0000 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPVw-00000004dLt-2HLi for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 18:18:03 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 9A375C0006; Fri, 26 Jul 2024 18:17:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1722017876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kZDH+vYVZ0sd+e3v/cz3AWvqXHr6SWRTVQNIEwVs3rE=; b=RF13gQD0rDtCumVc75IlykaY3O4SaZfqjB2d54aFpfW7NfsKoD4zET7Exks6JRVxiNduqx MReFmI4uF0XPep8nmBom6s2WI7pazGnRHvVgqyx7Xs+LbVd9ucaI96uakbV9tUlZQm27Jl HweOIjLOnyEhMaVO7ePS+zxQ2sWDArtZfyArlPNkiHRHequzmMHYaQt1yTpgYyfknN1GoT 4eE1LEMiXULz3MkgVwSsU8If2rZ7MRUlKiTPmhtgdqhsxo89ieN+NxKW/V8zCEVydOs8gO d+qIAftV8KkvHUkG3LBAXDT0wuxmlgnV+3/GEICiDQBqXEur/pzgGX3+D0SkiA== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 26 Jul 2024 20:17:51 +0200 Subject: [PATCH v5 03/12] usb: cdns3-ti: move reg writes to separate function MIME-Version: 1.0 Message-Id: <20240726-s2r-cdns-v5-3-8664bfb032ac@bootlin.com> References: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> In-Reply-To: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Roger Quadros , Peter Chen , Pawel Laszczak , Mathias Nyman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kevin Hilman , =?utf-8?q?Gr=C3=A9gory_Clement?= , Thomas Petazzoni , =?utf-8?q?Th=C3=A9o_Lebru?= =?utf-8?q?n?= X-Mailer: b4 0.14.0 X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_111800_941562_622A8EEB X-CRM114-Status: GOOD ( 14.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The device probe function mixes management code and hardware initialisation code. Extract the latter into an explicitly named cdns_ti_reset_and_init_hw() function to clarify intent. It also will allow easier transition to using runtime PM for triggering HW init. Signed-off-by: Théo Lebrun --- drivers/usb/cdns3/cdns3-ti.c | 84 ++++++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 38 deletions(-) diff --git a/drivers/usb/cdns3/cdns3-ti.c b/drivers/usb/cdns3/cdns3-ti.c index cfabc12ee0e3..5253829ea1d8 100644 --- a/drivers/usb/cdns3/cdns3-ti.c +++ b/drivers/usb/cdns3/cdns3-ti.c @@ -58,6 +58,7 @@ struct cdns_ti { unsigned vbus_divider:1; struct clk *usb2_refclk; struct clk *lpm_clk; + int usb2_refclk_rate_code; }; static const int cdns_ti_rate_table[] = { /* in KHZ */ @@ -98,15 +99,52 @@ static const struct of_dev_auxdata cdns_ti_auxdata[] = { {}, }; +static void cdns_ti_reset_and_init_hw(struct cdns_ti *data) +{ + u32 reg; + + /* assert RESET */ + reg = cdns_ti_readl(data, USBSS_W1); + reg &= ~USBSS_W1_PWRUP_RST; + cdns_ti_writel(data, USBSS_W1, reg); + + /* set static config */ + reg = cdns_ti_readl(data, USBSS_STATIC_CONFIG); + reg &= ~USBSS1_STATIC_PLL_REF_SEL_MASK; + reg |= data->usb2_refclk_rate_code << USBSS1_STATIC_PLL_REF_SEL_SHIFT; + + reg &= ~USBSS1_STATIC_VBUS_SEL_MASK; + + if (data->vbus_divider) + reg |= 1 << USBSS1_STATIC_VBUS_SEL_SHIFT; + + cdns_ti_writel(data, USBSS_STATIC_CONFIG, reg); + reg = cdns_ti_readl(data, USBSS_STATIC_CONFIG); + + /* set USB2_ONLY mode if requested */ + reg = cdns_ti_readl(data, USBSS_W1); + + if (data->usb2_only) + reg |= USBSS_W1_USB2_ONLY; + + /* set default modestrap */ + reg |= USBSS_W1_MODESTRAP_SEL; + reg &= ~USBSS_W1_MODESTRAP_MASK; + reg |= USBSS_MODESTRAP_MODE_NONE << USBSS_W1_MODESTRAP_SHIFT; + cdns_ti_writel(data, USBSS_W1, reg); + + /* de-assert RESET */ + reg |= USBSS_W1_PWRUP_RST; + cdns_ti_writel(data, USBSS_W1, reg); +} + static int cdns_ti_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *node = pdev->dev.of_node; struct cdns_ti *data; - int error; - u32 reg; - int rate_code, i; unsigned long rate; + int error, i; data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); if (!data) @@ -146,7 +184,11 @@ static int cdns_ti_probe(struct platform_device *pdev) return -EINVAL; } - rate_code = i; + data->usb2_refclk_rate_code = i; + data->vbus_divider = device_property_read_bool(dev, "ti,vbus-divider"); + data->usb2_only = device_property_read_bool(dev, "ti,usb2-only"); + + cdns_ti_reset_and_init_hw(data); pm_runtime_enable(dev); error = pm_runtime_get_sync(dev); @@ -155,40 +197,6 @@ static int cdns_ti_probe(struct platform_device *pdev) goto err; } - /* assert RESET */ - reg = cdns_ti_readl(data, USBSS_W1); - reg &= ~USBSS_W1_PWRUP_RST; - cdns_ti_writel(data, USBSS_W1, reg); - - /* set static config */ - reg = cdns_ti_readl(data, USBSS_STATIC_CONFIG); - reg &= ~USBSS1_STATIC_PLL_REF_SEL_MASK; - reg |= rate_code << USBSS1_STATIC_PLL_REF_SEL_SHIFT; - - reg &= ~USBSS1_STATIC_VBUS_SEL_MASK; - data->vbus_divider = device_property_read_bool(dev, "ti,vbus-divider"); - if (data->vbus_divider) - reg |= 1 << USBSS1_STATIC_VBUS_SEL_SHIFT; - - cdns_ti_writel(data, USBSS_STATIC_CONFIG, reg); - reg = cdns_ti_readl(data, USBSS_STATIC_CONFIG); - - /* set USB2_ONLY mode if requested */ - reg = cdns_ti_readl(data, USBSS_W1); - data->usb2_only = device_property_read_bool(dev, "ti,usb2-only"); - if (data->usb2_only) - reg |= USBSS_W1_USB2_ONLY; - - /* set default modestrap */ - reg |= USBSS_W1_MODESTRAP_SEL; - reg &= ~USBSS_W1_MODESTRAP_MASK; - reg |= USBSS_MODESTRAP_MODE_NONE << USBSS_W1_MODESTRAP_SHIFT; - cdns_ti_writel(data, USBSS_W1, reg); - - /* de-assert RESET */ - reg |= USBSS_W1_PWRUP_RST; - cdns_ti_writel(data, USBSS_W1, reg); - error = of_platform_populate(node, NULL, cdns_ti_auxdata, dev); if (error) { dev_err(dev, "failed to create children: %d\n", error); From patchwork Fri Jul 26 18:17:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13743038 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7CE91C3DA4A for ; Fri, 26 Jul 2024 18:21:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ygFH1F/pP0x+mZLwLKNqGnH8mKaQf8msoqiAQ1GXuLM=; b=KK/Rm6menvMCPiUiwS6T0Qg68l qWpez7yCE2UsnmfV+aKitM2Lfs32ZEyO7HMfzyyNfVo/fI+k/xYHSJKHXF/ca4wWDT6QlZX/f5+J7 C3ZLVQ1Wy2qz7tgrP6Btab+OFjFYuxGv4T8Pgr63V6NmpwaphOg32Lr2H3UPQJOxoJlRBm2Blyc2i aUdUfi3eyv54qfNCi0l0ANZv3hK2CDhCAHTlvouoPMiP7iBnNtthHVrMT1INJbc7Qxl2y6h3S+JaJ wZbtww8EMaCCWCdEPjL0+T/7zZJr2G/kvw+m9FVj0R35mQumni6okFvx5gVQKgXye7qr+dvjpTIhT H5Ob6loA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPZ3-00000004eZw-41gE; Fri, 26 Jul 2024 18:21:14 +0000 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPVx-00000004dLw-2gJf for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 18:18:04 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 74BABC0004; Fri, 26 Jul 2024 18:17:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1722017877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ygFH1F/pP0x+mZLwLKNqGnH8mKaQf8msoqiAQ1GXuLM=; b=Dq/p01nrtDgkQW5H4QQBTf9w+n/h/3v2cu8ppA4toGNKWA6PMxSmFHBHjYxZ1c4BV7eLAq wAYfNP2to+B3+Ji9oHR9ldUO4IDI08GeP/sbF73EvBc7B/YEIcM2ywKhfNrfdbwCaFvS4f EOv70ZyfWgfmpFxAcM0h4kw7CshQwJKhobFZzLOhaev/ARgU2gGhtJMcv6S+vB6F+fXzj6 NgiDP3CZWSJdE61PA6wScZig5YM175d1w4TaVGveuNeyyCKwsbPqlpAIcfj5mwdt2kFqyw +L6uysXUZgYMzPOgghHIAK4c6DgdC2H69F2P92+8WZgQdFKXzdF5fOeF8yX0Rg== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 26 Jul 2024 20:17:52 +0200 Subject: [PATCH v5 04/12] usb: cdns3-ti: run HW init at resume() if HW was reset MIME-Version: 1.0 Message-Id: <20240726-s2r-cdns-v5-4-8664bfb032ac@bootlin.com> References: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> In-Reply-To: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Roger Quadros , Peter Chen , Pawel Laszczak , Mathias Nyman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kevin Hilman , =?utf-8?q?Gr=C3=A9gory_Clement?= , Thomas Petazzoni , =?utf-8?q?Th=C3=A9o_Lebru?= =?utf-8?q?n?= X-Mailer: b4 0.14.0 X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_111802_149782_1C453E15 X-CRM114-Status: GOOD ( 14.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org At runtime_resume(), read the W1 (Wrapper Register 1) register to detect if an hardware reset occurred. If it did, run the hardware init sequence. This callback will be called at system-wide resume. Previously, if a reset occurred during suspend, we would crash. The wrapper config had not been written, leading to invalid register accesses inside cdns3. Signed-off-by: Théo Lebrun --- drivers/usb/cdns3/cdns3-ti.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/usb/cdns3/cdns3-ti.c b/drivers/usb/cdns3/cdns3-ti.c index 5253829ea1d8..618fba5fa2bb 100644 --- a/drivers/usb/cdns3/cdns3-ti.c +++ b/drivers/usb/cdns3/cdns3-ti.c @@ -188,6 +188,12 @@ static int cdns_ti_probe(struct platform_device *pdev) data->vbus_divider = device_property_read_bool(dev, "ti,vbus-divider"); data->usb2_only = device_property_read_bool(dev, "ti,usb2-only"); + /* + * The call below to pm_runtime_get_sync() MIGHT reset hardware, if it + * detects it as uninitialised. We want to enforce a reset at probe, + * and so do it manually here. This means the first runtime_resume() + * will be a no-op. + */ cdns_ti_reset_and_init_hw(data); pm_runtime_enable(dev); @@ -232,6 +238,24 @@ static void cdns_ti_remove(struct platform_device *pdev) platform_set_drvdata(pdev, NULL); } +static int cdns_ti_runtime_resume(struct device *dev) +{ + const u32 mask = USBSS_W1_PWRUP_RST | USBSS_W1_MODESTRAP_SEL; + struct cdns_ti *data = dev_get_drvdata(dev); + u32 w1; + + w1 = cdns_ti_readl(data, USBSS_W1); + if ((w1 & mask) != mask) + cdns_ti_reset_and_init_hw(data); + + return 0; +} + +static const struct dev_pm_ops cdns_ti_pm_ops = { + RUNTIME_PM_OPS(NULL, cdns_ti_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) +}; + static const struct of_device_id cdns_ti_of_match[] = { { .compatible = "ti,j721e-usb", }, { .compatible = "ti,am64-usb", }, @@ -245,6 +269,7 @@ static struct platform_driver cdns_ti_driver = { .driver = { .name = "cdns3-ti", .of_match_table = cdns_ti_of_match, + .pm = pm_ptr(&cdns_ti_pm_ops), }, }; From patchwork Fri Jul 26 18:17:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13743033 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6D539C3DA4A for ; Fri, 26 Jul 2024 18:19:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Rs1+QAvC+jZKXsMcSqVeWFXio+625byt2ino+7lcNkU=; b=FX9ykM0auABvyL/lxR8KeiurmR p++4x7oYTT84SUXdoFvGqHmU01OhvJIr9H6u7mWYm34SW4n2YIgbq1nYQv3+7uJIDXPxQI/E+KPK8 Bj40dt6mTgRaaiPne+IlJMdvaXowWdgtG9NIBebtXOPU1fJ0zh3JNPxeiZ9Uod/raicdBqZXvblwb 2YUZtO+A1VI9Zu6vL/ajY6blhRpqccUu52jWGGQnXRkZdLiMpFxlROGljQJBR5wJjYcBzNQIOGNWo uEEyg0Q/UPilU/BxZA9g0QVDmoY4xHr+wQrFAvEdQA8twXPerhsd41lvfXnH/IPypk21+fSuZwIVb xP1cvNZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPX7-00000004dnq-3dHN; Fri, 26 Jul 2024 18:19:13 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPVv-00000004dLz-1t6q for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 18:18:02 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 5231DC0007; Fri, 26 Jul 2024 18:17:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1722017878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Rs1+QAvC+jZKXsMcSqVeWFXio+625byt2ino+7lcNkU=; b=E9JgL+qkpiuGRDvWxLP3R3OdEU1cluDeiFz53pCJFaTMQvq6VwcVygV3CV9xX7fY+8pBJJ jt0vPJY2NChKEYExC/ZDHfO1hATCIrOL+cqgzjqBAU1LCtM7pz0qRGGWWneN7a/05pcdmn VHXXCLN60j/tx/HZaNkb13AwyWynr5mJPDactO7E6qlQ9SG7hsWNDjXZkgAJwUDJlJYV4m HjsjZ6jJyKxt8AyKr7plXHke3C8cLzki8LD9o2HOCxxV8s1c+tI5cVu1P2AgZXB8hpOZAS 5iS/we8p6JG77MQHilKQDo5kAzWdwJHon5O9Pty1UuZrf/w4TsbCIaOdKWUg7Q== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 26 Jul 2024 20:17:53 +0200 Subject: [PATCH v5 05/12] usb: cdns3: add quirk to platform data for reset-on-resume MIME-Version: 1.0 Message-Id: <20240726-s2r-cdns-v5-5-8664bfb032ac@bootlin.com> References: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> In-Reply-To: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Roger Quadros , Peter Chen , Pawel Laszczak , Mathias Nyman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kevin Hilman , =?utf-8?q?Gr=C3=A9gory_Clement?= , Thomas Petazzoni , =?utf-8?q?Th=C3=A9o_Lebru?= =?utf-8?q?n?= X-Mailer: b4 0.14.0 X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_111759_644095_93C09C9A X-CRM114-Status: GOOD ( 10.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The cdns3 host role does not care about reset-on-resume. xHCI however reconfigures itself in silence rather than printing a warning about a resume error. Related warning example: [ 16.017462] xhci-hcd xhci-hcd.1.auto: xHC error in resume, USBSTS 0x401, Reinit Allow passing a CDNS3_RESET_ON_RESUME quirk flag from cdns3 pdata down to xHCI pdata. The goal is to allow signaling about reset-on-resume behavior from platform wrapper drivers. When used, remote wakeup is not expected to work. Acked-by: Peter Chen Signed-off-by: Théo Lebrun Reviewed-by: Roger Quadros --- drivers/usb/cdns3/core.h | 1 + drivers/usb/cdns3/host.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/usb/cdns3/core.h b/drivers/usb/cdns3/core.h index 57d47348dc19..9207bd6365f7 100644 --- a/drivers/usb/cdns3/core.h +++ b/drivers/usb/cdns3/core.h @@ -45,6 +45,7 @@ struct cdns3_platform_data { unsigned long quirks; #define CDNS3_DEFAULT_PM_RUNTIME_ALLOW BIT(0) #define CDNS3_DRD_SUSPEND_RESIDENCY_ENABLE BIT(1) +#define CDNS3_RESET_ON_RESUME BIT(2) }; /** diff --git a/drivers/usb/cdns3/host.c b/drivers/usb/cdns3/host.c index ceca4d839dfd..d2cb529630e4 100644 --- a/drivers/usb/cdns3/host.c +++ b/drivers/usb/cdns3/host.c @@ -103,6 +103,9 @@ static int __cdns_host_init(struct cdns *cdns) if (cdns->pdata && (cdns->pdata->quirks & CDNS3_DEFAULT_PM_RUNTIME_ALLOW)) cdns->xhci_plat_data->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW; + if (cdns->pdata && (cdns->pdata->quirks & CDNS3_RESET_ON_RESUME)) + cdns->xhci_plat_data->quirks |= XHCI_RESET_ON_RESUME; + ret = platform_device_add_data(xhci, cdns->xhci_plat_data, sizeof(struct xhci_plat_priv)); if (ret) From patchwork Fri Jul 26 18:17:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13743037 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AA225C3DA49 for ; Fri, 26 Jul 2024 18:20:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UB2yJwdnYb2P4da/POGQoMfTHp7V1lBWEjlzymwP8HU=; b=0edkyPFuJD1EFy8ST6b+Iruncc N3tXG50UkYqPNfCl4YNv9b2h4ACF4Su7P7kmMqKkIjwbBXvmeEL4Zyxusfp0ddJgceP5ZPL4S+fY5 wFbJnLIptE2bNRWmI354TjXykQu6WVExcpqt9f/1Kf/Eb+tL+4KMXUHUkJQzyxMuw2t9CIdki44ob eSSvKezoPITTNOWPgngKUSg/aCD44ra4a6Fg08IP3WF/flUbaXopjEww2hnAV5eAm2TN+BmhbyB10 1X8A8STM5kWWl0ygnbcfdJd6ygKUdN2GzbvWBuDRf6PTQKZNi9GxPlknnV55EPkjbRpMNOWzKWiU9 ekIOnM9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPYf-00000004eOA-0mlU; Fri, 26 Jul 2024 18:20:49 +0000 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPVw-00000004dM1-2HqS for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 18:18:03 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 2DEEDC0008; Fri, 26 Jul 2024 18:17:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1722017878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UB2yJwdnYb2P4da/POGQoMfTHp7V1lBWEjlzymwP8HU=; b=V4plbe+JHBZ+BcsSSbMU3fD9SNLkG2/Xq0mSl2tN4CoE9T1+Fk2dKc/FeXqPhuq/Gfqg+Z BEbxnR4Yp5WUThk2P4kv8TLW7wQqzZzt5/7AS0URzoSC36hPZw2Pwb/fQ7p9/Dk2Sbe7ON leZ94Xgyf4TmW4TUTz3oCbP8pqEUzSbXP5TS9I3kOq4jqCZfzC72c0rDIcIp01+0uGjuoa rSSpA543jj9t5RR86KhDTafRh4mArEVIrU1fst/yc+vqFCr/UxVL8VM63SicJbDIRmy3yr eQKC3u7loCRRXtMu5uiJ94GuLUm7UNlMIkaQg5HyoxHO6xl/0Lxs6W+ddyj9cg== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 26 Jul 2024 20:17:54 +0200 Subject: [PATCH v5 06/12] usb: cdns3-ti: grab auxdata from match data MIME-Version: 1.0 Message-Id: <20240726-s2r-cdns-v5-6-8664bfb032ac@bootlin.com> References: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> In-Reply-To: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Roger Quadros , Peter Chen , Pawel Laszczak , Mathias Nyman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kevin Hilman , =?utf-8?q?Gr=C3=A9gory_Clement?= , Thomas Petazzoni , =?utf-8?q?Th=C3=A9o_Lebru?= =?utf-8?q?n?= X-Mailer: b4 0.14.0 X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_111800_946808_F362C514 X-CRM114-Status: GOOD ( 13.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Current code uses the global `cdns_ti_auxdata` variable as auxiliary data passed to of_platform_populate(). Use match data to store a pointer to auxdata. Current behavior is not changed; it allows future compatibles to provide different auxiliary data. Signed-off-by: Théo Lebrun Reviewed-by: Roger Quadros --- drivers/usb/cdns3/cdns3-ti.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/drivers/usb/cdns3/cdns3-ti.c b/drivers/usb/cdns3/cdns3-ti.c index 618fba5fa2bb..159814dfc856 100644 --- a/drivers/usb/cdns3/cdns3-ti.c +++ b/drivers/usb/cdns3/cdns3-ti.c @@ -87,18 +87,6 @@ static inline void cdns_ti_writel(struct cdns_ti *data, u32 offset, u32 value) writel(value, data->usbss + offset); } -static struct cdns3_platform_data cdns_ti_pdata = { - .quirks = CDNS3_DRD_SUSPEND_RESIDENCY_ENABLE, /* Errata i2409 */ -}; - -static const struct of_dev_auxdata cdns_ti_auxdata[] = { - { - .compatible = "cdns,usb3", - .platform_data = &cdns_ti_pdata, - }, - {}, -}; - static void cdns_ti_reset_and_init_hw(struct cdns_ti *data) { u32 reg; @@ -142,6 +130,7 @@ static int cdns_ti_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *node = pdev->dev.of_node; + const struct of_dev_auxdata *auxdata; struct cdns_ti *data; unsigned long rate; int error, i; @@ -203,7 +192,8 @@ static int cdns_ti_probe(struct platform_device *pdev) goto err; } - error = of_platform_populate(node, NULL, cdns_ti_auxdata, dev); + auxdata = device_get_match_data(dev); + error = of_platform_populate(node, NULL, auxdata, dev); if (error) { dev_err(dev, "failed to create children: %d\n", error); goto err; @@ -256,9 +246,21 @@ static const struct dev_pm_ops cdns_ti_pm_ops = { SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) }; +static struct cdns3_platform_data cdns_ti_pdata = { + .quirks = CDNS3_DRD_SUSPEND_RESIDENCY_ENABLE, /* Errata i2409 */ +}; + +static const struct of_dev_auxdata cdns_ti_auxdata[] = { + { + .compatible = "cdns,usb3", + .platform_data = &cdns_ti_pdata, + }, + {}, +}; + static const struct of_device_id cdns_ti_of_match[] = { - { .compatible = "ti,j721e-usb", }, - { .compatible = "ti,am64-usb", }, + { .compatible = "ti,j721e-usb", .data = cdns_ti_auxdata }, + { .compatible = "ti,am64-usb", .data = cdns_ti_auxdata }, {}, }; MODULE_DEVICE_TABLE(of, cdns_ti_of_match); From patchwork Fri Jul 26 18:17:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13743036 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2D9D2C3DA49 for ; Fri, 26 Jul 2024 18:20:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3Eayj+ntAEk18/DRsjd8aPm4OTkARNCkPfWA6i3HBMw=; b=eZanajYiffBMcOQp8zok59TDZ7 UFBnFTCetL51LhWcDPw8ThrmYH3DhIu6mzQSb2mK4mHPihoklxcxYDa77Yp0GjWZEVkUGsfOPuMrn jdxkM93UMG8cXU1T7akhn91wjdHMny7Ut5/ApxQDGp3mxOih6NAW0vsGfYNFCcrmM6ZehmkyfYa3m WvqSwIhXr2Y6uRosMyMg/i1YFHX7Th37j3o0jzyD++k6UihCjTgOkzMB7KJXTYXBdLGH7Fg/jY57l fX08b5ja8Menpf1MBXIhQDB0WIKhJAs3n8a+bPeC3xw5cUWMeRCknMpMfKiiP7MeGdSJqziE9r1eV QJjQ7lBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPYG-00000004eBH-1VDb; Fri, 26 Jul 2024 18:20:24 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPVx-00000004dMe-18gx for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 18:18:03 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 0577FC000A; Fri, 26 Jul 2024 18:17:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1722017879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3Eayj+ntAEk18/DRsjd8aPm4OTkARNCkPfWA6i3HBMw=; b=m01kwFZH8OlhF1iaJg8FIvKh749lS2UavKUm42AMknQ0S5TwCAd+CbX2PovnmjtTekR6rM P8lLwHZHsX3zYZHBaKfZ9D3+S/kZ6Z+5Y47CKc5NJh7qgfXPKKuiwIo6bobXfXjkZX5TBC rCSsuVtQ/Mgu6fS0Sf2Z4YfsGWDq/hCpi1rh3JC7DZ9H10Kjm2N/EnnFJLPmz1v9gwNWtl C+GC3hlpt8W4kRXDUTBWFuVg7r0zf8gNUOjvaR0Wm7PGa4SGeMGoIZtPv1dFyRXUpBohL6 kH2eE37QGFs+X8gBTsSxIYT0gDGo2vkPj2a8yGrCguftORJEDoVbg7b3iRnoIg== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 26 Jul 2024 20:17:55 +0200 Subject: [PATCH v5 07/12] usb: cdns3-ti: add J7200 support with reset-on-resume behavior MIME-Version: 1.0 Message-Id: <20240726-s2r-cdns-v5-7-8664bfb032ac@bootlin.com> References: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> In-Reply-To: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Roger Quadros , Peter Chen , Pawel Laszczak , Mathias Nyman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kevin Hilman , =?utf-8?q?Gr=C3=A9gory_Clement?= , Thomas Petazzoni , =?utf-8?q?Th=C3=A9o_Lebru?= =?utf-8?q?n?= X-Mailer: b4 0.14.0 X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_111801_463589_19D67713 X-CRM114-Status: UNSURE ( 9.93 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add ti,j7200-usb compatible. Match data indicates the controller resets on resume which tells that to the cdns3 core. This in turn silences a xHCI warning visible in cases of unexpected resets. We also inherit the errata quirk CDNS3_DRD_SUSPEND_RESIDENCY_ENABLE from the default `cdns_ti_auxdata` configuration. Signed-off-by: Théo Lebrun --- drivers/usb/cdns3/cdns3-ti.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/usb/cdns3/cdns3-ti.c b/drivers/usb/cdns3/cdns3-ti.c index 159814dfc856..65b8b6f4c654 100644 --- a/drivers/usb/cdns3/cdns3-ti.c +++ b/drivers/usb/cdns3/cdns3-ti.c @@ -258,7 +258,21 @@ static const struct of_dev_auxdata cdns_ti_auxdata[] = { {}, }; +static struct cdns3_platform_data cdns_ti_j7200_pdata = { + .quirks = CDNS3_RESET_ON_RESUME | + CDNS3_DRD_SUSPEND_RESIDENCY_ENABLE, /* Errata i2409 */ +}; + +static const struct of_dev_auxdata cdns_ti_j7200_auxdata[] = { + { + .compatible = "cdns,usb3", + .platform_data = &cdns_ti_j7200_pdata, + }, + {}, +}; + static const struct of_device_id cdns_ti_of_match[] = { + { .compatible = "ti,j7200-usb", .data = cdns_ti_j7200_auxdata }, { .compatible = "ti,j721e-usb", .data = cdns_ti_auxdata }, { .compatible = "ti,am64-usb", .data = cdns_ti_auxdata }, {}, From patchwork Fri Jul 26 18:17:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13743040 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5066AC3DA49 for ; Fri, 26 Jul 2024 18:22:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=L8BqOp+imFT7RCmJiTvOqUvgDym7zUG3PG+O/IVmdxE=; b=bPLBCujhhbfJxS8RO7JhRs7DxS BTjSLgLKnsmgLOWuiKAcS1up8sJHqzDM2FqNx+ehixAHG85nZdQKOIYwR1cB+/4Mx9Mw/cKbsC84N I3/bQywH+wLNcJnFv3ScwiMiWRFEHLc52Uid2CexRP85GKOBjeMerLjhV8nsW5Aaguy3H4xQybCjl TctkPLL5tlIkSW1vSPNF9Pq5rJapehhwY5xFFenOn5uEMb9vu9vuajlpGYXjeAW9nbFt+QEyxdwie nDj2Oipl2C0Kp0iG7ApJRzpRE71GPqYcruu7PWT84M1w4pkpS2OqmpeZaAP7svXHigy+yW3IQeIcT /cTe4uNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPZo-00000004eo3-0egF; Fri, 26 Jul 2024 18:22:00 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPVx-00000004dMw-45zC for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 18:18:05 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id CB411C000B; Fri, 26 Jul 2024 18:17:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1722017880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L8BqOp+imFT7RCmJiTvOqUvgDym7zUG3PG+O/IVmdxE=; b=RzgIV18gLAeLOEqwiANRhZCopxKO9YmyJJyevs1sTSbgS55Q9aGhSlG/hMCEWGAJQB6fh+ 8p8e4/6fSJIKHac24zvNF1heB4MCuYeMm3/UbQpNjAGA4V72LfW93xPIQK7vSEWWJ7+PKN c8y8NtXMJMbbKpDEP0vvn+GQtOTQ03iiqkL3pa6/GSrzTeC4E8Fo8YUV4UqUksKzgVbO1f dx9KPVKGjgQiHKsZ8W6+o7s9C6rwc7S+y6vU5ioTlRIus6tMTRGpcgdKXoTwEguxc77o69 4CWjV56xDYBKTT+9q+qWSY84yV2IyASebwOuuhyED7308sGHT2iIV/K8q5Hqug== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 26 Jul 2024 20:17:56 +0200 Subject: [PATCH v5 08/12] usb: cdns3: rename hibernated argument of role->resume() to lost_power MIME-Version: 1.0 Message-Id: <20240726-s2r-cdns-v5-8-8664bfb032ac@bootlin.com> References: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> In-Reply-To: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Roger Quadros , Peter Chen , Pawel Laszczak , Mathias Nyman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kevin Hilman , =?utf-8?q?Gr=C3=A9gory_Clement?= , Thomas Petazzoni , =?utf-8?q?Th=C3=A9o_Lebru?= =?utf-8?q?n?= X-Mailer: b4 0.14.0 X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_111802_383180_5BB52325 X-CRM114-Status: GOOD ( 12.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The cdns_role_driver->resume() callback takes a second boolean argument named `hibernated` in its implementations. This is mistaken; the only potential caller is: int cdns_resume(struct cdns *cdns) { /* ... */ if (cdns->roles[cdns->role]->resume) cdns->roles[cdns->role]->resume(cdns, cdns_power_is_lost(cdns)); return 0; } The argument can be true in cases outside of return from hibernation. Reflect the true meaning by renaming both arguments to `lost_power`. Signed-off-by: Théo Lebrun --- drivers/usb/cdns3/cdns3-gadget.c | 4 ++-- drivers/usb/cdns3/cdnsp-gadget.c | 2 +- drivers/usb/cdns3/core.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c index fd1beb10bba7..694aa1457739 100644 --- a/drivers/usb/cdns3/cdns3-gadget.c +++ b/drivers/usb/cdns3/cdns3-gadget.c @@ -3468,7 +3468,7 @@ __must_hold(&cdns->lock) return 0; } -static int cdns3_gadget_resume(struct cdns *cdns, bool hibernated) +static int cdns3_gadget_resume(struct cdns *cdns, bool lost_power) { struct cdns3_device *priv_dev = cdns->gadget_dev; @@ -3476,7 +3476,7 @@ static int cdns3_gadget_resume(struct cdns *cdns, bool hibernated) return 0; cdns3_gadget_config(priv_dev); - if (hibernated) + if (lost_power) writel(USB_CONF_DEVEN, &priv_dev->regs->usb_conf); return 0; diff --git a/drivers/usb/cdns3/cdnsp-gadget.c b/drivers/usb/cdns3/cdnsp-gadget.c index 4a3f0f958256..7d05180442fb 100644 --- a/drivers/usb/cdns3/cdnsp-gadget.c +++ b/drivers/usb/cdns3/cdnsp-gadget.c @@ -1973,7 +1973,7 @@ static int cdnsp_gadget_suspend(struct cdns *cdns, bool do_wakeup) return 0; } -static int cdnsp_gadget_resume(struct cdns *cdns, bool hibernated) +static int cdnsp_gadget_resume(struct cdns *cdns, bool lost_power) { struct cdnsp_device *pdev = cdns->gadget_dev; enum usb_device_speed max_speed; diff --git a/drivers/usb/cdns3/core.h b/drivers/usb/cdns3/core.h index 9207bd6365f7..f385d3980545 100644 --- a/drivers/usb/cdns3/core.h +++ b/drivers/usb/cdns3/core.h @@ -30,7 +30,7 @@ struct cdns_role_driver { int (*start)(struct cdns *cdns); void (*stop)(struct cdns *cdns); int (*suspend)(struct cdns *cdns, bool do_wakeup); - int (*resume)(struct cdns *cdns, bool hibernated); + int (*resume)(struct cdns *cdns, bool lost_power); const char *name; #define CDNS_ROLE_STATE_INACTIVE 0 #define CDNS_ROLE_STATE_ACTIVE 1 From patchwork Fri Jul 26 18:17:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13743039 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5CCBBC3DA4A for ; Fri, 26 Jul 2024 18:21:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wZYia7FGurB9of6IzHnVjgaTJVQiLrxPMBa0JK9qcOU=; b=VvK4MRnblbR4G73M4sgsISkoy2 UrQwgI75vasSN5k6GW1zE8PacbgB3CZKTT0EE/XYonyfaF7QGxvJl3JJBq+foJC+dTJEIIBzuE1mN PSLEoqocUZa5TIsOnWfbBalicWcVpRA3+XyAEsc4ESdL8UhBwQNHtFPfiRUA7QlIaQek6+/WDgPKT OEHREqr8PMuRp6ehBW/xyYQnw8EkrMcvmykSvl21kGpds4BsSD58mwOUraHC8ioloJYGZtSbUnZwF n4w5mCg+U4Htgs9LpLi8PbPMBrIF6tVCKReDDhR6vm40cpD1Ycw0e3Kaa6DOMA79/H3AayJmG8UxH /uBc1y9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPZQ-00000004egJ-26lA; Fri, 26 Jul 2024 18:21:36 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPVy-00000004dNg-35fp for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 18:18:04 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 95BDCC0009; Fri, 26 Jul 2024 18:18:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1722017881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wZYia7FGurB9of6IzHnVjgaTJVQiLrxPMBa0JK9qcOU=; b=YISZNTASZcu9lL4M+MHFMKTHcQtXdc/AEFh0XrKSLydZP3UUmXSCJOMXkGLnVzUf2h4hhR cRTZwaTCyGUiUPTanbVXyq4AS4ucXZblnM4ZfludQbknbf0L51ZwxGz4T59bNwMbO2/6lI jWsnuAtyyuvG9uIdMk/trfGZWv68HiwENG7boPnhQnpVQ/Sn32GnyA4g9JTOTknZr2/tOp 1JCF6C4aLPetxME1h5Bni6uWpgmVUUVZMybB8LsFex272FPRGBQtQHNKZKFEzvPwiwUrZ+ 1Ssg8B1gwrH4UbjZ9WLnLdGX+TOzw07OXu3ok1zShDm2WaFurfCq3CqaYQECKA== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 26 Jul 2024 20:17:57 +0200 Subject: [PATCH v5 09/12] xhci: introduce xhci->lost_power flag MIME-Version: 1.0 Message-Id: <20240726-s2r-cdns-v5-9-8664bfb032ac@bootlin.com> References: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> In-Reply-To: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Roger Quadros , Peter Chen , Pawel Laszczak , Mathias Nyman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kevin Hilman , =?utf-8?q?Gr=C3=A9gory_Clement?= , Thomas Petazzoni , =?utf-8?q?Th=C3=A9o_Lebru?= =?utf-8?q?n?= X-Mailer: b4 0.14.0 X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_111803_123743_906452F3 X-CRM114-Status: GOOD ( 15.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The XHCI_RESET_ON_RESUME quirk allows wrappers to signal that they expect a reset after resume. It is also used by some to enforce a XHCI reset on resume (see needs-reset-on-resume DT prop). Some wrappers are unsure beforehands if they will reset. Add a mechanism to signal *at resume* if power has been lost. Parent devices can set this flag, that defaults to the XHCI_RESET_ON_RESUME value. The XHCI_RESET_ON_RESUME quirk still triggers a runtime_pm_get() on the controller. This is required as we do not know if a suspend will trigger a reset, so the best guess is to avoid runtime PM. Reset the xhci->lost_power value each time in xhci_resume(), making it safe for devices to only set lost_power on some resumes. Signed-off-by: Théo Lebrun --- drivers/usb/host/xhci.c | 8 +++++++- drivers/usb/host/xhci.h | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 0a8cf6c17f82..2c9b32d339f9 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -1029,9 +1029,12 @@ int xhci_resume(struct xhci_hcd *xhci, pm_message_t msg) spin_lock_irq(&xhci->lock); - if (hibernated || xhci->quirks & XHCI_RESET_ON_RESUME || xhci->broken_suspend) + if (hibernated || xhci->lost_power || xhci->broken_suspend) reinit_xhc = true; + /* Reset to default value, parent devices might correct it at next resume. */ + xhci->lost_power = !!(xhci->quirks & XHCI_RESET_ON_RESUME); + if (!reinit_xhc) { /* * Some controllers might lose power during suspend, so wait @@ -5228,6 +5231,9 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks) if (get_quirks) get_quirks(dev, xhci); + /* Default value, that can be corrected at resume. */ + xhci->lost_power = !!(xhci->quirks & XHCI_RESET_ON_RESUME); + /* In xhci controllers which follow xhci 1.0 spec gives a spurious * success event after a short transfer. This quirk will ignore such * spurious event. diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index ebd0afd59a60..ec7c6061363f 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1640,6 +1640,12 @@ struct xhci_hcd { unsigned broken_suspend:1; /* Indicates that omitting hcd is supported if root hub has no ports */ unsigned allow_single_roothub:1; + /* + * Signal from upper stacks that we lost power during system-wide + * suspend. Its default value is based on XHCI_RESET_ON_RESUME, meaning + * it is safe for wrappers to not modify lost_power at resume. + */ + unsigned lost_power:1; /* cached extended protocol port capabilities */ struct xhci_port_cap *port_caps; unsigned int num_port_caps; From patchwork Fri Jul 26 18:17:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13743041 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3E07CC3DA49 for ; Fri, 26 Jul 2024 18:22:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nVKDcHNw5TaBkw7ykMrWc0qPl//SaW0x/mq86RauHgc=; b=DV3NIWXETP1uV06qunWHSJro1m LtcUWV+7fOw+fXEdCQTcQnQp5eSNB805mvrd55Ax8NS+h16m/IPy6Zp38PAe9DzLXk1a+U3KZVISc T9RV/zeL45h5/ccZ9+kz7NXtud1stdhL2IWnX/9eUF2ZIYZCgFj8eCjvhP9Np/YGXLALNEP04ivDF FPk8asRfHSYwpJhl8eWN5841ZbUn+ClCDQaqLaRd5dgL3NgW+WqcfvmTcYF9AWv44n0nr6p9DriVk 9HW819aEC4yYefzXCTGimhWWwp4/EpTj2iqEOPlV2GfQJEjaNiVaH1G9F6zsjyoNpzn+adrfmFfgh ggHY5B1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPaC-00000004ewR-0eTQ; Fri, 26 Jul 2024 18:22:24 +0000 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPW0-00000004dOM-0NEI for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 18:18:06 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 6C3A2C000C; Fri, 26 Jul 2024 18:18:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1722017882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nVKDcHNw5TaBkw7ykMrWc0qPl//SaW0x/mq86RauHgc=; b=Ls+AnFBCzBN0HwcYy9zP6koWjLz/YO08/2MPGZeHVW+/8c9SdnUo4Yr1yXevYIIdA+JYoE lro7oeDBX4Wh3+5DHbesFtvd4e24dVubijUvREJ9hj/WeNhdwbSukzJCWQd9SF1IXydDjb 4XY+vNTR/4UuTlxtrqISnuDNvRt8QXq85DVzfPnH8QcbGXKUAL8QF0OmFq3XkLt73mL/Ct mKBON+s+4BjiAgo4yKjZElTfJZcLFX6qK1ri4g3lMYeXEE3q99Y0xISPQctKBdMSmG2xpN 29eEr7sHUel6nlcKiS9YtvkEC6nhbD2R/03GTtaxA79IFS8RY7lQO4+2NFPy2g== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 26 Jul 2024 20:17:58 +0200 Subject: [PATCH v5 10/12] usb: cdns3: host: transmit lost_power signal from wrapper to XHCI MIME-Version: 1.0 Message-Id: <20240726-s2r-cdns-v5-10-8664bfb032ac@bootlin.com> References: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> In-Reply-To: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Roger Quadros , Peter Chen , Pawel Laszczak , Mathias Nyman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kevin Hilman , =?utf-8?q?Gr=C3=A9gory_Clement?= , Thomas Petazzoni , =?utf-8?q?Th=C3=A9o_Lebru?= =?utf-8?q?n?= X-Mailer: b4 0.14.0 X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_111804_340523_6EA51940 X-CRM114-Status: UNSURE ( 9.63 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org cdns_role_driver->resume() receives the information if power was lost across suspend (ie if a reset occurred). Transmit that to the XHCI core using the newly introduced lost_power flag. We therefore override its default value that is based on XHCI_RESET_ON_RESUME. Signed-off-by: Théo Lebrun --- drivers/usb/cdns3/host.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/usb/cdns3/host.c b/drivers/usb/cdns3/host.c index d2cb529630e4..edef39ab8d15 100644 --- a/drivers/usb/cdns3/host.c +++ b/drivers/usb/cdns3/host.c @@ -139,6 +139,15 @@ static void cdns_host_exit(struct cdns *cdns) cdns_drd_host_off(cdns); } +static int cdns_host_resume(struct cdns *cdns, bool lost_power) +{ + struct usb_hcd *hcd = platform_get_drvdata(cdns->host_dev); + struct xhci_hcd *xhci = hcd_to_xhci(hcd); + + xhci->lost_power = lost_power; + return 0; +} + int cdns_host_init(struct cdns *cdns) { struct cdns_role_driver *rdrv; @@ -149,6 +158,7 @@ int cdns_host_init(struct cdns *cdns) rdrv->start = __cdns_host_init; rdrv->stop = cdns_host_exit; + rdrv->resume = cdns_host_resume; rdrv->state = CDNS_ROLE_STATE_INACTIVE; rdrv->name = "host"; From patchwork Fri Jul 26 18:17:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13743042 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 468EBC3DA4A for ; Fri, 26 Jul 2024 18:22:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ih+kvx1EySeuO8rTTlNvuYdd21gOB8JWUrmwahT1dOc=; b=xh6eRsJIb1D409f/WB8uvfAfA+ /P6s8exYw0/+tNYeS3t7IqyJRi+jt4U0igwax+tvDBMFP7kfYUxT2ms84gjDCoKPPqGotF3i7WAkl Wdpc1wpPaYpC9rupZbigg+4pTXAwAAZMaUcFd3UjgGy+kVksUYMvf85ZTrr/WvF2YUKsDkF5SYbkO aJjqlmsBcGEQKivFnIxCxaYNVPof8TgqvVo97Sj86GTpF55hZU1hhi7R8kY9/Tj1v3Tj0y1xzaPjc q75WjKIEIbH9sKuR6NOf5h2Q5Swvg8BcRTPO+j1nR3NsjveLiZY4aL/zWgZbQPlumv6pYnMhghUmk z9NRU8PQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPaY-00000004f2C-1eNs; Fri, 26 Jul 2024 18:22:46 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPW0-00000004dOn-1R2h for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 18:18:06 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 43B4CC000E; Fri, 26 Jul 2024 18:18:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1722017883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ih+kvx1EySeuO8rTTlNvuYdd21gOB8JWUrmwahT1dOc=; b=kfbw/Q+QBan9UTaP6HuJ77llt2vFWlvZpOKS3Av1JequqWPDFAHbb2QOk8eZazcs4Hv+03 R4xPpHj6knTcAUImEbRK6i8YNuqymlar61qVlryTH+DMasExG35Zv2WALwLZnqUzbxwP++ OJKRhGH4Mvr3lvIBxyhpglPe13jxK/Rvirs4rviwk2iVoiZNfwa/AR8py6n4kL5tpuc2Hs R608HRMzfXRiNujGDZbh4k3UaUQTAkcHdtU1g73dVG/YVFLb/eNt/XuC4Yb6S8Uv0sTX5t R7QThnoWYn/qXLSF2/kUexkcCiSmmywqI3Pb+BYTGJOnwbodqZqtBVN19urgZw== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 26 Jul 2024 20:17:59 +0200 Subject: [PATCH v5 11/12] arm64: dts: ti: k3-j7200: use J7200-specific USB compatible MIME-Version: 1.0 Message-Id: <20240726-s2r-cdns-v5-11-8664bfb032ac@bootlin.com> References: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> In-Reply-To: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Roger Quadros , Peter Chen , Pawel Laszczak , Mathias Nyman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kevin Hilman , =?utf-8?q?Gr=C3=A9gory_Clement?= , Thomas Petazzoni , =?utf-8?q?Th=C3=A9o_Lebru?= =?utf-8?q?n?= X-Mailer: b4 0.14.0 X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_111804_575235_D8A26C94 X-CRM114-Status: GOOD ( 10.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On our platform, suspend-to-idle or suspend-to-RAM turn the controller off. This compatible triggers reset-on-resume behavior to reconfigure the hardware. Signed-off-by: Théo Lebrun Reviewed-by: Roger Quadros --- arch/arm64/boot/dts/ti/k3-j7200-main.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/ti/k3-j7200-main.dtsi b/arch/arm64/boot/dts/ti/k3-j7200-main.dtsi index 9386bf3ef9f6..6b8e8672b386 100644 --- a/arch/arm64/boot/dts/ti/k3-j7200-main.dtsi +++ b/arch/arm64/boot/dts/ti/k3-j7200-main.dtsi @@ -766,7 +766,7 @@ pcie1_rc: pcie@2910000 { }; usbss0: cdns-usb@4104000 { - compatible = "ti,j721e-usb"; + compatible = "ti,j7200-usb", "ti,j721e-usb"; reg = <0x00 0x4104000 0x00 0x100>; dma-coherent; power-domains = <&k3_pds 288 TI_SCI_PD_EXCLUSIVE>; From patchwork Fri Jul 26 18:18:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13743043 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24D56C3DA49 for ; Fri, 26 Jul 2024 18:23:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nzzwZRIMf3Tzxd7N00x3LQAknBs3IrccO6DEWuel4oQ=; b=Qaua70SzvTa6SrcxewajHhAFLd ULpenD+cxiDDNSt1McQ7rNsfPPIDiqiYbn9SkqOB7bE27tZWL1IWUG8mqyDYKK06/pjKcNzORbuxq AafA16Blt3kP+wmnLqYnbE4ppcwSc5PbHTA1pUN1MBQpM2NA+Ek+692xW3u89ye2aZvlXK0misseR mzAmPybq7sYAeoLv19ycv92Huf5pGmE/3mdhWN9Hdy+fAv3IfSWunbmd/3ntutYQNHMQBD5aBK8l1 5FVT42WEfEAi/BiMfzm4XalU3aDN6DYwnPJTSR6IXMfHm25xO/tKw1QHiM/BFwrTYqMrIpZOwT1HS OHeiwb8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPav-00000004f7A-3MbZ; Fri, 26 Jul 2024 18:23:09 +0000 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPW1-00000004dP7-1hwV for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 18:18:07 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 1148BC0011; Fri, 26 Jul 2024 18:18:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1722017883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nzzwZRIMf3Tzxd7N00x3LQAknBs3IrccO6DEWuel4oQ=; b=A5/P1RgqlIFjF5ttDIOfjWKIeVVj56YVzB3p0s8T2Il7RtaZRahYcaiLSXMpgmmAhPAvLD ip7/SUDvfi30x5DYnHTyAtxyq+wu9Y+a4XlTiCVwrbqegCSy/TrUp5AcM0KIyJ/BcVIZuw ndNENrH4uTdyp0HPps44ihMR6udGO01j/2yzFI8+F3ir+NWplXrlfr4AVwPQqc86b7pupI COXVA5z8Wzy3yOmsns9q2fKRxz2PXIuPmCUqLqWv1OR56LyGuOm0rlFT7jo4RiMR/pon9L Hr6Tq92iXBSQirjgIm3lHBq3wrt3/G2+w1uu748soK3HONgIEcJDrNtd2/c0KA== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 26 Jul 2024 20:18:00 +0200 Subject: [PATCH v5 12/12] arm64: dts: ti: k3-am64: add USB fallback compatible to J721E MIME-Version: 1.0 Message-Id: <20240726-s2r-cdns-v5-12-8664bfb032ac@bootlin.com> References: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> In-Reply-To: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Roger Quadros , Peter Chen , Pawel Laszczak , Mathias Nyman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kevin Hilman , =?utf-8?q?Gr=C3=A9gory_Clement?= , Thomas Petazzoni , =?utf-8?q?Th=C3=A9o_Lebru?= =?utf-8?q?n?= X-Mailer: b4 0.14.0 X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_111805_907289_F6DA7393 X-CRM114-Status: GOOD ( 11.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org USB on AM64 is the same peripheral as on J721E. It has a specific compatible for potential integration details. Express this relationship, matching what the dt-bindings indicate. Signed-off-by: Théo Lebrun Reviewed-by: Roger Quadros --- arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi index f8370dd03350..02c8ed93730f 100644 --- a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi @@ -759,7 +759,7 @@ timesync_router: pinctrl@a40000 { }; usbss0: cdns-usb@f900000 { - compatible = "ti,am64-usb"; + compatible = "ti,am64-usb", "ti,j721e-usb"; reg = <0x00 0xf900000 0x00 0x100>; power-domains = <&k3_pds 161 TI_SCI_PD_EXCLUSIVE>; clocks = <&k3_clks 161 9>, <&k3_clks 161 1>;