Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp928682lqt; Fri, 7 Jun 2024 03:02:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWLjx4lsgX5IbtEU3Mi66Biyc6FJJLHtJNYkO0LXz0QM31iIW9BAhxenZU4Em1KaDBTs0vKWFvUZkvw52ZZ9QdqGs0ZbzSxD78JRmILcA== X-Google-Smtp-Source: AGHT+IEMdylTs8vuuq93AxyHFDgWAmOlhuUlULK6Q3xGW5KBh+uc/uWStRVTgH/nOUYWRcCDdt57 X-Received: by 2002:a54:480e:0:b0:3c9:b9e8:de94 with SMTP id 5614622812f47-3d210d9adc9mr1876470b6e.30.1717754556260; Fri, 07 Jun 2024 03:02:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717754556; cv=pass; d=google.com; s=arc-20160816; b=W0kqSdEMkwAVKhRBOfrOiJ6gVRYb97dZcR/JY8YN8HXzQ0wMtJ6Czpl54eEKLvz9x5 mkw2DZ7Dbz2L2OWiNgTCVnVDvLO3YmO+NuNeW8PG2NHVBx/28sXq0Wlg9MQLolrrbVvc unBitiBIMoFqF+CIqdNgES1E3Pvz4wnyucpH2DJuzHA7F5bytikBpdhblL6T01yxVJHo t9J/cDiSRAQrb/4NHu8awfVW32zsCUz+C6zxX83njCHg7gUgrPt7R5WRX39aXekv1+7c ehA1wLFOjfJPQVtrpIAI8w2S1ffLYATa3iufXLSgMzbrCuEbUhKD4Z9o3tLsWPAchUiq 7Zig== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=1C54Z0DoOr3DgKzs0LAeK461GnGKNlUpIDnohi91J2c=; fh=PNVS6hneBIB5DuUKcqXTZxY2dQy/qm89zdYDxH+oLxc=; b=qVB5OMCvMrb9R4zDFv4P2PHox+yZfWkoZhXy7geEt0iHftx1u69o01nbFR5NEzTOu8 BAVqb7aA5BBeEcKwIzcMV6m+jPFfRNSrBJDsC4baa4/aiWkejTLiZL9LZrFuIod13Ipv ivc2wZKcQTnCTAjJ8MAFCw9gSTlV4lMedQQJgy3gmYQHemYvcu/INUPfnKYl4n/oXp11 M1jLDZaTZ7G9z8pF5mjTqYWfT572Air20dEuBioZTXDkCazLRo0UuhnxezVcPE7Sy+lH qO86PDpP3JQ/hSLJUB8lNrOo2y+OzGJu2MPgcBQuQGoa645EuwqdzynECW25gfSWKEYL jeBw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=PHFZ1N+t; arc=pass (i=1 spf=pass spfdomain=foss.st.com dkim=pass dkdomain=foss.st.com dmarc=pass fromdomain=foss.st.com); spf=pass (google.com: domain of linux-kernel+bounces-205772-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205772-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6b04fa23d59si36099606d6.491.2024.06.07.03.02.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 03:02:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205772-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=PHFZ1N+t; arc=pass (i=1 spf=pass spfdomain=foss.st.com dkim=pass dkdomain=foss.st.com dmarc=pass fromdomain=foss.st.com); spf=pass (google.com: domain of linux-kernel+bounces-205772-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205772-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A86781C22F7D for ; Fri, 7 Jun 2024 10:02:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F1E9C15DBCE; Fri, 7 Jun 2024 10:01:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=foss.st.com header.i=@foss.st.com header.b="PHFZ1N+t" Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B7CA15CD7D; Fri, 7 Jun 2024 10:00:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.207.212.93 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717754460; cv=none; b=bDvxkXF9tdAGIG6q/dJFN8U07hUc7eOtY4cnMlSFvyxNvbmx4GgqbcByxNhlth0cmompuV2Ew/lyV+/LeL0U1O+OpEJgjb77gnqnyPIAn7VXtB41Pu3y+gaLmP5GP7PUfIenRKK0nzFYkH526CrtFIEt12gNSSR5RMk6FARmGvw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717754460; c=relaxed/simple; bh=Goiu04tc2COWbv3MBLvmACwB631+sw/JwUriPCVXLz8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TbAR1HsYI9881Yi6keUf5ULK3SPtWxWVUXPSodVvYSVBLTNi7ZIaUrHVNVBESTtZcjJ1Zjzy9cF7LXGDv6pj905g94c7qBBhrJ3ioxPppDt2otK7gA4/H9ONzUP+CUPeXEsdJU/XtlGLLQcL7yhckwHu/kVloxsmEyLM/IqXLcw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foss.st.com; spf=pass smtp.mailfrom=foss.st.com; dkim=pass (2048-bit key) header.d=foss.st.com header.i=@foss.st.com header.b=PHFZ1N+t; arc=none smtp.client-ip=91.207.212.93 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=foss.st.com Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45791m44009520; Fri, 7 Jun 2024 12:00:35 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=selector1; bh= 1C54Z0DoOr3DgKzs0LAeK461GnGKNlUpIDnohi91J2c=; b=PHFZ1N+tQh5vcn17 WHpZJim58x8PWQgdZ1UQRkgqLDbUKZsex4t61JprCKiICTCy+c1yP8q4vqKbtXCt yfdYwUaxgRGuPLtjxkBi/SHfFZOVa0Qz0SoW7VjE+GLBGQb2msqmxvCSUs0hwKfP udJLmZR607oVDD8J+TpqLErL8XqSUI5l/AXANjwYYEMySKNEDjYEkRpGIEzSmvU1 133X3d1u7NjqJRAU80D389OxRwMrtYWHnhrVZ/Jf1XdFNYZ9c6zl9bXjRMiUB37z p4igdrlmFVg3EeZ5m1jgHNNLdXAJ6mE7hVATMyJtaeMYck1xFFkvCEBDPu7oJYhq 5xsRrA== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3yfw91swjm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 Jun 2024 12:00:35 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 1B38B40048; Fri, 7 Jun 2024 12:00:31 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 450B4214D13; Fri, 7 Jun 2024 11:59:17 +0200 (CEST) Received: from localhost (10.252.19.205) 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.35; Fri, 7 Jun 2024 11:59:16 +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 , Marek Vasut CC: , , , , Subject: [PATCH v5 08/12] net: stmmac: dwmac-stm32: add management of stm32mp13 for stm32 Date: Fri, 7 Jun 2024 11:57:50 +0200 Message-ID: <20240607095754.265105-9-christophe.roullier@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240607095754.265105-1-christophe.roullier@foss.st.com> References: <20240607095754.265105-1-christophe.roullier@foss.st.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-07_04,2024-06-06_02,2024-05-17_01 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 | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c index 96ba7bc73e823..064f73cbe3b45 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c @@ -104,6 +104,7 @@ struct stm32_ops { int (*parse_data)(struct stm32_dwmac *dwmac, struct device *dev); bool clk_rx_enable_in_suspend; + bool is_mp13; u32 syscfg_clr_off; }; @@ -224,11 +225,18 @@ static int stm32mp1_configure_pmcr(struct plat_stmmacenet_data *plat_dat) { struct stm32_dwmac *dwmac = plat_dat->bsp_priv; u32 reg = dwmac->mode_reg; - int val; + int val = 0; switch (plat_dat->mac_interface) { case PHY_INTERFACE_MODE_MII: - val = SYSCFG_PMCR_ETH_SEL_MII; + /* + * STM32MP15xx supports both MII and GMII, STM32MP13xx MII only. + * SYSCFG_PMCSETR ETH_SELMII is present only on STM32MP15xx and + * acts as a selector between 0:GMII and 1:MII. As STM32MP13xx + * supports only MII, ETH_SELMII is not present. + */ + if (!dwmac->ops->is_mp13) /* Select MII mode on STM32MP15xx */ + val |= SYSCFG_PMCR_ETH_SEL_MII; break; case PHY_INTERFACE_MODE_GMII: val = SYSCFG_PMCR_ETH_SEL_GMII; @@ -560,12 +568,24 @@ static struct stm32_ops stm32mp1_dwmac_data = { .resume = stm32mp1_resume, .parse_data = stm32mp1_parse_data, .syscfg_clr_off = 0x44, + .is_mp13 = false, + .clk_rx_enable_in_suspend = true +}; + +static struct stm32_ops stm32mp13_dwmac_data = { + .set_mode = stm32mp1_set_mode, + .suspend = stm32mp1_suspend, + .resume = stm32mp1_resume, + .parse_data = stm32mp1_parse_data, + .syscfg_clr_off = 0x08, + .is_mp13 = true, .clk_rx_enable_in_suspend = true }; 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