Received: by 2002:ab2:6486:0:b0:1ef:eae8:a797 with SMTP id de6csp817294lqb; Sun, 17 Mar 2024 07:53:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWySvTTGnNiNrMBRYOaKrzFQ0ta3sZGKqMRtaoGBkxPqCAbmAiurg894+eBBuun2WhwhvSBhmEF3GqL/DRlZFRdTNAZstDMcsyybVvJ7Q== X-Google-Smtp-Source: AGHT+IHrtgRn29EhRyqOkrQ6m7syHDZ04Bl3D+GMHY2WfEESXhBrkpJTUNogF1fcaid5kxVl0UPS X-Received: by 2002:a17:906:6a19:b0:a46:af3e:dedc with SMTP id qw25-20020a1709066a1900b00a46af3ededcmr1908199ejc.40.1710687221556; Sun, 17 Mar 2024 07:53:41 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id v9-20020a170906564900b00a430f28eb9fsi3560435ejr.323.2024.03.17.07.53.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Mar 2024 07:53:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-105417-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XJRNigLu; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-105417-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105417-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 11F671F21304 for ; Sun, 17 Mar 2024 14:53:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CFB111C2BD; Sun, 17 Mar 2024 14:53:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="XJRNigLu" Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF1CD1BDE6 for ; Sun, 17 Mar 2024 14:53:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710687206; cv=none; b=aGoW6KePM+oEcg6CRiO48+dAQzxFlNQ+uJKcZVWit5oGS85Dw6RzWvtyiiS0BAiYG5N2U/NdUGw4c5Fn4qMEGn6Dk30HJPj3M1nqB+gt/9joLl4LR2IYIbZASmqrlE0OUMe8HutnGNCjueeLY6ZdL0QOQcizhVD9xHzMO0a8XVs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710687206; c=relaxed/simple; bh=umAmPDRWxrO5hgJRsHXj7JfLjCRC32nO7T4dfbUql9A=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=IFNRT8ktxpdVOG7ED0H4I0a9jlxeNbXqQEiySndSl9MkeVtr94oll9opx01ukbLe91G/+JFKUkSaiRyvO9qU/uvicDdiK5q69ByEvKEQToagC3S84iBiTfY1rZg/cnoiHp6Curf9EOkKqnx+wfD8kT0a0NkCS7gu1Sxe06yipf4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=XJRNigLu; arc=none smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a466c85ae5fso93860066b.0 for ; Sun, 17 Mar 2024 07:53:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710687202; x=1711292002; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=m7ImUJS52VyjYeLxcluUDeQFte9FFBlkrSYtgWQ8yXw=; b=XJRNigLuE4+w763pC/tkXJvAl6rFZzZzZjNxAWcgf+ZNmYEMSECLS9A2gkvZlUClwd te0y94fls1W27Z6oBnP2B7LLLqa+C5TmhaC8v07ocfu9ZkLYhmw2qjxTcBDEjjstUGHH c5UdrynfPl3PfHaFeYsdPJuXHRJVGXkiLKpbKS70M0A0CyUY4RVynd+68t1F8EjAkASY /5lh381/1rJOG2MTaZ5dmjuSwxdld4kFC18vzbOG2px+JppSM7Nbm3jlBRtp1qqjmA4A EmkE6b9yDbvKTFFXJQb5KfFvYXyHOGl6i7IaZy9WSGA/STLlvmAj6j9uaYIn+pPuGbEl SrnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710687202; x=1711292002; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=m7ImUJS52VyjYeLxcluUDeQFte9FFBlkrSYtgWQ8yXw=; b=gKJMyQn62xwA1sbVBGHBfX5nSgv3w/EHmYXwDoUmzU+pSRgzCbNbhdP20gGX6nnuwr xoPsTS2NIZgs88D8XqrMc9BP0GL41sSfTN0NqZGQqk0cCvHw/z3cU5Nd9MwD07DBpJsZ y9x2y+FfhTA4jai8gSeESPoGAqDArfqBq5NuNdquo0i5eCPt3Sav7XdFQ2sQ/8aGiqvN 19gjeEl3X/zZ+ty8oV3sSVR3v+IkU5gC8h9BTLrplfPtR/sCPS0MdCTmt9Wfe7WaKDZK IBwwa/Tpvf8j6Gy2Fpk7LEh44mnGR4QRYposY/Ejo2BS5E01DjFWoi+6jlrgvEc6bobF ZU0Q== X-Forwarded-Encrypted: i=1; AJvYcCUAOsLZzJfdoAtp9IIYWO6z/EO+TVw0Ko12wCVKda/g6na+EFK69qjesyGFTydTivsdEEsPg4qOs1OeOU6twwFGXvhYrZikC7nEJ0M+ X-Gm-Message-State: AOJu0YziEWl82oIwVRqzfT7UKbfG2pMuPYIu7iTXj1+Oy+PE+/OB2OgO cuXQK2qjILJG6HRzPajo5/J5YFW2bKMHU+BtKTNb0+JadtmG+4+BERhewixxjRs= X-Received: by 2002:a17:906:831a:b0:a46:a10b:8806 with SMTP id j26-20020a170906831a00b00a46a10b8806mr3048939ejx.13.1710687202489; Sun, 17 Mar 2024 07:53:22 -0700 (PDT) Received: from [192.168.1.20] ([178.197.222.97]) by smtp.gmail.com with ESMTPSA id jx25-20020a170907761900b00a4661f0f1e7sm3822898ejc.205.2024.03.17.07.53.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 Mar 2024 07:53:22 -0700 (PDT) Message-ID: <2316e61d-ad7d-46fb-9f55-67964552855a@linaro.org> Date: Sun, 17 Mar 2024 15:53:19 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/3] net: stmmac: Add NXP S32 SoC family support Content-Language: en-US To: Wadim Mueller Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Chester Lin , =?UTF-8?Q?Andreas_F=C3=A4rber?= , Matthias Brugger , NXP S32 Linux Team , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Michael Turquette , Stephen Boyd , Richard Cochran , Andrew Halaney , Simon Horman , Bartosz Golaszewski , Johannes Zink , Shenwei Wang , "Russell King (Oracle)" , Swee Leong Ching , Giuseppe Cavallaro , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-clk@vger.kernel.org References: <20240315222754.22366-1-wafgo01@gmail.com> <20240315222754.22366-3-wafgo01@gmail.com> From: Krzysztof Kozlowski Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/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cY qc+rJggwMQcJL9F+oDm3wX47nr6jIsEB5ZftdybIzpMZ5V9v45lUwmdnMrSzZVgC4jRGXzsU EViBQt2CopXtHtYfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <20240315222754.22366-3-wafgo01@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 15/03/2024 23:27, Wadim Mueller wrote: > Add support for NXP S32 SoC family's GMAC to the stmmac network driver. This driver implementation is based on the patchset originally contributed by Chester Lin [1], which itself draws heavily from NXP's downstream implementation [2]. The patchset was never merged. > > The S32G2/3 SoCs feature multiple Ethernet interfaces (PFE0, PFE1, PFE2, and GMAC) which can be routed through a SerDes Subsystem, supporting various interfaces such as SGMII and RGMII. However, the current Glue Code lacks support for SerDes routing and pinctrl handling, relying solely on correct settings in U-Boot. Clock settings for this SoC are managed by the ATF Firmware. Please run scripts/checkpatch.pl and fix reported warnings. Some warnings can be ignored, but the code here looks like it needs a fix. Feel free to get in touch if the warning is not clear. Read how commit msg should be wrapped. Please wrap commit message according to Linux coding style / submission process (neither too early nor over the limit): https://elixir.bootlin.com/linux/v6.4-rc1/source/Documentation/process/submitting-patches.rst#L597 > > Changes made compared to [1]: > > Rebased onto Linux 6.8-rc7 > Consolidated into a single commit > Minor adjustments in naming and usage of dev_err()/dev_info() > > Test Environment: > The driver has been successfully tested on the official S32G-VNP-RDB3 Reference Design Board from NXP, utilizing an S32G3 SoC. The firmware and U-Boot used were from the BSP39 Release. The official BSP39 Ubuntu 22.04 Release was successfully booted. A network stress test using iperf [3] was also executed without issues. > > [1] https://patchwork.kernel.org/project/netdevbpf/patch/20221031101052.14956-6-clin@suse.com/#25068228 > [2] https://github.com/nxp-auto-linux/linux/blob/release/bsp39.0-5.15.129-rt/drivers/net/ethernet/stmicro/stmmac/dwmac-s32cc.c > [3] https://linux.die.net/man/1/iperf > [4] https://github.com/nxp-auto-linux/u-boot > [5] https://github.com/nxp-auto-linux/arm-trusted-firmware > > Signed-off-by: Wadim Mueller > --- > drivers/net/ethernet/stmicro/stmmac/Kconfig | 12 + > drivers/net/ethernet/stmicro/stmmac/Makefile | 1 + That's totally unrelated to DTS. Do not mix independent work in one patchset. This targets net-next, not SoC, so please send it as separate patchset when net-next reopens, so after merge window. > drivers/net/ethernet/stmicro/stmmac/common.h | 3 + > .../net/ethernet/stmicro/stmmac/dwmac-s32.c | 313 ++++++++++++++++++ > .../net/ethernet/stmicro/stmmac/dwmac4_dma.c | 9 + > .../net/ethernet/stmicro/stmmac/dwmac4_dma.h | 3 + > drivers/net/ethernet/stmicro/stmmac/hwif.h | 5 + > .../net/ethernet/stmicro/stmmac/stmmac_main.c | 7 + > include/linux/stmmac.h | 9 + > 9 files changed, 362 insertions(+) > create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c > > diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig > index 85dcda51df05..1cdf2da0251c 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig > +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig > @@ -142,6 +142,18 @@ config DWMAC_ROCKCHIP > This selects the Rockchip RK3288 SoC glue layer support for > the stmmac device drive .. > + > + plat_dat->safety_feat_cfg->tsoee = 1; > + plat_dat->safety_feat_cfg->mrxpee = 1; > + plat_dat->safety_feat_cfg->mestee = 1; > + plat_dat->safety_feat_cfg->mrxee = 1; > + plat_dat->safety_feat_cfg->mtxee = 1; > + plat_dat->safety_feat_cfg->epsi = 1; > + plat_dat->safety_feat_cfg->edpp = 1; > + plat_dat->safety_feat_cfg->prtyen = 1; > + plat_dat->safety_feat_cfg->tmouten = 1; > + > + ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); > + if (ret) > + goto err_gmac_exit; > + > + return 0; > + > +err_gmac_exit: > + s32_gmac_exit(pdev, plat_dat->bsp_priv); > + return ret; > +} > + > +static const struct of_device_id s32_dwmac_match[] = { > + { .compatible = "nxp,s32-dwmac" }, Missing bindings. Please run scripts/checkpatch.pl and fix reported warnings. Some warnings can be ignored, but the code here looks like it needs a fix. Feel free to get in touch if the warning is not clear. > + {} > +}; Best regards, Krzysztof