sd: Fix SDSC card support #41
Reference in New Issue
Block a user
Delete Branch "fix-sdsc-card-blocksize"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Old SDSC cards could have a native blocksize != 512 bytes, but they
should support the SET_BLOCKLEN command to set the blocksize to 512.
Use that so we can just assume 512 everywhere else.
SDSC cards used byte addresses, not sector numbers, for the argument
of READ_BLOCK and WRITE_BLOCK. Check the card type and multiply the
sector number with 512 if necessary.
Tested with a noname chinese 128 MiB-ish card.
Signed-off-by: Matthias Blankertz matthias@blankertz.org