netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mv643xx broken on pegasos
@ 2009-01-15  1:22 pacman
  2009-01-15 20:32 ` Martin Michlmayr
  2009-01-19 10:42 ` Lennert Buytenhek
  0 siblings, 2 replies; 8+ messages in thread
From: pacman @ 2009-01-15  1:22 UTC (permalink / raw)
  To: netdev

Based on what I can find in the mailing list archives, I'm the last remaining
Pegasos owner. (Maybe I was always the only one.) I therefore reluctantly
offer myself as the guinea pig to get mv643xx_eth back to normal.

In 2.6.26 it worked. (Detected as eth1, since eth0 is the via-rhine)

In 2.6.27 it was completely broken. It detected the device and said the link
was up, but it was not usable. From tcpdump it appears that incoming packets
are processed correctly, but outgoing packets are delayed and/or mangled.
Occasionally a packet goes through. Workaround: the 2.6.26 version of
mv643xx_eth.c still compiles and works if dropped into 2.6.27/drivers/net.

In 2.6.28, it behaves like 2.6.27 with a bonus bug: the port has moved to
eth2, and eth1 is now a phantom port with MAC address 00:00:00:00:00:00. And
the old 2.6.26 code doesn't compile so the workaround is dead.

To start the investigation, I'm including log excerpts showing what happens
when the driver is first loaded in 3 different kernels. Note this interesting
feature: the first one shows a different MAC address than the others, with an
unregistered OUI instead of bplan's 00:0b:2f, plus the suspicious string
"DEAD"... and this is the driver that works!

2.6.26> MV-643xx 10/100/1000 Ethernet Driver
2.6.26> eth1: port 1 with MAC address 00:2b:2f:de:ad:01
2.6.26> eth1: Scatter Gather Enabled
2.6.26> eth1: TX TCP/IP Checksumming Supported
2.6.26> eth1: RX TCP/UDP Checksum Offload ON
2.6.26> eth1: RX NAPI Enabled
2.6.26> eth1: Using SRAM

2.6.27> MV-643xx 10/100/1000 ethernet driver version 1.3
2.6.27>  : no PHY detected at addr 0
2.6.27> net eth1: port 1 with MAC address 00:0b:2f:6b:27:e2
2.6.27> net eth1: scatter/gather enabled
2.6.27> net eth1: tx checksum offload
2.6.27> net eth1: napi enabled
2.6.27> net eth1: configured with sram

2.6.28> MV-643xx 10/100/1000 ethernet driver version 1.4
2.6.28> mv643xx_eth smi: probed
2.6.28> net eth1: port 0 with MAC address 00:00:00:00:00:00
2.6.28> net eth1: configured with sram
2.6.28> eth%d: 0:07 already attached
2.6.28> net eth2: port 1 with MAC address 00:0b:2f:6b:27:e2
2.6.28> net eth2: configured with sram

-- 
Alan Curry

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

* Re: mv643xx broken on pegasos
  2009-01-15  1:22 mv643xx broken on pegasos pacman
@ 2009-01-15 20:32 ` Martin Michlmayr
  2009-01-19  5:59   ` David Miller
  2009-01-19 10:42 ` Lennert Buytenhek
  1 sibling, 1 reply; 8+ messages in thread
From: Martin Michlmayr @ 2009-01-15 20:32 UTC (permalink / raw)
  To: pacman; +Cc: netdev, buytenh

* pacman@kosh.dhis.org <pacman@kosh.dhis.org> [2009-01-14 20:22]:
> In 2.6.27 it was completely broken.

I just noticed that this bug has also been reported on the Pegasos
forum: http://www.powerdeveloper.org/forums/viewtopic.php?p=11849
The discussion doesn't contain a lot of information, except for this
observation:

"I've been bisecting the problem today and the regression is indeed
with one of Lennert's changes, but I would certainly not have bet on
the innocent looking "mv643xx_eth: use longer DMA bursts" patch (git
commit identifier cd4ccf76bfd2c36d351e68be7e6a597268f98a1a).

With this commit reverted, Gb ethernet is working again with kernel
2.6.27 on Pegasos."

-- 
Martin Michlmayr
http://www.cyrius.com/

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

* Re: mv643xx broken on pegasos
  2009-01-15 20:32 ` Martin Michlmayr
@ 2009-01-19  5:59   ` David Miller
  2009-01-19  9:45     ` Lennert Buytenhek
  0 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2009-01-19  5:59 UTC (permalink / raw)
  To: tbm; +Cc: pacman, netdev, buytenh

From: Martin Michlmayr <tbm@cyrius.com>
Date: Thu, 15 Jan 2009 21:32:14 +0100

> I just noticed that this bug has also been reported on the Pegasos
> forum: http://www.powerdeveloper.org/forums/viewtopic.php?p=11849
> The discussion doesn't contain a lot of information, except for this
> observation:
> 
> "I've been bisecting the problem today and the regression is indeed
> with one of Lennert's changes, but I would certainly not have bet on
> the innocent looking "mv643xx_eth: use longer DMA bursts" patch (git
> commit identifier cd4ccf76bfd2c36d351e68be7e6a597268f98a1a).
> 
> With this commit reverted, Gb ethernet is working again with kernel
> 2.6.27 on Pegasos."

Lennert, please work to resolve this problem.  If you don't
have time, I'm just going to revert that DMA burst change.

Thanks.

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

* Re: mv643xx broken on pegasos
  2009-01-19  5:59   ` David Miller
@ 2009-01-19  9:45     ` Lennert Buytenhek
  2009-01-20  1:16       ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Lennert Buytenhek @ 2009-01-19  9:45 UTC (permalink / raw)
  To: David Miller; +Cc: tbm, pacman, netdev, Matt Sealey, Gabriel Paubert

On Sun, Jan 18, 2009 at 09:59:11PM -0800, David Miller wrote:

> > I just noticed that this bug has also been reported on the Pegasos
> > forum: http://www.powerdeveloper.org/forums/viewtopic.php?p=11849
> > The discussion doesn't contain a lot of information, except for this
> > observation:
> > 
> > "I've been bisecting the problem today and the regression is indeed
> > with one of Lennert's changes, but I would certainly not have bet on
> > the innocent looking "mv643xx_eth: use longer DMA bursts" patch (git
> > commit identifier cd4ccf76bfd2c36d351e68be7e6a597268f98a1a).
> > 
> > With this commit reverted, Gb ethernet is working again with kernel
> > 2.6.27 on Pegasos."
> 
> Lennert, please work to resolve this problem.  If you don't
> have time, I'm just going to revert that DMA burst change.

Hi David,

Reverting indeed seems the right thing to do (commit below), but
even with that patch it's apparently still broken in 2.6.28, I'm
still looking into that.


thanks,
Lennert



>From a8907f45652a3a331b83d8b8b830750a5a82ed23 Mon Sep 17 00:00:00 2001
From: Lennert Buytenhek <buytenh@wantstofly.org>
Date: Mon, 19 Jan 2009 10:33:21 +0100
Subject: [PATCH] Revert "mv643xx_eth: use longer DMA bursts".

This reverts commit cd4ccf76bfd2c36d351e68be7e6a597268f98a1a.

On the Pegasos board, we can't do DMA burst that are longer than
one cache line.  For now, go back to using 32 byte DMA bursts for
all mv643xx_eth platforms -- we can switch the ARM-based platforms
back to doing long 128 byte bursts in the next development cycle.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Reported-by: Alan Curry <pacman@kosh.dhis.org>
Reported-by: Gabriel Paubert <paubert@iram.es>
---
 drivers/net/mv643xx_eth.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 7253a49..e2aa468 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -136,21 +136,23 @@ static char mv643xx_eth_driver_version[] = "1.4";
 /*
  * SDMA configuration register.
  */
+#define RX_BURST_SIZE_4_64BIT		(2 << 1)
 #define RX_BURST_SIZE_16_64BIT		(4 << 1)
 #define BLM_RX_NO_SWAP			(1 << 4)
 #define BLM_TX_NO_SWAP			(1 << 5)
+#define TX_BURST_SIZE_4_64BIT		(2 << 22)
 #define TX_BURST_SIZE_16_64BIT		(4 << 22)
 
 #if defined(__BIG_ENDIAN)
 #define PORT_SDMA_CONFIG_DEFAULT_VALUE		\
-		(RX_BURST_SIZE_16_64BIT	|	\
-		TX_BURST_SIZE_16_64BIT)
+		(RX_BURST_SIZE_4_64BIT	|	\
+		 TX_BURST_SIZE_4_64BIT)
 #elif defined(__LITTLE_ENDIAN)
 #define PORT_SDMA_CONFIG_DEFAULT_VALUE		\
-		(RX_BURST_SIZE_16_64BIT	|	\
-		BLM_RX_NO_SWAP		|	\
-		BLM_TX_NO_SWAP		|	\
-		TX_BURST_SIZE_16_64BIT)
+		(RX_BURST_SIZE_4_64BIT	|	\
+		 BLM_RX_NO_SWAP		|	\
+		 BLM_TX_NO_SWAP		|	\
+		 TX_BURST_SIZE_4_64BIT)
 #else
 #error One of __BIG_ENDIAN or __LITTLE_ENDIAN must be defined
 #endif
-- 
1.5.6.4

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

* Re: mv643xx broken on pegasos
  2009-01-15  1:22 mv643xx broken on pegasos pacman
  2009-01-15 20:32 ` Martin Michlmayr
@ 2009-01-19 10:42 ` Lennert Buytenhek
  2009-01-19 11:18   ` Gabriel Paubert
  2009-01-19 11:18   ` Gabriel Paubert
  1 sibling, 2 replies; 8+ messages in thread
From: Lennert Buytenhek @ 2009-01-19 10:42 UTC (permalink / raw)
  To: pacman; +Cc: netdev, Gabriel Paubert, Matt Sealey

On Wed, Jan 14, 2009 at 08:22:32PM -0500, pacman@kosh.dhis.org wrote:

> In 2.6.28, it behaves like 2.6.27 with a bonus bug: the port has
> moved to eth2, and eth1 is now a phantom port with MAC address
> 00:00:00:00:00:00. And the old 2.6.26 code doesn't compile so the
> workaround is dead.

This is probably because mv643xx_eth now no longer fails registration
of the interface if no valid PHY could be found.  Gabriel Paubert
(CC'ed) had a patch for this that basically amounted to removing the
initialisation for eth1 (called "eth0" in the Pegasos platform code).
He's away for a couple of days but should be back soon.

Also, since the mv643xx_eth phylib conversion, it appears that the
PHY on the Pegasos board fails to initialise properly, and this can
apparently be worked around by turning the Marvell phylib driver off.
Are you seeing this as well?


thanks,
Lennert

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

* Re: mv643xx broken on pegasos
  2009-01-19 10:42 ` Lennert Buytenhek
  2009-01-19 11:18   ` Gabriel Paubert
@ 2009-01-19 11:18   ` Gabriel Paubert
  1 sibling, 0 replies; 8+ messages in thread
From: Gabriel Paubert @ 2009-01-19 11:18 UTC (permalink / raw)
  To: Lennert Buytenhek; +Cc: linuxppc-dev, netdev, pacman

On Mon, Jan 19, 2009 at 11:42:25AM +0100, Lennert Buytenhek wrote:
> On Wed, Jan 14, 2009 at 08:22:32PM -0500, pacman@kosh.dhis.org wrote:
> 
> > In 2.6.28, it behaves like 2.6.27 with a bonus bug: the port has
> > moved to eth2, and eth1 is now a phantom port with MAC address
> > 00:00:00:00:00:00. And the old 2.6.26 code doesn't compile so the
> > workaround is dead.
> 
> This is probably because mv643xx_eth now no longer fails registration
> of the interface if no valid PHY could be found.  Gabriel Paubert
> (CC'ed) had a patch for this that basically amounted to removing the
> initialisation for eth1 (called "eth0" in the Pegasos platform code).
> He's away for a couple of days but should be back soon.

Indeed, I'm back. Maybe I should have posted my patches to a mailing
list, but since I did not kow which one (linuxppc or netdev), I opted 
for none. 

In the end I have booted a Pegasos with the following patch on top of 2.6.29-rc1.
Actually I have slightly amended pegasos_eth.c since my last post on Matt's request
and I'm not going to be close to the machine and reboot it until Janurary 20th but 
it's only a few renames (and at least it builds), but buyer beware (note that the
patches to drivers/net/mv643xx_eth.c have already been submitted separately
by Lennert through netdev):


diff --git a/arch/powerpc/platforms/chrp/pegasos_eth.c b/arch/powerpc/platforms/chrp/pegasos_eth.c
index 130ff72..039fc8e 100644
--- a/arch/powerpc/platforms/chrp/pegasos_eth.c
+++ b/arch/powerpc/platforms/chrp/pegasos_eth.c
@@ -21,8 +21,8 @@
 #define PEGASOS2_SRAM_BASE 			(0xf2000000)
 #define PEGASOS2_SRAM_SIZE			(256*1024)
 
-#define PEGASOS2_SRAM_BASE_ETH0			(PEGASOS2_SRAM_BASE)
-#define PEGASOS2_SRAM_BASE_ETH1			(PEGASOS2_SRAM_BASE_ETH0 + (PEGASOS2_SRAM_SIZE / 2) )
+#define PEGASOS2_SRAM_BASE_ETH_PORT0			(PEGASOS2_SRAM_BASE)
+#define PEGASOS2_SRAM_BASE_ETH_PORT1			(PEGASOS2_SRAM_BASE_ETH_PORT0 + (PEGASOS2_SRAM_SIZE / 2) )
 
 
 #define PEGASOS2_SRAM_RXRING_SIZE		(PEGASOS2_SRAM_SIZE/4)
@@ -47,75 +47,42 @@ static struct platform_device mv643xx_eth_shared_device = {
 	.resource	= mv643xx_eth_shared_resources,
 };
 
-static struct resource mv643xx_eth0_resources[] = {
+static struct resource mv643xx_eth_port1_resources[] = {
 	[0] = {
-		.name	= "eth0 irq",
+		.name	= "eth port1 irq",
 		.start	= 9,
 		.end	= 9,
 		.flags	= IORESOURCE_IRQ,
 	},
 };
 
-
-static struct mv643xx_eth_platform_data eth0_pd = {
-	.shared		= &mv643xx_eth_shared_device,
-	.port_number	= 0,
-
-	.tx_sram_addr = PEGASOS2_SRAM_BASE_ETH0,
-	.tx_sram_size = PEGASOS2_SRAM_TXRING_SIZE,
-	.tx_queue_size = PEGASOS2_SRAM_TXRING_SIZE/16,
-
-	.rx_sram_addr = PEGASOS2_SRAM_BASE_ETH0 + PEGASOS2_SRAM_TXRING_SIZE,
-	.rx_sram_size = PEGASOS2_SRAM_RXRING_SIZE,
-	.rx_queue_size = PEGASOS2_SRAM_RXRING_SIZE/16,
-};
-
-static struct platform_device eth0_device = {
-	.name		= MV643XX_ETH_NAME,
-	.id		= 0,
-	.num_resources	= ARRAY_SIZE(mv643xx_eth0_resources),
-	.resource	= mv643xx_eth0_resources,
-	.dev = {
-		.platform_data = &eth0_pd,
-	},
-};
-
-static struct resource mv643xx_eth1_resources[] = {
-	[0] = {
-		.name	= "eth1 irq",
-		.start	= 9,
-		.end	= 9,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct mv643xx_eth_platform_data eth1_pd = {
+static struct mv643xx_eth_platform_data eth_port1_pd = {
 	.shared		= &mv643xx_eth_shared_device,
 	.port_number	= 1,
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(7),
 
-	.tx_sram_addr = PEGASOS2_SRAM_BASE_ETH1,
+	.tx_sram_addr = PEGASOS2_SRAM_BASE_ETH_PORT1,
 	.tx_sram_size = PEGASOS2_SRAM_TXRING_SIZE,
 	.tx_queue_size = PEGASOS2_SRAM_TXRING_SIZE/16,
 
-	.rx_sram_addr = PEGASOS2_SRAM_BASE_ETH1 + PEGASOS2_SRAM_TXRING_SIZE,
+	.rx_sram_addr = PEGASOS2_SRAM_BASE_ETH_PORT1 + PEGASOS2_SRAM_TXRING_SIZE,
 	.rx_sram_size = PEGASOS2_SRAM_RXRING_SIZE,
 	.rx_queue_size = PEGASOS2_SRAM_RXRING_SIZE/16,
 };
 
-static struct platform_device eth1_device = {
+static struct platform_device eth_port1_device = {
 	.name		= MV643XX_ETH_NAME,
 	.id		= 1,
-	.num_resources	= ARRAY_SIZE(mv643xx_eth1_resources),
-	.resource	= mv643xx_eth1_resources,
+	.num_resources	= ARRAY_SIZE(mv643xx_eth_port1_resources),
+	.resource	= mv643xx_eth_port1_resources,
 	.dev = {
-		.platform_data = &eth1_pd,
+		.platform_data = &eth_port1_pd,
 	},
 };
 
 static struct platform_device *mv643xx_eth_pd_devs[] __initdata = {
 	&mv643xx_eth_shared_device,
-	&eth0_device,
-	&eth1_device,
+	&eth_port1_device,
 };
 
 /***********/
@@ -191,15 +158,10 @@ static int __init mv643xx_eth_add_pds(void)
 
 		if ( Enable_SRAM() < 0)
 		{
-			eth0_pd.tx_sram_addr = 0;
-			eth0_pd.tx_sram_size = 0;
-			eth0_pd.rx_sram_addr = 0;
-			eth0_pd.rx_sram_size = 0;
-
-			eth1_pd.tx_sram_addr = 0;
-			eth1_pd.tx_sram_size = 0;
-			eth1_pd.rx_sram_addr = 0;
-			eth1_pd.rx_sram_size = 0;
+			eth_port1_pd.tx_sram_addr = 0;
+			eth_port1_pd.tx_sram_size = 0;
+			eth_port1_pd.rx_sram_addr = 0;
+			eth_port1_pd.rx_sram_size = 0;
 
 #ifdef BE_VERBOSE
 			printk("Pegasos II/Marvell MV64361: Can't enable the "
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 7253a49..fc8836d 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -136,15 +136,17 @@ static char mv643xx_eth_driver_version[] = "1.4";
 /*
  * SDMA configuration register.
  */
+#define RX_BURST_SIZE_4_64BIT		(2 << 1)
 #define RX_BURST_SIZE_16_64BIT		(4 << 1)
 #define BLM_RX_NO_SWAP			(1 << 4)
 #define BLM_TX_NO_SWAP			(1 << 5)
+#define TX_BURST_SIZE_4_64BIT		(2 << 22)
 #define TX_BURST_SIZE_16_64BIT		(4 << 22)
 
 #if defined(__BIG_ENDIAN)
 #define PORT_SDMA_CONFIG_DEFAULT_VALUE		\
-		(RX_BURST_SIZE_16_64BIT	|	\
-		TX_BURST_SIZE_16_64BIT)
+		(RX_BURST_SIZE_4_64BIT	|	\
+		TX_BURST_SIZE_4_64BIT)
 #elif defined(__LITTLE_ENDIAN)
 #define PORT_SDMA_CONFIG_DEFAULT_VALUE		\
 		(RX_BURST_SIZE_16_64BIT	|	\
@@ -2210,6 +2212,7 @@ static int mv643xx_eth_stop(struct net_device *dev)
 	struct mv643xx_eth_private *mp = netdev_priv(dev);
 	int i;
 
+	wrlp(mp, INT_MASK_EXT, 0x00000000);
 	wrlp(mp, INT_MASK, 0x00000000);
 	rdlp(mp, INT_MASK);
 


> Also, since the mv643xx_eth phylib conversion, it appears that the
> PHY on the Pegasos board fails to initialise properly, and this can
> apparently be worked around by turning the Marvell phylib driver off.
> Are you seeing this as well?

At least I experienced this problem. On the Pegasos, the generic
PHY driver works, the Marvell specific ones screws up (at least 
when connected to a 100Mb/s hub, it detects it as 1Gb). 


	Gabriel

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

* Re: mv643xx broken on pegasos
  2009-01-19 10:42 ` Lennert Buytenhek
@ 2009-01-19 11:18   ` Gabriel Paubert
  2009-01-19 11:18   ` Gabriel Paubert
  1 sibling, 0 replies; 8+ messages in thread
From: Gabriel Paubert @ 2009-01-19 11:18 UTC (permalink / raw)
  To: Lennert Buytenhek; +Cc: pacman, netdev, Matt Sealey, linuxppc-dev

On Mon, Jan 19, 2009 at 11:42:25AM +0100, Lennert Buytenhek wrote:
> On Wed, Jan 14, 2009 at 08:22:32PM -0500, pacman@kosh.dhis.org wrote:
> 
> > In 2.6.28, it behaves like 2.6.27 with a bonus bug: the port has
> > moved to eth2, and eth1 is now a phantom port with MAC address
> > 00:00:00:00:00:00. And the old 2.6.26 code doesn't compile so the
> > workaround is dead.
> 
> This is probably because mv643xx_eth now no longer fails registration
> of the interface if no valid PHY could be found.  Gabriel Paubert
> (CC'ed) had a patch for this that basically amounted to removing the
> initialisation for eth1 (called "eth0" in the Pegasos platform code).
> He's away for a couple of days but should be back soon.

Indeed, I'm back. Maybe I should have posted my patches to a mailing
list, but since I did not kow which one (linuxppc or netdev), I opted 
for none. 

In the end I have booted a Pegasos with the following patch on top of 2.6.29-rc1.
Actually I have slightly amended pegasos_eth.c since my last post on Matt's request
and I'm not going to be close to the machine and reboot it until Janurary 20th but 
it's only a few renames (and at least it builds), but buyer beware (note that the
patches to drivers/net/mv643xx_eth.c have already been submitted separately
by Lennert through netdev):


diff --git a/arch/powerpc/platforms/chrp/pegasos_eth.c b/arch/powerpc/platforms/chrp/pegasos_eth.c
index 130ff72..039fc8e 100644
--- a/arch/powerpc/platforms/chrp/pegasos_eth.c
+++ b/arch/powerpc/platforms/chrp/pegasos_eth.c
@@ -21,8 +21,8 @@
 #define PEGASOS2_SRAM_BASE 			(0xf2000000)
 #define PEGASOS2_SRAM_SIZE			(256*1024)
 
-#define PEGASOS2_SRAM_BASE_ETH0			(PEGASOS2_SRAM_BASE)
-#define PEGASOS2_SRAM_BASE_ETH1			(PEGASOS2_SRAM_BASE_ETH0 + (PEGASOS2_SRAM_SIZE / 2) )
+#define PEGASOS2_SRAM_BASE_ETH_PORT0			(PEGASOS2_SRAM_BASE)
+#define PEGASOS2_SRAM_BASE_ETH_PORT1			(PEGASOS2_SRAM_BASE_ETH_PORT0 + (PEGASOS2_SRAM_SIZE / 2) )
 
 
 #define PEGASOS2_SRAM_RXRING_SIZE		(PEGASOS2_SRAM_SIZE/4)
@@ -47,75 +47,42 @@ static struct platform_device mv643xx_eth_shared_device = {
 	.resource	= mv643xx_eth_shared_resources,
 };
 
-static struct resource mv643xx_eth0_resources[] = {
+static struct resource mv643xx_eth_port1_resources[] = {
 	[0] = {
-		.name	= "eth0 irq",
+		.name	= "eth port1 irq",
 		.start	= 9,
 		.end	= 9,
 		.flags	= IORESOURCE_IRQ,
 	},
 };
 
-
-static struct mv643xx_eth_platform_data eth0_pd = {
-	.shared		= &mv643xx_eth_shared_device,
-	.port_number	= 0,
-
-	.tx_sram_addr = PEGASOS2_SRAM_BASE_ETH0,
-	.tx_sram_size = PEGASOS2_SRAM_TXRING_SIZE,
-	.tx_queue_size = PEGASOS2_SRAM_TXRING_SIZE/16,
-
-	.rx_sram_addr = PEGASOS2_SRAM_BASE_ETH0 + PEGASOS2_SRAM_TXRING_SIZE,
-	.rx_sram_size = PEGASOS2_SRAM_RXRING_SIZE,
-	.rx_queue_size = PEGASOS2_SRAM_RXRING_SIZE/16,
-};
-
-static struct platform_device eth0_device = {
-	.name		= MV643XX_ETH_NAME,
-	.id		= 0,
-	.num_resources	= ARRAY_SIZE(mv643xx_eth0_resources),
-	.resource	= mv643xx_eth0_resources,
-	.dev = {
-		.platform_data = &eth0_pd,
-	},
-};
-
-static struct resource mv643xx_eth1_resources[] = {
-	[0] = {
-		.name	= "eth1 irq",
-		.start	= 9,
-		.end	= 9,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct mv643xx_eth_platform_data eth1_pd = {
+static struct mv643xx_eth_platform_data eth_port1_pd = {
 	.shared		= &mv643xx_eth_shared_device,
 	.port_number	= 1,
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(7),
 
-	.tx_sram_addr = PEGASOS2_SRAM_BASE_ETH1,
+	.tx_sram_addr = PEGASOS2_SRAM_BASE_ETH_PORT1,
 	.tx_sram_size = PEGASOS2_SRAM_TXRING_SIZE,
 	.tx_queue_size = PEGASOS2_SRAM_TXRING_SIZE/16,
 
-	.rx_sram_addr = PEGASOS2_SRAM_BASE_ETH1 + PEGASOS2_SRAM_TXRING_SIZE,
+	.rx_sram_addr = PEGASOS2_SRAM_BASE_ETH_PORT1 + PEGASOS2_SRAM_TXRING_SIZE,
 	.rx_sram_size = PEGASOS2_SRAM_RXRING_SIZE,
 	.rx_queue_size = PEGASOS2_SRAM_RXRING_SIZE/16,
 };
 
-static struct platform_device eth1_device = {
+static struct platform_device eth_port1_device = {
 	.name		= MV643XX_ETH_NAME,
 	.id		= 1,
-	.num_resources	= ARRAY_SIZE(mv643xx_eth1_resources),
-	.resource	= mv643xx_eth1_resources,
+	.num_resources	= ARRAY_SIZE(mv643xx_eth_port1_resources),
+	.resource	= mv643xx_eth_port1_resources,
 	.dev = {
-		.platform_data = &eth1_pd,
+		.platform_data = &eth_port1_pd,
 	},
 };
 
 static struct platform_device *mv643xx_eth_pd_devs[] __initdata = {
 	&mv643xx_eth_shared_device,
-	&eth0_device,
-	&eth1_device,
+	&eth_port1_device,
 };
 
 /***********/
@@ -191,15 +158,10 @@ static int __init mv643xx_eth_add_pds(void)
 
 		if ( Enable_SRAM() < 0)
 		{
-			eth0_pd.tx_sram_addr = 0;
-			eth0_pd.tx_sram_size = 0;
-			eth0_pd.rx_sram_addr = 0;
-			eth0_pd.rx_sram_size = 0;
-
-			eth1_pd.tx_sram_addr = 0;
-			eth1_pd.tx_sram_size = 0;
-			eth1_pd.rx_sram_addr = 0;
-			eth1_pd.rx_sram_size = 0;
+			eth_port1_pd.tx_sram_addr = 0;
+			eth_port1_pd.tx_sram_size = 0;
+			eth_port1_pd.rx_sram_addr = 0;
+			eth_port1_pd.rx_sram_size = 0;
 
 #ifdef BE_VERBOSE
 			printk("Pegasos II/Marvell MV64361: Can't enable the "
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 7253a49..fc8836d 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -136,15 +136,17 @@ static char mv643xx_eth_driver_version[] = "1.4";
 /*
  * SDMA configuration register.
  */
+#define RX_BURST_SIZE_4_64BIT		(2 << 1)
 #define RX_BURST_SIZE_16_64BIT		(4 << 1)
 #define BLM_RX_NO_SWAP			(1 << 4)
 #define BLM_TX_NO_SWAP			(1 << 5)
+#define TX_BURST_SIZE_4_64BIT		(2 << 22)
 #define TX_BURST_SIZE_16_64BIT		(4 << 22)
 
 #if defined(__BIG_ENDIAN)
 #define PORT_SDMA_CONFIG_DEFAULT_VALUE		\
-		(RX_BURST_SIZE_16_64BIT	|	\
-		TX_BURST_SIZE_16_64BIT)
+		(RX_BURST_SIZE_4_64BIT	|	\
+		TX_BURST_SIZE_4_64BIT)
 #elif defined(__LITTLE_ENDIAN)
 #define PORT_SDMA_CONFIG_DEFAULT_VALUE		\
 		(RX_BURST_SIZE_16_64BIT	|	\
@@ -2210,6 +2212,7 @@ static int mv643xx_eth_stop(struct net_device *dev)
 	struct mv643xx_eth_private *mp = netdev_priv(dev);
 	int i;
 
+	wrlp(mp, INT_MASK_EXT, 0x00000000);
 	wrlp(mp, INT_MASK, 0x00000000);
 	rdlp(mp, INT_MASK);
 


> Also, since the mv643xx_eth phylib conversion, it appears that the
> PHY on the Pegasos board fails to initialise properly, and this can
> apparently be worked around by turning the Marvell phylib driver off.
> Are you seeing this as well?

At least I experienced this problem. On the Pegasos, the generic
PHY driver works, the Marvell specific ones screws up (at least 
when connected to a 100Mb/s hub, it detects it as 1Gb). 


	Gabriel

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

* Re: mv643xx broken on pegasos
  2009-01-19  9:45     ` Lennert Buytenhek
@ 2009-01-20  1:16       ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2009-01-20  1:16 UTC (permalink / raw)
  To: buytenh; +Cc: tbm, pacman, netdev, matt, paubert

From: Lennert Buytenhek <buytenh@wantstofly.org>
Date: Mon, 19 Jan 2009 10:45:23 +0100

> Revert "mv643xx_eth: use longer DMA bursts".
> 
> This reverts commit cd4ccf76bfd2c36d351e68be7e6a597268f98a1a.
> 
> On the Pegasos board, we can't do DMA burst that are longer than
> one cache line.  For now, go back to using 32 byte DMA bursts for
> all mv643xx_eth platforms -- we can switch the ARM-based platforms
> back to doing long 128 byte bursts in the next development cycle.
> 
> Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
> Reported-by: Alan Curry <pacman@kosh.dhis.org>
> Reported-by: Gabriel Paubert <paubert@iram.es>

Applied, thanks everyone.

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

end of thread, other threads:[~2009-01-20  1:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-15  1:22 mv643xx broken on pegasos pacman
2009-01-15 20:32 ` Martin Michlmayr
2009-01-19  5:59   ` David Miller
2009-01-19  9:45     ` Lennert Buytenhek
2009-01-20  1:16       ` David Miller
2009-01-19 10:42 ` Lennert Buytenhek
2009-01-19 11:18   ` Gabriel Paubert
2009-01-19 11:18   ` Gabriel Paubert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).