u-boot1.1.6的移植 网卡支持
来源:互联网 发布:大数据 安全 应对 编辑:程序博客网 时间:2024/05/16 06:12
注:蓝色为修改部分!
driver/dm9000x.c中修改:
int
eth_init(bd_t * bd)
{
int i, oft, lnk;
DM9000_DBG("eth_init()/n");
// RESET device */
dm9000_reset();
dm9000_probe();
// NIC Type: FASTETHER, HOMERUN, LONGRUN */
identify_nic();
// GPIO0 on pre-activate PHY */
DM9000_iow(DM9000_GPR, 0x00);
// Set PHY */
set_PHY_mode();
// Program operating register */
DM9000_iow(DM9000_NCR, 0x0); // only intern phy supported by now */
DM9000_iow(DM9000_TCR, 0); // TX Polling clear */
DM9000_iow(DM9000_BPTR, 0x3f); // Less 3Kb, 200us */
DM9000_iow(DM9000_FCTR, FCTR_HWOT(3) | FCTR_LWOT(8)); // Flow Control : High/Low Water */
DM9000_iow(DM9000_FCR, 0x0); // SH FIXME: This looks strange! Flow Control */
DM9000_iow(DM9000_SMCR, 0); // Special Mode */
DM9000_iow(DM9000_NSR, NSR_WAKEST | NSR_TX2END | NSR_TX1END); // clear TX status */
DM9000_iow(DM9000_ISR, 0x0f); // Clear interrupt status */
// Set Node address */
//HJ_start // www.embedsky.net */
char *tmp = getenv("ethaddr");
char *end;
for (i = 0; i < 6; i++)
{
bd->bi_enetaddr[i] = tmp ? simple_strtoul(tmp, &end, 16) : 0;
if(tmp)
tmp = (*end) ? end+1 : end;
}
//HJ_end // www.embedsky.net */
printf("MAC: %02x:%02x:%02x:%02x:%02x:%02x/n", bd->bi_enetaddr[0],
bd->bi_enetaddr[1], bd->bi_enetaddr[2], bd->bi_enetaddr[3],
bd->bi_enetaddr[4], bd->bi_enetaddr[5]);
for (i = 0, oft = 0x10; i < 6; i++, oft++)
DM9000_iow(oft, bd->bi_enetaddr[i]);
for (i = 0, oft = 0x16; i < 8; i++, oft++)
DM9000_iow(oft, 0xff);
// read back mac, just to be sure */
for (i = 0, oft = 0x10; i < 6; i++, oft++)
DM9000_DBG("%02x:", DM9000_ior(oft));
DM9000_DBG("/n");
// Activate DM9000 */
DM9000_iow(DM9000_RCR, RCR_DIS_LONG | RCR_DIS_CRC | RCR_RXEN); // RX enable */
DM9000_iow(DM9000_IMR, IMR_PAR); // Enable TX/RX interrupt mask */
return 0;
}
driver/Makefile里修改:
COBJS = dm9000x.o
include/configs/jzy2440.h
//
* Hardware drivers
*/
#define CONFIG_DRIVER_DM9000 1
#define CONFIG_DM9000_BASE 0x20000300
#define DM9000_IO CONFIG_DM9000_BASE
#define DM9000_DATA (CONFIG_DM9000_BASE + 4)/*BASE+4 ;CMD接ADDR2*/
/*BASE+16;CMD接ADDR4*/
#define CONFIG_DM9000_USE_16BIT
#define CONFIG_BOOTDELAY 1
#define CONFIG_BOOTARGS "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0"
#define CONFIG_ETHADDR 0a:1b:2c:3d:4e:5f
#define CONFIG_NETMASK 255.255.255.0
#define CONFIG_IPADDR 192.168.1.6
#define CONFIG_SERVERIP 192.168.1.8
#define CONFIG_BOOTCOMMAND "nboot 0x32000000 0 0x50000; bootm 0x32000000"
- u-boot1.1.6的移植 网卡支持
- U-Boot1.1.6移植DM9000网卡
- u-boot1.1.6移植
- u-boot1.3.4 dm9000网卡芯片移植
- u-boot1.1.6移植 DM9000
- 2440, u-boot1.1.6移植
- u-boot1.1.5的移植一
- u-boot1.1.5的移植二
- u-boot1.1.6移植之Diff比较
- 移植u-boot1.1.6到TQ2440
- 移植u-boot1.1.6到mini2440文档
- u-boot1.1.6在s3c2440上移植
- u-boot1.1.6在s3c2440上移植
- u-boot1.1.4移植
- 移植u-boot1.1.4支持操作nandFlash的nand erase命令
- U-boot1.3.4移植流程
- U-Boot1.2.0移植YC2440
- U-Boot1.3.1移植YC2440
- Linux编程重要目录与文件
- EAI Siebel Adapter和EAI UI Data Adapter
- 什么是 "asmlinkage"?
- 差距
- rman备份恢复
- u-boot1.1.6的移植 网卡支持
- hoho,自己动手做图片
- 在drupal个人信息页加入用户最新评论
- Spin lock的学习
- ubuntu9.10下使用vsftpd,搭建ftp server!
- 使用Fedora中的添加/删除程序添加安装DVD中的包
- 十款非windows操作系统介绍!
- 好长时间没来了
- JAVA读取Oracle中的blob图片字段并显示