Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2694304rdb; Fri, 22 Sep 2023 06:10:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnTjvk9k88rB27Q+kAuYrB/kVSOna/r4nUnMB7ho6kNGMImmaQ8ZIFrRlKWuTVFj/ig8GA X-Received: by 2002:a05:6a00:1893:b0:68e:25ff:613e with SMTP id x19-20020a056a00189300b0068e25ff613emr9123977pfh.3.1695388256133; Fri, 22 Sep 2023 06:10:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695388256; cv=none; d=google.com; s=arc-20160816; b=O3Hy5ABhjUPoTT2mmarhSiKHTmtA2bBktGo8zvyl/4LH2pLikIlGdCEYrjcYq/BQsg Lwi3Xu7E2HX+kwWRBVvMx/Ej+cAZSdv6ItZ9S9Jq0+7ZZ9xJVmlXkFBRA76F2obWacz6 bFfj0qSylYfQ9Tlsc7m7MeEz7QOQ6ad27NffMk3ZVNFS4Ujrt/8/grfZ7b0yv/1IP7bv 7oBemzkOGUTGEbS27Xuq2EaRFBUxqTs0oJeUGbjj0fqZBuZ5+qXAVzmU21hP17zpn12i 8lPys6QAOJtzrJLM2XOT9snTFxOa7OIKnz1pdH2IsWLWqWcuFOYQp18enkfpZSDLHOnz y5zQ== 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=/9F9IPv8bKefYH1bhnlKnLSsSeMujGUyOaDFDQ+NMFI=; fh=Nrq3/ZyqAmcldX4TnYQJDytRSUiD1vJeQNniXh+eWjo=; b=M8hL2RPuezRj0edcp0B/XPAIOXAEfDH0yKlrjdR2HJzFpq5WL4mbe+tH9BHpXjJqGG +6aJkd7/SwU4Lw74hE3qe/wEjtUa0z3+pojP4fG5jD6oXHIyHL1SZMXI9XhB2OTairsz FCITmyhQdzC5rBXDED0yV20mmNDKhxccAGHrog0f3wBkjfrkQ4Ds1KZ62nUE+pZBzR7y rD45B7MaPOCezBc48Hm0dXHpK/hISp9wuKxzVCmhjECTu3vTBQsmL2GxbtEr7k0w9UNA fMt9mgxzkb9Hl007VzcGRzA6LWHndPvbNaATJiyAqpAOev345/wG/zsqyRR1cFF37/P6 qiLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=XpaZmfbS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id p39-20020a056a000a2700b0068e2dadcfc3si4097980pfh.48.2023.09.22.06.10.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 06:10:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=XpaZmfbS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id D43CF8331E28; Thu, 21 Sep 2023 14:17:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232796AbjIUVRP (ORCPT + 99 others); Thu, 21 Sep 2023 17:17:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232649AbjIUVQH (ORCPT ); Thu, 21 Sep 2023 17:16:07 -0400 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E973D1FF7; Thu, 21 Sep 2023 10:09:28 -0700 (PDT) Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 38LBWej4026620; Thu, 21 Sep 2023 17:06:51 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= selector1; bh=/9F9IPv8bKefYH1bhnlKnLSsSeMujGUyOaDFDQ+NMFI=; b=Xp aZmfbSHUgfgOttnVqy92Ub18iTgJWNcqmKeZEt4PMWWAIACo+JB2HgyTxKIfgkBq wbwRmsB7ATJ8PRtTVDdUamo8MCMdK9dRKCgvNba338wHBhsBzeD9xVivYSxs9ri0 e0D/dqVyR6QCSjkZpKPXJ+P+ie8Cbdybq699LVuxFjRIPNAmaOJ61A1r921+ZlPp vpeX0Exln82csHepTZCNtYEbkgrZDeR3C6GX0Aw/4UVK0QD9xr0+QFEN9wL01iQ4 5iIqLzexe5GT8NC+MlfqZ0vVsrEi7J/jJ4eqaAyOFe59Fx+MDAYKQA/Jh+/dB0zl BiXNn0S6O3pxTyKufJgw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3t53px4sqy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Sep 2023 17:06:51 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5A216100057; Thu, 21 Sep 2023 17:06:51 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 522D4252250; Thu, 21 Sep 2023 17:06:51 +0200 (CEST) Received: from localhost (10.201.21.249) by SHFDAG1NODE2.st.com (10.75.129.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 21 Sep 2023 17:06:51 +0200 From: Christophe Roullier To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maxime Coquelin , Alexandre Torgue , Richard Cochran , Jose Abreu , Liam Girdwood , Mark Brown , Christophe Roullier CC: , , , , Subject: [PATCH 3/7] net: ethernet: stmmac: add management of stm32mp13 for stm32 Date: Thu, 21 Sep 2023 17:06:18 +0200 Message-ID: <20230921150622.599232-4-christophe.roullier@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230921150622.599232-1-christophe.roullier@foss.st.com> References: <20230921150622.599232-1-christophe.roullier@foss.st.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.201.21.249] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE2.st.com (10.75.129.70) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-21_13,2023-09-21_01,2023-05-22_02 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 21 Sep 2023 14:17:15 -0700 (PDT) Add Ethernet support for STM32MP13. STM32MP13 is STM32 SOC with 2 GMACs instances. GMAC IP version is SNPS 4.20. Signed-off-by: Christophe Roullier --- .../net/ethernet/stmicro/stmmac/dwmac-stm32.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c index 762c5256398f..0f843ab3822f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c @@ -584,9 +584,30 @@ static struct stm32_ops stm32mp1_dwmac_data = { } }; +static struct stm32_ops stm32mp13_dwmac_data = { + .set_mode = stm32mp1_set_mode, + .clk_prepare = stm32mp1_clk_prepare, + .suspend = stm32mp1_suspend, + .resume = stm32mp1_resume, + .parse_data = stm32mp1_parse_data, + .syscfg_clr_off = 0x08, + .pmcsetr = { + .eth1_clk_sel = BIT(16), + .eth1_ref_clk_sel = BIT(17), + .eth1_selmii = 0, + .eth1_sel_rgmii = BIT(21), + .eth1_sel_rmii = BIT(23), + .eth2_clk_sel = BIT(24), + .eth2_ref_clk_sel = BIT(25), + .eth2_sel_rgmii = BIT(29), + .eth2_sel_rmii = BIT(31) + } +}; + static const struct of_device_id stm32_dwmac_match[] = { { .compatible = "st,stm32-dwmac", .data = &stm32mcu_dwmac_data}, { .compatible = "st,stm32mp1-dwmac", .data = &stm32mp1_dwmac_data}, + { .compatible = "st,stm32mp13-dwmac", .data = &stm32mp13_dwmac_data}, { } }; MODULE_DEVICE_TABLE(of, stm32_dwmac_match); -- 2.25.1