[openfirmware] [commit] r2549 - cpu/arm/mmp2
repository service
svn at openfirmware.info
Fri Sep 30 01:59:28 CEST 2011
Author: quozl
Date: Fri Sep 30 01:59:27 2011
New Revision: 2549
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2549
Log:
OLPC XO-1.75 - add thermal watchdog disable used in testing
Modified:
cpu/arm/mmp2/thermal.fth
Modified: cpu/arm/mmp2/thermal.fth
==============================================================================
--- cpu/arm/mmp2/thermal.fth Fri Sep 30 00:51:18 2011 (r2548)
+++ cpu/arm/mmp2/thermal.fth Fri Sep 30 01:59:27 2011 (r2549)
@@ -8,6 +8,8 @@
h# 10000 thermal-base io! \ Enable sensing
;
+\ thermal watchdog is enabled by CForth
+
: cpu-temperature ( -- celcius )
0 ( acc )
d# 100 0 do ( acc ) \ Accumulate 100 samples
@@ -22,6 +24,28 @@
d# 52940 - d# 196 / ( celcius )
;
+: ?thermal ( -- )
+ cpu-temperature d# 70 > abort " CPU too hot"
+;
+
+[ifndef] wdtpcr
+main-pmu-pa h# 200 + constant wdtpcr
+[then]
+
+\ disable thermal watchdog, please use only in controlled conditions
+: thermal-off
+ wdtpcr io@
+ b# 0101.1111 and
+ wdtpcr io!
+;
+
+: thermal-on
+ wdtpcr io@
+ b# 1101.1111 and
+ b# 1000.0000 or
+ wdtpcr io!
+;
+
thermal-base h# 4 + value wd-thresh
: wd-thresh@ ( -- n ) wd-thresh io@ ;
: wd-thresh! ( n -- ) wd-thresh io! ;
More information about the openfirmware
mailing list