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.

186 lines
6.6 KiB

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