tq210板载的网络芯片是dm9000,uboot里面正好也有dm9000的驱动,直接调用即可,下面详细道来。
更改u-boot-2014.04\board\samsung\smdkv210\smdkv210.c
把static void smc9115_pre_init(void)函数直接更换成
static void dm9000_pre_init(void)
{
u32 smc_bw_conf, smc_bc_conf;
/* Ethernet needs bus width of 16 bits */
smc_bw_conf = SMC_DATA16_WIDTH(CONFIG_ENV_SROM_BANK)
| SMC_BYTE_ADDR_MODE(CONFIG_ENV_SROM_BANK);
smc_bc_conf = SMC_BC_TACS(0) | SMC_BC_TCOS(1) | SMC_BC_TACC(2)
| SMC_BC_TCOH(1) | SMC_BC_TAH(0) | SMC_BC_TACP(0) | SMC_BC_PMC(0);
/* Select and configure the SROMC bank */
s5p_config_sromc(CONFIG_ENV_SROM_BANK, smc_bw_conf, smc_bc_conf);
}
然后更改
int board_init(void)
{
//smc9115_pre_init();
dm9000_pre_init();
gd->bd->bi_arch_number = MACH_TYPE_SMDKC100;
gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
return 0;
}
再更改
int board_eth_init(bd_t *bis)
{
int rc = 0;
#ifdef CONFIG_SMC911X
rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
#elif defined(CONFIG_DRIVER_DM9000)
rc = dm9000_initialize(bis);
#endif
return rc;
}
随后更改\u-boot-2014.04\include\configs\smdkv210.h
#if 0
#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 */
#endif
#define CONFIG_ENV_SROM_BANK 1 /* Select SROM Bank-3 for Ethernet*/
/* add by yin */
#define CONFIG_DRIVER_DM9000
#define CONFIG_DM9000_NO_SROM
#define CONFIG_DM9000_BASE 0x88000000
#define DM9000_IO (CONFIG_DM9000_BASE)
#define DM9000_DATA (CONFIG_DM9000_BASE + 0x4)
#define CONFIG_CMD_PING
#define CONFIG_IPADDR 192.168.1.120
#define CONFIG_SERVERIP 192.168.1.101
#define CONFIG_ETHADDR 1A:2A:3A:4A:5A:6A
上面的ip地址自己可以随意更改,不限制
编译,烧录
看底部有个ping 192.168.1.101
实现现了ping命令,说明连接上了pc机
上图是pc机的网络设置
此内容由EEWORLD论坛网友star_66666原创,如需转载或用于商业用途需征得作者同意并注明出处