Modifying binding or duplicating compatible string
Hi,
We currently have a "brcm,ns-ax-usb3-phy" binding defined for Broadcom's USB 3.0 PHY which you can find in:Documentation/devicetree/bindings/phy/bcm-ns-usb3-phy.txt
It looks like this:
usb3-phy {
compatible = "brcm,ns-ax-usb3-phy";
reg = <0x18003000 0x1000>, <0x18105000 0x1000>;
reg-names = "ccb-mii", "dmp";
#phy-cells = <0>;
};The problem is that PHY is actually attached to the MDIO bus and 0x18003000
+ 0x18003004 registers are used to access whole MDIO, not just this single PHY.
A correct binding should look like this:
mdio: mdio@18003000 {
compatible = "brcm,iproc-mdio";
reg = <0x18003000 0x8>;
#size-cells = <1>;
#address-cells = <0>;
usb3-phy@10 {
compatible = "brcm,ns-ax-usb3-phy";
reg = <0x10>;
usb3-dmp-syscon = <&usb3_dmp>;
#phy-cells = <0>;
};
};usb3_dmp: syscon@18105000 {
reg = <0x18105000 0x1000>;
};I mean to clean up this situation. My question is: is this acceptable to support the same compatible string in two contexts?
1) For backward compatibility the first one would require specifying both:
ccb-mii / MDIO register and DMP register.
2) For cleaniness the new one would require reg to be PHY index and DMP one to be specified with usb3-dmp-syscon.
In Linux there shouldn't be a problem as MDIO children nodes are handled separately, but I still don't know if it's an acceptable solution.
Can I have some opinions on this, please?
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 36 lines · Rafał Miłecki
Hi,
We currently have a "brcm,ns-ax-usb3-phy" binding defined for Broadcom's USB 3.0 PHY which you can find in:
Documentation/devicetree/bindings/phy/bcm-ns-usb3-phy.txtIt looks like this:
usb3-phy { compatible = "brcm,ns-ax-usb3-phy"; reg = <0x18003000 0x1000>, <0x18105000 0x1000>; reg-names = "ccb-mii", "dmp"; #phy-cells = <0>; };The problem is that PHY is actually attached to the MDIO bus and
0x18003000
+0x18003004registers are used to access whole MDIO, not just this single PHY.A correct binding should look like this:
mdio: mdio@18003000 { compatible = "brcm,iproc-mdio"; reg = <0x18003000 0x8>; #size-cells = <1>; #address-cells = <0>; usb3-phy@10 { compatible = "brcm,ns-ax-usb3-phy"; reg = <0x10>; usb3-dmp-syscon = <&usb3_dmp>; #phy-cells = <0>; }; };
Quoted 7 lines
usb3_dmp: syscon@18105000 { reg = <0x18105000 0x1000>; };I mean to clean up this situation. My question is: is this acceptable to support the same compatible string in two contexts?
Depends on the context. ;) I think here it would be fine because you have differing buses.
Quoted 2 lines
1) For backward compatibility the first one would require specifying both:
ccb-mii / MDIO register and DMP register.
You don't need both in the DT. New DT and old OS is not a combination we worry about. You either have the old binding or new one in the DT. It's the driver that would need to probe the old way (presumably as a platform device) and the new way as an mdio device.
You can decide whether you need to support the old way or not. Depends on who it would affect for your platform.
Quoted 7 lines
2) For cleaniness the new one would require reg to be PHY index and DMP one to be specified with usb3-dmp-syscon.
In Linux there shouldn't be a problem as MDIO children nodes are handled separately, but I still don't know if it's an acceptable solution.
Can I have some opinions on this, please?
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 9 lines · Rob Herring
Quoted 2 lines
I mean to clean up this situation. My question is: is this acceptable to support the same compatible string in two contexts?
Depends on the context. ;) I think here it would be fine because you have differing buses.
Quoted 2 lines
1) For backward compatibility the first one would require specifying both:
ccb-mii / MDIO register and DMP register.
Quoted 7 lines
You don't need both in the DT. New DT and old OS is not a combination we worry about. You either have the old binding or new one in the DT. It's the driver that would need to probe the old way (presumably as a platform device) and the new way as an mdio device.
You can decide whether you need to support the old way or not. Depends on who it would affect for your platform.
Thank you for the help! I'll proceed with that.
Signature · 5 lines
Rafał -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html