Commit 1589887a authored by Len Brown's avatar Len Brown Committed by Len Brown

[ACPI] delete old _TRA code formerly used just by IA64. (Bjorn Helgaas)

The current approach is to walk the _CRS in pcibios_scan_root()
using acpi_walk_resources().
parent b29ea22d
...@@ -62,8 +62,6 @@ struct acpi_pci_root { ...@@ -62,8 +62,6 @@ struct acpi_pci_root {
acpi_handle handle; acpi_handle handle;
struct acpi_pci_id id; struct acpi_pci_id id;
struct pci_bus *bus; struct pci_bus *bus;
u64 mem_tra;
u64 io_tra;
}; };
static LIST_HEAD(acpi_pci_roots); static LIST_HEAD(acpi_pci_roots);
...@@ -115,97 +113,6 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver) ...@@ -115,97 +113,6 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver)
} }
} }
void
acpi_pci_get_translations (
struct acpi_pci_id *id,
u64 *mem_tra,
u64 *io_tra)
{
struct list_head *node = NULL;
struct acpi_pci_root *entry;
/* TBD: Locking */
list_for_each(node, &acpi_pci_roots) {
entry = list_entry(node, struct acpi_pci_root, node);
if ((id->segment == entry->id.segment)
&& (id->bus == entry->id.bus)) {
*mem_tra = entry->mem_tra;
*io_tra = entry->io_tra;
return;
}
}
*mem_tra = 0;
*io_tra = 0;
}
static u64
acpi_pci_root_bus_tra (
struct acpi_resource *resource,
int type)
{
struct acpi_resource_address16 *address16;
struct acpi_resource_address32 *address32;
struct acpi_resource_address64 *address64;
while (1) {
switch (resource->id) {
case ACPI_RSTYPE_END_TAG:
return 0;
case ACPI_RSTYPE_ADDRESS16:
address16 = (struct acpi_resource_address16 *) &resource->data;
if (type == address16->resource_type) {
return address16->address_translation_offset;
}
break;
case ACPI_RSTYPE_ADDRESS32:
address32 = (struct acpi_resource_address32 *) &resource->data;
if (type == address32->resource_type) {
return address32->address_translation_offset;
}
break;
case ACPI_RSTYPE_ADDRESS64:
address64 = (struct acpi_resource_address64 *) &resource->data;
if (type == address64->resource_type) {
return address64->address_translation_offset;
}
break;
}
resource = ACPI_PTR_ADD (struct acpi_resource,
resource, resource->length);
}
return 0;
}
static int
acpi_pci_evaluate_crs (
struct acpi_pci_root *root)
{
acpi_status status;
struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
ACPI_FUNCTION_TRACE("acpi_pci_evaluate_crs");
status = acpi_get_current_resources (root->handle, &buffer);
if (ACPI_FAILURE(status))
return_VALUE(-ENODEV);
root->io_tra = acpi_pci_root_bus_tra ((struct acpi_resource *)
buffer.pointer, ACPI_IO_RANGE);
root->mem_tra = acpi_pci_root_bus_tra ((struct acpi_resource *)
buffer.pointer, ACPI_MEMORY_RANGE);
acpi_os_free(buffer.pointer);
return_VALUE(0);
}
static int static int
acpi_pci_root_add ( acpi_pci_root_add (
struct acpi_device *device) struct acpi_device *device)
...@@ -288,10 +195,8 @@ acpi_pci_root_add ( ...@@ -288,10 +195,8 @@ acpi_pci_root_add (
root->id.function = device->pnp.bus_address & 0xFFFF; root->id.function = device->pnp.bus_address & 0xFFFF;
/* /*
* Evaluate _CRS to get root bridge resources
* TBD: Need PCI interface for enumeration/configuration of roots. * TBD: Need PCI interface for enumeration/configuration of roots.
*/ */
acpi_pci_evaluate_crs(root);
/* TBD: Locking */ /* TBD: Locking */
list_add_tail(&root->node, &acpi_pci_roots); list_add_tail(&root->node, &acpi_pci_roots);
......
...@@ -53,10 +53,6 @@ ...@@ -53,10 +53,6 @@
#define ACPI_PCI_COMPONENT 0x00400000 #define ACPI_PCI_COMPONENT 0x00400000
/* ACPI PCI Root Bridge (pci_root.c) */
void acpi_pci_get_translations (struct acpi_pci_id* id, u64* mem_tra, u64* io_tra);
/* ACPI PCI Interrupt Link (pci_link.c) */ /* ACPI PCI Interrupt Link (pci_link.c) */
int acpi_pci_link_check (void); int acpi_pci_link_check (void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment