• Welcome to SCdev.org. Please log in.

Welcome to the new SCdev forums!

Supercard SD driver problem

Started by Amadeus, June 13, 2006, 01:53:20 AM

Previous topic - Next topic

Amadeus

Hello,

I am trying to include a supercard sd driver in DSLinux.
Demo sourcecode is available, but I am stuck... Every time
I read 0x09800000, I get 0xFFFF. I suspect that the supercard
is not initialized to IO-mode.

There is a special condition in DSLinux: the program is located in the
lower 16 Mbytes of GBA slot. Can somebody tell me if it's possible to
run programs from the lower 16 MBytes and doing I/O in the upper
16 MBytes at the same time?

Thank you

MisterJP

Hi Amadeus

I think you need to first unlock the supercard by writing 0xa55a twice and then 0x3 twice to 0x09FFFFFE.

When i tried to wrote the supercard sd driver, this what i've done and it worked. I have just checked out the latest dslinux source from cvs and apparently my code is now in the distribution : i don't know if it is still working as i made it last year and many changes have been made to the dslinux source code, however it's a start.
Please note that it was a test driver (it was my first linux driver) and the write part did not work, but i successfully managed to read data from the supercard.

Regards,
JP.

MisterJP

Apparently, the code i wrote is not working anymore. I didn't investigate much, but it appears the sc doesn't reply to the "SELECT CARD" command. From there, there are many possibilities, the RCA of the card has changed in the latest firmware, or maybe the unlock code or the firmware prevents some command to be used...

I'll try to make some more test over the week end.

Regards,
JP

Amadeus

Hello MisterJP,

Quote
I think you need to first unlock the supercard by writing 0xa55a twice and then 0x3 twice to 0x09FFFFFE.
Done. But how can I verify the success of unlocking?

Quote
When i tried to wrote the supercard sd driver, this what i've done and it worked.

Have you used the XIP kernel?

regards
Amadeus

MisterJP

Quote from: "Amadeus"Hello MisterJP,
Done. But how can I verify the success of unlocking?
Apart from sending a command which ask for a reply (reading a sector, send card CSD), i don't know.
Quote from: "Amadeus"
Have you used the XIP kernel?
Nope...

I made some more tests this evening and apparently, the only thing that prevent my code from working is the RCA of the SD card : with old supercard firmware, i used 0x7694, but with the latest (i did not test all firmware) the card is now @0x8B61.

I made a quick test program based on the driver source, it will get the csd from the card and give you the SD card size (sorry, the source is very messy :p )

http://thomasset.free.fr/main.zip

Hope this will help.

Regards,
JP.

MisterJP

Hi,

It seems the rca assigned by the supercard firmware is dependant on the SD card inserted, i guess it is related to the sd card CID.

The best solution would be to send a software reset to the card and then assign a new RCA, then it will work in all case.
Regarding the linux driver, moving it to in the MMC layer would be the best solution as it will handle all that part automatically, however i did not investigate much in this direction.

Regards,
JP.

Amadeus

My driver is working now. A week full of work..
Thanks for all infos!