RE: [RFC PATCH v2 1/2] macb: Add 1588 support in Cadence GEM.

2016-11-24 Thread Andrei.Pistirica
a...@davemloft.net; > nicolas.fe...@atmel.com; harinikatakamli...@gmail.com; > harini.kata...@xilinx.com; punn...@xilinx.com; mich...@xilinx.com; > anir...@xilinx.com; boris.brezil...@free-electrons.com; > alexandre.bell...@free-electrons.com; tbul...@pixelsurmer.com > Subject: Re: [RFC PATCH

Re: [RFC PATCH v2 1/2] macb: Add 1588 support in Cadence GEM.

2016-11-23 Thread Richard Cochran
On Wed, Nov 23, 2016 at 02:34:03PM +0100, Andrei Pistirica wrote: > From what I understand, your suggestion is: > (ns | frac) * ppb = (total_ns | total_frac) > (total_ns | total_frac) / 10^9 = (adj_ns | adj_frac) > This is correct iff total_ns/10^9 >= 1, but the problem is that there are > missed f

Re: [RFC PATCH v2 1/2] macb: Add 1588 support in Cadence GEM.

2016-11-23 Thread Andrei Pistirica
On 20.11.2016 20:37, Richard Cochran wrote: On Fri, Nov 18, 2016 at 03:21:51PM +0100, Andrei Pistirica wrote: +#ifdef CONFIG_MACB_USE_HWSTAMP +void macb_ptp_init(struct net_device *ndev); +#else +void macb_ptp_init(struct net_device *ndev) { } static inline ^^^ I can do static inline only

Re: [RFC PATCH v2 1/2] macb: Add 1588 support in Cadence GEM.

2016-11-23 Thread Andrei Pistirica
On 20.11.2016 20:18, Richard Cochran wrote: On Fri, Nov 18, 2016 at 03:21:51PM +0100, Andrei Pistirica wrote: - Frequency adjustment is not directly supported by this IP. This statement still makes no sense. Doesn't the following text... This statement is inherited from original patch, an

Re: [RFC PATCH v2 1/2] macb: Add 1588 support in Cadence GEM.

2016-11-20 Thread Richard Cochran
On Fri, Nov 18, 2016 at 03:21:51PM +0100, Andrei Pistirica wrote: > +#ifdef CONFIG_MACB_USE_HWSTAMP > +void macb_ptp_init(struct net_device *ndev); > +#else > +void macb_ptp_init(struct net_device *ndev) { } static inline ^^^ > +#endif > +void macb_ptp_init(struct net_device *ndev) > +{ > +

Re: [RFC PATCH v2 1/2] macb: Add 1588 support in Cadence GEM.

2016-11-20 Thread Richard Cochran
On Fri, Nov 18, 2016 at 03:21:51PM +0100, Andrei Pistirica wrote: > - Frequency adjustment is not directly supported by this IP. This statement still makes no sense. Doesn't the following text... > addend is the initial value ns increment and similarly addendesub. > The ppb (parts per billio

[RFC PATCH v2 1/2] macb: Add 1588 support in Cadence GEM.

2016-11-18 Thread Andrei Pistirica
Cadence GEM provides a 102 bit time counter with 48 bits for seconds, 30 bits for nsecs and 24 bits for sub-nsecs to control 1588 timestamping. This patch does the following: - Registers to ptp clock framework - Timer initialization is done by writing time of day to the timer counter. - ns increme