1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * Copyright (C) 2003, 04, 11 Ralf Baechle (ralf@linux-mips.org)
5 * Copyright (C) 2011 Wind River Systems,
6 * written by Ralf Baechle (ralf@linux-mips.org)
9 #include <linux/kernel.h>
11 #include <linux/memblock.h>
12 #include <linux/export.h>
13 #include <linux/init.h>
14 #include <linux/types.h>
15 #include <linux/pci.h>
16 #include <linux/of_address.h>
18 #include <asm/cpu-info.h>
20 unsigned long PCIBIOS_MIN_IO
;
21 EXPORT_SYMBOL(PCIBIOS_MIN_IO
);
23 unsigned long PCIBIOS_MIN_MEM
;
24 EXPORT_SYMBOL(PCIBIOS_MIN_MEM
);
26 static int __init
pcibios_set_cache_line_size(void)
31 * Set PCI cacheline size to that of the highest level in the
34 lsize
= cpu_dcache_line_size();
35 lsize
= cpu_scache_line_size() ? : lsize
;
36 lsize
= cpu_tcache_line_size() ? : lsize
;
40 pci_dfl_cache_line_size
= lsize
>> 2;
42 pr_debug("PCI: pci_cache_line_size set to %d bytes\n", lsize
);
45 arch_initcall(pcibios_set_cache_line_size
);
47 void pci_resource_to_user(const struct pci_dev
*dev
, int bar
,
48 const struct resource
*rsrc
, resource_size_t
*start
,
51 phys_addr_t size
= resource_size(rsrc
);
53 *start
= fixup_bigphys_addr(rsrc
->start
, size
);
54 *end
= rsrc
->start
+ size
- 1;