[openfirmware] r1291 - dev/mmc/sdhci
svn at openfirmware.info
svn at openfirmware.info
Sun Aug 9 06:01:36 CEST 2009
Author: wmb
Date: 2009-08-09 06:01:36 +0200 (Sun, 09 Aug 2009)
New Revision: 1291
Modified:
dev/mmc/sdhci/sdhci.bth
dev/mmc/sdhci/sdhci2.bth
dev/mmc/sdhci/sdhcixo.bth
dev/mmc/sdhci/sdmmc.bth
dev/mmc/sdhci/selftest.fth
Log:
SDHCI MMC selftest improvements from Luke Gorrie.
Modified: dev/mmc/sdhci/sdhci.bth
===================================================================
--- dev/mmc/sdhci/sdhci.bth 2009-08-09 04:00:58 UTC (rev 1290)
+++ dev/mmc/sdhci/sdhci.bth 2009-08-09 04:01:36 UTC (rev 1291)
@@ -17,7 +17,6 @@
finish-device
-fload ${BP}/dev/mmc/sdhci/selftest.fth
end0
end-tokenizing
Modified: dev/mmc/sdhci/sdhci2.bth
===================================================================
--- dev/mmc/sdhci/sdhci2.bth 2009-08-09 04:00:58 UTC (rev 1290)
+++ dev/mmc/sdhci/sdhci2.bth 2009-08-09 04:01:36 UTC (rev 1291)
@@ -23,7 +23,6 @@
finish-device
-fload ${BP}/dev/mmc/sdhci/selftest.fth
end0
end-tokenizing
Modified: dev/mmc/sdhci/sdhcixo.bth
===================================================================
--- dev/mmc/sdhci/sdhcixo.bth 2009-08-09 04:00:58 UTC (rev 1290)
+++ dev/mmc/sdhci/sdhcixo.bth 2009-08-09 04:01:36 UTC (rev 1291)
@@ -23,7 +23,6 @@
finish-device
-fload ${BP}/dev/mmc/sdhci/selftest.fth
end0
end-tokenizing
Modified: dev/mmc/sdhci/sdmmc.bth
===================================================================
--- dev/mmc/sdhci/sdmmc.bth 2009-08-09 04:00:58 UTC (rev 1290)
+++ dev/mmc/sdhci/sdmmc.bth 2009-08-09 04:01:36 UTC (rev 1291)
@@ -9,6 +9,7 @@
FCode-version2
fload ${BP}/dev/mmc/sdhci/sdmmc.fth
+fload ${BP}/dev/mmc/sdhci/selftest.fth
end0
end-tokenizing
Modified: dev/mmc/sdhci/selftest.fth
===================================================================
--- dev/mmc/sdhci/selftest.fth 2009-08-09 04:00:58 UTC (rev 1290)
+++ dev/mmc/sdhci/selftest.fth 2009-08-09 04:01:36 UTC (rev 1291)
@@ -3,6 +3,8 @@
headers
+: /block ( -- u ) " /block" $call-parent ;
+
0 instance value sbuf
0 instance value ibuf
0 instance value obuf
@@ -18,8 +20,8 @@
obuf /block dma-free 0 to obuf
sbuf /block dma-free 0 to sbuf
;
-: read-block ( adr block# -- error? ) 1 true r/w-blocks 1 <> ;
-: write-block ( adr block# -- error? ) 1 false r/w-blocks 1 <> ;
+: read-block ( adr block# -- error? ) 1 read-blocks 1 <> ;
+: write-block ( adr block# -- error? ) 1 write-blocks 1 <> ;
: test-block ( block# pattern -- error? )
obuf /block 2 pick fill obuf 2 pick write-block if true exit then
ibuf /block rot invert fill ibuf swap read-block if true exit then
@@ -34,9 +36,7 @@
;
external
: selftest ( -- error? )
- open 0= if ." Open /sd failed" cr true exit then
- 0 1 set-address
- attach-card 0= if ." No card inserted" cr close false exit then
+ open 0= if ." Open sdmmc failed" cr true exit then
alloc-test-bufs
['] (selftest) catch if true then
free-test-bufs
More information about the openfirmware
mailing list