Author: wmb Date: Mon Jan 24 23:45:17 2011 New Revision: 2147 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2147
Log: OLPC XO-1.75 - RTC is now working on A2.
Modified: cpu/arm/olpc/1.75/rtc.fth
Modified: cpu/arm/olpc/1.75/rtc.fth ============================================================================== --- cpu/arm/olpc/1.75/rtc.fth Mon Jan 24 23:44:23 2011 (r2146) +++ cpu/arm/olpc/1.75/rtc.fth Mon Jan 24 23:45:17 2011 (r2147) @@ -1,18 +1,19 @@ 0 0 " " " /" begin-package " rtc" name
-: set-address ( -- ) [ifdef] cl2-a1 +: set-address ( -- ) d# 97 to smb-clock-gpio# d# 98 to smb-data-gpio# -[else] - d# 53 to smb-clock-gpio# - d# 54 to smb-data-gpio# -[then] h# d0 to smb-slave ; : rtc@ ( reg# -- byte ) set-address smb-byte@ ; : rtc! ( byte reg# -- ) set-address smb-byte! ; +[else] +: set-address ( -- ) h# d0 2 set-twsi-target ; +: rtc@ ( reg# -- byte ) set-address twsi-b@ ; +: rtc! ( byte reg# -- ) set-address twsi-b! ; +[then]
headerless
@@ -30,7 +31,11 @@ : >bcd ( binary -- bcd ) d# 10 /mod 4 << + ;
: bcd-time&date ( -- s m h d m y century ) +[ifdef] cl2-a1 7 0 smb-read-n ( s m h dow d m y ) +[else] + 0 1 7 twsi-get ( s m h dow d m y ) +[then] 3 roll drop ( s m h dow d m y ) d# 20 ;