Port-arm archive

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

Re: 1024bytes/sect microSD support



In message: <20091126.230527.78408573.kiyohara%kk.iij4u.or.jp@localhost>
            KIYOHARA Takashi <kiyohara%kk.iij4u.or.jp@localhost> writes:
: Hi! all,
: 
: 
: I has 2 problems with sdmmc and pxamci.
: 
: I got a microSD.  My GUMSTIX reports this message with it.
: 
:   ld0: 1938 MB, 984 cyl, 32 head, 63 sec, 1024 bytes/sect x 1985024 sectors
: 
: It is 1024 bytes/sect card.  I can't mount, fdisk, and disklabel it.
: This reason is report 'read CRC error'(STAT_CRC_READ_ERROR and MMC_I_DAT_ERR)
: by pxamci.
: I try with following fix.  pxamci quit and work.  ;-) 
: 
: sys/arch/arm/xscale/pxa2x0_mci.c:pxamci_attach_sub() ---
:         /* Setup max block length */
:         if (CPU_IS_PXA270) {
: #if 0
:                 sc->sc_maxblklen = 2048;
: #else
:                 sc->sc_maxblklen = 512;
: #endif
:         } else {
:                 sc->sc_maxblklen = 512;
:         }
: --- sys/arch/arm/xscale/pxa2x0_mci.c::pxamci_attach_sub()
: 
: 
: Also I know, Linux's drivers/mmc/card/block.c always set 512bytes.
: 
:   mmc_blk_alloc()
:   {
:     :
:         /*
:          * Both SD and MMC specifications state (although a bit
:          * unclearly in the MMC case) that a block size of 512
:          * bytes must always be supported by the card.
:          */
:         md->block_bits = 9;
:     :
:   }
: 
: 
: I think that it is necessary to always adjust us to 512 bytes.  If this
: is not supported, we cannot have Linux and interchangeability.
: However, I do not know how to set more better it.  Does anyone have an
: idea?

FreeBSD always uses 512 byte blocks.  Other block sizes are only
useful to compute the size of the device, and aren't useful for normal
operations, nor are they a requirement from a disk I/O sense and I
don't think they should be visible outside the sd/mmc layer.  I found
quite a few references to this restriction in the literature when I
was writing the FreeBSD stack...

Warner


Home | Main Index | Thread Index | Old Index