以下代码都在github
https://github.com/SourceLink/S5PV210
一、网卡初始化分析
网卡初始化是在board_init_r中的init_sequence队列中的initr_net函数中:
#ifdef CONFIG_CMD_NET
INIT_FUNC_WATCHDOG_RESET
initr_net,
#endif
initr_net函数中又调用了eth_initialize函数进行初始化
#ifdef CONFIG_CMD_NET
static int initr_net(void)
{
puts("Net: ");
eth_initialize();
#if defined(CONFIG_RESET_PHY_R)
debug("Reset Ethernet PHY\n");
reset_phy();
#endif
return 0;
}
#endif
进行代码跟踪后发现eth_initialize函数在net/eth_legacy.c中定义
/*
* If board-specific initialization exists, call it.
* If not, call a CPU-specific one
*/
if (board_eth_init !=