Adding SDHC Support (Success!)
Adding SDHC Support (Success!)
Hi,
the last 2 days i were working on SDHC support for Gc-Linux..
The init-handshake works fine now, i can even see the Partitions...
But then if he tries to load the rootfs, he gets an error.. Since i have nearly no idea of this stuff, i hope on your help!
If i interpret it correctly, he tries to read from a block, which is MUCH too high for my SDHC-Card.
I'm using a 8GB Card, so it has 15523840 512-Byte blocks..
Here is the error, i'm getting:
sd_generic_read: read, offset=2206839808, len=512
sd_generic_read: crc=8340, calc_crc=ffff, failed
sd_read_single_block: start=2206839808, data=c0377400, len=512, retval= -61
If you need anymore informations, just ask..
the last 2 days i were working on SDHC support for Gc-Linux..
The init-handshake works fine now, i can even see the Partitions...
But then if he tries to load the rootfs, he gets an error.. Since i have nearly no idea of this stuff, i hope on your help!
If i interpret it correctly, he tries to read from a block, which is MUCH too high for my SDHC-Card.
I'm using a 8GB Card, so it has 15523840 512-Byte blocks..
Here is the error, i'm getting:
sd_generic_read: read, offset=2206839808, len=512
sd_generic_read: crc=8340, calc_crc=ffff, failed
sd_read_single_block: start=2206839808, data=c0377400, len=512, retval= -61
If you need anymore informations, just ask..
Last edited by _Nold_ on Mon Feb 13, 2012 2:40 pm, edited 1 time in total.
| DOL-001 (EUR) Indigo | WKF Plug'n'Play Diskdrive Replacement | BBA |
| Internalised: WaveBird, Keyboard Adapter, MemoryCard, SD-Adapter |
| DOL-001 (EUR) | >> First Gamecube Portable - Worklog
| Internalised: WaveBird, Keyboard Adapter, MemoryCard, SD-Adapter |
| DOL-001 (EUR) | >> First Gamecube Portable - Worklog
Re: Adding SDHC Support
SDHC does not read by BYTE address, it reads by block address. So this means you need to send offset in form of 512 byte blocks (and write a wrapper to handle mis-aligned blocks if you're reading partial sectors, but my guess is gc-linux already handles all this).
So, if SDHC, use block address (512byte sized blocks).
This page was really helpful for me a long time ago: http://elm-chan.org/docs/mmc/mmc_e.html CMD17-CMD18
Also, the same goes for writing blocks.
So, if SDHC, use block address (512byte sized blocks).
This page was really helpful for me a long time ago: http://elm-chan.org/docs/mmc/mmc_e.html CMD17-CMD18

Also, the same goes for writing blocks.

Re: Adding SDHC Support
Hm, ok, thanks for that so far.. the problem is, that the whole gcn-sd driver is only reading single blocks (CMD17)..
That's why i have no idea where the problem is, since he even can read out the partition-table..
I also tried "reallocating" before.. i just did a if(offset > capacity_blks) { offset = offset/512; }
Just to try it out.. no access... he gives me the error i had right after i finished the initialisation process..
"Can not open root device "gcnsda2" or unknown block(61,2)"
So it seems that i really need some kind of reallocation... :/
I never did something like this before, but i got so far, i need to get that going
EDIT:
Ok, i just did a little change, now he tries to read the first sectors of my ext3 partition.. but he dosn't seem to find a filesystem...
That's why i have no idea where the problem is, since he even can read out the partition-table..
I also tried "reallocating" before.. i just did a if(offset > capacity_blks) { offset = offset/512; }
Just to try it out.. no access... he gives me the error i had right after i finished the initialisation process..
"Can not open root device "gcnsda2" or unknown block(61,2)"
So it seems that i really need some kind of reallocation... :/
I never did something like this before, but i got so far, i need to get that going

EDIT:
Ok, i just did a little change, now he tries to read the first sectors of my ext3 partition.. but he dosn't seem to find a filesystem...
| DOL-001 (EUR) Indigo | WKF Plug'n'Play Diskdrive Replacement | BBA |
| Internalised: WaveBird, Keyboard Adapter, MemoryCard, SD-Adapter |
| DOL-001 (EUR) | >> First Gamecube Portable - Worklog
| Internalised: WaveBird, Keyboard Adapter, MemoryCard, SD-Adapter |
| DOL-001 (EUR) | >> First Gamecube Portable - Worklog
Re: Adding SDHC Support
noldor, the sd driver is a bit messy i think, it adds things to the (outdated) mmc compatibility layer and should be rewritten completely. i also had some issues with it when i tried to add sdhc support (i don't remember how far i got, but it recognized the card and then some kind of kernel panic). take a look at the other sdhc drivers (but not only the wii one)
Re: Adding SDHC Support
Yea, i was looking at nearly every patch ever made on linux mmc/sd drivers XD
Now i'm getting:
"EXT3-FS: Magic mismatch, very weird"
That's not bad at all in my eyes xD
Now i'm getting:
"EXT3-FS: Magic mismatch, very weird"
That's not bad at all in my eyes xD
| DOL-001 (EUR) Indigo | WKF Plug'n'Play Diskdrive Replacement | BBA |
| Internalised: WaveBird, Keyboard Adapter, MemoryCard, SD-Adapter |
| DOL-001 (EUR) | >> First Gamecube Portable - Worklog
| Internalised: WaveBird, Keyboard Adapter, MemoryCard, SD-Adapter |
| DOL-001 (EUR) | >> First Gamecube Portable - Worklog
Re: Adding SDHC Support
Noldor, perhaps put the file you have up on a pastie.org kind of site and we can have a look.

Re: Adding SDHC Support
Here you go: http://pastebin.com/awLU4cBL
But i have to warn you, it's not really nice coded, for the moment.
The most interesting part should be sd_generic_read, as i told you the initialisation works fine and all CSD Data seems to be ok, too...
But i have to warn you, it's not really nice coded, for the moment.

The most interesting part should be sd_generic_read, as i told you the initialisation works fine and all CSD Data seems to be ok, too...
| DOL-001 (EUR) Indigo | WKF Plug'n'Play Diskdrive Replacement | BBA |
| Internalised: WaveBird, Keyboard Adapter, MemoryCard, SD-Adapter |
| DOL-001 (EUR) | >> First Gamecube Portable - Worklog
| Internalised: WaveBird, Keyboard Adapter, MemoryCard, SD-Adapter |
| DOL-001 (EUR) | >> First Gamecube Portable - Worklog
Re: Adding SDHC Support
On line 1165, don't shift. Cause it looks like you're doing 1*512bytes*512blocks per read... 


Re: Adding SDHC Support
No, that's fine, i just tried that again...
block_len just tells him, that a block is 512byte long...
//EDIT: Oh man, you were rigth! but i can't change block_len, what i need to change is only the start-offset!!
AND FUCK YES IT WORKS!!! That's so awesome!! Thank you so much! *~*
Now i just need to do a lot of cleanup ^^
I'm so happy that it works
that's just too cool!
block_len just tells him, that a block is 512byte long...
//EDIT: Oh man, you were rigth! but i can't change block_len, what i need to change is only the start-offset!!
AND FUCK YES IT WORKS!!! That's so awesome!! Thank you so much! *~*
Now i just need to do a lot of cleanup ^^
I'm so happy that it works

| DOL-001 (EUR) Indigo | WKF Plug'n'Play Diskdrive Replacement | BBA |
| Internalised: WaveBird, Keyboard Adapter, MemoryCard, SD-Adapter |
| DOL-001 (EUR) | >> First Gamecube Portable - Worklog
| Internalised: WaveBird, Keyboard Adapter, MemoryCard, SD-Adapter |
| DOL-001 (EUR) | >> First Gamecube Portable - Worklog
Re: Adding SDHC Support
next step: patching the 3.x kernel 

please search before you ask - a lot has been discussed already!
(or use google with "site:gc-forever.com *term*")
http://is.gd/MDmZcr
we also have a wiki filled with knowledge
http://is.gd/dX58Rm
(or use google with "site:gc-forever.com *term*")
http://is.gd/MDmZcr
we also have a wiki filled with knowledge
http://is.gd/dX58Rm
Re: Adding SDHC Support
hehe, that would be cool, too. But i can't see any advantage in using a 3.X Kernel :/
Building a nice little distro seems much more usefull in my eyes :/
But the next step for me is to go to bed and get healthy <.<
After that i will clean up my code and build back the SD-Support ^^
Building a nice little distro seems much more usefull in my eyes :/
But the next step for me is to go to bed and get healthy <.<
After that i will clean up my code and build back the SD-Support ^^
| DOL-001 (EUR) Indigo | WKF Plug'n'Play Diskdrive Replacement | BBA |
| Internalised: WaveBird, Keyboard Adapter, MemoryCard, SD-Adapter |
| DOL-001 (EUR) | >> First Gamecube Portable - Worklog
| Internalised: WaveBird, Keyboard Adapter, MemoryCard, SD-Adapter |
| DOL-001 (EUR) | >> First Gamecube Portable - Worklog
Re: Adding SDHC Support
get well soon!
don't forget to send this to the gc-linux mailing list
don't forget to send this to the gc-linux mailing list

please search before you ask - a lot has been discussed already!
(or use google with "site:gc-forever.com *term*")
http://is.gd/MDmZcr
we also have a wiki filled with knowledge
http://is.gd/dX58Rm
(or use google with "site:gc-forever.com *term*")
http://is.gd/MDmZcr
we also have a wiki filled with knowledge
http://is.gd/dX58Rm
Re: Adding SDHC Support (Success!)
So much to do, but so little time.. ^^
I updated my old thread with some testing kernels, hope you can give it a try..
Thanks again emu
I updated my old thread with some testing kernels, hope you can give it a try..
Thanks again emu

| DOL-001 (EUR) Indigo | WKF Plug'n'Play Diskdrive Replacement | BBA |
| Internalised: WaveBird, Keyboard Adapter, MemoryCard, SD-Adapter |
| DOL-001 (EUR) | >> First Gamecube Portable - Worklog
| Internalised: WaveBird, Keyboard Adapter, MemoryCard, SD-Adapter |
| DOL-001 (EUR) | >> First Gamecube Portable - Worklog
Re: Adding SDHC Support (Success!)
So cool!!That means more compatibility for Linux based emus or possibility to use it through ide-exi? Man please, tell me it is true at least one of these possibilities.
Re: Adding SDHC Support (Success!)
tell me where you see the connection between sdhc and the ide-exijulius wrote:So cool!!That means more compatibility for Linux based emus or possibility to use it through ide-exi? Man please, tell me it is true at least one of these possibilities.

please search before you ask - a lot has been discussed already!
(or use google with "site:gc-forever.com *term*")
http://is.gd/MDmZcr
we also have a wiki filled with knowledge
http://is.gd/dX58Rm
(or use google with "site:gc-forever.com *term*")
http://is.gd/MDmZcr
we also have a wiki filled with knowledge
http://is.gd/dX58Rm
Re: Adding SDHC Support (Success!)
Both are using EXI
IDE-EXI would be cool.. but i havn't got one :/ ..
I was thinking about building a complete new batch (about 10).. They would be pretty cheap but i think we should wait until FoxxOTG finishes his project...

IDE-EXI would be cool.. but i havn't got one :/ ..
I was thinking about building a complete new batch (about 10).. They would be pretty cheap but i think we should wait until FoxxOTG finishes his project...
| DOL-001 (EUR) Indigo | WKF Plug'n'Play Diskdrive Replacement | BBA |
| Internalised: WaveBird, Keyboard Adapter, MemoryCard, SD-Adapter |
| DOL-001 (EUR) | >> First Gamecube Portable - Worklog
| Internalised: WaveBird, Keyboard Adapter, MemoryCard, SD-Adapter |
| DOL-001 (EUR) | >> First Gamecube Portable - Worklog
Re: Adding SDHC Support (Success!)
well they use exi but a sdhc driver won't help you with an ide harddrive 
but....
http://www.gc-linux.org/wiki/EXI:IDEHostAdapter


but....
http://www.gc-linux.org/wiki/EXI:IDEHostAdapter

please search before you ask - a lot has been discussed already!
(or use google with "site:gc-forever.com *term*")
http://is.gd/MDmZcr
we also have a wiki filled with knowledge
http://is.gd/dX58Rm
(or use google with "site:gc-forever.com *term*")
http://is.gd/MDmZcr
we also have a wiki filled with knowledge
http://is.gd/dX58Rm