From patchwork Fri Apr 14 15:24:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 13211697 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 AA779C77B72 for ; Fri, 14 Apr 2023 15:24:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PQDSPeKvwy8MP2ptUIOlqplLwrCWlzSxWz/bVBhP+U4=; b=BtguSprUSuyzYt BsANaO3LB8ICHYmAln4X7ixLZG6ZwaGFVZLbw5kPfMCSgWbV49EI7O3pm+sM9pfYISWct17A5tHNe JR0nV70qG5t5/b7ABMls7dzQE4Uqs01achEt6mbByVO+XA6h/4lEqrGzY4HtcRue8jiX5rp4O35sR A7w32c04X6nVBCOADq8kBKw2BK5dcEyWuiW4mkWhEm/7BKCqfised98bjNTot8VChxsaMuDg0taIC 0uTqjjHI1ubag/lAKVapqvGJBUHGhBFzS2okYdKNYmMHBbXikkUNFTVukM0e60Mhvly2EGijtPgPx LTcqX0rY56esjMfSKnYw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pnLI2-009wjO-1t; Fri, 14 Apr 2023 15:24:42 +0000 Received: from mx.sberdevices.ru ([45.89.227.171]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pnLHz-009wdv-2Z; Fri, 14 Apr 2023 15:24:41 +0000 Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 1D0375FD24; Fri, 14 Apr 2023 18:24:33 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1681485873; bh=tOUyWscI9lZ1BfORK8wKAfGeDsR5jeAkMWXUSzV4nOo=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=CFdpljegFDGexcztw33NhE658VcGlcFo5wn3igYeJFqCtORsOzU1iJZtNx5OimR/Y yrWTJo1YWhhrl+k6uGaY0UtI+OpMNNpWiDZoxhjzFUJ/Q5PK+Ra57awx4f5TUZNIzv 1ouylhk4YsGKFNyAtBKR2dLW1xkSnUEP9FnyRkFofutwcV4uyDLEZIAAY1l3cWXehw hd6oIkmEoGKt4L2uEmlsUdSK5/mVTzLdzekjD/fDlr7Dit+h1uDMHIYZEoZfb6LqtS ZLcSfn2SSLUPzZ5jCA/DCJi9HoDnbTYfRaukxs5vN3AGDjRiYc7J0mF1jkLj8R2oFx p2KNLorzVL5zQ== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Fri, 14 Apr 2023 18:24:33 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , , , , CC: , , , , , , , , , , Dmitry Rokosov Subject: [PATCH v1 1/5] phy: amlogic: during USB PHY clkin obtaining, enable it Date: Fri, 14 Apr 2023 18:24:19 +0300 Message-ID: <20230414152423.19842-2-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230414152423.19842-1-ddrokosov@sberdevices.ru> References: <20230414152423.19842-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH01.sberdevices.ru (172.16.1.4) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/04/14 08:08:00 #21104846 X-KSMG-AntiVirus-Status: Clean, skipped X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230414_082440_033165_E12F9ADA X-CRM114-Status: GOOD ( 11.76 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Previously, all Amlogic boards used the XTAL clock as the USB PHY input clock, and it did not need to be enabled as it was the default board clock. However, in new Amlogic SoCs such as the A1 family, USB PHY uses a gated clock, so it is necessary to enable this gated clock during probing. Signed-off-by: Dmitry Rokosov --- drivers/phy/amlogic/phy-meson-g12a-usb2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/amlogic/phy-meson-g12a-usb2.c b/drivers/phy/amlogic/phy-meson-g12a-usb2.c index 9d1efa0d9394..26b99fbe1026 100644 --- a/drivers/phy/amlogic/phy-meson-g12a-usb2.c +++ b/drivers/phy/amlogic/phy-meson-g12a-usb2.c @@ -315,7 +315,7 @@ static int phy_meson_g12a_usb2_probe(struct platform_device *pdev) if (IS_ERR(priv->regmap)) return PTR_ERR(priv->regmap); - priv->clk = devm_clk_get(dev, "xtal"); + priv->clk = devm_clk_get_enabled(dev, "xtal"); if (IS_ERR(priv->clk)) return PTR_ERR(priv->clk); From patchwork Fri Apr 14 15:24:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 13211698 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 19384C77B6E for ; Fri, 14 Apr 2023 15:24:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iH101SBVOJpclfO7DIm/hoKxURO8RdhpjwRDZqrtbGo=; b=RvUtSVhti/LVDp Ho6G/Vn7q2PT+t/r0uF53KvxNTbKNvePpsp8hVylJFqhay6xhWQRoTbgpeKP+Xg5Elt7YtcBS7pan 6fHJW2GDLfpLLeg1TC6IG4aCi7N+XdPwhRLJJRT3RTvUJGHVvBr1HgzH5bKrmjZOh4tAtKAh9mGky NXgGHFjjMviIbfo7rUnKHC4X0F0IfABpheZ98p1V4A9abk3YGK2zt34r2DqGxJy+1oOk3PWM1m9mB lQrKgbxkw3sdnulq6doRP/tYPfWvPWTvNTfIJWXpqmzrxS+FyWVOAaLrASHZ7bC4t6GYbZ+lIekkG llSruwreGHbuvVt3+NYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pnLI7-009wnn-1R; Fri, 14 Apr 2023 15:24:47 +0000 Received: from mx.sberdevices.ru ([45.89.227.171]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pnLHz-009wdy-2e; Fri, 14 Apr 2023 15:24:43 +0000 Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 4C8645FD25; Fri, 14 Apr 2023 18:24:33 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1681485873; bh=09WqdKYRyw2DjfHpWjzV6C/vopcEZSQEhMfI25aDH40=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=SHKv3Sz6dKqRl3xEMp3YCFcI87PO0RRN6UG+Ap/geWAsxptpePbI9uV9og2cLbym+ 31Ya1Biqp7lNlZi2VZha/RlhuZfIewNctx6BDQTUFFRKr6TWRrCB2iDh9Tzs8tUnG5 pj5/YVqlXFgmVoCjVGfv/vRA6Xd2YDGT5iq41z5bB3oZ690XEtg4Hq5Go0zho0Hwgc rh5PfU7wTjZqpK13jAktPzoI2aFqQS1Ug0g+ewLCOUe+Eif6K4fAIkJi3jKjI0wzaH 1DOmj68rBYrvtnnfLy+ZklpiD58kNAgvtnsnkQzUw5Lv5zFlAisl4l4aHJijJOpgNy xQqXeJ1niLmRg== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Fri, 14 Apr 2023 18:24:33 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , , , , CC: , , , , , , , , , , Dmitry Rokosov Subject: [PATCH v1 2/5] usb: dwc2: support dwc2 IP for Amlogic A1 SoC family Date: Fri, 14 Apr 2023 18:24:20 +0300 Message-ID: <20230414152423.19842-3-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230414152423.19842-1-ddrokosov@sberdevices.ru> References: <20230414152423.19842-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH01.sberdevices.ru (172.16.1.4) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/04/14 08:08:00 #21104846 X-KSMG-AntiVirus-Status: Clean, skipped X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230414_082440_210336_2C77EC6C X-CRM114-Status: UNSURE ( 8.95 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org The Amlogic A1 uses dwc2 Synopsys IP as its USB peripheral (gadget) endpoint, with different DWC2 parameters when compared to previous Amlogic SoCs. Signed-off-by: Dmitry Rokosov --- drivers/usb/dwc2/params.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c index 9ed9fd956940..098fbfc774ab 100644 --- a/drivers/usb/dwc2/params.c +++ b/drivers/usb/dwc2/params.c @@ -161,6 +161,25 @@ static void dwc2_set_amlogic_g12a_params(struct dwc2_hsotg *hsotg) p->hird_threshold_en = false; } +static void dwc2_set_amlogic_a1_params(struct dwc2_hsotg *hsotg) +{ + struct dwc2_core_params *p = &hsotg->params; + + p->otg_caps.hnp_support = false; + p->otg_caps.srp_support = false; + p->speed = DWC2_SPEED_PARAM_HIGH; + p->host_rx_fifo_size = 192; + p->host_nperio_tx_fifo_size = 128; + p->host_perio_tx_fifo_size = 128; + p->phy_type = DWC2_PHY_TYPE_PARAM_UTMI; + p->phy_utmi_width = 8; + p->ahbcfg = GAHBCFG_HBSTLEN_INCR8 << GAHBCFG_HBSTLEN_SHIFT; + p->lpm = false; + p->lpm_clock_gating = false; + p->besl = false; + p->hird_threshold_en = false; +} + static void dwc2_set_amcc_params(struct dwc2_hsotg *hsotg) { struct dwc2_core_params *p = &hsotg->params; @@ -258,6 +277,8 @@ const struct of_device_id dwc2_of_match_table[] = { .data = dwc2_set_amlogic_params }, { .compatible = "amlogic,meson-g12a-usb", .data = dwc2_set_amlogic_g12a_params }, + { .compatible = "amlogic,meson-a1-usb", + .data = dwc2_set_amlogic_a1_params }, { .compatible = "amcc,dwc-otg", .data = dwc2_set_amcc_params }, { .compatible = "apm,apm82181-dwc-otg", .data = dwc2_set_amcc_params }, { .compatible = "st,stm32f4x9-fsotg", From patchwork Fri Apr 14 15:24:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 13211696 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 AA7F1C77B77 for ; Fri, 14 Apr 2023 15:24:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hV3PNuL1YgOSCJMGlYTjsL4RYQHwE9glY5Vy7lwuMP4=; b=fJWv8B62/eXk7w DyOTlGln9Ci988o2eKDL/43aTsYHYCo7nRAfxc+9QxQ2LnHWkNM+QwTzrMAU+WoTphjUZzE0xmhp7 WeLqh2RbWExADTCUQ61JMMPs/9m714ZbL81rmBpmPASBJV0K41fdSQFoSgrfLAnYs7d98oRl34TDo d4vKZJKld0r2aMucH80cHmiICOvXQBb9Ssq7Ju5d9lZT63cOk/mrRXJ3af1/Jgltw/eJjZVG1Ro15 4k7GMPX7w0wUX2eChHu7tDaLTtAeAbzvQXA7VJ5n9K/cfQ/vC9oFkDXeKHjn9PIENwFbGRiJY3HMk Lf5dsfNFwS50e4Wqd3fA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pnLI7-009wnD-03; Fri, 14 Apr 2023 15:24:47 +0000 Received: from mx.sberdevices.ru ([45.89.227.171]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pnLHz-009we7-3C; Fri, 14 Apr 2023 15:24:42 +0000 Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 211AC5FD26; Fri, 14 Apr 2023 18:24:34 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1681485874; bh=C6RAhM5A4BPHpRvqPC3ioWTgfct9Luzmkm/GQUTL3y8=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=CkyiC5UmgoUazTCGzdnnbsZ1pUZ0e/fl8OQhoq4l4f4JFm6e1MN3YKe81/0NaZycv 2yUexAzAxh4o0hqFRzrMT2NFjbqywU3XnzTfdqI5tqKfPVfwKp9dFuCJ8/jsRUE+eM qnBVd+4Ddbkwp8StXJqDlSvl1LZHA7bpgU3cAmZ9Q3EJrbOwKknyKA7gHxSkiHHh/N eNmROGlk0ILOQNtPQjvGBTq4OvL0C7+R7Rf8DVBBMR/QX1BuKdCIE+CaX06aZZEww6 xoIy35K14SXnltaFUikrxeX/WTpDaCGhfmTiMfo89BtMWR8+FFqkkdfgoIYYg2t62M tDm104Yj+iB4w== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Fri, 14 Apr 2023 18:24:34 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , , , , CC: , , , , , , , , , , Dmitry Rokosov Subject: [PATCH v1 3/5] dt-bindings: usb: dwc2: add support for Amlogic A1 SoC USB peripheral Date: Fri, 14 Apr 2023 18:24:21 +0300 Message-ID: <20230414152423.19842-4-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230414152423.19842-1-ddrokosov@sberdevices.ru> References: <20230414152423.19842-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH01.sberdevices.ru (172.16.1.4) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/04/14 08:08:00 #21104846 X-KSMG-AntiVirus-Status: Clean, skipped X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230414_082440_209774_0F306FE8 X-CRM114-Status: UNSURE ( 7.41 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Provide the appropriate compatible string for the DWC2 IP that is found inside the Amlogic A1 SoC and used in peripheral mode. Signed-off-by: Dmitry Rokosov --- Documentation/devicetree/bindings/usb/dwc2.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/usb/dwc2.yaml b/Documentation/devicetree/bindings/usb/dwc2.yaml index 371ba93f3ce5..f70be397dac0 100644 --- a/Documentation/devicetree/bindings/usb/dwc2.yaml +++ b/Documentation/devicetree/bindings/usb/dwc2.yaml @@ -53,6 +53,7 @@ properties: - amlogic,meson8b-usb - amlogic,meson-gxbb-usb - amlogic,meson-g12a-usb + - amlogic,meson-a1-usb - intel,socfpga-agilex-hsotg - const: snps,dwc2 - const: amcc,dwc-otg From patchwork Fri Apr 14 15:24:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 13211695 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 34F23C77B6E for ; Fri, 14 Apr 2023 15:24:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jXzdkQn6QqxOdJ+RcScC/PIgI0drirNV/NkHt3+mxzg=; b=dsIyeg6RorGN/4 hYJpYWfGUDx+wsph8NlcT+3L/sLWjzSicYv00fS8Hz2VgvpezGwAyr/C45Jk6su3fg7OlhhwqAq6R 4RkA6SmS98/8OqNaV9DQkwLxQGuPQVYTQdHh1rB8eHm2aNsWowK61aQVKQ4IFo6qvKsgdjhyam+GL 1zmOzBgATx13CSNTp/rrGnXag40d+1ycxbV5rdgN++HWthiZgolgO+JOSZsuKatn9B3Mgy2G9Gn6U T0tkpVMRlsrJSyoOvTIE3XnIMtPkiE83752Q20ROBFK/Ca1rJ2jVbaCh2swltlWovcabfWFXQAuMe 2o4xOsE5p7eElu6kFhOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pnLI2-009wjd-34; Fri, 14 Apr 2023 15:24:42 +0000 Received: from mx.sberdevices.ru ([45.89.227.171]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pnLHz-009weC-2e; Fri, 14 Apr 2023 15:24:41 +0000 Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id ECF2C5FD27; Fri, 14 Apr 2023 18:24:34 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1681485875; bh=LsFSCOE/U7ctFiRSO+kttWX/RvhA2tL+4PMkcrQ5e54=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=DCPYUaMz60Nl/RmT7yM88Yzy3adQ6G3ZPztlvKLMMHmWigHQ74VVmrsOIRibpLc2m cCwojrhnuzPzkEay4O5INDE2OsrP+FNrLfxgBV+GDOfP9YpUYQSuyX2p5yMux2crDp 8srpJotp+JwjAzegvx1/WjvvuR/MlcKPrgfEZZ04+XLMSuCRHiENWA9jIfWIrOAa9m eQJ/Mho4V+V6Hk4yCrseev6BCxZyc0+0vwTxFX2mJLXmGUnw9NZ8aOGK4xByKUNVnI M2uVFDtZkSCjSzLx4V2L9OoWsk7v9ogaueGA+/bEeK4rF/W7tTGLfnJBSRu0g6UX8T tfik05VQ2pe1A== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Fri, 14 Apr 2023 18:24:34 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , , , , CC: , , , , , , , , , , Dmitry Rokosov Subject: [PATCH v1 4/5] usb: dwc3-meson-g12a: support OTG switch Date: Fri, 14 Apr 2023 18:24:22 +0300 Message-ID: <20230414152423.19842-5-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230414152423.19842-1-ddrokosov@sberdevices.ru> References: <20230414152423.19842-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH01.sberdevices.ru (172.16.1.4) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/04/14 08:08:00 #21104846 X-KSMG-AntiVirus-Status: Clean, skipped X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230414_082440_035424_3C63B8AC X-CRM114-Status: GOOD ( 10.91 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org From now, the Amlogic A1 USB controller is capable of switching between host and gadget modes, based on the status of the OTG_ID signal or by manual usb role changing. Signed-off-by: Dmitry Rokosov --- drivers/usb/dwc3/dwc3-meson-g12a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c index b282ad0e69c6..10469b95deb9 100644 --- a/drivers/usb/dwc3/dwc3-meson-g12a.c +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c @@ -242,7 +242,7 @@ static const struct dwc3_meson_g12a_drvdata g12a_drvdata = { }; static const struct dwc3_meson_g12a_drvdata a1_drvdata = { - .otg_switch_supported = false, + .otg_switch_supported = true, .clks = meson_a1_clocks, .num_clks = ARRAY_SIZE(meson_a1_clocks), .phy_names = meson_a1_phy_names, From patchwork Fri Apr 14 15:24:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 13211700 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 7A753C77B6E for ; Fri, 14 Apr 2023 15:25:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OU2UDxEAQABHM1uMtWGe/B3XAqkopp1IpvWy2tJ/B4w=; b=o3Uc1SRcR1O+nI noRh57y4Or6qpN+0MqSTF4Am3Taa1l5nlBgGRJqvycwXOW7XDHYkMXffdIdDR/ffXNcWvGe6UZYqz Mvv227v7+5NfVewQFtrzrgBSF2JGHPRXuFDoNM/dPwK2unV6qv9/6ozi+WhXNkpfy2xblki2DSFnk sfvbuCOOs0bczr2HVO59DBqxNzphOdPkr8AHwN0z8G9ubVri1geLRAZ0FMD+BEh3Nvr/iRRV/BcIJ g7/oL9Au7dAvaEinWby4TzNRR+n+ocosDMSvW9yPknUg8QAnZbOER2Bw1nrL8P+v06E+0P1OwXCs9 JzlL3UWn6psuExdxaHgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pnLIK-009wvX-2P; Fri, 14 Apr 2023 15:25:00 +0000 Received: from mx.sberdevices.ru ([45.89.227.171]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pnLI2-009wjE-36; Fri, 14 Apr 2023 15:24:44 +0000 Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id C972E5FD28; Fri, 14 Apr 2023 18:24:35 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1681485875; bh=lYTwixrqbd9SStEuaH+MOse4j7UjK4ooo6t7FaqVmeA=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=bF8ixADUwckraKrGckmTlpKLzIPe2taZI4ZDH36oDfoCLnHmMQY+Q6IX6ktbuH9Fj b3PkRnF9hGxtw7tAn5kdAb2tx4+RGui2lvuWv6LCMzF2WzRRA0XV1acTu9Yll2uj3K iSex5JgZ05czVfj3KPq3hNQUPWMNL/knmpGQYQtp1Y5xTKCmrfszqQ9iqAhBAa7ncG WIqmXhWhjbPmxzig7uJFhw8KNl3HycaQgxyCZbrtCY4abqCmAYcaVo7IJ/rDVGC6rL ntgemjifCH6Wypv+RuFyZn2wMTbHzWOY+sxLGz4WsuDB0S8ylOEtwdZIjfa9eg+RNh Ojv7Qq5tMTO7A== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Fri, 14 Apr 2023 18:24:35 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , , , , CC: , , , , , , , , , , Dmitry Rokosov Subject: [PATCH v1 5/5] arm64: dts: meson: a1: support USB controller in OTG mode Date: Fri, 14 Apr 2023 18:24:23 +0300 Message-ID: <20230414152423.19842-6-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230414152423.19842-1-ddrokosov@sberdevices.ru> References: <20230414152423.19842-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH01.sberdevices.ru (172.16.1.4) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/04/14 08:08:00 #21104846 X-KSMG-AntiVirus-Status: Clean, skipped X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230414_082443_363137_0D19E520 X-CRM114-Status: UNSURE ( 8.23 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Amlogic A1 SoC family has USB2.0 controller based on dwc2 and dwc3 heads. It supports otg/host/peripheral modes. Signed-off-by: Yue Wang Signed-off-by: Hanjie Lin Signed-off-by: Dmitry Rokosov --- arch/arm64/boot/dts/amlogic/meson-a1.dtsi | 59 +++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi index ae7d39cff07a..02af0aac6780 100644 --- a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi @@ -8,6 +8,8 @@ #include #include #include +#include +#include / { compatible = "amlogic,a1"; @@ -169,6 +171,17 @@ gpio_intc: interrupt-controller@0440 { amlogic,channel-interrupts = <49 50 51 52 53 54 55 56>; }; + + usb2_phy1: phy@4000 { + compatible = "amlogic,a1-usb2-phy"; + clocks = <&clkc CLKID_USB_PHY_IN>; + clock-names = "xtal"; + reg = <0x0 0x4000 0x0 0x60>; + resets = <&reset RESET_USBPHY>; + reset-names = "phy"; + #phy-cells = <0>; + power-domains = <&pwrc PWRC_USB_ID>; + }; }; gic: interrupt-controller@ff901000 { @@ -192,6 +205,52 @@ spifc: spi@fd000400 { #size-cells = <0>; status = "disabled"; }; + + usb: usb@fe004400 { + status = "disabled"; + compatible = "amlogic,meson-a1-usb-ctrl"; + reg = <0x0 0xfe004400 0x0 0xa0>; + interrupts = ; + #address-cells = <2>; + #size-cells = <2>; + ranges; + + clocks = <&clkc CLKID_USB_CTRL>, + <&clkc CLKID_USB_BUS>, + <&clkc CLKID_USB_CTRL_IN>; + clock-names = "usb_ctrl", "usb_bus", "xtal_usb_ctrl"; + resets = <&reset RESET_USBCTRL>; + reset-name = "usb_ctrl"; + + dr_mode = "otg"; + + phys = <&usb2_phy1>; + phy-names = "usb2-phy1"; + + dwc2: usb@ff500000 { + compatible = "amlogic,meson-a1-usb", "snps,dwc2"; + reg = <0x0 0xff500000 0x0 0x40000>; + interrupts = ; + phys = <&usb2_phy1>; + phy-names = "usb2_phy"; + clocks = <&clkc CLKID_USB_PHY>; + clock-names = "otg"; + dr_mode = "peripheral"; + g-rx-fifo-size = <192>; + g-np-tx-fifo-size = <128>; + g-tx-fifo-size = <128 128 16 16 16>; + }; + + dwc3: usb@ff400000 { + compatible = "snps,dwc3"; + reg = <0x0 0xff400000 0x0 0x100000>; + interrupts = ; + dr_mode = "host"; + snps,dis_u2_susphy_quirk; + snps,quirk-frame-length-adjustment = <0x20>; + snps,parkmode-disable-ss-quirk; + }; + }; }; timer {