diff options
author | Jiang Liu <jiang.liu@linux.intel.com> | 2015-02-01 21:42:59 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-02-03 16:27:21 -0500 |
commit | 2ea3d266bab3b497238113b20136f7c3f69ad9c0 (patch) | |
tree | d58f31464a40ec722efce3791a74e70e0e16b5f3 /drivers/acpi | |
parent | a49170b552423a3e85fc4f0d778c707402ee4863 (diff) |
ACPI: Translate resource into master side address for bridge window resources
Add translation_offset into the result address for bridge window
resources to form the master side address.
Currently acpi_dev_resource_{ext_}address_space() are only used for
devices instead of bridges, so it won't break current users. Later
it will be used to support PCI host bridge drivers.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/resource.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c index c902c8eece81..4dc8cfb2e94e 100644 --- a/drivers/acpi/resource.c +++ b/drivers/acpi/resource.c | |||
@@ -205,6 +205,21 @@ static bool acpi_decode_space(struct resource_win *win, | |||
205 | res->start = attr->minimum; | 205 | res->start = attr->minimum; |
206 | res->end = attr->maximum; | 206 | res->end = attr->maximum; |
207 | 207 | ||
208 | /* | ||
209 | * For bridges that translate addresses across the bridge, | ||
210 | * translation_offset is the offset that must be added to the | ||
211 | * address on the secondary side to obtain the address on the | ||
212 | * primary side. Non-bridge devices must list 0 for all Address | ||
213 | * Translation offset bits. | ||
214 | */ | ||
215 | if (addr->producer_consumer == ACPI_PRODUCER) { | ||
216 | res->start += attr->translation_offset; | ||
217 | res->end += attr->translation_offset; | ||
218 | } else if (attr->translation_offset) { | ||
219 | pr_debug("ACPI: translation_offset(%lld) is invalid for non-bridge device.\n", | ||
220 | attr->translation_offset); | ||
221 | } | ||
222 | |||
208 | switch (addr->resource_type) { | 223 | switch (addr->resource_type) { |
209 | case ACPI_MEMORY_RANGE: | 224 | case ACPI_MEMORY_RANGE: |
210 | acpi_dev_memresource_flags(res, len, wp); | 225 | acpi_dev_memresource_flags(res, len, wp); |