From patchwork Tue Apr 15 10:18:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 14052064 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6ED90C369AB for ; Tue, 15 Apr 2025 11:28:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wimGa1udfs/aPQ4Ye8/P3PbpDd6kr57yzXcYNHlkEz0=; b=vPSTTYC2TJgFiSXgP8I3wJ3t9J W6hfe1WCxZ7pt86ZKmUvhWXkfA5T8ec6A5VayhBb6SyWQZ/fWYwUNWAUPy8KAJXEAmJUSLIJzVo1i 37QxK/b+GuAwAdcI4hhmR1+F8qy5ulQ3b5TlSVY9o/GqpQwNW8u4KPC23u3G9WbtYWyx8GSFEXeyI jN/3DhyF6FzU18cqaU6It4S8ZMiFZ9LuMNSzoFYJaTLTZThdchC4X2WGtkduqdPjokJ8RIP8m4uCf ApFW48wBmWbYVkStfJjJrs4FeFrQLLc0GLL7s0wtBIG0+UH7xEgOrUNMFFf1gdPUwp4SJpJGiH6Rt XM2tMKsA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u4eSe-00000005XQy-2wpL; Tue, 15 Apr 2025 11:28:16 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u4dNf-00000005IhJ-1kE2 for linux-arm-kernel@lists.infradead.org; Tue, 15 Apr 2025 10:19:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1744712342; x=1776248342; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wimGa1udfs/aPQ4Ye8/P3PbpDd6kr57yzXcYNHlkEz0=; b=XH2SGIIv/kDFHcGhrUbFUKFEtT5m8vHhG2vaaN8BeUF2xgku49rM9++g 3Sqlj1yzfJWMVsLVEqCiIbgaZ/UKyMSyA72fhWXgBsAUmn50Dn0il1g4r FyB9CcwIAcfbQ77h8LHHlTKjuLwMfGI5i/tFpYFLn3tXjiV9pemsa25mm /Fo0vr5q50mco0Y8Rr4E3k56R4CehTPVyUdOpZumhjGnnPvsLH3paQZC1 C0/9uvjq18KBaUeY/5OSrIrfj8O0hJ6rZh+B6AN21PIyMguBFhf+ng2dg bchcxHfJpLBPWk7LCHZF1uNML0sqHDWxMMU0CekRdfexwa8Tsgfrsd+Sa Q==; X-CSE-ConnectionGUID: OuAOiMBSRoC+zQEZDLxotA== X-CSE-MsgGUID: XuVPIJwfRKKZTxbe3vRGpw== X-IronPort-AV: E=Sophos;i="6.15,213,1739833200"; d="scan'208";a="43537781" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 15 Apr 2025 12:19:00 +0200 X-CheckPoint: {67FE3295-24-7141A0B0-E6EDEC14} X-MAIL-CPID: 5E09EB4AC63FE62BE71D1E04C3EAC840_3 X-Control-Analysis: str=0001.0A006377.67FE3290.0089,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 2446B164775; Tue, 15 Apr 2025 12:18:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1744712336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wimGa1udfs/aPQ4Ye8/P3PbpDd6kr57yzXcYNHlkEz0=; b=mx91+Fp1Q3/95YOyqSJE6PCDOydgSAiSmP41FQgtqttT2RkJol8Zcf9PfdWlo0BkXX6MG3 E2aQdW2UlQAAcZqCkvB93mxTC8cTxQ1zaWzV+MvAibykg6qA/sZ0EzdXj2wo7rR/xQKDHy /PPYQic0ceEa/3v85eHkjhNnZnVVaq0ekHO69UeE72I8QdUE5bu4D9Fjprap2+Fk6xvoz6 ot12jRTMibeNSTo4wqb/kQ94MyRC1+utDam6+YAI1wuY7tUfilAUmnVgn5EMuojBTx9+Fk bjmHugCSgGWgP9Ym56HKUxIrN6lSJyBqZwIKvhTpaf45JMZRldPAkc8bSZe8Vg== From: Matthias Schiffer To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Whitcroft Cc: Dwaipayan Ray , Lukas Bulwahn , Joe Perches , Jonathan Corbet , Nishanth Menon , Vignesh Raghavendra , Siddharth Vadapalli , Roger Quadros , Tero Kristo , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux@ew.tq-group.com, Matthias Schiffer Subject: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes Date: Tue, 15 Apr 2025 12:18:01 +0200 Message-ID: <218a27ae2b2ef2db53fdb3573b58229659db65f9.1744710099.git.matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250415_031903_749766_3A1F6027 X-CRM114-Status: GOOD ( 12.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As discussed [1], the comments for the different rgmii(-*id) modes do not accurately describe what these values mean. As the Device Tree is primarily supposed to describe the hardware and not its configuration, the different modes need to distinguish board designs (if a delay is built into the PCB using different trace lengths); whether a delay is added on the MAC or the PHY side when needed should not matter. Unfortunately, implementation in MAC drivers is somewhat inconsistent where a delay is fixed or configurable on the MAC side. As a first step towards sorting this out, improve the documentation. Link: https://lore.kernel.org/lkml/d25b1447-c28b-4998-b238-92672434dc28@lunn.ch/ [1] Signed-off-by: Matthias Schiffer Reviewed-by: Maxime Chevallier --- .../bindings/net/ethernet-controller.yaml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml index 45819b2358002..2ddc1ce2439a6 100644 --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml @@ -74,19 +74,21 @@ properties: - rev-rmii - moca - # RX and TX delays are added by the MAC when required + # RX and TX delays are part of the board design (through PCB traces). MAC + # and PHY must not add delays. - rgmii - # RGMII with internal RX and TX delays provided by the PHY, - # the MAC should not add the RX or TX delays in this case + # RGMII with internal RX and TX delays provided by the MAC or PHY. No + # delays are included in the board design; this is the most common case + # in modern designs. - rgmii-id - # RGMII with internal RX delay provided by the PHY, the MAC - # should not add an RX delay in this case + # RGMII with internal RX delay provided by the MAC or PHY. TX delay is + # part of the board design. - rgmii-rxid - # RGMII with internal TX delay provided by the PHY, the MAC - # should not add an TX delay in this case + # RGMII with internal TX delay provided by the MAC or PHY. RX delay is + # part of the board design. - rgmii-txid - rtbi - smii From patchwork Tue Apr 15 10:18:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 14051891 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B468AC369AB for ; Tue, 15 Apr 2025 10:28:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MFqpgQW5EamtR8QdmjqS2VZbo2sqPuCPjB+h5Oo096U=; b=YqoxT3es8h25fAkIgNCCVrh543 W6RtMAjQxYtINTZPpmJAyJA75QONN5beEBVp0c4/YT/UjNs7gr4UhL3ZvXstu21QMJNt62Eznh5aY sUDyTMkL814Ss4LbZ2ENko/OMSBLaxzcYxgWq0E1otq0k4AnYJcIvrdPRm1EvmmJVmD+aKPgGvz4d W2o/TzgBLClly8lvY9+l/Pe68x0EV6FyecfYGLDB0Cv3g/iakT7l+Ltz6wziLiIJnAe0Vm4Soq7fA 4xxTiAyrep8VV6cwRY71gXzI/5fJ5sY1+yEIptKOIT3jQMiaLozZSxK5u1BmcTbuhuxXgebsieVSj LBFfzJ/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u4dWt-00000005KZk-1dri; Tue, 15 Apr 2025 10:28:35 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u4dNq-00000005Ils-0k50 for linux-arm-kernel@bombadil.infradead.org; Tue, 15 Apr 2025 10:19:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=MFqpgQW5EamtR8QdmjqS2VZbo2sqPuCPjB+h5Oo096U=; b=cFxfQMUFuR0hgUs683SrA5POJH fxOH1uYQcbH5uA8zClYuuLR6f237BtbJhkOYuoXl4+jh5qYU26J6l+mAQanryffH+VC7GyaznsWQ9 /fex/bGBdnn2U7QVDZwygMV8eRbzd67JM6O77G8klvPxw2j+jUWzBsFAoAf2ojXkp+JThlV6PcFtP WBu/PhL0VPL0nanv7QnBLfxK/eeinvgmD5jUlWQeCIk/CWTqhTgKN71wQW8mnuZV16VvsMbvhyilJ 8my/buN0Lv7J2M5NcBR92VJ1dos+rx+Ob9Z8vW0FJhXPMY4bsVE3g3vkhIxs5gFM16Z1sLviG10rT rpWtA/qQ==; Received: from mx1.tq-group.com ([93.104.207.81]) by desiato.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1u4dNm-00000009qy8-2Wnc for linux-arm-kernel@lists.infradead.org; Tue, 15 Apr 2025 10:19:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1744712349; x=1776248349; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MFqpgQW5EamtR8QdmjqS2VZbo2sqPuCPjB+h5Oo096U=; b=CnR/Ey1Dc6CYi9s0kyQ3hCMhAkYVqlTXBKdv+Ejw8bMOJ7hwKKeE1ZkO MyCITPC6IzTQe7TSUVHscgT5Gf7KOLpAUtMlInCcyu5TGpgzVwCI4ZYEt 2pDBJJ7rQg14sBCaz/n5YcZFZYkwJXE8xqaw6ZZymNwZ0AZ/reWYzqi1v jn08xs0Oo9gTCKt3uW+3LmKQ2Mu7eKAeLEZteURhIWYRA+Hws7xjjcLg8 zWzZ1GJ6QpgII5TeMUf5bcP47RDoZMqYQBhe0TIPXD2bky+K7RRsMwXCa ovcAEzN9kEgoCllzoatH9TCTioIx79dh4LyAwPhPpiWWaSP7Hk1vbYU9r Q==; X-CSE-ConnectionGUID: kK/iwg5hSmuRAog/IIY4Pw== X-CSE-MsgGUID: EsvKnMCcSpy31wr4isC/8w== X-IronPort-AV: E=Sophos;i="6.15,213,1739833200"; d="scan'208";a="43537784" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 15 Apr 2025 12:19:05 +0200 X-CheckPoint: {67FE329A-46-DC4DC9A0-F4F29281} X-MAIL-CPID: E2AC9662668DFE112FB8F3BA65C48555_0 X-Control-Analysis: str=0001.0A006377.67FE3296.0004,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 60984163A8E; Tue, 15 Apr 2025 12:19:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1744712342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MFqpgQW5EamtR8QdmjqS2VZbo2sqPuCPjB+h5Oo096U=; b=X3coK32oMqIEkB1CNfPLlgOroXkcuLoSzbI2Au0MWdzOzmnVyb3gJzdPtUha13qwd93GKh Sora7MJBYzJC1kzCNEBhgV1SM3XUCLV5ORJKoiH6WoGksYg3bImk/6LhW2pP8HkSU4jlfo P30YGLpNjS0NWcT6QeB42r/0NFKZJbD0u85Xpz+bktp4ZqcS4aXp5mqVLqvYOfYE5wGgDl Xfhe/Bto5TDpxjuf8DpYZO3NYm3SiFk2paNeT5VXLzyiVhiDPrKadLbldrHNlxcQ4jOC6h AsWGxonmQRQKnhpE+kQfWF27VuOfuMTEVWrGVTBXcBL8CiHsiios1+ksg/4FUg== From: Matthias Schiffer To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Whitcroft Cc: Dwaipayan Ray , Lukas Bulwahn , Joe Perches , Jonathan Corbet , Nishanth Menon , Vignesh Raghavendra , Siddharth Vadapalli , Roger Quadros , Tero Kristo , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux@ew.tq-group.com, Matthias Schiffer Subject: [PATCH net-next 2/4] dt-bindings: net: ti: k3-am654-cpsw-nuss: update phy-mode in example Date: Tue, 15 Apr 2025 12:18:02 +0200 Message-ID: <4216050f7b33ce4e5ce54f32023ec6ce093bd83c.1744710099.git.matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250415_111911_070760_9FBA5EA7 X-CRM114-Status: GOOD ( 11.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org k3-am65-cpsw-nuss controllers have a fixed internal TX delay, so RXID mode is not actually possible and will result in a warning from the driver going forward. Signed-off-by: Matthias Schiffer Reviewed-by: Maxime Chevallier --- .../devicetree/bindings/net/ti,k3-am654-cpsw-nuss.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.yaml b/Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.yaml index b11894fbaec47..c8128b8ca74fb 100644 --- a/Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.yaml +++ b/Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.yaml @@ -282,7 +282,7 @@ examples: ti,syscon-efuse = <&mcu_conf 0x200>; phys = <&phy_gmii_sel 1>; - phy-mode = "rgmii-rxid"; + phy-mode = "rgmii-id"; phy-handle = <&phy0>; }; }; From patchwork Tue Apr 15 10:18:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 14052069 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B833AC369AB for ; Tue, 15 Apr 2025 11:43:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=38wKAyJpUZ+v15BtZQhYo+REQajwTbN5pJiNx7WIgok=; b=Z0yqAKroNFdP1DNNqyreGRJnyg c7Fa+ARjndVDNWTkdQQp141Ea2Et5ml7F29vhJbkHx13KDVNJfofvKbA0wmv8Pc6u9/cyxfsUclwl vGT+Z/bmojVQJn5pX99K3Uf0lVFq3iE9e7PlOxK2BElNKvIlH4uy4PmNpGSApyxOR8PJrbiyR+ks2 sOYbXky7NJl9xhA/56y+Po4BoHF983OFwl1YzbFMteEu0bj1ZGPVLlVmvcm1GD54iPkHvbl+Wqh8X WvHDd2oC4Pas2WFH4BXQbZGgy1t+7eYbjErTHtL/ZE7j5wHxctecinH5NeZTfy3kUW15c5qhThkdx cbf0m0yA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u4ehA-00000005b96-3GhX; Tue, 15 Apr 2025 11:43:16 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u4dNs-00000005In4-3XXR for linux-arm-kernel@bombadil.infradead.org; Tue, 15 Apr 2025 10:19:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=38wKAyJpUZ+v15BtZQhYo+REQajwTbN5pJiNx7WIgok=; b=ZzzIUCCA0xLiQm2woyqtLLk+pA RU7m3BOpVjCpIDLJZsIlgUcTrEzsHBqJrHIotJFPRXI7y92658iqPGBTfzpkUOGJ1XClSSSOfBvon xAcRcKVr0x5Hzi0CoyiyCZWJXDQzHQt2cyVSJJnkF1vLqJ96U/29O6lXZk/wn+w4JjvL2rsqKB5fg d4qRaXDCtvbriGwRz6bukkGdXHhabVosN3ww3P/b+9kAp8Xmfn63LCl5GaZlUxlIXwaKNQsaqnkD3 Y7wvJEbRkrErgyguR593cUcqY2SXwxnYnBcnRBn1T9/ySAK6Z92Do1LlvnMEPy73An2cpif6bWwlM 1dEeq+9Q==; Received: from mx1.tq-group.com ([93.104.207.81]) by desiato.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1u4dNp-00000009qy8-1MII for linux-arm-kernel@lists.infradead.org; Tue, 15 Apr 2025 10:19:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1744712352; x=1776248352; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=38wKAyJpUZ+v15BtZQhYo+REQajwTbN5pJiNx7WIgok=; b=qxukwvQoFP17VD6HAo7VVCzIwqpx0NS53uZKqjyWj8M6zJwlCy6U48Kp 18L7gMikZMqc9OmH475hW0Ysoyu9SC2rWo/yxjPkiuavDnOo7kNRtTc8S ykdnTlNqBz2BRQwTUvPrx6QrEW98BY2Nymcv59nn9mwdWx4LZwYg+yl/J TT4vUkaAagj+og+2jWFaKWhLepCx8MMlBtkxUQ15B4rGfmQp4w1GEbIwA DLoIWUtN4ZzxyDELnzTkifAFY5Pm294UXnQ/FnUTvvasyHWs8wxOjmakt 1TPRz8Sp2pPRf5DHTMuTyh2LC9VuSrTvGc6N2F7IJZSjZMeBFQLBbBv3w g==; X-CSE-ConnectionGUID: chtD1w7vRP6Ofi0sMP3uTA== X-CSE-MsgGUID: LQIoltfBSHO2OCu1S8ThUw== X-IronPort-AV: E=Sophos;i="6.15,213,1739833200"; d="scan'208";a="43537787" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 15 Apr 2025 12:19:11 +0200 X-CheckPoint: {67FE32A0-0-903EAEAC-E04C76C8} X-MAIL-CPID: 8CC79B74E1AFEF81D94ED3F9DF1A712D_5 X-Control-Analysis: str=0001.0A006399.67FE32A2.0015,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id C055F164816; Tue, 15 Apr 2025 12:19:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1744712347; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=38wKAyJpUZ+v15BtZQhYo+REQajwTbN5pJiNx7WIgok=; b=KK4EGTVu4CbxJVmujnwSirrfhq0EqShvSvfGWnE8LgSityWXXC5qLDANzGW0Eh7eJoZX3K Y+Otmv/TEVe/L6AsWh9ezRZAu9tr4rlqnCmBEcA2M9JJsfEsVLl8chv375o/WOhgrFCjFW 39v2mwrodLOGB9+m0BN1zkWWHH6QUVOFkjKOCntAYQ6pMPpALEKIJkVITLw0KQspDB9EyI qCEKpd4vg/wlcIgg1gzByjLL8EES7FzHtp8LL6Gkdpa7gKZPqTFbqQ6Bf4ApS3P9QEgUQn idATjL60jpohE9Vxtz21552FBsfGMXiDgitQT54YkZIk8GS0sQY1EAXsDsJwnQ== From: Matthias Schiffer To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Whitcroft Cc: Dwaipayan Ray , Lukas Bulwahn , Joe Perches , Jonathan Corbet , Nishanth Menon , Vignesh Raghavendra , Siddharth Vadapalli , Roger Quadros , Tero Kristo , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux@ew.tq-group.com, Matthias Schiffer Subject: [PATCH net-next 3/4] net: ethernet: ti: am65-cpsw: fixup PHY mode for fixed RGMII TX delay Date: Tue, 15 Apr 2025 12:18:03 +0200 Message-ID: <32e0dffa7ea139e7912607a08e391809d7383677.1744710099.git.matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250415_111913_629342_5C6A747E X-CRM114-Status: GOOD ( 13.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org All am65-cpsw controllers have a fixed TX delay, so the PHY interface mode must be fixed up to account for this. Modes that claim to a delay on the PCB can't actually work. Warn people to update their Device Trees if one of the unsupported modes is specified. Signed-off-by: Matthias Schiffer Reviewed-by: Maxime Chevallier --- drivers/net/ethernet/ti/am65-cpsw-nuss.c | 27 ++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c index c9fd34787c998..a1d32735c7512 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c @@ -2602,6 +2602,7 @@ static int am65_cpsw_nuss_init_slave_ports(struct am65_cpsw_common *common) return -ENOENT; for_each_child_of_node(node, port_np) { + phy_interface_t phy_if; struct am65_cpsw_port *port; u32 port_id; @@ -2667,14 +2668,36 @@ static int am65_cpsw_nuss_init_slave_ports(struct am65_cpsw_common *common) /* get phy/link info */ port->slave.port_np = port_np; - ret = of_get_phy_mode(port_np, &port->slave.phy_if); + ret = of_get_phy_mode(port_np, &phy_if); if (ret) { dev_err(dev, "%pOF read phy-mode err %d\n", port_np, ret); goto of_node_put; } - ret = phy_set_mode_ext(port->slave.ifphy, PHY_MODE_ETHERNET, port->slave.phy_if); + /* CPSW controllers supported by this driver have a fixed + * internal TX delay in RGMII mode. Fix up PHY mode to account + * for this and warn about Device Trees that claim to have a TX + * delay on the PCB. + */ + switch (phy_if) { + case PHY_INTERFACE_MODE_RGMII_ID: + phy_if = PHY_INTERFACE_MODE_RGMII_RXID; + break; + case PHY_INTERFACE_MODE_RGMII_TXID: + phy_if = PHY_INTERFACE_MODE_RGMII; + break; + case PHY_INTERFACE_MODE_RGMII: + case PHY_INTERFACE_MODE_RGMII_RXID: + dev_warn(dev, + "RGMII mode without internal TX delay unsupported; please fix your Device Tree\n"); + break; + default: + break; + } + + port->slave.phy_if = phy_if; + ret = phy_set_mode_ext(port->slave.ifphy, PHY_MODE_ETHERNET, phy_if); if (ret) goto of_node_put; From patchwork Tue Apr 15 10:18:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 14051892 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 687B1C369AB for ; Tue, 15 Apr 2025 10:32:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=L3mgdLsAzzZaK/mOx+qOWZRMUeWUqc13Mm441pFDAiY=; b=DNJARzpHJFCljJHoai5lP8dxwj mubCvZCHz/4PZExaaHHyRwV9E1/zko0d7zh0QLaTBfeRRf1qDHNWZabfVe6BR2sA08FR+ZS9Oo2pY HemfU81QJgDKN+BUkn2UnIt6qKUXoAu5W/jmPNMxfumleloMeauGZMy7P4c3YNRgML4D++x0ceQTn 8AVJHNQKXO1GLAkUTvl/Zt9UpO9oZW92MaruVzHsz2/I5UCxa1kqrl84DkiQaOABNPd96LBmyMjsp nEfAKbsuYkgqhHQDNgzrIJIZf6TFYrlVqm6UqbTh5hJ8bjc52ySu4H9OiWqZ9pkDONRRII+i9/Tbl 0satU9rQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u4daW-00000005LMy-1FkZ; Tue, 15 Apr 2025 10:32:20 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u4dNw-00000005Ioc-0IlW for linux-arm-kernel@lists.infradead.org; Tue, 15 Apr 2025 10:19:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1744712359; x=1776248359; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=L3mgdLsAzzZaK/mOx+qOWZRMUeWUqc13Mm441pFDAiY=; b=kPN22pZXr0yjR4y2MofA2Qy7xHS6kAHJfHZ9YlaIgYxsLFklfLTX0oQF CvFee56r0/lFhqagoL1A6Ib54K9w688fUunwYNOwHhrg4I/hnzKMyKGcR H8wURW4AHcqekHjTQ4ZpiY6IT3FHNZ56dILM6rhDUT8JWO6+gETtUHq6l DGAQsnEAkeH4aNl/qmRtUNv19t37/C/ppsHNfNv/82T9b2ws1CIpiPCvz NLbvdZxPgXIc1V4KM1/Z8eDRW/JufRhyAG13Pg1pmx7RH8LJ4Z1YSuRo0 bNJiHLg5wIsowUNCgyHht7SG3je9lDei7tSIcaaEkbElAxXufh9cYzVON A==; X-CSE-ConnectionGUID: IwmrXv6VTCSAI3p/xks4FQ== X-CSE-MsgGUID: 3bL/W/GHSWOL+S5bi73eFg== X-IronPort-AV: E=Sophos;i="6.15,213,1739833200"; d="scan'208";a="43537792" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 15 Apr 2025 12:19:16 +0200 X-CheckPoint: {67FE32A5-B-7141A0B0-E6EDEC14} X-MAIL-CPID: 5C0A9FF98528448249FF1B25666F25D4_3 X-Control-Analysis: str=0001.0A00639F.67FE32A3.002A,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id DB06016489A; Tue, 15 Apr 2025 12:19:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1744712352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L3mgdLsAzzZaK/mOx+qOWZRMUeWUqc13Mm441pFDAiY=; b=KS5my13jufA8VQYzVUolMCKej6Q6tnssyGOSXTJ5vvYPOztf4WkrwHSB161oYHAaXSR5Di LU0epMxqooehsceu3dwjHl2Te7f8qmll6KsaNXzfcPOEmAqcr1APAsOPDup/VWeZu3J2r/ VRahVBSu+/J7QqeEoucuEShtkKDdob90Qex2OofXap8YdqpdwwUollbCo2cVBlYfg7pwHz FYpxJD67+pTSdEZpd4q0U15HUuNstBYn0YdDGFZ8bIfRgFGO2nnkHeNh+t6TstazSpGo2G o7a0U9Ac5NsiMfKrEJn98eJefYeWxc0nD+814nZJxy9Z6c+ckH30du2wfZIj/A== From: Matthias Schiffer To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Whitcroft Cc: Dwaipayan Ray , Lukas Bulwahn , Joe Perches , Jonathan Corbet , Nishanth Menon , Vignesh Raghavendra , Siddharth Vadapalli , Roger Quadros , Tero Kristo , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux@ew.tq-group.com, Matthias Schiffer , Andrew Lunn Subject: [PATCH net-next 4/4] checkpatch: check for comment explaining rgmii(|-rxid|-txid) PHY modes Date: Tue, 15 Apr 2025 12:18:04 +0200 Message-ID: <16a08c72ec6cf68bbe55b82d6fb2f12879941f16.1744710099.git.matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250415_031920_275636_44B2E101 X-CRM114-Status: GOOD ( 14.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Historially, the RGMII PHY modes specified in Device Trees have been used inconsistently, often referring to the usage of delays on the PHY side rather than describing the board; many drivers still implement this incorrectly. Require a comment in Devices Trees using these modes (usually mentioning that the delay is relalized on the PCB), so we can avoid adding more incorrect uses (or will at least notice which drivers still need to be fixed). Suggested-by: Andrew Lunn Signed-off-by: Matthias Schiffer --- Documentation/dev-tools/checkpatch.rst | 9 +++++++++ scripts/checkpatch.pl | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/Documentation/dev-tools/checkpatch.rst b/Documentation/dev-tools/checkpatch.rst index abb3ff6820766..8692d3bc155f1 100644 --- a/Documentation/dev-tools/checkpatch.rst +++ b/Documentation/dev-tools/checkpatch.rst @@ -513,6 +513,15 @@ Comments See: https://lore.kernel.org/lkml/20131006222342.GT19510@leaf/ + **UNCOMMENTED_RGMII_MODE** + Historially, the RGMII PHY modes specified in Device Trees have been + used inconsistently, often referring to the usage of delays on the PHY + side rather than describing the board. + + PHY modes "rgmii", "rgmii-rxid" and "rgmii-txid" modes require the clock + signal to be delayed on the PCB; this unusual configuration should be + described in a comment. If they are not (meaning that the delay is realized + internally in the MAC or PHY), "rgmii-id" is the correct PHY mode. Commit message -------------- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 784912f570e9d..57fcbd4b63ede 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3735,6 +3735,17 @@ sub process { } } +# Check for RGMII phy-mode with delay on PCB + if ($realfile =~ /\.dtsi?$/ && $line =~ /^\+\s*(phy-mode|phy-connection-type)\s*=\s*"/ && + !ctx_has_comment($first_line, $linenr)) { + my $prop = $1; + my $mode = get_quoted_string($line, $rawline); + if ($mode =~ /^"rgmii(?:|-rxid|-txid)"$/) { + CHK("UNCOMMENTED_RGMII_MODE", + "$prop $mode without comment -- delays on the PCB should be described, otherwise use \"rgmii-id\"\n" . $herecurr); + } + } + # check for using SPDX license tag at beginning of files if ($realline == $checklicenseline) { if ($rawline =~ /^[ \+]\s*\#\!\s*\//) {