[OpenBIOS] r382 - cpu/x86/pc/olpc/sdtools dev/olpc/dcon
svn at openbios.org
svn at openbios.org
Wed May 16 10:32:25 CEST 2007
Author: wmb
Date: 2007-05-16 10:32:24 +0200 (Wed, 16 May 2007)
New Revision: 382
Modified:
cpu/x86/pc/olpc/sdtools/maketar
cpu/x86/pc/olpc/sdtools/sd.fth
dev/olpc/dcon/dconsmb.fth
Log:
OLPC SD exerciser program - added MSR , DCON, and mfg data support.
Modified: cpu/x86/pc/olpc/sdtools/maketar
===================================================================
--- cpu/x86/pc/olpc/sdtools/maketar 2007-05-15 00:59:33 UTC (rev 381)
+++ cpu/x86/pc/olpc/sdtools/maketar 2007-05-16 08:32:24 UTC (rev 382)
@@ -1,6 +1,9 @@
#!/bin/sh
-cp ../../../bin/x86/linux/forth .
-cp ../../../bin/x86/builder.dic .
-cp ../../../cpu/x86/ioports.fth .
-tar cfz sdkit.tgz forth builder.dic sd.fth ioports.fth sd
+ls ../../../../../cpu/x86/Linux
+cp ../../../../../cpu/x86/Linux/forth .
+cp ../../../../../cpu/x86/build/builder.dic .
+cp ../../../../../cpu/x86/ioports.fth .
+cp ../../../../../cpu/x86/pc/olpc/mfgdata.fth .
+cp ../../../../../dev/olpc/dcon/dconsmb.fth .
+tar cfz sdkit.tgz forth builder.dic sd.fth ioports.fth dconsmb.fth mfgdata.fth sd
rm -f builder.dic forth ioports.fth
Modified: cpu/x86/pc/olpc/sdtools/sd.fth
===================================================================
--- cpu/x86/pc/olpc/sdtools/sd.fth 2007-05-15 00:59:33 UTC (rev 381)
+++ cpu/x86/pc/olpc/sdtools/sd.fth 2007-05-16 08:32:24 UTC (rev 382)
@@ -33,6 +33,32 @@
: r ( offset -- ) sdl@ u. ;
: w ( l offset -- ) sdl! ;
+
+fff0.0000 10.0000 mmap constant flash-base
+\needs cdump : cdump ( adr len -- ) bounds ?do i c@ .x loop ;
+\needs .mfg-data fload mfgdata.fth
+
+: 1ms ( -- )
+ h# 10 msr@ drop d# 500,000 + ( limit )
+ begin dup h# 10 msr@ drop - 0< until
+ drop
+;
+: ms ( #ms -- ) 0 ?do 1ms loop ;
+
+\needs dcon@ fload dconsmb.fth
+
+: mode! ( mode -- ) 1 dcon! ;
+: hres! ( hres -- ) 2 dcon! ; \ def: h# 458 d# 1200
+: htotal! ( htotal -- ) 3 dcon! ; \ def: h# 4e8 d# 1256
+: hsync! ( sync -- ) 4 dcon! ; \ def: h# 1808 d# 24,8
+: vres! ( vres -- ) 5 dcon! ; \ def: h# 340 d# 900
+: vtotal! ( htotal -- ) 6 dcon! ; \ def: h# 390 d# 912
+: vsync! ( sync -- ) 7 dcon! ; \ def: h# 403 d# 4,3
+: timeout! ( to -- ) 8 dcon! ; \ def: h# ffff
+: scanint! ( si -- ) 9 dcon! ; \ def: h# 0000
+: bright! ( level -- ) d# 10 dcon! ; \ def: h# xxxF
+
+
\ LICENSE_BEGIN
\ Copyright (c) 2006 FirmWorks
\
Modified: dev/olpc/dcon/dconsmb.fth
===================================================================
--- dev/olpc/dcon/dconsmb.fth 2007-05-15 00:59:33 UTC (rev 381)
+++ dev/olpc/dcon/dconsmb.fth 2007-05-16 08:32:24 UTC (rev 382)
@@ -8,7 +8,7 @@
h# 70 value smb-clock \ 8 is the shortest period the controller allows
: smb-on ( -- )
- h# 5140000b rdmsr drop to smb-base
+ h# 5140000b msr@ drop to smb-base
\ Empirically, it doesn't work if you set reg 6 before reg 5
\ First set the registers with the enable bit clear
smb-clock 1 lshift 5 smb!
More information about the OpenBIOS
mailing list