diff --git a/TODO b/TODO index f7878bf874..b0e9462bb9 100644 --- a/TODO +++ b/TODO @@ -10,7 +10,7 @@ NuttX TODO List (Last updated March 4, 2011) (5) Binary loaders (binfmt/) (16) Network (net/, drivers/net) (5) Network Utilities (netutils/) - (1) USB (drivers/usbdev) + (2) USB (drivers/usbdev, drivers/usbhost) (5) Libraries (lib/) (12) File system/Generic drivers (fs/, drivers/) (2) Graphics subystem (graphics/) @@ -29,7 +29,7 @@ NuttX TODO List (Last updated March 4, 2011) (2) ARM/LPC313x (arch/arm/src/lpc313x/) (3) ARM/STR71x (arch/arm/src/str71x/) (4) ARM/LM3S6918 (arch/arm/src/lm3s/) - (5) ARM/STM32 (arch/arm/src/stm32/) + (4) ARM/STM32 (arch/arm/src/stm32/) (4) 8051 / MCS51 (arch/8051/) (2) Hitachi/Renesas SH-1 (arch/sh/src/sh1) (4) Renesas M16C/26 (arch/sh/src/m16c) @@ -324,7 +324,7 @@ o Network Utilities (netutils/) Status: Open. An annoyance, but not a real problem. Priority: Low -o USB (drivers/usbdev) +o USB (drivers/usbdev, drivers/usbhost) ^^^^^^^^^^^^^^^^^^^^ Description: There is a workaround for a bug in drivers/usbdev/usbdev_storage.c. @@ -332,6 +332,11 @@ o USB (drivers/usbdev) Status: Open Priority: Medium + Description: drivers/usbhost/usbhost_rtl8187.c is a work in progress. There is no RTL8187 + driver available yet. That is a work in progress. + Status: Open + Priority: Low (Unless you need RTL8187 support). + o Libraries (lib/) ^^^^^^^^^^^^^^^^ @@ -775,6 +780,10 @@ o ARM/LPC214x (arch/arm/src/lpc214x/) Desription: I am unable to initialize a 2Gb SanDisk microSD card (in adaptor) on the the mcu123 board. The card fails to accept CMD0. Doesn't seem like a software issue, but if anyone else sees the problem, I'd like to know. + Related: Fixes were recently made for the SDIO-based MMC/SD driver to + support 2Gb cards -- the blocksize was forced to 512 in all cases. The SPI- + based driver may also have this problem (but I don't think this would have + andything to do with CMD0). Status: Open Priority: Uncertain @@ -892,16 +901,6 @@ o ARM/STM32 (arch/arm/src/stm32/) Priority: Low until someone needs DMA1, Channel 5 (ADC3, UART4_TX, TIM5_CH1, or TIM8_CH2). - Desription: I am unable to access a 2Gb SanDisk microSD card (in adaptor) on the - the STM3210E-EVAL board. The card reports that it is a SDV1.x card - with a 1Kb block size, but the CMD16 to set the block length to - 1024 fails. - Update: Part of the fix appears to be to ignore the reported block - size and to force the block size to 512. - Status: Open - Priority: Uncertain. I don't this is a bug, I think I just don't understand - how to work with this type of SD card. - o 8051 / MCS51 (arch/8051/) ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/drivers/mmcsd/mmcsd_sdio.c b/drivers/mmcsd/mmcsd_sdio.c index e4994000ac..779cfb32e6 100644 --- a/drivers/mmcsd/mmcsd_sdio.c +++ b/drivers/mmcsd/mmcsd_sdio.c @@ -626,23 +626,26 @@ static void mmcsd_decodeCSD(FAR struct mmcsd_state_s *priv, uint32_t csd[4]) */ uint16_t csize = ((csd[1] & 0x03ff) << 2) | ((csd[2] >> 30) & 3); - uint8_t csizemult = (csd[2] >> 15) & 7; + uint8_t csizemult = (csd[2] >> 15) & 7; priv->nblocks = ((uint32_t)csize + 1) * (1 << (csizemult + 2)); - priv->capacity = (priv->nblocks << readbllen); - - /* Force the block size to 512 bytes in any event. Some devices, such - * as 2Gb report blocksizes larger than 512 bytes but still expect to be - * accessed with a 512 byte blocksize. - */ - -#if 0 priv->blockshift = readbllen; priv->blocksize = (1 << readbllen); -#else - priv->blockshift = 9; - priv->blocksize = (1 << 9); -#endif + priv->capacity = (priv->nblocks << readbllen); + + /* Some devices, such as 2Gb devices, report blocksizes larger than 512 bytes + * but still expect to be accessed with a 512 byte blocksize. + * + * NOTE: A minor optimization would be to eliminated priv->blocksize and + * priv->blockshift: Those values will be 512 and 9 in all cases anyway. + */ + + if (priv->blocksize > 512) + { + priv->nblocks <<= (priv->blockshift - 9); + priv->blocksize = 512; + priv->blockshift = 9; + } #if defined(CONFIG_DEBUG) && defined (CONFIG_DEBUG_VERBOSE) && defined(CONFIG_DEBUG_FS) if (IS_SD(priv->type))