All of lore.kernel.org
 help / color / mirror / Atom feed
From: alek du <alek.du@intel.com>
To: <linux-kernel@vger.kernel.org>
Cc: jgarzik@pobox.com
Subject: [PATCH 3/3] ata: Add Intel SCH PATA support
Date: Tue, 22 Apr 2008 10:09:01 +0800	[thread overview]
Message-ID: <20080422100901.2d9a3d1e@dxy.sh.intel.com> (raw)

This patch adds Intel SCH chipsets (US15W, US15L, UL11L) PATA controller
support.

Signed-off-by: Alek Du <alek.du@intel.com>
---
 drivers/ata/ata_piix.c |   40 ++++++++++++++++++++++++++++++++++++++--
 drivers/ide/pci/piix.c |    2 ++
 2 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index b7c38ee..7f95a9a 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -214,6 +214,8 @@ static const struct pci_device_id piix_pci_tbl[] = {
 	/* ICH7/7-R (i945, i975) UDMA 100*/
 	{ 0x8086, 0x27DF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 },
 	{ 0x8086, 0x269E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 },
+	/* INTEL SCH UDMA 100 */
+	{ 0x8086, 0x811A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 },
 	/* ICH8 Mobile PATA Controller */
 	{ 0x8086, 0x2850, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 },
 
@@ -561,6 +563,10 @@ struct ich_laptop {
 	u16 subdevice;
 };
 
+struct sch_80 {
+	u16 device;
+};
+
 /*
  *	List of laptops that use short cables rather than 80 wire
  */
@@ -577,6 +583,17 @@ static const struct ich_laptop ich_laptop[] = {
 	{ 0, }
 };
 
+/*
+ *	List of chipsets whose port IOCFG and enable bit registers are reserved
+ */
+
+static const struct sch_80 sch_80[] = {
+	/* devid */
+	{ 0x811A },	/* Intel SCH chipset */
+	/* end marker */
+	{ 0, }
+};
+
 /**
  *	ich_pata_cable_detect - Probe host controller cable detect info
  *	@ap: Port for which cable detect info is desired
@@ -592,6 +609,7 @@ static int ich_pata_cable_detect(struct ata_port *ap)
 {
 	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
 	const struct ich_laptop *lap = &ich_laptop[0];
+	const struct sch_80 *sch = &sch_80[0];
 	u8 tmp, mask;
 
 	/* Check for specials - Acer Aspire 5602WLMi */
@@ -604,6 +622,13 @@ static int ich_pata_cable_detect(struct ata_port *ap)
 		lap++;
 	}
 
+	/* Check for specials - Intel SCH chipset */
+	while (sch->device) {
+		if (sch->device == pdev->device)
+			return ATA_CBL_PATA80;
+		sch++;
+	}
+
 	/* check BIOS cable detect results */
 	mask = ap->port_no == 0 ? PIIX_80C_PRI : PIIX_80C_SEC;
 	pci_read_config_byte(pdev, PIIX_IOCFG, &tmp);
@@ -624,9 +649,20 @@ static int piix_pata_prereset(struct ata_link *link, unsigned long deadline)
 {
 	struct ata_port *ap = link->ap;
 	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
+	const struct sch_80 *sch = &sch_80[0];
+	int skip_check = 0;
 
-	if (!pci_test_config_bits(pdev, &piix_enable_bits[ap->port_no]))
-		return -ENOENT;
+	/* Check for specials - Intel SCH chipset */
+	while (sch->device) {
+		if (sch->device == pdev->device) {
+			skip_check = 1;
+			break;
+		}
+		sch++;
+	}
+	if (!skip_check)
+		if (!pci_test_config_bits(pdev, &piix_enable_bits[ap->port_no]))
+			return -ENOENT;
 	return ata_sff_prereset(link, deadline);
 }
 
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c
index decef0f..dce830b 100644
--- a/drivers/ide/pci/piix.c
+++ b/drivers/ide/pci/piix.c
@@ -377,6 +377,7 @@ static const struct ide_port_info piix_pci_info[] __devinitdata = {
 	/* 22 */ DECLARE_ICH_DEV("ICH4",	ATA_UDMA5),
 	/* 23 */ DECLARE_ICH_DEV("ESB2",	ATA_UDMA5),
 	/* 24 */ DECLARE_ICH_DEV("ICH8M",	ATA_UDMA5),
+	/* 25 */ DECLARE_ICH_DEV("SCH",		ATA_UDMA5),
 };
 
 /**
@@ -450,6 +451,7 @@ static const struct pci_device_id piix_pci_tbl[] = {
 	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82801DB_1),  22 },
 	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ESB2_18),    23 },
 	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ICH8_6),     24 },
+	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_SCH_IDE),	25 },
 	{ 0, },
 };
 MODULE_DEVICE_TABLE(pci, piix_pci_tbl);
-- 
1.5.2.5

                 reply	other threads:[~2008-04-22  2:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20080422100901.2d9a3d1e@dxy.sh.intel.com \
    --to=alek.du@intel.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@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.