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: 14051849 X-Patchwork-Delegate: kuba@kernel.org Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) (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 A438F28B51D; Tue, 15 Apr 2025 10:19:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.104.207.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744712348; cv=none; b=nb27m3iz+1A1sN/e7tkoQReNz8gt1TFkK6TMgdAB3F/TEZS5trFJ6yl8/hQdWptroaBeZ+uivwlVfF0t0L+JXC0xf9kT1xrIQS4w4yl5XT131niRwhAotvfMBimRHIEjHCkd+HaayGH9Fw/X/Atu890MSIEetWlTnwljp+4aVYY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744712348; c=relaxed/simple; bh=soMsuOoW4yEHs0ZnKQkME+wdlHFOzVeyMEamxHTbjpg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=j3qQnK1qykTP1/mqfXIekJdPVO6xvAK4rHk4mWqUarI0E21dVJgPep0r9eIutjDp80XceS+WbG5lt93udYXey580TZB9o+tl5e4Z6ivmeTf6u68/0SEKs38Yo90s2y5i1AmS6a2ZrX1UEIgkl2gu1UIegYO+DINpdCjfoTPCxa8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com; spf=pass smtp.mailfrom=ew.tq-group.com; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b=NJBS9+wz; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=mx91+Fp1 reason="key not found in DNS"; arc=none smtp.client-ip=93.104.207.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="NJBS9+wz"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b="mx91+Fp1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1744712344; x=1776248344; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wimGa1udfs/aPQ4Ye8/P3PbpDd6kr57yzXcYNHlkEz0=; b=NJBS9+wztb0Zmqku2Qf3sJKCNlGEEat5t4+NXY6IxTmGMVvGBBhO/YyM GpQccQN8SU8sLYt5B30MhTgbE/FgCWsXrBy/2eAO6be2zZ/8ForiWxLKZ yxQBN0DzM0k0l0oCBhf4NHdEGMZ8jhIZcEZaUbMr8tv2VOocHBHV+h+PU yxO1sz0xeWpMZrVd0kVKfxLMDigxD0MUyip7JNYUwXaoj8bUkCnX7VlyC GuwBMV/+BZPFCXj0x/9CfL1QbzfDNuEFH7YM90zNSv/e0jTox/6EfCSxe x3dG+5KSJecW85g+uzIxNB07VlTOo8wxL9bDFSs2pG4/iXIaGJxC2nkGB A==; 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: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-Patchwork-Delegate: kuba@kernel.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: 14051850 X-Patchwork-Delegate: kuba@kernel.org Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) (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 B387F28E607; Tue, 15 Apr 2025 10:19:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.104.207.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744712351; cv=none; b=fW9Yuhv8JGUVyK+MqYy4u8Q/VayKdAC4vn2OXpAZ6jnYFUSopXeEiBSWK/ndfbCIOnuyCAxoskC3myYoEQSw/woL9dKPZgz3NYrlTkQBBfhp+JlUoE3ywb+1X+SKMX4kMEJUASTKA4U7iqfhh0+JbALDHFRvKlr3wi8Ndyr87P4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744712351; c=relaxed/simple; bh=N8Liv9QfdjKawBDNuMnGi9SFQeE+8ajkB3VNyo5vbTA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uCjAiS/w+a8dayCQTqsRwIcbay92Lv4Q4YXYnTnfrktRKZ7aQs2HsI4N5ITnUKw6zhnt6envkDq5LcPYygSJJ4K7gajt+W1WoFyftJ8q9moB3o02E54p2Mz0xrGet92EVJ0shw6pqDl+5HelJNp+EnainVwsGctO/B0bdvr0KG4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com; spf=pass smtp.mailfrom=ew.tq-group.com; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b=UdrFsLdC; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=X3coK32o reason="key not found in DNS"; arc=none smtp.client-ip=93.104.207.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="UdrFsLdC"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b="X3coK32o" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1744712347; x=1776248347; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MFqpgQW5EamtR8QdmjqS2VZbo2sqPuCPjB+h5Oo096U=; b=UdrFsLdC/IrVNGI6OoozoFprUPlTM/mps5qWvYrsKkkCdKH03zOKNS+C ubbENi/XGL2RYas6be4OeuOzvKe0ZSw+PFCw5MtRNShzGhrUrQDI85G8a yVN0qewLoj7PYy7jYNoxVNrUcAkVA7k7UyHPVx5ibX8kuoKIRn5+h70Rg 20Vxz6hO/+OPX7/4IssycW/uatDx+wzZcsmRN4/MW8kgd1JoIvBRV6C4a rHh+lRf+wCcsIgTbB9IkY4wAisC3JYLWpdiBYjJmpMG7p8bT7I50Zg13j Q+i2o8Ao3r4dMbahstsVd/+wwS8B2zh73ScfM2nzmOg9yK/C9cKBriyQs 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: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-Patchwork-Delegate: kuba@kernel.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: 14051851 X-Patchwork-Delegate: kuba@kernel.org Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) (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 F273028E607; Tue, 15 Apr 2025 10:19:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.104.207.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744712358; cv=none; b=rlyU4GH/gnilUnz2AmCTlpPDDnJz4z5a5qF3M8Z024Udjo/5XQc0S40d1McQqAMYvJBs19CeyVNt7BejIHO5xpBeLDudxyyu/rsnMoIm4LgmIRgGs4e870CAxPPza78S1Fm05Cj0FAZn3UVgcvDehKofLayCm2iWtanMHHh4QJk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744712358; c=relaxed/simple; bh=caRbKJERsJ8Yix2obZ63dxXCwKNp6CXhZffFOet+5gQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NBD1XbfbFwR5eKEy719DILL9Y4b2WvNNdTR8HPNunvRKAsprjK+AqQCFulOGKm5YCmToPF6/MKuJhDdR8h27q7dQ0z+nuQXaEE47DUKzztalaKb9cb2ZgvNqGSl4vT3SAfZyeBCwMvreEKdn1Tvp4/ZREa3JvwN3SECM1WPDJPk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com; spf=pass smtp.mailfrom=ew.tq-group.com; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b=MWA3LcGB; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=KK4EGTVu reason="key not found in DNS"; arc=none smtp.client-ip=93.104.207.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="MWA3LcGB"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b="KK4EGTVu" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1744712354; x=1776248354; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=38wKAyJpUZ+v15BtZQhYo+REQajwTbN5pJiNx7WIgok=; b=MWA3LcGByujvZobC9XzNPycdlGymC1onzLA+eb5nQvNXd+QvQ5SsZ8j0 gqPDeAIfG9NGXHTsZiLJIE8A8MUxFbJkj3EEAyo1v2I0CNoOIias26/Ks glDnylxQUxgfDCkDnZhCEHfmsvKXjJNRkVbD636a3Y9hlMi1i3tCwXxFZ IYPj2GVyW9RKaf4A+voAbig/WHCbf5WKWr/bEnB7FdZ1BqFRR42m9wsLU CwuTZbHIFJvOvu/FAZQDQYqHnihGH/G2+I3k9xBW9CwIuDUDk60t9y2dR gn5mMChDuXQ/xUHgtMEFFZdS9uqlAbONXuyc9c4oPvSxxGh7Wr2nSIwuf Q==; 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: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-Patchwork-Delegate: kuba@kernel.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: 14051852 X-Patchwork-Delegate: kuba@kernel.org Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) (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 D7404291171; Tue, 15 Apr 2025 10:19:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.104.207.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744712361; cv=none; b=AEGRG6q7FebqWxcEf0KOIGa18SdH+nHnqUowTK27kbq5Lxkmf6Az+mLnTBmCXnNBlpJLmc6J1HlHhzjb4PhihcxqbxHUUSU/8WASU5LfU+9vxTYxso/+iSqR1ydxsC9wZzmTeRcC6spGwxmt3lpBTs8nXUpmFyszI3uv9BE6hpA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744712361; c=relaxed/simple; bh=GLxiJlf0l4/8f/3cOIsp8spLAwZmy6rGL3fBo0ibedo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ENKmWS1c2Y9XuLSx7SMNtH9qKxcrDtKABbgQ4SklMaPOhms34KUoe7+n8eRURs6W+nhCsPFAit5LBdKhjy9LegYOjRWPN6GEOM7jL+pctw6XcDCJya7vx7Jl4udfs2Er5kTgHLayN9isis9COjhriq6MROOkFYrR2J5BdV9KKzA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com; spf=pass smtp.mailfrom=ew.tq-group.com; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b=MkFV+lBr; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=KS5my13j reason="key not found in DNS"; arc=none smtp.client-ip=93.104.207.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="MkFV+lBr"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b="KS5my13j" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1744712358; x=1776248358; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=L3mgdLsAzzZaK/mOx+qOWZRMUeWUqc13Mm441pFDAiY=; b=MkFV+lBryBJNa6igRNWDBlpagU2YrcuUvlZWeby+D6BMtlBWLga7re+Q OGD7e2TIXUnyrIEy23+T8+HRkmnl2KgB34Nnbmq1HFJXLytAzrttBBu9D il2/Ks3ry6lTiRPIeb+R2qy5OS8NjcAvz/1SLTVz2aht7mL7u9DHGhQ8L T44hoVwfdHpm39KRZuboMquQa8wowu2HujjweBO2fLuJ55Nw1xob0QGIi 0GwQXEQczlUgPFiEfF66lp/M9jjxPe2tbx4pSI52RPtMZzDqmBQipa8sN bc9Xs/tVhsFka/f25xRUgvY8AMso9e+Fk7I9X0UM/aGnGK1Usdjbmsl5i 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: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-Patchwork-Delegate: kuba@kernel.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*\//) {