Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3396608rdh; Thu, 28 Sep 2023 10:19:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLXcIfG8WEIRZS9KUXzBL6jsxxziplmT8qBhiubELkS96erzk0F1yUk63gAcVq+9GAC6GA X-Received: by 2002:a17:90a:e548:b0:268:10a3:cea8 with SMTP id ei8-20020a17090ae54800b0026810a3cea8mr1762903pjb.9.1695921570794; Thu, 28 Sep 2023 10:19:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695921570; cv=none; d=google.com; s=arc-20160816; b=L01zQRqsHvQ0067nj4Q4ouPKERuvTUGc/QvOWtTDQZAka8V4DbcZHjR39cvEs+4Uwg OxowkSGYWX2UvvCEIOrCDhSQGJdEcL5R1E5EbkYj3jyv3XeNoSYx0VxkTLDZeWWknxWN 4F44HsXLz0e06zAAxG6GzLk4fsYKEXySDpPUnXhxrp/wT1OL/cm1z1M0tp0zoLOBHwxQ bZ7JOYY/0aKFK6VWa5a3jAtAyFFHouf6L//9dkQw35OdYcdro9EeP208eLTM2FlOy8vX aKdMluPAdI4mXuBKxvol6azYo0y2jordVwmNgAF0zBsqP0zvPt78Tb7EJkgq+tf53UVB 42lg== 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 Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id lk15-20020a17090b33cf00b0027771ba9056si11394228pjb.133.2023.09.28.10.19.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 10:19:30 -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 8D125853F296; Thu, 28 Sep 2023 08:17:32 -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 S231922AbjI1PRZ (ORCPT + 99 others); Thu, 28 Sep 2023 11:17:25 -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 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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:32 -0700 (PDT) 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); -- 2.25.1