public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] net, cpsw: disable gigabit support through plattform data
@ 2013-06-04  8:51 Heiko Schocher
  2013-06-04 13:58 ` Tom Rini
  2013-06-04 15:00 ` Wolfgang Denk
  0 siblings, 2 replies; 6+ messages in thread
From: Heiko Schocher @ 2013-06-04  8:51 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Cyril Chemparathy <cyril@ti.com>
Cc: Chandan Nath <chandan.nath@ti.com>
Cc: Satyanarayana, Sandhya <sandhya.satyanarayana@ti.com>
Cc: Ilya Yanok <ilya.yanok@cogentembedded.com>
Cc: Yegor Yefremov <yegorslists@googlemail.com>
Cc: Mugunthan V N <mugunthanvnm@ti.com>
Cc: Tom Rini <trini@ti.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
---
 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(-)

diff --git a/board/phytec/pcm051/board.c b/board/phytec/pcm051/board.c
index 43d7b6e..9ea50e1 100644
--- a/board/phytec/pcm051/board.c
+++ b/board/phytec/pcm051/board.c
@@ -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,
 };
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index b371376..e52b009 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -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,
 };
diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index 379b679..10b8aeb 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -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,
diff --git a/include/cpsw.h b/include/cpsw.h
index 296b0e5..fa217f4 100644
--- a/include/cpsw.h
+++ b/include/cpsw.h
@@ -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;
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] net, cpsw: disable gigabit support through plattform data
  2013-06-04  8:51 [U-Boot] net, cpsw: disable gigabit support through plattform data Heiko Schocher
@ 2013-06-04 13:58 ` Tom Rini
  2013-06-04 15:00 ` Wolfgang Denk
  1 sibling, 0 replies; 6+ messages in thread
From: Tom Rini @ 2013-06-04 13:58 UTC (permalink / raw)
  To: u-boot

On Tue, Jun 04, 2013 at 10:51:54AM +0200, Heiko Schocher wrote:

> add possibility to disable gigabit support through
> plattform data. Current boards should not be affected
> through this patch.
> 
> Signed-off-by: Heiko Schocher <hs@denx.de>

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!

-- 
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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] net, cpsw: disable gigabit support through plattform data
  2013-06-04  8:51 [U-Boot] net, cpsw: disable gigabit support through plattform data Heiko Schocher
  2013-06-04 13:58 ` Tom Rini
@ 2013-06-04 15:00 ` Wolfgang Denk
  2013-06-04 15:15   ` Heiko Schocher
  1 sibling, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2013-06-04 15:00 UTC (permalink / raw)
  To: u-boot

Dear Heiko,

In message <1370335914-14027-1-git-send-email-hs@denx.de> you wrote:
> add possibility to disable gigabit support through
> plattform data. Current boards should not be affected
> through this patch.
...
> +		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

-- 
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] net, cpsw: disable gigabit support through plattform data
  2013-06-04 15:00 ` Wolfgang Denk
@ 2013-06-04 15:15   ` Heiko Schocher
  2013-06-04 15:29     ` Mugunthan V N
  0 siblings, 1 reply; 6+ messages in thread
From: Heiko Schocher @ 2013-06-04 15:15 UTC (permalink / raw)
  To: u-boot

Hello Wolfgang,

Am 04.06.2013 17:00, schrieb Wolfgang Denk:
> Dear Heiko,
> 
> In message <1370335914-14027-1-git-send-email-hs@denx.de> you wrote:
>> add possibility to disable gigabit support through
>> plattform data. Current boards should not be affected
>> through this patch.
> ...
>> +		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
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] net, cpsw: disable gigabit support through plattform data
  2013-06-04 15:15   ` Heiko Schocher
@ 2013-06-04 15:29     ` Mugunthan V N
  2013-06-05 10:44       ` Heiko Schocher
  0 siblings, 1 reply; 6+ messages in thread
From: Mugunthan V N @ 2013-06-04 15:29 UTC (permalink / raw)
  To: u-boot

On 6/4/2013 8:45 PM, Heiko Schocher wrote:
> Hello Wolfgang,
>
> Am 04.06.2013 17:00, schrieb Wolfgang Denk:
>> Dear Heiko,
>>
>> In message <1370335914-14027-1-git-send-email-hs@denx.de> you wrote:
>>> add possibility to disable gigabit support through
>>> plattform data. Current boards should not be affected
>>> through this patch.
>> ...
>>> +		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.
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] net, cpsw: disable gigabit support through plattform data
  2013-06-04 15:29     ` Mugunthan V N
@ 2013-06-05 10:44       ` Heiko Schocher
  0 siblings, 0 replies; 6+ messages in thread
From: Heiko Schocher @ 2013-06-05 10:44 UTC (permalink / raw)
  To: u-boot

Hello Mugunthan, Tom,

Am 04.06.2013 17:29, schrieb Mugunthan V N:
> On 6/4/2013 8:45 PM, Heiko Schocher wrote:
>> Hello Wolfgang,
>>
>> Am 04.06.2013 17:00, schrieb Wolfgang Denk:
>>> Dear Heiko,
>>>
>>> In message <1370335914-14027-1-git-send-email-hs@denx.de> you wrote:
>>>> add possibility to disable gigabit support through
>>>> plattform data. Current boards should not be affected
>>>> through this patch.
>>> ...
>>>> +		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.
>> 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
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-06-05 10:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-04  8:51 [U-Boot] net, cpsw: disable gigabit support through plattform data Heiko Schocher
2013-06-04 13:58 ` Tom Rini
2013-06-04 15:00 ` Wolfgang Denk
2013-06-04 15:15   ` Heiko Schocher
2013-06-04 15:29     ` Mugunthan V N
2013-06-05 10:44       ` Heiko Schocher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox