[openfirmware] [commit] r2371 - in cpu/arm: mmp2 olpc/1.75
repository service
svn at openfirmware.info
Fri Jul 15 10:20:04 CEST 2011
Author: wmb
Date: Fri Jul 15 10:20:04 2011
New Revision: 2371
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2371
Log:
OLPC XO-1.75 - Slow down TWSI clock for accelerometer.
Modified:
cpu/arm/mmp2/twsi.fth
cpu/arm/olpc/1.75/accelerometer.fth
Modified: cpu/arm/mmp2/twsi.fth
==============================================================================
--- cpu/arm/mmp2/twsi.fth Fri Jul 15 08:59:50 2011 (r2370)
+++ cpu/arm/mmp2/twsi.fth Fri Jul 15 10:20:04 2011 (r2371)
@@ -158,6 +158,11 @@
twsi-get
;
+d# 12,600,000 constant numerator
+: set-bus-speed ( hz -- ) \ Useful range is currently 25,000 .. 100,000
+ child-address set-twsi-target
+ numerator swap / h# 1ff min h# 7e max lcr!
+;
: decode-unit ( adr len -- low high ) parse-2int ;
: encode-unit ( low high -- adr len ) >r <# u#s drop [char] , hold r> u#s u#> ;
end-package
Modified: cpu/arm/olpc/1.75/accelerometer.fth
==============================================================================
--- cpu/arm/olpc/1.75/accelerometer.fth Fri Jul 15 08:59:50 2011 (r2370)
+++ cpu/arm/olpc/1.75/accelerometer.fth Fri Jul 15 10:20:04 2011 (r2371)
@@ -47,6 +47,7 @@
: delay ( -- ) d# 30 ms ;
: open ( -- flag )
my-address my-space " set-address" $call-parent
+ d# 25,000 " set-bus-speed" $call-parent
['] accelerometer-on catch 0=
;
: close ( -- )
More information about the openfirmware
mailing list