SD on MX31 ADS
Secure Digital Host Controller
The Secure Digital Host Controller (SDHC) 模块支持MMC,SD和Secure Digital I/O and Combo Cards (SDIO)三种。MX31一共有2个SDHC硬件模块。一个host controller 只支持连接上的一个卡。
SDHC.DLL由以下源代码组成 『―――― 微软代码 c:/macallan/private/winceos/coreos/ceosutil/utiltree.cxx c:/macallan/public/common/sdk/inc/svsutil.hxx c:/macallan/private/winceos/coreos/ceosutil/utilmemf.cxx c:/macallan/public/common/sdk/inc/svsutil.hxx c:/macallan/private/winceos/coreos/ceosutil/utilmem.cxx c:/macallan/private/winceos/coreos/ceosutil/svsutil.cxx c:/macallan/public/common/oak/drivers/sdcard/sdcardlib/sdcardapistubs.cpp c:/macallan/public/common/oak/drivers/sdcard/sdcardlib/sddebug.cpp c:/macallan/public/common/oak/drivers/sdcard/sdcardlib/sdmemapi.cpp c:/macallan/public/common/oak/inc/block_allocator.hxx c:/macallan/public/common/oak/drivers/sdcard/sdhclib/sdhclib.cpp ―――――』 d:/wince500/platform/mx31/src/drivers/sdhc/bspsdhc.c d:/wince500/public/common/oak/csp/arm/freescale/mxarm11/drivers/sdhc/main.cpp d:/wince500/public/common/oak/csp/arm/freescale/mxarm11/drivers/sdhc/sdcontrol.cpp d:/wince500/public/common/sdk/inc/kfuncs.h |
SDHC的注册表设置
#if (defined BSP_SDHC1 || defined BSP_SDHC2) [HKEY_LOCAL_MACHINE/Drivers/SDCARD/ClientDrivers/Class/SDMemory_Class] "BlockTransferSize"=dword:100 ; Overwrite from default 64 blocks. ; "SingleBlockWrites"=dword:1 ; alternatively force the driver to use single block access [HKEY_LOCAL_MACHINE/Drivers/SDCARD/ClientDrivers/Class/MMC_Class] "BlockTransferSize"=dword:100 ; Overwrite from default 64 blocks. ; "SingleBlockWrites"=dword:1 ; alternatively force the driver to use single block access [HKEY_LOCAL_MACHINE/System/StorageManager/Profiles/MMC] "Name"="MMC Card" "Folder"="MMC" [HKEY_LOCAL_MACHINE/System/StorageManager/Profiles/SDMemory] "Name"="SD Memory Card" "Folder"="SD Memory" #endif IF BSP_SDHC1 [HKEY_LOCAL_MACHINE/Drivers/BuiltIn/SDHC_ARM11_1] "Order"=dword:21 "Dll"="sdhc.dll" "Prefix"="SDH" "ControllerISTPriority"=dword:64 "Index"=dword:1 ENDIF ;BSP_SDHC1 IF BSP_SDHC2 [HKEY_LOCAL_MACHINE/Drivers/BuiltIn/SDHC_ARM11_2] "Order"=dword:21 "Dll"="sdhc.dll" "Prefix"="SDH" "ControllerISTPriority"=dword:64 "Index"=dword:2 ENDIF ;BSP_SDHC |
SDHC和DMA
SDHC驱动支持DMA 和非DMA 2种数据传输模式,默认是DMA。For every request submitted to it, the driver attempts to build a DMA Scatter Gather Buffer Descriptor list for the buffer passed to it by the upper layer. For cases where this list cannot be built, the driver falls back to the non-DMA mode of transfer. The default configuration is maintained in the file bsp_cfg.h using the parameters BSP_SDMA_SUPPORT_SDHC1 and BSP_SDMA_SUPPORT_SDHC2. A value of TRUE means DMA is the default mode, and for cases where DMA cannot be used, the driver falls back to a non-DMA mode. A value of FALSE means non-DMA mode is the default and DMA mode will not be attempted. For the driver to attempt to build the Scatter Gather DMA Buffer Descriptors, the upper layer should ensure that the buffer meets the following criteria. • Start of the buffer should be a word aligned address. • Number of bytes to transfer should be word aligned. Due to cache coherency issues arising due to processor and SDMA access of the memory, the above criteria is further stringent for the read or receive operation (it is not applicable for write or transmit): • Start of the buffer should be a cache line size (32 bytes) aligned address. • Number of bytes to transfer should be cache line size (32 bytes) aligned. |