From patchwork Wed Apr 26 10:29:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 87794 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp139487vqo; Wed, 26 Apr 2023 03:31:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6nMb9rnv2ueGgi6mYH5M8NOpWZ5oyXSjCYjtweOHwXsYzSfH+GNJtZlGrV3fWhxcAc7q8q X-Received: by 2002:a05:6a00:218d:b0:641:699:f353 with SMTP id h13-20020a056a00218d00b006410699f353mr1572210pfi.22.1682505096175; Wed, 26 Apr 2023 03:31:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682505096; cv=none; d=google.com; s=arc-20160816; b=neoapCH1pvzexBvXvqfgMqByZISoXwCOigule2DyxG5M08ldW1wuk+/dgniN9/0vEH Dne7qI8GFT4nHewOBfjGdBKzRfJxHBpPVRCj/cTjdLl2RLFmSdazWArut8lTED9Cjd2H gfR1bNc+ww2/4ps032DfqhVBX/qk4QoMM+NK7+evh32Yp0aTqtJ3aMtsoqxoxlqIA6sn mGxM+q172Pj2uR+2pXmzzgJWigWWkt+Ch9DlvDmyNYMnEHfj+dYCfuqto2l8Bnf88BhC RtI4P7sACXKtFJuHrS5516Os2Me6ekrXekmDZ+WJFqpKyqoMzDtRKs343ATrfx2E0SJe /dhA== 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=2iTDEsndR82cnln9Q9SqkIaok7IFFDU8o3YeSEDTGF4=; b=rY6HTTPxbr7NbGebfKxf8PL7Y6DJ3WSEvYMHwrXbOMKllVXAKmfHrivXP+kOyIaz7t h3QABMzG0Sprd2gl5qzm5TUkm1Ep6w2/y5Z9XIPxGxWaTySSF5VxkqBGG08bpYu+59DQ m8Xwe8Sg644piuDbyKvXSlljYgzIql67RpAOQidVCWt31o4WO3HjbXduwj8OxgTom/cq qqSEfaVGj4+tvhjmFjC5SOUNumDyxDJO3iBqPhuWp8c9hCFLPam8b3OWSiaaCm6lOXwH EcVH4BlWOjTHCKCmyh8dFepcqRSpzI6vakJTkjLwSJ2Hy5ykRNBfvRuDSHuQrZ2e3zMe 6tKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=UWTpX6du; 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 e13-20020a056a0000cd00b0063473a51539si11815421pfj.398.2023.04.26.03.31.21; Wed, 26 Apr 2023 03:31:36 -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=UWTpX6du; 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 S240435AbjDZK34 (ORCPT + 99 others); Wed, 26 Apr 2023 06:29:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229744AbjDZK3l (ORCPT ); Wed, 26 Apr 2023 06:29:41 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7504B49DD; Wed, 26 Apr 2023 03:29:39 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id C65D65FD7B; Wed, 26 Apr 2023 13:29:37 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1682504977; bh=2iTDEsndR82cnln9Q9SqkIaok7IFFDU8o3YeSEDTGF4=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=UWTpX6duaX2IAVpAWjNY+DnGpWEl9biaL1HpLEZLhnPWQd/jmgFvtA3iUtcTECWhL jnvnlvuNHprUDG+ktoCUwdHZb13SylUlo9lKBdudwwuXH1Pe4slJqyZLo703hNW55g wXN5GtR7mKp5t7x2P4JhAKLRSNfa5ru9NSCj2csc86NG67suAlfUEuEhI4lTCM7r5z wUykuePqRAg2KKNoE5B8YbhGgvAhzn9+jdU6LIOQ7KnebKcDf26DQTkv6QDWmL35V/ 3kIS1G1C/lSsnHrIUsmOUGEtw1lJLjfiwMtJiO8cuY/tzdTbRMVKEbm6KbvDQhTI/r nSjkT05vE1vRA== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Wed, 26 Apr 2023 13:29:37 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , , , , CC: , , , , , , , , , , Dmitry Rokosov Subject: [PATCH v3 1/5] phy: amlogic: enable/disable clkin during Amlogic USB PHY init/exit Date: Wed, 26 Apr 2023 13:29:18 +0300 Message-ID: <20230426102922.19705-2-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230426102922.19705-1-ddrokosov@sberdevices.ru> References: <20230426102922.19705-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH02.sberdevices.ru (172.16.1.5) 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/26 04:45:00 #21166225 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_NONE, 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?1764234463297940831?= X-GMAIL-MSGID: =?utf-8?q?1764234463297940831?= 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: Martin Blumenstingl --- drivers/phy/amlogic/phy-meson-g12a-usb2.c | 15 +++++++++++++-- 1 file changed, 13 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..ec2555bb83d5 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,13 @@ 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; + + ret = reset_control_reset(priv->reset); + if (!ret) + 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 Wed Apr 26 10:29: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: 87798 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp145157vqo; Wed, 26 Apr 2023 03:43:56 -0700 (PDT) X-Google-Smtp-Source: AKy350YFQI8yHLJJX1mraU+oxhTd2R9x4CVug3Pi5nW76UW8BbMzcOc5plNIMsIFvWAlsQckCDJk X-Received: by 2002:a05:6a00:847:b0:63d:67e5:9731 with SMTP id q7-20020a056a00084700b0063d67e59731mr30474595pfk.2.1682505836257; Wed, 26 Apr 2023 03:43:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682505836; cv=none; d=google.com; s=arc-20160816; b=sbqOBmPiEG2dDEIR5kRtYmNdH1qN74wDsa9XXMROIuA/W4cBxPNS1qU8UpAyuoG6pb dGqAxguotAFX0qc74sXdXWHJgL1KAVONtEsziPGa7jbl56tBXi/dkLthriR97KR4yqYz DZDc/ZRcMcoAcnyYIDpOxdModcDinVuKQCZuBy/jeqDFtB6NTn+Q87qmJ4yMG/vR7YVd F0FaSYhFo5dEJ6BZxSiTUh6ftbzF4QFQ2r83hssltDN4oNrI3pHKbzQXOXv8y2yPLVCm WkupIPVMhaAY9UIGBl4VrU308NwmCkqkPH3e40XZuvixzPI7TLGTFnKMvVqX6cnkrXOY 7vlw== 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=eyzCCsK01f/afWykUeqT1z5S763OYcMrDYYa5HTJ5Mo=; b=bOEO0zMwjss2cBPkd1LJKIRTmuGv+e30SOMpduZY6uDd65vwDinL/v7ggPf8wb7RrN GrV2wrIH/aKdoeVIF3nTnnewt3O0M+X/dElvmRI/Q/7t3kJjxZ0bAnI2QUSRu+cKIYQp NU9YCkiM9VOnaFOkBNAlQLeND1pvfUYiZaY0RL1WymZI3mDeem1vEVc88W8Le8Zb2KDT OaVZfAT7OYdoWtp/sJuAppujDuMSaL/dtnQrT6d0SbaZpkfI9gCW0+P0ereFiWbykW7x d+xyAkEmo5OeWsdpErP4wxTEMpUp7MubutW0jjNfaELhcStnCYAnTUtPH0X44+Xl3CLk KYjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=g9JZahJW; 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 u82-20020a627955000000b0063b7862ed1csi16740548pfc.397.2023.04.26.03.43.43; Wed, 26 Apr 2023 03:43:56 -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=g9JZahJW; 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 S240267AbjDZK3o (ORCPT + 99 others); Wed, 26 Apr 2023 06:29:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239384AbjDZK3l (ORCPT ); Wed, 26 Apr 2023 06:29:41 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C48CE49F4; Wed, 26 Apr 2023 03:29:39 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 042DB5FD7C; Wed, 26 Apr 2023 13:29:38 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1682504978; bh=eyzCCsK01f/afWykUeqT1z5S763OYcMrDYYa5HTJ5Mo=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=g9JZahJWGBQmrx8vhJ0nSwBEYhead3HRMZY0AoFLAOFacFXGCNm5+PpB/CszqPHwV N2MFLEllnAcwuctLrLFN2/ubVoDK1cagkH4gZNMPPDc1G8ZUyAPOpuVXib+x4F6ZYC oYsXJyRF9pxLxGOupUvKtVsQQHYBZeYYM8Ss7bOXg6YRlcKzxM87ESBuPESkjZlLFM olW/fIRnLMR9DAT4gFCM8cbd78wPNrQJr7/QBPRAfvJKFZwD8AJKPH99W/TFRTOCcW vP5I7Z7nVDL8QrlrCuWM2AU2OHSPDpfA+K7ObsDNzSkB2/w9rv65pysvk2TaUHBmR/ FzwUGTavhRVMw== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Wed, 26 Apr 2023 13:29:37 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , , , , CC: , , , , , , , , , , Dmitry Rokosov , Minas Harutyunyan Subject: [PATCH v3 2/5] usb: dwc2: support dwc2 IP for Amlogic A1 SoC family Date: Wed, 26 Apr 2023 13:29:19 +0300 Message-ID: <20230426102922.19705-3-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230426102922.19705-1-ddrokosov@sberdevices.ru> References: <20230426102922.19705-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH02.sberdevices.ru (172.16.1.5) 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/26 04:45:00 #21166225 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_NONE, 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?1764235239767848277?= X-GMAIL-MSGID: =?utf-8?q?1764235239767848277?= 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 Wed Apr 26 10:29: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: 87797 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp144947vqo; Wed, 26 Apr 2023 03:43:26 -0700 (PDT) X-Google-Smtp-Source: AKy350ZxQn4IsEl2pktHGIEgMnAV4pwy8I2klGyYsxCd+sOT6ZF51W5wWojyY4F3nCxEeW90cDHK X-Received: by 2002:a17:903:27cb:b0:19f:2dff:2199 with SMTP id km11-20020a17090327cb00b0019f2dff2199mr18038159plb.68.1682505806154; Wed, 26 Apr 2023 03:43:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682505806; cv=none; d=google.com; s=arc-20160816; b=SV4Fgcw215mVJyDKhqkcKTJzCfysS0ZOLygLMp/NtM0P/1fNQwIJ4teUPz0ZsQ0Vc6 3cSgCcE99FpFDTJCgM9MMwLiSeHn9lfweBoU8QuC5jf8cbTbmttsy7enQ3vAWKSJ3Gw/ B4qLLcSCOQc3cGvfT6/YgUCsJvNHvm+pcFSQMQ6gGXbhWXN2gLQqFkYi3LruH+ySXn7k 1K18op4AbzWu1hQqB/IVjkgnCWwejQRR6BfnyrXOKwkjvQMy9BsRNDubH2NNZXqhZim1 02axRGzLVcDhpooNTgcoxe+xqHJOgDJodF+I3XnpGEqYonfiEoa1/yOFVX7lnPuITRLx lPdA== 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=d9FEepOf44U9WlSTkZRyE7W3kPgjD/3/5ttgBCiHj3U=; b=G8KgWS+BNVFPSua19gU5Oyq7sicepclfYnVap2/JmJFxiSP8GKBSMn6CXBo2+ws4hN wId7D1kc/soWzBwCCTKWq5Tm+4Yh3yFGPFaFKBcLaZxKgJAs8m5EyLHXC9Q+44L3X2sJ L5fRMDRWqMljR7oW0ZdmD6XAPKVwpXbRu+1Ajf9EaohQdgEAl63+3J/OQGXYG6jP0NJB 3wo6oYd3zT6WMEWFoskSDFINkybw+C05fwl+hT1SDOxOjdy5FP9lrUxkFZy6vYPbkSz3 4AN6O5Zp7VRvsjFLekJlj8Y+U76+GBaOI4Y/KryVWfHrKHrkPox78cEZhflLaSGtU80G IqwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=qdbtYeQw; 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 ij8-20020a170902ab4800b001a63c61f06fsi15052099plb.48.2023.04.26.03.43.10; Wed, 26 Apr 2023 03:43:26 -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=qdbtYeQw; 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 S240143AbjDZKaB (ORCPT + 99 others); Wed, 26 Apr 2023 06:30:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239666AbjDZK3l (ORCPT ); Wed, 26 Apr 2023 06:29:41 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E47AB49F5; Wed, 26 Apr 2023 03:29:39 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 3512F5FD7D; Wed, 26 Apr 2023 13:29:38 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1682504978; bh=d9FEepOf44U9WlSTkZRyE7W3kPgjD/3/5ttgBCiHj3U=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=qdbtYeQwJy+UJ4aEV0cqY1+KmBF7fIJoRu5m3JfWXQCuUbzAcMusboDMZgBscPCzr 2SfO4ZP5Pqc29cYTdieESJP3BdRMQ1ttvHooe4eg9S+Z/F+xN80I2C7xSNPR6pg7G2 P7HG91pV5CjIKd2QX+AIPxi3ZUdOUFNEatTGZD8apk3ZHs+P8Bv/HBCmCjkHSstKJQ 9AFXqut9HAW9HKIDgwef3njUOSXdMo9o5x2nKixnCldUAhulzSV8GxfOtWcKlXUQuJ IdHLvByIY0YFOFq6m20vg6XyheDRJRazXAbba01LByTKxRbg55/91BpOKAgyDXvnww 3fInN6QIzI4PQ== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Wed, 26 Apr 2023 13:29:38 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , , , , CC: , , , , , , , , , , Dmitry Rokosov , Rob Herring Subject: [PATCH v3 3/5] dt-bindings: usb: dwc2: add support for Amlogic A1 SoC USB peripheral Date: Wed, 26 Apr 2023 13:29:20 +0300 Message-ID: <20230426102922.19705-4-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230426102922.19705-1-ddrokosov@sberdevices.ru> References: <20230426102922.19705-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH02.sberdevices.ru (172.16.1.5) 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/26 04:45:00 #21166225 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_NONE, 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?1764235207950786318?= X-GMAIL-MSGID: =?utf-8?q?1764235207950786318?= 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 Wed Apr 26 10:29: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: 87795 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp140096vqo; Wed, 26 Apr 2023 03:32:41 -0700 (PDT) X-Google-Smtp-Source: AKy350ZRQCn6hmeQZlv/+YvI/HPhL96zU+AYe0MUvu+QueErqF3zUuniNllIQ8rOvVE2aX1cwfwO X-Received: by 2002:a05:6a20:9151:b0:f4:1acb:8b1f with SMTP id x17-20020a056a20915100b000f41acb8b1fmr15029529pzc.2.1682505161145; Wed, 26 Apr 2023 03:32:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682505161; cv=none; d=google.com; s=arc-20160816; b=Cu9tnDATbsgc9XiPof+N9d6C3FZyJRjqcQx/wSmYE6UY4oc2ExlCaxaYqdHr5qfZ+B VH/BOUoqrxe+ggOtINrfQxppF0SXF2kYj3Ja13bS3BOh3Iut71eFLhs5A162QZoqYsqc KYuA3Hw6KrAbzkXmLUtGerqUvyxE4wqGtQ2YvJwNKrVvzqL0BdFEygnT1uCbYEpyWYo+ zaNZRtndlBqO43Zz+vx8RZ+AKT6wVUNlun4cjjuoLzcVTsw/qd9uYHkP+Kn6F2YBRuBk BfFbZsl0OwGLGaHdcGCKRFbIXSYjgvp++x410rXU5I9CqDVvpvBxO9Q7R4rJ963cpfBp aaaQ== 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=izMKXdTFH1h2UBa+MY3F3v9dqaNkzDFsQICpQYJio5U=; b=hfscUBfY/Z79Ez8WxPX0oIdRSih9/z1FNrNd0uGcKbKdDOtjzIVYm+Hh4B13VBcnqM gj3KEGgbHgfmNT9ZTfTy9EPJbzgWjeME9NDqYywLbADUANpa2esNTHAbIUZPX3n+eX0q qpieQV8gNa6XLtaoa2va8p/PSYdY9UXMSTDQkgfoxWYPEw3k7WWlGuuXtLBzHIVgAaZr RLy3pFa9fIrUEObHf/OiHPD1L3CAceWQMrBXy378wnmOWz+jhYeGvGYlmIWKuKs8AllY V+qWJ7mr6wAdMIzf4CuPeIoAIMg4/gyf4qJfQPAebgKMfw38SeeJgLzmlptQIMfocoQk j69w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=O0GnZZ9z; 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 r17-20020a632b11000000b0050be2ca268csi15099912pgr.762.2023.04.26.03.32.28; Wed, 26 Apr 2023 03:32:41 -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=O0GnZZ9z; 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 S240396AbjDZKaI (ORCPT + 99 others); Wed, 26 Apr 2023 06:30:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239790AbjDZK3l (ORCPT ); Wed, 26 Apr 2023 06:29:41 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 661D849F6; Wed, 26 Apr 2023 03:29:40 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id BEC9B5FD7E; Wed, 26 Apr 2023 13:29:38 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1682504978; bh=izMKXdTFH1h2UBa+MY3F3v9dqaNkzDFsQICpQYJio5U=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=O0GnZZ9zfwX59nJxxCv6oiFrRX+yUPYkRcF03tMGorJ/agCjGbT1WAMK0D7Hbdw9V Gnc26l7ni5vSAj5ae+TFoNLs+++IBTF/oBbsJWN2sdePqoga2QBK9axNMiuq4cx2k6 bsySY6ooGYCbT0OxkOfAEFtGno+u1hTtOCnnnx3/DsLKOIpH66pFNCSxjyIa79nBsF ZrtnKx1VV+w5T3kKsdxu6C2nAXeg1+XmDLvt828UU3JYITw21g1akd2f/zHB2nESqA 7rG7crU1zx47UYad1CUNITlfJ2pqtvie5GtJhgqgobQZtdIaeuiZrF8y7DichHMx1s yTKmz/QGlSUHQ== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Wed, 26 Apr 2023 13:29:38 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , , , , CC: , , , , , , , , , , Dmitry Rokosov Subject: [PATCH v3 4/5] usb: dwc3-meson-g12a: support OTG switch for all IP versions Date: Wed, 26 Apr 2023 13:29:21 +0300 Message-ID: <20230426102922.19705-5-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230426102922.19705-1-ddrokosov@sberdevices.ru> References: <20230426102922.19705-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH02.sberdevices.ru (172.16.1.5) 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/26 04:45:00 #21166225 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_NONE, 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?1764234531532360151?= X-GMAIL-MSGID: =?utf-8?q?1764234531532360151?= 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 Wed Apr 26 10:29: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: 87796 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp140375vqo; Wed, 26 Apr 2023 03:33:13 -0700 (PDT) X-Google-Smtp-Source: AKy350ZlfvTRAKYjjOtVzewt38KWCaIQ8w0j5nN12XiwJv4LCKUCFpJCEO0R8KSFYHpxGxdaFVbz X-Received: by 2002:a05:6a20:748c:b0:f0:fa9b:d4c7 with SMTP id p12-20020a056a20748c00b000f0fa9bd4c7mr25933639pzd.55.1682505193058; Wed, 26 Apr 2023 03:33:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682505193; cv=none; d=google.com; s=arc-20160816; b=aPdPGzP6HksfT2cQhaFimK16+vR3iEsS5zn5yuXS74LAUXyv4+S1KJrZJGVVRJLbhD cgyJ0+0rvkAwBmNOCKY39Z12DHUhe0bZRgjO939p2a6SRcdcHQmgZ2Z46Jcm79bxj3Mt +Q8wcrlDDxnjIP5w0e438PNMXTZi72O0gCEAgK1ngq73gV16y7OihcwkVf45lOuiVHtu 8XHwlAVsgSSo+tHEM3s2E9WIlV3qoO3HJXU02Ip1LC6u7ZyGTsFtZ7QBhFQzAGQ8S9+f EU9b56o/Zc64MPMFMJsN52UN7eBFs0uQGAEu8x6prRwCa/Ol2ixqSLIa89fKMid5ySTi Sgkg== 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=4lHHCxkIlnUR0GNXGWVdUkMmB9fJMh5SedGakqeeYVI=; b=P9xcug2YPDkmVT5yd/pDEeB9oMuTQeJBZSoqI2nyTrcdhi58whu8me0hvw5mfDJ748 9KlJ3dTsh54bPzigEB+omZkQalkPBYxCoQVxucJy109csyoLzrNweh7oj5M6ttgl45fW TvXpJa8Nz6dGvt8q6rNqS5NH+rWPRD+ddvLRwsob1JvtQ/oCvKNfDWDvz6QdAPQZ5w2U xZSzoiVwyaIXoYEa7zplT8SIEO4NHbzVY+j/coiIlaoHfRVRyOnwCu/sx0xY1QV2E6uK WgUjxtIIxCKhjBC9jtO3jaO2FT4ovZ1jXxSJZ3Hg9C+utBZV6CoP4Si5sVijZFN+egQE dwUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=BE6Xe3NN; 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 v62-20020a632f41000000b0051b37c000dcsi16017470pgv.81.2023.04.26.03.32.59; Wed, 26 Apr 2023 03:33:13 -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=BE6Xe3NN; 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 S240511AbjDZKaW (ORCPT + 99 others); Wed, 26 Apr 2023 06:30:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240280AbjDZK3o (ORCPT ); Wed, 26 Apr 2023 06:29:44 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDDA449DD; Wed, 26 Apr 2023 03:29:42 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id E9FD05FD7F; Wed, 26 Apr 2023 13:29:40 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1682504981; bh=4lHHCxkIlnUR0GNXGWVdUkMmB9fJMh5SedGakqeeYVI=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=BE6Xe3NNGVrY40Kh9GMYS8/HS2NaAoNO2icJfHY+d5SLEeMRRBO6emtzmswN3h0yn GquNCBfF3VQmW2M5Ir6XPyAWjMpAgOYOfLEWS1LHUaQV/tsx+EJm23ch9kLx23u2aq kM9ePmuqyW/r2EvWNmjdxae0O9l4dY02rcR+yS13bkCbkHUYdefcDnZgePw5k9jVVR nfMH58iDE3RzXgmSi94vxab352SaLUqVHX8wyEeEVnpGPjK0QPZfOzu/26HXCdfpIO UofV61pCLVElSrFviaKgHxBbyJR5/FUv1AY9oGZwUvA4xMbvsg5Zuws6gDzJsTiqNp tNcNORqrFoeDQ== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Wed, 26 Apr 2023 13:29:40 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , , , , CC: , , , , , , , , , , Dmitry Rokosov Subject: [PATCH v3 5/5] arm64: dts: meson: a1: support USB controller in OTG mode Date: Wed, 26 Apr 2023 13:29:22 +0300 Message-ID: <20230426102922.19705-6-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230426102922.19705-1-ddrokosov@sberdevices.ru> References: <20230426102922.19705-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH02.sberdevices.ru (172.16.1.5) 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/26 04:45:00 #21166225 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_NONE, 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?1764234565687731604?= X-GMAIL-MSGID: =?utf-8?q?1764234565687731604?= 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 Reviewed-by: Martin Blumenstingl --- 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..5588ee602161 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 {