uboot网络移植成功,tftp能用。
2012-10-18 15:47
369 查看
开发板:OK6410-A uboot版本:uboot1.16
一、修改include/configs/smdk6410.h里配置网卡的相应代码
原来:
//#define CONFIG_DRIVER_SMC911X1 /* we have a SMC9115 on-board */
//#define CONFIG_CH7033
#ifdef CONFIG_DRIVER_SMC911X
#undef CONFIG_DRIVER_CS8900
#define CONFIG_DRIVER_SMC911X_BASE 0x18800300
#else
#define CONFIG_DRIVER_CS89000 /* we have a CS8900 on-board */
#define CS8900_BASE 0x18800300
#define CS8900_BUS16 1 /* the Linux driver does accesses as shorts */
#endif
替换为:
另外按实际修改或添加网络配置信息:
二、修改uboot1.16/board/samsung/smdk6410/smdk6410.c (可选做)
将 SC8900 替换为 DM9000 。
将 sc8900 替换为 dm9000 。
三、修改drivers/dm9000x.c
int eth_init(bd_t * bd)函数:
1)
/* GPIO0 on pre-activate PHY */
DM9000_iow(DM9000_GPR, 0x00); /*REG_1F bit0 activate phyxcer */
//==============添加以下===============//
//==============添加以上=============//
/* Set PHY */
set_PHY_mode();
2)
DM9000_iow(DM9000_ISR, 0x0f); /* Clear interrupt status */
/* Set Node address */
//==============添加以下===============//
//==============添加以上=============//
3)
for (i = 0, oft = 0x16; i < 8; i++, oft++)
//修改MAR寄存器(Multicast Address Register)的值,修正第一次收不到数据的错误
//DM9000_iow(oft, 0xff); //替换
DM9000_iow(oft, 0x00);
void eth_halt(void)函数: (可选做)
注释掉下面两行,修正一直无法收到数据的错误
phy_write(0, 0x8000); /* PHY RESET */
DM9000_iow(DM9000_GPR, 0x01);/* Power-Down PHY */
另附相关文件的下载地址:http://download.csdn.net/detail/wwf0123/4660329
一、修改include/configs/smdk6410.h里配置网卡的相应代码
原来:
//#define CONFIG_DRIVER_SMC911X1 /* we have a SMC9115 on-board */
//#define CONFIG_CH7033
#ifdef CONFIG_DRIVER_SMC911X
#undef CONFIG_DRIVER_CS8900
#define CONFIG_DRIVER_SMC911X_BASE 0x18800300
#else
#define CONFIG_DRIVER_CS89000 /* we have a CS8900 on-board */
#define CS8900_BASE 0x18800300
#define CS8900_BUS16 1 /* the Linux driver does accesses as shorts */
#endif
替换为:
#define CONFIG_DRIVER_DM9000AE1 #ifdef CONFIG_DRIVER_DM9000AE #define CONFIG_DRIVER_DM90001 #define CONFIG_DM9000_BASE(0x18000000) /*XM0CSN1*/ #define DM9000_IO(CONFIG_DM9000_BASE) #define DM9000_DATA(CONFIG_DM9000_BASE+0x4) /*ADDR2*/ #define CONFIG_DM9000_USE_16BIT 1 //#define CONFIG_DM9000_DEBUG 1 #else #ifdef CONFIG_DRIVER_SMC911X #undef CONFIG_DRIVER_CS8900 #define CONFIG_DRIVER_SMC911X_BASE 0x18800300 #else #define CONFIG_DRIVER_CS89000 /* we have a CS8900 on-board */ #define CS8900_BASE0x18800300 #define CS8900_BUS161 /* the Linux driver does accesses as shorts */ #endif //end of #ifdef CONFIG_DRIVER_SMC911X #endif //end of #ifdef CONFIG_DRIVER_DM9000AE
另外按实际修改或添加网络配置信息:
#define CONFIG_ETHADDR00:40:5c:26:0a:5b #define CONFIG_NETMASK255.255.255.0 #define CONFIG_IPADDR192.168.0.110 #define CONFIG_SERVERIP192.168.0.101 #define CONFIG_GATEWAYIP192.168.0.1
二、修改uboot1.16/board/samsung/smdk6410/smdk6410.c (可选做)
将 SC8900 替换为 DM9000 。
将 sc8900 替换为 dm9000 。
三、修改drivers/dm9000x.c
int eth_init(bd_t * bd)函数:
1)
/* GPIO0 on pre-activate PHY */
DM9000_iow(DM9000_GPR, 0x00); /*REG_1F bit0 activate phyxcer */
//==============添加以下===============//
#if CONFIG_DRIVER_DM9000AE udelay(100*1000); /* wait >2 ms (2~60 ms normal) for PHY power-up ready */ /* software-RESET NIC */ DM9000_iow(0x00,0x3); /* NCR REG. 00 RST Bit[0]=1 RESET on, LBK=1 MAC loopback on */ udelay(1000); /* wait >10us for software-RESET ok, then let it auto-clear */ #endif
//==============添加以上=============//
/* Set PHY */
set_PHY_mode();
2)
DM9000_iow(DM9000_ISR, 0x0f); /* Clear interrupt status */
/* Set Node address */
//==============添加以下===============//
if (is_zero_ether_addr(bd->bi_enetaddr) || is_multicast_ether_addr(bd->bi_enetaddr)) { /* try reading from environment */ u8 i; char *s, *e; s = getenv ("ethaddr"); for (i = 0; i < 6; ++i) { bd->bi_enetaddr[i] = s ? simple_strtoul (s, &e, 16) : 0; if (s) s = (*e) ? e + 1 : e; } }
//==============添加以上=============//
3)
for (i = 0, oft = 0x16; i < 8; i++, oft++)
//修改MAR寄存器(Multicast Address Register)的值,修正第一次收不到数据的错误
//DM9000_iow(oft, 0xff); //替换
DM9000_iow(oft, 0x00);
void eth_halt(void)函数: (可选做)
注释掉下面两行,修正一直无法收到数据的错误
phy_write(0, 0x8000); /* PHY RESET */
DM9000_iow(DM9000_GPR, 0x01);/* Power-Down PHY */
另附相关文件的下载地址:http://download.csdn.net/detail/wwf0123/4660329
相关文章推荐
- uboot 1.1.6 移植8900网卡+tftp
- uboot-2009.03成功移植到mini2440
- uboot移植时自己修改也正确,但是却make不成功的问题
- uboot-2009.03成功移植到mini2440
- OK6410调试记录——移植Uboot支持网络
- uboot-2009.03成功移植到mini2440
- uboot移植之网络驱动移植--移植理论知识--7.29
- 海思3716c在uboot时tftp总不成功分析
- uboot-2009.03成功移植到mini2440
- OK6410 uboot2013.04-rc1 DM9000移植及tftp配置使用
- uboot移植之网络驱动移植--移植操作--7.29
- uboot移植之网络驱动移植--网卡驱动如何工作--7.30
- 二..linux开发之uboot移植(二)——网络命令ping开发搭建使用&tftp服务器的安装&nfs网络服务器的安装
- DM3730开发板使用uboot通过网络下载内核和文件系统 ubuntu下配置 TFTP
- 逻辑概念解释:以SD驱动为例去解释成功将驱动移植到Uboot这句话的含义 + Uboot中的驱动和Linux内核中的驱动的区别和联系 + 如何在Uboot中实现某硬件的驱动的逻辑和思路
- Uboot移植_starts(文件级).2.2
- 嵌入式设备 以及手机 最新判断网络是否连接成功的最好方法,你值得知道
- 第一次移植uboot(2)(NAND中环境变量读写)
- 从0移植uboot(三) _编译最小可用uboot
- UBOOT之DDR2内存移植相关修改简记 .