From patchwork Thu Sep 28 15:15:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Roullier X-Patchwork-Id: 146272 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3556537vqu; Thu, 28 Sep 2023 12:45:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHTwmVDnH8Na2NDrcCXDSgDsJSdUyRgJbZoJOWB41riJFCLemmttp9ZUUWQ/tgKeAFGNVVo X-Received: by 2002:a05:6808:d49:b0:3a7:26fd:b229 with SMTP id w9-20020a0568080d4900b003a726fdb229mr2082251oik.48.1695930327787; Thu, 28 Sep 2023 12:45:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695930327; cv=none; d=google.com; s=arc-20160816; b=IOxc/dsi38LntdPdNRhskQR/cK/xM1VDQ9BOi/EOalJgU5khkdThzAgFqW4CMknpgn R0iOApYDwIl8IMWvbIQ+DF4asUvBiJsod/36+yFieHkquQWIWARPhqSvbfQDQSHzJAyc 3DlOt8iyTwhGqO3BrBYASuOBEIsbAlN9kEK3SQ+IkDMzlLfBA0IpfshsXJa375r68nKp msWHVlqs3skWFdRbKvKFnV+BErqo/evYTP2t71cEmDI8zk6BUhHM3yOs6MCUPr4tSt+x d9pyDn7UW2y3Kal50dwyyMAS8u/7wkUIaEo30LTSE6mJbV7VS4eKqme63OdOPzb6IRDs Mi4Q== 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=tCZxZAAY+Gn9wAA1qw22DEBm15B9XqamItmDNiDWxRA=; fh=Nrq3/ZyqAmcldX4TnYQJDytRSUiD1vJeQNniXh+eWjo=; b=flcZrotjGBpCZdkqE+Io9Q8GPnRzJ/OdQyFl/HTrny+vT9hwRc43/DsZKmmJZA4XYI I/gnh/lb5J6r0YVkAOCxgBND7tU4u6DkY9jr0qlbBZZrIfLHOZZCAlmFIsnWzmtqeN6i hZmckrqzDeL7EMD25/glF/GkQrBn4NuFN6IL+b7kLoDeEn0vx26qBz7LxtpkkSlgkbrh kVK1FVrX0KCf79GeYDrOp0hzpGn584EFf1lS4HjR0NotFKWC4LFHWFg1P3XLRDlUo7w6 Sj99ugOos/F8/22tY5g5YXi5qk21fJQ5Yg/hQxvdE06diLPXA1OcGdb1EZDTa0VUB0Bp Raxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=iDG44OTp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id l187-20020a6391c4000000b005859baa2aa9si283996pge.567.2023.09.28.12.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 12:45:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=iDG44OTp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id B240E853EB6B; Thu, 28 Sep 2023 08:17:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232046AbjI1PR0 (ORCPT + 21 others); Thu, 28 Sep 2023 11:17:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231915AbjI1PRN (ORCPT ); Thu, 28 Sep 2023 11:17:13 -0400 Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 792BC10DB; Thu, 28 Sep 2023 08:17:03 -0700 (PDT) Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38SEDFGg029808; Thu, 28 Sep 2023 17:16:31 +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=tCZxZAAY+Gn9wAA1qw22DEBm15B9XqamItmDNiDWxRA=; b=iD G44OTp/pHo24LvyYBuT1ZE5vd50PYX9W2CpMr0QUJ8nXjcCX10MPTHKkEXNej7u6 kUMNqzRUqFaobG7b3GlCkOrdjOA7/S3U6qVcLwrsNdKcya68HrbY6eKSAp6sf0pg 5sYLFre2NZQbAcpNzj1Qz1JnPFBlnWdVmPJbkHYYbsH2UMi6Wb9JyibLKZiIsXQp zzLc0ekP4euE3TKOywyTsBjF3G5XChbZVNNAljnta2jtVUEaeMQOv1Bamz+v+j2I nk/7D0NaQTzlBAD7lXM+ojQwYUIkuTrrJhZlSwykEHFYan1xZ889QKQe9p8aoXzQ Q5/SWkoz62meKtsl1x4Q== 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 3tcq63cupd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Sep 2023 17:16:31 +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 872B7100057; Thu, 28 Sep 2023 17:16:30 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 7D1F224553E; Thu, 28 Sep 2023 17:16:30 +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, 28 Sep 2023 17:16:29 +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 v3 05/12] net: ethernet: stmmac: add management of stm32mp13 for stm32 Date: Thu, 28 Sep 2023 17:15:05 +0200 Message-ID: <20230928151512.322016-6-christophe.roullier@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230928151512.322016-1-christophe.roullier@foss.st.com> References: <20230928151512.322016-1-christophe.roullier@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.21.249] X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) 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-28_14,2023-09-28_02,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_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 (howler.vger.email [0.0.0.0]); Thu, 28 Sep 2023 08:17:44 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778311839153964594 X-GMAIL-MSGID: 1778311839153964594 From: Christophe Roullier Add Ethernet support for STM32MP13. STM32MP13 is STM32 SOC with 2 GMACs instances. GMAC IP version is SNPS 4.20. GMAC IP configure with 1 RX and 1 TX queue. DMA HW capability register supported RX Checksum Offload Engine supported TX Checksum insertion supported Wake-Up On Lan supported TSO supported 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 52106e0d7359f..a071dc6ffc95b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c @@ -537,9 +537,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);