/** * cavium_ptp_adjfine() - Adjust ptp frequency * @ptp_info: PTP clock info * @scaled_ppm: how much to adjust by, in parts per million, but with a * 16 bit binary fractional field
*/ staticint cavium_ptp_adjfine(struct ptp_clock_info *ptp_info, long scaled_ppm)
{ struct cavium_ptp *clock =
container_of(ptp_info, struct cavium_ptp, ptp_info); unsignedlong flags;
u64 comp;
u64 adj; bool neg_adj = false;
/* The hardware adds the clock compensation value to the PTP clock * on every coprocessor clock cycle. Typical convention is that it * represent number of nanosecond betwen each cycle. In this * convention compensation value is in 64 bit fixed-point * representation where upper 32 bits are number of nanoseconds * and lower is fractions of nanosecond. * The scaled_ppm represent the ratio in "parts per bilion" by which the * compensation value should be corrected. * To calculate new compenstation value we use 64bit fixed point * arithmetic on following formula * comp = tbase + tbase * scaled_ppm / (1M * 2^16) * where tbase is the basic compensation value calculated initialy * in cavium_ptp_init() -> tbase = 1/Hz. Then we use endian * independent structure definition to write data to PTP register.
*/
comp = ((u64)1000000000ull << 32) / clock->clock_rate;
adj = comp * scaled_ppm;
adj >>= 16;
adj = div_u64(adj, 1000000ull);
comp = neg_adj ? comp - adj : comp + adj;
/** * cavium_ptp_enable() - Request to enable or disable an ancillary feature. * @ptp_info: PTP clock info * @rq: request * @on: is it on
*/ staticint cavium_ptp_enable(struct ptp_clock_info *ptp_info, struct ptp_clock_request *rq, int on)
{ return -EOPNOTSUPP;
}
error: /* For `cavium_ptp_get()` we need to differentiate between the case * when the core has not tried to probe this device and the case when * the probe failed. In the later case we pretend that the * initialization was successful and keep the error in * `dev->driver_data`.
*/
pci_set_drvdata(pdev, ERR_PTR(err)); return 0;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.