2005-11-23 18:03:09

by Daniel Yeisley

[permalink] [raw]
Subject: [PATCH] 2.6.14.2 Support for 1K I/O space granularity on the Intel P64H2

The Intel P64H2 PCI bridge has the ability to allocate I/O space with
1KB granularity. I've written a patch against 2.6.14.2 to take
advantage of this option. I've tested it on the latest Unisys
ES7000-600.

Any comments?

--Dan



diff -Naur linux-2.6.14.2/drivers/pci/probe.c
linux-2.6.14.2-en1k/drivers/pci/probe.c
--- linux-2.6.14.2/drivers/pci/probe.c 2005-11-11 00:33:12.000000000
-0500
+++ linux-2.6.14.2-en1k/drivers/pci/probe.c 2005-11-21
08:52:01.000000000 -0500
@@ -251,8 +251,8 @@
res = child->resource[0];
pci_read_config_byte(dev, PCI_IO_BASE, &io_base_lo);
pci_read_config_byte(dev, PCI_IO_LIMIT, &io_limit_lo);
- base = (io_base_lo & PCI_IO_RANGE_MASK) << 8;
- limit = (io_limit_lo & PCI_IO_RANGE_MASK) << 8;
+ base = (io_base_lo & (PCI_IO_RANGE_MASK | 0x0c) ) << 8;
+ limit = (io_limit_lo & (PCI_IO_RANGE_MASK | 0x0c) ) << 8;

if ((io_base_lo & PCI_IO_RANGE_TYPE_MASK) ==
PCI_IO_RANGE_TYPE_32) {
u16 io_base_hi, io_limit_hi;
@@ -266,6 +266,19 @@
res->flags = (io_base_lo & PCI_IO_RANGE_TYPE_MASK) |
IORESOURCE_IO;
res->start = base;
res->end = limit + 0xfff;
+
+ /*
+ ** See if the 1k granularity option is enabled on the
Intel P64H2
+ */
+ if (dev->vendor == PCI_VENDOR_ID_INTEL && dev->device
== 0x1460) {
+ u16 en1k;
+ pci_read_config_word(dev, 0x40, &en1k);
+
+ if(en1k & 0x200) {
+ res->end = limit + 0x3ff;
+ printk(KERN_INFO "PCI: Enable I/O Space
to 1 KB Granularity\n");
+ }
+ }
}

res = child->resource[1];


2005-11-23 18:21:10

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] 2.6.14.2 Support for 1K I/O space granularity on the Intel P64H2

On Wed, Nov 23, 2005 at 01:02:52PM -0500, Yeisley, Dan P. wrote:
> The Intel P64H2 PCI bridge has the ability to allocate I/O space with
> 1KB granularity. I've written a patch against 2.6.14.2 to take
> advantage of this option. I've tested it on the latest Unisys
> ES7000-600.

Shouldn't this be made into a pci quirk somehow?

> linux-2.6.14.2-en1k/drivers/pci/probe.c
> --- linux-2.6.14.2/drivers/pci/probe.c 2005-11-11 00:33:12.000000000
> -0500

Your patch is linewrapped and can't be applied :(

thanks,

greg k-h

2005-11-23 18:57:42

by Daniel Yeisley

[permalink] [raw]
Subject: RE: [PATCH] 2.6.14.2 Support for 1K I/O space granularity on the Intel P64H2

The problem with implementing this with a quirk is this line:
res->end = limit + 0xfff;

That hard coded value of 0xfff is the problem. I suppose I could make
it a variable and initialize it to 0xfff and then set it to 0x3ff in the
quirk.

I'll take a look at doing it that way (and try to fix my line wrap
problem).

Thanks,
Dan


-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Wednesday, November 23, 2005 13:18
To: Yeisley, Dan P.
Cc: [email protected]
Subject: Re: [PATCH] 2.6.14.2 Support for 1K I/O space granularity on
the Intel P64H2

On Wed, Nov 23, 2005 at 01:02:52PM -0500, Yeisley, Dan P. wrote:
> The Intel P64H2 PCI bridge has the ability to allocate I/O space with
> 1KB granularity. I've written a patch against 2.6.14.2 to take
> advantage of this option. I've tested it on the latest Unisys
> ES7000-600.

Shouldn't this be made into a pci quirk somehow?

> linux-2.6.14.2-en1k/drivers/pci/probe.c
> --- linux-2.6.14.2/drivers/pci/probe.c 2005-11-11
00:33:12.000000000
> -0500

Your patch is linewrapped and can't be applied :(

thanks,

greg k-h