Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * Copyright (c) 2008 Zhang Le <r0bertz@gentoo.org>
0004  * Copyright (c) 2009 Wu Zhangjin <wuzhangjin@gmail.com>
0005  */
0006 
0007 #ifndef __ASM_MACH_LOONGSON2EF_PCI_H_
0008 #define __ASM_MACH_LOONGSON2EF_PCI_H_
0009 
0010 extern struct pci_ops loongson_pci_ops;
0011 
0012 /* this is an offset from mips_io_port_base */
0013 #define LOONGSON_PCI_IO_START   0x00004000UL
0014 
0015 #ifdef CONFIG_CPU_SUPPORTS_ADDRWINCFG
0016 
0017 /*
0018  * we use address window2 to map cpu address space to pci space
0019  * window2: cpu [1G, 2G] -> pci [1G, 2G]
0020  * why not use window 0 & 1? because they are used by cpu when booting.
0021  * window0: cpu [0, 256M] -> ddr [0, 256M]
0022  * window1: cpu [256M, 512M] -> pci [256M, 512M]
0023  */
0024 
0025 /* the smallest LOONGSON_CPU_MEM_SRC can be 512M */
0026 #define LOONGSON_CPU_MEM_SRC    0x40000000ul        /* 1G */
0027 #define LOONGSON_PCI_MEM_DST    LOONGSON_CPU_MEM_SRC
0028 
0029 #define LOONGSON_PCI_MEM_START  LOONGSON_PCI_MEM_DST
0030 #define LOONGSON_PCI_MEM_END    (0x80000000ul-1)    /* 2G */
0031 
0032 #define MMAP_CPUTOPCI_SIZE  (LOONGSON_PCI_MEM_END - \
0033                     LOONGSON_PCI_MEM_START + 1)
0034 
0035 #else   /* loongson2f/32bit & loongson2e */
0036 
0037 /* this pci memory space is mapped by pcimap in pci.c */
0038 #define LOONGSON_PCI_MEM_START  LOONGSON_PCILO1_BASE
0039 #define LOONGSON_PCI_MEM_END    (LOONGSON_PCILO1_BASE + 0x04000000 * 2)
0040 
0041 /* this is an offset from mips_io_port_base */
0042 #define LOONGSON_PCI_IO_START   0x00004000UL
0043 
0044 #endif  /* !CONFIG_CPU_SUPPORTS_ADDRWINCFG */
0045 
0046 #endif /* !__ASM_MACH_LOONGSON2EF_PCI_H_ */