2007-10-11 12:32:06

by Rick Niles

[permalink] [raw]
Subject: Help with rtc to hpet conversion of OSGPS driver

I'm the Linux maintainer for the OSGPS (open source GPS) project. Our
last release version was based off Fedora 5 and since we have had some
hardware issues with our on board interrupt line I was using the RTC
interrupt to service the tracking loops. I've been trying to make the
driver work with Fedora 7 and the 2.6.22 kernel, but the rtc_register()
and other RTC functions seems to have been removed. I see they've been
replaced by the corresponding HPET functions, which is great. However,
hpet_register() always returns -16 (EBUSY). This could be because I
lack the correct hardware (I'm running 32-bit Linux on a Athlon64 with
an NVIDIA chipset) or some other reason.

I'm looking for any help here. The RTC version of the code can be
viewed at:
http://osgps.cvs.sourceforge.net/osgps/osgps/linuxmod.c?revision=1.12&view=markup

Can device drivers still use the real-time clock at all? Does the
tickless kernel effect this at all?

Thanks for any help you can lend,
Rick Niles.


2007-10-11 12:37:46

by Jan Engelhardt

[permalink] [raw]
Subject: Re: Help with rtc to hpet conversion of OSGPS driver


On Oct 11 2007 08:01, Rick Niles wrote:
>
> I've been trying to make the driver work with
> Fedora 7 and the 2.6.22 kernel, but the rtc_register() and other RTC functions
> seems to have been removed.

grep -r rtc_device_register drivers/rtc/

Does that help?

> I see they've been replaced by the corresponding
> HPET functions, which is great. However, hpet_register() always returns -16
> (EBUSY). This could be because I lack the correct hardware (I'm running 32-bit
> Linux on a Athlon64 with an NVIDIA chipset) or some other reason.

2007-10-11 12:52:23

by Rick Niles

[permalink] [raw]
Subject: Re: Help with rtc to hpet conversion of OSGPS driver

Maybe I'm way off here, but that seems to be the function to register a
RTC hardware chip with the kernel. I want to use a real-time clock
interrupt to wake up my driver and service the GPS correlator, about
every 500ms. Please let me know if I'm misunderstanding.

Jan Engelhardt wrote:
> On Oct 11 2007 08:01, Rick Niles wrote:
>
>> I've been trying to make the driver work with
>> Fedora 7 and the 2.6.22 kernel, but the rtc_register() and other RTC functions
>> seems to have been removed.
>>
>
> grep -r rtc_device_register drivers/rtc/
>
> Does that help?
>
>
>> I see they've been replaced by the corresponding
>> HPET functions, which is great. However, hpet_register() always returns -16
>> (EBUSY). This could be because I lack the correct hardware (I'm running 32-bit
>> Linux on a Athlon64 with an NVIDIA chipset) or some other reason.
>>

2007-10-11 13:23:30

by Jan Engelhardt

[permalink] [raw]
Subject: Re: Help with rtc to hpet conversion of OSGPS driver


On Oct 11 2007 08:51, Rick Niles wrote:
>
> Maybe I'm way off here, but that seems to be the function to register a RTC
> hardware chip with the kernel. I want to use a real-time clock interrupt to
> wake up my driver and service the GPS correlator, about every 500ms. Please
> let me know if I'm misunderstanding.

You register your hardware, and then the userspace program opens /dev/rtc17
or whatever node is assigned to it, and receives periodic interrupts.
At least that's the theory for rtc-cmos.

And don't top post.

2007-10-12 04:20:57

by Robert Hancock

[permalink] [raw]
Subject: Re: Help with rtc to hpet conversion of OSGPS driver

Rick Niles wrote:
> I'm the Linux maintainer for the OSGPS (open source GPS) project. Our
> last release version was based off Fedora 5 and since we have had some
> hardware issues with our on board interrupt line I was using the RTC
> interrupt to service the tracking loops. I've been trying to make the
> driver work with Fedora 7 and the 2.6.22 kernel, but the rtc_register()
> and other RTC functions seems to have been removed. I see they've been
> replaced by the corresponding HPET functions, which is great. However,
> hpet_register() always returns -16 (EBUSY). This could be because I
> lack the correct hardware (I'm running 32-bit Linux on a Athlon64 with
> an NVIDIA chipset) or some other reason.
>
> I'm looking for any help here. The RTC version of the code can be
> viewed at:
> http://osgps.cvs.sourceforge.net/osgps/osgps/linuxmod.c?revision=1.12&view=markup
>
>
> Can device drivers still use the real-time clock at all? Does the
> tickless kernel effect this at all?
>
> Thanks for any help you can lend,
> Rick Niles.

Am I missing why you can't just use a normal kernel timer for this? You
shouldn't have to mess with the RTC or HPET directly..

--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from [email protected]
Home Page: http://www.roberthancock.com/