#1356 closed enhancement (fixed)

Add support for High Capacity SD and MMC cards to RTEMS

Reported by: Gene Smith Owned by: Sebastian Huber
Priority: normal Milestone: 4.10
Component: fs Version: 4.9
Severity: minor Keywords:
Cc: chrisj@…, sebastian.huber@… Blocked By:
Blocking:

Description

I could be wrong on this, but looking at the spi-sd-card.c code it appears that it currently supports only cards with a capacity of <=2GByte. To use the higher capacity cards I think you have to read/write the cards by block number and not by byte offset address as it currently does.

To know that an SD supports "block access" (which implies capacity >2GB) you have to do add CMD8 and CMD58 to see the OCR contents which contains the HCS (High Capacity Supported) flag.

For MMC you have to do add CMD58 to see the HCS flag.

You also have to tell MMC from SD. (MMC always fails ACMD41 unlike SD which supports it, see Bug 1355)

The cards with >2GB also only work with FAT32 and not FAT16 or 12. I think RTEMS supports FAT32 so no changes should be needed there (other than LFN enhancement which is another topic).

Attachments (7)

spi-sd-card.c (39.1 KB) - added by Gene Smith on Jan 22, 2009 at 3:01:17 PM.
My complete spi-sd-card.c
spi-sd-card.h (2.0 KB) - added by Gene Smith on Jan 22, 2009 at 3:02:23 PM.
Adds block_addr to driver structure
spi-sd-card-1.9-HEAD.c.diff (7.0 KB) - added by Gene Smith on Jan 22, 2009 at 5:01:26 PM.
spi-sd-card.c patch against HEAD
spi-sd-card-1.4-HEAD.h.diff (302 bytes) - added by Gene Smith on Jan 22, 2009 at 5:03:03 PM.
Diff to HEAD version of spi-sd-card.h
spi-sd-card.patch (11.5 KB) - added by Sebastian Huber on Jan 27, 2009 at 10:38:04 AM.
Patch for CVS HEAD
spi-sd-card_v1.patch (11.6 KB) - added by Gene Smith on Jan 28, 2009 at 11:23:34 PM.
Slight mod for MMC's csd_structure value
sd-card-HEAD.patch (12.4 KB) - added by Sebastian Huber on Feb 2, 2009 at 8:03:38 AM.
Patch for CVS HEAD

Download all attachments as: .zip

Change History (12)

comment:1 Changed on Jan 21, 2009 at 5:11:39 PM by Joel Sherrill

Cc: Chris Johns added
Owner: changed from Joel Sherrill to Chris Johns

Changed on Jan 22, 2009 at 3:01:17 PM by Gene Smith

Attachment: spi-sd-card.c added

My complete spi-sd-card.c

Changed on Jan 22, 2009 at 3:02:23 PM by Gene Smith

Attachment: spi-sd-card.h added

Adds block_addr to driver structure

comment:2 Changed on Jan 22, 2009 at 3:56:17 PM by Sebastian Huber

Cc: Sebastian Huber added
Owner: changed from Chris Johns to Sebastian Huber

Changed on Jan 22, 2009 at 5:01:26 PM by Gene Smith

Attachment: spi-sd-card-1.9-HEAD.c.diff added

spi-sd-card.c patch against HEAD

Changed on Jan 22, 2009 at 5:03:03 PM by Gene Smith

Attachment: spi-sd-card-1.4-HEAD.h.diff added

Diff to HEAD version of spi-sd-card.h

Changed on Jan 27, 2009 at 10:38:04 AM by Sebastian Huber

Attachment: spi-sd-card.patch added

Patch for CVS HEAD

comment:3 Changed on Jan 27, 2009 at 10:38:04 AM by Sebastian Huber

attachments.isobsolete: 01, 1, 1, 1

Changed on Jan 28, 2009 at 11:23:34 PM by Gene Smith

Attachment: spi-sd-card_v1.patch added

Slight mod for MMC's csd_structure value

Changed on Feb 2, 2009 at 8:03:38 AM by Sebastian Huber

Attachment: sd-card-HEAD.patch added

Patch for CVS HEAD

comment:4 Changed on Feb 2, 2009 at 8:03:38 AM by Sebastian Huber

attachments.isobsolete: 01, 1

comment:5 Changed on Apr 30, 2009 at 12:52:10 PM by Sebastian Huber

Resolution: fixed
Status: newclosed

Fixed in 4.10.

Note: See TracTickets for help on using tickets.