Hi Nat,
> Yes I understand that, but assuming 512 to be the default is a
> violation of
> MMC specification 3.1, and I think it's better not to assume the hardware
> violates it (even if it does at the moment).
>
> This way, if some "crazy" manufacturer actually implements the
> specification,
> the software still works.
At some point you will have to come to terms with the fact that SD cards
have outgrown the SD standard ;o)
The SD standard calls for a 128 bit descriptor (someone was thinking small)
called the CSD. It has a 12 bit field to hold the number of blocks (c_size)
and a 3 bit field to shift c_size (c_size_mult). The numner of blocks is
calculated:
BLOCKNR = ((csd.c_size + 1)*(0x01 << (csd.c_size_mult + 2)))
Filling all these fields completely allows for a max of
= (4095 + 1) * (0x01 << (7 + 2) )
= 2097152 blocks
= 1MB at 512 bytes per block
So, if you make SD cards, you can make 2G, 4G and 8G cards and there is a
market for them, what do you do? How do you get a card to convey that it is
larger than 1MB?
It so happens that the 4 bit csd.rd_bl_len field that determines block
length has some wiggle room. The block length is calculated:
BLOCK_LEN = (0x01 << csd.rd_bl_len)
But, everyone (except me) knows that all SD cards are accessed with 512 byte
blocks (csd.rd_bl_len = 9). With 4 bits, csd.rd_bl_len could be as large as
15 (32768 bytes). So, this is where the extra size has been placed. Where
would you place it?
In the meantime, a new, proprietary SDHC standard has been established and
we will start seeing SDHC capable devices (cameras, camcorders, etc.). These
devices will be capable of recognizing and reading both SD and SDHC cards.
The challenge for us will be how to get hold of the SDHC standard so we can
add SDHC support to Linux/uClinux.
RF
> On Thursday 22 February 2007 3:18 pm, Wolfgang Mües wrote:
> > On Mittwoch, 21. Februar 2007, NZG wrote:
> > > Personally I'll probably just force all cards to a 512 block size.
> > > Any card that ignores this command and wants to use a different size
> > > is just going to have to be declared unsupported to support this new
> > > SD garbage.
> >
> > You don't need to set a block size. 512 is the default, even for those
> > cards which have 1024 in the csd...
> >
> > regards
> >
> > Wolfgang
> _______________________________________________
> uClinux-dev mailing list
> [email protected]
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by [email protected]
> To unsubscribe see:
> http://mailman.uclinux.org/mailman/options/uclinux-dev
>
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev