netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix ethernet driver for Octeon based Movidis hardware
@ 2010-04-02  1:17 David Daney
  2010-04-02  1:17 ` [PATCH 1/2] netdev: phy/mdio-octeon: Enable the hardware before using it David Daney
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: David Daney @ 2010-04-02  1:17 UTC (permalink / raw)
  To: ralf, linux-mips, netdev, gregkh; +Cc: davem, David Daney

The Movidis X16 bootloader doesn't enable the mdio bus.  The first
patch fixes this by enabling the mdio bus when the driver is
initialized.

Also the addresses of the PHYs was unknown for this device.  The
second patch adds the corresponding PHY addresses.

With both patches applied I can successfully use all eight Ethernet
ports.

Please consider for 2.6.34.  Since Octeon is an embedded MIPS SOC it
is unlikely to break the kernel for any workstations.  Any or all of
these could be considered for merging via Ralf's linux-mips.org tree.

Thanks,

David Daney (2):
  netdev: phy/mdio-octeon: Enable the hardware before using it.
  staging: octeon-ethernet: Use proper phy addresses for Movidis
    hardware.

 drivers/net/phy/mdio-octeon.c              |   10 ++++++++++
 drivers/staging/octeon/cvmx-helper-board.c |    8 ++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)


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

* [PATCH 1/2] netdev: phy/mdio-octeon: Enable the hardware before using it.
  2010-04-02  1:17 [PATCH 0/2] Fix ethernet driver for Octeon based Movidis hardware David Daney
@ 2010-04-02  1:17 ` David Daney
  2010-04-02  1:17 ` [PATCH 2/2] staging: octeon-ethernet: Use proper phy addresses for Movidis hardware David Daney
  2010-04-02  1:20 ` [PATCH 0/2] Fix ethernet driver for Octeon based " David Miller
  2 siblings, 0 replies; 5+ messages in thread
From: David Daney @ 2010-04-02  1:17 UTC (permalink / raw)
  To: ralf, linux-mips, netdev, gregkh; +Cc: davem, David Daney

In some cases the mdio bus is not enabled at the time of probing.
This prevents anything from working, so we will enable it before
trying to use it, and disable it when the driver is removed.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
---
 drivers/net/phy/mdio-octeon.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/net/phy/mdio-octeon.c b/drivers/net/phy/mdio-octeon.c
index 61a4461..dfaaf30 100644
--- a/drivers/net/phy/mdio-octeon.c
+++ b/drivers/net/phy/mdio-octeon.c
@@ -87,6 +87,7 @@ static int octeon_mdiobus_write(struct mii_bus *bus, int phy_id,
 static int __init octeon_mdiobus_probe(struct platform_device *pdev)
 {
 	struct octeon_mdiobus *bus;
+	union cvmx_smix_en smi_en;
 	int i;
 	int err = -ENOENT;
 
@@ -102,6 +103,10 @@ static int __init octeon_mdiobus_probe(struct platform_device *pdev)
 	if (!bus->mii_bus)
 		goto err;
 
+	smi_en.u64 = 0;
+	smi_en.s.en = 1;
+	cvmx_write_csr(CVMX_SMIX_EN(bus->unit), smi_en.u64);
+
 	/*
 	 * Standard Octeon evaluation boards don't support phy
 	 * interrupts, we need to poll.
@@ -132,17 +137,22 @@ err_register:
 
 err:
 	devm_kfree(&pdev->dev, bus);
+	smi_en.u64 = 0;
+	cvmx_write_csr(CVMX_SMIX_EN(bus->unit), smi_en.u64);
 	return err;
 }
 
 static int __exit octeon_mdiobus_remove(struct platform_device *pdev)
 {
 	struct octeon_mdiobus *bus;
+	union cvmx_smix_en smi_en;
 
 	bus = dev_get_drvdata(&pdev->dev);
 
 	mdiobus_unregister(bus->mii_bus);
 	mdiobus_free(bus->mii_bus);
+	smi_en.u64 = 0;
+	cvmx_write_csr(CVMX_SMIX_EN(bus->unit), smi_en.u64);
 	return 0;
 }
 
-- 
1.6.6.1


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

* [PATCH 2/2] staging: octeon-ethernet: Use proper phy addresses for Movidis hardware.
  2010-04-02  1:17 [PATCH 0/2] Fix ethernet driver for Octeon based Movidis hardware David Daney
  2010-04-02  1:17 ` [PATCH 1/2] netdev: phy/mdio-octeon: Enable the hardware before using it David Daney
@ 2010-04-02  1:17 ` David Daney
  2010-04-02  1:20 ` [PATCH 0/2] Fix ethernet driver for Octeon based " David Miller
  2 siblings, 0 replies; 5+ messages in thread
From: David Daney @ 2010-04-02  1:17 UTC (permalink / raw)
  To: ralf, linux-mips, netdev, gregkh; +Cc: davem, David Daney

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
---
 drivers/staging/octeon/cvmx-helper-board.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/octeon/cvmx-helper-board.c b/drivers/staging/octeon/cvmx-helper-board.c
index 3085e38..00a555b 100644
--- a/drivers/staging/octeon/cvmx-helper-board.c
+++ b/drivers/staging/octeon/cvmx-helper-board.c
@@ -153,6 +153,14 @@ int cvmx_helper_board_get_mii_address(int ipd_port)
 		 * through switch.
 		 */
 		return -1;
+
+	case CVMX_BOARD_TYPE_CUST_WSX16:
+		if (ipd_port >= 0 && ipd_port <= 3)
+			return ipd_port;
+		else if (ipd_port >= 16 && ipd_port <= 19)
+			return ipd_port - 16 + 4;
+		else
+			return -1;
 	}
 
 	/* Some unknown board. Somebody forgot to update this function... */
-- 
1.6.6.1


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

* Re: [PATCH 0/2] Fix ethernet driver for Octeon based Movidis hardware
  2010-04-02  1:17 [PATCH 0/2] Fix ethernet driver for Octeon based Movidis hardware David Daney
  2010-04-02  1:17 ` [PATCH 1/2] netdev: phy/mdio-octeon: Enable the hardware before using it David Daney
  2010-04-02  1:17 ` [PATCH 2/2] staging: octeon-ethernet: Use proper phy addresses for Movidis hardware David Daney
@ 2010-04-02  1:20 ` David Miller
  2010-04-02 17:04   ` Greg KH
  2 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2010-04-02  1:20 UTC (permalink / raw)
  To: ddaney; +Cc: ralf, linux-mips, netdev, gregkh

From: David Daney <ddaney@caviumnetworks.com>
Date: Thu,  1 Apr 2010 18:17:53 -0700

> The Movidis X16 bootloader doesn't enable the mdio bus.  The first
> patch fixes this by enabling the mdio bus when the driver is
> initialized.
> 
> Also the addresses of the PHYs was unknown for this device.  The
> second patch adds the corresponding PHY addresses.
> 
> With both patches applied I can successfully use all eight Ethernet
> ports.
> 
> Please consider for 2.6.34.  Since Octeon is an embedded MIPS SOC it
> is unlikely to break the kernel for any workstations.  Any or all of
> these could be considered for merging via Ralf's linux-mips.org tree.

Ralf please merge this via your MIPS tree, thanks:

Acked-by: David S. Miller <davem@davemloft.net>

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

* Re: [PATCH 0/2] Fix ethernet driver for Octeon based Movidis hardware
  2010-04-02  1:20 ` [PATCH 0/2] Fix ethernet driver for Octeon based " David Miller
@ 2010-04-02 17:04   ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2010-04-02 17:04 UTC (permalink / raw)
  To: David Miller; +Cc: ddaney, ralf, linux-mips, netdev

On Thu, Apr 01, 2010 at 06:20:45PM -0700, David Miller wrote:
> From: David Daney <ddaney@caviumnetworks.com>
> Date: Thu,  1 Apr 2010 18:17:53 -0700
> 
> > The Movidis X16 bootloader doesn't enable the mdio bus.  The first
> > patch fixes this by enabling the mdio bus when the driver is
> > initialized.
> > 
> > Also the addresses of the PHYs was unknown for this device.  The
> > second patch adds the corresponding PHY addresses.
> > 
> > With both patches applied I can successfully use all eight Ethernet
> > ports.
> > 
> > Please consider for 2.6.34.  Since Octeon is an embedded MIPS SOC it
> > is unlikely to break the kernel for any workstations.  Any or all of
> > these could be considered for merging via Ralf's linux-mips.org tree.
> 
> Ralf please merge this via your MIPS tree, thanks:
> 
> Acked-by: David S. Miller <davem@davemloft.net>

I agree, Ralf, please take these and you can add:
	Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
to them.

thanks,

greg k-h

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

end of thread, other threads:[~2010-04-02 17:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-02  1:17 [PATCH 0/2] Fix ethernet driver for Octeon based Movidis hardware David Daney
2010-04-02  1:17 ` [PATCH 1/2] netdev: phy/mdio-octeon: Enable the hardware before using it David Daney
2010-04-02  1:17 ` [PATCH 2/2] staging: octeon-ethernet: Use proper phy addresses for Movidis hardware David Daney
2010-04-02  1:20 ` [PATCH 0/2] Fix ethernet driver for Octeon based " David Miller
2010-04-02 17:04   ` Greg KH

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