public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: hugang <hugang@soulinfo.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org, andrea@suse.de, jamagallon@able.es,
	marcelo@hera.kernel.org
Subject: Re: [patch]back ports ICH3M support into 2.4.20
Date: Wed, 4 Dec 2002 21:09:41 +0800	[thread overview]
Message-ID: <20021204210941.47b4db08.hugang@soulinfo.com> (raw)
In-Reply-To: <1038765805.30381.3.camel@irongate.swansea.linux.org.uk>


[-- Attachment #1.1: Type: text/plain, Size: 1975 bytes --]

On 01 Dec 2002 18:03:25 +0000
Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:

> On Sun, 2002-12-01 at 05:04, hugang wrote:
> > hello 
> >   Here is a back port patch for Intel ICH3M IDE 
> 
> 2.4.20 already has the correct version of the fixes for partially
> configured IDE devices. The code you are posting is old and in several
> places wrong, hence it was removed.
> 
> 2.4.20 will try and do a full pci device setup, then fall back to just
> configuring BAR4.
> 
> Alan
> 
Here is an new patch for it. But I'm not true that , Place the fixup function in pci_init_piix is good way. But it works.
Here is it.
Index: 2.4/drivers/ide/piix.c
diff -u 2.4/drivers/ide/piix.c:1.1.1.4 2.4/drivers/ide/piix.c:1.1.1.4.8.3
--- 2.4/drivers/ide/piix.c:1.1.1.4	Fri Nov 29 13:57:34 2002
+++ 2.4/drivers/ide/piix.c	Wed Dec  4 21:05:27 2002
@@ -480,6 +480,30 @@
 }
 #endif /* defined(CONFIG_BLK_DEV_IDEDMA) && (CONFIG_PIIX_TUNING) */
 
+inline void ide_register_xp_fix(struct pci_dev *dev)
+{
+	int i;
+	unsigned short cmd;
+	unsigned long flags;
+	unsigned long base_address[4] = { 0x1f0, 0x3f4, 0x170, 0x374 };
+  
+	printk(KERN_INFO "PIIX: fixup IDE controller\n");
+	local_irq_save(flags);
+	pci_read_config_word(dev, PCI_COMMAND, &cmd);
+	write_config_word(dev, PCI_COMMAND, cmd & ~PCI_COMMAND_IO);
+
+	for (i=0; i<4; i++) {
+		dev->resource[i].start = base_address[i];
+		dev->resource[i].flags |= PCI_BASE_ADDRESS_SPACE_IO;
+		pci_write_config_dword(dev,
+				       (PCI_BASE_ADDRESS_0 + (i * 4)),
+				       dev->resource[i].start);
+	}
+
+	pci_write_config_word(dev, PCI_COMMAND, cmd);
+	local_irq_restore(flags);
+}
+
 unsigned int __init pci_init_piix (struct pci_dev *dev, const char *name)
 {
 #if defined(DISPLAY_PIIX_TIMINGS) && defined(CONFIG_PROC_FS)
@@ -489,6 +513,9 @@
 		piix_display_info = &piix_get_info;
 	}
 #endif /* DISPLAY_PIIX_TIMINGS && CONFIG_PROC_FS */
+	if (dev->resource[0].start != 0x01f1)
+		ide_register_xp_fix(dev);
+
 	return 0;
 }
 


-- 
		- Hu Gang

[-- Attachment #1.2: tune.gz --]
[-- Type: application/octet-stream, Size: 699 bytes --]

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2002-12-04 13:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-01  5:04 [patch]back ports ICH3M support into 2.4.20 hugang
2002-12-01 18:03 ` Alan Cox
2002-12-04 13:09   ` hugang [this message]
2002-12-04 14:36     ` Alan Cox

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=20021204210941.47b4db08.hugang@soulinfo.com \
    --to=hugang@soulinfo.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=andrea@suse.de \
    --cc=jamagallon@able.es \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@hera.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox