mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-25 05:34:00 +08:00
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>
This commit is contained in:
parent
a49170b552
commit
2ea3d266ba
@ -205,6 +205,21 @@ static bool acpi_decode_space(struct resource_win *win,
|
|||||||
res->start = attr->minimum;
|
res->start = attr->minimum;
|
||||||
res->end = attr->maximum;
|
res->end = attr->maximum;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* For bridges that translate addresses across the bridge,
|
||||||
|
* translation_offset is the offset that must be added to the
|
||||||
|
* address on the secondary side to obtain the address on the
|
||||||
|
* primary side. Non-bridge devices must list 0 for all Address
|
||||||
|
* Translation offset bits.
|
||||||
|
*/
|
||||||
|
if (addr->producer_consumer == ACPI_PRODUCER) {
|
||||||
|
res->start += attr->translation_offset;
|
||||||
|
res->end += attr->translation_offset;
|
||||||
|
} else if (attr->translation_offset) {
|
||||||
|
pr_debug("ACPI: translation_offset(%lld) is invalid for non-bridge device.\n",
|
||||||
|
attr->translation_offset);
|
||||||
|
}
|
||||||
|
|
||||||
switch (addr->resource_type) {
|
switch (addr->resource_type) {
|
||||||
case ACPI_MEMORY_RANGE:
|
case ACPI_MEMORY_RANGE:
|
||||||
acpi_dev_memresource_flags(res, len, wp);
|
acpi_dev_memresource_flags(res, len, wp);
|
||||||
|
Loading…
Reference in New Issue
Block a user