Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Android in Japan at last?



Stephen J. Turnbull wrote:
> Godwin Stewart writes:
>  > On 27/05/09 12:25, Dave M G wrote:
>  > 
>  > > Looks like additional storage is with a miniSD card, up to 4GB capacity. 
>  > > Hopefully in the future it can support an 8GB card as well.
>  > 
>  > MiniSD cards of 4GB are necessarily SDHC cards, which means that the card
>  > reader itself should support cards up to 32GB. The only limiting factor here
>  > is whether or not the O/S can manage filesystems greater than 4GB.
> 
> Do check.  The Zaurus SLC-3000 driver has a silly limitation of 1GiB on
> SD cards.  I could understand 2GiB (32-bit ssize_t) or 4GiB (32 bit
> size_t), but 1GiB?[1]

That's pretty much a problem with the SD spec itself...

The SD size is calculated as:
12bit c_size * 4*2^(3bit c_size_mult) * 2^(4bit read_bl_len)

SD cards <= 1GB use a read_bl_len of 9 (512 Bytes)
SD cards > 1GB apparently hijacked the block length field in the CSD
register of the card to express the bigger size, but you can not
actually use a block length >512 with the SET_BLOCK_LEN command.

So this is pretty much a special case, which was likely never tested
at the time they wrote the driver...

The SD simplified spec says:
"To indicate 2 GByte card, BLOCK_LEN shall be 1024 bytes.
Therefore, the maximal capacity that can be coded is 4096*512*1024 =
2 G bytes."
However there are even 4GB SD cards that use a BLOCK_LEN of 2048 bytes to
indicated the 4GB.

In theory you could indicate up to 64GB that way, but the upper
limit is set by the 32bit byte address given to the READ/WRITE
commands.

For SDHC they switched to block addressing (512byte blocks) instead
of byte addressing, so you could address up to 2TB with the
READ/WRITE commands.

However for some unknown reason the SDHC spec says "the maximum
capacity of the Physical Layer Specification Version 2.00 is 32 GB",
even though the new CSD register layout (22bit c_size, in 512KB
blocks) would also allow up to 2TB AFAICS.

-- 
Tobias						PGP: http://9ac7e0bc.uguu.de


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links