[openfirmware] [commit] r2944 - cpu/arm/mmp2
repository service
svn at openfirmware.info
Tue Apr 17 03:04:04 CEST 2012
Author: quozl
Date: Tue Apr 17 03:04:04 2012
New Revision: 2944
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2944
Log:
OLPC XO-1.75 - restore thermal protection after suspend, #11779
Modified:
cpu/arm/mmp2/dramrecal.fth
cpu/arm/mmp2/thermal.fth
Modified: cpu/arm/mmp2/dramrecal.fth
==============================================================================
--- cpu/arm/mmp2/dramrecal.fth Fri Apr 13 07:01:36 2012 (r2943)
+++ cpu/arm/mmp2/dramrecal.fth Tue Apr 17 03:04:04 2012 (r2944)
@@ -869,6 +869,7 @@
timers-wake
resume-usb
enable-interrupts
+ init-thermal-sensor
;
: strp ( -- ) ec-rst-pwr str ec-max-pwr .d ." mW " soc .% space ;
Modified: cpu/arm/mmp2/thermal.fth
==============================================================================
--- cpu/arm/mmp2/thermal.fth Fri Apr 13 07:01:36 2012 (r2943)
+++ cpu/arm/mmp2/thermal.fth Tue Apr 17 03:04:04 2012 (r2944)
@@ -1,11 +1,25 @@
\ See license at end of file
purpose: Driver for the MMP2 thermal sensor
+\ See also cforth:src/app/arm-xo-1.75/thermal.fth
h# 013200 value thermal-base
+: room-temp@ ( -- n ) thermal-base io@ ;
+: room-temp! ( n -- ) thermal-base io! ;
+thermal-base h# 4 + value wd-thresh
+: wd-thresh@ ( -- n ) wd-thresh io@ ;
+: wd-thresh! ( n -- ) wd-thresh io! ;
+\ thermal-base h# 8 + value lo-thresh
+\ thermal-base h# c + value hi-thresh
+thermal-base h# 10 + value ts-ctrl
+: ts-ctrl! ( n -- ) ts-ctrl io! ;
+
: init-thermal-sensor ( -- )
thermal-base io@ h# 400 and if exit then
7 h# 90 apbc! 3 h# 90 apbc! \ Enable clocks to thermal sensor
- h# 10000 thermal-base io! \ Enable sensing
+ h# 10000 room-temp! \ Enable sensing
+ d# 696 wd-thresh! \ Set thermal watchdog threshold to 85C
+ h# 88 ts-ctrl! \ Clear thermal watchdog reset status
+ \ Set thermal watchdog reset enable
;
\ thermal watchdog is enabled by CForth
@@ -46,10 +60,6 @@
wdtpcr io!
;
-thermal-base h# 4 + value wd-thresh
-: wd-thresh@ ( -- n ) wd-thresh io@ ;
-: wd-thresh! ( n -- ) wd-thresh io! ;
-
: .c ( n -- ) (.) type ." C " ;
: .thermal
More information about the openfirmware
mailing list