diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-22 19:39:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-22 19:39:28 -0500 |
commit | e1ba84597c9012b9f9075aac283ac7537d7561ba (patch) | |
tree | 41ab1a74c71ce55e72ef73424346e8e0a7f4616e /drivers/char | |
parent | 60eaa0190f6b39dce18eb1975d9773ed8bc9a534 (diff) | |
parent | cef09b808e584c13b7126b83dc37c80b00234137 (diff) |
Merge tag 'pci-v3.14-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI updates from Bjorn Helgaas:
"PCI changes for the v3.14 merge window:
Resource management
- Change pci_bus_region addresses to dma_addr_t (Bjorn Helgaas)
- Support 64-bit AGP BARs (Bjorn Helgaas, Yinghai Lu)
- Add pci_bus_address() to get bus address of a BAR (Bjorn Helgaas)
- Use pci_resource_start() for CPU address of AGP BARs (Bjorn Helgaas)
- Enforce bus address limits in resource allocation (Yinghai Lu)
- Allocate 64-bit BARs above 4G when possible (Yinghai Lu)
- Convert pcibios_resource_to_bus() to take pci_bus, not pci_dev (Yinghai Lu)
PCI device hotplug
- Major rescan/remove locking update (Rafael J. Wysocki)
- Make ioapic builtin only (not modular) (Yinghai Lu)
- Fix release/free issues (Yinghai Lu)
- Clean up pciehp (Bjorn Helgaas)
- Announce pciehp slot info during enumeration (Bjorn Helgaas)
MSI
- Add pci_msi_vec_count(), pci_msix_vec_count() (Alexander Gordeev)
- Add pci_enable_msi_range(), pci_enable_msix_range() (Alexander Gordeev)
- Deprecate "tri-state" interfaces: fail/success/fail+info (Alexander Gordeev)
- Export MSI mode using attributes, not kobjects (Greg Kroah-Hartman)
- Drop "irq" param from *_restore_msi_irqs() (DuanZhenzhong)
SR-IOV
- Clear NumVFs when disabling SR-IOV in sriov_init() (ethan.zhao)
Virtualization
- Add support for save/restore of extended capabilities (Alex Williamson)
- Add Virtual Channel to save/restore support (Alex Williamson)
- Never treat a VF as a multifunction device (Alex Williamson)
- Add pci_try_reset_function(), et al (Alex Williamson)
AER
- Ignore non-PCIe error sources (Betty Dall)
- Support ACPI HEST error sources for domains other than 0 (Betty Dall)
- Consolidate HEST error source parsers (Bjorn Helgaas)
- Add a TLP header print helper (Borislav Petkov)
Freescale i.MX6
- Remove unnecessary code (Fabio Estevam)
- Make reset-gpio optional (Marek Vasut)
- Report "link up" only after link training completes (Marek Vasut)
- Start link in Gen1 before negotiating for Gen2 mode (Marek Vasut)
- Fix PCIe startup code (Richard Zhu)
Marvell MVEBU
- Remove duplicate of_clk_get_by_name() call (Andrew Lunn)
- Drop writes to bridge Secondary Status register (Jason Gunthorpe)
- Obey bridge PCI_COMMAND_MEM and PCI_COMMAND_IO bits (Jason Gunthorpe)
- Support a bridge with no IO port window (Jason Gunthorpe)
- Use max_t() instead of max(resource_size_t,) (Jingoo Han)
- Remove redundant of_match_ptr (Sachin Kamat)
- Call pci_ioremap_io() at startup instead of dynamically (Thomas Petazzoni)
NVIDIA Tegra
- Disable Gen2 for Tegra20 and Tegra30 (Eric Brower)
Renesas R-Car
- Add runtime PM support (Valentine Barshak)
- Fix rcar_pci_probe() return value check (Wei Yongjun)
Synopsys DesignWare
- Fix crash in dw_msi_teardown_irq() (Bjørn Erik Nilsen)
- Remove redundant call to pci_write_config_word() (Bjørn Erik Nilsen)
- Fix missing MSI IRQs (Harro Haan)
- Add dw_pcie prefix before cfg_read/write (Pratyush Anand)
- Fix I/O transfers by using CPU (not realio) address (Pratyush Anand)
- Whitespace cleanup (Jingoo Han)
EISA
- Call put_device() if device_register() fails (Levente Kurusa)
- Revert EISA initialization breakage ((Bjorn Helgaas)
Miscellaneous
- Remove unused code, including PCIe 3.0 interfaces (Stephen Hemminger)
- Prevent bus conflicts while checking for bridge apertures (Bjorn Helgaas)
- Stop clearing bridge Secondary Status when setting up I/O aperture (Bjorn Helgaas)
- Use dev_is_pci() to identify PCI devices (Yijing Wang)
- Deprecate DEFINE_PCI_DEVICE_TABLE (Joe Perches)
- Update documentation 00-INDEX (Erik Ekman)"
* tag 'pci-v3.14-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (119 commits)
Revert "EISA: Initialize device before its resources"
Revert "EISA: Log device resources in dmesg"
vfio-pci: Use pci "try" reset interface
PCI: Check parent kobject in pci_destroy_dev()
xen/pcifront: Use global PCI rescan-remove locking
powerpc/eeh: Use global PCI rescan-remove locking
PCI: Fix pci_check_and_unmask_intx() comment typos
PCI: Add pci_try_reset_function(), pci_try_reset_slot(), pci_try_reset_bus()
MPT / PCI: Use pci_stop_and_remove_bus_device_locked()
platform / x86: Use global PCI rescan-remove locking
PCI: hotplug: Use global PCI rescan-remove locking
pcmcia: Use global PCI rescan-remove locking
ACPI / hotplug / PCI: Use global PCI rescan-remove locking
ACPI / PCI: Use global PCI rescan-remove locking in PCI root hotplug
PCI: Add global pci_lock_rescan_remove()
PCI: Cleanup pci.h whitespace
PCI: Reorder so actual code comes before stubs
PCI/AER: Support ACPI HEST AER error sources for PCI domains other than 0
ACPICA: Add helper macros to extract bus/segment numbers from HEST table.
PCI: Make local functions static
...
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/agp/agp.h | 1 | ||||
-rw-r--r-- | drivers/char/agp/ali-agp.c | 4 | ||||
-rw-r--r-- | drivers/char/agp/amd-k7-agp.c | 12 | ||||
-rw-r--r-- | drivers/char/agp/amd64-agp.c | 5 | ||||
-rw-r--r-- | drivers/char/agp/ati-agp.c | 21 | ||||
-rw-r--r-- | drivers/char/agp/efficeon-agp.c | 5 | ||||
-rw-r--r-- | drivers/char/agp/generic.c | 4 | ||||
-rw-r--r-- | drivers/char/agp/intel-agp.c | 48 | ||||
-rw-r--r-- | drivers/char/agp/intel-agp.h | 10 | ||||
-rw-r--r-- | drivers/char/agp/intel-gtt.c | 47 | ||||
-rw-r--r-- | drivers/char/agp/nvidia-agp.c | 9 | ||||
-rw-r--r-- | drivers/char/agp/sis-agp.c | 5 | ||||
-rw-r--r-- | drivers/char/agp/via-agp.c | 13 |
13 files changed, 80 insertions, 104 deletions
diff --git a/drivers/char/agp/agp.h b/drivers/char/agp/agp.h index 923f99df4f1c..b709749c8639 100644 --- a/drivers/char/agp/agp.h +++ b/drivers/char/agp/agp.h | |||
@@ -239,6 +239,7 @@ long compat_agp_ioctl(struct file *file, unsigned int cmd, unsigned long arg); | |||
239 | 239 | ||
240 | /* Chipset independent registers (from AGP Spec) */ | 240 | /* Chipset independent registers (from AGP Spec) */ |
241 | #define AGP_APBASE 0x10 | 241 | #define AGP_APBASE 0x10 |
242 | #define AGP_APERTURE_BAR 0 | ||
242 | 243 | ||
243 | #define AGPSTAT 0x4 | 244 | #define AGPSTAT 0x4 |
244 | #define AGPCMD 0x8 | 245 | #define AGPCMD 0x8 |
diff --git a/drivers/char/agp/ali-agp.c b/drivers/char/agp/ali-agp.c index 443cd6751ca2..19db03667650 100644 --- a/drivers/char/agp/ali-agp.c +++ b/drivers/char/agp/ali-agp.c | |||
@@ -85,8 +85,8 @@ static int ali_configure(void) | |||
85 | pci_write_config_dword(agp_bridge->dev, ALI_TLBCTRL, ((temp & 0xffffff00) | 0x00000010)); | 85 | pci_write_config_dword(agp_bridge->dev, ALI_TLBCTRL, ((temp & 0xffffff00) | 0x00000010)); |
86 | 86 | ||
87 | /* address to map to */ | 87 | /* address to map to */ |
88 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | 88 | agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev, |
89 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | 89 | AGP_APERTURE_BAR); |
90 | 90 | ||
91 | #if 0 | 91 | #if 0 |
92 | if (agp_bridge->type == ALI_M1541) { | 92 | if (agp_bridge->type == ALI_M1541) { |
diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c index 779f0ab845a9..3661a51e93e2 100644 --- a/drivers/char/agp/amd-k7-agp.c +++ b/drivers/char/agp/amd-k7-agp.c | |||
@@ -11,7 +11,7 @@ | |||
11 | #include <linux/slab.h> | 11 | #include <linux/slab.h> |
12 | #include "agp.h" | 12 | #include "agp.h" |
13 | 13 | ||
14 | #define AMD_MMBASE 0x14 | 14 | #define AMD_MMBASE_BAR 1 |
15 | #define AMD_APSIZE 0xac | 15 | #define AMD_APSIZE 0xac |
16 | #define AMD_MODECNTL 0xb0 | 16 | #define AMD_MODECNTL 0xb0 |
17 | #define AMD_MODECNTL2 0xb2 | 17 | #define AMD_MODECNTL2 0xb2 |
@@ -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 */ |
@@ -207,6 +205,7 @@ static int amd_irongate_fetch_size(void) | |||
207 | static int amd_irongate_configure(void) | 205 | static int amd_irongate_configure(void) |
208 | { | 206 | { |
209 | struct aper_size_info_lvl2 *current_size; | 207 | struct aper_size_info_lvl2 *current_size; |
208 | phys_addr_t reg; | ||
210 | u32 temp; | 209 | u32 temp; |
211 | u16 enable_reg; | 210 | u16 enable_reg; |
212 | 211 | ||
@@ -214,9 +213,8 @@ static int amd_irongate_configure(void) | |||
214 | 213 | ||
215 | if (!amd_irongate_private.registers) { | 214 | if (!amd_irongate_private.registers) { |
216 | /* Get the memory mapped registers */ | 215 | /* Get the memory mapped registers */ |
217 | pci_read_config_dword(agp_bridge->dev, AMD_MMBASE, &temp); | 216 | reg = pci_resource_start(agp_bridge->dev, AMD_MMBASE_BAR); |
218 | temp = (temp & PCI_BASE_ADDRESS_MEM_MASK); | 217 | amd_irongate_private.registers = (volatile u8 __iomem *) ioremap(reg, 4096); |
219 | amd_irongate_private.registers = (volatile u8 __iomem *) ioremap(temp, 4096); | ||
220 | if (!amd_irongate_private.registers) | 218 | if (!amd_irongate_private.registers) |
221 | return -ENOMEM; | 219 | return -ENOMEM; |
222 | } | 220 | } |
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c index 896413b59aae..3b47ed0310e1 100644 --- a/drivers/char/agp/amd64-agp.c +++ b/drivers/char/agp/amd64-agp.c | |||
@@ -269,7 +269,6 @@ static int agp_aperture_valid(u64 aper, u32 size) | |||
269 | */ | 269 | */ |
270 | static int fix_northbridge(struct pci_dev *nb, struct pci_dev *agp, u16 cap) | 270 | static int fix_northbridge(struct pci_dev *nb, struct pci_dev *agp, u16 cap) |
271 | { | 271 | { |
272 | u32 aper_low, aper_hi; | ||
273 | u64 aper, nb_aper; | 272 | u64 aper, nb_aper; |
274 | int order = 0; | 273 | int order = 0; |
275 | u32 nb_order, nb_base; | 274 | u32 nb_order, nb_base; |
@@ -295,9 +294,7 @@ static int fix_northbridge(struct pci_dev *nb, struct pci_dev *agp, u16 cap) | |||
295 | apsize |= 0xf00; | 294 | apsize |= 0xf00; |
296 | order = 7 - hweight16(apsize); | 295 | order = 7 - hweight16(apsize); |
297 | 296 | ||
298 | pci_read_config_dword(agp, 0x10, &aper_low); | 297 | aper = pci_bus_address(agp, AGP_APERTURE_BAR); |
299 | pci_read_config_dword(agp, 0x14, &aper_hi); | ||
300 | aper = (aper_low & ~((1<<22)-1)) | ((u64)aper_hi << 32); | ||
301 | 298 | ||
302 | /* | 299 | /* |
303 | * On some sick chips APSIZE is 0. This means it wants 4G | 300 | * On some sick chips APSIZE is 0. This means it wants 4G |
diff --git a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c index 03c1dc1ab552..18a7a6baa304 100644 --- a/drivers/char/agp/ati-agp.c +++ b/drivers/char/agp/ati-agp.c | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <asm/agp.h> | 12 | #include <asm/agp.h> |
13 | #include "agp.h" | 13 | #include "agp.h" |
14 | 14 | ||
15 | #define ATI_GART_MMBASE_ADDR 0x14 | 15 | #define ATI_GART_MMBASE_BAR 1 |
16 | #define ATI_RS100_APSIZE 0xac | 16 | #define ATI_RS100_APSIZE 0xac |
17 | #define ATI_RS100_IG_AGPMODE 0xb0 | 17 | #define ATI_RS100_IG_AGPMODE 0xb0 |
18 | #define ATI_RS300_APSIZE 0xf8 | 18 | #define ATI_RS300_APSIZE 0xf8 |
@@ -196,12 +196,12 @@ static void ati_cleanup(void) | |||
196 | 196 | ||
197 | static int ati_configure(void) | 197 | static int ati_configure(void) |
198 | { | 198 | { |
199 | phys_addr_t reg; | ||
199 | u32 temp; | 200 | u32 temp; |
200 | 201 | ||
201 | /* Get the memory mapped registers */ | 202 | /* Get the memory mapped registers */ |
202 | pci_read_config_dword(agp_bridge->dev, ATI_GART_MMBASE_ADDR, &temp); | 203 | reg = pci_resource_start(agp_bridge->dev, ATI_GART_MMBASE_BAR); |
203 | temp = (temp & 0xfffff000); | 204 | ati_generic_private.registers = (volatile u8 __iomem *) ioremap(reg, 4096); |
204 | ati_generic_private.registers = (volatile u8 __iomem *) ioremap(temp, 4096); | ||
205 | 205 | ||
206 | if (!ati_generic_private.registers) | 206 | if (!ati_generic_private.registers) |
207 | return -ENOMEM; | 207 | return -ENOMEM; |
@@ -211,18 +211,18 @@ static int ati_configure(void) | |||
211 | else | 211 | else |
212 | pci_write_config_dword(agp_bridge->dev, ATI_RS300_IG_AGPMODE, 0x20000); | 212 | pci_write_config_dword(agp_bridge->dev, ATI_RS300_IG_AGPMODE, 0x20000); |
213 | 213 | ||
214 | /* address to map too */ | 214 | /* address to map to */ |
215 | /* | 215 | /* |
216 | pci_read_config_dword(agp_bridge.dev, AGP_APBASE, &temp); | 216 | agp_bridge.gart_bus_addr = pci_bus_address(agp_bridge.dev, |
217 | agp_bridge.gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | 217 | AGP_APERTURE_BAR); |
218 | printk(KERN_INFO PFX "IGP320 gart_bus_addr: %x\n", agp_bridge.gart_bus_addr); | 218 | printk(KERN_INFO PFX "IGP320 gart_bus_addr: %x\n", agp_bridge.gart_bus_addr); |
219 | */ | 219 | */ |
220 | writel(0x60000, ati_generic_private.registers+ATI_GART_FEATURE_ID); | 220 | writel(0x60000, ati_generic_private.registers+ATI_GART_FEATURE_ID); |
221 | readl(ati_generic_private.registers+ATI_GART_FEATURE_ID); /* PCI Posting.*/ | 221 | readl(ati_generic_private.registers+ATI_GART_FEATURE_ID); /* PCI Posting.*/ |
222 | 222 | ||
223 | /* SIGNALED_SYSTEM_ERROR @ NB_STATUS */ | 223 | /* SIGNALED_SYSTEM_ERROR @ NB_STATUS */ |
224 | pci_read_config_dword(agp_bridge->dev, 4, &temp); | 224 | pci_read_config_dword(agp_bridge->dev, PCI_COMMAND, &temp); |
225 | pci_write_config_dword(agp_bridge->dev, 4, temp | (1<<14)); | 225 | pci_write_config_dword(agp_bridge->dev, PCI_COMMAND, temp | (1<<14)); |
226 | 226 | ||
227 | /* Write out the address of the gatt table */ | 227 | /* Write out the address of the gatt table */ |
228 | writel(agp_bridge->gatt_bus_addr, ati_generic_private.registers+ATI_GART_BASE); | 228 | writel(agp_bridge->gatt_bus_addr, ati_generic_private.registers+ATI_GART_BASE); |
@@ -385,8 +385,7 @@ static int ati_create_gatt_table(struct agp_bridge_data *bridge) | |||
385 | * This is a bus address even on the alpha, b/c its | 385 | * This is a bus address even on the alpha, b/c its |
386 | * used to program the agp master not the cpu | 386 | * used to program the agp master not the cpu |
387 | */ | 387 | */ |
388 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | 388 | addr = pci_bus_address(agp_bridge->dev, AGP_APERTURE_BAR); |
389 | addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | ||
390 | agp_bridge->gart_bus_addr = addr; | 389 | agp_bridge->gart_bus_addr = addr; |
391 | 390 | ||
392 | /* Calculate the agp offset */ | 391 | /* Calculate the agp offset */ |
diff --git a/drivers/char/agp/efficeon-agp.c b/drivers/char/agp/efficeon-agp.c index 6974d5032053..533cb6d229b8 100644 --- a/drivers/char/agp/efficeon-agp.c +++ b/drivers/char/agp/efficeon-agp.c | |||
@@ -128,7 +128,6 @@ static void efficeon_cleanup(void) | |||
128 | 128 | ||
129 | static int efficeon_configure(void) | 129 | static int efficeon_configure(void) |
130 | { | 130 | { |
131 | u32 temp; | ||
132 | u16 temp2; | 131 | u16 temp2; |
133 | struct aper_size_info_lvl2 *current_size; | 132 | struct aper_size_info_lvl2 *current_size; |
134 | 133 | ||
@@ -141,8 +140,8 @@ static int efficeon_configure(void) | |||
141 | current_size->size_value); | 140 | current_size->size_value); |
142 | 141 | ||
143 | /* address to map to */ | 142 | /* address to map to */ |
144 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | 143 | agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev, |
145 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | 144 | AGP_APERTURE_BAR); |
146 | 145 | ||
147 | /* agpctrl */ | 146 | /* agpctrl */ |
148 | pci_write_config_dword(agp_bridge->dev, INTEL_AGPCTRL, 0x2280); | 147 | pci_write_config_dword(agp_bridge->dev, INTEL_AGPCTRL, 0x2280); |
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c index a0df182f6f7d..f39437addb58 100644 --- a/drivers/char/agp/generic.c +++ b/drivers/char/agp/generic.c | |||
@@ -1396,8 +1396,8 @@ int agp3_generic_configure(void) | |||
1396 | 1396 | ||
1397 | current_size = A_SIZE_16(agp_bridge->current_size); | 1397 | current_size = A_SIZE_16(agp_bridge->current_size); |
1398 | 1398 | ||
1399 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | 1399 | agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev, |
1400 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | 1400 | AGP_APERTURE_BAR); |
1401 | 1401 | ||
1402 | /* set aperture size */ | 1402 | /* set aperture size */ |
1403 | pci_write_config_word(agp_bridge->dev, agp_bridge->capndx+AGPAPSIZE, current_size->size_value); | 1403 | pci_write_config_word(agp_bridge->dev, agp_bridge->capndx+AGPAPSIZE, current_size->size_value); |
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index a426ee1f57a6..a7c276585a9f 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c | |||
@@ -118,7 +118,6 @@ static void intel_8xx_cleanup(void) | |||
118 | 118 | ||
119 | static int intel_configure(void) | 119 | static int intel_configure(void) |
120 | { | 120 | { |
121 | u32 temp; | ||
122 | u16 temp2; | 121 | u16 temp2; |
123 | struct aper_size_info_16 *current_size; | 122 | struct aper_size_info_16 *current_size; |
124 | 123 | ||
@@ -128,8 +127,8 @@ static int intel_configure(void) | |||
128 | pci_write_config_word(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); | 127 | pci_write_config_word(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); |
129 | 128 | ||
130 | /* address to map to */ | 129 | /* address to map to */ |
131 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | 130 | agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev, |
132 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | 131 | AGP_APERTURE_BAR); |
133 | 132 | ||
134 | /* attbase - aperture base */ | 133 | /* attbase - aperture base */ |
135 | pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); | 134 | pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); |
@@ -148,7 +147,7 @@ static int intel_configure(void) | |||
148 | 147 | ||
149 | static int intel_815_configure(void) | 148 | static int intel_815_configure(void) |
150 | { | 149 | { |
151 | u32 temp, addr; | 150 | u32 addr; |
152 | u8 temp2; | 151 | u8 temp2; |
153 | struct aper_size_info_8 *current_size; | 152 | struct aper_size_info_8 *current_size; |
154 | 153 | ||
@@ -167,8 +166,8 @@ static int intel_815_configure(void) | |||
167 | current_size->size_value); | 166 | current_size->size_value); |
168 | 167 | ||
169 | /* address to map to */ | 168 | /* address to map to */ |
170 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | 169 | agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev, |
171 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | 170 | AGP_APERTURE_BAR); |
172 | 171 | ||
173 | pci_read_config_dword(agp_bridge->dev, INTEL_ATTBASE, &addr); | 172 | pci_read_config_dword(agp_bridge->dev, INTEL_ATTBASE, &addr); |
174 | addr &= INTEL_815_ATTBASE_MASK; | 173 | addr &= INTEL_815_ATTBASE_MASK; |
@@ -208,7 +207,6 @@ static void intel_820_cleanup(void) | |||
208 | 207 | ||
209 | static int intel_820_configure(void) | 208 | static int intel_820_configure(void) |
210 | { | 209 | { |
211 | u32 temp; | ||
212 | u8 temp2; | 210 | u8 temp2; |
213 | struct aper_size_info_8 *current_size; | 211 | struct aper_size_info_8 *current_size; |
214 | 212 | ||
@@ -218,8 +216,8 @@ static int intel_820_configure(void) | |||
218 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); | 216 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); |
219 | 217 | ||
220 | /* address to map to */ | 218 | /* address to map to */ |
221 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | 219 | agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev, |
222 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | 220 | AGP_APERTURE_BAR); |
223 | 221 | ||
224 | /* attbase - aperture base */ | 222 | /* attbase - aperture base */ |
225 | pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); | 223 | pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); |
@@ -239,7 +237,6 @@ static int intel_820_configure(void) | |||
239 | 237 | ||
240 | static int intel_840_configure(void) | 238 | static int intel_840_configure(void) |
241 | { | 239 | { |
242 | u32 temp; | ||
243 | u16 temp2; | 240 | u16 temp2; |
244 | struct aper_size_info_8 *current_size; | 241 | struct aper_size_info_8 *current_size; |
245 | 242 | ||
@@ -249,8 +246,8 @@ static int intel_840_configure(void) | |||
249 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); | 246 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); |
250 | 247 | ||
251 | /* address to map to */ | 248 | /* address to map to */ |
252 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | 249 | agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev, |
253 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | 250 | AGP_APERTURE_BAR); |
254 | 251 | ||
255 | /* attbase - aperture base */ | 252 | /* attbase - aperture base */ |
256 | pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); | 253 | pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); |
@@ -268,7 +265,6 @@ static int intel_840_configure(void) | |||
268 | 265 | ||
269 | static int intel_845_configure(void) | 266 | static int intel_845_configure(void) |
270 | { | 267 | { |
271 | u32 temp; | ||
272 | u8 temp2; | 268 | u8 temp2; |
273 | struct aper_size_info_8 *current_size; | 269 | struct aper_size_info_8 *current_size; |
274 | 270 | ||
@@ -282,9 +278,9 @@ static int intel_845_configure(void) | |||
282 | agp_bridge->apbase_config); | 278 | agp_bridge->apbase_config); |
283 | } else { | 279 | } else { |
284 | /* address to map to */ | 280 | /* address to map to */ |
285 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | 281 | agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev, |
286 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | 282 | AGP_APERTURE_BAR); |
287 | agp_bridge->apbase_config = temp; | 283 | agp_bridge->apbase_config = agp_bridge->gart_bus_addr; |
288 | } | 284 | } |
289 | 285 | ||
290 | /* attbase - aperture base */ | 286 | /* attbase - aperture base */ |
@@ -303,7 +299,6 @@ static int intel_845_configure(void) | |||
303 | 299 | ||
304 | static int intel_850_configure(void) | 300 | static int intel_850_configure(void) |
305 | { | 301 | { |
306 | u32 temp; | ||
307 | u16 temp2; | 302 | u16 temp2; |
308 | struct aper_size_info_8 *current_size; | 303 | struct aper_size_info_8 *current_size; |
309 | 304 | ||
@@ -313,8 +308,8 @@ static int intel_850_configure(void) | |||
313 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); | 308 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); |
314 | 309 | ||
315 | /* address to map to */ | 310 | /* address to map to */ |
316 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | 311 | agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev, |
317 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | 312 | AGP_APERTURE_BAR); |
318 | 313 | ||
319 | /* attbase - aperture base */ | 314 | /* attbase - aperture base */ |
320 | pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); | 315 | pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); |
@@ -332,7 +327,6 @@ static int intel_850_configure(void) | |||
332 | 327 | ||
333 | static int intel_860_configure(void) | 328 | static int intel_860_configure(void) |
334 | { | 329 | { |
335 | u32 temp; | ||
336 | u16 temp2; | 330 | u16 temp2; |
337 | struct aper_size_info_8 *current_size; | 331 | struct aper_size_info_8 *current_size; |
338 | 332 | ||
@@ -342,8 +336,8 @@ static int intel_860_configure(void) | |||
342 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); | 336 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); |
343 | 337 | ||
344 | /* address to map to */ | 338 | /* address to map to */ |
345 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | 339 | agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev, |
346 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | 340 | AGP_APERTURE_BAR); |
347 | 341 | ||
348 | /* attbase - aperture base */ | 342 | /* attbase - aperture base */ |
349 | pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); | 343 | pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); |
@@ -361,7 +355,6 @@ static int intel_860_configure(void) | |||
361 | 355 | ||
362 | static int intel_830mp_configure(void) | 356 | static int intel_830mp_configure(void) |
363 | { | 357 | { |
364 | u32 temp; | ||
365 | u16 temp2; | 358 | u16 temp2; |
366 | struct aper_size_info_8 *current_size; | 359 | struct aper_size_info_8 *current_size; |
367 | 360 | ||
@@ -371,8 +364,8 @@ static int intel_830mp_configure(void) | |||
371 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); | 364 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); |
372 | 365 | ||
373 | /* address to map to */ | 366 | /* address to map to */ |
374 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | 367 | agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev, |
375 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | 368 | AGP_APERTURE_BAR); |
376 | 369 | ||
377 | /* attbase - aperture base */ | 370 | /* attbase - aperture base */ |
378 | pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); | 371 | pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); |
@@ -390,7 +383,6 @@ static int intel_830mp_configure(void) | |||
390 | 383 | ||
391 | static int intel_7505_configure(void) | 384 | static int intel_7505_configure(void) |
392 | { | 385 | { |
393 | u32 temp; | ||
394 | u16 temp2; | 386 | u16 temp2; |
395 | struct aper_size_info_8 *current_size; | 387 | struct aper_size_info_8 *current_size; |
396 | 388 | ||
@@ -400,8 +392,8 @@ static int intel_7505_configure(void) | |||
400 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); | 392 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); |
401 | 393 | ||
402 | /* address to map to */ | 394 | /* address to map to */ |
403 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | 395 | agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev, |
404 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | 396 | AGP_APERTURE_BAR); |
405 | 397 | ||
406 | /* attbase - aperture base */ | 398 | /* attbase - aperture base */ |
407 | pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); | 399 | pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); |
diff --git a/drivers/char/agp/intel-agp.h b/drivers/char/agp/intel-agp.h index 1042c1b90376..fda073dcd967 100644 --- a/drivers/char/agp/intel-agp.h +++ b/drivers/char/agp/intel-agp.h | |||
@@ -55,8 +55,8 @@ | |||
55 | #define INTEL_I860_ERRSTS 0xc8 | 55 | #define INTEL_I860_ERRSTS 0xc8 |
56 | 56 | ||
57 | /* Intel i810 registers */ | 57 | /* Intel i810 registers */ |
58 | #define I810_GMADDR 0x10 | 58 | #define I810_GMADR_BAR 0 |
59 | #define I810_MMADDR 0x14 | 59 | #define I810_MMADR_BAR 1 |
60 | #define I810_PTE_BASE 0x10000 | 60 | #define I810_PTE_BASE 0x10000 |
61 | #define I810_PTE_MAIN_UNCACHED 0x00000000 | 61 | #define I810_PTE_MAIN_UNCACHED 0x00000000 |
62 | #define I810_PTE_LOCAL 0x00000002 | 62 | #define I810_PTE_LOCAL 0x00000002 |
@@ -113,9 +113,9 @@ | |||
113 | #define INTEL_I850_ERRSTS 0xc8 | 113 | #define INTEL_I850_ERRSTS 0xc8 |
114 | 114 | ||
115 | /* intel 915G registers */ | 115 | /* intel 915G registers */ |
116 | #define I915_GMADDR 0x18 | 116 | #define I915_GMADR_BAR 2 |
117 | #define I915_MMADDR 0x10 | 117 | #define I915_MMADR_BAR 0 |
118 | #define I915_PTEADDR 0x1C | 118 | #define I915_PTE_BAR 3 |
119 | #define I915_GMCH_GMS_STOLEN_48M (0x6 << 4) | 119 | #define I915_GMCH_GMS_STOLEN_48M (0x6 << 4) |
120 | #define I915_GMCH_GMS_STOLEN_64M (0x7 << 4) | 120 | #define I915_GMCH_GMS_STOLEN_64M (0x7 << 4) |
121 | #define G33_GMCH_GMS_STOLEN_128M (0x8 << 4) | 121 | #define G33_GMCH_GMS_STOLEN_128M (0x8 << 4) |
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index b8e2014cb9cb..ad5da1ffcbe9 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c | |||
@@ -64,7 +64,7 @@ static struct _intel_private { | |||
64 | struct pci_dev *pcidev; /* device one */ | 64 | struct pci_dev *pcidev; /* device one */ |
65 | struct pci_dev *bridge_dev; | 65 | struct pci_dev *bridge_dev; |
66 | u8 __iomem *registers; | 66 | u8 __iomem *registers; |
67 | phys_addr_t gtt_bus_addr; | 67 | phys_addr_t gtt_phys_addr; |
68 | u32 PGETBL_save; | 68 | u32 PGETBL_save; |
69 | u32 __iomem *gtt; /* I915G */ | 69 | u32 __iomem *gtt; /* I915G */ |
70 | bool clear_fake_agp; /* on first access via agp, fill with scratch */ | 70 | bool clear_fake_agp; /* on first access via agp, fill with scratch */ |
@@ -172,7 +172,7 @@ static void i8xx_destroy_pages(struct page *page) | |||
172 | #define I810_GTT_ORDER 4 | 172 | #define I810_GTT_ORDER 4 |
173 | static int i810_setup(void) | 173 | static int i810_setup(void) |
174 | { | 174 | { |
175 | u32 reg_addr; | 175 | phys_addr_t reg_addr; |
176 | char *gtt_table; | 176 | char *gtt_table; |
177 | 177 | ||
178 | /* i81x does not preallocate the gtt. It's always 64kb in size. */ | 178 | /* i81x does not preallocate the gtt. It's always 64kb in size. */ |
@@ -181,8 +181,7 @@ static int i810_setup(void) | |||
181 | return -ENOMEM; | 181 | return -ENOMEM; |
182 | intel_private.i81x_gtt_table = gtt_table; | 182 | intel_private.i81x_gtt_table = gtt_table; |
183 | 183 | ||
184 | pci_read_config_dword(intel_private.pcidev, I810_MMADDR, ®_addr); | 184 | reg_addr = pci_resource_start(intel_private.pcidev, I810_MMADR_BAR); |
185 | reg_addr &= 0xfff80000; | ||
186 | 185 | ||
187 | intel_private.registers = ioremap(reg_addr, KB(64)); | 186 | intel_private.registers = ioremap(reg_addr, KB(64)); |
188 | if (!intel_private.registers) | 187 | if (!intel_private.registers) |
@@ -191,7 +190,7 @@ static int i810_setup(void) | |||
191 | writel(virt_to_phys(gtt_table) | I810_PGETBL_ENABLED, | 190 | writel(virt_to_phys(gtt_table) | I810_PGETBL_ENABLED, |
192 | intel_private.registers+I810_PGETBL_CTL); | 191 | intel_private.registers+I810_PGETBL_CTL); |
193 | 192 | ||
194 | intel_private.gtt_bus_addr = reg_addr + I810_PTE_BASE; | 193 | intel_private.gtt_phys_addr = reg_addr + I810_PTE_BASE; |
195 | 194 | ||
196 | if ((readl(intel_private.registers+I810_DRAM_CTL) | 195 | if ((readl(intel_private.registers+I810_DRAM_CTL) |
197 | & I810_DRAM_ROW_0) == I810_DRAM_ROW_0_SDRAM) { | 196 | & I810_DRAM_ROW_0) == I810_DRAM_ROW_0_SDRAM) { |
@@ -608,9 +607,8 @@ static bool intel_gtt_can_wc(void) | |||
608 | 607 | ||
609 | static int intel_gtt_init(void) | 608 | static int intel_gtt_init(void) |
610 | { | 609 | { |
611 | u32 gma_addr; | ||
612 | u32 gtt_map_size; | 610 | u32 gtt_map_size; |
613 | int ret; | 611 | int ret, bar; |
614 | 612 | ||
615 | ret = intel_private.driver->setup(); | 613 | ret = intel_private.driver->setup(); |
616 | if (ret != 0) | 614 | if (ret != 0) |
@@ -636,10 +634,10 @@ static int intel_gtt_init(void) | |||
636 | 634 | ||
637 | intel_private.gtt = NULL; | 635 | intel_private.gtt = NULL; |
638 | if (intel_gtt_can_wc()) | 636 | if (intel_gtt_can_wc()) |
639 | intel_private.gtt = ioremap_wc(intel_private.gtt_bus_addr, | 637 | intel_private.gtt = ioremap_wc(intel_private.gtt_phys_addr, |
640 | gtt_map_size); | 638 | gtt_map_size); |
641 | if (intel_private.gtt == NULL) | 639 | if (intel_private.gtt == NULL) |
642 | intel_private.gtt = ioremap(intel_private.gtt_bus_addr, | 640 | intel_private.gtt = ioremap(intel_private.gtt_phys_addr, |
643 | gtt_map_size); | 641 | gtt_map_size); |
644 | if (intel_private.gtt == NULL) { | 642 | if (intel_private.gtt == NULL) { |
645 | intel_private.driver->cleanup(); | 643 | intel_private.driver->cleanup(); |
@@ -660,14 +658,11 @@ static int intel_gtt_init(void) | |||
660 | } | 658 | } |
661 | 659 | ||
662 | if (INTEL_GTT_GEN <= 2) | 660 | if (INTEL_GTT_GEN <= 2) |
663 | pci_read_config_dword(intel_private.pcidev, I810_GMADDR, | 661 | bar = I810_GMADR_BAR; |
664 | &gma_addr); | ||
665 | else | 662 | else |
666 | pci_read_config_dword(intel_private.pcidev, I915_GMADDR, | 663 | bar = I915_GMADR_BAR; |
667 | &gma_addr); | ||
668 | |||
669 | intel_private.gma_bus_addr = (gma_addr & PCI_BASE_ADDRESS_MEM_MASK); | ||
670 | 664 | ||
665 | intel_private.gma_bus_addr = pci_bus_address(intel_private.pcidev, bar); | ||
671 | return 0; | 666 | return 0; |
672 | } | 667 | } |
673 | 668 | ||
@@ -787,16 +782,15 @@ EXPORT_SYMBOL(intel_enable_gtt); | |||
787 | 782 | ||
788 | static int i830_setup(void) | 783 | static int i830_setup(void) |
789 | { | 784 | { |
790 | u32 reg_addr; | 785 | phys_addr_t reg_addr; |
791 | 786 | ||
792 | pci_read_config_dword(intel_private.pcidev, I810_MMADDR, ®_addr); | 787 | reg_addr = pci_resource_start(intel_private.pcidev, I810_MMADR_BAR); |
793 | reg_addr &= 0xfff80000; | ||
794 | 788 | ||
795 | intel_private.registers = ioremap(reg_addr, KB(64)); | 789 | intel_private.registers = ioremap(reg_addr, KB(64)); |
796 | if (!intel_private.registers) | 790 | if (!intel_private.registers) |
797 | return -ENOMEM; | 791 | return -ENOMEM; |
798 | 792 | ||
799 | intel_private.gtt_bus_addr = reg_addr + I810_PTE_BASE; | 793 | intel_private.gtt_phys_addr = reg_addr + I810_PTE_BASE; |
800 | 794 | ||
801 | return 0; | 795 | return 0; |
802 | } | 796 | } |
@@ -1108,12 +1102,10 @@ static void i965_write_entry(dma_addr_t addr, | |||
1108 | 1102 | ||
1109 | static int i9xx_setup(void) | 1103 | static int i9xx_setup(void) |
1110 | { | 1104 | { |
1111 | u32 reg_addr, gtt_addr; | 1105 | phys_addr_t reg_addr; |
1112 | int size = KB(512); | 1106 | int size = KB(512); |
1113 | 1107 | ||
1114 | pci_read_config_dword(intel_private.pcidev, I915_MMADDR, ®_addr); | 1108 | reg_addr = pci_resource_start(intel_private.pcidev, I915_MMADR_BAR); |
1115 | |||
1116 | reg_addr &= 0xfff80000; | ||
1117 | 1109 | ||
1118 | intel_private.registers = ioremap(reg_addr, size); | 1110 | intel_private.registers = ioremap(reg_addr, size); |
1119 | if (!intel_private.registers) | 1111 | if (!intel_private.registers) |
@@ -1121,15 +1113,14 @@ static int i9xx_setup(void) | |||
1121 | 1113 | ||
1122 | switch (INTEL_GTT_GEN) { | 1114 | switch (INTEL_GTT_GEN) { |
1123 | case 3: | 1115 | case 3: |
1124 | pci_read_config_dword(intel_private.pcidev, | 1116 | intel_private.gtt_phys_addr = |
1125 | I915_PTEADDR, >t_addr); | 1117 | pci_resource_start(intel_private.pcidev, I915_PTE_BAR); |
1126 | intel_private.gtt_bus_addr = gtt_addr; | ||
1127 | break; | 1118 | break; |
1128 | case 5: | 1119 | case 5: |
1129 | intel_private.gtt_bus_addr = reg_addr + MB(2); | 1120 | intel_private.gtt_phys_addr = reg_addr + MB(2); |
1130 | break; | 1121 | break; |
1131 | default: | 1122 | default: |
1132 | intel_private.gtt_bus_addr = reg_addr + KB(512); | 1123 | intel_private.gtt_phys_addr = reg_addr + KB(512); |
1133 | break; | 1124 | break; |
1134 | } | 1125 | } |
1135 | 1126 | ||
diff --git a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c index be42a2312dc9..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) | |||
106 | { | 106 | { |
107 | int i, rc, num_dirs; | 107 | int i, rc, num_dirs; |
108 | u32 apbase, aplimit; | 108 | u32 apbase, aplimit; |
109 | phys_addr_t apbase_phys; | ||
109 | struct aper_size_info_8 *current_size; | 110 | struct aper_size_info_8 *current_size; |
110 | u32 temp; | 111 | u32 temp; |
111 | 112 | ||
@@ -115,9 +116,8 @@ static int nvidia_configure(void) | |||
115 | pci_write_config_byte(agp_bridge->dev, NVIDIA_0_APSIZE, | 116 | pci_write_config_byte(agp_bridge->dev, NVIDIA_0_APSIZE, |
116 | current_size->size_value); | 117 | current_size->size_value); |
117 | 118 | ||
118 | /* address to map to */ | 119 | /* address to map to */ |
119 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &apbase); | 120 | apbase = pci_bus_address(agp_bridge->dev, AGP_APERTURE_BAR); |
120 | apbase &= PCI_BASE_ADDRESS_MEM_MASK; | ||
121 | agp_bridge->gart_bus_addr = apbase; | 121 | agp_bridge->gart_bus_addr = apbase; |
122 | aplimit = apbase + (current_size->size * 1024 * 1024) - 1; | 122 | aplimit = apbase + (current_size->size * 1024 * 1024) - 1; |
123 | pci_write_config_dword(nvidia_private.dev_2, NVIDIA_2_APBASE, apbase); | 123 | pci_write_config_dword(nvidia_private.dev_2, NVIDIA_2_APBASE, apbase); |
@@ -153,8 +153,9 @@ static int nvidia_configure(void) | |||
153 | pci_write_config_dword(agp_bridge->dev, NVIDIA_0_APSIZE, temp | 0x100); | 153 | pci_write_config_dword(agp_bridge->dev, NVIDIA_0_APSIZE, temp | 0x100); |
154 | 154 | ||
155 | /* map aperture */ | 155 | /* map aperture */ |
156 | apbase_phys = pci_resource_start(agp_bridge->dev, AGP_APERTURE_BAR); | ||
156 | nvidia_private.aperture = | 157 | nvidia_private.aperture = |
157 | (volatile u32 __iomem *) ioremap(apbase, 33 * PAGE_SIZE); | 158 | (volatile u32 __iomem *) ioremap(apbase_phys, 33 * PAGE_SIZE); |
158 | 159 | ||
159 | if (!nvidia_private.aperture) | 160 | if (!nvidia_private.aperture) |
160 | return -ENOMEM; | 161 | return -ENOMEM; |
diff --git a/drivers/char/agp/sis-agp.c b/drivers/char/agp/sis-agp.c index 79c838c434bc..2c74038da459 100644 --- a/drivers/char/agp/sis-agp.c +++ b/drivers/char/agp/sis-agp.c | |||
@@ -50,13 +50,12 @@ static void sis_tlbflush(struct agp_memory *mem) | |||
50 | 50 | ||
51 | static int sis_configure(void) | 51 | static int sis_configure(void) |
52 | { | 52 | { |
53 | u32 temp; | ||
54 | struct aper_size_info_8 *current_size; | 53 | struct aper_size_info_8 *current_size; |
55 | 54 | ||
56 | current_size = A_SIZE_8(agp_bridge->current_size); | 55 | current_size = A_SIZE_8(agp_bridge->current_size); |
57 | pci_write_config_byte(agp_bridge->dev, SIS_TLBCNTRL, 0x05); | 56 | pci_write_config_byte(agp_bridge->dev, SIS_TLBCNTRL, 0x05); |
58 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | 57 | agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev, |
59 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | 58 | AGP_APERTURE_BAR); |
60 | pci_write_config_dword(agp_bridge->dev, SIS_ATTBASE, | 59 | pci_write_config_dword(agp_bridge->dev, SIS_ATTBASE, |
61 | agp_bridge->gatt_bus_addr); | 60 | agp_bridge->gatt_bus_addr); |
62 | pci_write_config_byte(agp_bridge->dev, SIS_APSIZE, | 61 | pci_write_config_byte(agp_bridge->dev, SIS_APSIZE, |
diff --git a/drivers/char/agp/via-agp.c b/drivers/char/agp/via-agp.c index 74d3aa3773bf..228f20cddc05 100644 --- a/drivers/char/agp/via-agp.c +++ b/drivers/char/agp/via-agp.c | |||
@@ -43,16 +43,15 @@ static int via_fetch_size(void) | |||
43 | 43 | ||
44 | static int via_configure(void) | 44 | static int via_configure(void) |
45 | { | 45 | { |
46 | u32 temp; | ||
47 | struct aper_size_info_8 *current_size; | 46 | struct aper_size_info_8 *current_size; |
48 | 47 | ||
49 | current_size = A_SIZE_8(agp_bridge->current_size); | 48 | current_size = A_SIZE_8(agp_bridge->current_size); |
50 | /* aperture size */ | 49 | /* aperture size */ |
51 | pci_write_config_byte(agp_bridge->dev, VIA_APSIZE, | 50 | pci_write_config_byte(agp_bridge->dev, VIA_APSIZE, |
52 | current_size->size_value); | 51 | current_size->size_value); |
53 | /* address to map too */ | 52 | /* address to map to */ |
54 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | 53 | agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev, |
55 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | 54 | AGP_APERTURE_BAR); |
56 | 55 | ||
57 | /* GART control register */ | 56 | /* GART control register */ |
58 | pci_write_config_dword(agp_bridge->dev, VIA_GARTCTRL, 0x0000000f); | 57 | pci_write_config_dword(agp_bridge->dev, VIA_GARTCTRL, 0x0000000f); |
@@ -132,9 +131,9 @@ static int via_configure_agp3(void) | |||
132 | 131 | ||
133 | current_size = A_SIZE_16(agp_bridge->current_size); | 132 | current_size = A_SIZE_16(agp_bridge->current_size); |
134 | 133 | ||
135 | /* address to map too */ | 134 | /* address to map to */ |
136 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | 135 | agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev, |
137 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | 136 | AGP_APERTURE_BAR); |
138 | 137 | ||
139 | /* attbase - aperture GATT base */ | 138 | /* attbase - aperture GATT base */ |
140 | pci_write_config_dword(agp_bridge->dev, VIA_AGP3_ATTBASE, | 139 | pci_write_config_dword(agp_bridge->dev, VIA_AGP3_ATTBASE, |