smdk2450开发板硬件支持cs8900但是BSP只有bootload支持网络,驱动中不支持.为了支持网络只有移植上去.
下面是一个移植步骤(第一次移,不对处还请高手指正).
我使用的系统是wince 5.0,下面都是基于5.0系统.
1.在driver目录中添加入cs8900驱动代码,我的CS8900驱动代码是重2440BSP中拷过来,网上也有好多地方下载.
修改driver目录下的dirs文件,加入cs8900驱动.如下:
DIRS=ceddk \
IROMBOOT \
DISPLAY \
touch \
wavedev \
cs8900eboot \
iic \
camera \
PowerButton \
Usb \
Keybd \
Serial \
HSMMC \
CF_ATAPI \
SDBUS \
SDMEMORY \
POST \
hspi \
NLED \
DummyIST \
GPS \
CS8900\
2.修改cs8900.c驱动代码.
// nGCS1=nUB/nLB(nSBHE),nWAIT,16-bit 片选设置
v_pSSMCRegs->SMBIDCYR1=(v_pSSMCRegs->SMBIDCYR1&~(0xf<<0))|(0x0<<0);
v_pSSMCRegs->SMBWSTWRR1=(v_pSSMCRegs->SMBWSTWRR1&~(0xf<<0))|(0xe<<0);
v_pSSMCRegs->SMBWSTOENR1=(v_pSSMCRegs->SMBWSTOENR1&~(0xf<<0))|(0x2<<0);
v_pSSMCRegs->SMBWSTWENR1=(v_pSSMCRegs->SMBWSTWENR1&~(0xf<<0))|(0x2<<0);
v_pSSMCRegs->SMBWSTRDR1 = ( v_pSSMCRegs->SMBWSTRDR1&~(0xf<<0))|(0xe<<0);
v_pSSMCRegs->SMBWSTWENR1=(v_pSSMCRegs->SMBWSTWENR1&~(0xf<<0))|(0x2<<0);
v_pSSMCRegs->SMBCR1=( v_pSSMCRegs->SMBCR1&~(0xffffffff))|(1<<4)|(1<<0)
rdata = v_pIOPRegs->GPFCON; //中断配置
rdata &= ~(3 << 8);
rdata |= (2 << 8);
v_pIOPRegs->GPFCON = rdata; /* External Interrupt #4 Enable */
#if 1
rdata = v_pIOPRegs->EXTINT0;
rdata &= ~(7 << 16);
rdata |= (4 << 16);
v_pIOPRegs->EXTINT1 = rdata; /* High Level Triggered Mode */
reset ()中也要修改中断初始化.
3.platform.reg
IF BSP_NOCS8900
;IF BSP_KITL != ETHERNET
[HKEY_LOCAL_MACHINE\Drivers\CS8900]
"Dll"="ndis.dll"
"Prefix"="NDS"
"Miniport"="CS8900"
[HKEY_LOCAL_MACHINE\Comm\CS8900]
"DisplayName"="CS8900"
"Group"="NDIS"
"ImagePath"="CS8900.dll"
[HKEY_LOCAL_MACHINE\Comm\CS8900\Linkage]
"Route"=multi_sz:"CS89001"
[HKEY_LOCAL_MACHINE\Comm\CS89001]
"DisplayName"="CS8900"
"Group"="NDIS"
"ImagePath"="CS8900.dll"
[HKEY_LOCAL_MACHINE\Comm\CS89001\Parms]
"BusNumber"=dword:0
"BusType"=dword:0
"InterruptNumber"=dword:33 //在 s3c2450_intr.h 定义为51,要对应.
; "IoBaseAddress"=dword:A7000300
"IoBaseAddress"=dword:80000000 //f地址和bsp_base_reg_cfg.h对应
"Transceiver"=dword:3
"CardType"=dword:1
[HKEY_LOCAL_MACHINE\Comm\CS89001\Parms\TcpIp]
"EnableDHCP"=dword:1
"DefaultGateway"="0.0.0.0"
"LLInterface"=""
"UseZeroBroadcast"=dword:0
"IpAddress"="0.0.0.0"
"Subnetmask"="0.0.0.0"
"DNS"="0.0.0.0"
[HKEY_LOCAL_MACHINE\Comm\Tcpip\Linkage]
"Bind"="CS89001"
;ENDIF
ENDIF ; BSP_NOCS8900
platform.bib中加入
IF BSP_NOCS8900
cs8900.dll $(_FLATRELEASEDIR)\cs8900.dll NK SH
ndis.dll $(_FLATRELEASEDIR)\ndis.dll NK SH
ENDIF BSP_NOCS8900
好了差不多了,编译后应该就可以连接网络了.