We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Showing results for 
Search instead for 
Did you mean: 
Registered: ‎11-18-2016

LWIP - Two Emac(ethernet) configuration Problem


I have designed my custom board with two MARVELL Ethernet PHY ports ,ZYNQ-7z020 shown in below diagram.TWO Phys are connected individual Emacs in Zynq-7z020. But Both are connected to Single MDIO bus.

the following points are observations.

1.If i configure single Ethernet MAC through MDIO bus  was working fine(individually tested by enabling/disabling Hardware EMAC).

2.Configuring TWO Ethernets on single MDIO bus creating problem.

3. Two no s of PHY are configuring for Second EMAC Only

(it was observed at Auto Negotiation )

Please give the solution / guidance for Two EMAC ethernet configuration for Transmitt and receive on Both the PHY ports .


Thanks in advance

Kasarla Ganesh.  

0 Kudos
5 Replies
Xilinx Employee
Xilinx Employee
Registered: ‎10-30-2017

Re: LWIP - Two Emac(ethernet) configuration Problem

Hi @ganeshpatel,


Please check this post:



for linux:



Best Regards,
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.

0 Kudos
Registered: ‎11-18-2016

Re: LWIP - Two Emac(ethernet) configuration Problem

sorry sir, i am not using AXI ethernet port, Both ethernet MACs are from Processor side. i.e EMAC0 and EMAC1.. Please guide us to working out two EMAC port LWIP.


EMAC0(Zynq)---->Marvell Phy_0--------> RJ45

EMAC1(Zynq)---->Marvell Phy_1--------> RJ45( * we are two individual Phys)


Thanks & Regards

Kasarla Ganesh Patel

0 Kudos
Xilinx Employee
Xilinx Employee
Registered: ‎10-30-2017

Re: LWIP - Two Emac(ethernet) configuration Problem

Hi @ganeshpatel,


I know the link applicable for Ethernet lite  but why I provided is for reference purpose. In the given forum post he described how he was able to work with the 2 emacs in LWIP. you can also do the same thing irrespective of Ethernet lite or PS emac.


Best Regrads,


0 Kudos
Registered: ‎11-18-2016

Re: LWIP - Two Emac(ethernet) configuration Problem

We have searched different  answer requests and Example applications. but we have not identified any proper solutions for "Baremetal (stand alone OS) for TWO EMAC configurations ".

Please suggest  for Two Emac Configuration with individual operations...!





unsigned char mac_ethernet_address[] ={ 0x00, 0x0a, 0x35, 0x00, 0x01, 0x02 };

unsigned char mac_ethernet_address1[] ={ 0x00, 0x0a, 0x35, 0x00, 0x01, 0x03 };


IP4_ADDR(&ipaddr, 192, 168, 1, 10);
IP4_ADDR(&netmask, 255, 255, 255, 0);
IP4_ADDR(&gw, 192, 168, 1, 1);

IP4_ADDR(&ipaddr1, 192, 168, 1, 11);
IP4_ADDR(&netmask1, 255, 255, 255, 0);
IP4_ADDR(&gw1, 192, 168, 1, 1);





 Ethernet-0 connected  properly with phy_addr 7 and 3 shown in below.

for Ethernet-1 register value getting 0 even after given differentiated emac base address.









///////main.c/////////////added two aemac_add fucntions for two ethernet access////

if (!xemac_add(echo_netif, &ipaddr, &netmask,
&gw, mac_ethernet_address,
xil_printf("Error adding N/W interface\n\r");
return -1;

if (!xemac_add1(echo_netif1, &ipaddr1, &netmask1,
&gw1, mac_ethernet_address1,
xil_printf("Error adding N/W interface\n\r");
return -1;






////////****************************** terminal output********************/////////////////////////

-----lwIP TCP echo server ------

TCP packets sent to port 6001 will be echoed back

xtopology[i].emac_type 3

netif->state E000B000

xemac->state 200AC0
xemac->topology_index 0
xemac->type 3
detect_phyreg0 phy address 32: 0
reg0 phy address 31: FFFF
reg0 phy address 30: FFFF
reg0 phy address 29: FFFF
reg0 phy address 28: FFFF
reg0 phy address 27: FFFF
reg0 phy address 26: FFFF
reg0 phy address 25: FFFF
reg0 phy address 24: FFFF
reg0 phy address 23: FFFF
reg0 phy address 22: FFFF
reg0 phy address 21: FFFF
reg0 phy address 20: FFFF
reg0 phy address 19: FFFF
reg0 phy address 18: FFFF
reg0 phy address 17: FFFF
reg0 phy address 16: FFFF
reg0 phy address 15: FFFF
reg0 phy address 14: FFFF
reg0 phy address 13: FFFF
reg0 phy address 12: FFFF
reg0 phy address 11: FFFF
reg0 phy address 10: FFFF
reg0 phy address 9: FFFF
reg0 phy address 8: FFFF
reg0 phy address 7: 796D
reg0 phy address 6: FFFF
reg0 phy address 5: FFFF
reg0 phy address 4: FFFF
reg0 phy address 3: 7949
reg0 phy address 2: FFFF
reg0 phy address 1: FFFF
phy address 7:
Start PHY autonegotiation
Waiting for PHY to complete autonegotiation.
autonegotiation complete
link speed for phy address 7: 10

phy address 3:
Start PHY autonegotiation
Waiting for PHY to complete autonegotiation.
autonegotiation complete
link speed for phy address 3: 10
xtopology[i].emac_type 3

netif1->state E000C000

xemac1->state 200C80
xemac1->topology_index 1
xemac1->type 3
netif1->hwaddr1 20006F
InstancePtr1->Config1.BaseAddress1 = E000C000
xemacpsp1->Config.BaseAddress: E000C000
reg1 phy address 31: 0
reg1 phy address 30: 0
reg1 phy address 29: 0
reg1 phy address 28: 0
reg1 phy address 27: 0
reg1 phy address 26: 0
reg1 phy address 25: 0
reg1 phy address 24: 0
reg1 phy address 23: 0
reg1 phy address 22: 0
reg1 phy address 21: 0
reg1 phy address 20: 0
reg1 phy address 19: 0
reg1 phy address 18: 0
reg1 phy address 17: 0
reg1 phy address 16: 0
reg1 phy address 15: 0
reg1 phy address 14: 0
reg1 phy address 13: 0
reg1 phy address 12: 0
reg1 phy address 11: 0
reg1 phy address 10: 0
reg1 phy address 9: 0
reg1 phy address 8: 0
reg1 phy address 7: 0
reg1 phy address 6: 0
reg1 phy address 5: 0
reg1 phy address 4: 0
reg1 phy address 3: 0
reg1 phy address 2: 0
reg1 phy address 1: 0
xemacpsp1->Config.BaseAddress E000C000
phy address 0:
Start PHY autonegotiation
Waiting for SECOND PHY to complete autonegotiation.
Auto negotiation error
Phy setup error
Assert due to phy setup failure


0 Kudos
Visitor bytownbrooks
Registered: ‎06-21-2018

Re: LWIP - Two Emac(ethernet) configuration Problem

Did you ever solve this problem?  I am having what looks like the same issue on a custom board with 2 PHYs sharing an MDIO bus.