Add support for resource windows. This is for bridge resources, i.e.,
regions where a bridge forwards transactions from the primary to the
secondary side. This does not add support for *setting* windows via
the /proc interface.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
switch (pnp_resource_type(res)) {
case IORESOURCE_IO:
case IORESOURCE_MEM:
switch (pnp_resource_type(res)) {
case IORESOURCE_IO:
case IORESOURCE_MEM:
- pnp_printf(buffer, " %#llx-%#llx\n",
+ pnp_printf(buffer, " %#llx-%#llx%s\n",
(unsigned long long) res->start,
(unsigned long long) res->start,
- (unsigned long long) res->end);
+ (unsigned long long) res->end,
+ res->flags & IORESOURCE_WINDOW ?
+ " window" : "");
break;
case IORESOURCE_IRQ:
case IORESOURCE_DMA:
break;
case IORESOURCE_IRQ:
case IORESOURCE_DMA:
}
static void pnpacpi_parse_allocated_ioresource(struct pnp_dev *dev, u64 start,
}
static void pnpacpi_parse_allocated_ioresource(struct pnp_dev *dev, u64 start,
- u64 len, int io_decode)
+ u64 len, int io_decode,
+ int window)
{
int flags = 0;
u64 end = start + len - 1;
{
int flags = 0;
u64 end = start + len - 1;
flags |= IORESOURCE_IO_16BIT_ADDR;
if (len == 0 || end >= 0x10003)
flags |= IORESOURCE_DISABLED;
flags |= IORESOURCE_IO_16BIT_ADDR;
if (len == 0 || end >= 0x10003)
flags |= IORESOURCE_DISABLED;
+ if (window)
+ flags |= IORESOURCE_WINDOW;
pnp_add_io_resource(dev, start, end, flags);
}
pnp_add_io_resource(dev, start, end, flags);
}
static void pnpacpi_parse_allocated_memresource(struct pnp_dev *dev,
u64 start, u64 len,
static void pnpacpi_parse_allocated_memresource(struct pnp_dev *dev,
u64 start, u64 len,
+ int write_protect, int window)
{
int flags = 0;
u64 end = start + len - 1;
{
int flags = 0;
u64 end = start + len - 1;
flags |= IORESOURCE_DISABLED;
if (write_protect == ACPI_READ_WRITE_MEMORY)
flags |= IORESOURCE_MEM_WRITEABLE;
flags |= IORESOURCE_DISABLED;
if (write_protect == ACPI_READ_WRITE_MEMORY)
flags |= IORESOURCE_MEM_WRITEABLE;
+ if (window)
+ flags |= IORESOURCE_WINDOW;
pnp_add_mem_resource(dev, start, end, flags);
}
pnp_add_mem_resource(dev, start, end, flags);
}
{
struct acpi_resource_address64 addr, *p = &addr;
acpi_status status;
{
struct acpi_resource_address64 addr, *p = &addr;
acpi_status status;
status = acpi_resource_to_address64(res, p);
if (!ACPI_SUCCESS(status)) {
status = acpi_resource_to_address64(res, p);
if (!ACPI_SUCCESS(status)) {
- if (p->producer_consumer == ACPI_PRODUCER)
- return;
+ window = (p->producer_consumer == ACPI_PRODUCER) ? 1 : 0;
if (p->resource_type == ACPI_MEMORY_RANGE)
pnpacpi_parse_allocated_memresource(dev,
p->minimum, p->address_length,
if (p->resource_type == ACPI_MEMORY_RANGE)
pnpacpi_parse_allocated_memresource(dev,
p->minimum, p->address_length,
- p->info.mem.write_protect);
+ p->info.mem.write_protect, window);
else if (p->resource_type == ACPI_IO_RANGE)
pnpacpi_parse_allocated_ioresource(dev,
p->minimum, p->address_length,
p->granularity == 0xfff ? ACPI_DECODE_10 :
else if (p->resource_type == ACPI_IO_RANGE)
pnpacpi_parse_allocated_ioresource(dev,
p->minimum, p->address_length,
p->granularity == 0xfff ? ACPI_DECODE_10 :
+ ACPI_DECODE_16, window);
}
static void pnpacpi_parse_allocated_ext_address_space(struct pnp_dev *dev,
struct acpi_resource *res)
{
struct acpi_resource_extended_address64 *p = &res->data.ext_address64;
}
static void pnpacpi_parse_allocated_ext_address_space(struct pnp_dev *dev,
struct acpi_resource *res)
{
struct acpi_resource_extended_address64 *p = &res->data.ext_address64;
- if (p->producer_consumer == ACPI_PRODUCER)
- return;
+ window = (p->producer_consumer == ACPI_PRODUCER) ? 1 : 0;
if (p->resource_type == ACPI_MEMORY_RANGE)
pnpacpi_parse_allocated_memresource(dev,
p->minimum, p->address_length,
if (p->resource_type == ACPI_MEMORY_RANGE)
pnpacpi_parse_allocated_memresource(dev,
p->minimum, p->address_length,
- p->info.mem.write_protect);
+ p->info.mem.write_protect, window);
else if (p->resource_type == ACPI_IO_RANGE)
pnpacpi_parse_allocated_ioresource(dev,
p->minimum, p->address_length,
p->granularity == 0xfff ? ACPI_DECODE_10 :
else if (p->resource_type == ACPI_IO_RANGE)
pnpacpi_parse_allocated_ioresource(dev,
p->minimum, p->address_length,
p->granularity == 0xfff ? ACPI_DECODE_10 :
+ ACPI_DECODE_16, window);
}
static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
}
static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
pnpacpi_parse_allocated_ioresource(dev,
io->minimum,
io->address_length,
pnpacpi_parse_allocated_ioresource(dev,
io->minimum,
io->address_length,
break;
case ACPI_RESOURCE_TYPE_START_DEPENDENT:
break;
case ACPI_RESOURCE_TYPE_START_DEPENDENT:
pnpacpi_parse_allocated_ioresource(dev,
fixed_io->address,
fixed_io->address_length,
pnpacpi_parse_allocated_ioresource(dev,
fixed_io->address,
fixed_io->address_length,
break;
case ACPI_RESOURCE_TYPE_VENDOR:
break;
case ACPI_RESOURCE_TYPE_VENDOR:
pnpacpi_parse_allocated_memresource(dev,
memory24->minimum,
memory24->address_length,
pnpacpi_parse_allocated_memresource(dev,
memory24->minimum,
memory24->address_length,
- memory24->write_protect);
+ memory24->write_protect, 0);
break;
case ACPI_RESOURCE_TYPE_MEMORY32:
memory32 = &res->data.memory32;
pnpacpi_parse_allocated_memresource(dev,
memory32->minimum,
memory32->address_length,
break;
case ACPI_RESOURCE_TYPE_MEMORY32:
memory32 = &res->data.memory32;
pnpacpi_parse_allocated_memresource(dev,
memory32->minimum,
memory32->address_length,
- memory32->write_protect);
+ memory32->write_protect, 0);
break;
case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
fixed_memory32 = &res->data.fixed_memory32;
pnpacpi_parse_allocated_memresource(dev,
fixed_memory32->address,
fixed_memory32->address_length,
break;
case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
fixed_memory32 = &res->data.fixed_memory32;
pnpacpi_parse_allocated_memresource(dev,
fixed_memory32->address,
fixed_memory32->address_length,
- fixed_memory32->write_protect);
+ fixed_memory32->write_protect, 0);
break;
case ACPI_RESOURCE_TYPE_ADDRESS16:
case ACPI_RESOURCE_TYPE_ADDRESS32:
break;
case ACPI_RESOURCE_TYPE_ADDRESS16:
case ACPI_RESOURCE_TYPE_ADDRESS32: