Hello.
I use unknown EVB based on TMS320C6670.
The EVB has two ethernet Phys(Both SGMII0 and SGMII1 can be connected to network).
So I want to use both ethernet ports.
I used client sample as an NDK sample. However the sample uses only SGMII1.
I tried something to activate two ports in the sample. But I failed.
What should I do more?
Now, I modified somethings,
1. add following line in main() to make sure SGMII0 is connected to phy.
emac_port_mode[0] = PLATFORM_EMAC_PORT_MODE_PHY;
2. modify section for creation of configuration like following.
hCfg = CfgNew();
if( !hCfg )
{
platform_write("Unable to create configuration\n");
goto main_exit;
}
// Add our global hostname to hCfg (to be claimed in all connected domains)
CfgAddEntry( hCfg, CFGTAG_SYSINFO, CFGITEM_DHCP_HOSTNAME, 0,
strlen(HostName), (UINT8 *)HostName, 0 );
{
CI_IPNET NA;
CI_ROUTE RT;
IPN IPTmp;
// Setup manual IP address
bzero( &NA, sizeof(NA) );
NA.IPAddr = inet_addr("192.168.10.10");
NA.IPMask = inet_addr(LocalIPMask);
strcpy( NA.Domain, DomainName );
NA.NetType = 0;
// Add the address to interface
CfgAddEntry( hCfg, CFGTAG_IPNET, 0, 0,
sizeof(CI_IPNET), (UINT8 *)&NA, 0 );
// Setup manual IP address
bzero( &NA, sizeof(NA) );
NA.IPAddr = inet_addr("192.168.10.11");
NA.IPMask = inet_addr(LocalIPMask);
strcpy( NA.Domain, DomainName );
NA.NetType = 0;
// Add the address to interface
CfgAddEntry( hCfg, CFGTAG_IPNET, 1, 0,
sizeof(CI_IPNET), (UINT8 *)&NA, 0 );
}
....
do
{
rc = NC_NetStart( hCfg, NetworkOpen0, NetworkClose0, NetworkIPAddr );
} while( rc > 0 );