From patchwork Sun Oct 16 06:46:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [18/27] UBUNTU: SAUCE: fsl_pq_mdio: Add support for FMan From: Benjamin Collins X-Patchwork-Id: 164278 Message-Id: <9591e77279cb9424ebc4094db40c95eda5f725ec.1339455422.git.bcollins@ubuntu.com> To: kernel-team@lists.ubuntu.com Date: Sun, 16 Oct 2011 01:46:57 -0500 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 Signed-off-by: Kumar Gala Signed-off-by: Ben Collins --- drivers/net/ethernet/freescale/fsl_pq_mdio.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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);