driver: net: fsl-mc: Add support of multiple phys for dpmac

Till now we have had cases where we had one phy device per dpmac.
Now, with the upcoming products (LX2160AQDS), we have cases, where there
are sometimes two phy devices for one dpmac. One phy for TX lanes and
one phy for RX lanes. to handle such cases, add the support for multiple
phys in ethernet driver. The ethernet link is up if all the phy devices
connected to one dpmac report link up. also the link capabilities are
limited by the weakest phy device.

i.e. say if there are two phys for one dpmac. one operates at 10G without
autoneg and other operate at 1G with autoneg. Then the ethernet interface
will operate at 1G without autoneg.

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
diff --git a/board/freescale/ls2080aqds/eth.c b/board/freescale/ls2080aqds/eth.c
index 989d57e..f706fd4 100644
--- a/board/freescale/ls2080aqds/eth.c
+++ b/board/freescale/ls2080aqds/eth.c
@@ -623,7 +623,7 @@
 		switch (++slot) {
 		case 1:
 			/* Slot housing a SGMII riser card? */
-			wriop_set_phy_address(dpmac_id,
+			wriop_set_phy_address(dpmac_id, 0,
 					      riser_phy_addr[dpmac_id - 1]);
 			dpmac_info[dpmac_id].board_mux = EMI1_SLOT1;
 			bus = mii_dev_for_muxval(EMI1_SLOT1);
@@ -631,7 +631,7 @@
 			break;
 		case 2:
 			/* Slot housing a SGMII riser card? */
-			wriop_set_phy_address(dpmac_id,
+			wriop_set_phy_address(dpmac_id, 0,
 					      riser_phy_addr[dpmac_id - 1]);
 			dpmac_info[dpmac_id].board_mux = EMI1_SLOT2;
 			bus = mii_dev_for_muxval(EMI1_SLOT2);
@@ -641,18 +641,18 @@
 			if (slot == EMI_NONE)
 				return;
 			if (serdes1_prtcl == 0x39) {
-				wriop_set_phy_address(dpmac_id,
+				wriop_set_phy_address(dpmac_id, 0,
 					riser_phy_addr[dpmac_id - 2]);
 				if (dpmac_id >= 6 && hwconfig_f("xqsgmii",
 								env_hwconfig))
-					wriop_set_phy_address(dpmac_id,
+					wriop_set_phy_address(dpmac_id, 0,
 						riser_phy_addr[dpmac_id - 3]);
 			} else {
-				wriop_set_phy_address(dpmac_id,
+				wriop_set_phy_address(dpmac_id, 0,
 					riser_phy_addr[dpmac_id - 2]);
 				if (dpmac_id >= 7 && hwconfig_f("xqsgmii",
 								env_hwconfig))
-					wriop_set_phy_address(dpmac_id,
+					wriop_set_phy_address(dpmac_id, 0,
 						riser_phy_addr[dpmac_id - 3]);
 			}
 			dpmac_info[dpmac_id].board_mux = EMI1_SLOT3;
@@ -691,7 +691,7 @@
 			break;
 		case 4:
 			/* Slot housing a SGMII riser card? */
-			wriop_set_phy_address(dpmac_id,
+			wriop_set_phy_address(dpmac_id, 0,
 					      riser_phy_addr[dpmac_id - 9]);
 			dpmac_info[dpmac_id].board_mux = EMI1_SLOT4;
 			bus = mii_dev_for_muxval(EMI1_SLOT4);
@@ -701,14 +701,14 @@
 			if (slot == EMI_NONE)
 				return;
 			if (serdes2_prtcl == 0x47) {
-				wriop_set_phy_address(dpmac_id,
+				wriop_set_phy_address(dpmac_id, 0,
 					      riser_phy_addr[dpmac_id - 10]);
 				if (dpmac_id >= 14 && hwconfig_f("xqsgmii",
 								 env_hwconfig))
-					wriop_set_phy_address(dpmac_id,
+					wriop_set_phy_address(dpmac_id, 0,
 						riser_phy_addr[dpmac_id - 11]);
 			} else {
-				wriop_set_phy_address(dpmac_id,
+				wriop_set_phy_address(dpmac_id, 0,
 					riser_phy_addr[dpmac_id - 11]);
 			}
 			dpmac_info[dpmac_id].board_mux = EMI1_SLOT5;
@@ -717,7 +717,7 @@
 			break;
 		case 6:
 			/* Slot housing a SGMII riser card? */
-			wriop_set_phy_address(dpmac_id,
+			wriop_set_phy_address(dpmac_id, 0,
 					      riser_phy_addr[dpmac_id - 13]);
 			dpmac_info[dpmac_id].board_mux = EMI1_SLOT6;
 			bus = mii_dev_for_muxval(EMI1_SLOT6);
@@ -775,7 +775,7 @@
 		switch (++slot) {
 		case 1:
 			/* Slot housing a QSGMII riser card? */
-			wriop_set_phy_address(dpmac_id, dpmac_id - 1);
+			wriop_set_phy_address(dpmac_id, 0, dpmac_id - 1);
 			dpmac_info[dpmac_id].board_mux = EMI1_SLOT1;
 			bus = mii_dev_for_muxval(EMI1_SLOT1);
 			wriop_set_mdio(dpmac_id, bus);
@@ -819,7 +819,7 @@
 		 * the XAUI card is used for the XFI MAC, which will cause
 		 * error.
 		 */
-		wriop_set_phy_address(i, i + 4);
+		wriop_set_phy_address(i, 0, i + 4);
 		ls2080a_qds_enable_SFP_TX(SFP_TX);
 
 		break;