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",