Do you have a question? Post it now! No Registration Necessary
- aniket.d
November 11, 2006, 1:56 am

Processor: MPC8245
Kernel version: 2.6.14
RTC: DS1340
Driver used: rtc-ds1307.c - ported from some newer version (2.6.17 or
something) of the standard kernel.
problem faced: RTC time is not syncd to the system time or vice versa.
In arch/ppc/platforms/our_plat.c I am setting ppc_md.get_rtc_time
and ppc_md.set_rtc_time. ppc_md.calibrate_decr is also set. The
ppc_md.time_init has not been set. It seems that as part of time_init,
I should be enabling the time base. In 83xx the TBEN is in a register
called SPCR, however for 824x it is a signal (input line) to the CPU.
Does that mean changing the hardware so that the pin is asserted by
default?
In another way or trying to get RTC and system clock to be
synced, I was using hctosys.c in drivers/rtc/ for the same purpose. In
this case, the RTC's time was read at boot and then written to the
system clock at boot. However, immediately after writing to system
time, the time used to get changed to some other random value.
The RTC driver works fine - which means - I can write to the RTC
(thru the sysfs) and can read it back from the RTC and the values that
I write are available even on subsequent reboots.
So what is the missing piece to sync the system clock and the RTC?
Is there any other processor dependent stuff that should be done that I
am missing or doing wrong? Or is there something on the lines of
hctosys.c that I should be doing? Please guide.
Thanks,
Aniket.
Kernel version: 2.6.14
RTC: DS1340
Driver used: rtc-ds1307.c - ported from some newer version (2.6.17 or
something) of the standard kernel.
problem faced: RTC time is not syncd to the system time or vice versa.
In arch/ppc/platforms/our_plat.c I am setting ppc_md.get_rtc_time
and ppc_md.set_rtc_time. ppc_md.calibrate_decr is also set. The
ppc_md.time_init has not been set. It seems that as part of time_init,
I should be enabling the time base. In 83xx the TBEN is in a register
called SPCR, however for 824x it is a signal (input line) to the CPU.
Does that mean changing the hardware so that the pin is asserted by
default?
In another way or trying to get RTC and system clock to be
synced, I was using hctosys.c in drivers/rtc/ for the same purpose. In
this case, the RTC's time was read at boot and then written to the
system clock at boot. However, immediately after writing to system
time, the time used to get changed to some other random value.
The RTC driver works fine - which means - I can write to the RTC
(thru the sysfs) and can read it back from the RTC and the values that
I write are available even on subsequent reboots.
So what is the missing piece to sync the system clock and the RTC?
Is there any other processor dependent stuff that should be done that I
am missing or doing wrong? Or is there something on the lines of
hctosys.c that I should be doing? Please guide.
Thanks,
Aniket.
Site Timeline
- » ISP Programming utility for ColdFire
- — Next thread in » Embedded Linux
-
- » polling
- — Previous thread in » Embedded Linux
-
- » Crosscompiling for ARM: reloc type R_ARM_ABS32 is not supported for PIC - ...
- — Newest thread in » Embedded Linux
-
- » Broadband filter matching design
- — The site's Newest Thread. Posted in » Electronics Design
-
- » Re: OT: The Deep State defined
- — The site's Last Updated Thread. Posted in » Electronics Design
-