From: Chris L. <cl...@gm...> - 2013-04-23 12:16:34
|
On Tue, Apr 23, 2013 at 2:00 AM, Richard Cochran <ric...@gm...>wrote: > On Mon, Apr 22, 2013 at 05:18:30PM -0400, Chris LaRocque wrote: > > > > Could one of you kind folks point me toward the files where the gianfar > > timer functionality could or would be implemented? > > - kernel/time/posix-clock.c > - drivers/net/ethernet/freescale/gianfar_ptp.c > > > Was / is there an example or two which would show me the light? > > You can see the original version at > > https://lists.ozlabs.org/pipermail/linuxppc-dev/2010-May/082433.html > > but this was before the posix clock idea came along. > > > I need to know the magnitude of the task before I take this info to > > management. > > Maybe you can just use normal timers using CLOCK_REALTIME or > CLOCK_MONOTONIC? > > This what I recommend. PHC timer support has been designed into the > API, but it has not been implemented. There are two reasons why it is > still missing. > > First, adding the logic would be a non-trivial exercise (see how the > hrtimer stuff works, to get an idea). > > Second, it is doubtful whether having direct PHC timers would perform > much better than just synchronizing the system clock to the PHC, and > using normal timers. > > I did a whole paper on that second point, and I am convinced that it > just isn't worth the effort to implement PHC timers. However, I would > support the addition of the code, if you or someone else wants to > develop it. > > HTH, > Richard > Thank You I have already looked into the hrtimer source and also found the discussions you had back in 2010 about the API. Of course I have also read your paper. If we were just syncing the clocks I'd be done. Unfortunately, I had counted on the alarm output to drive data acquisition within our distributed system. I am now investigating timers and gpio to accomplish the same goal; as long as the triggers will generate and queue the timestamps the project will succeed. I'm just not as far along as I had believed. Your comment about multiplexing of the pin function is apropos. I should have recognized something was amiss when TSEC_TMR_GCLK was not present on the 1588 header. I am looking into where the changes to the config register should be accomplished. What would really be convenient is if I can get the tigger input to start one of the fiper which would then toggle an alarm pin in one of two modes: oneshot or periodic at an arbitrary interval; without interupting the processor. I need time stamping of events occuring at rates of 1 kHz or greater. Pointers appreciated. Regards Chris |