#ifdefined(CONFIG_ARCH_S3C2410)
//先清除BWSCON上的DW4为0
//然后设置带宽为16位
//启用BANK4的WAIT状态
//启用BANK4的SRAM的写高低字节使能
*((volatileunsignedint*)S3C2410_BWSCON)=
(oldval_bwscon&~(3<16))|S3C2410_BWSCON_DW4_16|S3C2410_BWSCON_WS4|S3C2410_BWSCON_ST4;
//设置PMC - Page mode configuration - 1 data
// Tacp - Page mode access cycle @ Page mode - 6 clocks
// Tcah - Address hold time after nGCSn - 4 clocks
// Tcoh - Chip selection hold time after nOE - 1 clock
// Tacc - Access cycle - 14 clocks
// Tcos - Chip selection set-up time before nOE - 4 clocks
// Tacs - Address set-up time before nGCSn - 0 clock
*((volatileunsignedint*)S3C2410_BANKCON4)=0x1f7c;
#endif
#ifdefined(CONFIG_ARCH_S3C2410)
printk("Now use the default MAC address: 08:90:90:90:90:90\n");
mac_src="friendly-arm";
ndev->dev_addr[0]=0x08;
ndev->dev_addr[1]=0x90;
ndev->dev_addr[2]=0x90;
ndev->dev_addr[3]=0x90;
ndev->dev_addr[4]=0x90;
ndev->dev_addr[5]=0x90;
#else
#ifdefined(CONFIG_ARCH_S3C2410)
*(volatileunsignedint*)S3C2410_BWSCON=oldval_bwscon;
*(volatileunsignedint*)S3C2410_BANKCON4=oldval_bankcon4;
#endif
|
主要就是执行3个功能
修改BWSCON寄存器
修改BANKCON4寄存器
修改MAC信息
以前看别人移植UBoot给MINI2440,Fclk,Hclk,Pclk的分频比1:4:8
呢么MINI2440上的Hclk就是100MHz,也就是1个时钟10ns,刚好比上面分析的大2倍,
呢么我们就可以将时钟数/2
Tacs = 1个clock = 01
Tcos = 2个clock = 10
Tacc = 3个clock = 010
Tcoh = 2个clock = 10
Tcah = 1个clock = 01
Tacp = 3个clock = 01
PMC = normal(1data) = 00
也就是0x3294
这里要注意的是使用WAIT信号的时候Tacc要大于等于4个clock
所以将
*((volatile unsigned int *)S3C2410_BWSCON) =
(oldval_bwscon & ~(3<16)) | S3C2410_BWSCON_DW4_16 | S3C2410_BWSCON_WS4 | S3C2410_BWSCON_ST4;
*((volatile unsigned int *)S3C2410_BANKCON4) = 0x1f7c;
改为
*((volatile unsigned int *)S3C2410_BWSCON) =
(oldval_bwscon & ~(3<16 | S3C2410_BWSCON_WS4 | S3C2410_BWSCON_ST4 )) | S3C2410_BWSCON_DW4_16;
*((volatile unsigned int *)S3C2410_BANKCON4) = 0x3294;
大家喜欢的还可以把
#if defined(CONFIG_ARCH_S3C2410)
printk("Now use the default MAC address: 08:90:90:90:90:90\n");
改为
#if defined(CONFIG_ARCH_NO2410)
printk("Now use the default MAC address: 08:90:90:90:90:90\n");
这样就会通过读取DM9000来得到MAC地址,我经过试验,得出的MAC地址为ff:ff:ff:ff:ff:ff
不知道会对TCP/IP协议栈有什么影响
这是使用
*((volatile unsigned int *)S3C2410_BWSCON) =
(oldval_bwscon & ~(3<16)) | S3C2410_BWSCON_DW4_16 | S3C2410_BWSCON_WS4 | S3C2410_BWSCON_ST4;
*((volatile unsigned int *)S3C2410_BANKCON4) = 0x1f7c;
时候的延迟
响应时间在0.747左右
这是使用
*((volatile unsigned int *)S3C2410_BWSCON) =
(oldval_bwscon & ~(3<16 | S3C2410_BWSCON_WS4 | S3C2410_BWSCON_ST4 )) | S3C2410_BWSCON_DW4_16;
*((volatile unsigned int *)S3C2410_BANKCON4) = 0x3294;
时候的延迟
可见响应时间有所改善~ 不过我没有示波仪,所以不知道这样的设置会不会对DM9000造成不良影响~
所以大家的DM9000挂掉的话不要来找我哈~ 哈哈哈(逃~
由于对时序分析也是初次尝试~ 所以有写得不对的地方请大家一定要指出,万分感谢 = 3=)/