steven james pyro@linuxlabs.com writes:
Greetings,
I think pc80/rtc.c IS the correct place for it. AFAIK, it is generic.
O.k. I have looked and now that I have actually looked up what is being referred to I can confirm it is in the original motorola chip. I have DV2,DV1,DV0 the various reference clocks are all present in the reference chip. Initially when the problem was brought up I did not see what everyone was talking about.
The only problem with pc80/rtc.c is that pc80/mc14618rtc.c already exists and even has this code. It is just a mater of calling: rtc_init, on most of the boards that need it. It has a long name only because it references the original motorola part number.
And the default for the timer base is already in the existing code.
So calling rtc_init from an appropriate place appears to be all that is required. Which I do from ich2_rtc_init() and ich3_rtc_init().
We still need an implementation/southbridge specific routine to see if the battery failed but otherwise the exiting code should work pretty much as is.
I tracked down a lot of the issues when figuring out what it would take to store parameters in the cmos ram, and apparently no one else noticed.. And for me the internal state had simply swapped out.
So been there, done that. The code already exists, works and is generic. Feel free to call it from the appropriate southbridge fixup routines if you want. There is even a define so boards with strange configurations can overrule the default configuration.
Eric