netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] sky2: driver update for 2.6.27
@ 2008-06-17 16:04 Stephen Hemminger
  2008-06-17 16:04 ` [PATCH 1/5] sky2: phy setup changes Stephen Hemminger
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Stephen Hemminger @ 2008-06-17 16:04 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

Add support for new chip type and do some related cleanups.
-- 


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

* [PATCH 1/5] sky2: phy setup changes
  2008-06-17 16:04 [PATCH 0/5] sky2: driver update for 2.6.27 Stephen Hemminger
@ 2008-06-17 16:04 ` Stephen Hemminger
  2008-06-18  3:31   ` Jeff Garzik
  2008-06-17 16:04 ` [PATCH 2/5] sky2: chip version printout Stephen Hemminger
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: Stephen Hemminger @ 2008-06-17 16:04 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

[-- Attachment #1: sky2-phy2.patch --]
[-- Type: text/plain, Size: 1093 bytes --]

Change the setup of the PHY registers on some chip ids. These changes
make the latest sky2 driver follow the vendor driver.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


--- a/drivers/net/sky2.c	2008-06-16 09:38:33.000000000 -0700
+++ b/drivers/net/sky2.c	2008-06-16 09:38:34.000000000 -0700
@@ -659,8 +659,7 @@ static void sky2_phy_init(struct sky2_hw
 		ledover |= PHY_M_LED_MO_RX(MO_LED_OFF);
 	}
 
-	if (hw->chip_id == CHIP_ID_YUKON_EC_U &&
-	    hw->chip_rev == CHIP_REV_YU_EC_U_A1) {
+	if (hw->chip_id == CHIP_ID_YUKON_EC_U) {
 		/* apply fixes in PHY AFE */
 		gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 255);
 
@@ -679,7 +678,8 @@ static void sky2_phy_init(struct sky2_hw
 		/* apply workaround for integrated resistors calibration */
 		gm_phy_write(hw, port, PHY_MARV_PAGE_ADDR, 17);
 		gm_phy_write(hw, port, PHY_MARV_PAGE_DATA, 0x3f60);
-	} else if (hw->chip_id != CHIP_ID_YUKON_EX) {
+	} else if (hw->chip_id != CHIP_ID_YUKON_EX &&
+		   hw->chip_id < CHIP_ID_YUKON_SUPR) {
 		/* no effect on Yukon-XL */
 		gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl);
 

-- 


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

* [PATCH 2/5] sky2: chip version printout
  2008-06-17 16:04 [PATCH 0/5] sky2: driver update for 2.6.27 Stephen Hemminger
  2008-06-17 16:04 ` [PATCH 1/5] sky2: phy setup changes Stephen Hemminger
@ 2008-06-17 16:04 ` Stephen Hemminger
  2008-06-17 16:04 ` [PATCH 3/5] sky2: use DEFINE_PCI_DEVICE_TABLE Stephen Hemminger
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Stephen Hemminger @ 2008-06-17 16:04 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

[-- Attachment #1: sky2-chip-name.patch --]
[-- Type: text/plain, Size: 2250 bytes --]

Change how chip version is printed so that if an unknown version is detected
nothing breaks.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/drivers/net/sky2.c	2008-06-16 09:38:34.000000000 -0700
+++ b/drivers/net/sky2.c	2008-06-16 09:47:41.000000000 -0700
@@ -147,17 +147,6 @@ static const unsigned txqaddr[] = { Q_XA
 static const unsigned rxqaddr[] = { Q_R1, Q_R2 };
 static const u32 portirq_msk[] = { Y2_IS_PORT_1, Y2_IS_PORT_2 };
 
-/* This driver supports yukon2 chipset only */
-static const char *yukon2_name[] = {
-	"XL",		/* 0xb3 */
-	"EC Ultra", 	/* 0xb4 */
-	"Extreme",	/* 0xb5 */
-	"EC",		/* 0xb6 */
-	"FE",		/* 0xb7 */
-	"FE+",		/* 0xb8 */
-	"Supreme",	/* 0xb9 */
-};
-
 static void sky2_set_multicast(struct net_device *dev);
 
 /* Access to PHY via serial interconnect */
@@ -4266,12 +4255,33 @@ static int __devinit pci_wake_enabled(st
 	return value & PCI_PM_CTRL_PME_ENABLE;
 }
 
+/* This driver supports yukon2 chipset only */
+static const char *sky2_name(u8 chipid, char *buf, int sz)
+{
+	const char *name[] = {
+		"XL",		/* 0xb3 */
+		"EC Ultra", 	/* 0xb4 */
+		"Extreme",	/* 0xb5 */
+		"EC",		/* 0xb6 */
+		"FE",		/* 0xb7 */
+		"FE+",		/* 0xb8 */
+		"Supreme",	/* 0xb9 */
+	};
+
+	if (chipid >= CHIP_ID_YUKON_XL && chipid < CHIP_ID_YUKON_SUPR)
+		strncpy(buf, name[chipid - CHIP_ID_YUKON_XL], sz);
+	else
+		snprintf(buf, sz, "(chip %#x)", chipid);
+	return buf;
+}
+
 static int __devinit sky2_probe(struct pci_dev *pdev,
 				const struct pci_device_id *ent)
 {
 	struct net_device *dev;
 	struct sky2_hw *hw;
 	int err, using_dac = 0, wol_default;
+	char buf1[16];
 
 	err = pci_enable_device(pdev);
 	if (err) {
@@ -4342,10 +4352,10 @@ static int __devinit sky2_probe(struct p
 	if (err)
 		goto err_out_iounmap;
 
-	dev_info(&pdev->dev, "v%s addr 0x%llx irq %d Yukon-%s (0x%x) rev %d\n",
-	       DRV_VERSION, (unsigned long long)pci_resource_start(pdev, 0),
-	       pdev->irq, yukon2_name[hw->chip_id - CHIP_ID_YUKON_XL],
-	       hw->chip_id, hw->chip_rev);
+	dev_info(&pdev->dev, "v%s addr 0x%llx irq %d Yukon-2 %s rev %d\n",
+		 DRV_VERSION, (unsigned long long)pci_resource_start(pdev, 0),
+		 pdev->irq, sky2_name(hw->chip_id, buf1, sizeof(buf1)),
+		 hw->chip_rev);
 
 	sky2_reset(hw);
 

-- 


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

* [PATCH 3/5] sky2: use DEFINE_PCI_DEVICE_TABLE
  2008-06-17 16:04 [PATCH 0/5] sky2: driver update for 2.6.27 Stephen Hemminger
  2008-06-17 16:04 ` [PATCH 1/5] sky2: phy setup changes Stephen Hemminger
  2008-06-17 16:04 ` [PATCH 2/5] sky2: chip version printout Stephen Hemminger
@ 2008-06-17 16:04 ` Stephen Hemminger
  2008-06-17 16:04 ` [PATCH 4/5] sky2: 88E8057 chip support Stephen Hemminger
  2008-06-17 16:04 ` [PATCH 5/5] sky2: version 1.22 Stephen Hemminger
  4 siblings, 0 replies; 7+ messages in thread
From: Stephen Hemminger @ 2008-06-17 16:04 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

[-- Attachment #1: sky2-pci-table.patch --]
[-- Type: text/plain, Size: 711 bytes --]

PCI device table can be marked as devinitconst by using macro.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


--- a/drivers/net/sky2.c	2008-06-16 09:38:35.000000000 -0700
+++ b/drivers/net/sky2.c	2008-06-16 09:38:35.000000000 -0700
@@ -98,7 +98,7 @@ static int disable_msi = 0;
 module_param(disable_msi, int, 0);
 MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)");
 
-static const struct pci_device_id sky2_id_table[] = {
+static DEFINE_PCI_DEVICE_TABLE(sky2_id_table) = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, /* SK-9Sxx */
 	{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, /* SK-9Exx */
 	{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b00) },	/* DGE-560T */

-- 


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

* [PATCH 4/5] sky2: 88E8057 chip support
  2008-06-17 16:04 [PATCH 0/5] sky2: driver update for 2.6.27 Stephen Hemminger
                   ` (2 preceding siblings ...)
  2008-06-17 16:04 ` [PATCH 3/5] sky2: use DEFINE_PCI_DEVICE_TABLE Stephen Hemminger
@ 2008-06-17 16:04 ` Stephen Hemminger
  2008-06-17 16:04 ` [PATCH 5/5] sky2: version 1.22 Stephen Hemminger
  4 siblings, 0 replies; 7+ messages in thread
From: Stephen Hemminger @ 2008-06-17 16:04 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

[-- Attachment #1: sky2-ul2-chip.patch --]
[-- Type: text/plain, Size: 2874 bytes --]

Add support for Yukon 2 Ultra 2 chip set (88E8057) based on code in latest
version of vendor driver (sk98lin 10.60.2.3).  Untested on real hardware.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


--- a/drivers/net/sky2.c	2008-06-17 09:03:55.000000000 -0700
+++ b/drivers/net/sky2.c	2008-06-17 09:03:56.000000000 -0700
@@ -136,6 +136,7 @@ static DEFINE_PCI_DEVICE_TABLE(sky2_id_t
 	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436C) }, /* 88E8072 */
 	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436D) }, /* 88E8055 */
 	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4370) }, /* 88E8075 */
+	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4380) }, /* 88E8057 */
 	{ 0 }
 };
 
@@ -647,7 +648,7 @@ static void sky2_phy_init(struct sky2_hw
 		ledover |= PHY_M_LED_MO_RX(MO_LED_OFF);
 	}
 
-	if (hw->chip_id == CHIP_ID_YUKON_EC_U) {
+	if (hw->chip_id == CHIP_ID_YUKON_EC_U || hw->chip_id == CHIP_ID_YUKON_UL_2) {
 		/* apply fixes in PHY AFE */
 		gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 255);
 
@@ -655,9 +656,11 @@ static void sky2_phy_init(struct sky2_hw
 		gm_phy_write(hw, port, 0x18, 0xaa99);
 		gm_phy_write(hw, port, 0x17, 0x2011);
 
-		/* fix for IEEE A/B Symmetry failure in 1000BASE-T */
-		gm_phy_write(hw, port, 0x18, 0xa204);
-		gm_phy_write(hw, port, 0x17, 0x2002);
+		if (hw->chip_id == CHIP_ID_YUKON_EC_U) {
+			/* fix for IEEE A/B Symmetry failure in 1000BASE-T */
+			gm_phy_write(hw, port, 0x18, 0xa204);
+			gm_phy_write(hw, port, 0x17, 0x2002);
+		}
 
 		/* set page register to 0 */
 		gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 0);
@@ -2807,6 +2810,7 @@ static u32 sky2_mhz(const struct sky2_hw
 	case CHIP_ID_YUKON_EC_U:
 	case CHIP_ID_YUKON_EX:
 	case CHIP_ID_YUKON_SUPR:
+	case CHIP_ID_YUKON_UL_2:
 		return 125;
 
 	case CHIP_ID_YUKON_FE:
@@ -2899,6 +2903,11 @@ static int __devinit sky2_init(struct sk
 			| SKY2_HW_ADV_POWER_CTL;
 		break;
 
+	case CHIP_ID_YUKON_UL_2:
+		hw->flags = SKY2_HW_GIGABIT
+			| SKY2_HW_ADV_POWER_CTL;
+		break;
+
 	default:
 		dev_err(&hw->pdev->dev, "unsupported chip type 0x%x\n",
 			hw->chip_id);
@@ -4265,9 +4274,10 @@ static const char *sky2_name(u8 chipid, 
 		"FE",		/* 0xb7 */
 		"FE+",		/* 0xb8 */
 		"Supreme",	/* 0xb9 */
+		"UL 2",		/* 0xba */
 	};
 
-	if (chipid >= CHIP_ID_YUKON_XL && chipid < CHIP_ID_YUKON_SUPR)
+	if (chipid >= CHIP_ID_YUKON_XL && chipid < CHIP_ID_YUKON_UL_2)
 		strncpy(buf, name[chipid - CHIP_ID_YUKON_XL], sz);
 	else
 		snprintf(buf, sz, "(chip %#x)", chipid);
--- a/drivers/net/sky2.h	2008-06-17 08:32:26.000000000 -0700
+++ b/drivers/net/sky2.h	2008-06-17 09:03:56.000000000 -0700
@@ -441,6 +441,7 @@ enum {
  	CHIP_ID_YUKON_FE   = 0xb7, /* YUKON-2 FE */
  	CHIP_ID_YUKON_FE_P = 0xb8, /* YUKON-2 FE+ */
 	CHIP_ID_YUKON_SUPR = 0xb9, /* YUKON-2 Supreme */
+	CHIP_ID_YUKON_UL_2 = 0xba, /* YUKON-2 Ultra 2 */
 };
 enum yukon_ec_rev {
 	CHIP_REV_YU_EC_A1    = 0,  /* Chip Rev. for Yukon-EC A1/A0 */

-- 


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

* [PATCH 5/5] sky2: version 1.22
  2008-06-17 16:04 [PATCH 0/5] sky2: driver update for 2.6.27 Stephen Hemminger
                   ` (3 preceding siblings ...)
  2008-06-17 16:04 ` [PATCH 4/5] sky2: 88E8057 chip support Stephen Hemminger
@ 2008-06-17 16:04 ` Stephen Hemminger
  4 siblings, 0 replies; 7+ messages in thread
From: Stephen Hemminger @ 2008-06-17 16:04 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

[-- Attachment #1: sky2-1.22 --]
[-- Type: text/plain, Size: 388 bytes --]

New version to reflect new hardware support

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/drivers/net/sky2.c	2008-06-16 09:38:36.000000000 -0700
+++ b/drivers/net/sky2.c	2008-06-16 09:38:37.000000000 -0700
@@ -51,7 +51,7 @@
 #include "sky2.h"
 
 #define DRV_NAME		"sky2"
-#define DRV_VERSION		"1.21"
+#define DRV_VERSION		"1.22"
 #define PFX			DRV_NAME " "
 
 /*

-- 


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

* Re: [PATCH 1/5] sky2: phy setup changes
  2008-06-17 16:04 ` [PATCH 1/5] sky2: phy setup changes Stephen Hemminger
@ 2008-06-18  3:31   ` Jeff Garzik
  0 siblings, 0 replies; 7+ messages in thread
From: Jeff Garzik @ 2008-06-18  3:31 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

Stephen Hemminger wrote:
> Change the setup of the PHY registers on some chip ids. These changes
> make the latest sky2 driver follow the vendor driver.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

applied 1-5



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

end of thread, other threads:[~2008-06-18  3:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-17 16:04 [PATCH 0/5] sky2: driver update for 2.6.27 Stephen Hemminger
2008-06-17 16:04 ` [PATCH 1/5] sky2: phy setup changes Stephen Hemminger
2008-06-18  3:31   ` Jeff Garzik
2008-06-17 16:04 ` [PATCH 2/5] sky2: chip version printout Stephen Hemminger
2008-06-17 16:04 ` [PATCH 3/5] sky2: use DEFINE_PCI_DEVICE_TABLE Stephen Hemminger
2008-06-17 16:04 ` [PATCH 4/5] sky2: 88E8057 chip support Stephen Hemminger
2008-06-17 16:04 ` [PATCH 5/5] sky2: version 1.22 Stephen Hemminger

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