Author: wmb
Date: Wed Dec 8 00:40:03 2010
New Revision: 2066
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2066
Log:
Generic - fixed invalid assumption in dispose.fth - it assumed that allocated memory for the transient area was above the dictionary. Violation of the assumption caused end-module to crash.
Modified:
forth/lib/dispose.fth
Modified: forth/lib/dispose.fth
==============================================================================
--- forth/lib/dispose.fth Fri Dec 3 08:10:10 2010 (r2065)
+++ forth/lib/dispose.fth Wed Dec 8 00:40:03 2010 (r2066)
@@ -63,6 +63,16 @@
0 value resboundary \ Lower boundary of region to dispose
0 value tranboundary
+: transient-item? ( item -- transient? )
+ tranboundary there within
+;
+: resident-item? ( item -- resident? )
+ origin >link resboundary within
+;
+: safe-transient-item? ( item -- safe-transient? )
+ transtart tranboundary within
+;
+
\ relink removes transients from any linked list. It must be called
\ with a known good first link, as it doesn't know how to reset
\ the head of the list, which is usually a global variable.
@@ -71,13 +81,13 @@
\ Skip over all consecutive words in the transient vocabulary
dup
begin ( prev-item this-item )
- item@ dup tranboundary >= ( prev-item next-item tran? )
+ item@ dup transient-item? ( prev-item next-item tran? )
dup if over showit then
0= until ( prev-item next-kept-item )
\ Link the next non-transient word to the previous non-transient one
- dup rot item! ( next-kept-item )
- dup resboundary < ( next-kept-item <resboundary? )
- over transtart >= ( next-kept-item <resboundary? safe-transient? )
+ dup rot item! ( next-kept-item )
+ dup resident-item? ( next-kept-item resident? )
+ over safe-transient-item? ( next-kept-item resident? safe-transient? )
or
until drop
;
@@ -101,7 +111,7 @@
: relink-buffer:s ( -- )
['] buf-link@ is item@ ['] buf-link! is item! ['] buffer:. is link.
buffer-link begin \ Check for transient at head
- link@ dup tranboundary >=
+ link@ dup transient-item?
while
dup showit >buffer-link
repeat buffer-link link!
@@ -116,7 +126,7 @@
: relink-voc-list ( -- )
['] voc-link@ is item@ ['] voc-link! is item! ['] vocab. is link.
voc-link begin \ Check for transient at head
- link@ dup tranboundary >=
+ link@ dup transient-item?
while
dup showit >voc-link
repeat voc-link link!
Author: quozl
Date: Fri Dec 3 08:10:10 2010
New Revision: 2065
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2065
Log:
OLPC XO-1.5 - increase external SD card power-up off time for a 32 G class 10 SD card being tested.
Modified:
dev/mmc/sdhci/sdhci.fth
Modified: dev/mmc/sdhci/sdhci.fth
==============================================================================
--- dev/mmc/sdhci/sdhci.fth Fri Dec 3 07:55:12 2010 (r2064)
+++ dev/mmc/sdhci/sdhci.fth Fri Dec 3 08:10:10 2010 (r2065)
@@ -801,10 +801,16 @@
false to writing?
;
+\ time to hold card power off to allow VCC_SD to discharge
+\ 25ms required for XO-1.5 with external SanDisk 32 G class 10 SD card
+\ 29ms required for XO-1.5 with external SanDisk 8 G class 4 SD card
+\ 1ms should be required for XO-1.75 A2 (due to discharge clamps)
+d# 40 value power-off-time
+
\ -1 means error, 1 means retry
: power-up-card ( -- false | retry? true )
intstat-on
- card-power-off d# 20 ms
+ card-power-off power-off-time ms
card-power-on d# 40 ms \ This delay is just a guess (20 was barely too slow for a Via board)
card-inserted? 0= if card-power-off intstat-off false true exit then
card-clock-slow d# 10 ms \ This delay is just a guess
Author: wmb
Date: Thu Dec 2 03:09:15 2010
New Revision: 2059
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2059
Log:
OLPC XO-1.5 - fixed a bug in the SPI "cloning" code that lets you use an XO-1.5 board as an SPI programmer. Also added high-level versions of a couple of code words just for good measure.
Modified:
dev/via/spi/bbspi.fth
Modified: dev/via/spi/bbspi.fth
==============================================================================
--- dev/via/spi/bbspi.fth Thu Dec 2 03:07:34 2010 (r2058)
+++ dev/via/spi/bbspi.fth Thu Dec 2 03:09:15 2010 (r2059)
@@ -22,6 +22,7 @@
: bb-spi-cs-on ( -- ) gpo-port dup pc@ 8 invert and swap pc! ;
: bb-spi-cs-off ( -- ) gpo-port dup pc@ 8 or swap pc! ;
+[ifdef] 386-assembler
code bb-spi-out ( b -- )
bx pop
@@ -39,6 +40,8 @@
ax dx out
bl bl add \ Shift left
loopa
+ clk-mask do-mask + invert # ax and \ Clk low
+ ax dx out
c;
code bb-spi-in ( -- b )
@@ -66,9 +69,44 @@
bx inc
then
loopa
+ bp ax mov \ Base value
+ gpo-port # dx mov \ Out port
+ ax dx out \ CLK low
bp pop
bx push
c;
+[then]
+[ifndef] bb-spi-in
+: bb-spi-out ( b -- )
+ gpo-port pl@ ( portval )
+ clk-mask invert and ( portval' )
+ do-mask invert and ( portval' )
+ swap ( portval b )
+ 8 0 do ( portval b )
+ 2dup h# 80 and if ( portval b portval )
+ do-mask or ( portval b portval' )
+ then ( portval b portval )
+ dup gpo-port pl! ( portval b portval ) \ CLK low with data
+ clk-mask or gpo-port pl! ( portval b ) \ CLK high with data
+ 2* ( portval b' )
+ loop ( portval b )
+ drop gpo-port pl! ( ) \ CLK low
+;
+
+: bb-spi-in ( -- b )
+ gpo-port pl@ ( portval )
+ clk-mask invert and 0 ( portval b )
+ 8 0 do ( portval b )
+ over gpo-port pl! ( portval b ) \ CLK low
+ over clk-mask or gpo-port pl! ( portval b ) \ CLK high
+ 2* ( portval b' )
+ gpi-port pl@ di-mask and if ( portval b )
+ 1+ ( portval b' )
+ then ( portval b )
+ loop ( portval b )
+ swap gpo-port pl! ( b ) \ CLK low
+;
+[then]
: bb-spi-start ( -- )
['] bb-spi-in to spi-in
@@ -80,7 +118,7 @@
\ use-spi-flash-read \ Readback with SPI commands, not memory ops
use-hw-spi-flash-read
- gpo-port dup pc@ clk-mask invert and do-mask invert and cs-mask or swap pc! \ CLK, DO low, CS# high
+ gpo-port dup pl@ clk-mask invert and do-mask invert and cs-mask or swap pl! \ CLK, DO low, CS# high
h# 88e4 config-b@ 2 or h# 88e4 config-b!
;