【stareware】C6748 基于LWIP 使用PHY新品 DP83848代替 lan8710 需要做哪些修改?
除了:// PHY地址
int main(void)
{
unsigned char macArray[6] = MAC_ADDRESS;
unsigned int ipAddr;
/* Set up the UART peripheral for Standard Input/Output operation.*/
UARTStdioInit();
/* Set up the pin multiplex for EMAC and MDIO and enable PSC */
EMACPinMuxSetup();
PSCModuleControl(SOC_PSC_1_REGS, HW_PSC_EMAC, PSC_POWERDOMAIN_ALWAYS_ON,
PSC_MDCTL_NEXT_ENABLE);
EMACIntrSetUp();
/* Initialze the lwIP library, using DHCP.*/
#if STATIC_IP_ADDRESS
ipAddr = lwIPInit(0, macArray, STATIC_IP_ADDRESS, 0, 0, IPADDR_USE_STATIC);
#else
ipAddr = lwIPInit(0, macArray, 0, 0, 0, IPADDR_USE_DHCP);
#endif
IpAddrDisplay(ipAddr);
LocatorConfig(macArray, "evmAM1808 enet_lwip");
/* Initialize the sample httpd server. */
httpd_init();
/* Loop forever. All the work is done in interrupt handlers. */
while(1)
{
; /* Perform nothing */
}
}
unsigned int lwIPInit(unsigned int instNum, unsigned char *macArray,
unsigned int ipAddr, unsigned int netMask, unsigned int gwAddr, unsigned int ipMode)
中的
if(NULL ==
netif_add(&sitaraNetIF[instNum], &ip_addr, &net_mask, &gw_addr, &instNum, sitaraif_init, ip_input))
{
return 0;
}
中的
err_t
sitaraif_init(struct netif *netif)
{
return (sitaraif_hw_init(netif))
}
中的
EMACInit(sitaraif->emac_ctrl_base, sitaraif->emac_base);
MDIOInit(sitaraif->mdio_base, MDIO_FREQ_INPUT, MDIO_FREQ_OUTPUT);
while(delay–);
EMACRxBroadCastEnable(sitaraif->emac_base, 0);
/* Set the MAC Addresses in EMAC hardware */
EMACMACSrcAddrSet(sitaraif->emac_base, sitaraif->mac_addr);
for(channel = 0; channel < 8; channel++) {
EMACMACAddrSet(sitaraif->emac_base, channel, sitaraif->mac_addr, EMAC_MACADDR_MATCH);
}
if(!((MDIOPhyAliveStatusGet(sitaraif->mdio_base) >> sitaraif->phy_addr) & 0x01 )) // PHY地址
{
return ERR_CONN;
}
if(!Lan8710aLinkStatusGet(sitaraif->mdio_base, sitaraif->phy_addr, 10000)) // PHY地址
{
return ERR_CONN;
}
if(sitaraif_link_setup(sitaraif) != ERR_OK) {
return ERR_CONN;
}
Shine:
抱歉,没看到过专门的移植文档,建议去e2e咨询一下有没有移植例程。
e2e.ti.com/…/791