From patchwork Thu May 11 21:04:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 92849 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4667996vqo; Thu, 11 May 2023 14:09:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7qsslNRwYkdww5hnNQ0U7fjPzPWZdkXL2nh/pgnHwCMUjZNE3lWidnrrmyCwQ5yov5ieAy X-Received: by 2002:a17:902:d902:b0:1ac:482e:ed4d with SMTP id c2-20020a170902d90200b001ac482eed4dmr22949405plz.18.1683839346076; Thu, 11 May 2023 14:09:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683839346; cv=none; d=google.com; s=arc-20160816; b=YZ6+k25ImL7jUJgPznwpOFQCfQ66IG1RVinP1DTS0mvg0zPVaviFy9DtyDM+mmpkF8 DlwF9+tIJrR+HbeNtGkF3mqZMVORKjpM+pwtPs7CzePGALmD4AOFMEiu0671IS7a8MoG t/DJ2BqheRD5s3+P4GdjMooE0HgBKsi0q9jdYFQe8143B6JfLxJ2MtmU4HccBE+8SFT+ 0AE5Wz5WUso20Nre8K6/U+7wlVO8hUsEpjrGT9SdCe3MsbI3ZuwlU42guinLYO61qb0A HE1DzORtE/NUydY62DDdTcDrLWLGFhUYWX2/AdIOJJYP8tJkgXvCK6qmePqP4wOGWQsC ugXg== 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=cNgexytHsdSK0EYcMzfDxg1MwXMWuaSZF2BPGnQoLGZSA4TZpF5KVXlNnQwG//jMQ2 3mdOLsqNvDVc2/FN4XHUse/307I+T1RsLLZJDAPE8QYfqWTU1+/CkTnuPHQti5DowI9V 4yirPlnZI49BaQ1d26T6i+vLXzuEHfmbK//pxOXH6MRLc5gZfOYE8rhMMd8qx1/HRb8e MOtbAnNnNkQ1kYEJfTo6ETDPpbDDkh6wt7y9UyfnAfhWWeN36TbxtTIraS65BYuxknNG 5KqGh7GGy8y004PqTzUDq9e2FbIjDg/1t/vkxCBpoURfmPWi3G4JvhAEvImOlgEm5qAD D76Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=oQIuj2vp; 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 u12-20020a170902e80c00b001ac813bbfb4si7940249plg.203.2023.05.11.14.08.51; Thu, 11 May 2023 14:09:06 -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=oQIuj2vp; 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 S239291AbjEKVFV (ORCPT + 99 others); Thu, 11 May 2023 17:05:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238768AbjEKVFM (ORCPT ); Thu, 11 May 2023 17:05:12 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6B357DA8; Thu, 11 May 2023 14:05:10 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 54D6B5FD11; Fri, 12 May 2023 00:05:08 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1683839108; bh=eyzCCsK01f/afWykUeqT1z5S763OYcMrDYYa5HTJ5Mo=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=oQIuj2vpkx5n8bqAHoIgF/CTBL5luo6qnvBo5k3pSedhKOsAONQzooa0OXPTqgxHq dUUIa9RpShK9ZWLEn4u+c4L8LTBymyNEUFBALjW7Uz1UHbvYD0ohVp+Q0YDhrrJY/D NTFC89R4NnnzAakQVwKRTC1NCB4u8bTt2Sy4LGuuw1S3lZA1edJgmhty+7aDZDPw/D ZruVhOh5OMP7XhJcX59tOs5Q9Cry95TBr7lxmojPT6kJmRauNalrkZNJR7IDz9u+7Y uHmbigz2hbQyr09xbEm4TJMp9V7cr70V2iyFfhv3TLOvU3ox3POnSKj9kPTE67TsuG nbkDWyvynR3nA== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Fri, 12 May 2023 00:05:08 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , , , , CC: , , , , , , , , , , Dmitry Rokosov , Minas Harutyunyan Subject: [PATCH v4 1/3] usb: dwc2: support dwc2 IP for Amlogic A1 SoC family Date: Fri, 12 May 2023 00:04:53 +0300 Message-ID: <20230511210455.6634-2-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230511210455.6634-1-ddrokosov@sberdevices.ru> References: <20230511210455.6634-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/05/11 10:21:00 #21259776 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 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?1765633526194066311?= X-GMAIL-MSGID: =?utf-8?q?1765633526194066311?= 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 Thu May 11 21:04:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 92850 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4670774vqo; Thu, 11 May 2023 14:13:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6PEM7UeVOspH8cT6zNDPaXRf8SBWbl3a/+pdM6IDZrB+HoAxCZ+2J5faJ+6t0EJvGEJTL5 X-Received: by 2002:a05:6a20:12d0:b0:102:f744:a708 with SMTP id v16-20020a056a2012d000b00102f744a708mr9189776pzg.35.1683839624479; Thu, 11 May 2023 14:13:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683839624; cv=none; d=google.com; s=arc-20160816; b=IP/SLMul2KkvSIew2TKw2mmHG4Lky24MiOuL+ivJZ/hXD76KfsXDSnHHt1nsFFrCQX fMgNhJ5oBcHuxjFENJTzwHDrAkrgUk+XX3vaKGyrbrhdIQ3Rb+2O7k8R5htg4AStGO5c s2h9beMyRiutdp7745dloFi/M1n84+2RgO1M4boxB9126dJ0OTqIpceaoewbEn/4rc5t hZPgISjfBcgo4DBmevfgwj/WV5mpdSf3UHHmuEI00GSPtv5eEkhXih9XXmnupD5D+Wat PPNy0uHyNSrlRAt83wiAprhSWKuiFPKIcx+gAXPUsH7IYJ2Y+EIlTsS8hWO40H2kXicu sx9Q== 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=a5OUZ6lZL07p+y7H7DtcwHsUdR8eNgjKq4md5ZMVz2KhnN/V3PH9xkPe/aMZABswlV kSuRIY2NnvdsM7wRPomykB0jwCZINyVscIohNUcYSqfV+LlqKv7A+eJZ+PzW2sBMo4i9 X4gc2tE1d+sQ3iwOWgQ+O4UwHTflb1DFKsa7ADGf6tmZtv3nfVtNaTSkZ/leYSc6p7G9 gYp9l/080C412H0tHmQBJ+6/gL6YsjEqD7+91l6it7Js0SyLzKA/zu+AI2ePYzzYuY++ lBnwOsc/NKX4fQvSJOtDleSJoj1KVvAH5+k7O26NQhCFJj4iElT1cBBwc2RidKN4wxac LrwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=NpXc+JAq; 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 t20-20020aa79474000000b00640f04eb325si8535114pfq.229.2023.05.11.14.13.30; Thu, 11 May 2023 14:13:44 -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=NpXc+JAq; 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 S239033AbjEKVFP (ORCPT + 99 others); Thu, 11 May 2023 17:05:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238051AbjEKVFM (ORCPT ); Thu, 11 May 2023 17:05:12 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3969729E; Thu, 11 May 2023 14:05:10 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 112885FD15; Fri, 12 May 2023 00:05:09 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1683839109; bh=d9FEepOf44U9WlSTkZRyE7W3kPgjD/3/5ttgBCiHj3U=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=NpXc+JAquzliIizVSYH5/0ly7V9axiK8/Gm/G6t0/wFlmUhTnHTxtryYcDN/D6M9g E0t8BzNMcoF/Tg37/rku5F4YXqQwsHtpEUYpNFibhpklEaUjJgZMCkvpKBSsN5yuNA vdpkTy00dJVFPWWVz3P0gtAB5dlF7foWw0i7g5Q68GMsJQsH9Jyu2QczqeXTSYLDHb yiNjmtlTqMqjmGk6NreLJ1JWlsuk1phnbZatvExflF19te0P4bB+egN1nPPTqekhJD vuQZeHaVbayjcRkbc2VybkPWuSCZsn5HWS/hFDjJt3Q1rgVl7QHB2fmUlL80DTnycf o8HQZ4Sb8NagA== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Fri, 12 May 2023 00:05:09 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , , , , CC: , , , , , , , , , , Dmitry Rokosov , Rob Herring Subject: [PATCH v4 2/3] dt-bindings: usb: dwc2: add support for Amlogic A1 SoC USB peripheral Date: Fri, 12 May 2023 00:04:54 +0300 Message-ID: <20230511210455.6634-3-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230511210455.6634-1-ddrokosov@sberdevices.ru> References: <20230511210455.6634-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/05/11 10:21:00 #21259776 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 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?1765633817842588916?= X-GMAIL-MSGID: =?utf-8?q?1765633817842588916?= 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 Thu May 11 21:04:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 92851 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4674351vqo; Thu, 11 May 2023 14:20:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4GWryVcf8emCXS2j4rotii4p+PMM0/4eXwraHGaRLCakbTqhryUWir5vjQFwr9tcFr6WvS X-Received: by 2002:a17:903:444:b0:1a1:b440:3773 with SMTP id iw4-20020a170903044400b001a1b4403773mr20995360plb.27.1683840041258; Thu, 11 May 2023 14:20:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683840041; cv=none; d=google.com; s=arc-20160816; b=aYkAK0hJQVgKCV7gi3aaxfOQpI67/UrHr0+g1ZUKvrywElNFcqKDFwapPN5WuGtrn0 ECPZXXWlqe+4yvNP3fT0cDY5NC1ArMK0TQQQ250wZi07HdWJYCoIVVHV3t6XVC+BUjdT Ilea91MKcT3JNd9sUcfCUJoL8+hargZNQgoZeuSjrVEy9SjKXawjMBWZ+ZSFE6Ju/mG0 cCK2wrGOZHeQaJZg5T33jfUTbpEu/U8SCKT5zSQXj3ZJRKtdCpe2Lq+aXhGWwLzBVx7Z v6ZZhVZ7jliWVZjFCtxNtV44L2cxRA+vNF6uz3WuGYOrB5Tvow5cCcL9FP4MhoSY7X6T v9ug== 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=dTHk+inECewBrGmfF1/L7UIRt/tdCtwgawkvnCaB36T7Uf7+pZzhVRnYzl38Imp9Fv QwMQirpkTHXxLN6u7kLIfK2bsnJywXYacoQOIKY2aSCfTiLNsbKsW7lHKF+rPVbs+6UQ beNbJ4daulBpjtJzZRBYVSQWsqqZn1TwAx3nvN+TBLuv7a1IXUPNsIuRU65At4xnAGKX 2PwkxjPpbAC7Eus7u5Nkjzb6l3gD/WQjjEmYUG3tocYVq/tHpijZu9ej0pDjP7cYN3vR t+mzz3dkjBNwHMQRy1VxM/ycSO+52CDsfFYLIhSc/5IEeIiuaKPt7fWcsdACMNndXUhH JEjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=lAqWEQ3P; 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 h7-20020a170902f54700b001adc5bc4d8asi2922912plf.572.2023.05.11.14.20.27; Thu, 11 May 2023 14:20: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=lAqWEQ3P; 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 S239323AbjEKVFX (ORCPT + 99 others); Thu, 11 May 2023 17:05:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238792AbjEKVFN (ORCPT ); Thu, 11 May 2023 17:05:13 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2A3F7EE9; Thu, 11 May 2023 14:05:11 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 2567B5FD62; Fri, 12 May 2023 00:05:10 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1683839110; bh=izMKXdTFH1h2UBa+MY3F3v9dqaNkzDFsQICpQYJio5U=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=lAqWEQ3PMUY37Xoo9RjMkqSYFW71Ex4lEIV5r5bPkbSm3VvjG6VN21slRxo3EtFPn NdCJ9UsMt+lb5YdHQLxs9aERJ/MIwokQFNHbCr+pQ5AKLS5NXKbUREgi0py/ifPm5n nV0vIAh783Roh1WO6WU4OjiXjxPCHLNhSNQbeFcdmJCs7H/AehdA0l3dgLy6PWjVm+ U3TIRhTuxct1FCuElre23kqogWOUp+7mUkZ4gi9CiBF3KNeho4wJv/TsKP8CYJlm5F aHCBdCx9cBFt5nMbdIlLeAyGEIE0cvEMHQ4npapWjZIomKzH1uRD0vNgVJaz0T23t2 0pBkT95bf2kLw== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Fri, 12 May 2023 00:05:10 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , , , , CC: , , , , , , , , , , Dmitry Rokosov Subject: [PATCH v4 3/3] usb: dwc3-meson-g12a: support OTG switch for all IP versions Date: Fri, 12 May 2023 00:04:55 +0300 Message-ID: <20230511210455.6634-4-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230511210455.6634-1-ddrokosov@sberdevices.ru> References: <20230511210455.6634-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/05/11 10:21:00 #21259776 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 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?1765634254834053803?= X-GMAIL-MSGID: =?utf-8?q?1765634254834053803?= 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);