This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#10507 - AMSSansa Lower frequency for uSD Card on as3525 to comply with sd specification.
Attached to Project:
Rockbox
Opened by Jack Halpin (FlynDice) - Tuesday, 11 August 2009, 08:18 GMT+2
Last edited by Jack Halpin (FlynDice) - Tuesday, 08 December 2009, 21:36 GMT+2
Opened by Jack Halpin (FlynDice) - Tuesday, 11 August 2009, 08:18 GMT+2
Last edited by Jack Halpin (FlynDice) - Tuesday, 08 December 2009, 21:36 GMT+2
|
DetailsThis patch lowers the frequency of the card clock to 31 Mhz for a high speed card and 15.5 MHz for a standard speed which respects the sd specification speeds of 50 & 25. Due to the current PCLK setting of 62 MHz these are the highest frequencies we can use and still remain within the spec. I have only tested on my e280v2. I can copy and delete files between the uSD and internal with no problem and music plays normally. I have not run check_disk yet. I had to disable widebus(4bits vs 1) to get this to work.
|
This task depends upon
Closed by Jack Halpin (FlynDice)
Tuesday, 08 December 2009, 21:36 GMT+2
Reason for closing: Fixed
Additional comments about closing: Fixed with r23901
Tuesday, 08 December 2009, 21:36 GMT+2
Reason for closing: Fixed
Additional comments about closing: Fixed with r23901
I think the timeouts should be hardcoded, like SD_MAX_READ_TIMEOUT[NUM_VOLUMES], because we always know the state of the MCI_CLOCK_BYPASS bit for drives 0 & 1, so no need to read it.
Also is the change to pushpull bus mode needed?
Why do you put an extra card_info[drive].initialized = 1; before initialization is fully completed?
Since we should know what we set MCI_CLOCK to, I think reading it and doing a "& 0xff00" is not needed, but that's almost cosmetics.
Last thing: I'll run a test_disk in benchmark mode with and without this patch to see if using 1 or 4 bits data line has a noticeable effect.
btw I'll make a better error message for this one
I did not bother with percentages for the (tiny tiny) performance difference, i attach the results if you want to check
I also let the change to test_disk.c to use the µSD and not internal storage.
It gets no worse than with SVN: when deleting the MUSIC/ folder created by the OF from the card I get a data crc fail (error 0x2) on the Transcend 4GB class 6
Could you check I didn't mess up either ?
Regression: microSD isn't detected on boot, you have to remove and reinsert it.
test_disk is a bit faster on 512b accesses, slower on other, and a write+compare test with 300MB was OK, now running with 2047MB
The pushpull/opendrain thing is not an issue for us with sd, it is an mmc thing. The pl180 reset value for this puts the bus in pushpull mode anyway and we never change it which is how it should be.
The 400kHz limit during the ident phase is also an mmc thing and does not apply to sd. When it says "some cards" need this it's referring to mmc cards, not some sd cards.
The pl180 is designed to be used with both. My e280v2 internal and microsd work fine without the 400kHz Ident freq. and simply initializing at full MCLK freq(bypass).
We don't need to worry about someone trying to stick an mmc card into our microsd slot, it won't fit.....
In present SVN it seems we put the card in 4 bit mode but not the controller. I could not get 4 bit to work with the internal but with my uSD card I could browse the files and get album art displayed but
music would stop after 2-3 seconds. There is a 50 Kohm pull up resister on dat3(pin1) of the sd card that should be disconnected with ACMD42 SET_CLR_CARD_DETECT after entering 4bit mode.
Putting both cards into HS timing with the switch command seems to work fine.
Omitting the SD_SET_BLOCKLEN command seems to work fine as it defaults to 512 anyway.
That's all I can think of right now, I've had to take a break from the sd stuff for awhile as it was starting to turn me into a blithering idiot......
I've been trying to get the debug page to reliably show the card freqs so I do not end up with another "bypass screwup".
www.sandisk.com/media/216454/appnotemmc_sdv1.0.pdf P.3:
Timing specifications
Design engineers must meet the rise, fall, setup, hold, and other SD Card and
MultiMediaCard bus timing specifications. If they want to support MultiMediaCards in
their design, the clock speed should be controllable by the host. This is due to the
MultiMediaCard's open-drain mode; the MultiMediaCard powers up in the open-drain
mode and cannot handle a clock faster than 400 Khz. Once the MultiMediaCard
completes the initialization process, the card switches to the push-pull mode. In the pushpull
mode the MultiMediaCard can run at the maximum clock speed.
and p.6:
Clock control is another option that should be implemented in a MultiMediaCard or SD
Card design. As mentioned in the Timing section, if the design needs to support the
MultiMediaCard, the clock should be lowered to 400 kHz or less during initialization.
When the initialization process is complete, the host can raise the clock speed to the
card’s maximum.
And also in a Sandisk manual I can't find a link for right now but the file name is: Sandisk_productmanualsdcardv2.2final.pdf
from a table on p.3-9:
Clock Freq. Identification Mode(9) fOD 010/10 0 400 kHz CL < 250 pF (21 cards)
(9) Low frequency required for MMC compatibility.
I hadn't looked back at the SD spec after finding these. There's so much missing from the simplified spec that I've found a lot of info by looking through the card manuals from several card manufacturers.
It didn't really change anything when I tried it anyway, it just worked. And what we do now works just fine it was just one of those observations that are crowding out my sanity.......
EDIT: Here's a similar doc I found a link for: www.cs.ucr.edu/~amitra/sdcard/ProdManualSDCardv1.9.pdf see the table on p.3-10