From f20136eb03a1dbdfb04f3c62fd11c0d02d02b726 Mon Sep 17 00:00:00 2001 From: Cyril Chemparathy Date: Wed, 15 Sep 2010 10:11:21 -0400 Subject: net: davinci_emac: separate out davinci mdio Davinci's MDIO controller is present on other TI devices, without an accompanying EMAC. For example, on tnetv107x, the same MDIO module is used in conjunction with a 3-port switch hardware. By separating the MDIO controller code into its own platform driver, this patch allows common logic to be reused on such platforms. Signed-off-by: Cyril Chemparathy Tested-by: Michael Williamson Tested-by: Caglar Akyuz Signed-off-by: Kevin Hilman --- include/linux/davinci_emac.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/linux') diff --git a/include/linux/davinci_emac.h b/include/linux/davinci_emac.h index 7c930dba477c..a04fd8c9fbdf 100644 --- a/include/linux/davinci_emac.h +++ b/include/linux/davinci_emac.h @@ -14,6 +14,10 @@ #include #include +struct mdio_platform_data { + unsigned long bus_freq; +}; + struct emac_platform_data { char mac_addr[ETH_ALEN]; u32 ctrl_reg_offset; -- cgit v1.2.3 From 5d69e0076a726588265af040b21ac3f8266856d1 Mon Sep 17 00:00:00 2001 From: Cyril Chemparathy Date: Wed, 15 Sep 2010 10:11:24 -0400 Subject: net: davinci_emac: switch to new mdio This patch switches the emac implementation over to the newly separated MDIO driver. With this, the mdio bus frequency defaults to a safe 2.2MHz. Boards may optionally specify a bus frequency via platform data. The phy identification scheme has been modified to use a phy bus id instead of a mask. This largely serves to eliminate the "phy search" code in emac init. Signed-off-by: Cyril Chemparathy Acked-by: David S. Miller Tested-by: Michael Williamson Tested-by: Caglar Akyuz Signed-off-by: Kevin Hilman --- include/linux/davinci_emac.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/linux') diff --git a/include/linux/davinci_emac.h b/include/linux/davinci_emac.h index a04fd8c9fbdf..46a759f0c082 100644 --- a/include/linux/davinci_emac.h +++ b/include/linux/davinci_emac.h @@ -28,6 +28,15 @@ struct emac_platform_data { u32 ctrl_ram_size; u32 phy_mask; u32 mdio_max_freq; + + /* + * phy_id can be one of the following: + * - NULL : use the first phy on the bus, + * - "" : force to 100/full, no mdio control + * - ":" : use the specified bus and phy + */ + const char *phy_id; + u8 rmii_en; u8 version; void (*interrupt_enable) (void); -- cgit v1.2.3 From 7b3742aff1a9946b9b25f16d6a7ca22c10926391 Mon Sep 17 00:00:00 2001 From: Cyril Chemparathy Date: Wed, 15 Sep 2010 10:11:27 -0400 Subject: net: davinci_emac: cleanup unused mdio emac code This patch removes code that has been rendered useless by the previous patches in this series. Signed-off-by: Cyril Chemparathy Acked-by: David S. Miller Tested-by: Michael Williamson Tested-by: Caglar Akyuz Signed-off-by: Kevin Hilman --- include/linux/davinci_emac.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include/linux') diff --git a/include/linux/davinci_emac.h b/include/linux/davinci_emac.h index 46a759f0c082..5dd428532f79 100644 --- a/include/linux/davinci_emac.h +++ b/include/linux/davinci_emac.h @@ -24,10 +24,7 @@ struct emac_platform_data { u32 ctrl_mod_reg_offset; u32 ctrl_ram_offset; u32 hw_ram_addr; - u32 mdio_reg_offset; u32 ctrl_ram_size; - u32 phy_mask; - u32 mdio_max_freq; /* * phy_id can be one of the following: -- cgit v1.2.3