From: Josua Mayer <josua@solid-run.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
netdev@vger.kernel.org
Cc: alvaro.karsz@solid-run.com,
Michael Hennerich <michael.hennerich@analog.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Alexandru Ardelean <alexandru.ardelean@analog.com>
Subject: Re: [PATCH 1/3] dt: adin: document clk-out property
Date: Mon, 11 Apr 2022 10:42:18 +0300 [thread overview]
Message-ID: <b519690c-a487-e64c-86e1-bd37e38dc7a7@solid-run.com> (raw)
In-Reply-To: <e0511d39-7915-3ce1-60c7-9d7739f1b253@linaro.org>
\o/
Am 10.04.22 um 22:01 schrieb Krzysztof Kozlowski:
> On 10/04/2022 20:41, Josua Mayer wrote:
>>> Adjust subject prefix to the subsystem (dt-bindings, not dt, missing net).
>> Ack. So something like
>> dt-bindings: net: adin: document clk-out property
> Yes.
Great, I will have it changed in a future revision!
>>>> Signed-off-by: Josua Mayer <josua@solid-run.com>
>>>> ---
>>>> Documentation/devicetree/bindings/net/adi,adin.yaml | 5 +++++
>>>> 1 file changed, 5 insertions(+)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/net/adi,adin.yaml b/Documentation/devicetree/bindings/net/adi,adin.yaml
>>>> index 1129f2b58e98..4e421bf5193d 100644
>>>> --- a/Documentation/devicetree/bindings/net/adi,adin.yaml
>>>> +++ b/Documentation/devicetree/bindings/net/adi,adin.yaml
>>>> @@ -36,6 +36,11 @@ properties:
>>>> enum: [ 4, 8, 12, 16, 20, 24 ]
>>>> default: 8
>>>>
>>>> + adi,clk-out-frequency:
>>> Use types defined by the dtschema, so "adi,clk-out-hz". Then no need for
>>> type/ref.
>> That sounds useful, I was not aware. The only inspiration I used was the
>> at803x driver ...
>> It seemed natural to share the property name as it serves the same
>> purpose here.
> Indeed ar803x uses such property. In general reusing properties is a
> good idea, but not all properties are good enough to copy. I don't know
> why adi,clk-out-frequency got accepted because we really stick to common
> units when possible.
>
> https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml
>
>>>> + description: Clock output frequency in Hertz.
>>>> + $ref: /schemas/types.yaml#/definitions/uint32
>>>> + enum: [125000000]
>>> If only one value, then "const: 125000000", but why do you need such
>>> value in DT if it is always the same?
>> Yes yes yes.
>> From my understanding of the adin1300 data-sheet, it can provide either
>> a 25MHz clock or a 125MHz clock on its GP_CLK pin. So for the context of
>> this feature we would have two options. However because we found the
>> documentation very confusing we skipped the 25MHz option.
>>
>> Actually my statement above omits some of the options.
>> - There are actually two 125MHz clocks, the first called "recovered" and
>> the second "free running".
>> - One can let the phy choose the rate based on its internal state.
>> This is indicated on page 73 of the datasheet
>> (https://www.analog.com/media/en/technical-documentation/data-sheets/adin1300.pdf)
>>
>> Because of this confusion we wanted to for now only allow selecting the
>> free-running 125MHz clock.
> Hm, so you do not insist on actual frequency but rather type of the
> clock (freerunning instead of recovered and 25 MHz). Then the frequency
> does not look enough because it does not offer you the choice of clock
> (freerunning or recovered) and instead you could have enum like:
> adi,phy-output-clock:
> $ref: /schemas/types.yaml#/definitions/string
> enum: [125mhz-freerunning, 125mhz-recovered, 25mhz-freeruning....]
>
> Judging by page 24 you have 5 or more options... This could be also
> numeric ID (enum [0, 1, 2, 3 ...]) with some explanation, but strings
> seem easier to understand.
I agree that strings are more meaningful here, especially considering
how each entry carries at least two pieces of information.
If we are not to reuse the qca,clk-out-frequency name, then an enum
seems the easiest way to describe the available settings from the clock
config register!
> The binding should describe the hardware, not implementation in Linux,
> therefore you should actually list all possible choices. The driver then
> can just return EINVAL on unsupported choices (or map them back to only
> one supported).
I have prepared a draft for the entries that should exist, it covers
five of the 6 available bits. Maybe you can comment if this is
understandable?
adi,phy-output-clock:
description: Select clock output on GP_CLK pin. Three clocks are
available:
A 25MHz reference, a free-running 125MHz and a recovered 125MHz.
The phy can also automatically switch between the reference and the
respective 125MHz clocks based on its internal state.
$ref: /schemas/types.yaml#/definitions/string
enum:
- 25mhz-reference
- 125mhz-free-running
- 125mhz-recovered
- adaptive-free-running
- adaptive-recovered
Bit no. 3 (GE_REF_CLK_EN) is special in that it can be enabled
independently from the 5 choices above,
and it controls a different pin. Therefore it deserves its own property,
perhaps a flag or boolean adi,phy-output-ref-clock.
Any opinion if this should be added, or we can omit it completely?
sincerely
Josua Mayer
next prev parent reply other threads:[~2022-04-11 7:42 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-10 10:46 [PATCH 0/3] adin: add support for 125MHz clk-out Josua Mayer
2022-04-10 10:46 ` [PATCH 1/3] dt: adin: document clk-out property Josua Mayer
2022-04-10 14:21 ` Krzysztof Kozlowski
2022-04-10 18:41 ` Josua Mayer
2022-04-10 19:01 ` Krzysztof Kozlowski
2022-04-11 7:42 ` Josua Mayer [this message]
2022-04-11 20:07 ` Jakub Kicinski
2022-04-11 20:59 ` Andrew Lunn
2022-04-11 21:33 ` Jakub Kicinski
2022-04-12 0:29 ` Andrew Lunn
2022-04-10 10:46 ` [PATCH 2/3] net: phy: adin: add support for 125MHz clk-out Josua Mayer
2022-04-10 10:46 ` [PATCH 3/3] ARM: dts: imx6qdl-sr-som: update phy configuration for som revision 1.9 Josua Mayer
2022-04-19 10:27 ` [PATCH v2 0/3] adin: add support for clock output Josua Mayer
2022-04-19 10:27 ` [PATCH v2 1/3] dt-bindings: net: adin: document phy clock output properties Josua Mayer
2022-04-21 12:24 ` Andrew Lunn
2022-04-19 10:27 ` [PATCH v2 2/3] net: phy: adin: add support for clock output Josua Mayer
2022-04-21 6:45 ` kernel test robot
2022-04-27 7:06 ` Josua Mayer
2022-04-19 10:27 ` [PATCH v2 3/3] ARM: dts: imx6qdl-sr-som: update phy configuration for som revision 1.9 Josua Mayer
2022-04-21 12:27 ` Andrew Lunn
2022-04-21 13:03 ` Russell King (Oracle)
2022-04-21 13:30 ` Andrew Lunn
2022-04-21 14:20 ` Russell King (Oracle)
2022-04-27 7:15 ` Josua Mayer
2022-05-09 16:01 ` Russell King (Oracle)
2022-04-28 8:28 ` [PATCH v3 0/3] adin: add support for clock output Josua Mayer
2022-04-28 8:28 ` [PATCH v3 1/3] dt-bindings: net: adin: document phy clock output properties Josua Mayer
2022-05-05 15:52 ` Josua Mayer
2022-05-05 20:24 ` Krzysztof Kozlowski
2022-05-08 9:57 ` Josua Mayer
2022-05-09 7:21 ` Krzysztof Kozlowski
2022-05-09 12:36 ` Josua Mayer
2022-04-28 8:28 ` [PATCH v3 2/3] net: phy: adin: add support for clock output Josua Mayer
2022-04-28 12:21 ` Andrew Lunn
2022-04-28 12:52 ` Josua Mayer
2022-04-28 23:34 ` Andrew Lunn
2022-04-28 8:28 ` [PATCH v3 3/3] ARM: dts: imx6qdl-sr-som: update phy configuration for som revision 1.9 Josua Mayer
2022-05-05 1:42 ` Shawn Guo
2022-05-09 14:36 ` [PATCH v4 0/3] adin: add support for clock output Josua Mayer
2022-05-09 14:36 ` [PATCH v4 1/3] dt-bindings: net: adin: document phy clock output properties Josua Mayer
2022-05-10 10:22 ` Krzysztof Kozlowski
2022-05-10 20:39 ` Jakub Kicinski
2022-05-11 12:58 ` [PATCH v4 1/3] dt-bindings: net: adin: document phy clock Michael Walle
2022-05-11 16:11 ` Jakub Kicinski
2022-05-11 17:10 ` Michael Walle
2022-05-11 19:42 ` Jakub Kicinski
2022-05-12 21:20 ` Michael Walle
2022-05-12 22:44 ` Jakub Kicinski
2022-05-15 7:16 ` Josua Mayer
2022-05-16 17:43 ` Jakub Kicinski
2022-05-16 19:48 ` Josua Mayer
2022-05-16 22:40 ` Jakub Kicinski
2022-05-17 8:50 ` Josua Mayer
2022-05-09 14:36 ` [PATCH v4 2/3] net: phy: adin: add support for clock output Josua Mayer
2022-05-09 14:36 ` [PATCH v4 3/3] ARM: dts: imx6qdl-sr-som: update phy configuration for som revision 1.9 Josua Mayer
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=b519690c-a487-e64c-86e1-bd37e38dc7a7@solid-run.com \
--to=josua@solid-run.com \
--cc=alexandru.ardelean@analog.com \
--cc=alvaro.karsz@solid-run.com \
--cc=davem@davemloft.net \
--cc=krzk+dt@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=kuba@kernel.org \
--cc=michael.hennerich@analog.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh+dt@kernel.org \
/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).