net: ethernet: ti: cpts: calc mult and shift from refclk freq
The cyclecounter mult and shift values can be calculated based on the
CPTS rfclk frequency and timekeepnig framework provides required algos
and API's.
Hence, calc mult and shift basing on CPTS rfclk frequency if both
cpts_clock_shift and cpts_clock_mult properties are not provided in DT (the
basis of calculation algorithm is borrowed from
__clocksource_update_freq_scale() commit 7d2f944a2b
("clocksource:
Provide a generic mult/shift factor calculation")). After this change
cpts_clock_shift and cpts_clock_mult DT properties will become optional.
Cc: John Stultz <john.stultz@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
5304121ada
commit
88f0f0b0be
@@ -20,8 +20,6 @@ Required properties:
|
||||
- slaves : Specifies number for slaves
|
||||
- active_slave : Specifies the slave to use for time stamping,
|
||||
ethtool and SIOCGMIIPHY
|
||||
- cpts_clock_mult : Numerator to convert input clock ticks into nanoseconds
|
||||
- cpts_clock_shift : Denominator to convert input clock ticks into nanoseconds
|
||||
|
||||
Optional properties:
|
||||
- ti,hwmods : Must be "cpgmac0"
|
||||
@@ -35,7 +33,11 @@ Optional properties:
|
||||
For example in dra72x-evm, pcf gpio has to be
|
||||
driven low so that cpsw slave 0 and phy data
|
||||
lines are connected via mux.
|
||||
|
||||
- cpts_clock_mult : Numerator to convert input clock ticks into nanoseconds
|
||||
- cpts_clock_shift : Denominator to convert input clock ticks into nanoseconds
|
||||
Mult and shift will be calculated basing on CPTS
|
||||
rftclk frequency if both cpts_clock_shift and
|
||||
cpts_clock_mult properties are not provided.
|
||||
|
||||
Slave Properties:
|
||||
Required properties:
|
||||
|
Reference in New Issue
Block a user