mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Kernel Real Time Clock (RTC) Support for I2C Devices
@ 2001-04-18 19:13 Grant Erickson
  2001-04-18 19:35 ` Gabriel Paubert
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Grant Erickson @ 2001-04-18 19:13 UTC (permalink / raw)
  To: Linux I2C Mailing List, Linux/PPC Embedded Mailing List,
	Linux Kernel Mailing List

I have been unable to find an answer for this in the LKML archives, so I
am hoping someone on this list might perhaps have some insight or pointers
thereto on this question.

I have an embedded board with a PowerPC 405GP on which Linux 2.4.2
(MontaVista's version thereof) is running swimmingly. Attached to that
PowerPC's I2C controller is a Dallas DS1307 I2C RTC.

>From the looks of drivers/char/rtc.c it would appear that this kernel
driver only supports bus-attached RTCs such as the mentioned MC146818. Is
this correct?

What is the correct access method / kernel tie-in for supporting such an
I2C-based RTC device using the "standard" interfaces?

My hope is to use 'hwclock' from util-linux w/o modification. Is this
reasonable?

Thanks,

Grant Erickson


-- 
 Grant Erickson                       University of Minnesota Alumni
  o mail:erick205@umn.edu                                 1996 BSEE
  o http://www.umn.edu/~erick205                          1998 MSEE



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Kernel Real Time Clock (RTC) Support for I2C Devices
  2001-04-18 19:13 Kernel Real Time Clock (RTC) Support for I2C Devices Grant Erickson
@ 2001-04-18 19:35 ` Gabriel Paubert
  2001-04-18 19:40 ` Wolfgang Denk
  2001-04-19 11:33 ` johan.adolfsson
  2 siblings, 0 replies; 4+ messages in thread
From: Gabriel Paubert @ 2001-04-18 19:35 UTC (permalink / raw)
  To: Grant Erickson
  Cc: Linux I2C Mailing List, Linux/PPC Embedded Mailing List,
	Linux Kernel Mailing List



On Wed, 18 Apr 2001, Grant Erickson wrote:

> >From the looks of drivers/char/rtc.c it would appear that this kernel
> driver only supports bus-attached RTCs such as the mentioned MC146818. Is
> this correct?

I think so. 

> 
> What is the correct access method / kernel tie-in for supporting such an
> I2C-based RTC device using the "standard" interfaces?

Adding a new kind of clock to the kernel and setting the correct pointers
in ppc_md seems the right (if not necessarily simple) solution to your
problem.  

I wonder how you calibrate the decrementer frequency on this machine, I2C
is too slow to get any precision, unless you accept to wait for one minute
or so at boot. I still have problems of reproducibility of clock frequency
measurements with bus attached RTC (on machines on which the RTC is the
only moderately precise timing source and its interrupt line is
unfortunately not connected).

> 
> My hope is to use 'hwclock' from util-linux w/o modification. Is this
> reasonable?

No.

	Regards,
	Gabriel.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Kernel Real Time Clock (RTC) Support for I2C Devices
  2001-04-18 19:13 Kernel Real Time Clock (RTC) Support for I2C Devices Grant Erickson
  2001-04-18 19:35 ` Gabriel Paubert
@ 2001-04-18 19:40 ` Wolfgang Denk
  2001-04-19 11:33 ` johan.adolfsson
  2 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2001-04-18 19:40 UTC (permalink / raw)
  To: Grant Erickson
  Cc: Linux I2C Mailing List, Linux/PPC Embedded Mailing List,
	Linux Kernel Mailing List

Dear Grant,

in message <Pine.SOL.4.20.0104181408540.10793-100000@garnet.tc.umn.edu> you wrote:
> 
> >From the looks of drivers/char/rtc.c it would appear that this kernel
> driver only supports bus-attached RTCs such as the mentioned MC146818. Is
> this correct?

This is correct; however, you can replace this driver by one of  your
own  (see for instance drivers/char/ip860_rtc.c in our version of the
2.4.x Linux sources which implements the RTC driver for a  V3021  RTC
on a IP860 VMEBus system [MPC860 based]).

Right now I'm writing another driver for  the  Philips  PCF8563  RTC,
which is much closer to what you have in mind.

> What is the correct access method / kernel tie-in for supporting such an
> I2C-based RTC device using the "standard" interfaces?

Assuming you have a working I2C driver, just add the necessary "glue"
code to provide the same interface as that of drivers/char/rtc.c .

> My hope is to use 'hwclock' from util-linux w/o modification. Is this
> reasonable?

Yes, this will work (it does for me on the MPC8xx).

Hope this helps,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
The universe does not have laws - it has habits, and  habits  can  be
broken.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Kernel Real Time Clock (RTC) Support for I2C Devices
  2001-04-18 19:13 Kernel Real Time Clock (RTC) Support for I2C Devices Grant Erickson
  2001-04-18 19:35 ` Gabriel Paubert
  2001-04-18 19:40 ` Wolfgang Denk
@ 2001-04-19 11:33 ` johan.adolfsson
  2 siblings, 0 replies; 4+ messages in thread
From: johan.adolfsson @ 2001-04-19 11:33 UTC (permalink / raw)
  To: Grant Erickson, Linux I2C Mailing List,
	Linux/PPC Embedded Mailing List, Linux Kernel Mailing List

Support for DS1302 is available in the CRIS port.
A patch for 2.4.3 (and a lot of other stuff you don't need) is available in
http://developer.axis.com/download/devboard_lx/R1_0_0/

/Johan

----- Original Message -----
From: Grant Erickson <erick205@umn.edu>
To: Linux I2C Mailing List <linux-i2c@pelican.tk.uni-linz.ac.at>; Linux/PPC
Embedded Mailing List <linuxppc-embedded@lists.linuxppc.org>; Linux Kernel
Mailing List <linux-kernel@vger.kernel.org>
Sent: Wednesday, April 18, 2001 9:13 PM
Subject: Kernel Real Time Clock (RTC) Support for I2C Devices


> I have been unable to find an answer for this in the LKML archives, so I
> am hoping someone on this list might perhaps have some insight or pointers
> thereto on this question.
>
> I have an embedded board with a PowerPC 405GP on which Linux 2.4.2
> (MontaVista's version thereof) is running swimmingly. Attached to that
> PowerPC's I2C controller is a Dallas DS1307 I2C RTC.
>
> >From the looks of drivers/char/rtc.c it would appear that this kernel
> driver only supports bus-attached RTCs such as the mentioned MC146818. Is
> this correct?
>
> What is the correct access method / kernel tie-in for supporting such an
> I2C-based RTC device using the "standard" interfaces?
>
> My hope is to use 'hwclock' from util-linux w/o modification. Is this
> reasonable?
>
> Thanks,
>
> Grant Erickson
>
>
> --
>  Grant Erickson                       University of Minnesota Alumni
>   o mail:erick205@umn.edu                                 1996 BSEE
>   o http://www.umn.edu/~erick205                          1998 MSEE
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-04-19 11:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-18 19:13 Kernel Real Time Clock (RTC) Support for I2C Devices Grant Erickson
2001-04-18 19:35 ` Gabriel Paubert
2001-04-18 19:40 ` Wolfgang Denk
2001-04-19 11:33 ` johan.adolfsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®