Patchwork [18/27] UBUNTU: SAUCE: fsl_pq_mdio: Add support for FMan

login
register
mail settings
Submitter Benjamin Collins
Date Oct. 16, 2011, 6:46 a.m.
Message ID <9591e77279cb9424ebc4094db40c95eda5f725ec.1339455422.git.bcollins@ubuntu.com>
Download mbox | patch
Permalink /patch/164278/
State New
Headers show

Comments

Benjamin Collins - Oct. 16, 2011, 6:46 a.m.
This patch is being maintained and will eventually be merged upstream by
Freescale directly. The powerpc-e500mc flavour uses this.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
---
 drivers/net/ethernet/freescale/fsl_pq_mdio.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

Patch

diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.c b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
index 935a1b6..7eee784 100644
--- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c
+++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
@@ -302,6 +302,7 @@  static int fsl_pq_mdio_probe(struct platform_device *ofdev)
 
 	if (of_device_is_compatible(np, "fsl,gianfar-mdio") ||
 			of_device_is_compatible(np, "fsl,gianfar-tbi") ||
+			of_device_is_compatible(np, "fsl,fman-mdio") ||
 			of_device_is_compatible(np, "fsl,ucc-mdio") ||
 			of_device_is_compatible(np, "ucc_geth_phy"))
 		map -= offsetof(struct fsl_pq_mdio, miimcfg);
@@ -342,6 +343,13 @@  static int fsl_pq_mdio_probe(struct platform_device *ofdev)
 			mii_mng_master = id;
 			ucc_set_qe_mux_mii_mng(id - 1);
 		}
+	} else if (of_device_is_compatible(np, "fsl,fman-mdio")) {
+#ifdef CONFIG_FSL_FMAN
+		tbiaddr = 5;
+#else
+		err = -ENODEV;
+		goto err_free_irqs;
+#endif
 	} else {
 		err = -ENODEV;
 		goto err_free_irqs;
@@ -362,7 +370,9 @@  static int fsl_pq_mdio_probe(struct platform_device *ofdev)
 			err = -EBUSY;
 			goto err_free_irqs;
 		} else {
+#ifndef CONFIG_FSL_FMAN
 			out_be32(tbipa, tbiaddr);
+#endif
 		}
 	}
 
@@ -429,6 +439,9 @@  static struct of_device_id fsl_pq_mdio_match[] = {
 	{
 		.compatible = "fsl,etsec2-mdio",
 	},
+	{
+		.compatible = "fsl,fman-mdio",
+	},
 	{},
 };
 MODULE_DEVICE_TABLE(of, fsl_pq_mdio_match);