topic:关于如何同时使用wince6.0 下S5pv210 的四个SD卡的问题
作者:gooogleman
平台:S5pv210 之Sate210
地址:http://blog.csdn.net/gooogleman/article/details/7623553
Sate210 核心板引出四个SD卡接口,但是目前底板只放了两个SD卡(SD0和SD2)并能在wince6.0 下正常使用,现在有人问我如何同时使用四个SD卡 ,让wince6.0 驱动支持,我现在来分析一下。
看platform.reg 注册表,
有
IF BSP_NOSDMMC_CH0 !
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDMMC_CH0]
"InterfaceType"=dword:0 ; Internal
"Order"=dword:21
"Dll"="sdmmc_ch0.dll"
"Prefix"="HSC"
"ObjectCreationProc"="CreateSDMMCHCCh0Object"
"MemBase"=dword:EB000000
"MemLen"=dword:100
"Irq"=dword:5E ; SDMMC0 Virtual IRQ = 94 (0x5E), Physical IRQ = 58
;"BaseClockFrequency"=dword:B71B000 ; 2AEA540->45MHz(EPLL)
;"TimeoutClockFrequency"=dword:B71B000 ; 2AEA540->45MHz(EPLL)
"BaseClockFrequency"=dword:5B8D800 ; 2AEA540->45MHz(EPLL)
"TimeoutClockFrequency"=dword:5B8D800 ; 2AEA540->45MHz(EPLL)
"IClass"="{A32942B7-920C-486b-B0E6-92A702A99B35}" ; Power-manageable generic
ENDIF BSP_NOSDMMC_CH0 !
IF BSP_NOSDMMC_CH0
IF BSP_NOSDMMC_CH1 !
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDMMC_CH1]
"InterfaceType"=dword:0 ; Internal
"Order"=dword:21
"Dll"="sdmmc_ch1.dll"
"Prefix"="HSC"
"ObjectCreationProc"="CreateSDMMCHCCh1Object"
"MemBase"=dword:EB100000
"MemLen"=dword:100
"Irq"=dword:5F ; SDMMC1 Virtual IRQ = 95 (0x5F), Physical IRQ = 59
;"BaseClockFrequency"=dword:B71B000 ; 2AEA540->45MHz(EPLL)
;"TimeoutClockFrequency"=dword:B71B000 ; 2AEA540->45MHz(EPLL)
"BaseClockFrequency"=dword:5B8D800 ; 2AEA540->45MHz(EPLL)
"TimeoutClockFrequency"=dword:5B8D800 ; 2AEA540->45MHz(EPLL)
"IClass"="{A32942B7-920C-486b-B0E6-92A702A99B35}" ; Power-manageable generic
ENDIF BSP_NOSDMMC_CH1 !
ENDIF BSP_NOSDMMC_CH0
IF BSP_NOSDMMC_CH2 !
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDMMC_CH2]
"InterfaceType"=dword:0 ; Internal
"Order"=dword:21
"Dll"="sdmmc_CH2.dll"
"Prefix"="HSC"
"ObjectCreationProc"="CreateSDMMCHCCh2Object"
"MemBase"=dword:EB200000
"MemLen"=dword:100
"Irq"=dword:60 ; SDMMC0 Virtual IRQ = 94 (0x5E), Physical IRQ = 58
"BaseClockFrequency"=dword:5B8D800 ; 2AEA540->45MHz(EPLL)
"TimeoutClockFrequency"=dword:5B8D800 ; 2AEA540->45MHz(EPLL)
"IClass"="{A32942B7-920C-486b-B0E6-92A702A99B35}" ; Power-manageable generic
ENDIF BSP_NOSDMMC_CH2 !
IF BSP_USE_SDMMC_CH2_8BIT !
IF BSP_NOSDMMC_CH3 !
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDMMC_CH3]
"InterfaceType"=dword:0 ; Internal
"Order"=dword:21
"Dll"="sdmmc_CH3.dll"
"Prefix"="HSC"
"ObjectCreationProc"="CreateSDMMCHCCh3Object"
"MemBase"=dword:EB300000
"MemLen"=dword:100
"Irq"=dword:86 ; SDMMC0 Virtual IRQ = 94 (0x5E), Physical IRQ = 58
"BaseClockFrequency"=dword:5B8D800 ; 2AEA540->45MHz(EPLL)
"TimeoutClockFrequency"=dword:5B8D800 ; 2AEA540->45MHz(EPLL)
"IClass"="{A32942B7-920C-486b-B0E6-92A702A99B35}" ; Power-manageable generic
ENDIF BSP_NOSDMMC_CH3 !
ENDIF BSP_USE_SDMMC_CH2_8BIT !
再看看BSP_NOSDMMC_CH0,BSP_NOSDMMC_CH1,BSP_NOSDMMC_CH2,BSP_NOSDMMC_CH3 的环境变量设置
在sate210.bat 里面有
set BSP_NOSDMMC_BOOT=1
@REM ----- SD/MMC Driver Configuration -------------------------
set BSP_NOSDMMC_CH0=
set BSP_USE_SDMMC_CH0_8BIT=
set BSP_NOSDMMC_CH1=1
set BSP_NOSDMMC_CH2=
set BSP_USE_SDMMC_CH2_8BIT=
set BSP_NOSDMMC_CH3=1
if /i "%BSP_NOSDMMC_BOOT%"=="" set BSP_NOSDMMC_CH0=1
上面配置和注册表的SD配置结合起来,说明 SD0和SD2都是直接可用的,那么要SD1和SD3 也可以用就要这么改——最简单的办法,把注册表的环境变量全部删除,让环境变量不受Sate210.bat 控制。
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDMMC_CH0]
"InterfaceType"=dword:0 ; Internal
"Order"=dword:21
"Dll"="sdmmc_ch0.dll"
"Prefix"="HSC"
"ObjectCreationProc"="CreateSDMMCHCCh0Object"
"MemBase"=dword:EB000000
"MemLen"=dword:100
"Irq"=dword:5E ; SDMMC0 Virtual IRQ = 94 (0x5E), Physical IRQ = 58
;"BaseClockFrequency"=dword:B71B000 ; 2AEA540->45MHz(EPLL)
;"TimeoutClockFrequency"=dword:B71B000 ; 2AEA540->45MHz(EPLL)
"BaseClockFrequency"=dword:5B8D800 ; 2AEA540->45MHz(EPLL)
"TimeoutClockFrequency"=dword:5B8D800 ; 2AEA540->45MHz(EPLL)
"IClass"="{A32942B7-920C-486b-B0E6-92A702A99B35}" ; Power-manageable generic
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDMMC_CH1]
"InterfaceType"=dword:0 ; Internal
"Order"=dword:21
"Dll"="sdmmc_ch1.dll"
"Prefix"="HSC"
"ObjectCreationProc"="CreateSDMMCHCCh1Object"
"MemBase"=dword:EB100000
"MemLen"=dword:100
"Irq"=dword:5F ; SDMMC1 Virtual IRQ = 95 (0x5F), Physical IRQ = 59
;"BaseClockFrequency"=dword:B71B000 ; 2AEA540->45MHz(EPLL)
;"TimeoutClockFrequency"=dword:B71B000 ; 2AEA540->45MHz(EPLL)
"BaseClockFrequency"=dword:5B8D800 ; 2AEA540->45MHz(EPLL)
"TimeoutClockFrequency"=dword:5B8D800 ; 2AEA540->45MHz(EPLL)
"IClass"="{A32942B7-920C-486b-B0E6-92A702A99B35}" ; Power-manageable generic
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDMMC_CH2]
"InterfaceType"=dword:0 ; Internal
"Order"=dword:21
"Dll"="sdmmc_CH2.dll"
"Prefix"="HSC"
"ObjectCreationProc"="CreateSDMMCHCCh2Object"
"MemBase"=dword:EB200000
"MemLen"=dword:100
"Irq"=dword:60 ; SDMMC0 Virtual IRQ = 94 (0x5E), Physical IRQ = 58
"BaseClockFrequency"=dword:5B8D800 ; 2AEA540->45MHz(EPLL)
"TimeoutClockFrequency"=dword:5B8D800 ; 2AEA540->45MHz(EPLL)
"IClass"="{A32942B7-920C-486b-B0E6-92A702A99B35}" ; Power-manageable generic
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDMMC_CH3]
"InterfaceType"=dword:0 ; Internal
"Order"=dword:21
"Dll"="sdmmc_CH3.dll"
"Prefix"="HSC"
"ObjectCreationProc"="CreateSDMMCHCCh3Object"
"MemBase"=dword:EB300000
"MemLen"=dword:100
"Irq"=dword:86 ; SDMMC0 Virtual IRQ = 94 (0x5E), Physical IRQ = 58
"BaseClockFrequency"=dword:5B8D800 ; 2AEA540->45MHz(EPLL)
"TimeoutClockFrequency"=dword:5B8D800 ; 2AEA540->45MHz(EPLL)
"IClass"="{A32942B7-920C-486b-B0E6-92A702A99B35}" ; Power-manageable generic
在看看 platform.bib file
;-------- SMDKV210 SDMMC -----------------------------------------------------------------------
IF BSP_NOSDMMC_CH0 !
sdmmc_ch0.dll $(_FLATRELEASEDIR)\sdmmc_ch0.dll NK SHMK
ENDIF BSP_NOSDMMC_CH0 !
IF BSP_NOSDMMC_CH0
IF BSP_NOSDMMC_CH1 !
sdmmc_ch1.dll $(_FLATRELEASEDIR)\sdmmc_ch1.dll NK SHMK
ENDIF BSP_NOSDMMC_CH1 !
ENDIF BSP_NOSDMMC_CH0
IF BSP_NOSDMMC_CH2 !
sdmmc_ch2.dll $(_FLATRELEASEDIR)\sdmmc_ch2.dll NK SHMK
ENDIF BSP_NOSDMMC_CH2 !
IF BSP_USE_SDMMC_CH2_8BIT !
IF BSP_NOSDMMC_CH3 !
sdmmc_ch3.dll $(_FLATRELEASEDIR)\sdmmc_ch3.dll NK SHMK
ENDIF BSP_NOSDMMC_CH3 !
ENDIF BSP_USE_SDMMC_CH2_8BIT !
这样也把那些环境变量删除,剩余下面即可
sdmmc_ch0.dll $(_FLATRELEASEDIR)\sdmmc_ch0.dll NK SHMK
sdmmc_ch1.dll $(_FLATRELEASEDIR)\sdmmc_ch1.dll NK SHMK
sdmmc_ch2.dll $(_FLATRELEASEDIR)\sdmmc_ch2.dll NK SHMK
sdmmc_ch3.dll $(_FLATRELEASEDIR)\sdmmc_ch3.dll NK SHMK