Author: wmb Date: Fri Oct 15 00:13:42 2010 New Revision: 1984 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/1984
Log: ARM - enabled stdin-idle.
Modified: cpu/arm/irqdispatch.fth cpu/arm/mmp2/irq.fth cpu/arm/mmp2/timer.fth
Modified: cpu/arm/irqdispatch.fth ============================================================================== --- cpu/arm/irqdispatch.fth Thu Oct 14 23:58:27 2010 (r1983) +++ cpu/arm/irqdispatch.fth Fri Oct 15 00:13:42 2010 (r1984) @@ -4,6 +4,7 @@ 0 value pic-node : enable-interrupt ( level -- ) " enable-irq" pic-node $call-method ; : disable-interrupt ( level -- ) " disable-irq" pic-node $call-method ; +: interrupt-enabled? ( level -- flag ) " irq-enabled?" pic-node $call-method ;
: stray-interrupt ( level -- ) ." Unexpected interrupt on IRQ" dup .d cr
Modified: cpu/arm/mmp2/irq.fth ============================================================================== --- cpu/arm/mmp2/irq.fth Thu Oct 14 23:58:27 2010 (r1983) +++ cpu/arm/mmp2/irq.fth Fri Oct 15 00:13:42 2010 (r1984) @@ -15,6 +15,7 @@ : block-irqs ( -- ) 1 h# 110 ic! ; : unblock-irqs ( -- ) 0 h# 110 ic! ;
+: irq-enabled? ( level -- flag ) /l* ic@ h# 20 and 0<> ; : enable-irq ( level -- ) h# 21 swap /l* ic! ; \ Enable for IRQ1 : disable-irq ( level -- ) 0 swap /l* ic! ;
Modified: cpu/arm/mmp2/timer.fth ============================================================================== --- cpu/arm/mmp2/timer.fth Thu Oct 14 23:58:27 2010 (r1983) +++ cpu/arm/mmp2/timer.fth Fri Oct 15 00:13:42 2010 (r1984) @@ -154,3 +154,17 @@ d# 15 enable-interrupt ; ' (set-tick-limit) to set-tick-limit + +: can-idle? ( -- flag ) + interrupts-enabled? if + d# 15 interrupt-enabled? + else + false + then +; +: do-idle ( -- ) c7-wfi ; +: safe-idle ( -- ) + can-idle? if do-idle then + \ do-lid +; +' safe-idle to stdin-idle
openfirmware@openfirmware.info