device.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
  4. */
  5. #ifndef _QUARK_DEVICE_H_
  6. #define _QUARK_DEVICE_H_
  7. /*
  8. * Internal PCI device numbers within the SoC.
  9. *
  10. * Note it must start with 0x_ prefix, as the device number macro will be
  11. * included in the ACPI ASL files (see irq_helper.h and irq_route.h).
  12. */
  13. #define QUARK_HOST_BRIDGE_DEV 0x00
  14. #define QUARK_HOST_BRIDGE_FUNC 0
  15. #define QUARK_DEV_20 0x14
  16. #define QUARK_MMC_SDIO_FUNC 0
  17. #define QUARK_UART0_FUNC 1
  18. #define QUARK_USB_DEVICE_FUNC 2
  19. #define QUARK_USB_EHCI_FUNC 3
  20. #define QUARK_USB_OHCI_FUNC 4
  21. #define QUARK_UART1_FUNC 5
  22. #define QUARK_EMAC0_FUNC 6
  23. #define QUARK_EMAC1_FUNC 7
  24. #define QUARK_DEV_21 0x15
  25. #define QUARK_SPI0_FUNC 0
  26. #define QUARK_SPI1_FUNC 1
  27. #define QUARK_I2C_GPIO_FUNC 2
  28. #define QUARK_DEV_23 0x17
  29. #define QUARK_PCIE0_FUNC 0
  30. #define QUARK_PCIE1_FUNC 1
  31. #define QUARK_LGC_BRIDGE_DEV 0x1f
  32. #define QUARK_LGC_BRIDGE_FUNC 0
  33. #ifndef __ASSEMBLY__
  34. #include <pci.h>
  35. #define QUARK_HOST_BRIDGE \
  36. PCI_BDF(0, QUARK_HOST_BRIDGE_DEV, QUARK_HOST_BRIDGE_FUNC)
  37. #define QUARK_MMC_SDIO \
  38. PCI_BDF(0, QUARK_DEV_20, QUARK_MMC_SDIO_FUNC)
  39. #define QUARK_UART0 \
  40. PCI_BDF(0, QUARK_DEV_20, QUARK_UART0_FUNC)
  41. #define QUARK_USB_DEVICE \
  42. PCI_BDF(0, QUARK_DEV_20, QUARK_USB_DEVICE_FUNC)
  43. #define QUARK_USB_EHCI \
  44. PCI_BDF(0, QUARK_DEV_20, QUARK_USB_EHCI_FUNC)
  45. #define QUARK_USB_OHCI \
  46. PCI_BDF(0, QUARK_DEV_20, QUARK_USB_OHCI_FUNC)
  47. #define QUARK_UART1 \
  48. PCI_BDF(0, QUARK_DEV_20, QUARK_UART1_FUNC)
  49. #define QUARK_EMAC0 \
  50. PCI_BDF(0, QUARK_DEV_20, QUARK_EMAC0_FUNC)
  51. #define QUARK_EMAC1 \
  52. PCI_BDF(0, QUARK_DEV_20, QUARK_EMAC1_FUNC)
  53. #define QUARK_SPI0 \
  54. PCI_BDF(0, QUARK_DEV_21, QUARK_SPI0_FUNC)
  55. #define QUARK_SPI1 \
  56. PCI_BDF(0, QUARK_DEV_21, QUARK_SPI1_FUNC)
  57. #define QUARK_I2C_GPIO \
  58. PCI_BDF(0, QUARK_DEV_21, QUARK_I2C_GPIO_FUNC)
  59. #define QUARK_PCIE0 \
  60. PCI_BDF(0, QUARK_DEV_23, QUARK_PCIE0_FUNC)
  61. #define QUARK_PCIE1 \
  62. PCI_BDF(0, QUARK_DEV_23, QUARK_PCIE1_FUNC)
  63. #define QUARK_LEGACY_BRIDGE \
  64. PCI_BDF(0, QUARK_LGC_BRIDGE_DEV, QUARK_LGC_BRIDGE_FUNC)
  65. #endif /* __ASSEMBLY__ */
  66. #endif /* _QUARK_DEVICE_H_ */