diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2014-01-03 20:26:58 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-01-06 19:49:22 -0500 |
commit | e501b3d87f003dfad8fcbd0f55ae17ea52495a56 (patch) | |
tree | 1307d77ead535d134b6f62df53c923cf1247baa6 /drivers/char/agp/amd-k7-agp.c | |
parent | 06cf56e497c8c1469b0931caa7d5b1d827655fe2 (diff) |
agp: Support 64-bit APBASE
Per the AGP 3.0 spec, APBASE is a standard PCI BAR and may be either 32
bits or 64 bits wide. Many drivers read APBASE directly, but they only
handled 32-bit BARs.
The PCI core reads APBASE at enumeration-time. Use pci_bus_address()
instead of reading it again in the driver. This works correctly for both
32-bit and 64-bit BARs.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/char/agp/amd-k7-agp.c')
-rw-r--r-- | drivers/char/agp/amd-k7-agp.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c index 779f0ab845a9..5f028cb1d6e8 100644 --- a/drivers/char/agp/amd-k7-agp.c +++ b/drivers/char/agp/amd-k7-agp.c | |||
@@ -126,7 +126,6 @@ static int amd_create_gatt_table(struct agp_bridge_data *bridge) | |||
126 | unsigned long __iomem *cur_gatt; | 126 | unsigned long __iomem *cur_gatt; |
127 | unsigned long addr; | 127 | unsigned long addr; |
128 | int retval; | 128 | int retval; |
129 | u32 temp; | ||
130 | int i; | 129 | int i; |
131 | 130 | ||
132 | value = A_SIZE_LVL2(agp_bridge->current_size); | 131 | value = A_SIZE_LVL2(agp_bridge->current_size); |
@@ -149,8 +148,7 @@ static int amd_create_gatt_table(struct agp_bridge_data *bridge) | |||
149 | * used to program the agp master not the cpu | 148 | * used to program the agp master not the cpu |
150 | */ | 149 | */ |
151 | 150 | ||
152 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | 151 | addr = pci_bus_address(agp_bridge->dev, AGP_APERTURE_BAR); |
153 | addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | ||
154 | agp_bridge->gart_bus_addr = addr; | 152 | agp_bridge->gart_bus_addr = addr; |
155 | 153 | ||
156 | /* Calculate the agp offset */ | 154 | /* Calculate the agp offset */ |