From patchwork Tue Apr 18 11:16:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 84770 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2772137vqo; Tue, 18 Apr 2023 04:33:14 -0700 (PDT) X-Google-Smtp-Source: AKy350ZEHHUvzO1EuuvjgDmdD+Ha7VmY0D724CwhiZtqI85AoD3sD3loabgN9KH2EXdYQY8GxKgZ X-Received: by 2002:a17:902:ab8e:b0:1a2:8c7e:f301 with SMTP id f14-20020a170902ab8e00b001a28c7ef301mr1556375plr.45.1681817594191; Tue, 18 Apr 2023 04:33:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681817594; cv=none; d=google.com; s=arc-20160816; b=Pc9OUq0GDGQUKmOY8NdIY4tAtaqzSHJz6SKactcWzwo4XjmMLsanm8/pgSCkq368jj QP+ZH0NC0k0Hpk66eh7lJaRg7DvY6IEgU0vMgADi0riztUBOofqKCVlVAPIW0avlHK33 fGYZw5UA1CwJUkIh+vjk738UE3tHyisomsSRgVhklBkBMjKeJ1NeLYM6e+mMvBmZIWbW Ty9um8/wandg2QNTtTTQPuJE1Jtt3VkdMXNuBIHzlW82Qm41tt2ownSSCxxpcvHyqFEx KyWHXZW1yxdjOvwZrClJBVLGHVid644r2iipEIw6WMi/j8Zdq691K0+hV83CJPHPNd6r 6H6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=MDzMe5CZfB1jJP7T11BEyo9k6M0Db32prO+SmusTuWw=; b=CiePpj5Fps7UU1SmviO3FVAO0nYr4+W6yc+bzLb+oMLprPXQ5bhiFY3trMZxPWMjpo q7bI9ncH1mv6IX7NWA5/RBTikg+k7l3ou1M97ipXSNdAnxgrnFQcx+3nOLrtg361R/8u 7syR1gk4KhrphWei8TMF/cg2A3Q68iaVaTJLO0oRuozKlAT4fVukyGPGXgjTLk3CEjTb s8Pbe+5dVci5IRQxlV68qhmV0jaPurPRrYoz85R4R5/PsKBg5BdnBw6r6B8f+26qk4ex VSscnl9ZfNak3QGBDoYrumNlYRCeY6oOq2PhT2JJ+0x6K2SdMy9ZYxBhYQOH6MKUlEMi HpRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=brqLeNnH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n15-20020a170902d2cf00b001a2445dd0fasi14895343plc.381.2023.04.18.04.32.58; Tue, 18 Apr 2023 04:33:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=brqLeNnH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231428AbjDRLSZ (ORCPT + 99 others); Tue, 18 Apr 2023 07:18:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231302AbjDRLSX (ORCPT ); Tue, 18 Apr 2023 07:18:23 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8896619AA; Tue, 18 Apr 2023 04:17:36 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id F24565FD78; Tue, 18 Apr 2023 14:16:20 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1681816581; bh=MDzMe5CZfB1jJP7T11BEyo9k6M0Db32prO+SmusTuWw=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=brqLeNnHFhrcMVFs0R8yx2+7mwYyq+eOWHy5gKsQDSSPFOT7vG87eoE21J0MCPUtj /ZDLMSEpazMaB90uVs0YZdxxHZ7tOmH1cTT114+/ioSqRj/FsNG0Sp6dXxdFAaa1OX rKSIS8T9C8d5kkEeelMcSH88IvZqE4VcFgSF9189TzLEDVJ49KX/mNmRM7CNd7BN4s z/Qv7rzi2lLNjo+HKfZ4RDa7QP25N+bNu+y5IyVdZcn9ztNZXrPxytrGFO3+Vj+p6H G8OSARnLw0zTmHuJdvWWGWSFpibgD/h+oSUZaKgWAADMczYKrHxgbQgkD6xSvatfc7 UTNN778qGqelw== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Tue, 18 Apr 2023 14:16:20 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , , , , CC: , , , , , , , , , , Dmitry Rokosov Subject: [PATCH v2 1/5] phy: amlogic: enable/disable clkin during Amlogic USB PHY init/exit Date: Tue, 18 Apr 2023 14:16:08 +0300 Message-ID: <20230418111612.19479-2-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230418111612.19479-1-ddrokosov@sberdevices.ru> References: <20230418111612.19479-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/18 05:44:00 #21123121 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763513565299784783?= X-GMAIL-MSGID: =?utf-8?q?1763513565299784783?= Previously, all Amlogic boards used the XTAL clock as the default board clock for the USB PHY input, so there was no need to enable it. However, with the introduction of new Amlogic SoCs like the A1 family, the USB PHY now uses a gated clock. Hence, it is necessary to enable this gated clock during the PHY initialization sequence, or disable it during the PHY exit, as appropriate. Signed-off-by: Dmitry Rokosov Reviewed-by: Neil Armstrong --- drivers/phy/amlogic/phy-meson-g12a-usb2.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/phy/amlogic/phy-meson-g12a-usb2.c b/drivers/phy/amlogic/phy-meson-g12a-usb2.c index 9d1efa0d9394..80938751da4f 100644 --- a/drivers/phy/amlogic/phy-meson-g12a-usb2.c +++ b/drivers/phy/amlogic/phy-meson-g12a-usb2.c @@ -172,10 +172,16 @@ static int phy_meson_g12a_usb2_init(struct phy *phy) int ret; unsigned int value; - ret = reset_control_reset(priv->reset); + ret = clk_prepare_enable(priv->clk); if (ret) return ret; + ret = reset_control_reset(priv->reset); + if (ret) { + clk_disable_unprepare(priv->clk); + return ret; + } + udelay(RESET_COMPLETE_TIME); /* usb2_otg_aca_en == 0 */ @@ -277,8 +283,11 @@ static int phy_meson_g12a_usb2_init(struct phy *phy) static int phy_meson_g12a_usb2_exit(struct phy *phy) { struct phy_meson_g12a_usb2_priv *priv = phy_get_drvdata(phy); + int ret = reset_control_reset(priv->reset); + + clk_disable_unprepare(priv->clk); - return reset_control_reset(priv->reset); + return ret; } /* set_mode is not needed, mode setting is handled via the UTMI bus */ From patchwork Tue Apr 18 11:16:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 84787 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2780248vqo; Tue, 18 Apr 2023 04:48:23 -0700 (PDT) X-Google-Smtp-Source: AKy350ZE4p1TFHci2Y9my7hyBgc2J0igsJm6KwzSgwJFtNAbMqNE968MPSfAIYd/sZgettFEN77E X-Received: by 2002:a05:6a20:8420:b0:f0:e2eb:64e7 with SMTP id c32-20020a056a20842000b000f0e2eb64e7mr631004pzd.50.1681818502802; Tue, 18 Apr 2023 04:48:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681818502; cv=none; d=google.com; s=arc-20160816; b=aQyLJ33tXwJ2eHGfy5n/sRKaWvadEEC/DDXYf6uh18OCr1Hc6Pb3tU6D0owQ3B6Jhr vEr7xR2QIMpJgezEO9+ZXMfW1WXnnSB04gjNDUUhZ5xQ1viwxAI8qM7GoAPVNZqRfWbp 591EwdHov3whcNDuoEA6w2vs6ODIK2VLiqsqqCFhg3g+6Gi0QGXJkJ4SI2kS9jsnlLD1 ghaGGLLHklkjIxuV5XoVz16ovxkt8hRpxfvY0c8HtI5yEeKzLiTgYpZI5p2EUZlGY7x0 TBxg+Kir1fpqsLTsL7J1aaGVLBZ0uZlH3EMGln2YmBj9cd/xthmaugX2h8TQK00lL7Oy 5yJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=09WqdKYRyw2DjfHpWjzV6C/vopcEZSQEhMfI25aDH40=; b=SDXtyZqKMGj569b2GcGbVcUExK6PUWaU+I0L/lbNAgDEN+Axu/HAcmmUVp+tNkydg6 ZgcFWPejxw9ZyimK2CaiLlgnS6zu0DGtQ3eJeemOe8W+n2KVppjVWDdJAQ7hEwyw4K5p po5JYGql8KeEwAk59BMNJyvNQGDZJD1kzVziSvmrWTlemUC8AQpzIR1QTSYgPhoPLP1L mRt6NIo9KOGvQN0KVS1FnAyLVxEejCdxmSnmdzxD6j2TgzNApG2B+wAlJcUAcIl284L9 MyLjP5HETTeYDiwuLCLkGvZNdfHDkzW0m6xFTmgaa2mgo3Bt3lAFJltWiIsLIFEJn2SQ OMwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=Ep+FkMAT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v22-20020a636116000000b00502fdd175f3si14795327pgb.148.2023.04.18.04.48.09; Tue, 18 Apr 2023 04:48:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=Ep+FkMAT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231466AbjDRLSa (ORCPT + 99 others); Tue, 18 Apr 2023 07:18:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231440AbjDRLSZ (ORCPT ); Tue, 18 Apr 2023 07:18:25 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51786902E; Tue, 18 Apr 2023 04:17:38 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 97E325FD79; Tue, 18 Apr 2023 14:16:21 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1681816581; bh=09WqdKYRyw2DjfHpWjzV6C/vopcEZSQEhMfI25aDH40=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Ep+FkMATP9znbpgX9YxDSrzdFnc1QzE+e8seNxmUoGbckEssC0tFPLKO7lDxfJteU 0f7NHTt3civIEIjddl8oT84XvxlGKz9Mqihu7znuIr3ECf8WO9JtBPIfHvtg8W1MaX ZJ2QXKvjzXgfOs/7gtzvmHKwP4oSHDkHEKrLRdSFn/ZcyvlgbfSdukdHZGRlK09xlI uCtEc5luBNTD6F4SISibbPOToKKkdvaRhAo4p8Bb+M2zAroO9v5ESwbink0Ik8yRss xExKkHII/TfN7KTAFCPvPBnSmMOkP0EiswsugeIkGIOOwqgWvZkNdy+rcP7BXZllOe s8K1r/p/wXhMA== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Tue, 18 Apr 2023 14:16:21 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , , , , CC: , , , , , , , , , , Dmitry Rokosov Subject: [PATCH v2 2/5] usb: dwc2: support dwc2 IP for Amlogic A1 SoC family Date: Tue, 18 Apr 2023 14:16:09 +0300 Message-ID: <20230418111612.19479-3-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230418111612.19479-1-ddrokosov@sberdevices.ru> References: <20230418111612.19479-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/18 05:44:00 #21123121 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763514518248129560?= X-GMAIL-MSGID: =?utf-8?q?1763514518248129560?= 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 Reviewed-by: Neil Armstrong Acked-by: Minas Harutyunyan --- 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 Tue Apr 18 11:16:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 84771 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2773341vqo; Tue, 18 Apr 2023 04:35:18 -0700 (PDT) X-Google-Smtp-Source: AKy350axdzJBeASskfGvLbvQ0yE0O42gT2jGat30EWXScgp3kh85Ux46EChHp/HwBk94mWmxMojh X-Received: by 2002:a05:6a21:6d8b:b0:ef:f887:40cb with SMTP id wl11-20020a056a216d8b00b000eff88740cbmr6583489pzb.4.1681817717916; Tue, 18 Apr 2023 04:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681817717; cv=none; d=google.com; s=arc-20160816; b=skZSx/i7b6/ZSFQX2vuEQBRGGALWhxXGXN0Bs7rFzuZhMtbNk4DjeOGnjgropQyeFu 6/o/ExMjMZo1JOBtvlitSfkHYHKq6yFdijK9HmddEjgFaOQz47OvADWkwE0FBmshJPrc eg7qTL406GVKgMghkhSEK6bGw7ICyFbl9YoP6x0xNa9ZvGipIh55zV0fAFiU1REKfKg/ gHJ+hVMCthtxmUB5oEiTnxUNsLZ2UckSKKqGVIz4kkOIzUuMDL9Nt48Ror+aPWuG9rFo Ri5wYnWhkqUZJMbyqwgm/luyzBoKM4UCsI3gVZEDBRYXJXXWo78bdp1QkoVUYc7vuiDL 8zUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=C6RAhM5A4BPHpRvqPC3ioWTgfct9Luzmkm/GQUTL3y8=; b=a2akkmYJaw1YCc5sOxMTLeByl0NP2f7wvn2g6YFqyufIb03hvy2dFVCur1AZ2x8Kh7 kNJ4qDdmVqq/tj4xs5M/WsmGmvOQy0uKNIryn1tjJwc/08o3OD/WBdlAdP5IR8l11xFQ hAHuYfPModSxOd/YX+1HjEw9i/9jaVtykBZea4TqZdleQ5Zvd1t/btO/wGE+ErulRplS 8JwqGBKGszReLUdFfXAr+h696qBQ2K6PvZtO7NhoqNbisbFocsJF7uZguokE38oevndu gzfBb+l9o1puLyBRQqX1AVTgcMkmOTAJ1wIeqFLD6hRDaNfdyothLlw6Kio2/qEfSaFG FJBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=WTnU5EyK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f11-20020a63e30b000000b0050fb0a2622esi14307905pgh.400.2023.04.18.04.35.01; Tue, 18 Apr 2023 04:35:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=WTnU5EyK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231440AbjDRLSj (ORCPT + 99 others); Tue, 18 Apr 2023 07:18:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231473AbjDRLSg (ORCPT ); Tue, 18 Apr 2023 07:18:36 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8E0C8A78; Tue, 18 Apr 2023 04:17:42 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id CF68C5FD7A; Tue, 18 Apr 2023 14:16:22 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1681816582; bh=C6RAhM5A4BPHpRvqPC3ioWTgfct9Luzmkm/GQUTL3y8=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=WTnU5EyKuyZJeJXoyY7jJKjk3WDCfseGihjK656q5YpN3aYGZW3USItYk2c33d1Ht 9JZ9u6BdS6o0nXgj5DHZH440BeP6546Br/I0bcfBvjcVevIwsOvfzoUC1CMPwjJON9 9BwPivB7lLUfC5OWtC78K0P8w74ZlXBhCCq/9JzgLwxvhWRIkd2R6AXyEf0UYWbCsL dVoPfjFQKoATMm2FwGXStmiKiYRys8T9BunlCAezIL+5HB5k2V6TAOGv2NHjxwv8U0 9L26NC6zjVwH0x0Uw1T9WyyDBJT3FtpEjSa9sTHnJS9o2LYmEJRWNNUN0HY4uuGA9T 9wX04DM8wOktA== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Tue, 18 Apr 2023 14:16:22 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , , , , CC: , , , , , , , , , , Dmitry Rokosov Subject: [PATCH v2 3/5] dt-bindings: usb: dwc2: add support for Amlogic A1 SoC USB peripheral Date: Tue, 18 Apr 2023 14:16:10 +0300 Message-ID: <20230418111612.19479-4-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230418111612.19479-1-ddrokosov@sberdevices.ru> References: <20230418111612.19479-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/18 05:44:00 #21123121 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763513695401723165?= X-GMAIL-MSGID: =?utf-8?q?1763513695401723165?= 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 Acked-by: Rob Herring Reviewed-by: Martin Blumenstingl --- 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 Tue Apr 18 11:16:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 84772 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2773802vqo; Tue, 18 Apr 2023 04:36:05 -0700 (PDT) X-Google-Smtp-Source: AKy350Z1Nrw2PDJCT5Fovwq6Hc2a7pr2tH7aUmw5IN0BKcu/AG6AikAyBHsKEU7awuzG8oS2yseC X-Received: by 2002:a17:90a:6fe1:b0:239:ea16:5b13 with SMTP id e88-20020a17090a6fe100b00239ea165b13mr1713067pjk.14.1681817765166; Tue, 18 Apr 2023 04:36:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681817765; cv=none; d=google.com; s=arc-20160816; b=FBaWOOIjq6Id7Eo58Hf++P1xxaYU2GTsG9srnzBV4aj4FoXLNMl1XUY8re1iQhxcfB NHEY8U1CLP0FyzxNzvBkTx00FlAgsuUIxr3D8Es65imTOdxtWWRbaxE7iIX9k4GRIPe3 O0mG+QpxrQh0EgPMzrv4xAzKleLEToNXI1l3jB03EBL+a+jFria1xLTWG93jswub6GG9 JozL3MEuQQnPjO5xIcDKQyG19jbY/vF/2PbL6NKTcf581UVME6YLeKuwRQtGMr2hYUZz wovonFIq6qfogPpt1Q3ze//GhiP+5AV/+Hn2S2ol+9YJwSnjJJlaAmIUmbpBpRwH79Uy unAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=26RiW/rOJIVLmGJWx/SnHu6+Xcx0ZjBJnASIM+ICGp4=; b=bJ8M7H0uT7CIDVWkhKtVc/vUv7hs0kyL0BJYSjWXmsAc+YmC305UYwEyWp8ZYLRXjr ZjQOk64qk+UCQlcVhhSad4hop3Aczo0KEF/p0NZ1s3q42eD0VoWkRClMroBJSf9Bv0k7 LByzloJzz00dp0s3txOUwJiCY9AG7dzlfcaTU7lxGuLysnqArI+Z9Otc3JOj2yESutXA kkhuRrEWq0K3YDy0ZV9jU4AFoZLGVlU9eejbd3NXsLGbbuBWDobTZwh3SiCLbRlCwkPk BMab6tDcZ7dzht1UDvrynNFeWfvIRajK5Nql8rTJfRmc4BQ3wHR3E3iZfbeJKOOhbd1a Jk7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=r+jNyWHX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id br2-20020a17090b0f0200b00247a55b01dcsi3536544pjb.174.2023.04.18.04.35.49; Tue, 18 Apr 2023 04:36:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=r+jNyWHX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230352AbjDRLS4 (ORCPT + 99 others); Tue, 18 Apr 2023 07:18:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230526AbjDRLSx (ORCPT ); Tue, 18 Apr 2023 07:18:53 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19D747EC8; Tue, 18 Apr 2023 04:17:57 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 3B6585FD7B; Tue, 18 Apr 2023 14:16:24 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1681816584; bh=26RiW/rOJIVLmGJWx/SnHu6+Xcx0ZjBJnASIM+ICGp4=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=r+jNyWHXfjahndwJpd/bxwD0NKbgVzPgI2C2LUO8YMEwG7fXFm/q0SJH08Jqn1uLw Kb/VLMUqJAN6lLmM877g+H4eYdorbprzrsiN6lzP4xt/WAatXE2H100Y33n07oWVX0 Ab4fPSQmBtT3AgqpoMgO7YOLYPz4RnCTY1nvYHKqrrKcoGDdJ85uXzKYUwqNF59k23 TJcPtLVdt+yvLZe/eG/asbzDOpIBm7ZlL5JpIPinrpxM2p6JnKNzL/k2O+C1D17niK tYNOShpg9pNzt1lUmb2DD/HieX9d2ta9+MhVYau39iSTyacf54IsA5DGPp60HFCVBg NS1Lod044Tk6A== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Tue, 18 Apr 2023 14:16:24 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , , , , CC: , , , , , , , , , , Dmitry Rokosov Subject: [PATCH v2 4/5] usb: dwc3-meson-g12a: support OTG switch for all IP versions Date: Tue, 18 Apr 2023 14:16:11 +0300 Message-ID: <20230418111612.19479-5-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230418111612.19479-1-ddrokosov@sberdevices.ru> References: <20230418111612.19479-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/18 05:44:00 #21123121 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763513744784150327?= X-GMAIL-MSGID: =?utf-8?q?1763513744784150327?= 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 via manual USB role change. Previously, only the Amlogic A1 IP version did not use OTG support for host only mode, but this is no longer applicable. Therefore, the 'otg_switch_supported' option can now be removed as it is no longer required. Signed-off-by: Dmitry Rokosov Reviewed-by: Neil Armstrong Reviewed-by: Martin Blumenstingl --- drivers/usb/dwc3/dwc3-meson-g12a.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c index b282ad0e69c6..a13afdb219e8 100644 --- a/drivers/usb/dwc3/dwc3-meson-g12a.c +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c @@ -140,7 +140,6 @@ static const char * const meson_a1_phy_names[] = { struct dwc3_meson_g12a; struct dwc3_meson_g12a_drvdata { - bool otg_switch_supported; bool otg_phy_host_port_disable; struct clk_bulk_data *clks; int num_clks; @@ -189,7 +188,6 @@ static int dwc3_meson_gxl_usb_post_init(struct dwc3_meson_g12a *priv); */ static const struct dwc3_meson_g12a_drvdata gxl_drvdata = { - .otg_switch_supported = true, .otg_phy_host_port_disable = true, .clks = meson_gxl_clocks, .num_clks = ARRAY_SIZE(meson_g12a_clocks), @@ -203,7 +201,6 @@ static const struct dwc3_meson_g12a_drvdata gxl_drvdata = { }; static const struct dwc3_meson_g12a_drvdata gxm_drvdata = { - .otg_switch_supported = true, .otg_phy_host_port_disable = true, .clks = meson_gxl_clocks, .num_clks = ARRAY_SIZE(meson_g12a_clocks), @@ -217,7 +214,6 @@ static const struct dwc3_meson_g12a_drvdata gxm_drvdata = { }; static const struct dwc3_meson_g12a_drvdata axg_drvdata = { - .otg_switch_supported = true, .clks = meson_gxl_clocks, .num_clks = ARRAY_SIZE(meson_gxl_clocks), .phy_names = meson_a1_phy_names, @@ -230,7 +226,6 @@ static const struct dwc3_meson_g12a_drvdata axg_drvdata = { }; static const struct dwc3_meson_g12a_drvdata g12a_drvdata = { - .otg_switch_supported = true, .clks = meson_g12a_clocks, .num_clks = ARRAY_SIZE(meson_g12a_clocks), .phy_names = meson_g12a_phy_names, @@ -242,7 +237,6 @@ static const struct dwc3_meson_g12a_drvdata g12a_drvdata = { }; static const struct dwc3_meson_g12a_drvdata a1_drvdata = { - .otg_switch_supported = false, .clks = meson_a1_clocks, .num_clks = ARRAY_SIZE(meson_a1_clocks), .phy_names = meson_a1_phy_names, @@ -307,7 +301,7 @@ static int dwc3_meson_g12a_usb2_init_phy(struct dwc3_meson_g12a *priv, int i, U2P_R0_POWER_ON_RESET, U2P_R0_POWER_ON_RESET); - if (priv->drvdata->otg_switch_supported && i == USB2_OTG_PHY) { + if (i == USB2_OTG_PHY) { regmap_update_bits(priv->u2p_regmap[i], U2P_R0, U2P_R0_ID_PULLUP | U2P_R0_DRV_VBUS, U2P_R0_ID_PULLUP | U2P_R0_DRV_VBUS); @@ -490,7 +484,7 @@ static int dwc3_meson_g12a_otg_mode_set(struct dwc3_meson_g12a *priv, { int ret; - if (!priv->drvdata->otg_switch_supported || !priv->phys[USB2_OTG_PHY]) + if (!priv->phys[USB2_OTG_PHY]) return -EINVAL; if (mode == PHY_MODE_USB_HOST) @@ -589,9 +583,6 @@ static int dwc3_meson_g12a_otg_init(struct platform_device *pdev, int ret, irq; struct device *dev = &pdev->dev; - if (!priv->drvdata->otg_switch_supported) - return 0; - if (priv->otg_mode == USB_DR_MODE_OTG) { /* Ack irq before registering */ regmap_update_bits(priv->usb_glue_regmap, USB_R5, @@ -841,8 +832,7 @@ static int dwc3_meson_g12a_remove(struct platform_device *pdev) struct device *dev = &pdev->dev; int i; - if (priv->drvdata->otg_switch_supported) - usb_role_switch_unregister(priv->role_switch); + usb_role_switch_unregister(priv->role_switch); of_platform_depopulate(dev); From patchwork Tue Apr 18 11:16:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 84785 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2780042vqo; Tue, 18 Apr 2023 04:47:55 -0700 (PDT) X-Google-Smtp-Source: AKy350Y8DhceFWlFkFNxeZnA2ZJsFgkYaUBbFDrDiJXWgrvc2VuO/ghvTL94Fg3/LzwaXahfyeEN X-Received: by 2002:a05:6a20:7351:b0:ef:c4f6:9128 with SMTP id v17-20020a056a20735100b000efc4f69128mr8500930pzc.42.1681818475485; Tue, 18 Apr 2023 04:47:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681818475; cv=none; d=google.com; s=arc-20160816; b=ILw9hDSm9GDofNwDYW6Nr+fp+jp40l9ZyuGyx4QH4AjI0KOLhb7ro009kennUqFtuL YP/9yHogY9hCKR9WFycCZZzGPt4AJVv+BpwPiMhXvPJyB/4393E4UHpbXyA9UTXoHRHi tYpdQnAVzwTsDoAq2PdumFkgN20kfxGrv187jA+Gb73jTn63hrZaeaTjOoOIlZcyF85m iOORz0D9N+KE/DN4S8Ae9nV8nueurqlhhOfpwqd6uJq9/ZfJvbgrttFm4CoMgL7e/gzg pkMdg+FtfSTZnKwEGh9cYZgHZ9eyzON0iXibJBgPl2H0NnOr1RnPDKiCaEqeXZ4GNw9A AEAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lYTwixrqbd9SStEuaH+MOse4j7UjK4ooo6t7FaqVmeA=; b=RG1a3OARXlXz0og1/A8jT/c+0Nf/tkKDcvR597ps9TO+KJXPe3UOYTxqonrw6SclJC 1Ph4g/HZfxNPON91WdwkEI2TEP3kPfEx9wJNoczgnXU48len76pRWPPQAxleFLRQMexT zHHSKzFRH0R6tb0ri1Ds8+GIWV7Hiq2myoIJXi2c3GFHKKwYkxF2WYoIOLP+T8z52M1l 2yI02k8iNghvreT4uJUYBHH5M3jkJeo5Vz9EZ5K7zn3uU6nkBV/0ivzbYrsE5WXxufkW Cets5hZ4U4HKX+7gkxpAAOP9qfHVN6Rvn1BtJtKxXSX+6Yz5syKakZq8V9hLA2zW13vE tEEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=Svh2dtAB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n127-20020a632785000000b00519c3475f12si655856pgn.572.2023.04.18.04.47.43; Tue, 18 Apr 2023 04:47:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=Svh2dtAB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231340AbjDRLcl (ORCPT + 99 others); Tue, 18 Apr 2023 07:32:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231247AbjDRLcf (ORCPT ); Tue, 18 Apr 2023 07:32:35 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA10861AB; Tue, 18 Apr 2023 04:32:33 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 046FD5FD7C; Tue, 18 Apr 2023 14:16:26 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1681816586; bh=lYTwixrqbd9SStEuaH+MOse4j7UjK4ooo6t7FaqVmeA=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Svh2dtABfLv0A4s8N8XedVQorPjq21MkbnzYzqGr0rE7B7n9umg+kH5gWc/yfHSxG I6if+KKBejBAY8kxAT35VX8E6ePwaDSYCg9APOXYUTEcf+YTGq+sTMsW1m535JjJJZ maO427TZfHXgh0eMipZMNELzwSsHvujFt9J6lbj8/lmYIsses3X6j8hyVgIzfEGY7w KHroZFMv6imEBXB138tczGBWFym21BusY/Irq0Fl/7qA5FDUxrUYztnLs7qwN5pLfP YAfl2lJeIKU0+N0tenqO5E9AidpMhA92sNKKaEeQ2alWPsyl02QvJSCU8DdA0PRhqw Osjt1945IdDHA== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Tue, 18 Apr 2023 14:16:25 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , , , , CC: , , , , , , , , , , Dmitry Rokosov Subject: [PATCH v2 5/5] arm64: dts: meson: a1: support USB controller in OTG mode Date: Tue, 18 Apr 2023 14:16:12 +0300 Message-ID: <20230418111612.19479-6-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230418111612.19479-1-ddrokosov@sberdevices.ru> References: <20230418111612.19479-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/18 05:44:00 #21123121 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763514489769974123?= X-GMAIL-MSGID: =?utf-8?q?1763514489769974123?= 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 {