devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacky Chou <jacky_chou@aspeedtech.com>
To: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>, Joel Stanley <joel@jms.id.au>,
	Andrew Jeffery <andrew@codeconstruct.com.au>
Cc: "Simon Horman" <horms@kernel.org>,
	"Heiner Kallweit" <hkallweit1@gmail.com>,
	"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
	"Po-Yu Chuang" <ratbert@faraday-tech.com>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-aspeed@lists.ozlabs.org, taoren@meta.com,
	bmc-sw2@aspeedtech.com
Subject: [net-next v2 1/4] dt-bindings: net: ftgmac100: Restrict phy-mode and delay properties for AST2600
Date: Wed, 13 Aug 2025 14:32:58 +0800	[thread overview]
Message-ID: <20250813063301.338851-2-jacky_chou@aspeedtech.com> (raw)
In-Reply-To: <20250813063301.338851-1-jacky_chou@aspeedtech.com>

Create the new compatibles to identify AST2600 MAC0/1 and MAC3/4.
Add conditional schema constraints for Aspeed AST2600 MAC controllers:
- For "aspeed,ast2600-mac01", restrict phy-mode to "rgmii-id" and
  "rgmii-rxid", and require rx/tx-internal-delay-ps properties with 45ps
  step.
- For "aspeed,ast2600-mac23", require rx/tx-internal-delay-ps properties
  with 250ps step.
- Both require the "scu" property.
Other compatible values remain unrestricted.

Because the RGMII delay on AST2600 MAC0/1 is 45ps and its total delay
step is 32, cannot cover 2ns delay for RGMII to meet center. We need
the PHY side enables RX internal delay and the phy_mode must be
"rgmii-id" or "rgmii-rxid".

Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
---
 .../bindings/net/faraday,ftgmac100.yaml       | 50 +++++++++++++++++--
 1 file changed, 47 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml b/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml
index 55d6a8379025..82c7c81eab10 100644
--- a/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml
+++ b/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml
@@ -6,9 +6,6 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 
 title: Faraday Technology FTGMAC100 gigabit ethernet controller
 
-allOf:
-  - $ref: ethernet-controller.yaml#
-
 maintainers:
   - Po-Yu Chuang <ratbert@faraday-tech.com>
 
@@ -21,6 +18,8 @@ properties:
               - aspeed,ast2400-mac
               - aspeed,ast2500-mac
               - aspeed,ast2600-mac
+              - aspeed,ast2600-mac01
+              - aspeed,ast2600-mac23
           - const: faraday,ftgmac100
 
   reg:
@@ -69,6 +68,12 @@ properties:
   mdio:
     $ref: /schemas/net/mdio.yaml#
 
+  scu:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      Phandle to the SCU (System Control Unit) syscon node for Aspeed platform.
+      This reference is used by the MAC controller to configure the RGMII delays.
+
 required:
   - compatible
   - reg
@@ -76,6 +81,45 @@ required:
 
 unevaluatedProperties: false
 
+allOf:
+  - $ref: ethernet-controller.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: aspeed,ast2600-mac01
+    then:
+      properties:
+        phy-mode:
+          enum: [rgmii-id, rgmii-rxid]
+        rx-internal-delay-ps:
+          minimum: 0
+          maximum: 1395
+          multipleOf: 45
+        tx-internal-delay-ps:
+          minimum: 0
+          maximum: 1395
+          multipleOf: 45
+      required:
+        - scu
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: aspeed,ast2600-mac23
+    then:
+      properties:
+        rx-internal-delay-ps:
+          minimum: 0
+          maximum: 7750
+          multipleOf: 250
+        tx-internal-delay-ps:
+          minimum: 0
+          maximum: 7750
+          multipleOf: 250
+      required:
+        - scu
+
 examples:
   - |
     ethernet@1e660000 {
-- 
2.43.0


  reply	other threads:[~2025-08-13  6:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-13  6:32 [net-next v2 0/4] Add AST2600 RGMII delay into ftgmac100 Jacky Chou
2025-08-13  6:32 ` Jacky Chou [this message]
2025-08-15 18:12   ` [net-next v2 1/4] dt-bindings: net: ftgmac100: Restrict phy-mode and delay properties for AST2600 Andrew Lunn
2025-08-13  6:32 ` [net-next v2 2/4] ARM: dts: aspeed-g6: Add ethernet alise and update MAC compatible Jacky Chou
2025-08-13  6:33 ` [net-next v2 3/4] ARM: dts: aspeed: ast2600evb: Add delay setting for MAC Jacky Chou
2025-08-15 18:17   ` Andrew Lunn
2025-08-13  6:33 ` [net-next v2 4/4] net: ftgmac100: Add RGMII delay configuration for AST2600 Jacky Chou
2025-08-15 18:23   ` Andrew Lunn
2025-08-15  0:44 ` [net-next v2 0/4] Add AST2600 RGMII delay into ftgmac100 Jakub Kicinski
2025-08-15 18:42 ` Andrew Lunn
2025-08-20  0:40   ` 回覆: " Jacky Chou
2025-08-20  2:43     ` Andrew Lunn
2025-08-20  6:09       ` 回覆: " Jacky Chou
2025-08-26  1:41       ` Jacky Chou
2025-08-26  3:17         ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250813063301.338851-2-jacky_chou@aspeedtech.com \
    --to=jacky_chou@aspeedtech.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@codeconstruct.com.au \
    --cc=bmc-sw2@aspeedtech.com \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=joel@jms.id.au \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=ratbert@faraday-tech.com \
    --cc=robh@kernel.org \
    --cc=taoren@meta.com \
    --cc=u.kleine-koenig@baylibre.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).