diff mbox

[RFC,07/10] fec: Add LAN8700 phy support

Message ID a34d2aac8d5282bfbdf09dddc2da57c4ad7da355.1259893118.git.amit.kucheria@canonical.com
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Amit Kucheria Dec. 4, 2009, 2:47 a.m. UTC
The i.MX51 babbage board has a FEC ethernet controller with this phy.

Signed-off-by: Amit Kucheria <amit.kucheria@canonical.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
---
 drivers/net/fec.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

Comments

Sascha Hauer Dec. 4, 2009, 11:15 a.m. UTC | #1
On Fri, Dec 04, 2009 at 04:47:07AM +0200, Amit Kucheria wrote:
> The i.MX51 babbage board has a FEC ethernet controller with this phy.

I already saw patches for proper phylib support for the fec driver.
Maybe we should reactivate them rather than adding another phy to this
driver.

Sascha

> 
> Signed-off-by: Amit Kucheria <amit.kucheria@canonical.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: netdev@vger.kernel.org
> ---
>  drivers/net/fec.c |   21 +++++++++++++++++++++
>  1 files changed, 21 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/fec.c b/drivers/net/fec.c
> index 9a8743d..5d0d332 100644
> --- a/drivers/net/fec.c
> +++ b/drivers/net/fec.c
> @@ -1128,6 +1128,26 @@ static phy_info_t phy_info_dp83848= {
>  	},
>  };
>  
> +static phy_info_t phy_info_lan8700 = {
> +	0x0007C0C,
> +	"LAN8700",
> +	(const phy_cmd_t []) { /* config */
> +		{ mk_mii_read(MII_REG_CR), mii_parse_cr },
> +		{ mk_mii_read(MII_REG_ANAR), mii_parse_anar },
> +		{ mk_mii_end, }
> +	},
> +	(const phy_cmd_t []) { /* startup */
> +		{ mk_mii_write(MII_REG_CR, 0x1200), NULL }, /* autonegotiate */
> +		{ mk_mii_read(MII_REG_SR), mii_parse_sr },
> +		{ mk_mii_end, }
> +	},
> +	(const phy_cmd_t []) { /* act_int */
> +		{ mk_mii_end, }
> +	},
> +	(const phy_cmd_t []) { /* shutdown */
> +		{ mk_mii_end, }
> +	},
> +};
>  /* ------------------------------------------------------------------------- */
>  
>  static phy_info_t const * const phy_info[] = {
> @@ -1137,6 +1157,7 @@ static phy_info_t const * const phy_info[] = {
>  	&phy_info_am79c874,
>  	&phy_info_ks8721bl,
>  	&phy_info_dp83848,
> +	&phy_info_lan8700,
>  	NULL
>  };
>  
> -- 
> 1.6.3.3
> 
>
diff mbox

Patch

diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 9a8743d..5d0d332 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1128,6 +1128,26 @@  static phy_info_t phy_info_dp83848= {
 	},
 };
 
+static phy_info_t phy_info_lan8700 = {
+	0x0007C0C,
+	"LAN8700",
+	(const phy_cmd_t []) { /* config */
+		{ mk_mii_read(MII_REG_CR), mii_parse_cr },
+		{ mk_mii_read(MII_REG_ANAR), mii_parse_anar },
+		{ mk_mii_end, }
+	},
+	(const phy_cmd_t []) { /* startup */
+		{ mk_mii_write(MII_REG_CR, 0x1200), NULL }, /* autonegotiate */
+		{ mk_mii_read(MII_REG_SR), mii_parse_sr },
+		{ mk_mii_end, }
+	},
+	(const phy_cmd_t []) { /* act_int */
+		{ mk_mii_end, }
+	},
+	(const phy_cmd_t []) { /* shutdown */
+		{ mk_mii_end, }
+	},
+};
 /* ------------------------------------------------------------------------- */
 
 static phy_info_t const * const phy_info[] = {
@@ -1137,6 +1157,7 @@  static phy_info_t const * const phy_info[] = {
 	&phy_info_am79c874,
 	&phy_info_ks8721bl,
 	&phy_info_dp83848,
+	&phy_info_lan8700,
 	NULL
 };