Commits
WingMan Kwok committed 704e022e213
net: ethernet: ti: introduce ptp boundary clock internal sync monitor On some of TI's platforms, more than one timing capable modules are included. Consider, for example, the CPTS and the two IEP modules on AM57xx platforms. When these timing modules participate in a PTP boundary clock (BC) functionality, the PTP clocks implemented by these modules need to be internally synchronized to the same PTP time of the PTP domain in which the BC participates. If the internal sync is done by using the 1PPS generated by the timing modules, it needs to make sure that only one such module is generating 1PPS at any given instant of time, for otherwise the SoC life may be damaged over time when more than one timing module has output signal going against each other. It is not suffice to rely on the application that implements that PTP boundary clock software functionality to ensure the one out-going PPS policy for user may "accidentally" issue PPS enablement outside of the PTP BC application, for example, through sysfs. This patch introduces a small driver so that the driver of each BC participating timing module needs to get permission from this driver before it can enable its PPS. A gpio-controlled multiplexer is added to guarantee there will be only one PPS signal output at any time. Two of the gpio control pins pps_mux sel0 and pps_mux_sel1 will be maintained by this module. This patch implements the gpio-based 1PPS output selection: - extract the pps_mux_sel0 and pps_mux_sel1 gpio from device tree - acquire and initialize those gpios - define and use clock type to determine the desired gpio values - update the ptp_bc_clock_register API to pass the clock type - update the cpts clock driver to pass clock type while invoking ptp_bc_clock_register - update the prueth (iep) clock driver to pass clock type while invoking ptp_bc_clock_register Signed-off-by: WingMan Kwok <w-kwok2@ti.com> Signed-off-by: Eric Ruei <e-ruei1@ti.com> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>