Hello all,
for what it's worth, I wrote a quick dirty patch for myself to solve this issue for myself.
See below.
Best regards,
Stefan
####################
commit c6dffe1f34476fbb0653328521ab4124f204b007
Author: Stefan Lange <s.lange@gateware.de>
Date: Wed Jul 13 17:37:34 2016 +0200
Workaround to enable rgmii-id phy-connection-type with QorIQ Frame Manag
Dirty Workaround:
Get the true external PHY's connection type
Workaround as FMAN overwrites the "phy-connection-type"-property
with "rgmii" if "rgmii-id" is noted in the device tree.
The new variable "external_phy_if" is successively used in the
"init_phy" function further above in this .c-file.
See also: https://community.nxp.com/thread/398029
diff --git a/arch/powerpc/boot/dts/fsl/tqmt1042.dts b/arch/powerpc/boot/dts/fsl/
index cde8d2f..e81d236 100644
--- a/arch/powerpc/boot/dts/fsl/tqmt1042.dts
+++ b/arch/powerpc/boot/dts/fsl/tqmt1042.dts
@@ -263,12 +263,14 @@
enet3: ethernet@e6000 {
phy-handle = <&phy_rgmii_0>;
phy-connection-type = "rgmii-id";
+ external-phy-connection-type = "rgmii-id";
};
/* MAC5: RGMII DP83867 */
enet4: ethernet@e8000 {
phy-handle = <&phy_rgmii_1>;
phy-connection-type = "rgmii-id";
+ external-phy-connection-type = "rgmii-id";
};
/* external, dedicated MDIO */
diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/fr
index e33d9d2..254e88c 100644
--- a/drivers/net/ethernet/freescale/fman/mac.c
+++ b/drivers/net/ethernet/freescale/fman/mac.c
@@ -67,6 +67,7 @@ struct mac_priv_s {
struct fixed_phy_status *fixed_link;
u16 speed;
u16 max_speed;
+ phy_interface_t external_phy_if;
int (*enable)(struct fman_mac *mac_dev, enum comm_mode mode);
int (*disable)(struct fman_mac *mac_dev, enum comm_mode mode);
@@ -476,8 +477,14 @@ static int init_phy(struct net_device *net_dev,
struct phy_device *phy_dev;
struct mac_priv_s *priv = mac_dev->priv;
- phy_dev = of_phy_connect(net_dev, priv->phy_node, adj_lnk, 0,
+ if (priv->external_phy_if) {
+ phy_dev = of_phy_connect(net_dev, priv->phy_node, adj_lnk, 0,
+ priv->external_phy_if);
+ }
+ else {
+ phy_dev = of_phy_connect(net_dev, priv->phy_node, adj_lnk, 0,
priv->phy_if);
+ }
if (!phy_dev) {
netdev_err(net_dev, "Could not connect to PHY\n");
return -ENODEV;
@@ -881,6 +888,23 @@ static int mac_probe(struct platform_device *_of_dev)
priv->phy_if = str2phy(char_prop);
}
+ /*
+ * Dirty Workaround:
+ * Get the true external PHY's connection type
+ * Workaround as FMAN overwrites the "phy-connection-type"-property
+ * with "rgmii" if "rgmii-id" is noted in the device tree.
+ * The new variable "external_phy_if" is successively used in the
+ * "init_phy" function further above in this .c-file.
+ * See also: https://community.nxp.com/thread/398029
+ */
+ char_prop = (const char *)of_get_property(mac_node,
+ "external-phy-connection-type"
+ if (char_prop) {
+ dev_info(dev,"'external-phy-connection-type' property present in
+ dev_info(dev,"'external-phy-connection-type' set to %s \n", char
+ priv->external_phy_if = str2phy(char_prop);
+ }
+
priv->speed = phy2speed[priv->phy_if];
priv->max_speed = priv->speed;
mac_dev->if_support = DTSEC_SUPPORTED;