修正Ok6410的uboot网络不可用

本文详细介绍了如何解决飞凌6410开发板uboot中网络功能不可用的问题,通过将cs8900驱动更改为dm9000驱动,使得网络功能得以正常工作。包括修改配置文件、读取MAC地址、修改寄存器等步骤。

通过使用uboot的网络功能可以更新ubook,烧写内核,文件系统,如果网络功能不可能,那还不如同变砖了一样.当然如果支持sd卡启动,可能通过sd卡完成这些功能,但是也太过麻烦了.飞凌的6410开发板提供的uboot的网络驱动是cs8900,但是实际上网卡是dm9000ae.

烧入后发无法ping通,tftp不可用,输出:

CS8900 Ethernet chip not found?!
下面,提供简单的修改方法,把驱动改为dm9000,让网络功能用起来.

1.修改include/configs/smdk6410.h

#ifdef 	CONFIG_DRIVER_SMC911X	
#undef	CONFIG_DRIVER_CS8900	
#define CONFIG_DRIVER_SMC911X_BASE	0x18800300
#else
//注释掉下面3行
//#define CONFIG_DRIVER_CS8900	0	/* we have a CS8900 on-board */
//#define CS8900_BASE	  	0x18800300
//#define CS8900_BUS16		1 	/* the Linux driver does accesses as shorts */
//增加下面4行
#define CONFIG_DRIVER_DM9000                1
#define CONFIG_DM9000_BASE          0x18000000
#define DM9000_IO                   CONFIG_DM9000_BASE
#define DM9000_DATA                 (CONFIG_DM9000_BASE+4)
#define CONFIG_DM9000_USE_16BIT
//#define CONFIG_DM9000_DEBUG
#endif
2.303行
从环境变量中读取MAC地址
把((u16 *) bd->bi_enetaddr)[i] = read_srom_word(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.修改318行,修改0x00为0xff
修改MAR寄存器(Multicast Address Register)的值,修正第一次收不到数据的错误
for (i = 0, oft = 0x16; i < 8; i++, oft++)
	DM9000_iow(oft,0x00);
	//DM9000_iow(oft, 0xff);
4.413行
注释掉下面2行
修正一直无法收到数据的错误,不要每次调用halt的时候都对PHY进行复位操作,否则会引起无法接受到数据的情况  
void
eth_halt(void)
{
	DM9000_DBG("eth_halt\n");


	/* RESET devie */
	//phy_write(0, 0x8000);	/* PHY RESET */
	//DM9000_iow(DM9000_GPR, 0x01);	/* Power-Down PHY */
	DM9000_iow(DM9000_IMR, 0x80);	/* Disable all interrupt */
	DM9000_iow(DM9000_RCR, 0x00);	/* Disable RX */
}
这里只是根据别人的文章进行实现,的确可行,但是具体为什么这么做还有些问题需要自己去弄明白.
DDR Version 2.12 20190926 In ID:0xFFF 1A1A1A1B 3 DDR3 1A1B1A1B F Bus Width=32 Col=10 Bank=4 Row=15 CS=1 Die Bus-Width=16 Size=512MB mach:11 OUT Boot1 Release Time: Sep 25 2020 14:49:05, version: 2.63 ChipType = 0xa, 2298 mmc2:cmd19,100 SdmmcInit=2 0 BootCapSize=2000 UserCapSize=3728M\C2&\A7\AC\8B\C5,20 SdmmcInit=0 1 StorageInit ok = 203280 SecureMode = 0 Secure read: 4 206204 Secure read: 404 208549 Secure read: 804 210717 Secure read: c04 212821 Secure read: 1004 214987 Secure read: 1404 217238 Secure read: 1804 219558 Secure read: 1c04 221811 SecureInit ret = 0, SecureMode = 0 GPT part: 0, name: uboot, start:0x2000, size:0x1000 GPT part: 1, name: trust, start:0x3000, size:0x1000 GPT part: 2, name: misc, start:0x4000, size:0x800 GPT part: 3, name: boot, start:0x4800, size:0x7800 GPT part: 4, name: recovery, start:0xc000, size:0xb000 GPT part: 5, name: rootfs, start:0x17000, size:0x60000 GPT part: 6, name: oem, start:0x77000, size:0x90000 GPT part: 7, name: userdata, start:0x107000, size:0x640fdf find part:uboot OK. first_lba:0x2000. find part:trust OK. first_lba:0x3000. LOADER Check OK! 0x2000, 310600 TOS Check OK! 0x3000, 332322 Enter Trust OS INF [0x0] TEE-CORE:init_primary_helper:385: Core0 Initializing (1.1.0-449-g24f5da14f #hisping.lin #1 Mon Aug 14 06:20:42 UTC 2023 arm) INF [0x0] TEE-CORE:init_primary_helper:386: Release version: 1.2 INF [0x0] TEE-CORE:init_primary_helper:387: Next entry point address: 0x60000000 INF [0x0] TEE-CORE:init_teecore:83: teecore inits done U-Boot 2017.09-230909-dirty #joss (May 27 2025 - 11:21:23 +0800) Model: Rockchip RK3126 Evaluation board MPIDR: 0x80000f00 Serial: rawDRAM: 2.7 TiB Sysmem: init Sysmem Error: Failed to add sysmem from bi_dram[8] sysmem_dump_all: -------------------------------------------------------------------- memory.rgn[0].addr = 0x00f10024 - 0x01c20024 (size: 0x00d10000) memory.rgn[1].addr = 0x00f10024 - 0x01e20048 (size: 0x00f10024) memory.rgn[2].addr = 0x00f10025 - 0x01c20025 (size: 0x00d10000) memory.rgn[3].addr = 0x00f10025 - 0x01e20049 (size: 0x00f10024) memory.rgn[4].addr = 0x00f10025 - 0x01e2004a (size: 0x00f10025) memory.rgn[5].addr = 0x00f10025 - 0x52e20025 (size: 0x51f10000) memory.total = 0x5666006d (1382 MiB. 384 KiB) -------------------------------------------------------------------- framework malloc_r = 32 MiB framework malloc_f = 224 KiB allocated.total = 0x00000000 (0 MiB. 0 KiB) -------------------------------------------------------------------- LMB.allocated[0].addr = 0x00000000 - 0x00000000 (size: 0x00000000) reserved.core.total = 0x00000000 (0 MiB. 0 KiB) -------------------------------------------------------------------- Sysmem Warn: Maybe malloc size 32 MiB is too large? initcall sequence 6007fb44 failed at call 6005f605 (err=-22) ### ERROR ### Please RESET the board ###
最新发布
11-22
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值