Windows NT 4.0 source code leak
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.

722 lines
22 KiB

4 years ago
  1. /*++
  2. Copyright (c) 1993 Digital Equipment Corporation
  3. Module Name:
  4. mikasa.h
  5. Abstract:
  6. This module specifies platform-specific definitions for the
  7. Mikasa modules.
  8. Author:
  9. Joe Notarangelo 25-Oct-1993
  10. Revision History:
  11. James Livingston 29-Apr-1994
  12. Adapted from Avanti module for Mikasa.
  13. Janet Schneider (Digital) 27-July-1995
  14. Added support for the Noritake.
  15. --*/
  16. #ifndef _MIKASA_
  17. #define _MIKASA_
  18. #include "alpharef.h"
  19. #include "apecs.h"
  20. #include "isaaddr.h"
  21. #define NUMBER_MIKASA_EISA_SLOTS 7
  22. #define NUMBER_MIKASA_PCI_SLOTS 3
  23. #define NUMBER_MIKASA_COMBO_SLOTS 1
  24. #define NUMBER_NORITAKE_EISA_SLOTS 2
  25. #define NUMBER_NORITAKE_PCI_SLOTS 7
  26. // Highest local PCI virtual slot number is 13 == IDSEL PCI_AD[24]
  27. #define PCI_MAX_LOCAL_DEVICE 13
  28. #if !defined (_LANGUAGE_ASSEMBLY)
  29. #if !defined (AXP_FIRMWARE)
  30. //
  31. // Define the per-processor data structures allocated in the PCR
  32. // for each EV4 processor.
  33. //
  34. typedef struct _MIKASA_PCR{
  35. ULONGLONG HalpCycleCount; // 64-bit per-processor cycle count
  36. EV4ProfileCount ProfileCount; // Profile counter state, do not move
  37. EV4IrqStatus IrqStatusTable[MaximumIrq]; // Irq status table
  38. } MIKASA_PCR, *PMIKASA_PCR;
  39. #endif
  40. //
  41. // Define the Mikasa server management data structure.
  42. //
  43. typedef union _MIKASA_SRV{
  44. struct {
  45. UCHAR FlashRomEnable : 1; // rw
  46. UCHAR DcPowerDisable : 1; // rw
  47. UCHAR HaltIncoming : 1; // ro
  48. UCHAR TempFail : 1; // ro
  49. UCHAR DcOk1 : 1; // ro
  50. UCHAR DcOk2 : 1; // ro
  51. UCHAR Fan1Fault : 1; // ro
  52. UCHAR Fan2Fault : 1; // ro
  53. };
  54. UCHAR All;
  55. } MIKASA_SRV, *PMIKASA_SRV;
  56. //
  57. // Define the Mikasa interrupt mask register. This is how we enable
  58. // and disable individual PCI interrupts. Actually, it's here more
  59. // for reference, since the interrupt enable/disable is done with a
  60. // computational algorithm.
  61. //
  62. typedef union _MIKASA_IMR{
  63. struct {
  64. ULONG Slot0IntA : 1;
  65. ULONG Slot0IntB : 1;
  66. ULONG Slot0IntC : 1;
  67. ULONG Slot0IntD : 1;
  68. ULONG Slot1IntA : 1;
  69. ULONG Slot1IntB : 1;
  70. ULONG Slot1IntC : 1;
  71. ULONG Slot1IntD : 1;
  72. ULONG Slot2IntA : 1;
  73. ULONG Slot2IntB : 1;
  74. ULONG Slot2IntC : 1;
  75. ULONG Slot2IntD : 1;
  76. ULONG Ncr810Scsi : 1;
  77. ULONG PwrInt : 1;
  78. ULONG TempWarn : 1;
  79. ULONG Reserved : 17;
  80. };
  81. ULONG All;
  82. } MIKASA_IMR, *PMIKASA_IMR;
  83. //
  84. // Define the Noritake server management data structure.
  85. //
  86. typedef union _NORITAKE_SRV{
  87. struct {
  88. UCHAR FlashRomEnable : 1; // rw
  89. UCHAR DcPowerDisable : 1; // rw
  90. UCHAR Reserved1: 2;
  91. UCHAR HaltIncoming : 1; // ro
  92. UCHAR FlashReady: 1; // ro
  93. UCHAR Reserved2: 1;
  94. UCHAR EmbeddedVGAStatus: 1; // rw
  95. };
  96. UCHAR All;
  97. } NORITAKE_SRV, *PNORITAKE_SRV;
  98. //
  99. // Define the Noritake interrupt mask registers. This is how we enable
  100. // and disable individual PCI interrupts. Actually, it's here more
  101. // for reference, since the interrupt enable/disable is done with a
  102. // computational algorithm.
  103. //
  104. //
  105. // Note: Slots 0 through 2 are on PCI bus 0, and slots 3 through 6 are
  106. // on PCI bus 1.
  107. //
  108. typedef union _NORITAKE_IMR1{
  109. struct {
  110. ULONG SumIr2And3 : 1;
  111. ULONG QLogic: 1;
  112. ULONG Slot0IntA : 1;
  113. ULONG Slot0IntB : 1;
  114. ULONG Slot1IntA : 1;
  115. ULONG Slot1IntB : 1;
  116. ULONG Slot2IntA : 1;
  117. ULONG Slot2IntB : 1;
  118. ULONG Slot3IntA : 1;
  119. ULONG Slot3IntB : 1;
  120. ULONG Slot4IntA : 1;
  121. ULONG Slot4IntB : 1;
  122. ULONG Slot5IntA : 1;
  123. ULONG Slot5IntB : 1;
  124. ULONG Slot6IntA : 1;
  125. ULONG Slot6IntB : 1;
  126. ULONG Reserved : 16;
  127. };
  128. ULONG ALL;
  129. } NORITAKE_IMR1, *PNORITAKE_IMR1;
  130. typedef union _NORITAKE_IMR2{
  131. struct {
  132. ULONG SumUnmaskedIr2 : 1;
  133. ULONG SecondaryPCIBusInt : 1;
  134. ULONG Slot0IntC : 1;
  135. ULONG Slot0IntD : 1;
  136. ULONG Slot1IntC : 1;
  137. ULONG Slot1IntD : 1;
  138. ULONG Slot2IntC : 1;
  139. ULONG Slot2IntD : 1;
  140. ULONG Slot3IntC : 1;
  141. ULONG Slot3IntD : 1;
  142. ULONG Slot4IntC : 1;
  143. ULONG Slot4IntD : 1;
  144. ULONG Slot5IntC : 1;
  145. ULONG Slot5IntD : 1;
  146. ULONG Slot6IntC : 1;
  147. ULONG Slot6IntD : 1;
  148. ULONG Reserved : 16;
  149. };
  150. ULONG ALL;
  151. } NORITAKE_IMR2, *PNORITAKE_IMR2;
  152. typedef union _NORITAKE_IMR3{
  153. struct {
  154. ULONG Reserved1 : 2;
  155. ULONG Power2Int : 1;
  156. ULONG Power1Int : 1;
  157. ULONG TempFail : 1;
  158. ULONG TempWarn : 1;
  159. ULONG Fan2Fail : 1;
  160. ULONG Fan1Fail : 1;
  161. ULONG Reserved2 : 24;
  162. };
  163. ULONG ALL;
  164. } NORITAKE_IMR3, *PNORITAKE_IMR3;
  165. #endif //!_LANGUAGE_ASSEMBLY
  166. #define HAL_PCR ( (PMIKASA_PCR)(&(PCR->HalReserved)) )
  167. #define PCI_VECTOR PRIMARY0_VECTOR // from alpharef.h
  168. #define PCI_MAX_INTERRUPT_VECTOR MAXIMUM_PCI_VECTOR // from alpharef.h
  169. #define PCI_SPARSE_IO_BASE_QVA ((ULONG)(HAL_MAKE_QVA(APECS_PCI_IO_BASE_PHYSICAL)))
  170. //
  171. // The combined Vendor ID, Device ID for the PCEB of the PCI/EISA bridge
  172. // chip set.
  173. //
  174. #define INTEL_PCI_EISA_BRIDGE_ID 0x04828086
  175. //
  176. // PCI-EISA Bridge chip configuration space base is at physical address
  177. // 0x1e0000000. The equivalent QVA is:
  178. // (0x1e0000000 >> IO_BIT_SHIFT) | QVA_ENABLE
  179. //
  180. // N.B.: The PCI configuration space address is what we're really referring
  181. // to, here.
  182. //
  183. #define PCI_CONFIGURATION_BASE_QVA 0xaf000000
  184. #define PCI_CONFIG_CYCLE_TYPE_0 0x0 // Local PCI device
  185. #define PCI_CONFIG_CYCLE_TYPE_1 0x1 // Nested PCI device
  186. #define PCI_EISA_BRIDGE_HEADER_OFFSET (0x00070000 >> IO_BIT_SHIFT) // AD[18]
  187. //
  188. // PCI-EISA Bridge Non-Configuration control register offsets. These should
  189. // be simply ored with PCI_SPARSE_IO_BASE_QVA; they match what's in the
  190. // Intel handbook for the 82374EB (ESC).
  191. //
  192. #define ESC_EDGE_LEVEL_CONTROL_1 0x4d0
  193. #define ESC_EDGE_LEVEL_CONTROL_2 0x4d1
  194. #define ESC_CMOS_ISA_PORT 0x800
  195. //
  196. // BIOS timer address port. This value is stuffed into PCEB configuration
  197. // space at PCEB/ESC cofiguration.
  198. //
  199. #define BIOS_TIMER_PORT 0x78
  200. //
  201. // Mikasa-unique registers, accessed via PCI_SPARSE_IO_BASE_QVA, via the
  202. // same protocol as above. Locations of these are intermixed with
  203. // ESC-specific and ordinary ISA registers in this space. N.B.: the
  204. // term "port" is used for compatibility with PC industry terminology.
  205. // We know Alphas don't have I/O instructions, nor ports, as such.
  206. //
  207. #define COMBO_CHIP_CONFIG_INDEX_PORT 0x398
  208. #define COMBO_CHIP_CONFIG_DATA_PORT 0x399
  209. //
  210. // Define I2C constants
  211. //
  212. #define I2C_INTERFACE_DATA_PORT 0x530
  213. #define I2C_INTERFACE_CSR_PORT 0x531
  214. #define I2C_INTERFACE_LENGTH 0x2
  215. #define I2C_INTERFACE_MASK 0x1
  216. //
  217. // This is the same for both Noritake and Mikasa
  218. //
  219. #define SERVER_MANAGEMENT_REGISTER 0x532
  220. //
  221. // Noritake interrupt and interrupt mask register offsets.
  222. //
  223. #define PCI_INTERRUPT_BASE_ADDRESS 0x540
  224. #define PCI_INTERRUPT_REGISTER_1 0x542
  225. #define PCI_INTERRUPT_REGISTER_2 0x544
  226. #define PCI_INTERRUPT_REGISTER_3 0x546
  227. #define PCI_INTERRUPT_MASK_REGISTER_1 0x54A
  228. #define PCI_INTERRUPT_MASK_REGISTER_2 0x54C
  229. #define PCI_INTERRUPT_MASK_REGISTER_3 0x54E
  230. //
  231. // Noritake PCI vector offsets. Interrupt vectors that originate from register
  232. // 1 start at 0x11 for bit position 0. So, when servicing an interrupt from
  233. // register 1, you must add 0x11 to the bit position to get the interrupt
  234. // vector. Likewise, if you have an interrupt vector, and you would like to
  235. // determine which interrupt register it resides in, you can use the vector
  236. // offsets to determine this. All vectors in interrupt register 1 are between
  237. // 0x11 and 0x20. All vectors in interrupt register 2 are between 0x21 and
  238. // 0x30. All vectors in interrupt register 3 are between 0x31 and 0x38.
  239. // Subtracting the vector offset for a register from the interrupt vector will
  240. // give you the bit position of the vector. For example, Vector 0x14
  241. // corresponds to bit 3 of interrupt register 1, Vector 0x27 corresponds to bit
  242. // 6 of interrupt register 2, and so on.
  243. //
  244. #define REGISTER_1_VECTOR_OFFSET 0x11
  245. #define REGISTER_2_VECTOR_OFFSET 0x21
  246. #define REGISTER_3_VECTOR_OFFSET 0x31
  247. //
  248. // Mikasa interrupt and interrupt mask register offsets.
  249. //
  250. #define PCI_INTERRUPT_REGISTER 0x534
  251. #define PCI_INTERRUPT_MASK_REGISTER 0x536
  252. //
  253. // Define the index and data ports for the NS Super IO (87312) chip.
  254. //
  255. #define SUPERIO_INDEX_PORT 0x398
  256. #define SUPERIO_DATA_PORT 0x399
  257. #define SUPERIO_PORT_LENGTH 0x2
  258. //
  259. // PCI Sparse I/O space offsets for unique functions on the ESC. They are
  260. // used as the offsets above.
  261. //
  262. #define ESC_CONFIG_ADDRESS 0x22
  263. #define ESC_CONFIG_DATA 0x23
  264. //
  265. // ESC configuration register index addresses. The protocol is:
  266. // write the configuration register address (one of the following)
  267. // into ESC_CONTROL_INDEX, then write the data into ESC_CONTROL_DATA.
  268. //
  269. #define ESC_INDEX_ESC_ID 0x02 // write 0xf to enable
  270. #define ESC_INDEX_REVISION_ID 0x08 // ro
  271. #define ESC_INDEX_MODE_SELECT 0x40 // rw
  272. #define ESC_INDEX_BIOS_CHIP_SELECT_A 0x42 // rw
  273. #define ESC_INDEX_BIOS_CHIP_SELECT_B 0x43 // rw
  274. #define ESC_INDEX_BCLK_CLOCK_DIVISOR 0x4d // rw
  275. #define ESC_INDEX_PERIPHERAL_CHIP_SELECT_A 0x4e // rw
  276. #define ESC_INDEX_PERIPHERAL_CHIP_SELECT_B 0x4f // rw
  277. #define ESC_INDEX_EISA_ID_BYTE_1 0x50 // rw
  278. #define ESC_INDEX_EISA_ID_BYTE_2 0x51 // rw
  279. #define ESC_INDEX_EISA_ID_BYTE_3 0x52 // rw
  280. #define ESC_INDEX_EISA_ID_BYTE_4 0x53 // rw
  281. #define ESC_INDEX_SG_RELOCATE_BASE 0x57 // rw
  282. #define ESC_INDEX_PIRQ0_ROUTE_CONTROL 0x60 // rw
  283. #define ESC_INDEX_PIRQ1_ROUTE_CONTROL 0x61 // rw
  284. #define ESC_INDEX_PIRQ2_ROUTE_CONTROL 0x62 // rw
  285. #define ESC_INDEX_PIRQ3_ROUTE_CONTROL 0x63 // rw
  286. #define ESC_INDEX_GPCS0_BASE_LOW 0x64 // rw
  287. #define ESC_INDEX_GPCS0_BASE_HIGH 0x65 // rw
  288. #define ESC_INDEX_GPCS0_MASK 0x66 // rw
  289. #define ESC_INDEX_GPCS1_BASE_LOW 0x68 // rw
  290. #define ESC_INDEX_GPCS1_BASE_HIGH 0x69 // rw
  291. #define ESC_INDEX_GPCS1_MASK 0x6a // rw
  292. #define ESC_INDEX_GPCS2_BASE_LOW 0x6c // rw
  293. #define ESC_INDEX_GPCS2_BASE_HIGH 0x6d // rw
  294. #define ESC_INDEX_GPCS2_MASK 0x6e // rw
  295. #define ESC_INDEX_GP_XBUS_CONTROL 0x6f // rw
  296. #if !defined (_LANGUAGE_ASSEMBLY)
  297. typedef union _ESC_MODESEL{
  298. struct {
  299. UCHAR EisaMasterSupport: 2;
  300. UCHAR Reserved1: 1;
  301. UCHAR SystemErrorEnable : 1;
  302. UCHAR EscSelect : 1;
  303. UCHAR CramPageEnable : 1;
  304. UCHAR MreqPirqEnable : 1;
  305. UCHAR Reserved2: 2;
  306. };
  307. UCHAR All;
  308. }ESC_MODESEL, *PESC_MODESEL;
  309. #define MS_4_EISA_MASTERS 0x00
  310. #define MS_6_EISA_MASTERS 0x01
  311. #define MS_7_EISA_MASTERS 0x02
  312. #define MS_8_EISA_MASTERS 0x03
  313. #define MS_RESERVED_MASK 0x84
  314. #define BIOSCSA_RESERVED_MASK 0xc0
  315. #define BIOSCSB_RESERVED_MASK 0xf0
  316. #define GPXBC_RESERVED_MASK 0xf8
  317. typedef union _ESC_CLKDIV{
  318. struct {
  319. UCHAR ClockDivisor: 3;
  320. UCHAR Reserved1: 1;
  321. UCHAR MouseInterruptEnable : 1;
  322. UCHAR CoprocessorError : 1;
  323. UCHAR Reserved2: 2;
  324. };
  325. UCHAR All;
  326. }ESC_CLKDIV, *PESC_CLKDIV;
  327. #define CLKDIV_33MHZ_EISA 0x00
  328. #define CLKDIV_25MHZ_EISA 0x01
  329. #define CLKDIV_RESERVED_MASK 0xc8
  330. typedef union _ESC_PCSA{
  331. struct {
  332. UCHAR RtcDecode: 1;
  333. UCHAR KeyboardControllerDecode: 1;
  334. UCHAR FloppyDiskSecondaryDecode : 1;
  335. UCHAR FloppyDiskPrimaryDecode : 1;
  336. UCHAR IdeDecode : 1;
  337. UCHAR FloppyIdeSpaceSecondary : 1;
  338. UCHAR Reserved : 2;
  339. };
  340. UCHAR All;
  341. }ESC_PCSA, *PESC_PCSA;
  342. #define PCSA_RESERVED_MASK 0xc0
  343. typedef union _ESC_PCSB{
  344. struct {
  345. UCHAR SerialPortADecode: 2;
  346. UCHAR SerialPortBDecode: 2;
  347. UCHAR ParallelPortDecode : 2;
  348. UCHAR Port92Decode : 1;
  349. UCHAR CramDecode : 1;
  350. };
  351. UCHAR All;
  352. }ESC_PCSB, *PESC_PCSB;
  353. #define PCSB_DECODE_DISABLE 0x3
  354. typedef union _ESC_PIRQ{
  355. struct {
  356. UCHAR IrqxRoutingBits: 7;
  357. UCHAR RoutePciInterrupts: 1;
  358. };
  359. UCHAR All;
  360. }ESC_PIRQ, *PESC_PIRQ;
  361. #define PIRQ_DISABLE_ROUTING 0x01
  362. #define PIRQ_ENABLE_ROUTING 0x00
  363. typedef union _ESC_GPXBC{
  364. struct {
  365. UCHAR EnableGpcs0: 1;
  366. UCHAR EnableGpcs1: 1;
  367. UCHAR EnableGpcs2: 1;
  368. UCHAR Reserved: 5;
  369. };
  370. UCHAR All;
  371. }ESC_GPXBC, *PESC_GPXBC;
  372. #endif // !_LANGUAGE_ASSEMBLY
  373. //
  374. // PCI-EISA Bridge Configuration register offsets. These should be
  375. // simply ored with PCI_CONFIGURATION_BASE_QVA; they match what's
  376. // in the Intel handbook for the 82375EB (PCEB).
  377. //
  378. #define PCI_VENDOR_ID 0x00 // ro
  379. #define PCI_DEVICE_ID 0x02 // ro
  380. #define PCI_COMMAND 0x04 // rw
  381. #define PCI_DEVICE_STATUS 0x06 // ro, rw clear
  382. #define PCI_REVISION 0x08 // ro
  383. #define PCI_MASTER_LATENCY_TIMER 0x0d // rw
  384. #define PCI_CONTROL 0x40 // rw
  385. #define PCI_ARBITER_CONTROL 0x41 // rw
  386. #define PCI_ARBITER_PRIORITY_CONTROL 0x42 // rw
  387. #define PCI_MEMCS_CONTROL 0x44 // rw
  388. #define PCI_MEMCS_BOTTOM_OF_HOLE 0x45 // rw
  389. #define PCI_MEMCS_TOP_OF_HOLE 0x46 // rw
  390. #define PCI_MEMCS_TOP_OF_MEMORY 0x47 // rw
  391. #define PCI_EISA_ADDRESS_DECODE_CONTROL_1 0x48 // rw
  392. #define PCI_ISA_IO_RECOVERY_TIME_CONTROL 0x4c // rw
  393. #define PCI_MEMCS_ATTRIBUTE_REGISTER_1 0x54 // rw
  394. #define PCI_MEMCS_ATTRIBUTE_REGISTER_2 0x55 // rw
  395. #define PCI_MEMCS_ATTRIBUTE_REGISTER_3 0x56 // rw
  396. #define PCI_DECODE_CONTROL 0x58 // rw
  397. #define PCI_EISA_ADDRESS_DECODE_CONTROL_2 0x5a // rw
  398. #define PCI_EISA_TO_PCI_MEMORY_REGIONS_ATTR 0x5c // rw
  399. #define PCI_EISA_TO_PCI_MEMORY_REGION1_REGISTER 0x60 // rw
  400. #define PCI_EISA_TO_PCI_MEMORY_REGION2_REGISTER 0x64 // rw
  401. #define PCI_EISA_TO_PCI_MEMORY_REGION3_REGISTER 0x68 // rw
  402. #define PCI_EISA_TO_PCI_MEMORY_REGION4_REGISTER 0x6c // rw
  403. #define PCI_EISA_TO_PCI_IO_REGION1_REGISTER 0x70 // rw
  404. #define PCI_EISA_TO_PCI_IO_REGION2_REGISTER 0x74 // rw
  405. #define PCI_EISA_TO_PCI_IO_REGION3_REGISTER 0x78 // rw
  406. #define PCI_EISA_TO_PCI_IO_REGION4_REGISTER 0x7c // rw
  407. #define PCI_BIOS_TIMER_BASE_ADDRESS 0x80 // rw
  408. #define PCI_EISA_LATENCY_TIMER_CONTROL_REGISTER 0x84 // rw
  409. #if !defined (_LANGUAGE_ASSEMBLY)
  410. //
  411. // Structure definitions of registers in PCEB PCI configuration space.
  412. // fields marked "Not supported" are Intel placeholders, apparently.
  413. //
  414. typedef union _PCEB_PCICMD{
  415. struct {
  416. USHORT IoSpaceEnable : 1;
  417. USHORT MemorySpaceEnable : 1;
  418. USHORT BusMasterEnable : 1;
  419. USHORT SpecialCycleEnable: 1; // Not supported
  420. USHORT MemoryWriteInvalidateEnable : 1; // Not supported
  421. USHORT VgaPaletteSnoop : 1; // Not supported
  422. USHORT ParityErrorEnable : 1;
  423. USHORT WaitStateControl : 1; // Not supported
  424. USHORT SerreEnable : 1; // Not supported
  425. USHORT Reserved : 7;
  426. };
  427. USHORT All;
  428. } PCEB_PCICMD, *PPCEB_PCICMD;
  429. typedef union _PCEB_PCISTS{
  430. struct {
  431. USHORT Reserved : 9;
  432. USHORT DevselTiming: 2; // ro
  433. USHORT SignaledTargetAbort : 1; // Not supported
  434. USHORT ReceivedTargetAbort: 1; // r/wc
  435. USHORT MasterAbort : 1; // r/wc
  436. USHORT Serrs : 1; // Not supported
  437. USHORT ParityError: 1; // r/wc
  438. };
  439. USHORT All;
  440. } PCEB_PCISTS, *PPCEB_PCISTS;
  441. typedef union _PCEB_MLT{
  442. struct {
  443. UCHAR Reserved : 3;
  444. UCHAR LatencyTimerCount: 5;
  445. };
  446. UCHAR All;
  447. } PCEB_MLT, *PPCEB_MLT;
  448. typedef union _PCEB_PCICON{
  449. struct {
  450. UCHAR Reserved1 : 2;
  451. UCHAR PciPostedWriteBuffersEnable: 1;
  452. UCHAR SubtractDecodeSamplePoint: 2;
  453. UCHAR InterruptAcknowledgeEnable: 1;
  454. UCHAR EisaToPciLineBuffersEnable: 1;
  455. UCHAR Reserved2 : 1;
  456. };
  457. UCHAR All;
  458. } PCEB_PCICON, *PPCEB_PCICON;
  459. #define PCICON_SDSP_SLOW 0x00
  460. #define PCICON_SDSP_TYPICAL 0x01
  461. #define PCICON_SDSP_FAST 0x02
  462. typedef union _PCEB_ARBCON{
  463. struct {
  464. UCHAR GuaranteedAccessTimeEnable : 1;
  465. UCHAR BusLockEnable: 1;
  466. UCHAR CpuBusParkEnable: 1;
  467. UCHAR MasterRetryTimer: 2;
  468. UCHAR Reserved : 2;
  469. UCHAR AutoPereqControlEnable: 1;
  470. };
  471. UCHAR All;
  472. } PCEB_ARBCON, *PPCEB_ARBCON;
  473. #define ARBCON_RETRY_TIMER_DISABLE 0x00
  474. #define ARBCON_16_PCICLKS_UNMASK 0x01
  475. #define ARBCON_32_PCICLKS_UNMASK 0x02
  476. #define ARBCON_64_PCICLKS_UNMASK 0x03
  477. typedef union _PCEB_ARBPRI{
  478. struct {
  479. UCHAR Bank0FixedPriorityMode : 1;
  480. UCHAR Bank1FixedPriorityMode: 1;
  481. UCHAR Bank2FixedPriorityMode: 2;
  482. UCHAR Bank0RotateEnable: 1;
  483. UCHAR Bank1RotateEnable: 1;
  484. UCHAR Bank2RotateEnable: 1;
  485. UCHAR Bank3RotateEnable: 1;
  486. };
  487. UCHAR All;
  488. } PCEB_ARBPRI, *PPCEB_ARBPRI;
  489. #define ARBPRI_BANK0_BANK3_BANK1 0x00
  490. #define ARBPRI_BANK3_BANK1_BANK0 0x10
  491. #define ARBPRI_BANK1_BANK0_BANK3 0x01
  492. typedef union _PCEB_MCSCON{
  493. struct {
  494. UCHAR ReadEnable512To640 : 1;
  495. UCHAR WriteEnable512To640: 1;
  496. UCHAR ReadEnableUpper64K: 1;
  497. UCHAR WriteEnableUpper64K: 1;
  498. UCHAR MemcsMasterEnable: 1;
  499. UCHAR Reserved: 3;
  500. };
  501. UCHAR All;
  502. } PCEB_MCSCON, *PPCEB_MCSCON;
  503. typedef union _PCEB_EADC1{
  504. struct {
  505. USHORT Block0To512 : 1;
  506. USHORT Block512To640: 1;
  507. USHORT Block640To768: 1;
  508. USHORT Reserved: 5;
  509. USHORT Block768To784: 1;
  510. USHORT Block784To800: 1;
  511. USHORT Block800To816: 1;
  512. USHORT Block816To832: 1;
  513. USHORT Block832To848: 1;
  514. USHORT Block848To864: 1;
  515. USHORT Block864To880: 1;
  516. USHORT Block880To896: 1;
  517. };
  518. UCHAR All;
  519. } PCEB_EADC1, *PPCEB_EADC1;
  520. typedef union _PCEB_IORT{
  521. struct {
  522. UCHAR RecoveryTimes16Bit : 2;
  523. UCHAR RecoveryEnable16Bit: 1;
  524. UCHAR RecoveryTimes8Bit : 3;
  525. UCHAR RecoveryEnable8Bit: 1;
  526. UCHAR Reserved: 1;
  527. };
  528. UCHAR All;
  529. } PCEB_IORT, *PPCEB_IORT;
  530. #define IORT_16BIT_1BCLK 0x01
  531. #define IORT_16BIT_2BCLKS 0x02
  532. #define IORT_16BIT_3BCLKS 0x03
  533. #define IORT_16BIT_4BCLKS 0x00
  534. #define IORT_8BIT_1BCLK 0x01
  535. #define IORT_8BIT_2BCLKS 0x02
  536. #define IORT_8BIT_3BCLKS 0x03
  537. #define IORT_8BIT_4BCLKS 0x04
  538. #define IORT_8BIT_5BCLKS 0x05
  539. #define IORT_8BIT_6BCLKS 0x06
  540. #define IORT_8BIT_7BCLKS 0x07
  541. #define IORT_8BIT_8BCLKS 0x00
  542. typedef union _PCEB_PDCON{
  543. struct {
  544. UCHAR PciDecodeMode : 1;
  545. UCHAR Reserved1: 3;
  546. UCHAR DecodeControlIde : 1;
  547. UCHAR DecodeControl8259 : 1;
  548. UCHAR Reserved2: 2;
  549. };
  550. UCHAR All;
  551. } PCEB_PDCON, *PPCEB_PDCON;
  552. #define SUBTRACTIVE_DECODE 0x00
  553. #define NEGATIVE_DECODE 0x01
  554. typedef struct _PCEB_EPMRA{
  555. struct {
  556. UCHAR Region1Attribute : 1;
  557. UCHAR Region2Attribute : 1;
  558. UCHAR Region3Attribute : 1;
  559. UCHAR Region4Attribute : 1;
  560. UCHAR Reserved: 4;
  561. };
  562. UCHAR All;
  563. } PCEB_EPMRA, *PPCEB_EPMRA;
  564. #define REGION_BUFFERED 0x01
  565. typedef struct _PCEB_MEMREGN{
  566. USHORT BaseAddress;
  567. USHORT LimitAddress;
  568. } PCEB_MEMREGN, *PPCEB_MEMREGN;
  569. typedef union _PCEB_IOREGN{
  570. struct {
  571. ULONG Reserved1: 2;
  572. ULONG BaseAddress : 14;
  573. ULONG Reserved2: 2;
  574. ULONG LimitAddress : 14;
  575. };
  576. ULONG All;
  577. } PCEB_IOREGN, *PPCEB_IOREGN;
  578. typedef union _PCEB_BTMR{
  579. struct {
  580. USHORT BiosTimerEnable: 1;
  581. USHORT Reserved: 1;
  582. USHORT BaseAddress2thru15 : 14;
  583. };
  584. USHORT All;
  585. } PCEB_BTMR, *PPCEB_BTMR;
  586. #endif
  587. //
  588. // ESC value for setting edge/level operation in the control words.
  589. //
  590. #define IRQ0_LEVEL_SENSITIVE 0x01
  591. #define IRQ1_LEVEL_SENSITIVE 0x02
  592. #define IRQ2_LEVEL_SENSITIVE 0x04
  593. #define IRQ3_LEVEL_SENSITIVE 0x08
  594. #define IRQ4_LEVEL_SENSITIVE 0x10
  595. #define IRQ5_LEVEL_SENSITIVE 0x20
  596. #define IRQ6_LEVEL_SENSITIVE 0x40
  597. #define IRQ7_LEVEL_SENSITIVE 0x80
  598. #define IRQ8_LEVEL_SENSITIVE 0x01
  599. #define IRQ9_LEVEL_SENSITIVE 0x02
  600. #define IRQ10_LEVEL_SENSITIVE 0x04
  601. #define IRQ11_LEVEL_SENSITIVE 0x08
  602. #define IRQ12_LEVEL_SENSITIVE 0x10
  603. #define IRQ13_LEVEL_SENSITIVE 0x20
  604. #define IRQ14_LEVEL_SENSITIVE 0x40
  605. #define IRQ15_LEVEL_SENSITIVE 0x80
  606. //
  607. // Define primary (and only) CPU on an Mikasa system
  608. //
  609. #define HAL_PRIMARY_PROCESSOR ((ULONG)0x0)
  610. #define HAL_MAXIMUM_PROCESSOR ((ULONG)0x0)
  611. //
  612. // Define the default processor clock frequency used before the actual
  613. // value can be determined.
  614. //
  615. #define DEFAULT_PROCESSOR_FREQUENCY_MHZ (200)
  616. #endif // _MIKASA_