Re: Modifying binding or duplicating compatible string
From: Rob Herring <hidden>
Date: 2017-05-10 12:32:35
On Tue, May 9, 2017 at 5:09 AM, Rafał Miłecki [off-list ref] wrote:
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?Depends on the context. ;) I think here it would be fine because you have differing buses.
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.
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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html