pci.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Copyright (c) 2008 Zhang Le <[email protected]>
  4. * Copyright (c) 2009 Wu Zhangjin <[email protected]>
  5. */
  6. #ifndef __ASM_MACH_LOONGSON2EF_PCI_H_
  7. #define __ASM_MACH_LOONGSON2EF_PCI_H_
  8. extern struct pci_ops loongson_pci_ops;
  9. /* this is an offset from mips_io_port_base */
  10. #define LOONGSON_PCI_IO_START 0x00004000UL
  11. #ifdef CONFIG_CPU_SUPPORTS_ADDRWINCFG
  12. /*
  13. * we use address window2 to map cpu address space to pci space
  14. * window2: cpu [1G, 2G] -> pci [1G, 2G]
  15. * why not use window 0 & 1? because they are used by cpu when booting.
  16. * window0: cpu [0, 256M] -> ddr [0, 256M]
  17. * window1: cpu [256M, 512M] -> pci [256M, 512M]
  18. */
  19. /* the smallest LOONGSON_CPU_MEM_SRC can be 512M */
  20. #define LOONGSON_CPU_MEM_SRC 0x40000000ul /* 1G */
  21. #define LOONGSON_PCI_MEM_DST LOONGSON_CPU_MEM_SRC
  22. #define LOONGSON_PCI_MEM_START LOONGSON_PCI_MEM_DST
  23. #define LOONGSON_PCI_MEM_END (0x80000000ul-1) /* 2G */
  24. #define MMAP_CPUTOPCI_SIZE (LOONGSON_PCI_MEM_END - \
  25. LOONGSON_PCI_MEM_START + 1)
  26. #else /* loongson2f/32bit & loongson2e */
  27. /* this pci memory space is mapped by pcimap in pci.c */
  28. #define LOONGSON_PCI_MEM_START LOONGSON_PCILO1_BASE
  29. #define LOONGSON_PCI_MEM_END (LOONGSON_PCILO1_BASE + 0x04000000 * 2)
  30. /* this is an offset from mips_io_port_base */
  31. #define LOONGSON_PCI_IO_START 0x00004000UL
  32. #endif /* !CONFIG_CPU_SUPPORTS_ADDRWINCFG */
  33. #endif /* !__ASM_MACH_LOONGSON2EF_PCI_H_ */