Message ID | 20230531150340.522994-1-detlev.casanova@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2958310vqr; Wed, 31 May 2023 08:18:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6NxiegPQa3IRHuoIaxswOrsyTkIGWq8JbR/RmO9340okjnWExgJlvJL5O8aiY8TOcLo68q X-Received: by 2002:a17:902:d4c7:b0:1b0:6f8b:9000 with SMTP id o7-20020a170902d4c700b001b06f8b9000mr3193893plg.49.1685546318527; Wed, 31 May 2023 08:18:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685546318; cv=none; d=google.com; s=arc-20160816; b=sJAYVWUg0nnLyC3+KaqoN8H8KM5uRdcu0nIW0+ujwy+I5IlKq5zZIrvg4tIX887xrO MJuJrbUxiBU35JKscUbZRqBGlezJoFLxP4zDgK5cj3XHmUuaGokVQXetk19uVTCao1yz praahIGTSCdEMbHl+/rmBlvnXIF7M3heMxSeG32/h+bXkiYxOP0Yoz8s/QZBkuDS+8lA YBlFRz/TNR4kqytfKypRYBWNOERZBVCWA3P21WzuauvIfdifC/wrWO2aOsNFSrZPIpSo 2n/NK2hL/GzfIWC0l+6XR6QN0cgJXLgvONj+rx5ev+WWyD8kwIvUYgmfpQTskESlJlkj LN2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=xG79sjMCCK/3WpGM1YvnTxHV1oDXeUfThgdF5UFFb1w=; b=zKQaOX1Z37VAZWUxT7IWLu1gCIsL/PNTc1qVQKQIRMZuPf6yoX0USOgFOiaOzBIm0r CpyUXUWJ4bsMbY+ZFyycIIWemY7MilgPAzxLYOkox4kKz4q1sSItTKGMnufuzav8mLz8 nhOwcTschlU3vjpvR1m6piKPrExDfFDoVBkhI+QzH6TqvTWhxQlcUn5RgXawbaywgLgz nsffJF/10WF3LAA9NBR01+I/w/BMPC5UqwTZ7h3ouSXYVmqYTgjwqC8xdz+ag57bXaBS hcMNaxRS+8I2ISV9ePkSN0wGIgMIygrkv7qmA+ulhzqc+w82XJ8n59iTYVQxBGkqNUK1 t5uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=gJv5lCZC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s5-20020a170902ea0500b001afd1a40242si995085plg.637.2023.05.31.08.18.15; Wed, 31 May 2023 08:18:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=gJv5lCZC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234015AbjEaPEN (ORCPT <rfc822;limurcpp@gmail.com> + 99 others); Wed, 31 May 2023 11:04:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233886AbjEaPEA (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 31 May 2023 11:04:00 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9793412B; Wed, 31 May 2023 08:03:58 -0700 (PDT) Received: from arisu.mtl.collabora.ca (mtl.collabora.ca [66.171.169.34]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: detlev) by madras.collabora.co.uk (Postfix) with ESMTPSA id 9DBB26606EB1; Wed, 31 May 2023 16:03:55 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1685545437; bh=ZwlXPYQPfk+GWd3QIJF4+YV66sRpXFI0cOCa/2Pkr1c=; h=From:To:Cc:Subject:Date:From; b=gJv5lCZCo9TpspztOoSp2+J7yKGfADEev9Peyk9pHP7lLl4bXSMcO45nu0OzA5AqA tg+zuNhlup2nWOeoe+1TGtwT97dGLvVmolwotYkCXOsdXoEwxLIAX6AuAUFTkjtr1f jVnkYEzZs/PraQjzYXfz3UpDNg8ZPbs2TH2Yi8KXAiQu888SPZ8sdF5iUt97+ohnXM j6XHJqmJvzugy/w5VxFSHrd6jdO5CT/kCq3FNjG5VSVRMpiE+KbiryXuLVKpIfeSWr SkNj24+b3ct8s/fR05oSjtFKD7aoinOrzpUK/b3uP6+QzO4m3BCIJR0NuJklenbgI+ J2ck/yqQlZBlw== From: Detlev Casanova <detlev.casanova@collabora.com> To: linux-kernel@vger.kernel.org Cc: Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>, Russell King <linux@armlinux.org.uk>, "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Florian Fainelli <f.fainelli@gmail.com>, netdev@vger.kernel.org, devicetree@vger.kernel.org, Detlev Casanova <detlev.casanova@collabora.com> Subject: [PATCH 1/2] dt-bindings: net: phy: Support external PHY xtal Date: Wed, 31 May 2023 11:03:39 -0400 Message-Id: <20230531150340.522994-1-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767423416297184775?= X-GMAIL-MSGID: =?utf-8?q?1767423416297184775?= |
Series |
[1/2] dt-bindings: net: phy: Support external PHY xtal
|
|
Commit Message
Detlev Casanova
May 31, 2023, 3:03 p.m. UTC
Ethernet PHYs can have external an clock that needs to be activated before
probing the PHY.
Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
---
.../devicetree/bindings/net/ethernet-phy.yaml | 10 ++++++++++
1 file changed, 10 insertions(+)
Comments
On Wed, May 31, 2023 at 11:03:39AM -0400, Detlev Casanova wrote: > Ethernet PHYs can have external an clock that needs to be activated before > probing the PHY. > > Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com> > --- > .../devicetree/bindings/net/ethernet-phy.yaml | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/Documentation/devicetree/bindings/net/ethernet-phy.yaml b/Documentation/devicetree/bindings/net/ethernet-phy.yaml > index 4f574532ee13..e83a33c2aa59 100644 > --- a/Documentation/devicetree/bindings/net/ethernet-phy.yaml > +++ b/Documentation/devicetree/bindings/net/ethernet-phy.yaml > @@ -93,6 +93,16 @@ properties: > the turn around line low at end of the control phase of the > MDIO transaction. > > + clock-names: > + items: > + - const: xtal I don't think xtal is the best of names here. It generally is used as an abbreviation for crystal. And the commit message is about there not being a crystal, but an actual clock. How is this clock named on the datasheet? Andrew
On Wednesday, May 31, 2023 11:16:46 A.M. EDT Andrew Lunn wrote: > On Wed, May 31, 2023 at 11:03:39AM -0400, Detlev Casanova wrote: > > Ethernet PHYs can have external an clock that needs to be activated before > > probing the PHY. > > > > Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com> > > --- > > > > .../devicetree/bindings/net/ethernet-phy.yaml | 10 ++++++++++ > > 1 file changed, 10 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/net/ethernet-phy.yaml > > b/Documentation/devicetree/bindings/net/ethernet-phy.yaml index > > 4f574532ee13..e83a33c2aa59 100644 > > --- a/Documentation/devicetree/bindings/net/ethernet-phy.yaml > > +++ b/Documentation/devicetree/bindings/net/ethernet-phy.yaml > > > > @@ -93,6 +93,16 @@ properties: > > the turn around line low at end of the control phase of the > > MDIO transaction. > > > > + clock-names: > > + items: > > + - const: xtal > > I don't think xtal is the best of names here. It generally is used as > an abbreviation for crystal. And the commit message is about there not > being a crystal, but an actual clock. > > How is this clock named on the datasheet? In the case of the PHY I used (RTL8211F), it is EXT_CLK. But this must be generic to any (ethernet) PHY, so using ext_clk to match it would not be good either. Now this is about having an external clock, so the ext_clk name makes sense in this case. I'm not pushing one name or another, let's use what you feel is more natural. Detlev.
On 5/31/23 11:00, Detlev Casanova wrote: > On Wednesday, May 31, 2023 11:16:46 A.M. EDT Andrew Lunn wrote: >> On Wed, May 31, 2023 at 11:03:39AM -0400, Detlev Casanova wrote: >>> Ethernet PHYs can have external an clock that needs to be activated before >>> probing the PHY. >>> >>> Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com> >>> --- >>> >>> .../devicetree/bindings/net/ethernet-phy.yaml | 10 ++++++++++ >>> 1 file changed, 10 insertions(+) >>> >>> diff --git a/Documentation/devicetree/bindings/net/ethernet-phy.yaml >>> b/Documentation/devicetree/bindings/net/ethernet-phy.yaml index >>> 4f574532ee13..e83a33c2aa59 100644 >>> --- a/Documentation/devicetree/bindings/net/ethernet-phy.yaml >>> +++ b/Documentation/devicetree/bindings/net/ethernet-phy.yaml >>> >>> @@ -93,6 +93,16 @@ properties: >>> the turn around line low at end of the control phase of the >>> MDIO transaction. >>> >>> + clock-names: >>> + items: >>> + - const: xtal >> >> I don't think xtal is the best of names here. It generally is used as >> an abbreviation for crystal. And the commit message is about there not >> being a crystal, but an actual clock. >> >> How is this clock named on the datasheet? > > In the case of the PHY I used (RTL8211F), it is EXT_CLK. But this must be > generic to any (ethernet) PHY, so using ext_clk to match it would not be > good either. > > Now this is about having an external clock, so the ext_clk name makes sense in > this case. > > I'm not pushing one name or another, let's use what you feel is more natural. You can look up clocks by positional index, maybe this is a case where there are just too many names that PHY vendors will use that we should not be using one specific name in particular, but just define the order in which clocks should be specified.
On 31/05/2023 20:00, Detlev Casanova wrote: >>> + clock-names: >>> + items: >>> + - const: xtal >> >> I don't think xtal is the best of names here. It generally is used as >> an abbreviation for crystal. And the commit message is about there not >> being a crystal, but an actual clock. >> >> How is this clock named on the datasheet? > > In the case of the PHY I used (RTL8211F), it is EXT_CLK. But this must be > generic to any (ethernet) PHY, so using ext_clk to match it would not be > good either. > > Now this is about having an external clock, so the ext_clk name makes sense in > this case. > > I'm not pushing one name or another, let's use what you feel is more natural. Just drop the name. Best regards, Krzysztof
On Thursday, June 1, 2023 12:52:18 P.M. EDT Krzysztof Kozlowski wrote: > On 31/05/2023 20:00, Detlev Casanova wrote: > >>> + clock-names: > >>> + items: > >>> + - const: xtal > >> > >> I don't think xtal is the best of names here. It generally is used as > >> an abbreviation for crystal. And the commit message is about there not > >> being a crystal, but an actual clock. > >> > >> How is this clock named on the datasheet? > > > > In the case of the PHY I used (RTL8211F), it is EXT_CLK. But this must be > > generic to any (ethernet) PHY, so using ext_clk to match it would not be > > good either. > > > > Now this is about having an external clock, so the ext_clk name makes > > sense in this case. > > > > I'm not pushing one name or another, let's use what you feel is more > > natural. > Just drop the name. So I can just use devm_clk_get_optional_enabled(dev, NULL) and I'll get the first clock defines in the device tree ? Detlev.
> So I can just use devm_clk_get_optional_enabled(dev, NULL) and I'll get the > first clock defines in the device tree ? Yes: bcm7xxx.c: clk = devm_clk_get_optional_enabled(&phydev->mdio.dev, NULL); micrel.c: clk = devm_clk_get(&phydev->mdio.dev, "rmii-ref"); smsc.c: refclk = devm_clk_get_optional_enabled(dev, NULL); Andrew
diff --git a/Documentation/devicetree/bindings/net/ethernet-phy.yaml b/Documentation/devicetree/bindings/net/ethernet-phy.yaml index 4f574532ee13..e83a33c2aa59 100644 --- a/Documentation/devicetree/bindings/net/ethernet-phy.yaml +++ b/Documentation/devicetree/bindings/net/ethernet-phy.yaml @@ -93,6 +93,16 @@ properties: the turn around line low at end of the control phase of the MDIO transaction. + clock-names: + items: + - const: xtal + + clocks: + maxItems: 1 + description: + External clock connected to the PHY. If not specified it is assumed + that the PHY uses a fixed crystal or an internal oscillator. + enet-phy-lane-swap: $ref: /schemas/types.yaml#/definitions/flag description: