[openfirmware] [commit] r2480 - cpu/arm/mmp2
repository service
svn at openfirmware.info
Mon Aug 29 03:22:56 CEST 2011
Author: wmb
Date: Mon Aug 29 03:22:55 2011
New Revision: 2480
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2480
Log:
OLPC XO-1.75 - Added some support to the RTC driver for testing wakeup from suspend.
Modified:
cpu/arm/mmp2/rtc.fth
Modified: cpu/arm/mmp2/rtc.fth
==============================================================================
--- cpu/arm/mmp2/rtc.fth Mon Aug 29 03:21:48 2011 (r2479)
+++ cpu/arm/mmp2/rtc.fth Mon Aug 29 03:22:55 2011 (r2480)
@@ -9,6 +9,10 @@
: int5-mask@ ( -- value ) h# 28.216c io@ ;
: int5-status@ ( -- value ) h# 28.2154 io@ ;
: enable-rtc ( -- ) h# 81 h# 01.5000 io! ;
+: enable-rtc-wakeup ( -- )
+ h# 5.004c io@ h# 2.0010 or h# 5.004c io!
+ h# 5.104c io@ h# 2.0010 or h# 5.104c io!
+;
: soc-rtc@ ( offset -- value ) h# 01.0000 + io@ ;
: soc-rtc! ( value offset -- value ) h# 01.0000 + io! ;
: take-alarm ( -- )
@@ -16,10 +20,12 @@
0 8 soc-rtc!
int5-mask@ 1 or int5-mask! \ Mask alarm
;
-: alarm-in-5 ( -- )
+: alarm-in-3 ( -- )
enable-rtc \ Turn on clocks
+
int5-mask@ 1 invert and int5-mask! \ Unmask alarm
- 0 soc-rtc@ d# 5 + 4 soc-rtc! \ Set alarm for 5 seconds from now
+ enable-rtc-wakeup
+ 0 soc-rtc@ d# 3 + 4 soc-rtc! \ Set alarm for 3 seconds from now
7 8 soc-rtc! \ Ack old interrupts and enable new ones
['] take-alarm 5 interrupt-handler!
5 enable-interrupt
More information about the openfirmware
mailing list