Skip to contentSkip to conversation

net, cpsw: disable gigabit support through plattform data

U-Boot Heiko Schocher 4 participants 6 messages Jun 4, 2013 – Jun 5, 2013 Network drivers

lore
Share & tools
lore
#0 lore raw

add possibility to disable gigabit support through plattform data. Current boards should not be affected through this patch.

Cc Cyril Chemparathy <[email protected]>
Cc Chandan Nath <[email protected]>
Cc Satyanarayana, Sandhya <[email protected]>
Cc Ilya Yanok <[email protected]>
Cc Yegor Yefremov <[email protected]>
Cc Mugunthan V N <[email protected]>
Cc Tom Rini <[email protected]>
Cc Joe Hershberger <[email protected]>
---
 board/phytec/pcm051/board.c |  1 +
 board/ti/am335x/board.c     |  1 +
 drivers/net/cpsw.c          | 14 ++++++++++++--
 include/cpsw.h              |  1 +

4 Dateien ge?ndert, 15 Zeilen hinzugef?gt(+), 2 Zeilen entfernt(-)

board/phytec/pcm051/board.c +1 -0
index 43d7b6e..9ea50e1 100644
@@ -213,6 +213,7 @@ static struct cpsw_platform_data cpsw_data = {
 	.hw_stats_reg_ofs	= 0x900,
 	.mac_control		= (1 << 5),
 	.control		= cpsw_control,
+	.gigabit_en		= 1,
 	.host_port_num		= 0,
 	.version		= CPSW_CTRL_VERSION_2,
 };
board/ti/am335x/board.c +1 -0
index b371376..e52b009 100644
@@ -464,6 +464,7 @@ static struct cpsw_platform_data cpsw_data = {
 	.hw_stats_reg_ofs	= 0x900,
 	.mac_control		= (1 << 5),
 	.control		= cpsw_control,
+	.gigabit_en		= 1,
 	.host_port_num		= 0,
 	.version		= CPSW_CTRL_VERSION_2,
 };
drivers/net/cpsw.c +12 -2
index 379b679..10b8aeb 100644
@@ -578,8 +578,15 @@ static void cpsw_slave_update_link(struct cpsw_slave *slave,
 
 	if (*link) { /* link up */
 		mac_control = priv->data.mac_control;
-		if (phy->speed == 1000)
-			mac_control |= GIGABITEN;
+		if (phy->speed == 1000) {
+			if (priv->data.gigabit_en) {
+				mac_control |= GIGABITEN;
+			} else {
+				/* Disable gigabit as it's non-functional */
+				mac_control &= ~GIGABITEN;
+				phy->speed = 100;
+			}
+		}
 		if (phy->duplex == DUPLEX_FULL)
 			mac_control |= FULLDUPLEXEN;
 		if (phy->speed == 100)
@@ -943,6 +950,9 @@ static int cpsw_phy_init(struct eth_device *dev, struct cpsw_slave *slave)
 			SUPPORTED_100baseT_Full |
 			SUPPORTED_1000baseT_Full);
 
+	if (!priv->data.gigabit_en)
+		supported &= ~SUPPORTED_1000baseT_Full;
+
 	phydev = phy_connect(priv->bus,
 			CONFIG_PHY_ADDR,
 			dev,
include/cpsw.h +1 -0
index 296b0e5..fa217f4 100644
@@ -41,6 +41,7 @@ struct cpsw_platform_data {
 	u32	hw_stats_reg_ofs;	/* cpsw hw stats counters	*/
 	u32	mac_control;
 	struct cpsw_slave_data	*slave_data;
+	u32	gigabit_en;	/* gigabit capable AND enabled		*/
 	void	(*control)(int enabled);
 	u32	host_port_num;
 	u8	version;
Signature · 1 line
1.7.11.7
#1 lore raw
Quoted 5 lines · Heiko Schocher

add possibility to disable gigabit support through plattform data. Current boards should not be affected through this patch.

Why? Based on some of your later patches, you're working with a customer that was sampled very early in am335x, but has newer silicon now. This looks like the work-around for very early parts where indeed, gigabit had to be disabled. We removed this from mainline (or from what was submitted to mainline, I forget which now) intentionally. NAK, without some new information coming to light. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130604/36d015ea/attachment.pgp>
#2 lore raw
In reply to Heiko Schocher

Dear Heiko,

Quoted 3 lines · In message <[email protected]> you wrote:

add possibility to disable gigabit support through plattform data. Current boards should not be affected through this patch.

...

drivers/net/cpsw.c static void cpsw_slave_update_link(struct cpsw_slave *slave, · line 587

Quoted 7 lines
drivers/net/cpsw.c +7 -0
+		if (phy->speed == 1000) {
+			if (priv->data.gigabit_en) {
+				mac_control |= GIGABITEN;
+			} else {
+				/* Disable gigabit as it's non-functional */
+				mac_control &= ~GIGABITEN;
+				phy->speed = 100;

Is this reliable? I mean, how do we know it's a 100 Mbps connection (and not for example a 10 Mbs one) ?

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Systems programmers are the high priests of a low cult.
                                                       -- R.S. Barton
#3 lore raw

Hello Wolfgang,

Am 04.06.2013 17:00, schrieb Wolfgang Denk:

Quoted 7 lines

Dear Heiko,

Quoted 3 lines · In message <[email protected]> you wrote:

add possibility to disable gigabit support through plattform data. Current boards should not be affected through this patch.

...

Quoted 10 lines

drivers/net/cpsw.c static void cpsw_slave_update_link(struct cpsw_slave *slave, · line 587

Quoted 7 lines
drivers/net/cpsw.c +7 -0
+		if (phy->speed == 1000) {
+			if (priv->data.gigabit_en) {
+				mac_control |= GIGABITEN;
+			} else {
+				/* Disable gigabit as it's non-functional */
+				mac_control &= ~GIGABITEN;
+				phy->speed = 100;

Is this reliable? I mean, how do we know it's a 100 Mbps connection (and not for example a 10 Mbs one) ?

Indeed. Anyway, I have to check, if this patch is necessary, as Tom noted ...

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#4 lore raw
Quoted 19 lines · Heiko Schocher

Hello Wolfgang,

Am 04.06.2013 17:00, schrieb Wolfgang Denk:

Quoted 16 lines

Dear Heiko,

Quoted 3 lines · In message <[email protected]> you wrote:

add possibility to disable gigabit support through plattform data. Current boards should not be affected through this patch.

...

drivers/net/cpsw.c static void cpsw_slave_update_link(struct cpsw_slave *slave, · line 587

Quoted 7 lines
drivers/net/cpsw.c +7 -0
+		if (phy->speed == 1000) {
+			if (priv->data.gigabit_en) {
+				mac_control |= GIGABITEN;
+			} else {
+				/* Disable gigabit as it's non-functional */
+				mac_control &= ~GIGABITEN;
+				phy->speed = 100;

Is this reliable? I mean, how do we know it's a 100 Mbps connection (and not for example a 10 Mbs one) ?

Phy speed info will be read from phy status itself for configuring mac ctrl reg.

Quoted 5 lines

Indeed. Anyway, I have to check, if this patch is necessary, as Tom noted ...

bye,
Heiko

As Tom mentioned this patch is applicable only for initial samples as there was a issue with Gig mode packet transfer.
Now there is no issue with having Gig enabled by default.

Regards
Mugunthan V N

#5 lore raw

Hello Mugunthan, Tom,

Am 04.06.2013 17:29, schrieb Mugunthan V N:

Quoted 22 lines · Heiko Schocher
Quoted 19 lines

Hello Wolfgang,

Am 04.06.2013 17:00, schrieb Wolfgang Denk:

Quoted 16 lines

Dear Heiko,

Quoted 3 lines · In message <[email protected]> you wrote:

add possibility to disable gigabit support through plattform data. Current boards should not be affected through this patch.

...

drivers/net/cpsw.c static void cpsw_slave_update_link(struct cpsw_slave *slave, · line 587

Quoted 7 lines
drivers/net/cpsw.c +7 -0
+		if (phy->speed == 1000) {
+			if (priv->data.gigabit_en) {
+				mac_control |= GIGABITEN;
+			} else {
+				/* Disable gigabit as it's non-functional */
+				mac_control &= ~GIGABITEN;
+				phy->speed = 100;

Is this reliable? I mean, how do we know it's a 100 Mbps connection (and not for example a 10 Mbs one) ?

Phy speed info will be read from phy status itself for configuring mac ctrl reg.

Quoted 8 lines
Quoted 5 lines

Indeed. Anyway, I have to check, if this patch is necessary, as Tom noted ...

bye,
Heiko

As Tom mentioned this patch is applicable only for initial samples as there was a issue with Gig mode packet transfer.
Now there is no issue with having Gig enabled by default.

Indeed, ethernet works fine without this patch :-)

Sorry for the noise. I delete this patch in patchwork.

Thanks!

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany