LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 11-09-2014, 01:47 AM   #1
louigi600
Member
 
Registered: Dec 2013
Location: Italy
Distribution: Slackware
Posts: 487
Blog Entries: 13

Rep: Reputation: 47
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 ?

Last edited by louigi600; 11-16-2014 at 01:36 AM.
 
Old 11-10-2014, 05:29 AM   #2
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Posts: 3,128

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

Last edited by fatmac; 11-10-2014 at 05:30 AM.
 
Old 11-10-2014, 05:43 AM   #3
louigi600
Member
 
Registered: Dec 2013
Location: Italy
Distribution: Slackware
Posts: 487

Original Poster
Blog Entries: 13

Rep: Reputation: 47
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.
 
Old 11-10-2014, 06:03 AM   #4
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Posts: 3,128

Rep: Reputation: Disabled
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.)
 
Old 11-10-2014, 06:32 AM   #5
louigi600
Member
 
Registered: Dec 2013
Location: Italy
Distribution: Slackware
Posts: 487

Original Poster
Blog Entries: 13

Rep: Reputation: 47
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).
 
Old 11-13-2014, 06:41 PM   #6
louigi600
Member
 
Registered: Dec 2013
Location: Italy
Distribution: Slackware
Posts: 487

Original Poster
Blog Entries: 13

Rep: Reputation: 47
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.

Last edited by louigi600; 11-14-2014 at 05:01 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why system clock runs faster than hardware clock? DavidLiu Linux - Software 2 01-23-2011 07:38 AM
System clock correct, hardware clock wrong karlovac Linux - General 5 01-16-2009 07:19 PM
Failed to set system clock to hardware clock jrtayloriv Linux - Newbie 2 09-25-2008 07:06 AM
Slow system clock and stray hardware clock, pleas help! Epox Linux - General 6 01-02-2007 02:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 04:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration