* [IDE-PATCH] Add piix fix up function into pii.c
@ 2002-12-04 13:10 hugang
2002-12-04 14:35 ` Alan Cox
0 siblings, 1 reply; 2+ messages in thread
From: hugang @ 2002-12-04 13:10 UTC (permalink / raw)
To: Linux Kernel Mailing List
[-- Attachment #1.1: Type: text/plain, Size: 1157 bytes --]
Hello all:
Please apply.
Index: drivers/ide//pci/piix.c
===================================================================
RCS file: /home/hugang/local/cvs/2.4/drivers/ide/pci/piix.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 piix.c
--- drivers/ide//pci/piix.c 28 Nov 2002 06:41:20 -0000 1.1.1.2
+++ drivers/ide//pci/piix.c 4 Dec 2002 13:02:36 -0000
@@ -652,6 +652,27 @@
static void __init init_setup_piix (struct pci_dev *dev, ide_pci_device_t *d)
{
+ 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);
+ pci_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);
+
ide_setup_pci_device(dev, d);
}
--
- Hu Gang
[-- Attachment #1.2: 2.5.gz --]
[-- Type: application/octet-stream, Size: 569 bytes --]
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [IDE-PATCH] Add piix fix up function into pii.c
2002-12-04 13:10 [IDE-PATCH] Add piix fix up function into pii.c hugang
@ 2002-12-04 14:35 ` Alan Cox
0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2002-12-04 14:35 UTC (permalink / raw)
To: hugang; +Cc: Linux Kernel Mailing List
On Wed, 2002-12-04 at 13:10, hugang wrote:
> Hello all:
>
> Please apply.
> Index: drivers/ide//pci/piix.c
Please tell me why it would be needed ?
pci_enable_device already ensures the resources are allocated. Also on a
PIIX you only need BAR4 as the other bits are on the ISA side.
Alan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-12-04 13:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-04 13:10 [IDE-PATCH] Add piix fix up function into pii.c hugang
2002-12-04 14:35 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®