xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/ptp/timestamper.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunTime stamps from MII bus snooping devices
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunThis binding supports non-PHY devices that snoop the MII bus and
4*4882a593Smuzhiyunprovide time stamps.  In contrast to PHY time stamping drivers (which
5*4882a593Smuzhiyuncan simply attach their interface directly to the PHY instance), stand
6*4882a593Smuzhiyunalone MII time stamping drivers use this binding to specify the
7*4882a593Smuzhiyunconnection between the snooping device and a given network interface.
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunNon-PHY MII time stamping drivers typically talk to the control
10*4882a593Smuzhiyuninterface over another bus like I2C, SPI, UART, or via a memory mapped
11*4882a593Smuzhiyunperipheral.  This controller device is associated with one or more
12*4882a593Smuzhiyuntime stamping channels, each of which snoops on a MII bus.
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunThe "timestamper" property lives in a phy node and links a time
15*4882a593Smuzhiyunstamping channel from the controller device to that phy's MII bus.
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunExample:
18*4882a593Smuzhiyun
19*4882a593Smuzhiyun	tstamper: timestamper@10000000 {
20*4882a593Smuzhiyun		compatible = "ines,ptp-ctrl";
21*4882a593Smuzhiyun		reg = <0x10000000 0x80>;
22*4882a593Smuzhiyun	};
23*4882a593Smuzhiyun
24*4882a593Smuzhiyun	ethernet@20000000 {
25*4882a593Smuzhiyun		mdio {
26*4882a593Smuzhiyun			ethernet-phy@1 {
27*4882a593Smuzhiyun				timestamper = <&tstamper 0>;
28*4882a593Smuzhiyun			};
29*4882a593Smuzhiyun		};
30*4882a593Smuzhiyun	};
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun	ethernet@30000000 {
33*4882a593Smuzhiyun		mdio {
34*4882a593Smuzhiyun			ethernet-phy@2 {
35*4882a593Smuzhiyun				timestamper = <&tstamper 1>;
36*4882a593Smuzhiyun			};
37*4882a593Smuzhiyun		};
38*4882a593Smuzhiyun	};
39*4882a593Smuzhiyun
40*4882a593SmuzhiyunIn this example, time stamps from the MII bus attached to phy@1 will
41*4882a593Smuzhiyunappear on time stamp channel 0 (zero), and those from phy@2 appear on
42*4882a593Smuzhiyunchannel 1.
43