#137028 - ps2aich - Tue Aug 07, 2007 2:34 pm
Hi all,
I open an extra thread to not poison New DLDI Tester - flash card report thread:
I was a little disappointed that EZ-V does not pass the read alignment
test (since I recently bought one), so I modified the driver
to allow this feature:
Before I upload the modified driver to the DLDI-Wiki, please could
some EZ-V User test it (of course, it works for me, but you never know :-)): ez5s.zip
Reason for the failure was following code snippet:
which I replaced by
which was already as comment there.
As result, the driver didn't fit anymore into 8k, so now it uses
16k (should be no problem since for DLDI 32k are reserved
nevertheless). If this would be an problem for anyone,
I can try to spare some space by refactoring *p usage.
Edit 080801:
Somebody noticed, that on large block reads, the driver with the unaligned read feature was much slower than the former one. So I optimzed it again by testing for unalignment.
The updated dldi can be found in the DLDI Wiki.
Last edited by ps2aich on Fri Aug 01, 2008 9:22 pm; edited 1 time in total
I open an extra thread to not poison New DLDI Tester - flash card report thread:
I was a little disappointed that EZ-V does not pass the read alignment
test (since I recently bought one), so I modified the driver
to allow this feature:
Before I upload the modified driver to the DLDI-Wiki, please could
some EZ-V User test it (of course, it works for me, but you never know :-)): ez5s.zip
Reason for the failure was following code snippet:
Code: |
*((uint32 *)(&ppbuf[i])) = CARD_DATA_RD; |
which I replaced by
Code: |
temp = CARD_DATA_RD;
temp1= CARD_DATA; ppbuf[i] = *p; ppbuf[i+1] = *(p+1); ppbuf[i+2] = *(p+2); ppbuf[i+3] = *(p+3); |
which was already as comment there.
As result, the driver didn't fit anymore into 8k, so now it uses
16k (should be no problem since for DLDI 32k are reserved
nevertheless). If this would be an problem for anyone,
I can try to spare some space by refactoring *p usage.
Edit 080801:
Somebody noticed, that on large block reads, the driver with the unaligned read feature was much slower than the former one. So I optimzed it again by testing for unalignment.
The updated dldi can be found in the DLDI Wiki.
Code: |
// test if ppbuf is 4byte-aligned
if ((((uint32) ppbuf) & 0x3) ) { // ppbuf is non-aligned do { // Read data if available if (CARD_CR2 & CARD_DATA_READY) { if (i< target) { temp = CARD_DATA_RD; ppbuf[i] = *p; ppbuf[i+1] = *(p+1); ppbuf[i+2] = *(p+2); ppbuf[i+3] = *(p+3); } i+=4; } } while (CARD_CR2 & CARD_BUSY); } else { // ppbuf is aligned do { // Read data if available if (CARD_CR2 & CARD_DATA_READY) { if (i< target) { *((uint32 *)(&ppbuf[i])) = CARD_DATA_RD; } i+=4; } } while (CARD_CR2 & CARD_BUSY); } |
Last edited by ps2aich on Fri Aug 01, 2008 9:22 pm; edited 1 time in total