Re: [PATCH 4/6] dt-bindings: net: add hisilicon-femac

From: Yang Xiwen
Date: Fri Feb 16 2024 - 04:48:31 EST


On 2/16/2024 5:41 PM, Krzysztof Kozlowski wrote:
On 16/02/2024 10:36, Yang Xiwen wrote:
+ maxItems: 2
+
+ reset-names:
+ items:
+ - const: mac
+ - const: phy
+
+ hisilicon,phy-reset-delays-us:
+ minItems: 3
+ maxItems: 3
+ description: |
+ The 1st cell is reset pre-delay in micro seconds.
+ The 2nd cell is reset pulse in micro seconds.
+ The 3rd cell is reset post-delay in micro seconds.
items:
- description:

Anyway, isn't this property of the phy?
It ought to be. But it seems a bit hard to implement it like this.
Why? You have phy node, so phy should know what to do.
It's not PHY which needs special treatment. It's the MAC. The PHY needs to be reset with MAC and BUS clocks disabled explicitly(see hisi_femac_phy_reset() in patch 1). I can't find a way to implement this easily except moving all clocks/resets management to MAC driver. Especially when the boot loader might has enabled the clocks already (so the clocks need to be disabled explicitly(i.e. call clk_prepare_enable() and clk_disable() for them, and ensure there is only one consumer).



Best regards,
Krzysztof


--
Regards,
Yang Xiwen