1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (C) 2020 Loongson Technology Co., Ltd.
4  */
5 #ifndef _ASM_PCI_H
6 #define _ASM_PCI_H
7 
8 #include <linux/mm.h>
9 
10 /*
11  * This file essentially defines the interface between board specific
12  * PCI code and LoongArch common PCI code. Should potentially put into
13  * include/asm/pci.h file.
14  */
15 
16 #include <linux/ioport.h>
17 #include <linux/list.h>
18 
19 extern phys_addr_t mcfg_addr_init(int node);
20 
21 /* Can be used to override the logic in pci_scan_bus for skipping
22    already-configured bus numbers - to be used for buggy BIOSes
23    or architectures with incomplete PCI setup by the loader */
pcibios_assign_all_busses(void)24 static inline unsigned int pcibios_assign_all_busses(void)
25 {
26 	return 0;
27 }
28 
29 #define PCIBIOS_MIN_IO		0x4000
30 #define PCIBIOS_MIN_MEM		0x20000000
31 #define PCIBIOS_MIN_CARDBUS_IO	0x4000
32 
33 #define HAVE_PCI_MMAP
34 #define ARCH_GENERIC_PCI_MMAP_RESOURCE
35 
36 /*
37  * Dynamic DMA mapping stuff.
38  * LoongArch has everything mapped statically.
39  */
40 
41 #include <linux/types.h>
42 #include <linux/slab.h>
43 #include <linux/scatterlist.h>
44 #include <linux/string.h>
45 #include <asm/io.h>
46 
pci_proc_domain(struct pci_bus *bus)47 static inline int pci_proc_domain(struct pci_bus *bus)
48 {
49 	return 1; /* always show the domain in /proc */
50 }
51 
52 /* generic pci stuff */
53 #include <asm-generic/pci.h>
54 
55 #endif /* _ASM_PCI_H */
56