在uboot中已經支持了DM9000
驅動代碼在drivers/net/目錄下的
dm9000x.c? dm9000x.h
?
修改include/configs/smdkc100.h 文件,注釋掉SMC911X的支持,添加對DM9000的支持
//#define CONFIG_SMC911X???????? 1?????? /* we have a SMC9115 on-board?? */
//#define CONFIG_SMC911X_16_BIT? 1?????? /* SMC911X_16_BIT Mode????????? */
//#define CONFIG_SMC911X_BASE??? 0x98800300????? /* SMC911X Drive Base?? */
在下面添加DM9000的支持
#define CONFIG_CMD_PING???????????????? 1
#define CONFIG_DRIVER_DM9000?? 1??????????????????? /*add by yangshuo*/
#define CONFIG_DM9000_BASE 0x88000300?? //comment by yangshuo
#define DM9000_IO CONFIG_DM9000_BASE
#define DM9000_DATA (CONFIG_DM9000_BASE + 4)
#define CONFIG_DM9000_USE_16BIT
#define CONFIG_DM9000_NO_SROM?? 1
#define CONFIG_ETHADDR? 11:22:33:44:55:66
#define CONFIG_IPADDR?? 192.168.1.200
#define CONFIG_SERVERIP 192.168.1.100
#define CONFIG_GATEWAYIP? 192.168.1.1
#define CONFIG_NETMASK? 255.255.255.0
?
修改board/samsung/smdkc100/smdkc100.c 文件,添加DM9000的初始化
在board_eth_init(bd_t *bis) 函數中添加
#ifdef CONFIG_DRIVER_DM9000
???????? rc = dm9000_initialize(bis);
#endif
在當前文件board_init(void) 函數中注釋掉
smc9115_pre_init();
?
修改arch/arm/lib/board.c 文件
在
eth_initialize(gd->bd);
后面添加
eth_init(gd->bd);
?
修改include/net.h 文件
static inline int is_multicast_ether_addr(const u8 *addr)
{
??????? return (0x01 == addr[0]);
}
不然啟動打印
dm9000 i/o: 0x88000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 00:00:00:00:00:00
?
修改net/eth.c 文件中eth_halt(void) 函數,屏蔽掉一下兩句,不然一使用DM9000就斷掉網絡連接
//????? eth_current->halt(eth_current);
//????? eth_current->state = ETH_STATE_PASSIVE;
?
編譯下載到DDR運行,打印效果
U-Boot 2011.12 (Sep 26 2012 - 19:54:25) for SMDKC100
CPU:??? S5PC100@666MHz
Board:? SMDKC100
DRAM:? 256 MiB
WARNING: Caches not enabled
Using default environment
In:??? serial
Out:?? serial
Err:?? serial
Net:?? dm9000
dm9000 i/o: 0x88000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 11:22:33:44:55:66
operating at 100M full duplex mode
?
設置一下ipaddr , 不然ping、tftp都無法使用,打印出
SMDKC100 # ping 192.168.4.120
dm9000 i/o: 0x88000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 11:22:33:44:55:66
operating at 100M full duplex mode
Using dm9000 device
ping failed; host 192.168.4.120 is not alive
?
//上面是我根據網上資料改的,可是當我改完后編譯的時候又出現下面的問題include/configs/smdkv210.h:error:"+" may not appear in macro parameter list
?
?