Corenet/p5040/SGMII:fix the problem for SGMII5/6
authorZhao Qiang <B45475@freescale.com>
Wed, 4 Sep 2013 02:11:26 +0000 (10:11 +0800)
committerYork Sun <yorksun@freescale.com>
Wed, 16 Oct 2013 23:13:11 +0000 (16:13 -0700)
SGMII5/6 and SGMII7/8 are not on the same slot on P5040
according to the serdes protocol.
So it is not proper to organize SGMII5/6 and SGMII7/8
on one bus and SGMII5/6 can't work.
So a new bus SUPER_HYDRA_FM3_SGMII_MDIO is added for
SGMII5/6

Signed-off-by: Zhao Qiang <B45475@freescale.com>
board/freescale/corenet_ds/eth_superhydra.c

index fa07ff3..91ac196 100644 (file)
@@ -449,6 +449,8 @@ int board_eth_init(bd_t *bis)
                                "SUPER_HYDRA_FM1_SGMII_MDIO");
        super_hydra_mdio_init(DEFAULT_FM_MDIO_NAME,
                                "SUPER_HYDRA_FM2_SGMII_MDIO");
+       super_hydra_mdio_init(DEFAULT_FM_MDIO_NAME,
+                             "SUPER_HYDRA_FM3_SGMII_MDIO");
        super_hydra_mdio_init(DEFAULT_FM_TGEC_MDIO_NAME,
                                "SUPER_HYDRA_FM1_TGEC_MDIO");
        super_hydra_mdio_init(DEFAULT_FM_TGEC_MDIO_NAME,
@@ -638,10 +640,22 @@ int board_eth_init(bd_t *bis)
                                break;
                        };
 
-                       super_hydra_mdio_set_mux("SUPER_HYDRA_FM2_SGMII_MDIO",
-                                       mdio_mux[i].mask, mdio_mux[i].val);
-                       fm_info_set_mdio(i,
-                       miiphy_get_dev_by_name("SUPER_HYDRA_FM2_SGMII_MDIO"));
+                       if (i == FM2_DTSEC1 || i == FM2_DTSEC2) {
+                               super_hydra_mdio_set_mux(
+                                               "SUPER_HYDRA_FM3_SGMII_MDIO",
+                                               mdio_mux[i].mask,
+                                               mdio_mux[i].val);
+                               fm_info_set_mdio(i, miiphy_get_dev_by_name(
+                                               "SUPER_HYDRA_FM3_SGMII_MDIO"));
+                       } else {
+                               super_hydra_mdio_set_mux(
+                                               "SUPER_HYDRA_FM2_SGMII_MDIO",
+                                               mdio_mux[i].mask,
+                                               mdio_mux[i].val);
+                               fm_info_set_mdio(i, miiphy_get_dev_by_name(
+                                               "SUPER_HYDRA_FM2_SGMII_MDIO"));
+                       }
+
                        break;
                case PHY_INTERFACE_MODE_RGMII:
                        /*