Skip to contentSkip to conversation

mx28evk: Convert to phylib framework

PATCH New Fabio Estevam 3 participants 6 messages Jul 12, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mx28evk: Convert to phylib framework

From: Fabio Estevam <[email protected]>

mx28evk has a LAN8270 ethernet phy and we can use the phylib framework.

One of the advantages of converting to phylib is that we no longer see a timeout prior to the first transfer in the 'tftp' command.

---
After applying this patch I get:

U-Boot 2013.04-11810-gd6d75ec-dirty (Jul 12 2013 - 01:15:03)

CPU:   Freescale i.MX28 rev1.2 at 454 MHz                                       
BOOT:  SSP SD/MMC #0, 3V3                                                       
DRAM:  128 MiB                               
MMC:   MXS MMC: 0                                                               
Video: MXSFB: 'videomode' variable not set!                                     
In:    serial                                                                   
Out:   serial                                                                   
Err:   serial                                                                   
Net:   Phy not found 

I still get this 'Phy not found' message, but I think this is not related to the board code.

 board/freescale/mx28evk/mx28evk.c | 15 +--------------
 include/configs/mx28evk.h         |  3 ++-
 2 files changed, 3 insertions(+), 15 deletions(-)
board/freescale/mx28evk/mx28evk.c +1 -14
index 4edd9f4..cd81d58 100644
@@ -110,7 +110,6 @@ int board_eth_init(bd_t *bis)
 {
 	struct mxs_clkctrl_regs *clkctrl_regs =
 		(struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE;
-	struct eth_device *dev;
 	int ret;
 
 	ret = cpu_eth_init(bis);
@@ -133,24 +132,12 @@ int board_eth_init(bd_t *bis)
 		return ret;
 	}
 
-	ret = fecmxc_initialize_multi(bis, 1, 3, MXS_ENET1_BASE);
+	ret = fecmxc_initialize_multi(bis, 1, 1, MXS_ENET1_BASE);
 	if (ret) {
 		puts("FEC MXS: Unable to init FEC1\n");
 		return ret;
 	}
 
-	dev = eth_get_dev_by_name("FEC0");
-	if (!dev) {
-		puts("FEC MXS: Unable to get FEC0 device entry\n");
-		return -EINVAL;
-	}
-
-	dev = eth_get_dev_by_name("FEC1");
-	if (!dev) {
-		puts("FEC MXS: Unable to get FEC1 device entry\n");
-		return -EINVAL;
-	}
-
 	return ret;
 }
 
include/configs/mx28evk.h +2 -1
index de69182..2431b83 100644
@@ -170,12 +170,13 @@
 
 /* Ethernet on SOC (FEC) */
 #ifdef	CONFIG_CMD_NET
-#define CONFIG_NET_MULTI
 #define CONFIG_ETHPRIME	"FEC0"
 #define CONFIG_FEC_MXC
 #define CONFIG_MII
 #define CONFIG_FEC_XCV_TYPE	RMII
 #define CONFIG_MX28_FEC_MAC_IN_OCOTP
+#define CONFIG_PHYLIB
+#define CONFIG_PHY_SMSC
 #endif
 
 /* RTC */
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/1 mx28evk: Convert to phylib framework

Dear Fabio Estevam,

Quoted 23 lines

From: Fabio Estevam <[email protected]>

mx28evk has a LAN8270 ethernet phy and we can use the phylib framework.

One of the advantages of converting to phylib is that we no longer see a timeout prior to the first transfer in the 'tftp' command.

---
After applying this patch I get:

U-Boot 2013.04-11810-gd6d75ec-dirty (Jul 12 2013 - 01:15:03)

CPU:   Freescale i.MX28 rev1.2 at 454 MHz
BOOT:  SSP SD/MMC #0, 3V3
DRAM:  128 MiB
MMC:   MXS MMC: 0
Video: MXSFB: 'videomode' variable not set!
In:    serial
Out:   serial
Err:   serial
Net:   Phy not found
Quoted 2 lines

I still get this 'Phy not found' message, but I think this is not related to the board code.

This is because PHYlib doesn't know your PHY. You might need to add a definition for it into drivers/net/phy/smsc.c

Quoted 17 lines
 board/freescale/mx28evk/mx28evk.c | 15 +--------------
 include/configs/mx28evk.h         |  3 ++-
 2 files changed, 3 insertions(+), 15 deletions(-)
(quoted diff) +0 -0

b/board/freescale/mx28evk/mx28evk.c index 4edd9f4..cd81d58 100644

board/freescale/mx28evk/mx28evk.c +0 -1
@@ -110,7 +110,6 @@ int board_eth_init(bd_t *bis)
 {
 	struct mxs_clkctrl_regs *clkctrl_regs =
 		(struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE;
-	struct eth_device *dev;
 	int ret;
 
 	ret = cpu_eth_init(bis);

board/freescale/mx28evk/mx28evk.c int board_eth_init(bd_t *bis) · line 135

Quoted 5 lines
board/freescale/mx28evk/mx28evk.c +1 -1
@@ -133,24 +132,12 @@ int board_eth_init(bd_t *bis)
 		return ret;
 	}
 
-	ret = fecmxc_initialize_multi(bis, 1, 3, MXS_ENET1_BASE);
+	ret = fecmxc_initialize_multi(bis, 1, 1, MXS_ENET1_BASE);

Are you sure the PHY address on the MII bus for FEC1 is 0x01 ?

[..]

Best regards,
Marek Vasut

#2 lore raw

PATCH 1/1 mx28evk: Convert to phylib framework

Quoted 25 lines · Marek Vasut

Dear Fabio Estevam,

Quoted 23 lines

From: Fabio Estevam <[email protected]>

mx28evk has a LAN8270 ethernet phy and we can use the phylib framework.

One of the advantages of converting to phylib is that we no longer see a timeout prior to the first transfer in the 'tftp' command.

---
After applying this patch I get:

U-Boot 2013.04-11810-gd6d75ec-dirty (Jul 12 2013 - 01:15:03)

CPU:   Freescale i.MX28 rev1.2 at 454 MHz
BOOT:  SSP SD/MMC #0, 3V3
DRAM:  128 MiB
MMC:   MXS MMC: 0
Video: MXSFB: 'videomode' variable not set!
In:    serial
Out:   serial
Err:   serial
Net:   Phy not found
Quoted 5 lines
Quoted 2 lines

I still get this 'Phy not found' message, but I think this is not related to the board code.

This is because PHYlib doesn't know your PHY. You might need to add a definition for it into drivers/net/phy/smsc.c

mx28evk uses a LAN8270.

drivers/net/phy/smsc.c has an entry for "SMSC LAN8710/LAN8720", so not sure why it fails to recognize it.
I haven't debugged it yet.

Which phy does sc_sps_1.h use? Is it also a 8720? Is the phy recognized on boot?

Regards,

Fabio Estevam

#3 lore raw

PATCH 1/1 mx28evk: Convert to phylib framework

Dear Fabio Estevam,

Quoted 32 lines · Marek Vasut
Quoted 25 lines

Dear Fabio Estevam,

Quoted 23 lines

From: Fabio Estevam <[email protected]>

mx28evk has a LAN8270 ethernet phy and we can use the phylib framework.

One of the advantages of converting to phylib is that we no longer see a timeout prior to the first transfer in the 'tftp' command.

---
After applying this patch I get:

U-Boot 2013.04-11810-gd6d75ec-dirty (Jul 12 2013 - 01:15:03)

CPU:   Freescale i.MX28 rev1.2 at 454 MHz
BOOT:  SSP SD/MMC #0, 3V3
DRAM:  128 MiB
MMC:   MXS MMC: 0
Video: MXSFB: 'videomode' variable not set!
In:    serial
Out:   serial
Err:   serial
Net:   Phy not found
Quoted 5 lines
Quoted 2 lines

I still get this 'Phy not found' message, but I think this is not related to the board code.

This is because PHYlib doesn't know your PHY. You might need to add a definition for it into drivers/net/phy/smsc.c

Quoted 8 lines

mx28evk uses a LAN8270.

drivers/net/phy/smsc.c has an entry for "SMSC LAN8710/LAN8720", so not sure why it fails to recognize it.
I haven't debugged it yet.

Which phy does sc_sps_1.h use? Is it also a 8720? Is the phy recognized on boot?

I think it's 8720 , but it's recognised , yes. Are you sure the PHY addresses are correct ? You can dig into phylib a bit and see what IDs does it report.

Best regards,
Marek Vasut

#4 lore raw

PATCH 1/1 mx28evk: Convert to phylib framework

Quoted 40 lines · Marek Vasut

Dear Fabio Estevam,

Quoted 38 lines · Marek Vasut
Quoted 25 lines

Dear Fabio Estevam,

Quoted 23 lines

From: Fabio Estevam <[email protected]>

mx28evk has a LAN8270 ethernet phy and we can use the phylib framework.

One of the advantages of converting to phylib is that we no longer see a timeout prior to the first transfer in the 'tftp' command.

---
After applying this patch I get:

U-Boot 2013.04-11810-gd6d75ec-dirty (Jul 12 2013 - 01:15:03)

CPU:   Freescale i.MX28 rev1.2 at 454 MHz
BOOT:  SSP SD/MMC #0, 3V3
DRAM:  128 MiB
MMC:   MXS MMC: 0
Video: MXSFB: 'videomode' variable not set!
In:    serial
Out:   serial
Err:   serial
Net:   Phy not found
Quoted 5 lines
Quoted 2 lines

I still get this 'Phy not found' message, but I think this is not related to the board code.

This is because PHYlib doesn't know your PHY. You might need to add a definition for it into drivers/net/phy/smsc.c

mx28evk uses a LAN8270.

drivers/net/phy/smsc.c has an entry for "SMSC LAN8710/LAN8720", so not sure why it fails to recognize it.
I haven't debugged it yet.

Quoted 5 lines
Quoted 2 lines

Which phy does sc_sps_1.h use? Is it also a 8720? Is the phy recognized on boot?

I think it's 8720 , but it's recognised , yes. Are you sure the PHY addresses are correct ? You can dig into phylib a bit and see what IDs does it report.

I think Fabio needs to define CONFIG_PHY_SMSC and use PHY address 3.

#5 lore raw

PATCH 1/1 mx28evk: Convert to phylib framework

Dear Alexandre Pereira da Silva,

Quoted 42 lines · Marek Vasut
Quoted 41 lines

Dear Fabio Estevam,

Quoted 39 lines · Marek Vasut
Quoted 26 lines

Dear Fabio Estevam,

Quoted 24 lines

From: Fabio Estevam <[email protected]>

mx28evk has a LAN8270 ethernet phy and we can use the phylib framework.

One of the advantages of converting to phylib is that we no longer see a timeout prior to the first transfer in the 'tftp' command.

---
After applying this patch I get:

U-Boot 2013.04-11810-gd6d75ec-dirty (Jul 12 2013 - 01:15:03)

CPU:   Freescale i.MX28 rev1.2 at 454 MHz
BOOT:  SSP SD/MMC #0, 3V3
DRAM:  128 MiB
MMC:   MXS MMC: 0
Video: MXSFB: 'videomode' variable not set!
In:    serial
Out:   serial
Err:   serial
Net:   Phy not found
Quoted 5 lines
Quoted 2 lines

I still get this 'Phy not found' message, but I think this is not related to the board code.

This is because PHYlib doesn't know your PHY. You might need to add a definition for it into drivers/net/phy/smsc.c

mx28evk uses a LAN8270.

drivers/net/phy/smsc.c has an entry for "SMSC LAN8710/LAN8720", so not sure why it fails to recognize it.
I haven't debugged it yet.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Which phy does sc_sps_1.h use? Is it also a 8720? Is the phy recognized on boot?

I think it's 8720 , but it's recognised , yes. Are you sure the PHY addresses are correct ? You can dig into phylib a bit and see what IDs does it report.

I think Fabio needs to define CONFIG_PHY_SMSC and use PHY address 3.

He already did and the LAN8720 can use either phy addr 0x00 or 0x01, so that seem ok as well.

Best regards,
Marek Vasut