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