* DS1340 RTC (i2c device)
@ 2004-07-19 6:44 miguel.valero
2004-07-19 6:58 ` Sylvain Munaut
2004-07-19 8:37 ` Wolfgang Denk
0 siblings, 2 replies; 4+ messages in thread
From: miguel.valero @ 2004-07-19 6:44 UTC (permalink / raw)
To: linuxppc-embedded
Does anyone have any good suggestions about how to handle an i2c RTC
device, as f.e. the Maxim ds1340 ?
As far as I can understand, the "todc_time" component only supports memory
mapped RTC devices.
I believe I have to implement my own, platform dependent, "time_init",
"set_rtc_time" and "get_rtc_time" functions, and register them in the
ppc_md structure during platform initialisation.
I also believe that "time_init" and "get_rtc_time" are called by the
kernel rather early.
The question is whether the i2c driver is already in place by the time
these functions are called, so that I can register a driver for the
ds1340.
Has anyone done something like that ?
If I am on the wrong track, can someone give me a good hint ?
Regards
Miguel A. Valero
R & D Engineer
------------------------------------------------------------------------------------------------------
AXXESSIT ASA
PB 219 Økern
Risløkkveien 2 N-0510 Oslo
------------------------------------------------------------------------------------------------------
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: DS1340 RTC (i2c device)
2004-07-19 6:44 DS1340 RTC (i2c device) miguel.valero
@ 2004-07-19 6:58 ` Sylvain Munaut
2004-07-19 8:37 ` Wolfgang Denk
1 sibling, 0 replies; 4+ messages in thread
From: Sylvain Munaut @ 2004-07-19 6:58 UTC (permalink / raw)
To: miguel.valero; +Cc: linuxppc-embedded
Hi
I'm also planning on using this chip as RTC. The solution I've come up
with currently is to use the RTC that is on the chip (but it doesn't
keep correct time between boots), but leave it uninitialized ( 1 Jan
1970 ), then in userspace, read the external RTC and set the correct
time during boot.
Sylvain Munaut
miguel.valero@axxessit.no wrote:
> Does anyone have any good suggestions about how to handle an i2c
> RTC device, as f.e. the Maxim ds1340 ?
>
> As far as I can understand, the "todc_time" component only supports
> memory mapped RTC devices.
>
> I believe I have to implement my own, platform dependent,
> "time_init", "set_rtc_time" and "get_rtc_time" functions, and
> register them in the ppc_md structure during platform
> initialisation.
>
> I also believe that "time_init" and "get_rtc_time" are called by
> the kernel rather early.
>
> The question is whether the i2c driver is already in place by the
> time these functions are called, so that I can register a driver
> for the ds1340. Has anyone done something like that ? If I am on
> the wrong track, can someone give me a good hint ?
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: DS1340 RTC (i2c device)
2004-07-19 6:44 DS1340 RTC (i2c device) miguel.valero
2004-07-19 6:58 ` Sylvain Munaut
@ 2004-07-19 8:37 ` Wolfgang Denk
1 sibling, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2004-07-19 8:37 UTC (permalink / raw)
To: miguel.valero; +Cc: linuxppc-embedded
In message <OFBE3E7E82.C477AD44-ONC1256ED6.0024E631@axxessit.no> you wrote:
>
> Does anyone have any good suggestions about how to handle an i2c RTC
> device, as f.e. the Maxim ds1340 ?
Sorry, can't help here.
> The question is whether the i2c driver is already in place by the time
> these functions are called, so that I can register a driver for the
> ds1340. Has anyone done something like that ?
I2C based RTCs have been in use for a long time. Just register the
RTC functions when the I2C driver comes up.
And make sure to disable the 11 minute mode or you may run into
problems (you'll know what I mean when your system crashes after 11
minutes). See the list archive for details.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd@denx.de
A verbal contract isn't worth the paper it's written on.
-- Samuel Goldwyn
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: DS1340 RTC (i2c device)
@ 2004-07-19 14:18 Dixon, Myron @ GNS
0 siblings, 0 replies; 4+ messages in thread
From: Dixon, Myron @ GNS @ 2004-07-19 14:18 UTC (permalink / raw)
To: miguel.valero, linuxppc-embedded
I have done this with a ds1337. I found the solution on this mailing list.
I think it was Wolfgang who had implemented the solution. Essentially,
the technique is to do as you suggest, replace your unique driver functions
with the predefined ones being pointed to by the ppc_md structure.
Worked great for me on our 8260 custom board using a 2.4.18 kernel.
Just search the archives for rtc fixes.
Myron
-----Original Message-----
From: miguel.valero@axxessit.no [mailto:miguel.valero@axxessit.no]
Sent: Monday, 19 July, 2004 2:44 AM
To: linuxppc-embedded@lists.linuxppc.org
Subject: DS1340 RTC (i2c device)
Does anyone have any good suggestions about how to handle an i2c RTC
device, as f.e. the Maxim ds1340 ?
As far as I can understand, the "todc_time" component only supports memory
mapped RTC devices.
I believe I have to implement my own, platform dependent, "time_init",
"set_rtc_time" and "get_rtc_time" functions, and register them in the
ppc_md structure during platform initialisation.
I also believe that "time_init" and "get_rtc_time" are called by the
kernel rather early.
The question is whether the i2c driver is already in place by the time
these functions are called, so that I can register a driver for the
ds1340.
Has anyone done something like that ?
If I am on the wrong track, can someone give me a good hint ?
Regards
Miguel A. Valero
R & D Engineer
----------------------------------------------------------------------------
--------------------------
AXXESSIT ASA
PB 219 Økern
Risløkkveien 2 N-0510 Oslo
----------------------------------------------------------------------------
--------------------------
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-07-19 14:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-19 6:44 DS1340 RTC (i2c device) miguel.valero
2004-07-19 6:58 ` Sylvain Munaut
2004-07-19 8:37 ` Wolfgang Denk
-- strict thread matches above, loose matches on Subject: below --
2004-07-19 14:18 Dixon, Myron @ GNS
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).