Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

183 lines
6.5 KiB

  1. /*----------------------------------------------------------------------*
  2. * cyclomz.h: Cyclades-Z hardware-related definitions. *
  3. * *
  4. * revision 1.0 03/14/95 Marcio Saito *
  5. * revision 2.0 01/04/96 Marcio Saito Changes due to HW design *
  6. * alterations. *
  7. * revision 2.1 03/15/96 Marcio Saito Changes due to HW design *
  8. * alterations. *
  9. * revision 3.0 04/11/97 Ivan Passos Changes to support the *
  10. * new boards (8Zo and Ze). *
  11. *----------------------------------------------------------------------*/
  12. /*
  13. * The data types defined below are used in all ZFIRM interface
  14. * data structures. They accomodate differences between HW
  15. * architectures and compilers.
  16. */
  17. typedef unsigned long uclong; /* 32 bits, unsigned */
  18. typedef unsigned short ucshort; /* 16 bits, unsigned */
  19. typedef unsigned char ucchar; /* 8 bits, unsigned */
  20. /*
  21. * Memory Window Sizes
  22. */
  23. #define DP_WINDOW_SIZE (0x00080000) /* window size 512 Kb */
  24. #define ZE_DP_WINDOW_SIZE (0x00100000) /* window size 1 Mb (for the
  25. Ze V_1 and 8Zo V_2) */
  26. #define CTRL_WINDOW_SIZE (0x00000080) /* runtime regs 128 bytes */
  27. /*
  28. * CUSTOM_REG - Cyclades-8Zo/PCI Custom Registers Set. The driver
  29. * normally will access only interested on the fpga_id, fpga_version,
  30. * start_cpu and stop_cpu.
  31. */
  32. struct CUSTOM_REG {
  33. uclong fpga_id; /* FPGA Identification Register */
  34. uclong fpga_version; /* FPGA Version Number Register */
  35. uclong cpu_start; /* CPU start Register (write) */
  36. uclong cpu_stop; /* CPU stop Register (write) */
  37. uclong misc_reg; /* Miscelaneous Register */
  38. uclong idt_mode; /* IDT mode Register */
  39. uclong uart_irq_status; /* UART IRQ status Register */
  40. uclong clear_timer0_irq; /* Clear timer interrupt Register */
  41. uclong clear_timer1_irq; /* Clear timer interrupt Register */
  42. uclong clear_timer2_irq; /* Clear timer interrupt Register */
  43. uclong test_register; /* Test Register */
  44. uclong test_count; /* Test Count Register */
  45. uclong timer_select; /* Timer select register */
  46. uclong pr_uart_irq_status; /* Prioritized UART IRQ stat Reg */
  47. uclong ram_wait_state; /* RAM wait-state Register */
  48. uclong uart_wait_state; /* UART wait-state Register */
  49. uclong timer_wait_state; /* timer wait-state Register */
  50. uclong ack_wait_state; /* ACK wait State Register */
  51. };
  52. /*
  53. * CUSTOM_REG_ZE - Cyclades-Ze/PCI Custom Registers Set. The driver
  54. * normally will access only interested on the fpga_id, fpga_version,
  55. * start_cpu and stop_cpu.
  56. */
  57. struct CUSTOM_REG_ZE {
  58. uclong fpga_id; /* FPGA Identification Register */
  59. uclong fpga_version; /* FPGA Version Number Register */
  60. uclong cpu_start; /* CPU start Register (write) */
  61. uclong cpu_stop; /* CPU stop Register (write) */
  62. uclong cpu_ctrl;
  63. uclong zbus_wait; /* Z-Bus wait states */
  64. uclong timer_div; /* Timer divider */
  65. uclong timer_irq_ack; /* Write anything to ack/clear Timer
  66. Interrupt Register */
  67. };
  68. /*
  69. * RUNTIME_9060 - PLX PCI9060ES local configuration and shared runtime
  70. * registers. This structure can be used to access the 9060 registers
  71. * (memory mapped).
  72. */
  73. struct RUNTIME_9060 {
  74. uclong loc_addr_range; /* 00h - Local Address Range */
  75. uclong loc_addr_base; /* 04h - Local Address Base */
  76. uclong loc_arbitr; /* 08h - Local Arbitration */
  77. uclong endian_descr; /* 0Ch - Big/Little Endian Descriptor */
  78. uclong loc_rom_range; /* 10h - Local ROM Range */
  79. uclong loc_rom_base; /* 14h - Local ROM Base */
  80. uclong loc_bus_descr; /* 18h - Local Bus descriptor */
  81. uclong loc_range_mst; /* 1Ch - Local Range for Master to PCI */
  82. uclong loc_base_mst; /* 20h - Local Base for Master PCI */
  83. uclong loc_range_io; /* 24h - Local Range for Master IO */
  84. uclong pci_base_mst; /* 28h - PCI Base for Master PCI */
  85. uclong pci_conf_io; /* 2Ch - PCI configuration for Master IO */
  86. uclong filler1; /* 30h */
  87. uclong filler2; /* 34h */
  88. uclong filler3; /* 38h */
  89. uclong filler4; /* 3Ch */
  90. uclong mail_box_0; /* 40h - Mail Box 0 */
  91. uclong mail_box_1; /* 44h - Mail Box 1 */
  92. uclong mail_box_2; /* 48h - Mail Box 2 */
  93. uclong mail_box_3; /* 4Ch - Mail Box 3 */
  94. uclong filler5; /* 50h */
  95. uclong filler6; /* 54h */
  96. uclong filler7; /* 58h */
  97. uclong filler8; /* 5Ch */
  98. uclong pci_doorbell; /* 60h - PCI to Local Doorbell */
  99. uclong loc_doorbell; /* 64h - Local to PCI Doorbell */
  100. uclong intr_ctrl_stat; /* 68h - Interrupt Control/Status */
  101. uclong init_ctrl; /* 6Ch - EEPROM control, Init Control, etc */
  102. };
  103. /* Values for the Local Base Address re-map register */
  104. #define WIN_RAM 0x00000001L /* set the sliding window to RAM */
  105. #define WIN_CREG 0x14000001L /* set the window to custom Registers */
  106. /* Values timer select registers */
  107. #define TIMER_BY_1M 0x00 /* clock divided by 1M */
  108. #define TIMER_BY_256K 0x01 /* clock divided by 256k */
  109. #define TIMER_BY_128K 0x02 /* clock divided by 128k */
  110. #define TIMER_BY_32K 0x03 /* clock divided by 32k */
  111. /*
  112. * Starting from here, the compilation is conditional to the definition
  113. * of FIRMWARE
  114. */
  115. #ifdef FIRMWARE
  116. struct RUNTIME_9060_FW {
  117. uclong mail_box_0; /* 40h - Mail Box 0 */
  118. uclong mail_box_1; /* 44h - Mail Box 1 */
  119. uclong mail_box_2; /* 48h - Mail Box 2 */
  120. uclong mail_box_3; /* 4Ch - Mail Box 3 */
  121. uclong filler5; /* 50h */
  122. uclong filler6; /* 54h */
  123. uclong filler7; /* 58h */
  124. uclong filler8; /* 5Ch */
  125. uclong pci_doorbell; /* 60h - PCI to Local Doorbell */
  126. uclong loc_doorbell; /* 64h - Local to PCI Doorbell */
  127. uclong intr_ctrl_stat; /* 68h - Interrupt Control/Status */
  128. uclong init_ctrl; /* 6Ch - EEPROM control, Init Control, etc */
  129. };
  130. /* Hardware related constants */
  131. #define ZF_UART_PTR (0xb0000000UL)
  132. #define ZF_UART_SPACE 0x00000080UL
  133. #define ZF_UART_CLOCK 7372800
  134. #define ZO_V1_FPGA_ID 0x95
  135. #define ZO_V2_FPGA_ID 0x84
  136. #define ZE_V1_FPGA_ID 0x89
  137. #define ZF_TIMER_PTR (0xb2000000UL)
  138. #define ZF_9060_PTR (0xb6000000UL)
  139. #define ZF_9060_ZE_PTR (0xb8000000UL)
  140. #define ZF_CUSTOM_PTR (0xb4000000UL)
  141. #define ZF_NO_CACHE (0xa0000000UL)
  142. #define ZF_CACHE (0x80000000UL)
  143. #define ZF_I_TIMER (EXT_INT0)
  144. #define ZF_I_SERIAL (EXT_INT2)
  145. #define ZF_I_HOST (EXT_INT3)
  146. #define ZF_I_ALL (EXT_INT0|EXT_INT2|EXT_INT3)
  147. #define ZF_I_TOTAL (EXT_INT0|EXT_INT1|EXT_INT2|EXT_INT3|EXT_INT4|EXT_INT5)
  148. #define ZF_IRQ03 0xfffffffeUL
  149. #define ZF_IRQ05 0xfffffffdUL
  150. #define ZF_IRQ09 0xfffffffbUL
  151. #define ZF_IRQ10 0xfffffff7UL
  152. #define ZF_IRQ11 0xffffffefUL
  153. #define ZF_IRQ12 0xffffffdfUL
  154. #define ZF_IRQ15 0xffffffbfUL
  155. #endif /* FIRMWARE */
  156.