LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware - ARM (https://www.linuxquestions.org/questions/slackware-arm-108/)
-   -   IFC6410: Issues with hardware clock (https://www.linuxquestions.org/questions/slackware-arm-108/ifc6410-issues-with-hardware-clock-4175524858/)

louigi600 11-09-2014 01:47 AM

IFC6410: Issues with hardware clock
 
I've put the battery on the IFC6410's RTC and now it keeps time while it's powered off. The clock can be read but for some reason it can't set the correct time on it:

Code:

root@ifc6410:~# date
Thu Jan  1 02:49:38 BST 1970
You have mail in /var/mail/root
root@ifc6410:~# ntpdate -b pool.ntp.org
 7 Nov 00:01:05 ntpdate[669]: step time server 212.45.144.16 offset 1415311867.771852 sec
root@ifc6410:~# date
Fri Nov  7 00:02:25 GMT 2014
root@ifc6410:~# hwclock -r
Thu 01 Jan 1970 03:51:24 AM BST  -1.984101 seconds
root@ifc6410:~# hwclock -w
hwclock: ioctl(RTC_SET_TIME) to /dev/rtc to set the time failed.: Invalid argument
root@ifc6410:~#

It's one of the few ARM machines that have a working hardware clock in them but on the others I can use hwclock to set the time without any issues.
For example here's the Along A13-rt713
Code:

root@headless:~# hwclock -r
Mon 13 Sep 2010 05:26:46 PM BST  -0.772207 seconds
root@headless:~# ntpdate -b pool.ntp.org
 9 Nov 07:40:26 ntpdate[1029]: step time server 212.45.144.3 offset 131123585.351895 sec
root@headless:~# date
Sun Nov  9 07:41:03 GMT 2014
root@headless:~# root@headless:/etc# hwclock  -w
root@headless:~# hwclock  -r
Sun 09 Nov 2014 07:41:54 AM GMT  -0.225090 seconds
root@headless:~#

Anyone have any idea how to set the clock on the IFC6410 ?

fatmac 11-10-2014 05:29 AM

Have you tried using 'date -s', (man date).
(Need to be 'root' to set system time.)

louigi600 11-10-2014 05:43 AM

I think that would set the system time, not the hardware clock. (man hwclock)
I want to set the proper time on the hardware clock.

fatmac 11-10-2014 06:03 AM

Sorry, reading through the man page has :-

--set Set the Hardware Clock to the time given by the --date option.

--date=date_string
You need this option if you specify the --set or --predict func‐
tions, otherwise it is ignored. It specifies the time to which
to set the Hardware Clock, or the time for which to predict the
Hardware Clock reading. The value of this option is an argument
to the date(1) program. For example:

hwclock --set --date="2011-08-14 16:45:05"

(I think I would give that a try.)

louigi600 11-10-2014 06:32 AM

If you look at what -w does: sets the hardware clock to the same time as the system clock, and at the message I get back from hwclock posted in the initial post...
On the IFC6410 it's failing because hwclock can't seem to set the time on the hardware clock but it can read it (-r).

louigi600 11-13-2014 06:41 PM

Patched the kernel with 0052-RTC-write-enabled-for-APQ8064.patch, rebuilt it, rebuilt aboot image and flashed it to boot partition.
After reboot it now works:
Code:

root@ifc6410:~# hwclock  -r
Thu 08 Jan 1970 04:07:51 AM CET  -1.921417 seconds
root@ifc6410:~# ntpdate -b pool.ntp.org
14 Nov 01:19:01 ntpdate[681]: step time server 146.48.81.102 offset 1415311852.647242 sec
You have mail in /var/mail/root
root@ifc6410:~# date
Fri Nov 14 01:19:04 CET 2014
root@ifc6410:~# hwclock  -w
root@ifc6410:~# hwclock  -r
Fri 14 Nov 2014 01:19:17 AM CET  -1.066986 seconds
root@ifc6410:~#

The kernel sources can be cloned like this from linaro:
Code:

git clone --depth 1 -b "ubuntu-ifc6410-14.10" https://git.linaro.org/landing-teams/working/qualcomm/kernel.git  ubuntu-ifc6410-14.10
For the patch have a look here. That's the change you need to make to the sources.

Advice: I tried making a more modular kernel but a lot of things broke so just stick as much as possible to the ifc6410_defconfig.


All times are GMT -5. The time now is 11:10 PM.