Skip to contentSkip to conversation

sparc32: convert to RTC subsystem

PATCH Applied Krzysztof Helt 4 participants 9 messages Sep 3, 2008 – Sep 8, 2008

lore
Share & tools
lore
#0 lore raw

cover sparc32: convert to RTC subsystem

Hi,

This is my clumsy attempt to convert the sparc32 to the RTC subsystem.
These patches require two patches from the -mm tree:

rtc-m48t59-reduce-structure-m48t59_private.patch rtc-m48t59-add-support-for-m48t02-and-m48t59-chips-2nd-rev.patch

The driver was tested on SS20.

Robert, please test it on as many machine as you can.

Kind regards,
Krzysztof

#1 lore raw

From: Krzysztof Helt <[email protected]>
Date: Wed, 3 Sep 2008 18:32:32 +0200

Quoted 10 lines

This is my clumsy attempt to convert the sparc32 to the RTC subsystem.
These patches require two patches from the -mm tree:

rtc-m48t59-reduce-structure-m48t59_private.patch rtc-m48t59-add-support-for-m48t02-and-m48t59-chips-2nd-rev.patch

The driver was tested on SS20.

Robert, please test it on as many machine as you can.

Krzystztof I like this work and I'd like to merge it into sparc-next-2.6

But there are those two patches from -mm that are dependencies.

Andrew, would you mind if I carried those two RTC patches in -mm mentioned above in sparc-next-2.6? The exist only to support Sparc RTC chips anyways, so to me this plan seems to make the most sense.

Thanks!

#2 lore raw
In reply to Krzysztof Helt
Quoted 4 lines · On Wed, 03 Sep 2008 14:41:43 -0700 (PDT) David Miller <[email protected]>…

Andrew, would you mind if I carried those two RTC patches in -mm mentioned above in sparc-next-2.6? The exist only to support Sparc RTC chips anyways, so to me this plan seems to make the most sense.

sent!

#3 lore raw
In reply to Krzysztof Helt

From: Andrew Morton <[email protected]>
Date: Wed, 3 Sep 2008 14:54:57 -0700

Quoted 9 lines
Quoted 4 lines · On Wed, 03 Sep 2008 14:41:43 -0700 (PDT) David Miller <[email protected]>…

Andrew, would you mind if I carried those two RTC patches in -mm mentioned above in sparc-next-2.6? The exist only to support Sparc RTC chips anyways, so to me this plan seems to make the most sense.

sent!

Thanks!

#4 lore raw
In reply to Krzysztof Helt
Quoted 3 lines · Krzysztof Helt

Robert, please test it on as many machine as you can.

With latest sparc-next, my ss20 boots now but the clock is suspect.

Time is initially set to Dec 31, 1969 but ntp fixes it.

I'm using debian etch so I'm not sure it's setup for generic rtc. I had to make a link for /dev/rtc to get things somewhat working. This could be a bad NVRAM but openboot doesn't complain.

ss20-1:/dev# ln -s rtc0 rtc
ss20-1:/dev# /sbin/hwclock --debug
hwclock from util-linux-2.12r
Using /dev/rtc interface to clock.
Last drift adjustment done at 1220490623 seconds after 1969
Last calibration done at 1220490623 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
/dev/rtc does not have interrupt functions. Waiting in loop for time 
from /dev/rtc to change
...got clock tick
Time read from Hardware Clock: 2108/09/04 01:30:25
Invalid values in hardware clock: 2108/09/04 01:30:25
The Hardware Clock registers contain values that are either invalid 
(e.g. 50th day of month) or beyond the range we can handle (e.g. Year 2095).
ss20-1:/dev# date
Wed Sep  3 21:30:52 EDT 2008
#5 lore raw
In reply to Krzysztof Helt

From: Robert Reif <[email protected]>
Date: Wed, 03 Sep 2008 21:42:54 -0400

Quoted 11 lines
Quoted 3 lines · Krzysztof Helt

Robert, please test it on as many machine as you can.

With latest sparc-next, my ss20 boots now but the clock is suspect.

Time is initially set to Dec 31, 1969 but ntp fixes it.

I'm using debian etch so I'm not sure it's setup for generic rtc. I had to make a link for /dev/rtc to get things somewhat working. This could be a bad NVRAM but openboot doesn't complain.

Older hwclock binaries won't look for /dev/rtc0, newer ones do. So the symlink is necessary for machines with the older binary.

Quoted 2 lines

Time read from Hardware Clock: 2108/09/04 01:30:25 Invalid values in hardware clock: 2108/09/04 01:30:25

Hmmm, 100 years too large, that looks familiar.

Krzysztof?

#6 lore raw
In reply to Krzysztof Helt
Quoted 4 lines · David Miller

Older hwclock binaries won't look for /dev/rtc0, newer ones do. So the symlink is necessary for machines with the older binary.

Quoted 9 lines
Quoted 3 lines

Time read from Hardware Clock: 2108/09/04 01:30:25 Invalid values in hardware clock: 2108/09/04 01:30:25

Hmmm, 100 years too large, that looks familiar.

Krzysztof?

With newer version and symlink removed:

ss20-1:~/hwclock-2.32# ./hwclock --debug
hwclock 2.32
Kernel IS in 11 minute mode
User did not specify a clock access method.  Searching for one...
Found RTC device special file '/dev/rtc0'
Using rtc ioctl interface to clock via file '/dev/rtc0'.
Adjtime file contents:
  drift factor = 0.021200, missed in last set = 0.000000
  UTC (0 seconds west of GMT), epoch = -1
  Last drift adjustment done Wed Sep  3 21:10:23 2008 (Time 1220490623) 
+ 0.000000 secs
  Last calibration done Wed Sep  3 21:10:23 2008 (Time 1220490623)
  Correction: 0.000000
Not booted from MILO
Assuming hardware clock's zero year is 1900
Assuming hw clock is kept in UTC time with offset 0 mins.
At 1220494343.809750, waiting for clock tick...
RTC device does not have interrupt functions.
Waiting in loop for time from rtc device driver to change
...got clock tick at system time 1220494344.499652
Raw time read from Hardware Clock: Y!08 M=9 D=4 02:12:24
mktime_tz: TZ environment variable is not set.
mktime_tz: temporarily setting TZ to HWCLOCK_TEMP +00:00
Invalid values in hardware clock: 208/09/04 02:12:24
hwclock: The Hardware Clock registers contain values that are either 
invalid (e.g. 50th day of month) or beyond the range we can handle (e.g. 
Year 2095).
new timezone offset for hardware clock is 0
#7 lore raw
In reply to Krzysztof Helt
Quoted 5 lines · Robert Reif
Quoted 3 lines · Krzysztof Helt

Robert, please test it on as many machine as you can.

With latest sparc-next, my ss20 boots now but the clock is suspect.

I also get this error:

Dec 31 19:01:25 ss20-1 kernel: rtc-m48t59 rtc-m48t59.0: rtc core: 
registered m48t08 as rtc0
Dec 31 19:01:25 ss20-1 kernel: TCP bic registered
Dec 31 19:01:25 ss20-1 kernel: NET: Registered protocol family 17
Dec 31 19:01:25 ss20-1 kernel: drivers/rtc/hctosys.c: unable to open rtc 

device (y)

#8 lore raw
In reply to Krzysztof Helt
Quoted 2 lines · Robert Reif
Dec 31 19:01:25 ss20-1 kernel: drivers/rtc/hctosys.c: unable to open 

rtc device (y)

I looks like defconfig isn't set up properly. I'll look at it tomorrow evening if someone doesn't beat me to it.