summaryrefslogtreecommitdiffstats
path: root/drivers/char/agp/nvidia-agp.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2014-01-06 23:21:16 +0100
committerBjorn Helgaas <bhelgaas@google.com>2014-01-07 19:36:35 +0100
commitd68c5a271727e09ce4a26ea8b85cbb852e06650f (patch)
tree58f48c1f956a0a18f7dff57718ca19e0f4d2b6b1 /drivers/char/agp/nvidia-agp.c
parentagp: Support 64-bit APBASE (diff)
downloadlinux-d68c5a271727e09ce4a26ea8b85cbb852e06650f.tar.xz
linux-d68c5a271727e09ce4a26ea8b85cbb852e06650f.zip
agp: Use pci_resource_start() to get CPU physical address for BAR
amd_irongate_configure(), ati_configure(), and nvidia_configure() call ioremap() on an address read directly from a BAR. But a BAR contains a bus address, and ioremap() expects a CPU physical address. Use pci_resource_start() to obtain the physical address. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/char/agp/nvidia-agp.c')
-rw-r--r--drivers/char/agp/nvidia-agp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c
index ab65d55272c4..a1861b75eb31 100644
--- a/drivers/char/agp/nvidia-agp.c
+++ b/drivers/char/agp/nvidia-agp.c
@@ -106,6 +106,7 @@ static int nvidia_configure(void)
{
int i, rc, num_dirs;
u32 apbase, aplimit;
+ phys_addr_t apbase_phys;
struct aper_size_info_8 *current_size;
u32 temp;
@@ -152,8 +153,9 @@ static int nvidia_configure(void)
pci_write_config_dword(agp_bridge->dev, NVIDIA_0_APSIZE, temp | 0x100);
/* map aperture */
+ apbase_phys = pci_resource_start(agp_bridge->dev, AGP_APERTURE_BAR);
nvidia_private.aperture =
- (volatile u32 __iomem *) ioremap(apbase, 33 * PAGE_SIZE);
+ (volatile u32 __iomem *) ioremap(apbase_phys, 33 * PAGE_SIZE);
if (!nvidia_private.aperture)
return -ENOMEM;