u-boot 2013.04-rc1移植(7)
来源:互联网 发布:横河otdr aq7275软件 编辑:程序博客网 时间:2024/06/15 04:33
DM9000网卡移植
u-boot默认的网卡是CS8900,而DM9000拥有高性价比,在嵌入式领域广泛被采用。uboot对DM9000支持的已经很完善,稍作修改,就可以使用。
1、修改:/home/eric/Documents/u-boot-2013.04-rc1/include/configs/smdk6410.h,屏蔽CS8900相关定义,增加DM9000支持
/* * Hardware drivers */#if 0 //eric++ 2017-11-12#define CONFIG_CS8900 /* we have a CS8900 on-board */#define CONFIG_CS8900_BASE 0x18800300#define CONFIG_CS8900_BUS16 /* follow the Linux driver */#endif#define CONFIG_DM9000 /* we have a DM9000 on-board */#define CONFIG_DM9000_BASE 0x18800300#define CONFIG_DM9000_USE_16BIT /* follow the Linux driver */#define CONFIG_DM9000_NO_SROM 1#define CONFIG_DRIVER_DM9000 1#define DM9000_IO CONFIG_DM9000_BASE#define DM9000_DATA (CONFIG_DM9000_BASE+4)#define CONFIG_ETHADDR 00.20.40.80.0a.0b#define CONFIG_NET_MASK 255.255.255.0#define CONFIG_IPADDR 192.168.1.2#define CONFIG_SERVERIP 192.168.1.136#define CONFIG_GATEWAYIP 192.168.1.1
注意:其中服务器IP要为电脑的IP,因为稍后会用电脑模拟服务器,而本机IP要和服务器IP位于同一网段。这样才可以在局域网内进行通讯。
2、修改:/home/eric/Documents/u-boot-2013.04-rc1/board/samsung/smdk6410/smdk6410.c
int board_eth_init(bd_t *bis){ int rc = 0;#ifdef CONFIG_CS8900 rc = cs8900_initialize(0, CONFIG_CS8900_BASE);#endif#ifdef CONFIG_DM9000 //eric++ 2017-11-12 rc = dm9000_initialize( bis );#endif return rc;}
3、编译启动!
U-Boot 2013.04-rc1 (Nov 12 2017 - 13:45:23) for SMDK6410
CPU: S3C6410@533MHz Fclk = 533MHz, Hclk = 133MHz, Pclk = 66MHz (ASYNC Mode) Board: SMDK6410DRAM: 128 MiBWARNING: Caches not enabledFlash: *** failed ***NAND: 256 MiBMMC: Samsung Host Controller: 0,3.6 GiB*** Warning - bad CRC, using default environmentIn: serialOut: serialErr: serialNet: dm9000Hit any key to stop autoboot: 0 NAND read: device 0 offset 0x60000, size 0x1c0000 1835008 bytes read: OKWrong Image Format for bootm commandERROR: can't get kernel image!
网卡已成功切换成DM9000
4、设备接上网线,连接路由,保证和电脑在同一局域网内,用ping命令测试,是否连通:
SMDK6410 # ping 192.168.1.136dm9000 i/o: 0x18800300, id: 0x90000a46 DM9000: running in 16 bit modeMAC: 00:40:5c:26:0a:5boperating at 100M full duplex modeUsing dm9000 devicehost 192.168.1.136 is aliveSMDK6410 #
如果网络配置不对,或者网络没有连接好,则会ping failed;
SMDK6410 # ping 192.168.1.136dm9000 i/o: 0x18800300, id: 0x90000a46 DM9000: running in 16 bit modeMAC: 00:40:5c:26:0a:5bcould not establish linkUsing dm9000 deviceping failed; host 192.168.1.136 is not aliveSMDK6410 #
6、利用tftp进行下载u-boot到nand flash中,Linux配置tftp服务器,或者window开启tftp32;
原理:从tftp服务器下载u-boot-nand.bin到RAM中,再烧写nand flash。
开启windows中tftp32,模拟一个tftp服务器,Current Directory中放入u-boot-nand.bin文件。
执行如下命令:
SMDK6410 # tftp 50008000 u-boot-nand.bindm9000 i/o: 0x18800300, id: 0x90000a46DM9000: running in 16 bit modeMAC: 00:40:5c:26:0a:5boperating at 100M full duplex modeUsing dm9000 deviceTFTP from server 192.168.1.136; our IP address is 192.168.1.2Filename 'u-boot-nand.bin'.Load address: 0x50008000Loading: #################### 444.3 KiB/sdoneBytes transferred = 280712 (44888 hex)SMDK6410 #SMDK6410 # nand erase.chipNAND erase.chip: device 0 whole chipSkipping bad block at 0x02960000Skipping bad block at 0x06860000Skipping bad block at 0x07220000Skipping bad block at 0x08d00000Skipping bad block at 0x0df60000Skipping bad block at 0x0fc40000Erasing at 0xffe0000 -- 100% complete.OKSMDK6410 # nand write.uboot 50008000 0 0NAND write: device 0 offset 0x0, size 0x0 516096 bytes written: OKSMDK6410 #
经过以上三个命令顺利将服务器中的u-boot-nand.bin烧录至nand flash中。和用SD卡进行烧写nand相比,方便很多!
- u-boot 2013.04-rc1移植(7)
- u-boot 2013.04-rc1移植(1)
- u-boot 2013.04-rc1移植(2)
- u-boot 2013.04-rc1移植(3)
- u-boot 2013.04-rc1移植(4)
- u-boot 2013.04-rc1移植(5)
- u-boot 2013.04-rc1移植(6)
- 移植u-boot-2011.09-rc1到FL2440(1)
- 移植u-boot-2011.09-rc1到FL2440(2)
- 移植u-boot-2011.09-rc1到FL2440(3)
- U-boot 201103rc1在s3c2440上的移植
- bootloader---24.u-boot-2010.06-rc1移植之4saveenv
- bootloader---23.u-boot-2010.06-rc1移植之3nand flash移植
- bootloader---21.u-boot-2010.06-rc1移植之调试的思路
- bootloader---22.u-boot-2010.06-rc1移植之2搭建框架
- bootloader---25.u-boot-2010.06-rc1移植之5usb下载
- U-boot分析与移植(5)----U-boot移植
- U-boot分析与移植(5)----U-boot移植
- scrapy
- 算法期中1003. 最近的0
- PAT 1056. Mice and Rice (25)
- 500 :java.lang.ClassCastException: org.apache.catalina.util.DefaultAnnotationProcessor cannot be cas
- sys.argv[]用法
- u-boot 2013.04-rc1移植(7)
- opencv canny 算子
- Bitnami Redmine数据库连接
- Matlab2013a许可证过期问题,反复提示激活
- Ubuntu 16.04 Tensorflow 使用源码安装
- 关联规则
- redis异常: MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on
- python中的try/except/else/finally语句
- C语言基础与提高( 数组、函数 )