aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/parisc/kernel/pci.c')
-rw-r--r--arch/parisc/kernel/pci.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c
index f7064abc3bb..38372e7cbb8 100644
--- a/arch/parisc/kernel/pci.c
+++ b/arch/parisc/kernel/pci.c
@@ -18,7 +18,6 @@
18 18
19#include <asm/io.h> 19#include <asm/io.h>
20#include <asm/system.h> 20#include <asm/system.h>
21#include <asm/cache.h> /* for L1_CACHE_BYTES */
22#include <asm/superio.h> 21#include <asm/superio.h>
23 22
24#define DEBUG_RESOURCES 0 23#define DEBUG_RESOURCES 0
@@ -123,6 +122,10 @@ static int __init pcibios_init(void)
123 } else { 122 } else {
124 printk(KERN_WARNING "pci_bios != NULL but init() is!\n"); 123 printk(KERN_WARNING "pci_bios != NULL but init() is!\n");
125 } 124 }
125
126 /* Set the CLS for PCI as early as possible. */
127 pci_cache_line_size = pci_dfl_cache_line_size;
128
126 return 0; 129 return 0;
127} 130}
128 131
@@ -171,7 +174,7 @@ void pcibios_set_master(struct pci_dev *dev)
171 ** upper byte is PCI_LATENCY_TIMER. 174 ** upper byte is PCI_LATENCY_TIMER.
172 */ 175 */
173 pci_write_config_word(dev, PCI_CACHE_LINE_SIZE, 176 pci_write_config_word(dev, PCI_CACHE_LINE_SIZE,
174 (0x80 << 8) | (L1_CACHE_BYTES / sizeof(u32))); 177 (0x80 << 8) | pci_cache_line_size);
175} 178}
176 179
177 180
@@ -254,10 +257,10 @@ EXPORT_SYMBOL(pcibios_bus_to_resource);
254 * Since we are just checking candidates, don't use any fields other 257 * Since we are just checking candidates, don't use any fields other
255 * than res->start. 258 * than res->start.
256 */ 259 */
257void pcibios_align_resource(void *data, struct resource *res, 260resource_size_t pcibios_align_resource(void *data, const struct resource *res,
258 resource_size_t size, resource_size_t alignment) 261 resource_size_t size, resource_size_t alignment)
259{ 262{
260 resource_size_t mask, align; 263 resource_size_t mask, align, start = res->start;
261 264
262 DBG_RES("pcibios_align_resource(%s, (%p) [%lx,%lx]/%x, 0x%lx, 0x%lx)\n", 265 DBG_RES("pcibios_align_resource(%s, (%p) [%lx,%lx]/%x, 0x%lx, 0x%lx)\n",
263 pci_name(((struct pci_dev *) data)), 266 pci_name(((struct pci_dev *) data)),
@@ -269,10 +272,10 @@ void pcibios_align_resource(void *data, struct resource *res,
269 272
270 /* Align to largest of MIN or input size */ 273 /* Align to largest of MIN or input size */
271 mask = max(alignment, align) - 1; 274 mask = max(alignment, align) - 1;
272 res->start += mask; 275 start += mask;
273 res->start &= ~mask; 276 start &= ~mask;
274 277
275 /* The caller updates the end field, we don't. */ 278 return start;
276} 279}
277 280
278 281