u-boot移植(四)添加网络支持
来源:互联网 发布:迅雷赚钱宝软件 编辑:程序博客网 时间:2024/05/16 19:36
1、 添加网卡支持
MINI2440配置的是dm9000网卡,
a) include/configs/mini2440.h
修改1:注释掉原来关于CS8900的配置,添加对DM9000的支持
添加#define CONFIG_NET_MULTI 1
因为dm9000_initialize函数在drivers/net/eth.c中定义,要支持此函数,需要添加宏定义
#define CONFIG_DRIVER_DM9000
#define CONFIG_DM9000_NO_SROM
#define CONFIG_CMD_PING
#define CONFIG_CMD_NET
#define CONFIG_NET_MULTI 1
#define CONFIG_DM9000 /* we have a DM9000 on-board */
#define CONFIG_DM9000_BASE 0x20000300
#define DM9000_IO 0X20000300
#define DM9000_DATA 0X20000304
修改2:设置网络地址
#define CONFIG_ETHADDR 08:00:3e:26:0a:5b
#define CONFIG_NETMASK 255.255.255.0
#define CONFIG_IPADDR 10.0.0.110
#define CONFIG_SERVERIP 10.0.0.101
b) drivers/net/dm9000x.c
修改1:注释掉代码
362 #if 0
363 i = 0;
364 while (!(phy_read(1) & 0x20)) { /* autonegation complete bit */
365 udelay(1000);
366 i++;
367 if (i == 1000000) {
368 printf("could not establish link\n");
369 return 0;
370 }
371 }
372 #endif
修改2:注释掉代码
446 #if 0
447 /* RESET devie */
448 phy_write(0, 0x8000); /* PHY RESET */
449 DM9000_iow(DM9000_GPR, 0x01); /* Power-Down PHY */
450 DM9000_iow(DM9000_IMR, 0x80); /* Disable all interrupt */
451 DM9000_iow(DM9000_RCR, 0x00); /* Disable RX */
452 #endif
c) board/samsung/mini2440.c
修改3:在board/samsung/mini2440/mini2440.c文件末尾添加dm9000的初始化函数:
#ifdef CONFIG_CMD_NET
int board_eth_init(bd_t *bis)
{
int rc = 0;
#ifdef CONFIG_DM9000
rc = dm9000_initialize(bis);
#endif
return rc;
}
修改4:board/samsung/lowlevel_init.S,网卡芯片挂载在bank4,按照网卡芯片的时序图修改如下
#define B4_Tacs 0x0 /* 0clk */
#define B4_Tcos 0x3 /* 0clk */
#define B4_Tacc 0x7 /* 14clk */
#define B4_Tcoh 0x1 /* 0clk */
#define B4_Tah 0x0 /* 0clk */
#define B4_Tacp 0x3
#define B4_PMC 0x0 /* normal */
此时可以ping通网络,但tftp很不稳定,修改tftp延时可解决此问题
修改5:/net/tftp.c文件宏定义修改为
#define TIMEOUT 50000UL /* Millisecs to timeout for lost pkt */
#ifndef CONFIG_NET_RETRY_COUNT
# define TIMEOUT_COUNT 100 /* # of timeouts before giving up */
可以很流畅的下载内核到内存
- u-boot移植(四)添加网络支持
- fl2440的U-boot-2010.09移植(四) 添加NOR Flash启动支持
- u-boot-2014.10移植第22天----添加nand flash命令支持(四)
- U-boot-2009.08移植(四) 支持DM900网卡
- u-boot移植(四)使支持NAND FLASH
- U-boot-2009.08移植(四) 支持DM900网卡
- u-boot移植(五)添加norflash支持
- u-boot移植(六)添加nandflash支持
- u-boot移植4:支持 网络
- U-boot移植(四)
- u-boot移植(四)
- u-boot移植(八)支持yaffs
- TQ2440 u-boot-2012.04.01移植四支持NAND Flash
- u-boot-2013.01.01移植(四)
- U-boot-2009.03移植之四:第一阶段(支持2440)各步骤简要目录
- u-boot-2010.12移植到2440(四,支持nand flash启动)
- 【转】u-boot-2010.12移植到2440(四,支持nand flash启动)
- u-boot-2011.03在mini2440/micro2440上的移植(四)——支持内核启动
- allegro 5教程
- C# 内存管理、优化的方法
- flash 游戏开发工作总结(1)--开发准备:FB的配置
- u-boot移植(三)让u-boot在开发板上跑起来
- AutoJpegTrunk-批量移除jpg文件中的元数据(Metadata)
- u-boot移植(四)添加网络支持
- Logotype Maker-功能强大的免费在线logo设计工具
- WPF 自定义grid spliter的 Style
- u-boot移植(五)添加norflash支持
- static在C语言中得用法(面向过程)
- 基本操作
- NYOJ 401 Coin Game
- Linux常用命令分类,之用户系统级别的命令
- java静态变量与C静态变量的区别