From patchwork Thu Sep 21 15:06:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Roullier X-Patchwork-Id: 143065 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5255131vqi; Thu, 21 Sep 2023 18:29:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2x98CLkGEqZaaO6jQMp8on3xaOvQ4sfDR92uvuVOE4RYBZNumI6y9mNqRoYdWcCCFwOsR X-Received: by 2002:a17:903:2581:b0:1c0:6e92:8cbd with SMTP id jb1-20020a170903258100b001c06e928cbdmr5648005plb.28.1695346161650; Thu, 21 Sep 2023 18:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695346161; cv=none; d=google.com; s=arc-20160816; b=oxyCdTzKIIeYu82ex2ogXLIE3WCfDDzTbpbfhagNApBsEZVbt234YnKQ6OvjTIpQHp +stmU6t2oTX310snSTaYK+fxgbOGZgaU+wwyZHrvHs33BaHIJVpwkiw9WANzUmIw/mzo 0VuV8ETCeYi+ERp7MMPOvuvhAWZynXBVjmvgGo/3dJshz72mtH/6dYXUxe6YvGSkaCZ8 GOUsu3dFgUaPLDFiMY4HK70+t7cFaY8HeQC6CT2zJfbPPYPKvikjAKEoLXxHFrwzU+MP WsBN6jwH561zz2FeserdooTd+/Yy0E7vz0MOMWTTb57LQqsj3FAHGXz8s/+9puA9g7uW 9yKA== 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 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id u18-20020a170903309200b001b9e9b21249si2459060plc.649.2023.09.21.18.29.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 18:29:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; 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 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 44E73825A8EB; Thu, 21 Sep 2023 14:18:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232424AbjIUVRP (ORCPT + 29 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 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=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Thu, 21 Sep 2023 14:18:04 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777699296309570158 X-GMAIL-MSGID: 1777699296309570158 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);