Skip to contentSkip to conversation

davinci: added Marvell 88E1111 PHY support

PATCH New Brilliantov Kirill Vladimirovich 2 participants 4 messages May 4, 2012 – May 7, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 davinci: added Marvell 88E1111 PHY support

added Marvell 88E1111 PHY support for Davinchi DM36x tested on DM368ZCEF

Signed-off-by: Brilliantov Kirill Vladimirovich
<[email protected]>

---
 arch/arm/cpu/arm926ejs/davinci/Makefile       |    1 +
 arch/arm/cpu/arm926ejs/davinci/marvell.c      |  232 +++++++++++++++++++++++++
 arch/arm/include/asm/arch-davinci/emac_defs.h |    6 +
 drivers/net/davinci_emac.c                    |   18 ++
 4 files changed, 257 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/davinci/marvell.c
arch/arm/cpu/arm926ejs/davinci/Makefile +1 -0
index da7efac..687c58b 100644
@@ -35,6 +35,7 @@ COBJS-$(CONFIG_SOC_DM644X)	+= dm644x.o
 COBJS-$(CONFIG_SOC_DM646X)	+= dm646x.o
 COBJS-$(CONFIG_SOC_DA850)	+= da850_pinmux.o
 COBJS-$(CONFIG_DRIVER_TI_EMAC)	+= lxt972.o dp83848.o et1011c.o ksz8873.o
+COBJS-$(CONFIG_DRIVER_TI_EMAC)	+= marvell.o
 
 ifdef CONFIG_SPL_BUILD
 COBJS-y	+= spl.o
arch/arm/cpu/arm926ejs/davinci/marvell.c new file +232 -0

232 lines not on this page · raw message

arch/arm/include/asm/arch-davinci/emac_defs.h +6 -0
index 8a17de9..5f27600 100644
@@ -105,4 +105,10 @@ int dp83848_auto_negotiate(int phy_addr);
 #define PHY_ET1011C	(0x282f013)
 int et1011c_get_link_speed(int phy_addr);
 
+#define PHY_M88E1111 (0x1410CC2)
+int m88e1111_is_phy_connected(int phy_addr);
+int m88e1111_get_link_speed(int phy_addr);
+int m88e1111_init_phy(int phy_addr);
+int m88e1111_auto_negotiate(int phy_addr);
+
 #endif  /* _DM644X_EMAC_H_ */
drivers/net/davinci_emac.c +18 -0
index fbd0f1b..fdca1ae 100644
@@ -881,6 +881,16 @@ int davinci_emac_initialize(void)
 			phy[i].auto_negotiate = gen_auto_negotiate;
 			break;
 #endif
+#ifdef PHY_M88E1111
+		case PHY_M88E1111:
+			sprintf(phy[i].name, "MARVELL88E1111 @ 0x%02x",
+				active_phy_addr[i]);
+			    phy[i].init = m88e1111_init_phy;
+			    phy[i].is_phy_connected = m88e1111_is_phy_connected;
+			    phy[i].get_link_speed = m88e1111_get_link_speed;
+			    phy[i].auto_negotiate = m88e1111_auto_negotiate;
+			break;
+#endif
 		default:
 			sprintf(phy[i].name, "GENERIC @ 0x%02x",
 						active_phy_addr[i]);
@@ -892,6 +902,14 @@ int davinci_emac_initialize(void)
 
 		debug("Ethernet PHY: %s\n", phy[i].name);
 
+#if defined(PHY_M88E1111) && defined(CONFIG_SOC_DM365)
+		/* I always get 1000Mb/s without this */
+		if (PHY_M88E1111 == phy_id) {
+			if (!phy[i].init(active_phy_addr[i]))
+				return(0);
+		}
+#endif
+
 		miiphy_register(phy[i].name, davinci_mii_phy_read,
 						davinci_mii_phy_write);
 	}
Signature · 1 line
1.7.9
#1 lore raw

PATCH 1/1 davinci: added Marvell 88E1111 PHY support

Quoted 5 lines · Brilliantov Kirill Vladimirovich

added Marvell 88E1111 PHY support for Davinchi DM36x tested on DM368ZCEF

Signed-off-by: Brilliantov Kirill Vladimirovich
<[email protected]>

OK, we really need the emac driver converted to phylib (which already has this PHY it looks like). Any chance you would have time to try doing that?

Signature · 1 line
Tom
#2 lore raw

PATCH 1/1 davinci: added Marvell 88E1111 PHY support

Tom Rini wrote on 05/04/2012 08:58 PM:

Quoted 5 lines

OK, we really need the emac driver converted to phylib (which already has this PHY it looks like). Any chance you would have time to try doing that?

Tom, now I try modify driver/net/phy/marvell.c. I add next defines in include/configs/davinci_dm365evn.h:
#define CONFIG_PHYLIB
#define CONFIG_PHY_MARVELL

After starting U-Boot I see initializing Marvell driver, but I don't see another functions, e.g. config or startup.

How can I link phylib and TI_EMAC?

Thank you and excuse me for my bad english.

#3 lore raw

PATCH 1/1 davinci: added Marvell 88E1111 PHY support

Quoted 14 lines · Brilliantov Kirill Vladimirovich

Tom Rini wrote on 05/04/2012 08:58 PM:

Quoted 5 lines

OK, we really need the emac driver converted to phylib (which already has this PHY it looks like). Any chance you would have time to try doing that?

Tom, now I try modify driver/net/phy/marvell.c. I add next defines in include/configs/davinci_dm365evn.h:
#define CONFIG_PHYLIB
#define CONFIG_PHY_MARVELL

Quoted 4 lines

After starting U-Boot I see initializing Marvell driver, but I don't see another functions, e.g. config or startup.

How can I link phylib and TI_EMAC?

The driver itself needs to be ported to PHYLIB. When I talked with others before about doing the conversion I was given the following patches to look at, as examples of drivers implementing PHYLIB support:
http://patchwork.ozlabs.org/patch/80589/
http://patchwork.ozlabs.org/patch/114793/

Signature · 1 line
Tom