Source code of Windows XP (NT5)
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.

173 lines
4.6 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. viac3.h
  5. Abstract:
  6. Author:
  7. Tom Brown (t-tbrown) 2001-06-26 - created file
  8. Environment:
  9. Kernel mode
  10. Notes:
  11. Revision History:
  12. --*/
  13. #ifndef _VIAC3_H
  14. #define _VIAC3_H
  15. #define VIAC3_PARAMETERS_KEY L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\ViaC3\\Parameters"
  16. #include "..\lib\processor.h"
  17. //
  18. // set in IdentifyCPUVersion according to data in
  19. // "Samuel 2, Ezra, and C5M LongHaul Programmer's Guide (Version 3.0.0 Gamma)"
  20. //
  21. // Encoding of the LongHaul revision set by IdentifyCPUVersion. Use it with
  22. // the following macros
  23. extern ULONG LongHaulFlags;
  24. // CPU has the LongHaul MSR at 110Ah
  25. #define SUPPORTS_MSR_FLAG (0x1)
  26. // Supports changing the bus ratio to change the core frequency
  27. #define SUPPORTS_SOFTBR_FLAG (0x2)
  28. // Supports changing the core voltage
  29. #define SUPPORTS_SOFTVID_FLAG (0x4)
  30. // Can not change the core voltage by more than 50mV at a time
  31. #define NEEDS_VOLTAGE_STEPPING_FLAG (0x8)
  32. // Copy bits of MSR from 40:36 to 24:20 so that softVID is initalized
  33. #define SET_MAXV_AT_STARTUP_FLAG (0x10)
  34. #define SUPPORTS_MSR (LongHaulFlags & SUPPORTS_MSR_FLAG)
  35. #define SUPPORTS_SOFTBR (LongHaulFlags & SUPPORTS_SOFTBR_FLAG)
  36. #define SUPPORTS_SOFTVID (LongHaulFlags & SUPPORTS_SOFTVID_FLAG)
  37. #define NEEDS_VOLTAGE_STEPPING (LongHaulFlags & NEEDS_VOLTAGE_STEPPING_FLAG)
  38. #define SET_MAXV_AT_STARTUP (LongHaulFlags & SET_MAXV_AT_STARTUP_FLAG)
  39. // Flags used to read hack bits from the registry
  40. #define DISABLE_ALL_HACK_FLAG (0x1)
  41. #define NO_SOFTVID_HACK_FLAG (0x2)
  42. #define NO_VOLTAGE_STEPPING_HACK_FLAG (0x4)
  43. #define MSR_LONGHAUL_ADDR 0x110A
  44. #define EBL_CR_POWERON_MSR 0x2A
  45. #define MSR_1147_ADDR 0x1147
  46. #define INVALID_BR -1
  47. #define CPUID_FUNC0_EBX 0x746E6543
  48. #define CPUID_FUNC0_EDX 0x48727561
  49. #define CPUID_FUNC0_ECX 0x736C7561
  50. typedef struct {
  51. union {
  52. struct {
  53. ULONG Stepping:4; // 3:0
  54. ULONG Model:4; // 7:4
  55. ULONG Family:4; // 11:8
  56. };
  57. ULONG AsDWord;
  58. };
  59. } CPUID_FUNC1, *PCPUID_FUNC1;
  60. typedef struct {
  61. union {
  62. struct {
  63. ULONG Unknown:22; // 21:0
  64. ULONG ClockMult:4; // 25:22
  65. };
  66. ULONGLONG AsQWord;
  67. };
  68. } EBL_CR_POWERON, *PEBL_CR_POWERON;
  69. typedef struct {
  70. union {
  71. struct {
  72. ULONG Unknown:19; // 18:0
  73. ULONG Enable_Change:1; // 19
  74. ULONG Unknown2:3; // 22:20
  75. ULONG Clock_Mult:4; // 26:23
  76. };
  77. ULONGLONG AsQWord;
  78. };
  79. } MSR_1147, *PMSR_1147;
  80. #define VRM85 0
  81. typedef struct {
  82. union {
  83. struct {
  84. ULONG RevisionID:4; // 3:0
  85. ULONG RevisionKey:4; // 7:4
  86. ULONG EnableSoftBusRatio:1; // 8
  87. ULONG EnableSoftVID:1; // 9
  88. ULONG EnableSoftBSEL:1; // 10
  89. ULONG Reserved1:1; // 11
  90. ULONG Reserved2:1; // 12
  91. ULONG Reserved3:1; // 13
  92. ULONG SoftBusRatio4:1; // 14
  93. ULONG VRMRev:1; // 15
  94. ULONG SoftBusRatio0:4; // 19:16
  95. ULONG SoftVID:5; // 24:20
  96. ULONG Reserved4:3; // 27:25
  97. ULONG SoftBSEL:2; // 29:28
  98. ULONG Reserved5:2; // 31:30
  99. ULONG MaxMHzBR0:4; // 35:32
  100. ULONG MaximumVID:5; // 40:36
  101. ULONG MaxMHzFSB:2; // 42:41
  102. ULONG MaxMHzBR4:1; // 43
  103. ULONG Reserved6:4; // 47:44
  104. ULONG MinMHzBR0:4; // 51:48
  105. ULONG MinimumVID:5; // 56:52
  106. ULONG MinMHzFSB:2; // 58:57
  107. ULONG MinMHzBR4:1; // 59
  108. ULONG Reserved7:4; // 63:60
  109. };
  110. ULONGLONG AsQWord;
  111. };
  112. } LONGHAUL_MSR, *PLONGHAUL_MSR;
  113. typedef struct {
  114. union {
  115. struct { // family/model/stepping 6/7/1-f,6/8/*
  116. ULONG Fid:8; // 7:0 MSR 110Ah[14,19:16]
  117. ULONG EnableFid:1; // 8 MSR 110Ah[8]
  118. ULONG Reserved1:7; // 15:9
  119. ULONG Vid:8; // 23:16 MSR 110Ah[24:20]
  120. ULONG EnableVid:1; // 24 MSR 110Ah[9]
  121. ULONG Reserved2:7; // 31:25
  122. };
  123. ULONG AsDWord;
  124. };
  125. } PSS_CONTROL, *PPSS_CONTROL;
  126. typedef struct {
  127. union {
  128. struct {
  129. ULONG Fid:8; // 7:0
  130. ULONG Reserved1:8; // 15:8
  131. ULONG Vid:8; // 23:16
  132. ULONG Reserved2:8; // 31:24
  133. };
  134. ULONG AsDWord;
  135. };
  136. } PSS_STATUS, *PPSS_STATUS;
  137. #endif // _VIAC3_H