cs5536_pci.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /*
  2. * the definition file of cs5536 Virtual Support Module(VSM).
  3. * pci configuration space can be accessed through the VSM, so
  4. * there is no need of the MSR read/write now, except the spec.
  5. * MSR registers which are not implemented yet.
  6. *
  7. * Copyright (C) 2007 Lemote Inc.
  8. * Author : jlliu, liujl@lemote.com
  9. */
  10. #ifndef _CS5536_PCI_H
  11. #define _CS5536_PCI_H
  12. #include <linux/types.h>
  13. #include <linux/pci_regs.h>
  14. extern void cs5536_pci_conf_write4(int function, int reg, u32 value);
  15. extern u32 cs5536_pci_conf_read4(int function, int reg);
  16. #define CS5536_ACC_INTR 9
  17. #define CS5536_IDE_INTR 14
  18. #define CS5536_USB_INTR 11
  19. #define CS5536_MFGPT_INTR 5
  20. #define CS5536_UART1_INTR 4
  21. #define CS5536_UART2_INTR 3
  22. /************** PCI BUS DEVICE FUNCTION ***************/
  23. /*
  24. * PCI bus device function
  25. */
  26. #define PCI_BUS_CS5536 0
  27. #define PCI_IDSEL_CS5536 14
  28. /********** STANDARD PCI-2.2 EXPANSION ****************/
  29. /*
  30. * PCI configuration space
  31. * we have to virtualize the PCI configure space head, so we should
  32. * define the necessary IDs and some others.
  33. */
  34. /* CONFIG of PCI VENDOR ID*/
  35. #define CFG_PCI_VENDOR_ID(mod_dev_id, sys_vendor_id) \
  36. (((mod_dev_id) << 16) | (sys_vendor_id))
  37. /* VENDOR ID */
  38. #define CS5536_VENDOR_ID 0x1022
  39. /* DEVICE ID */
  40. #define CS5536_ISA_DEVICE_ID 0x2090
  41. #define CS5536_IDE_DEVICE_ID 0x209a
  42. #define CS5536_ACC_DEVICE_ID 0x2093
  43. #define CS5536_OHCI_DEVICE_ID 0x2094
  44. #define CS5536_EHCI_DEVICE_ID 0x2095
  45. /* CLASS CODE : CLASS SUB-CLASS INTERFACE */
  46. #define CS5536_ISA_CLASS_CODE 0x060100
  47. #define CS5536_IDE_CLASS_CODE 0x010180
  48. #define CS5536_ACC_CLASS_CODE 0x040100
  49. #define CS5536_OHCI_CLASS_CODE 0x0C0310
  50. #define CS5536_EHCI_CLASS_CODE 0x0C0320
  51. /* BHLC : BIST HEADER-TYPE LATENCY-TIMER CACHE-LINE-SIZE */
  52. #define CFG_PCI_CACHE_LINE_SIZE(header_type, latency_timer) \
  53. ((PCI_NONE_BIST << 24) | ((header_type) << 16) \
  54. | ((latency_timer) << 8) | PCI_NORMAL_CACHE_LINE_SIZE);
  55. #define PCI_NONE_BIST 0x00 /* RO not implemented yet. */
  56. #define PCI_BRIDGE_HEADER_TYPE 0x80 /* RO */
  57. #define PCI_NORMAL_HEADER_TYPE 0x00
  58. #define PCI_NORMAL_LATENCY_TIMER 0x00
  59. #define PCI_NORMAL_CACHE_LINE_SIZE 0x08 /* RW */
  60. /* BAR */
  61. #define PCI_BAR0_REG 0x10
  62. #define PCI_BAR1_REG 0x14
  63. #define PCI_BAR2_REG 0x18
  64. #define PCI_BAR3_REG 0x1c
  65. #define PCI_BAR4_REG 0x20
  66. #define PCI_BAR5_REG 0x24
  67. #define PCI_BAR_COUNT 6
  68. #define PCI_BAR_RANGE_MASK 0xFFFFFFFF
  69. /* CARDBUS CIS POINTER */
  70. #define PCI_CARDBUS_CIS_POINTER 0x00000000
  71. /* SUBSYSTEM VENDOR ID */
  72. #define CS5536_SUB_VENDOR_ID CS5536_VENDOR_ID
  73. /* SUBSYSTEM ID */
  74. #define CS5536_ISA_SUB_ID CS5536_ISA_DEVICE_ID
  75. #define CS5536_IDE_SUB_ID CS5536_IDE_DEVICE_ID
  76. #define CS5536_ACC_SUB_ID CS5536_ACC_DEVICE_ID
  77. #define CS5536_OHCI_SUB_ID CS5536_OHCI_DEVICE_ID
  78. #define CS5536_EHCI_SUB_ID CS5536_EHCI_DEVICE_ID
  79. /* EXPANSION ROM BAR */
  80. #define PCI_EXPANSION_ROM_BAR 0x00000000
  81. /* CAPABILITIES POINTER */
  82. #define PCI_CAPLIST_POINTER 0x00000000
  83. #define PCI_CAPLIST_USB_POINTER 0x40
  84. /* INTERRUPT */
  85. #define CFG_PCI_INTERRUPT_LINE(pin, mod_intr) \
  86. ((PCI_MAX_LATENCY << 24) | (PCI_MIN_GRANT << 16) | \
  87. ((pin) << 8) | (mod_intr))
  88. #define PCI_MAX_LATENCY 0x40
  89. #define PCI_MIN_GRANT 0x00
  90. #define PCI_DEFAULT_PIN 0x01
  91. /*********** EXPANSION PCI REG ************************/
  92. /*
  93. * ISA EXPANSION
  94. */
  95. #define PCI_UART1_INT_REG 0x50
  96. #define PCI_UART2_INT_REG 0x54
  97. #define PCI_ISA_FIXUP_REG 0x58
  98. /*
  99. * IDE EXPANSION
  100. */
  101. #define PCI_IDE_CFG_REG 0x40
  102. #define CS5536_IDE_FLASH_SIGNATURE 0xDEADBEEF
  103. #define PCI_IDE_DTC_REG 0x48
  104. #define PCI_IDE_CAST_REG 0x4C
  105. #define PCI_IDE_ETC_REG 0x50
  106. #define PCI_IDE_PM_REG 0x54
  107. #define PCI_IDE_INT_REG 0x60
  108. /*
  109. * ACC EXPANSION
  110. */
  111. #define PCI_ACC_INT_REG 0x50
  112. /*
  113. * OHCI EXPANSION : INTTERUPT IS IMPLEMENTED BY THE OHCI
  114. */
  115. #define PCI_OHCI_PM_REG 0x40
  116. #define PCI_OHCI_INT_REG 0x50
  117. /*
  118. * EHCI EXPANSION
  119. */
  120. #define PCI_EHCI_LEGSMIEN_REG 0x50
  121. #define PCI_EHCI_LEGSMISTS_REG 0x54
  122. #define PCI_EHCI_FLADJ_REG 0x60
  123. #endif /* _CS5536_PCI_H_ */