Re: [PATCH v2 1/4] dt-bindings: net: ethernet-phy: move clocks property to invidivual PHY bindings
From: George Moussalem
Date: Wed Jun 03 2026 - 02:49:10 EST
On 6/2/26 20:34, Conor Dooley wrote:
> On Tue, Jun 02, 2026 at 10:50:37AM +0400, George Moussalem via B4 Relay wrote:
>> From: George Moussalem <george.moussalem@xxxxxxxxxxx>
>>
>> Move the clock property and restriction from the ethernet-phy.yaml file
>> to the individual PHY binding files. This allows each PHY to manage its
>> own clock requirements.
>>
>> Signed-off-by: George Moussalem <george.moussalem@xxxxxxxxxxx>
>> ---
>> Commit 350b7a258f20 introduced the clocks property with a restriction to
>> maximum 1 to the main ethernet-phy.yaml binding for Realtek to add an
>> optional external clock source. This is restrictive to all PHY bindings,
>> as some PHYs may require more than 1 clock such as the IPQ5018 PHY which
>> requires 2 clocks (for RX and TX).
>>
>> There are three other PHY drivers that require clock management:
>> - Micrel: requires 1 optional clock and the micrel.yaml file already
>> accomodates for the clock property.
>> - SMSC: requires an optional clock and the legacy bindings file
>> (smsc-lan87xx.txt) already accomodates for the clock property.
>> - BCM7xxx: requires an optional clock. I could not find a bindings file
>> for this PHY family.
>
> Have you done a large-scale dtbs_check run with this patch applied and
> checked that it does not ban having a clock for phys with no dedicated
> bindings?
I've ran: make V=s CHECK_DTBS=y DT_SCHEMA_FILES=/net/ ARCH=arm64
There were a whole lot of errors, mostly related to missing required
regulator/power-supply properties, but none related to clocks.
Also ran: make dt_binding_check DT_SCHEMA_FILES=/net/
This ran successfully apart from the one error I highlighted in my reply
to Rob on v1:
DTC [C] Documentation/devicetree/bindings/net/renesas,ether.example.dtb
/home/george/src/linux-next/out/Documentation/devicetree/bindings/net/renesas,ether.example.dtb:
ethernet-phy@1 (ethernet-phy-id0022.1537): compatible:
['ethernet-phy-id0022.1537', 'ethernet-phy-ieee802.3-c22'] is too long
from schema $id: http://devicetree.org/schemas/net/micrel.yaml
In addition, I ran `grep -r '#include <linux/clk.h>' drivers/net/phy` to
identify all phy drivers that manage clocks which I've reported above.
There's one more: xlnx_gmii2rgmii.c which acquires and enables 1 clock
which is also accounted for in its schema.
None of the phy-core files manage clocks.
> I feel like weakening the limit of a single clock is probably more
> accurate than outright banning clocks for ethernet phys without a
> dedicated binding?
If you think increasing the restriction is a better solution, I can
submit an updated version. Kindly let me know.
>
> Cheers,
> Conor.
>
>> ---
>> Documentation/devicetree/bindings/net/ethernet-phy.yaml | 6 ------
>> Documentation/devicetree/bindings/net/realtek,rtl82xx.yaml | 6 ++++++
>> 2 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/net/ethernet-phy.yaml b/Documentation/devicetree/bindings/net/ethernet-phy.yaml
>> index 21a1a63506f0..709ea976ef79 100644
>> --- a/Documentation/devicetree/bindings/net/ethernet-phy.yaml
>> +++ b/Documentation/devicetree/bindings/net/ethernet-phy.yaml
>> @@ -105,12 +105,6 @@ properties:
>> 1BR-10 names. The PHY must be configured to operate in BroadR-Reach mode
>> by software.
>>
>> - 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:
>> diff --git a/Documentation/devicetree/bindings/net/realtek,rtl82xx.yaml b/Documentation/devicetree/bindings/net/realtek,rtl82xx.yaml
>> index 45033c31a2d5..8a26f6941dc4 100644
>> --- a/Documentation/devicetree/bindings/net/realtek,rtl82xx.yaml
>> +++ b/Documentation/devicetree/bindings/net/realtek,rtl82xx.yaml
>> @@ -38,6 +38,12 @@ properties:
>> - ethernet-phy-id001c.cad0
>> - ethernet-phy-id001c.cb00
>>
>> + 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.
>> +
>> leds: true
>>
>> realtek,aldps-enable:
>>
>> --
>> 2.53.0
>>
>>
Best regards,
George