Changeset 2977


Ignore:
Timestamp:
May 16, 2012, 11:03:21 AM (3 years ago)
Author:
quozl
Message:

OLPC XO-1.75 - IDT1338 DS1338 RTC SRAM clear, check for a two byte signature at the end of SRAM, and if it is missing clear the century byte (not maintained by the RTC), and the area we are using for "CMOS".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpu/arm/olpc/rtc.fth

    r2976 r2977  
    2222headerless
    2323
     24: ?clear
     25   h# 3f rtc@  h# 3e rtc@  bwjoin  h# 55aa  <>  if
     26      h# 20 8 rtc!                     \ century
     27      h# 20 h# 10  do  0 i rtc!  loop  \ wipe cmos@ cmos! area
     28      h# 55aa  wbsplit  h# 3e rtc!  h# 3f rtc!
     29      ." RTC SRAM cleared" cr
     30   then
     31;
     32
    2433headers
    2534: open  ( -- okay )
     
    3039   \ Ensure that the Clock Halt bit is off
    3140   dup h# 80 and  if           ( value )
    32       \ Clear century
    33       h# 20 8 rtc!
    3441      \ Turn off Clock Halt
    3542      h# 7f and 0 rtc!         ( )
     
    4148      drop true                ( true )
    4249   then                        ( okay? )
     50   ?clear
    4351;
    4452: close  ( -- )
Note: See TracChangeset for help on using the changeset viewer.