All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@vger.kernel.org
Subject: [PATCH 6/7] sky2: enable clocks before probe
Date: Thu, 24 May 2007 15:22:48 -0700	[thread overview]
Message-ID: <20070524222538.812999691@linux-foundation.org> (raw)
In-Reply-To: 20070524222242.555399884@linux-foundation.org

[-- Attachment #1: sky2-ex-power.patch --]
[-- Type: text/plain, Size: 1635 bytes --]

Some chips need to have internal clocks enabled (via PCI config)
before the PCI space is readable.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

---
 drivers/net/sky2.c |  102 ++++++++++++++++++++++++++++++++++++++---------------
 drivers/net/sky2.h |   19 +++++++++
 2 files changed, 92 insertions(+), 29 deletions(-)

--- a/drivers/net/sky2.c	2007-05-24 15:22:14.000000000 -0700
+++ b/drivers/net/sky2.c	2007-05-24 15:22:33.000000000 -0700
@@ -2524,10 +2524,6 @@ static int __devinit sky2_init(struct sk
 		dev_warn(&hw->pdev->dev, "this driver not yet tested on this chip type\n"
 			 "Please report success or failure to <netdev@vger.kernel.org>\n");
 
-	/* Make sure and enable all clocks */
-	if (hw->chip_id == CHIP_ID_YUKON_EX || hw->chip_id == CHIP_ID_YUKON_EC_U)
-		sky2_pci_write32(hw, PCI_DEV_REG3, 0);
-
 	hw->chip_rev = (sky2_read8(hw, B2_MAC_CFG) & CFG_CHIP_R_MSK) >> 4;
 
 	/* This rev is really old, and requires untested workarounds */
@@ -3638,6 +3634,9 @@ static int __devinit sky2_probe(struct p
 	if (!hw->st_le)
 		goto err_out_iounmap;
 
+	/* On Yukon EC-U and EX need to force enabling all clocks */
+	pci_write_config_dword(pdev, PCI_DEV_REG3, 0);
+
 	err = sky2_init(hw);
 	if (err)
 		goto err_out_iounmap;
@@ -3822,8 +3821,7 @@ static int sky2_resume(struct pci_dev *p
 	pci_enable_wake(pdev, PCI_D0, 0);
 
 	/* Re-enable all clocks */
-	if (hw->chip_id == CHIP_ID_YUKON_EX || hw->chip_id == CHIP_ID_YUKON_EC_U)
-		sky2_pci_write32(hw, PCI_DEV_REG3, 0);
+	pci_write_config_dword(pdev, PCI_DEV_REG3, 0);
 
 	sky2_reset(hw);
 

-- 
Stephen Hemminger <shemminger@linux-foundation.org>


  parent reply	other threads:[~2007-05-24 22:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-24 22:22 [PATCH 0/7] sky2: patches for 2.6.22 Stephen Hemminger
2007-05-24 22:22 ` [PATCH 1/7] sky2: dont set bogus bit in PHY register Stephen Hemminger
2007-05-30 13:53   ` Jeff Garzik
2007-05-24 22:22 ` [PATCH 2/7] sky2: checksum offload plus vlan bug Stephen Hemminger
2007-05-24 22:22 ` [PATCH 3/7] sky2: program proper register for fiber PHY Stephen Hemminger
2007-05-24 22:22 ` [PATCH 4/7] sky2: PHY page register fixes Stephen Hemminger
2007-05-30 13:59   ` Jeff Garzik
2007-05-24 22:22 ` [PATCH 5/7] sky2: enable IRQ on duplex renegotiation Stephen Hemminger
2007-05-30 13:54   ` Jeff Garzik
2007-05-24 22:22 ` Stephen Hemminger [this message]
2007-05-30 13:56   ` [PATCH 6/7] sky2: enable clocks before probe Jeff Garzik
2007-05-30 14:43     ` Stephen Hemminger
2007-05-30 17:45     ` Stephen Hemminger
2007-05-24 22:22 ` [PATCH 7/7] sky2: version 1.15 Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070524222538.812999691@linux-foundation.org \
    --to=shemminger@linux-foundation.org \
    --cc=jgarzik@pobox.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.