PageRenderTime 88ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 1ms

/drivers/gpu/drm/radeon/atombios.h

https://bitbucket.org/ndreys/linux-sunxi
C++ Header | 7023 lines | 5042 code | 904 blank | 1077 comment | 0 complexity | f2ab490678c143dc82c49f5a70d2d18b MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, AGPL-1.0
  1. /*
  2. * Copyright 2006-2007 Advanced Micro Devices, Inc.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  18. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  19. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  20. * OTHER DEALINGS IN THE SOFTWARE.
  21. */
  22. /****************************************************************************/
  23. /*Portion I: Definitions shared between VBIOS and Driver */
  24. /****************************************************************************/
  25. #ifndef _ATOMBIOS_H
  26. #define _ATOMBIOS_H
  27. #define ATOM_VERSION_MAJOR 0x00020000
  28. #define ATOM_VERSION_MINOR 0x00000002
  29. #define ATOM_HEADER_VERSION (ATOM_VERSION_MAJOR | ATOM_VERSION_MINOR)
  30. /* Endianness should be specified before inclusion,
  31. * default to little endian
  32. */
  33. #ifndef ATOM_BIG_ENDIAN
  34. #error Endian not specified
  35. #endif
  36. #ifdef _H2INC
  37. #ifndef ULONG
  38. typedef unsigned long ULONG;
  39. #endif
  40. #ifndef UCHAR
  41. typedef unsigned char UCHAR;
  42. #endif
  43. #ifndef USHORT
  44. typedef unsigned short USHORT;
  45. #endif
  46. #endif
  47. #define ATOM_DAC_A 0
  48. #define ATOM_DAC_B 1
  49. #define ATOM_EXT_DAC 2
  50. #define ATOM_CRTC1 0
  51. #define ATOM_CRTC2 1
  52. #define ATOM_CRTC3 2
  53. #define ATOM_CRTC4 3
  54. #define ATOM_CRTC5 4
  55. #define ATOM_CRTC6 5
  56. #define ATOM_CRTC_INVALID 0xFF
  57. #define ATOM_DIGA 0
  58. #define ATOM_DIGB 1
  59. #define ATOM_PPLL1 0
  60. #define ATOM_PPLL2 1
  61. #define ATOM_DCPLL 2
  62. #define ATOM_PPLL0 2
  63. #define ATOM_EXT_PLL1 8
  64. #define ATOM_EXT_PLL2 9
  65. #define ATOM_EXT_CLOCK 10
  66. #define ATOM_PPLL_INVALID 0xFF
  67. #define ENCODER_REFCLK_SRC_P1PLL 0
  68. #define ENCODER_REFCLK_SRC_P2PLL 1
  69. #define ENCODER_REFCLK_SRC_DCPLL 2
  70. #define ENCODER_REFCLK_SRC_EXTCLK 3
  71. #define ENCODER_REFCLK_SRC_INVALID 0xFF
  72. #define ATOM_SCALER1 0
  73. #define ATOM_SCALER2 1
  74. #define ATOM_SCALER_DISABLE 0
  75. #define ATOM_SCALER_CENTER 1
  76. #define ATOM_SCALER_EXPANSION 2
  77. #define ATOM_SCALER_MULTI_EX 3
  78. #define ATOM_DISABLE 0
  79. #define ATOM_ENABLE 1
  80. #define ATOM_LCD_BLOFF (ATOM_DISABLE+2)
  81. #define ATOM_LCD_BLON (ATOM_ENABLE+2)
  82. #define ATOM_LCD_BL_BRIGHTNESS_CONTROL (ATOM_ENABLE+3)
  83. #define ATOM_LCD_SELFTEST_START (ATOM_DISABLE+5)
  84. #define ATOM_LCD_SELFTEST_STOP (ATOM_ENABLE+5)
  85. #define ATOM_ENCODER_INIT (ATOM_DISABLE+7)
  86. #define ATOM_GET_STATUS (ATOM_DISABLE+8)
  87. #define ATOM_BLANKING 1
  88. #define ATOM_BLANKING_OFF 0
  89. #define ATOM_CURSOR1 0
  90. #define ATOM_CURSOR2 1
  91. #define ATOM_ICON1 0
  92. #define ATOM_ICON2 1
  93. #define ATOM_CRT1 0
  94. #define ATOM_CRT2 1
  95. #define ATOM_TV_NTSC 1
  96. #define ATOM_TV_NTSCJ 2
  97. #define ATOM_TV_PAL 3
  98. #define ATOM_TV_PALM 4
  99. #define ATOM_TV_PALCN 5
  100. #define ATOM_TV_PALN 6
  101. #define ATOM_TV_PAL60 7
  102. #define ATOM_TV_SECAM 8
  103. #define ATOM_TV_CV 16
  104. #define ATOM_DAC1_PS2 1
  105. #define ATOM_DAC1_CV 2
  106. #define ATOM_DAC1_NTSC 3
  107. #define ATOM_DAC1_PAL 4
  108. #define ATOM_DAC2_PS2 ATOM_DAC1_PS2
  109. #define ATOM_DAC2_CV ATOM_DAC1_CV
  110. #define ATOM_DAC2_NTSC ATOM_DAC1_NTSC
  111. #define ATOM_DAC2_PAL ATOM_DAC1_PAL
  112. #define ATOM_PM_ON 0
  113. #define ATOM_PM_STANDBY 1
  114. #define ATOM_PM_SUSPEND 2
  115. #define ATOM_PM_OFF 3
  116. /* Bit0:{=0:single, =1:dual},
  117. Bit1 {=0:666RGB, =1:888RGB},
  118. Bit2:3:{Grey level}
  119. Bit4:{=0:LDI format for RGB888, =1 FPDI format for RGB888}*/
  120. #define ATOM_PANEL_MISC_DUAL 0x00000001
  121. #define ATOM_PANEL_MISC_888RGB 0x00000002
  122. #define ATOM_PANEL_MISC_GREY_LEVEL 0x0000000C
  123. #define ATOM_PANEL_MISC_FPDI 0x00000010
  124. #define ATOM_PANEL_MISC_GREY_LEVEL_SHIFT 2
  125. #define ATOM_PANEL_MISC_SPATIAL 0x00000020
  126. #define ATOM_PANEL_MISC_TEMPORAL 0x00000040
  127. #define ATOM_PANEL_MISC_API_ENABLED 0x00000080
  128. #define MEMTYPE_DDR1 "DDR1"
  129. #define MEMTYPE_DDR2 "DDR2"
  130. #define MEMTYPE_DDR3 "DDR3"
  131. #define MEMTYPE_DDR4 "DDR4"
  132. #define ASIC_BUS_TYPE_PCI "PCI"
  133. #define ASIC_BUS_TYPE_AGP "AGP"
  134. #define ASIC_BUS_TYPE_PCIE "PCI_EXPRESS"
  135. /* Maximum size of that FireGL flag string */
  136. #define ATOM_FIREGL_FLAG_STRING "FGL" //Flag used to enable FireGL Support
  137. #define ATOM_MAX_SIZE_OF_FIREGL_FLAG_STRING 3 //sizeof( ATOM_FIREGL_FLAG_STRING )
  138. #define ATOM_FAKE_DESKTOP_STRING "DSK" //Flag used to enable mobile ASIC on Desktop
  139. #define ATOM_MAX_SIZE_OF_FAKE_DESKTOP_STRING ATOM_MAX_SIZE_OF_FIREGL_FLAG_STRING
  140. #define ATOM_M54T_FLAG_STRING "M54T" //Flag used to enable M54T Support
  141. #define ATOM_MAX_SIZE_OF_M54T_FLAG_STRING 4 //sizeof( ATOM_M54T_FLAG_STRING )
  142. #define HW_ASSISTED_I2C_STATUS_FAILURE 2
  143. #define HW_ASSISTED_I2C_STATUS_SUCCESS 1
  144. #pragma pack(1) /* BIOS data must use byte aligment */
  145. /* Define offset to location of ROM header. */
  146. #define OFFSET_TO_POINTER_TO_ATOM_ROM_HEADER 0x00000048L
  147. #define OFFSET_TO_ATOM_ROM_IMAGE_SIZE 0x00000002L
  148. #define OFFSET_TO_ATOMBIOS_ASIC_BUS_MEM_TYPE 0x94
  149. #define MAXSIZE_OF_ATOMBIOS_ASIC_BUS_MEM_TYPE 20 /* including the terminator 0x0! */
  150. #define OFFSET_TO_GET_ATOMBIOS_STRINGS_NUMBER 0x002f
  151. #define OFFSET_TO_GET_ATOMBIOS_STRINGS_START 0x006e
  152. /* Common header for all ROM Data tables.
  153. Every table pointed _ATOM_MASTER_DATA_TABLE has this common header.
  154. And the pointer actually points to this header. */
  155. typedef struct _ATOM_COMMON_TABLE_HEADER
  156. {
  157. USHORT usStructureSize;
  158. UCHAR ucTableFormatRevision; /*Change it when the Parser is not backward compatible */
  159. UCHAR ucTableContentRevision; /*Change it only when the table needs to change but the firmware */
  160. /*Image can't be updated, while Driver needs to carry the new table! */
  161. }ATOM_COMMON_TABLE_HEADER;
  162. /****************************************************************************/
  163. // Structure stores the ROM header.
  164. /****************************************************************************/
  165. typedef struct _ATOM_ROM_HEADER
  166. {
  167. ATOM_COMMON_TABLE_HEADER sHeader;
  168. UCHAR uaFirmWareSignature[4]; /*Signature to distinguish between Atombios and non-atombios,
  169. atombios should init it as "ATOM", don't change the position */
  170. USHORT usBiosRuntimeSegmentAddress;
  171. USHORT usProtectedModeInfoOffset;
  172. USHORT usConfigFilenameOffset;
  173. USHORT usCRC_BlockOffset;
  174. USHORT usBIOS_BootupMessageOffset;
  175. USHORT usInt10Offset;
  176. USHORT usPciBusDevInitCode;
  177. USHORT usIoBaseAddress;
  178. USHORT usSubsystemVendorID;
  179. USHORT usSubsystemID;
  180. USHORT usPCI_InfoOffset;
  181. USHORT usMasterCommandTableOffset; /*Offset for SW to get all command table offsets, Don't change the position */
  182. USHORT usMasterDataTableOffset; /*Offset for SW to get all data table offsets, Don't change the position */
  183. UCHAR ucExtendedFunctionCode;
  184. UCHAR ucReserved;
  185. }ATOM_ROM_HEADER;
  186. /*==============================Command Table Portion==================================== */
  187. #ifdef UEFI_BUILD
  188. #define UTEMP USHORT
  189. #define USHORT void*
  190. #endif
  191. /****************************************************************************/
  192. // Structures used in Command.mtb
  193. /****************************************************************************/
  194. typedef struct _ATOM_MASTER_LIST_OF_COMMAND_TABLES{
  195. USHORT ASIC_Init; //Function Table, used by various SW components,latest version 1.1
  196. USHORT GetDisplaySurfaceSize; //Atomic Table, Used by Bios when enabling HW ICON
  197. USHORT ASIC_RegistersInit; //Atomic Table, indirectly used by various SW components,called from ASIC_Init
  198. USHORT VRAM_BlockVenderDetection; //Atomic Table, used only by Bios
  199. USHORT DIGxEncoderControl; //Only used by Bios
  200. USHORT MemoryControllerInit; //Atomic Table, indirectly used by various SW components,called from ASIC_Init
  201. USHORT EnableCRTCMemReq; //Function Table,directly used by various SW components,latest version 2.1
  202. USHORT MemoryParamAdjust; //Atomic Table, indirectly used by various SW components,called from SetMemoryClock if needed
  203. USHORT DVOEncoderControl; //Function Table,directly used by various SW components,latest version 1.2
  204. USHORT GPIOPinControl; //Atomic Table, only used by Bios
  205. USHORT SetEngineClock; //Function Table,directly used by various SW components,latest version 1.1
  206. USHORT SetMemoryClock; //Function Table,directly used by various SW components,latest version 1.1
  207. USHORT SetPixelClock; //Function Table,directly used by various SW components,latest version 1.2
  208. USHORT DynamicClockGating; //Atomic Table, indirectly used by various SW components,called from ASIC_Init
  209. USHORT ResetMemoryDLL; //Atomic Table, indirectly used by various SW components,called from SetMemoryClock
  210. USHORT ResetMemoryDevice; //Atomic Table, indirectly used by various SW components,called from SetMemoryClock
  211. USHORT MemoryPLLInit;
  212. USHORT AdjustDisplayPll; //only used by Bios
  213. USHORT AdjustMemoryController; //Atomic Table, indirectly used by various SW components,called from SetMemoryClock
  214. USHORT EnableASIC_StaticPwrMgt; //Atomic Table, only used by Bios
  215. USHORT ASIC_StaticPwrMgtStatusChange; //Obsolete , only used by Bios
  216. USHORT DAC_LoadDetection; //Atomic Table, directly used by various SW components,latest version 1.2
  217. USHORT LVTMAEncoderControl; //Atomic Table,directly used by various SW components,latest version 1.3
  218. USHORT LCD1OutputControl; //Atomic Table, directly used by various SW components,latest version 1.1
  219. USHORT DAC1EncoderControl; //Atomic Table, directly used by various SW components,latest version 1.1
  220. USHORT DAC2EncoderControl; //Atomic Table, directly used by various SW components,latest version 1.1
  221. USHORT DVOOutputControl; //Atomic Table, directly used by various SW components,latest version 1.1
  222. USHORT CV1OutputControl; //Atomic Table, Atomic Table, Obsolete from Ry6xx, use DAC2 Output instead
  223. USHORT GetConditionalGoldenSetting; //only used by Bios
  224. USHORT TVEncoderControl; //Function Table,directly used by various SW components,latest version 1.1
  225. USHORT TMDSAEncoderControl; //Atomic Table, directly used by various SW components,latest version 1.3
  226. USHORT LVDSEncoderControl; //Atomic Table, directly used by various SW components,latest version 1.3
  227. USHORT TV1OutputControl; //Atomic Table, Obsolete from Ry6xx, use DAC2 Output instead
  228. USHORT EnableScaler; //Atomic Table, used only by Bios
  229. USHORT BlankCRTC; //Atomic Table, directly used by various SW components,latest version 1.1
  230. USHORT EnableCRTC; //Atomic Table, directly used by various SW components,latest version 1.1
  231. USHORT GetPixelClock; //Atomic Table, directly used by various SW components,latest version 1.1
  232. USHORT EnableVGA_Render; //Function Table,directly used by various SW components,latest version 1.1
  233. USHORT GetSCLKOverMCLKRatio; //Atomic Table, only used by Bios
  234. USHORT SetCRTC_Timing; //Atomic Table, directly used by various SW components,latest version 1.1
  235. USHORT SetCRTC_OverScan; //Atomic Table, used by various SW components,latest version 1.1
  236. USHORT SetCRTC_Replication; //Atomic Table, used only by Bios
  237. USHORT SelectCRTC_Source; //Atomic Table, directly used by various SW components,latest version 1.1
  238. USHORT EnableGraphSurfaces; //Atomic Table, used only by Bios
  239. USHORT UpdateCRTC_DoubleBufferRegisters;
  240. USHORT LUT_AutoFill; //Atomic Table, only used by Bios
  241. USHORT EnableHW_IconCursor; //Atomic Table, only used by Bios
  242. USHORT GetMemoryClock; //Atomic Table, directly used by various SW components,latest version 1.1
  243. USHORT GetEngineClock; //Atomic Table, directly used by various SW components,latest version 1.1
  244. USHORT SetCRTC_UsingDTDTiming; //Atomic Table, directly used by various SW components,latest version 1.1
  245. USHORT ExternalEncoderControl; //Atomic Table, directly used by various SW components,latest version 2.1
  246. USHORT LVTMAOutputControl; //Atomic Table, directly used by various SW components,latest version 1.1
  247. USHORT VRAM_BlockDetectionByStrap; //Atomic Table, used only by Bios
  248. USHORT MemoryCleanUp; //Atomic Table, only used by Bios
  249. USHORT ProcessI2cChannelTransaction; //Function Table,only used by Bios
  250. USHORT WriteOneByteToHWAssistedI2C; //Function Table,indirectly used by various SW components
  251. USHORT ReadHWAssistedI2CStatus; //Atomic Table, indirectly used by various SW components
  252. USHORT SpeedFanControl; //Function Table,indirectly used by various SW components,called from ASIC_Init
  253. USHORT PowerConnectorDetection; //Atomic Table, directly used by various SW components,latest version 1.1
  254. USHORT MC_Synchronization; //Atomic Table, indirectly used by various SW components,called from SetMemoryClock
  255. USHORT ComputeMemoryEnginePLL; //Atomic Table, indirectly used by various SW components,called from SetMemory/EngineClock
  256. USHORT MemoryRefreshConversion; //Atomic Table, indirectly used by various SW components,called from SetMemory or SetEngineClock
  257. USHORT VRAM_GetCurrentInfoBlock; //Atomic Table, used only by Bios
  258. USHORT DynamicMemorySettings; //Atomic Table, indirectly used by various SW components,called from SetMemoryClock
  259. USHORT MemoryTraining; //Atomic Table, used only by Bios
  260. USHORT EnableSpreadSpectrumOnPPLL; //Atomic Table, directly used by various SW components,latest version 1.2
  261. USHORT TMDSAOutputControl; //Atomic Table, directly used by various SW components,latest version 1.1
  262. USHORT SetVoltage; //Function Table,directly and/or indirectly used by various SW components,latest version 1.1
  263. USHORT DAC1OutputControl; //Atomic Table, directly used by various SW components,latest version 1.1
  264. USHORT DAC2OutputControl; //Atomic Table, directly used by various SW components,latest version 1.1
  265. USHORT SetupHWAssistedI2CStatus; //Function Table,only used by Bios, obsolete soon.Switch to use "ReadEDIDFromHWAssistedI2C"
  266. USHORT ClockSource; //Atomic Table, indirectly used by various SW components,called from ASIC_Init
  267. USHORT MemoryDeviceInit; //Atomic Table, indirectly used by various SW components,called from SetMemoryClock
  268. USHORT EnableYUV; //Atomic Table, indirectly used by various SW components,called from EnableVGARender
  269. USHORT DIG1EncoderControl; //Atomic Table,directly used by various SW components,latest version 1.1
  270. USHORT DIG2EncoderControl; //Atomic Table,directly used by various SW components,latest version 1.1
  271. USHORT DIG1TransmitterControl; //Atomic Table,directly used by various SW components,latest version 1.1
  272. USHORT DIG2TransmitterControl; //Atomic Table,directly used by various SW components,latest version 1.1
  273. USHORT ProcessAuxChannelTransaction; //Function Table,only used by Bios
  274. USHORT DPEncoderService; //Function Table,only used by Bios
  275. }ATOM_MASTER_LIST_OF_COMMAND_TABLES;
  276. // For backward compatible
  277. #define ReadEDIDFromHWAssistedI2C ProcessI2cChannelTransaction
  278. #define UNIPHYTransmitterControl DIG1TransmitterControl
  279. #define LVTMATransmitterControl DIG2TransmitterControl
  280. #define SetCRTC_DPM_State GetConditionalGoldenSetting
  281. #define SetUniphyInstance ASIC_StaticPwrMgtStatusChange
  282. #define HPDInterruptService ReadHWAssistedI2CStatus
  283. #define EnableVGA_Access GetSCLKOverMCLKRatio
  284. #define GetDispObjectInfo EnableYUV
  285. typedef struct _ATOM_MASTER_COMMAND_TABLE
  286. {
  287. ATOM_COMMON_TABLE_HEADER sHeader;
  288. ATOM_MASTER_LIST_OF_COMMAND_TABLES ListOfCommandTables;
  289. }ATOM_MASTER_COMMAND_TABLE;
  290. /****************************************************************************/
  291. // Structures used in every command table
  292. /****************************************************************************/
  293. typedef struct _ATOM_TABLE_ATTRIBUTE
  294. {
  295. #if ATOM_BIG_ENDIAN
  296. USHORT UpdatedByUtility:1; //[15]=Table updated by utility flag
  297. USHORT PS_SizeInBytes:7; //[14:8]=Size of parameter space in Bytes (multiple of a dword),
  298. USHORT WS_SizeInBytes:8; //[7:0]=Size of workspace in Bytes (in multiple of a dword),
  299. #else
  300. USHORT WS_SizeInBytes:8; //[7:0]=Size of workspace in Bytes (in multiple of a dword),
  301. USHORT PS_SizeInBytes:7; //[14:8]=Size of parameter space in Bytes (multiple of a dword),
  302. USHORT UpdatedByUtility:1; //[15]=Table updated by utility flag
  303. #endif
  304. }ATOM_TABLE_ATTRIBUTE;
  305. typedef union _ATOM_TABLE_ATTRIBUTE_ACCESS
  306. {
  307. ATOM_TABLE_ATTRIBUTE sbfAccess;
  308. USHORT susAccess;
  309. }ATOM_TABLE_ATTRIBUTE_ACCESS;
  310. /****************************************************************************/
  311. // Common header for all command tables.
  312. // Every table pointed by _ATOM_MASTER_COMMAND_TABLE has this common header.
  313. // And the pointer actually points to this header.
  314. /****************************************************************************/
  315. typedef struct _ATOM_COMMON_ROM_COMMAND_TABLE_HEADER
  316. {
  317. ATOM_COMMON_TABLE_HEADER CommonHeader;
  318. ATOM_TABLE_ATTRIBUTE TableAttribute;
  319. }ATOM_COMMON_ROM_COMMAND_TABLE_HEADER;
  320. /****************************************************************************/
  321. // Structures used by ComputeMemoryEnginePLLTable
  322. /****************************************************************************/
  323. #define COMPUTE_MEMORY_PLL_PARAM 1
  324. #define COMPUTE_ENGINE_PLL_PARAM 2
  325. #define ADJUST_MC_SETTING_PARAM 3
  326. /****************************************************************************/
  327. // Structures used by AdjustMemoryControllerTable
  328. /****************************************************************************/
  329. typedef struct _ATOM_ADJUST_MEMORY_CLOCK_FREQ
  330. {
  331. #if ATOM_BIG_ENDIAN
  332. ULONG ulPointerReturnFlag:1; // BYTE_3[7]=1 - Return the pointer to the right Data Block; BYTE_3[7]=0 - Program the right Data Block
  333. ULONG ulMemoryModuleNumber:7; // BYTE_3[6:0]
  334. ULONG ulClockFreq:24;
  335. #else
  336. ULONG ulClockFreq:24;
  337. ULONG ulMemoryModuleNumber:7; // BYTE_3[6:0]
  338. ULONG ulPointerReturnFlag:1; // BYTE_3[7]=1 - Return the pointer to the right Data Block; BYTE_3[7]=0 - Program the right Data Block
  339. #endif
  340. }ATOM_ADJUST_MEMORY_CLOCK_FREQ;
  341. #define POINTER_RETURN_FLAG 0x80
  342. typedef struct _COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS
  343. {
  344. ULONG ulClock; //When returen, it's the re-calculated clock based on given Fb_div Post_Div and ref_div
  345. UCHAR ucAction; //0:reserved //1:Memory //2:Engine
  346. UCHAR ucReserved; //may expand to return larger Fbdiv later
  347. UCHAR ucFbDiv; //return value
  348. UCHAR ucPostDiv; //return value
  349. }COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS;
  350. typedef struct _COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V2
  351. {
  352. ULONG ulClock; //When return, [23:0] return real clock
  353. UCHAR ucAction; //0:reserved;COMPUTE_MEMORY_PLL_PARAM:Memory;COMPUTE_ENGINE_PLL_PARAM:Engine. it return ref_div to be written to register
  354. USHORT usFbDiv; //return Feedback value to be written to register
  355. UCHAR ucPostDiv; //return post div to be written to register
  356. }COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V2;
  357. #define COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_PS_ALLOCATION COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS
  358. #define SET_CLOCK_FREQ_MASK 0x00FFFFFF //Clock change tables only take bit [23:0] as the requested clock value
  359. #define USE_NON_BUS_CLOCK_MASK 0x01000000 //Applicable to both memory and engine clock change, when set, it uses another clock as the temporary clock (engine uses memory and vice versa)
  360. #define USE_MEMORY_SELF_REFRESH_MASK 0x02000000 //Only applicable to memory clock change, when set, using memory self refresh during clock transition
  361. #define SKIP_INTERNAL_MEMORY_PARAMETER_CHANGE 0x04000000 //Only applicable to memory clock change, when set, the table will skip predefined internal memory parameter change
  362. #define FIRST_TIME_CHANGE_CLOCK 0x08000000 //Applicable to both memory and engine clock change,when set, it means this is 1st time to change clock after ASIC bootup
  363. #define SKIP_SW_PROGRAM_PLL 0x10000000 //Applicable to both memory and engine clock change, when set, it means the table will not program SPLL/MPLL
  364. #define USE_SS_ENABLED_PIXEL_CLOCK USE_NON_BUS_CLOCK_MASK
  365. #define b3USE_NON_BUS_CLOCK_MASK 0x01 //Applicable to both memory and engine clock change, when set, it uses another clock as the temporary clock (engine uses memory and vice versa)
  366. #define b3USE_MEMORY_SELF_REFRESH 0x02 //Only applicable to memory clock change, when set, using memory self refresh during clock transition
  367. #define b3SKIP_INTERNAL_MEMORY_PARAMETER_CHANGE 0x04 //Only applicable to memory clock change, when set, the table will skip predefined internal memory parameter change
  368. #define b3FIRST_TIME_CHANGE_CLOCK 0x08 //Applicable to both memory and engine clock change,when set, it means this is 1st time to change clock after ASIC bootup
  369. #define b3SKIP_SW_PROGRAM_PLL 0x10 //Applicable to both memory and engine clock change, when set, it means the table will not program SPLL/MPLL
  370. typedef struct _ATOM_COMPUTE_CLOCK_FREQ
  371. {
  372. #if ATOM_BIG_ENDIAN
  373. ULONG ulComputeClockFlag:8; // =1: COMPUTE_MEMORY_PLL_PARAM, =2: COMPUTE_ENGINE_PLL_PARAM
  374. ULONG ulClockFreq:24; // in unit of 10kHz
  375. #else
  376. ULONG ulClockFreq:24; // in unit of 10kHz
  377. ULONG ulComputeClockFlag:8; // =1: COMPUTE_MEMORY_PLL_PARAM, =2: COMPUTE_ENGINE_PLL_PARAM
  378. #endif
  379. }ATOM_COMPUTE_CLOCK_FREQ;
  380. typedef struct _ATOM_S_MPLL_FB_DIVIDER
  381. {
  382. USHORT usFbDivFrac;
  383. USHORT usFbDiv;
  384. }ATOM_S_MPLL_FB_DIVIDER;
  385. typedef struct _COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V3
  386. {
  387. union
  388. {
  389. ATOM_COMPUTE_CLOCK_FREQ ulClock; //Input Parameter
  390. ATOM_S_MPLL_FB_DIVIDER ulFbDiv; //Output Parameter
  391. };
  392. UCHAR ucRefDiv; //Output Parameter
  393. UCHAR ucPostDiv; //Output Parameter
  394. UCHAR ucCntlFlag; //Output Parameter
  395. UCHAR ucReserved;
  396. }COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V3;
  397. // ucCntlFlag
  398. #define ATOM_PLL_CNTL_FLAG_PLL_POST_DIV_EN 1
  399. #define ATOM_PLL_CNTL_FLAG_MPLL_VCO_MODE 2
  400. #define ATOM_PLL_CNTL_FLAG_FRACTION_DISABLE 4
  401. #define ATOM_PLL_CNTL_FLAG_SPLL_ISPARE_9 8
  402. // V4 are only used for APU which PLL outside GPU
  403. typedef struct _COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V4
  404. {
  405. #if ATOM_BIG_ENDIAN
  406. ULONG ucPostDiv; //return parameter: post divider which is used to program to register directly
  407. ULONG ulClock:24; //Input= target clock, output = actual clock
  408. #else
  409. ULONG ulClock:24; //Input= target clock, output = actual clock
  410. ULONG ucPostDiv; //return parameter: post divider which is used to program to register directly
  411. #endif
  412. }COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V4;
  413. typedef struct _COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V5
  414. {
  415. union
  416. {
  417. ATOM_COMPUTE_CLOCK_FREQ ulClock; //Input Parameter
  418. ATOM_S_MPLL_FB_DIVIDER ulFbDiv; //Output Parameter
  419. };
  420. UCHAR ucRefDiv; //Output Parameter
  421. UCHAR ucPostDiv; //Output Parameter
  422. union
  423. {
  424. UCHAR ucCntlFlag; //Output Flags
  425. UCHAR ucInputFlag; //Input Flags. ucInputFlag[0] - Strobe(1)/Performance(0) mode
  426. };
  427. UCHAR ucReserved;
  428. }COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V5;
  429. // ucInputFlag
  430. #define ATOM_PLL_INPUT_FLAG_PLL_STROBE_MODE_EN 1 // 1-StrobeMode, 0-PerformanceMode
  431. typedef struct _DYNAMICE_MEMORY_SETTINGS_PARAMETER
  432. {
  433. ATOM_COMPUTE_CLOCK_FREQ ulClock;
  434. ULONG ulReserved[2];
  435. }DYNAMICE_MEMORY_SETTINGS_PARAMETER;
  436. typedef struct _DYNAMICE_ENGINE_SETTINGS_PARAMETER
  437. {
  438. ATOM_COMPUTE_CLOCK_FREQ ulClock;
  439. ULONG ulMemoryClock;
  440. ULONG ulReserved;
  441. }DYNAMICE_ENGINE_SETTINGS_PARAMETER;
  442. /****************************************************************************/
  443. // Structures used by SetEngineClockTable
  444. /****************************************************************************/
  445. typedef struct _SET_ENGINE_CLOCK_PARAMETERS
  446. {
  447. ULONG ulTargetEngineClock; //In 10Khz unit
  448. }SET_ENGINE_CLOCK_PARAMETERS;
  449. typedef struct _SET_ENGINE_CLOCK_PS_ALLOCATION
  450. {
  451. ULONG ulTargetEngineClock; //In 10Khz unit
  452. COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_PS_ALLOCATION sReserved;
  453. }SET_ENGINE_CLOCK_PS_ALLOCATION;
  454. /****************************************************************************/
  455. // Structures used by SetMemoryClockTable
  456. /****************************************************************************/
  457. typedef struct _SET_MEMORY_CLOCK_PARAMETERS
  458. {
  459. ULONG ulTargetMemoryClock; //In 10Khz unit
  460. }SET_MEMORY_CLOCK_PARAMETERS;
  461. typedef struct _SET_MEMORY_CLOCK_PS_ALLOCATION
  462. {
  463. ULONG ulTargetMemoryClock; //In 10Khz unit
  464. COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_PS_ALLOCATION sReserved;
  465. }SET_MEMORY_CLOCK_PS_ALLOCATION;
  466. /****************************************************************************/
  467. // Structures used by ASIC_Init.ctb
  468. /****************************************************************************/
  469. typedef struct _ASIC_INIT_PARAMETERS
  470. {
  471. ULONG ulDefaultEngineClock; //In 10Khz unit
  472. ULONG ulDefaultMemoryClock; //In 10Khz unit
  473. }ASIC_INIT_PARAMETERS;
  474. typedef struct _ASIC_INIT_PS_ALLOCATION
  475. {
  476. ASIC_INIT_PARAMETERS sASICInitClocks;
  477. SET_ENGINE_CLOCK_PS_ALLOCATION sReserved; //Caller doesn't need to init this structure
  478. }ASIC_INIT_PS_ALLOCATION;
  479. /****************************************************************************/
  480. // Structure used by DynamicClockGatingTable.ctb
  481. /****************************************************************************/
  482. typedef struct _DYNAMIC_CLOCK_GATING_PARAMETERS
  483. {
  484. UCHAR ucEnable; // ATOM_ENABLE or ATOM_DISABLE
  485. UCHAR ucPadding[3];
  486. }DYNAMIC_CLOCK_GATING_PARAMETERS;
  487. #define DYNAMIC_CLOCK_GATING_PS_ALLOCATION DYNAMIC_CLOCK_GATING_PARAMETERS
  488. /****************************************************************************/
  489. // Structure used by EnableASIC_StaticPwrMgtTable.ctb
  490. /****************************************************************************/
  491. typedef struct _ENABLE_ASIC_STATIC_PWR_MGT_PARAMETERS
  492. {
  493. UCHAR ucEnable; // ATOM_ENABLE or ATOM_DISABLE
  494. UCHAR ucPadding[3];
  495. }ENABLE_ASIC_STATIC_PWR_MGT_PARAMETERS;
  496. #define ENABLE_ASIC_STATIC_PWR_MGT_PS_ALLOCATION ENABLE_ASIC_STATIC_PWR_MGT_PARAMETERS
  497. /****************************************************************************/
  498. // Structures used by DAC_LoadDetectionTable.ctb
  499. /****************************************************************************/
  500. typedef struct _DAC_LOAD_DETECTION_PARAMETERS
  501. {
  502. USHORT usDeviceID; //{ATOM_DEVICE_CRTx_SUPPORT,ATOM_DEVICE_TVx_SUPPORT,ATOM_DEVICE_CVx_SUPPORT}
  503. UCHAR ucDacType; //{ATOM_DAC_A,ATOM_DAC_B, ATOM_EXT_DAC}
  504. UCHAR ucMisc; //Valid only when table revision =1.3 and above
  505. }DAC_LOAD_DETECTION_PARAMETERS;
  506. // DAC_LOAD_DETECTION_PARAMETERS.ucMisc
  507. #define DAC_LOAD_MISC_YPrPb 0x01
  508. typedef struct _DAC_LOAD_DETECTION_PS_ALLOCATION
  509. {
  510. DAC_LOAD_DETECTION_PARAMETERS sDacload;
  511. ULONG Reserved[2];// Don't set this one, allocation for EXT DAC
  512. }DAC_LOAD_DETECTION_PS_ALLOCATION;
  513. /****************************************************************************/
  514. // Structures used by DAC1EncoderControlTable.ctb and DAC2EncoderControlTable.ctb
  515. /****************************************************************************/
  516. typedef struct _DAC_ENCODER_CONTROL_PARAMETERS
  517. {
  518. USHORT usPixelClock; // in 10KHz; for bios convenient
  519. UCHAR ucDacStandard; // See definition of ATOM_DACx_xxx, For DEC3.0, bit 7 used as internal flag to indicate DAC2 (==1) or DAC1 (==0)
  520. UCHAR ucAction; // 0: turn off encoder
  521. // 1: setup and turn on encoder
  522. // 7: ATOM_ENCODER_INIT Initialize DAC
  523. }DAC_ENCODER_CONTROL_PARAMETERS;
  524. #define DAC_ENCODER_CONTROL_PS_ALLOCATION DAC_ENCODER_CONTROL_PARAMETERS
  525. /****************************************************************************/
  526. // Structures used by DIG1EncoderControlTable
  527. // DIG2EncoderControlTable
  528. // ExternalEncoderControlTable
  529. /****************************************************************************/
  530. typedef struct _DIG_ENCODER_CONTROL_PARAMETERS
  531. {
  532. USHORT usPixelClock; // in 10KHz; for bios convenient
  533. UCHAR ucConfig;
  534. // [2] Link Select:
  535. // =0: PHY linkA if bfLane<3
  536. // =1: PHY linkB if bfLanes<3
  537. // =0: PHY linkA+B if bfLanes=3
  538. // [3] Transmitter Sel
  539. // =0: UNIPHY or PCIEPHY
  540. // =1: LVTMA
  541. UCHAR ucAction; // =0: turn off encoder
  542. // =1: turn on encoder
  543. UCHAR ucEncoderMode;
  544. // =0: DP encoder
  545. // =1: LVDS encoder
  546. // =2: DVI encoder
  547. // =3: HDMI encoder
  548. // =4: SDVO encoder
  549. UCHAR ucLaneNum; // how many lanes to enable
  550. UCHAR ucReserved[2];
  551. }DIG_ENCODER_CONTROL_PARAMETERS;
  552. #define DIG_ENCODER_CONTROL_PS_ALLOCATION DIG_ENCODER_CONTROL_PARAMETERS
  553. #define EXTERNAL_ENCODER_CONTROL_PARAMETER DIG_ENCODER_CONTROL_PARAMETERS
  554. //ucConfig
  555. #define ATOM_ENCODER_CONFIG_DPLINKRATE_MASK 0x01
  556. #define ATOM_ENCODER_CONFIG_DPLINKRATE_1_62GHZ 0x00
  557. #define ATOM_ENCODER_CONFIG_DPLINKRATE_2_70GHZ 0x01
  558. #define ATOM_ENCODER_CONFIG_DPLINKRATE_5_40GHZ 0x02
  559. #define ATOM_ENCODER_CONFIG_LINK_SEL_MASK 0x04
  560. #define ATOM_ENCODER_CONFIG_LINKA 0x00
  561. #define ATOM_ENCODER_CONFIG_LINKB 0x04
  562. #define ATOM_ENCODER_CONFIG_LINKA_B ATOM_TRANSMITTER_CONFIG_LINKA
  563. #define ATOM_ENCODER_CONFIG_LINKB_A ATOM_ENCODER_CONFIG_LINKB
  564. #define ATOM_ENCODER_CONFIG_TRANSMITTER_SEL_MASK 0x08
  565. #define ATOM_ENCODER_CONFIG_UNIPHY 0x00
  566. #define ATOM_ENCODER_CONFIG_LVTMA 0x08
  567. #define ATOM_ENCODER_CONFIG_TRANSMITTER1 0x00
  568. #define ATOM_ENCODER_CONFIG_TRANSMITTER2 0x08
  569. #define ATOM_ENCODER_CONFIG_DIGB 0x80 // VBIOS Internal use, outside SW should set this bit=0
  570. // ucAction
  571. // ATOM_ENABLE: Enable Encoder
  572. // ATOM_DISABLE: Disable Encoder
  573. //ucEncoderMode
  574. #define ATOM_ENCODER_MODE_DP 0
  575. #define ATOM_ENCODER_MODE_LVDS 1
  576. #define ATOM_ENCODER_MODE_DVI 2
  577. #define ATOM_ENCODER_MODE_HDMI 3
  578. #define ATOM_ENCODER_MODE_SDVO 4
  579. #define ATOM_ENCODER_MODE_DP_AUDIO 5
  580. #define ATOM_ENCODER_MODE_TV 13
  581. #define ATOM_ENCODER_MODE_CV 14
  582. #define ATOM_ENCODER_MODE_CRT 15
  583. #define ATOM_ENCODER_MODE_DVO 16
  584. #define ATOM_ENCODER_MODE_DP_SST ATOM_ENCODER_MODE_DP // For DP1.2
  585. #define ATOM_ENCODER_MODE_DP_MST 5 // For DP1.2
  586. typedef struct _ATOM_DIG_ENCODER_CONFIG_V2
  587. {
  588. #if ATOM_BIG_ENDIAN
  589. UCHAR ucReserved1:2;
  590. UCHAR ucTransmitterSel:2; // =0: UniphyAB, =1: UniphyCD =2: UniphyEF
  591. UCHAR ucLinkSel:1; // =0: linkA/C/E =1: linkB/D/F
  592. UCHAR ucReserved:1;
  593. UCHAR ucDPLinkRate:1; // =0: 1.62Ghz, =1: 2.7Ghz
  594. #else
  595. UCHAR ucDPLinkRate:1; // =0: 1.62Ghz, =1: 2.7Ghz
  596. UCHAR ucReserved:1;
  597. UCHAR ucLinkSel:1; // =0: linkA/C/E =1: linkB/D/F
  598. UCHAR ucTransmitterSel:2; // =0: UniphyAB, =1: UniphyCD =2: UniphyEF
  599. UCHAR ucReserved1:2;
  600. #endif
  601. }ATOM_DIG_ENCODER_CONFIG_V2;
  602. typedef struct _DIG_ENCODER_CONTROL_PARAMETERS_V2
  603. {
  604. USHORT usPixelClock; // in 10KHz; for bios convenient
  605. ATOM_DIG_ENCODER_CONFIG_V2 acConfig;
  606. UCHAR ucAction;
  607. UCHAR ucEncoderMode;
  608. // =0: DP encoder
  609. // =1: LVDS encoder
  610. // =2: DVI encoder
  611. // =3: HDMI encoder
  612. // =4: SDVO encoder
  613. UCHAR ucLaneNum; // how many lanes to enable
  614. UCHAR ucStatus; // = DP_LINK_TRAINING_COMPLETE or DP_LINK_TRAINING_INCOMPLETE, only used by VBIOS with command ATOM_ENCODER_CMD_QUERY_DP_LINK_TRAINING_STATUS
  615. UCHAR ucReserved;
  616. }DIG_ENCODER_CONTROL_PARAMETERS_V2;
  617. //ucConfig
  618. #define ATOM_ENCODER_CONFIG_V2_DPLINKRATE_MASK 0x01
  619. #define ATOM_ENCODER_CONFIG_V2_DPLINKRATE_1_62GHZ 0x00
  620. #define ATOM_ENCODER_CONFIG_V2_DPLINKRATE_2_70GHZ 0x01
  621. #define ATOM_ENCODER_CONFIG_V2_LINK_SEL_MASK 0x04
  622. #define ATOM_ENCODER_CONFIG_V2_LINKA 0x00
  623. #define ATOM_ENCODER_CONFIG_V2_LINKB 0x04
  624. #define ATOM_ENCODER_CONFIG_V2_TRANSMITTER_SEL_MASK 0x18
  625. #define ATOM_ENCODER_CONFIG_V2_TRANSMITTER1 0x00
  626. #define ATOM_ENCODER_CONFIG_V2_TRANSMITTER2 0x08
  627. #define ATOM_ENCODER_CONFIG_V2_TRANSMITTER3 0x10
  628. // ucAction:
  629. // ATOM_DISABLE
  630. // ATOM_ENABLE
  631. #define ATOM_ENCODER_CMD_DP_LINK_TRAINING_START 0x08
  632. #define ATOM_ENCODER_CMD_DP_LINK_TRAINING_PATTERN1 0x09
  633. #define ATOM_ENCODER_CMD_DP_LINK_TRAINING_PATTERN2 0x0a
  634. #define ATOM_ENCODER_CMD_DP_LINK_TRAINING_PATTERN3 0x13
  635. #define ATOM_ENCODER_CMD_DP_LINK_TRAINING_COMPLETE 0x0b
  636. #define ATOM_ENCODER_CMD_DP_VIDEO_OFF 0x0c
  637. #define ATOM_ENCODER_CMD_DP_VIDEO_ON 0x0d
  638. #define ATOM_ENCODER_CMD_QUERY_DP_LINK_TRAINING_STATUS 0x0e
  639. #define ATOM_ENCODER_CMD_SETUP 0x0f
  640. #define ATOM_ENCODER_CMD_SETUP_PANEL_MODE 0x10
  641. // ucStatus
  642. #define ATOM_ENCODER_STATUS_LINK_TRAINING_COMPLETE 0x10
  643. #define ATOM_ENCODER_STATUS_LINK_TRAINING_INCOMPLETE 0x00
  644. //ucTableFormatRevision=1
  645. //ucTableContentRevision=3
  646. // Following function ENABLE sub-function will be used by driver when TMDS/HDMI/LVDS is used, disable function will be used by driver
  647. typedef struct _ATOM_DIG_ENCODER_CONFIG_V3
  648. {
  649. #if ATOM_BIG_ENDIAN
  650. UCHAR ucReserved1:1;
  651. UCHAR ucDigSel:3; // =0/1/2/3/4/5: DIG0/1/2/3/4/5 (In register spec also referred as DIGA/B/C/D/E/F)
  652. UCHAR ucReserved:3;
  653. UCHAR ucDPLinkRate:1; // =0: 1.62Ghz, =1: 2.7Ghz
  654. #else
  655. UCHAR ucDPLinkRate:1; // =0: 1.62Ghz, =1: 2.7Ghz
  656. UCHAR ucReserved:3;
  657. UCHAR ucDigSel:3; // =0/1/2/3/4/5: DIG0/1/2/3/4/5 (In register spec also referred as DIGA/B/C/D/E/F)
  658. UCHAR ucReserved1:1;
  659. #endif
  660. }ATOM_DIG_ENCODER_CONFIG_V3;
  661. #define ATOM_ENCODER_CONFIG_V3_DPLINKRATE_MASK 0x03
  662. #define ATOM_ENCODER_CONFIG_V3_DPLINKRATE_1_62GHZ 0x00
  663. #define ATOM_ENCODER_CONFIG_V3_DPLINKRATE_2_70GHZ 0x01
  664. #define ATOM_ENCODER_CONFIG_V3_ENCODER_SEL 0x70
  665. #define ATOM_ENCODER_CONFIG_V3_DIG0_ENCODER 0x00
  666. #define ATOM_ENCODER_CONFIG_V3_DIG1_ENCODER 0x10
  667. #define ATOM_ENCODER_CONFIG_V3_DIG2_ENCODER 0x20
  668. #define ATOM_ENCODER_CONFIG_V3_DIG3_ENCODER 0x30
  669. #define ATOM_ENCODER_CONFIG_V3_DIG4_ENCODER 0x40
  670. #define ATOM_ENCODER_CONFIG_V3_DIG5_ENCODER 0x50
  671. typedef struct _DIG_ENCODER_CONTROL_PARAMETERS_V3
  672. {
  673. USHORT usPixelClock; // in 10KHz; for bios convenient
  674. ATOM_DIG_ENCODER_CONFIG_V3 acConfig;
  675. UCHAR ucAction;
  676. union {
  677. UCHAR ucEncoderMode;
  678. // =0: DP encoder
  679. // =1: LVDS encoder
  680. // =2: DVI encoder
  681. // =3: HDMI encoder
  682. // =4: SDVO encoder
  683. // =5: DP audio
  684. UCHAR ucPanelMode; // only valid when ucAction == ATOM_ENCODER_CMD_SETUP_PANEL_MODE
  685. // =0: external DP
  686. // =1: internal DP2
  687. // =0x11: internal DP1 for NutMeg/Travis DP translator
  688. };
  689. UCHAR ucLaneNum; // how many lanes to enable
  690. UCHAR ucBitPerColor; // only valid for DP mode when ucAction = ATOM_ENCODER_CMD_SETUP
  691. UCHAR ucReserved;
  692. }DIG_ENCODER_CONTROL_PARAMETERS_V3;
  693. //ucTableFormatRevision=1
  694. //ucTableContentRevision=4
  695. // start from NI
  696. // Following function ENABLE sub-function will be used by driver when TMDS/HDMI/LVDS is used, disable function will be used by driver
  697. typedef struct _ATOM_DIG_ENCODER_CONFIG_V4
  698. {
  699. #if ATOM_BIG_ENDIAN
  700. UCHAR ucReserved1:1;
  701. UCHAR ucDigSel:3; // =0/1/2/3/4/5: DIG0/1/2/3/4/5 (In register spec also referred as DIGA/B/C/D/E/F)
  702. UCHAR ucReserved:2;
  703. UCHAR ucDPLinkRate:2; // =0: 1.62Ghz, =1: 2.7Ghz, 2=5.4Ghz <= Changed comparing to previous version
  704. #else
  705. UCHAR ucDPLinkRate:2; // =0: 1.62Ghz, =1: 2.7Ghz, 2=5.4Ghz <= Changed comparing to previous version
  706. UCHAR ucReserved:2;
  707. UCHAR ucDigSel:3; // =0/1/2/3/4/5: DIG0/1/2/3/4/5 (In register spec also referred as DIGA/B/C/D/E/F)
  708. UCHAR ucReserved1:1;
  709. #endif
  710. }ATOM_DIG_ENCODER_CONFIG_V4;
  711. #define ATOM_ENCODER_CONFIG_V4_DPLINKRATE_MASK 0x03
  712. #define ATOM_ENCODER_CONFIG_V4_DPLINKRATE_1_62GHZ 0x00
  713. #define ATOM_ENCODER_CONFIG_V4_DPLINKRATE_2_70GHZ 0x01
  714. #define ATOM_ENCODER_CONFIG_V4_DPLINKRATE_5_40GHZ 0x02
  715. #define ATOM_ENCODER_CONFIG_V4_ENCODER_SEL 0x70
  716. #define ATOM_ENCODER_CONFIG_V4_DIG0_ENCODER 0x00
  717. #define ATOM_ENCODER_CONFIG_V4_DIG1_ENCODER 0x10
  718. #define ATOM_ENCODER_CONFIG_V4_DIG2_ENCODER 0x20
  719. #define ATOM_ENCODER_CONFIG_V4_DIG3_ENCODER 0x30
  720. #define ATOM_ENCODER_CONFIG_V4_DIG4_ENCODER 0x40
  721. #define ATOM_ENCODER_CONFIG_V4_DIG5_ENCODER 0x50
  722. typedef struct _DIG_ENCODER_CONTROL_PARAMETERS_V4
  723. {
  724. USHORT usPixelClock; // in 10KHz; for bios convenient
  725. union{
  726. ATOM_DIG_ENCODER_CONFIG_V4 acConfig;
  727. UCHAR ucConfig;
  728. };
  729. UCHAR ucAction;
  730. union {
  731. UCHAR ucEncoderMode;
  732. // =0: DP encoder
  733. // =1: LVDS encoder
  734. // =2: DVI encoder
  735. // =3: HDMI encoder
  736. // =4: SDVO encoder
  737. // =5: DP audio
  738. UCHAR ucPanelMode; // only valid when ucAction == ATOM_ENCODER_CMD_SETUP_PANEL_MODE
  739. // =0: external DP
  740. // =1: internal DP2
  741. // =0x11: internal DP1 for NutMeg/Travis DP translator
  742. };
  743. UCHAR ucLaneNum; // how many lanes to enable
  744. UCHAR ucBitPerColor; // only valid for DP mode when ucAction = ATOM_ENCODER_CMD_SETUP
  745. UCHAR ucHPD_ID; // HPD ID (1-6). =0 means to skip HDP programming. New comparing to previous version
  746. }DIG_ENCODER_CONTROL_PARAMETERS_V4;
  747. // define ucBitPerColor:
  748. #define PANEL_BPC_UNDEFINE 0x00
  749. #define PANEL_6BIT_PER_COLOR 0x01
  750. #define PANEL_8BIT_PER_COLOR 0x02
  751. #define PANEL_10BIT_PER_COLOR 0x03
  752. #define PANEL_12BIT_PER_COLOR 0x04
  753. #define PANEL_16BIT_PER_COLOR 0x05
  754. //define ucPanelMode
  755. #define DP_PANEL_MODE_EXTERNAL_DP_MODE 0x00
  756. #define DP_PANEL_MODE_INTERNAL_DP2_MODE 0x01
  757. #define DP_PANEL_MODE_INTERNAL_DP1_MODE 0x11
  758. /****************************************************************************/
  759. // Structures used by UNIPHYTransmitterControlTable
  760. // LVTMATransmitterControlTable
  761. // DVOOutputControlTable
  762. /****************************************************************************/
  763. typedef struct _ATOM_DP_VS_MODE
  764. {
  765. UCHAR ucLaneSel;
  766. UCHAR ucLaneSet;
  767. }ATOM_DP_VS_MODE;
  768. typedef struct _DIG_TRANSMITTER_CONTROL_PARAMETERS
  769. {
  770. union
  771. {
  772. USHORT usPixelClock; // in 10KHz; for bios convenient
  773. USHORT usInitInfo; // when init uniphy,lower 8bit is used for connector type defined in objectid.h
  774. ATOM_DP_VS_MODE asMode; // DP Voltage swing mode
  775. };
  776. UCHAR ucConfig;
  777. // [0]=0: 4 lane Link,
  778. // =1: 8 lane Link ( Dual Links TMDS )
  779. // [1]=0: InCoherent mode
  780. // =1: Coherent Mode
  781. // [2] Link Select:
  782. // =0: PHY linkA if bfLane<3
  783. // =1: PHY linkB if bfLanes<3
  784. // =0: PHY linkA+B if bfLanes=3
  785. // [5:4]PCIE lane Sel
  786. // =0: lane 0~3 or 0~7
  787. // =1: lane 4~7
  788. // =2: lane 8~11 or 8~15
  789. // =3: lane 12~15
  790. UCHAR ucAction; // =0: turn off encoder
  791. // =1: turn on encoder
  792. UCHAR ucReserved[4];
  793. }DIG_TRANSMITTER_CONTROL_PARAMETERS;
  794. #define DIG_TRANSMITTER_CONTROL_PS_ALLOCATION DIG_TRANSMITTER_CONTROL_PARAMETERS
  795. //ucInitInfo
  796. #define ATOM_TRAMITTER_INITINFO_CONNECTOR_MASK 0x00ff
  797. //ucConfig
  798. #define ATOM_TRANSMITTER_CONFIG_8LANE_LINK 0x01
  799. #define ATOM_TRANSMITTER_CONFIG_COHERENT 0x02
  800. #define ATOM_TRANSMITTER_CONFIG_LINK_SEL_MASK 0x04
  801. #define ATOM_TRANSMITTER_CONFIG_LINKA 0x00
  802. #define ATOM_TRANSMITTER_CONFIG_LINKB 0x04
  803. #define ATOM_TRANSMITTER_CONFIG_LINKA_B 0x00
  804. #define ATOM_TRANSMITTER_CONFIG_LINKB_A 0x04
  805. #define ATOM_TRANSMITTER_CONFIG_ENCODER_SEL_MASK 0x08 // only used when ATOM_TRANSMITTER_ACTION_ENABLE
  806. #define ATOM_TRANSMITTER_CONFIG_DIG1_ENCODER 0x00 // only used when ATOM_TRANSMITTER_ACTION_ENABLE
  807. #define ATOM_TRANSMITTER_CONFIG_DIG2_ENCODER 0x08 // only used when ATOM_TRANSMITTER_ACTION_ENABLE
  808. #define ATOM_TRANSMITTER_CONFIG_CLKSRC_MASK 0x30
  809. #define ATOM_TRANSMITTER_CONFIG_CLKSRC_PPLL 0x00
  810. #define ATOM_TRANSMITTER_CONFIG_CLKSRC_PCIE 0x20
  811. #define ATOM_TRANSMITTER_CONFIG_CLKSRC_XTALIN 0x30
  812. #define ATOM_TRANSMITTER_CONFIG_LANE_SEL_MASK 0xc0
  813. #define ATOM_TRANSMITTER_CONFIG_LANE_0_3 0x00
  814. #define ATOM_TRANSMITTER_CONFIG_LANE_0_7 0x00
  815. #define ATOM_TRANSMITTER_CONFIG_LANE_4_7 0x40
  816. #define ATOM_TRANSMITTER_CONFIG_LANE_8_11 0x80
  817. #define ATOM_TRANSMITTER_CONFIG_LANE_8_15 0x80
  818. #define ATOM_TRANSMITTER_CONFIG_LANE_12_15 0xc0
  819. //ucAction
  820. #define ATOM_TRANSMITTER_ACTION_DISABLE 0
  821. #define ATOM_TRANSMITTER_ACTION_ENABLE 1
  822. #define ATOM_TRANSMITTER_ACTION_LCD_BLOFF 2
  823. #define ATOM_TRANSMITTER_ACTION_LCD_BLON 3
  824. #define ATOM_TRANSMITTER_ACTION_BL_BRIGHTNESS_CONTROL 4
  825. #define ATOM_TRANSMITTER_ACTION_LCD_SELFTEST_START 5
  826. #define ATOM_TRANSMITTER_ACTION_LCD_SELFTEST_STOP 6
  827. #define ATOM_TRANSMITTER_ACTION_INIT 7
  828. #define ATOM_TRANSMITTER_ACTION_DISABLE_OUTPUT 8
  829. #define ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT 9
  830. #define ATOM_TRANSMITTER_ACTION_SETUP 10
  831. #define ATOM_TRANSMITTER_ACTION_SETUP_VSEMPH 11
  832. #define ATOM_TRANSMITTER_ACTION_POWER_ON 12
  833. #define ATOM_TRANSMITTER_ACTION_POWER_OFF 13
  834. // Following are used for DigTransmitterControlTable ver1.2
  835. typedef struct _ATOM_DIG_TRANSMITTER_CONFIG_V2
  836. {
  837. #if ATOM_BIG_ENDIAN
  838. UCHAR ucTransmitterSel:2; //bit7:6: =0 Dig Transmitter 1 ( Uniphy AB )
  839. // =1 Dig Transmitter 2 ( Uniphy CD )
  840. // =2 Dig Transmitter 3 ( Uniphy EF )
  841. UCHAR ucReserved:1;
  842. UCHAR fDPConnector:1; //bit4=0: DP connector =1: None DP connector
  843. UCHAR ucEncoderSel:1; //bit3=0: Data/Clk path source from DIGA( DIG inst0 ). =1: Data/clk path source from DIGB ( DIG inst1 )
  844. UCHAR ucLinkSel:1; //bit2=0: Uniphy LINKA or C or E when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is A or C or E
  845. // =1: Uniphy LINKB or D or F when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is B or D or F
  846. UCHAR fCoherentMode:1; //bit1=1: Coherent Mode ( for DVI/HDMI mode )
  847. UCHAR fDualLinkConnector:1; //bit0=1: Dual Link DVI connector
  848. #else
  849. UCHAR fDualLinkConnector:1; //bit0=1: Dual Link DVI connector
  850. UCHAR fCoherentMode:1; //bit1=1: Coherent Mode ( for DVI/HDMI mode )
  851. UCHAR ucLinkSel:1; //bit2=0: Uniphy LINKA or C or E when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is A or C or E
  852. // =1: Uniphy LINKB or D or F when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is B or D or F
  853. UCHAR ucEncoderSel:1; //bit3=0: Data/Clk path source from DIGA( DIG inst0 ). =1: Data/clk path source from DIGB ( DIG inst1 )
  854. UCHAR fDPConnector:1; //bit4=0: DP connector =1: None DP connector
  855. UCHAR ucReserved:1;
  856. UCHAR ucTransmitterSel:2; //bit7:6: =0 Dig Transmitter 1 ( Uniphy AB )
  857. // =1 Dig Transmitter 2 ( Uniphy CD )
  858. // =2 Dig Transmitter 3 ( Uniphy EF )
  859. #endif
  860. }ATOM_DIG_TRANSMITTER_CONFIG_V2;
  861. //ucConfig
  862. //Bit0
  863. #define ATOM_TRANSMITTER_CONFIG_V2_DUAL_LINK_CONNECTOR 0x01
  864. //Bit1
  865. #define ATOM_TRANSMITTER_CONFIG_V2_COHERENT 0x02
  866. //Bit2
  867. #define ATOM_TRANSMITTER_CONFIG_V2_LINK_SEL_MASK 0x04
  868. #define ATOM_TRANSMITTER_CONFIG_V2_LINKA 0x00
  869. #define ATOM_TRANSMITTER_CONFIG_V2_LINKB 0x04
  870. // Bit3
  871. #define ATOM_TRANSMITTER_CONFIG_V2_ENCODER_SEL_MASK 0x08
  872. #define ATOM_TRANSMITTER_CONFIG_V2_DIG1_ENCODER 0x00 // only used when ucAction == ATOM_TRANSMITTER_ACTION_ENABLE or ATOM_TRANSMITTER_ACTION_SETUP
  873. #define ATOM_TRANSMITTER_CONFIG_V2_DIG2_ENCODER 0x08 // only used when ucAction == ATOM_TRANSMITTER_ACTION_ENABLE or ATOM_TRANSMITTER_ACTION_SETUP
  874. // Bit4
  875. #define ATOM_TRASMITTER_CONFIG_V2_DP_CONNECTOR 0x10
  876. // Bit7:6
  877. #define ATOM_TRANSMITTER_CONFIG_V2_TRANSMITTER_SEL_MASK 0xC0
  878. #define ATOM_TRANSMITTER_CONFIG_V2_TRANSMITTER1 0x00 //AB
  879. #define ATOM_TRANSMITTER_CONFIG_V2_TRANSMITTER2 0x40 //CD
  880. #define ATOM_TRANSMITTER_CONFIG_V2_TRANSMITTER3 0x80 //EF
  881. typedef struct _DIG_TRANSMITTER_CONTROL_PARAMETERS_V2
  882. {
  883. union
  884. {
  885. USHORT usPixelClock; // in 10KHz; for bios convenient
  886. USHORT usInitInfo; // when init uniphy,lower 8bit is used for connector type defined in objectid.h
  887. ATOM_DP_VS_MODE asMode; // DP Voltage swing mode
  888. };
  889. ATOM_DIG_TRANSMITTER_CONFIG_V2 acConfig;
  890. UCHAR ucAction; // define as ATOM_TRANSMITER_ACTION_XXX
  891. UCHAR ucReserved[4];
  892. }DIG_TRANSMITTER_CONTROL_PARAMETERS_V2;
  893. typedef struct _ATOM_DIG_TRANSMITTER_CONFIG_V3
  894. {
  895. #if ATOM_BIG_ENDIAN
  896. UCHAR ucTransmitterSel:2; //bit7:6: =0 Dig Transmitter 1 ( Uniphy AB )
  897. // =1 Dig Transmitter 2 ( Uniphy CD )
  898. // =2 Dig Transmitter 3 ( Uniphy EF )
  899. UCHAR ucRefClkSource:2; //bit5:4: PPLL1 =0, PPLL2=1, EXT_CLK=2
  900. UCHAR ucEncoderSel:1; //bit3=0: Data/Clk path source from DIGA/C/E. =1: Data/clk path source from DIGB/D/F
  901. UCHAR ucLinkSel:1; //bit2=0: Uniphy LINKA or C or E when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is A or C or E
  902. // =1: Uniphy LINKB or D or F when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is B or D or F
  903. UCHAR fCoherentMode:1; //bit1=1: Coherent Mode ( for DVI/HDMI mode )
  904. UCHAR fDualLinkConnector:1; //bit0=1: Dual Link DVI connector
  905. #else
  906. UCHAR fDualLinkConnector:1; //bit0=1: Dual Link DVI connector
  907. UCHAR fCoherentMode:1; //bit1=1: Coherent Mode ( for DVI/HDMI mode )
  908. UCHAR ucLinkSel:1; //bit2=0: Uniphy LINKA or C or E when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is A or C or E
  909. // =1: Uniphy LINKB or D or F when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is B or D or F
  910. UCHAR ucEncoderSel:1; //bit3=0: Data/Clk path source from DIGA/C/E. =1: Data/clk path source from DIGB/D/F
  911. UCHAR ucRefClkSource:2; //bit5:4: PPLL1 =0, PPLL2=1, EXT_CLK=2
  912. UCHAR ucTransmitterSel:2; //bit7:6: =0 Dig Transmitter 1 ( Uniphy AB )
  913. // =1 Dig Transmitter 2 ( Uniphy CD )
  914. // =2 Dig Transmitter 3 ( Uniphy EF )
  915. #endif
  916. }ATOM_DIG_TRANSMITTER_CONFIG_V3;
  917. typedef struct _DIG_TRANSMITTER_CONTROL_PARAMETERS_V3
  918. {
  919. union
  920. {
  921. USHORT usPixelClock; // in 10KHz; for bios convenient
  922. USHORT usInitInfo; // when init uniphy,lower 8bit is used for connector type defined in objectid.h
  923. ATOM_DP_VS_MODE asMode; // DP Voltage swing mode
  924. };
  925. ATOM_DIG_TRANSMITTER_CONFIG_V3 acConfig;
  926. UCHAR ucAction; // define as ATOM_TRANSMITER_ACTION_XXX
  927. UCHAR ucLaneNum;
  928. UCHAR ucReserved[3];
  929. }DIG_TRANSMITTER_CONTROL_PARAMETERS_V3;
  930. //ucConfig
  931. //Bit0
  932. #define ATOM_TRANSMITTER_CONFIG_V3_DUAL_LINK_CONNECTOR 0x01
  933. //Bit1
  934. #define ATOM_TRANSMITTER_CONFIG_V3_COHERENT 0x02
  935. //Bit2
  936. #define ATOM_TRANSMITTER_CONFIG_V3_LINK_SEL_MASK 0x04
  937. #define ATOM_TRANSMITTER_CONFIG_V3_LINKA 0x00
  938. #define ATOM_TRANSMITTER_CONFIG_V3_LINKB 0x04
  939. // Bit3
  940. #define ATOM_TRANSMITTER_CONFIG_V3_ENCODER_SEL_MASK 0x08
  941. #define ATOM_TRANSMITTER_CONFIG_V3_DIG1_ENCODER 0x00
  942. #define ATOM_TRANSMITTER_CONFIG_V3_DIG2_ENCODER 0x08
  943. // Bit5:4
  944. #define ATOM_TRASMITTER_CONFIG_V3_REFCLK_SEL_MASK 0x30
  945. #define ATOM_TRASMITTER_CONFIG_V3_P1PLL 0x00
  946. #define ATOM_TRASMITTER_CONFIG_V3_P2PLL 0x10
  947. #define ATOM_TRASMITTER_CONFIG_V3_REFCLK_SRC_EXT 0x20
  948. // Bit7:6
  949. #define ATOM_TRANSMITTER_CONFIG_V3_TRANSMITTER_SEL_MASK 0xC0
  950. #define ATOM_TRANSMITTER_CONFIG_V3_TRANSMITTER1 0x00 //AB
  951. #define ATOM_TRANSMITTER_CONFIG_V3_TRANSMITTER2 0x40 //CD
  952. #define ATOM_TRANSMITTER_CONFIG_V3_TRANSMITTER3 0x80 //EF
  953. /****************************************************************************/
  954. // Structures used by UNIPHYTransmitterControlTable V1.4
  955. // ASIC Families: NI
  956. // ucTableFormatRevision=1
  957. // ucTableContentRevision=4
  958. /****************************************************************************/
  959. typedef struct _ATOM_DP_VS_MODE_V4
  960. {
  961. UCHAR ucLaneSel;
  962. union
  963. {
  964. UCHAR ucLaneSet;
  965. struct {
  966. #if ATOM_BIG_ENDIAN
  967. UCHAR ucPOST_CURSOR2:2; //Bit[7:6] Post Cursor2 Level <= New in V4
  968. UCHAR ucPRE_EMPHASIS:3; //Bit[5:3] Pre-emphasis Level
  969. UCHAR ucVOLTAGE_SWING:3; //Bit[2:0] Voltage Swing Level
  970. #else
  971. UCHAR ucVOLTAGE_SWING:3; //Bit[2:0] Voltage Swing Level
  972. UCHAR ucPRE_EMPHASIS:3; //Bit[5:3] Pre-emphasis Level
  973. UCHAR ucPOST_CURSOR2:2; //Bit[7:6] Post Cursor2 Level <= New in V4
  974. #endif
  975. };
  976. };
  977. }ATOM_DP_VS_MODE_V4;
  978. typedef struct _ATOM_DIG_TRANSMITTER_CONFIG_V4
  979. {
  980. #if ATOM_BIG_ENDIAN
  981. UCHAR ucTransmitterSel:2; //bit7:6: =0 Dig Transmitter 1 ( Uniphy AB )
  982. // =1 Dig Transmitter 2 ( Uniphy CD )
  983. // =2 Dig Transmitter 3 ( Uniphy EF )
  984. UCHAR ucRefClkSource:2; //bit5:4: PPLL1 =0, PPLL2=1, DCPLL=2, EXT_CLK=3 <= New
  985. UCHAR ucEncoderSel:1; //bit3=0: Data/Clk path source from DIGA/C/E. =1: Data/clk path source from DIGB/D/F
  986. UCHAR ucLinkSel:1; //bit2=0: Uniphy LINKA or C or E when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is A or C or E
  987. // =1: Uniphy LINKB or D or F when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is B or D or F
  988. UCHAR fCoherentMode:1; //bit1=1: Coherent Mode ( for DVI/HDMI mode )
  989. UCHAR fDualLinkConnector:1; //bit0=1: Dual Link DVI connector
  990. #else
  991. UCHAR fDualLinkConnector:1; //bit0=1: Dual Link DVI connector
  992. UCHAR fCoherentMode:1; //bit1=1: Coherent Mode ( for DVI/HDMI mode )
  993. UCHAR ucLinkSel:1; //bit2=0: Uniphy LINKA or C or E when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is A or C or E
  994. // =1: Uniphy LINKB or D or F when fDualLinkConnector=0. when fDualLinkConnector=1, it means master link of dual link is B or D or F
  995. UCHAR ucEncoderSel:1; //bit3=0: Data/Clk path source from DIGA/C/E. =1: Data/clk path source from DIGB/D/F
  996. UCHAR ucRefClkSource:2; //bit5:4: PPLL1 =0, PPLL2=1, DCPLL=2, EXT_CLK=3 <= New
  997. UCHAR ucTransmitterSel:2; //bit7:6: =0 Dig Transmitter 1 ( Uniphy AB )
  998. // =1 Dig Transmitter 2 ( Uniphy CD )
  999. // =2 Dig Transmitter 3 ( Uniphy EF )
  1000. #endif
  1001. }ATOM_DIG_TRANSMITTER_CONFIG_V4;
  1002. typedef struct _DIG_TRANSMITTER_CONTROL_PARAMETERS_V4
  1003. {
  1004. union
  1005. {
  1006. USHORT usPixelClock; // in 10KHz; for bios convenient
  1007. USHORT usInitInfo; // when init uniphy,lower 8bit is used for connector type defined in objectid.h
  1008. ATOM_DP_VS_MODE_V4 asMode; // DP Voltage swing mode Redefined comparing to previous version
  1009. };
  1010. union
  1011. {
  1012. ATOM_DIG_TRANSMITTER_CONFIG_V4 acConfig;
  1013. UCHAR ucConfig;
  1014. };
  1015. UCHAR ucAction; // define as ATOM_TRANSMITER_ACTION_XXX
  1016. UCHAR ucLaneNum;
  1017. UCHAR ucReserved[3];
  1018. }DIG_TRANSMITTER_CONTROL_PARAMETERS_V4;
  1019. //ucConfig
  1020. //Bit0
  1021. #define ATOM_TRANSMITTER_CONFIG_V4_DUAL_LINK_CONNECTOR 0x01
  1022. //Bit1
  1023. #define ATOM_TRANSMITTER_CONFIG_V4_COHERENT 0x02
  1024. //Bit2
  1025. #define ATOM_TRANSMITTER_CONFIG_V4_LINK_SEL_MASK 0x04
  1026. #define ATOM_TRANSMITTER_CONFIG_V4_LINKA 0x00
  1027. #define ATOM_TRANSMITTER_CONFIG_V4_LINKB 0x04
  1028. // Bit3
  1029. #define ATOM_TRANSMITTER_CONFIG_V4_ENCODER_SEL_MASK 0x08
  1030. #define ATOM_TRANSMITTER_CONFIG_V4_DIG1_ENCODER 0x00
  1031. #define ATOM_TRANSMITTER_CONFIG_V4_DIG2_ENCODER 0x08
  1032. // Bit5:4
  1033. #define ATOM_TRANSMITTER_CONFIG_V4_REFCLK_SEL_MASK 0x30
  1034. #define ATOM_TRANSMITTER_CONFIG_V4_P1PLL 0x00
  1035. #define ATOM_TRANSMITTER_CONFIG_V4_P2PLL 0x10
  1036. #define ATOM_TRANSMITTER_CONFIG_V4_DCPLL 0x20 // New in _V4
  1037. #define ATOM_TRANSMITTER_CONFIG_V4_REFCLK_SRC_EXT 0x30 // Changed comparing to V3
  1038. // Bit7:6
  1039. #define ATOM_TRANSMITTER_CONFIG_V4_TRANSMITTER_SEL_MASK 0xC0
  1040. #define ATOM_TRANSMITTER_CONFIG_V4_TRANSMITTER1 0x00 //AB
  1041. #define ATOM_TRANSMITTER_CONFIG_V4_TRANSMITTER2 0x40 //CD
  1042. #define ATOM_TRANSMITTER_CONFIG_V4_TRANSMITTER3 0x80 //EF
  1043. /****************************************************************************/
  1044. // Structures used by ExternalEncoderControlTable V1.3
  1045. // ASIC Families: Evergreen, Llano, NI
  1046. // ucTableFormatRevision=1
  1047. // ucTableContentRevision=3
  1048. /****************************************************************************/
  1049. typedef struct _EXTERNAL_ENCODER_CONTROL_PARAMETERS_V3
  1050. {
  1051. union{
  1052. USHORT usPixelClock; // pixel clock in 10Khz, valid when ucAction=SETUP/ENABLE_OUTPUT
  1053. USHORT usConnectorId; // connector id, valid when ucAction = INIT
  1054. };
  1055. UCHAR ucConfig; // indicate which encoder, and DP link rate when ucAction = SETUP/ENABLE_OUTPUT
  1056. UCHAR ucAction; //
  1057. UCHAR ucEncoderMode; // encoder mode, only used when ucAction = SETUP/ENABLE_OUTPUT
  1058. UCHAR ucLaneNum; // lane number, only used when ucAction = SETUP/ENABLE_OUTPUT
  1059. UCHAR ucBitPerColor; // output bit per color, only valid when ucAction = SETUP/ENABLE_OUTPUT and ucEncodeMode= DP
  1060. UCHAR ucReserved;
  1061. }EXTERNAL_ENCODER_CONTROL_PARAMETERS_V3;
  1062. // ucAction
  1063. #define EXTERNAL_ENCODER_ACTION_V3_DISABLE_OUTPUT 0x00
  1064. #define EXTERNAL_ENCODER_ACTION_V3_ENABLE_OUTPUT 0x01
  1065. #define EXTERNAL_ENCODER_ACTION_V3_ENCODER_INIT 0x07
  1066. #define EXTERNAL_ENCODER_ACTION_V3_ENCODER_SETUP 0x0f
  1067. #define EXTERNAL_ENCODER_ACTION_V3_ENCODER_BLANKING_OFF 0x10
  1068. #define EXTERNAL_ENCODER_ACTION_V3_ENCODER_BLANKING 0x11
  1069. #define EXTERNAL_ENCODER_ACTION_V3_DACLOAD_DETECTION 0x12
  1070. #define EXTERNAL_ENCODER_ACTION_V3_DDC_SETUP 0x14
  1071. // ucConfig
  1072. #define EXTERNAL_ENCODER_CONFIG_V3_DPLINKRATE_MASK 0x03
  1073. #define EXTERNAL_ENCODER_CONFIG_V3_DPLINKRATE_1_62GHZ 0x00
  1074. #define EXTERNAL_ENCODER_CONFIG_V3_DPLINKRATE_2_70GHZ 0x01
  1075. #define EXTERNAL_ENCODER_CONFIG_V3_DPLINKRATE_5_40GHZ 0x02
  1076. #define EXTERNAL_ENCODER_CONFIG_V3_ENCODER_SEL_MASK 0x70
  1077. #define EXTERNAL_ENCODER_CONFIG_V3_ENCODER1 0x00
  1078. #define EXTERNAL_ENCODER_CONFIG_V3_ENCODER2 0x10
  1079. #define EXTERNAL_ENCODER_CONFIG_V3_ENCODER3 0x20
  1080. typedef struct _EXTERNAL_ENCODER_CONTROL_PS_ALLOCATION_V3
  1081. {
  1082. EXTERNAL_ENCODER_CONTROL_PARAMETERS_V3 sExtEncoder;
  1083. ULONG ulReserved[2];
  1084. }EXTERNAL_ENCODER_CONTROL_PS_ALLOCATION_V3;
  1085. /****************************************************************************/
  1086. // Structures used by DAC1OuputControlTable
  1087. // DAC2OuputControlTable
  1088. // LVTMAOutputControlTable (Before DEC30)
  1089. // TMDSAOutputControlTable (Before DEC30)
  1090. /****************************************************************************/
  1091. typedef struct _DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
  1092. {
  1093. UCHAR ucAction; // Possible input:ATOM_ENABLE||ATOMDISABLE
  1094. // When the display is LCD, in addition to above:
  1095. // ATOM_LCD_BLOFF|| ATOM_LCD_BLON ||ATOM_LCD_BL_BRIGHTNESS_CONTROL||ATOM_LCD_SELFTEST_START||
  1096. // ATOM_LCD_SELFTEST_STOP
  1097. UCHAR aucPadding[3]; // padding to DWORD aligned
  1098. }DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS;
  1099. #define DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
  1100. #define CRT1_OUTPUT_CONTROL_PARAMETERS DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
  1101. #define CRT1_OUTPUT_CONTROL_PS_ALLOCATION DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION
  1102. #define CRT2_OUTPUT_CONTROL_PARAMETERS DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
  1103. #define CRT2_OUTPUT_CONTROL_PS_ALLOCATION DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION
  1104. #define CV1_OUTPUT_CONTROL_PARAMETERS DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
  1105. #define CV1_OUTPUT_CONTROL_PS_ALLOCATION DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION
  1106. #define TV1_OUTPUT_CONTROL_PARAMETERS DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
  1107. #define TV1_OUTPUT_CONTROL_PS_ALLOCATION DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION
  1108. #define DFP1_OUTPUT_CONTROL_PARAMETERS DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
  1109. #define DFP1_OUTPUT_CONTROL_PS_ALLOCATION DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION
  1110. #define DFP2_OUTPUT_CONTROL_PARAMETERS DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
  1111. #define DFP2_OUTPUT_CONTROL_PS_ALLOCATION DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION
  1112. #define LCD1_OUTPUT_CONTROL_PARAMETERS DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
  1113. #define LCD1_OUTPUT_CONTROL_PS_ALLOCATION DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION
  1114. #define DVO_OUTPUT_CONTROL_PARAMETERS DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
  1115. #define DVO_OUTPUT_CONTROL_PS_ALLOCATION DIG_TRANSMITTER_CONTROL_PS_ALLOCATION
  1116. #define DVO_OUTPUT_CONTROL_PARAMETERS_V3 DIG_TRANSMITTER_CONTROL_PARAMETERS
  1117. /****************************************************************************/
  1118. // Structures used by BlankCRTCTable
  1119. /****************************************************************************/
  1120. typedef struct _BLANK_CRTC_PARAMETERS
  1121. {
  1122. UCHAR ucCRTC; // ATOM_CRTC1 or ATOM_CRTC2
  1123. UCHAR ucBlanking; // ATOM_BLANKING or ATOM_BLANKINGOFF
  1124. USHORT usBlackColorRCr;
  1125. USHORT usBlackColorGY;
  1126. USHORT usBlackColorBCb;
  1127. }BLANK_CRTC_PARAMETERS;
  1128. #define BLANK_CRTC_PS_ALLOCATION BLANK_CRTC_PARAMETERS
  1129. /****************************************************************************/
  1130. // Structures used by EnableCRTCTable
  1131. // EnableCRTCMemReqTable
  1132. // UpdateCRTC_DoubleBufferRegistersTable
  1133. /****************************************************************************/
  1134. typedef struct _ENABLE_CRTC_PARAMETERS
  1135. {
  1136. UCHAR ucCRTC; // ATOM_CRTC1 or ATOM_CRTC2
  1137. UCHAR ucEnable; // ATOM_ENABLE or ATOM_DISABLE
  1138. UCHAR ucPadding[2];
  1139. }ENABLE_CRTC_PARAMETERS;
  1140. #define ENABLE_CRTC_PS_ALLOCATION ENABLE_CRTC_PARAMETERS
  1141. /****************************************************************************/
  1142. // Structures used by SetCRTC_OverScanTable
  1143. /****************************************************************************/
  1144. typedef struct _SET_CRTC_OVERSCAN_PARAMETERS
  1145. {
  1146. USHORT usOverscanRight; // right
  1147. USHORT usOverscanLeft; // left
  1148. USHORT usOverscanBottom; // bottom
  1149. USHORT usOverscanTop; // top
  1150. UCHAR ucCRTC; // ATOM_CRTC1 or ATOM_CRTC2
  1151. UCHAR ucPadding[3];
  1152. }SET_CRTC_OVERSCAN_PARAMETERS;
  1153. #define SET_CRTC_OVERSCAN_PS_ALLOCATION SET_CRTC_OVERSCAN_PARAMETERS
  1154. /****************************************************************************/
  1155. // Structures used by SetCRTC_ReplicationTable
  1156. /****************************************************************************/
  1157. typedef struct _SET_CRTC_REPLICATION_PARAMETERS
  1158. {
  1159. UCHAR ucH_Replication; // horizontal replication
  1160. UCHAR ucV_Replication; // vertical replication
  1161. UCHAR usCRTC; // ATOM_CRTC1 or ATOM_CRTC2
  1162. UCHAR ucPadding;
  1163. }SET_CRTC_REPLICATION_PARAMETERS;
  1164. #define SET_CRTC_REPLICATION_PS_ALLOCATION SET_CRTC_REPLICATION_PARAMETERS
  1165. /****************************************************************************/
  1166. // Structures used by SelectCRTC_SourceTable
  1167. /****************************************************************************/
  1168. typedef struct _SELECT_CRTC_SOURCE_PARAMETERS
  1169. {
  1170. UCHAR ucCRTC; // ATOM_CRTC1 or ATOM_CRTC2
  1171. UCHAR ucDevice; // ATOM_DEVICE_CRT1|ATOM_DEVICE_CRT2|....
  1172. UCHAR ucPadding[2];
  1173. }SELECT_CRTC_SOURCE_PARAMETERS;
  1174. #define SELECT_CRTC_SOURCE_PS_ALLOCATION SELECT_CRTC_SOURCE_PARAMETERS
  1175. typedef struct _SELECT_CRTC_SOURCE_PARAMETERS_V2
  1176. {
  1177. UCHAR ucCRTC; // ATOM_CRTC1 or ATOM_CRTC2
  1178. UCHAR ucEncoderID; // DAC1/DAC2/TVOUT/DIG1/DIG2/DVO
  1179. UCHAR ucEncodeMode; // Encoding mode, only valid when using DIG1/DIG2/DVO
  1180. UCHAR ucPadding;
  1181. }SELECT_CRTC_SOURCE_PARAMETERS_V2;
  1182. //ucEncoderID
  1183. //#define ASIC_INT_DAC1_ENCODER_ID 0x00
  1184. //#define ASIC_INT_TV_ENCODER_ID 0x02
  1185. //#define ASIC_INT_DIG1_ENCODER_ID 0x03
  1186. //#define ASIC_INT_DAC2_ENCODER_ID 0x04
  1187. //#define ASIC_EXT_TV_ENCODER_ID 0x06
  1188. //#define ASIC_INT_DVO_ENCODER_ID 0x07
  1189. //#define ASIC_INT_DIG2_ENCODER_ID 0x09
  1190. //#define ASIC_EXT_DIG_ENCODER_ID 0x05
  1191. //ucEncodeMode
  1192. //#define ATOM_ENCODER_MODE_DP 0
  1193. //#define ATOM_ENCODER_MODE_LVDS 1
  1194. //#define ATOM_ENCODER_MODE_DVI 2
  1195. //#define ATOM_ENCODER_MODE_HDMI 3
  1196. //#define ATOM_ENCODER_MODE_SDVO 4
  1197. //#define ATOM_ENCODER_MODE_TV 13
  1198. //#define ATOM_ENCODER_MODE_CV 14
  1199. //#define ATOM_ENCODER_MODE_CRT 15
  1200. /****************************************************************************/
  1201. // Structures used by SetPixelClockTable
  1202. // GetPixelClockTable
  1203. /****************************************************************************/
  1204. //Major revision=1., Minor revision=1
  1205. typedef struct _PIXEL_CLOCK_PARAMETERS
  1206. {
  1207. USHORT usPixelClock; // in 10kHz unit; for bios convenient = (RefClk*FB_Div)/(Ref_Div*Post_Div)
  1208. // 0 means disable PPLL
  1209. USHORT usRefDiv; // Reference divider
  1210. USHORT usFbDiv; // feedback divider
  1211. UCHAR ucPostDiv; // post divider
  1212. UCHAR ucFracFbDiv; // fractional feedback divider
  1213. UCHAR ucPpll; // ATOM_PPLL1 or ATOM_PPL2
  1214. UCHAR ucRefDivSrc; // ATOM_PJITTER or ATO_NONPJITTER
  1215. UCHAR ucCRTC; // Which CRTC uses this Ppll
  1216. UCHAR ucPadding;
  1217. }PIXEL_CLOCK_PARAMETERS;
  1218. //Major revision=1., Minor revision=2, add ucMiscIfno
  1219. //ucMiscInfo:
  1220. #define MISC_FORCE_REPROG_PIXEL_CLOCK 0x1
  1221. #define MISC_DEVICE_INDEX_MASK 0xF0
  1222. #define MISC_DEVICE_INDEX_SHIFT 4
  1223. typedef struct _PIXEL_CLOCK_PARAMETERS_V2
  1224. {
  1225. USHORT usPixelClock; // in 10kHz unit; for bios convenient = (RefClk*FB_Div)/(Ref_Div*Post_Div)
  1226. // 0 means disable PPLL
  1227. USHORT usRefDiv; // Reference divider
  1228. USHORT usFbDiv; // feedback divider
  1229. UCHAR ucPostDiv; // post divider
  1230. UCHAR ucFracFbDiv; // fractional feedback divider
  1231. UCHAR ucPpll; // ATOM_PPLL1 or ATOM_PPL2
  1232. UCHAR ucRefDivSrc; // ATOM_PJITTER or ATO_NONPJITTER
  1233. UCHAR ucCRTC; // Which CRTC uses this Ppll
  1234. UCHAR ucMiscInfo; // Different bits for different purpose, bit [7:4] as device index, bit[0]=Force prog
  1235. }PIXEL_CLOCK_PARAMETERS_V2;
  1236. //Major revision=1., Minor revision=3, structure/definition change
  1237. //ucEncoderMode:
  1238. //ATOM_ENCODER_MODE_DP
  1239. //ATOM_ENOCDER_MODE_LVDS
  1240. //ATOM_ENOCDER_MODE_DVI
  1241. //ATOM_ENOCDER_MODE_HDMI
  1242. //ATOM_ENOCDER_MODE_SDVO
  1243. //ATOM_ENCODER_MODE_TV 13
  1244. //ATOM_ENCODER_MODE_CV 14
  1245. //ATOM_ENCODER_MODE_CRT 15
  1246. //ucDVOConfig
  1247. //#define DVO_ENCODER_CONFIG_RATE_SEL 0x01
  1248. //#define DVO_ENCODER_CONFIG_DDR_SPEED 0x00
  1249. //#define DVO_ENCODER_CONFIG_SDR_SPEED 0x01
  1250. //#define DVO_ENCODER_CONFIG_OUTPUT_SEL 0x0c
  1251. //#define DVO_ENCODER_CONFIG_LOW12BIT 0x00
  1252. //#define DVO_ENCODER_CONFIG_UPPER12BIT 0x04
  1253. //#define DVO_ENCODER_CONFIG_24BIT 0x08
  1254. //ucMiscInfo: also changed, see below
  1255. #define PIXEL_CLOCK_MISC_FORCE_PROG_PPLL 0x01
  1256. #define PIXEL_CLOCK_MISC_VGA_MODE 0x02
  1257. #define PIXEL_CLOCK_MISC_CRTC_SEL_MASK 0x04
  1258. #define PIXEL_CLOCK_MISC_CRTC_SEL_CRTC1 0x00
  1259. #define PIXEL_CLOCK_MISC_CRTC_SEL_CRTC2 0x04
  1260. #define PIXEL_CLOCK_MISC_USE_ENGINE_FOR_DISPCLK 0x08
  1261. #define PIXEL_CLOCK_MISC_REF_DIV_SRC 0x10
  1262. // V1.4 for RoadRunner
  1263. #define PIXEL_CLOCK_V4_MISC_SS_ENABLE 0x10
  1264. #define PIXEL_CLOCK_V4_MISC_COHERENT_MODE 0x20
  1265. typedef struct _PIXEL_CLOCK_PARAMETERS_V3
  1266. {
  1267. USHORT usPixelClock; // in 10kHz unit; for bios convenient = (RefClk*FB_Div)/(Ref_Div*Post_Div)
  1268. // 0 means disable PPLL. For VGA PPLL,make sure this value is not 0.
  1269. USHORT usRefDiv; // Reference divider
  1270. USHORT usFbDiv; // feedback divider
  1271. UCHAR ucPostDiv; // post divider
  1272. UCHAR ucFracFbDiv; // fractional feedback divider
  1273. UCHAR ucPpll; // ATOM_PPLL1 or ATOM_PPL2
  1274. UCHAR ucTransmitterId; // graphic encoder id defined in objectId.h
  1275. union
  1276. {
  1277. UCHAR ucEncoderMode; // encoder type defined as ATOM_ENCODER_MODE_DP/DVI/HDMI/
  1278. UCHAR ucDVOConfig; // when use DVO, need to know SDR/DDR, 12bit or 24bit
  1279. };
  1280. UCHAR ucMiscInfo; // bit[0]=Force program, bit[1]= set pclk for VGA, b[2]= CRTC sel
  1281. // bit[3]=0:use PPLL for dispclk source, =1: use engine clock for dispclock source
  1282. // bit[4]=0:use XTALIN as the source of reference divider,=1 use the pre-defined clock as the source of reference divider
  1283. }PIXEL_CLOCK_PARAMETERS_V3;
  1284. #define PIXEL_CLOCK_PARAMETERS_LAST PIXEL_CLOCK_PARAMETERS_V2
  1285. #define GET_PIXEL_CLOCK_PS_ALLOCATION PIXEL_CLOCK_PARAMETERS_LAST
  1286. typedef struct _PIXEL_CLOCK_PARAMETERS_V5
  1287. {
  1288. UCHAR ucCRTC; // ATOM_CRTC1~6, indicate the CRTC controller to
  1289. // drive the pixel clock. not used for DCPLL case.
  1290. union{
  1291. UCHAR ucReserved;
  1292. UCHAR ucFracFbDiv; // [gphan] temporary to prevent build problem. remove it after driver code is changed.
  1293. };
  1294. USHORT usPixelClock; // target the pixel clock to drive the CRTC timing
  1295. // 0 means disable PPLL/DCPLL.
  1296. USHORT usFbDiv; // feedback divider integer part.
  1297. UCHAR ucPostDiv; // post divider.
  1298. UCHAR ucRefDiv; // Reference divider
  1299. UCHAR ucPpll; // ATOM_PPLL1/ATOM_PPLL2/ATOM_DCPLL
  1300. UCHAR ucTransmitterID; // ASIC encoder id defined in objectId.h,
  1301. // indicate which graphic encoder will be used.
  1302. UCHAR ucEncoderMode; // Encoder mode:
  1303. UCHAR ucMiscInfo; // bit[0]= Force program PPLL
  1304. // bit[1]= when VGA timing is used.
  1305. // bit[3:2]= HDMI panel bit depth: =0: 24bpp =1:30bpp, =2:32bpp
  1306. // bit[4]= RefClock source for PPLL.
  1307. // =0: XTLAIN( default mode )
  1308. // =1: other external clock source, which is pre-defined
  1309. // by VBIOS depend on the feature required.
  1310. // bit[7:5]: reserved.
  1311. ULONG ulFbDivDecFrac; // 20 bit feedback divider decimal fraction part, range from 1~999999 ( 0.000001 to 0.999999 )
  1312. }PIXEL_CLOCK_PARAMETERS_V5;
  1313. #define PIXEL_CLOCK_V5_MISC_FORCE_PROG_PPLL 0x01
  1314. #define PIXEL_CLOCK_V5_MISC_VGA_MODE 0x02
  1315. #define PIXEL_CLOCK_V5_MISC_HDMI_BPP_MASK 0x0c
  1316. #define PIXEL_CLOCK_V5_MISC_HDMI_24BPP 0x00
  1317. #define PIXEL_CLOCK_V5_MISC_HDMI_30BPP 0x04
  1318. #define PIXEL_CLOCK_V5_MISC_HDMI_32BPP 0x08
  1319. #define PIXEL_CLOCK_V5_MISC_REF_DIV_SRC 0x10
  1320. typedef struct _CRTC_PIXEL_CLOCK_FREQ
  1321. {
  1322. #if ATOM_BIG_ENDIAN
  1323. ULONG ucCRTC:8; // ATOM_CRTC1~6, indicate the CRTC controller to
  1324. // drive the pixel clock. not used for DCPLL case.
  1325. ULONG ulPixelClock:24; // target the pixel clock to drive the CRTC timing.
  1326. // 0 means disable PPLL/DCPLL. Expanded to 24 bits comparing to previous version.
  1327. #else
  1328. ULONG ulPixelClock:24; // target the pixel clock to drive the CRTC timing.
  1329. // 0 means disable PPLL/DCPLL. Expanded to 24 bits comparing to previous version.
  1330. ULONG ucCRTC:8; // ATOM_CRTC1~6, indicate the CRTC controller to
  1331. // drive the pixel clock. not used for DCPLL case.
  1332. #endif
  1333. }CRTC_PIXEL_CLOCK_FREQ;
  1334. typedef struct _PIXEL_CLOCK_PARAMETERS_V6
  1335. {
  1336. union{
  1337. CRTC_PIXEL_CLOCK_FREQ ulCrtcPclkFreq; // pixel clock and CRTC id frequency
  1338. ULONG ulDispEngClkFreq; // dispclk frequency
  1339. };
  1340. USHORT usFbDiv; // feedback divider integer part.
  1341. UCHAR ucPostDiv; // post divider.
  1342. UCHAR ucRefDiv; // Reference divider
  1343. UCHAR ucPpll; // ATOM_PPLL1/ATOM_PPLL2/ATOM_DCPLL
  1344. UCHAR ucTransmitterID; // ASIC encoder id defined in objectId.h,
  1345. // indicate which graphic encoder will be used.
  1346. UCHAR ucEncoderMode; // Encoder mode:
  1347. UCHAR ucMiscInfo; // bit[0]= Force program PPLL
  1348. // bit[1]= when VGA timing is used.
  1349. // bit[3:2]= HDMI panel bit depth: =0: 24bpp =1:30bpp, =2:32bpp
  1350. // bit[4]= RefClock source for PPLL.
  1351. // =0: XTLAIN( default mode )
  1352. // =1: other external clock source, which is pre-defined
  1353. // by VBIOS depend on the feature required.
  1354. // bit[7:5]: reserved.
  1355. ULONG ulFbDivDecFrac; // 20 bit feedback divider decimal fraction part, range from 1~999999 ( 0.000001 to 0.999999 )
  1356. }PIXEL_CLOCK_PARAMETERS_V6;
  1357. #define PIXEL_CLOCK_V6_MISC_FORCE_PROG_PPLL 0x01
  1358. #define PIXEL_CLOCK_V6_MISC_VGA_MODE 0x02
  1359. #define PIXEL_CLOCK_V6_MISC_HDMI_BPP_MASK 0x0c
  1360. #define PIXEL_CLOCK_V6_MISC_HDMI_24BPP 0x00
  1361. #define PIXEL_CLOCK_V6_MISC_HDMI_36BPP 0x04
  1362. #define PIXEL_CLOCK_V6_MISC_HDMI_30BPP 0x08
  1363. #define PIXEL_CLOCK_V6_MISC_HDMI_48BPP 0x0c
  1364. #define PIXEL_CLOCK_V6_MISC_REF_DIV_SRC 0x10
  1365. typedef struct _GET_DISP_PLL_STATUS_INPUT_PARAMETERS_V2
  1366. {
  1367. PIXEL_CLOCK_PARAMETERS_V3 sDispClkInput;
  1368. }GET_DISP_PLL_STATUS_INPUT_PARAMETERS_V2;
  1369. typedef struct _GET_DISP_PLL_STATUS_OUTPUT_PARAMETERS_V2
  1370. {
  1371. UCHAR ucStatus;
  1372. UCHAR ucRefDivSrc; // =1: reference clock source from XTALIN, =0: source from PCIE ref clock
  1373. UCHAR ucReserved[2];
  1374. }GET_DISP_PLL_STATUS_OUTPUT_PARAMETERS_V2;
  1375. typedef struct _GET_DISP_PLL_STATUS_INPUT_PARAMETERS_V3
  1376. {
  1377. PIXEL_CLOCK_PARAMETERS_V5 sDispClkInput;
  1378. }GET_DISP_PLL_STATUS_INPUT_PARAMETERS_V3;
  1379. /****************************************************************************/
  1380. // Structures used by AdjustDisplayPllTable
  1381. /****************************************************************************/
  1382. typedef struct _ADJUST_DISPLAY_PLL_PARAMETERS
  1383. {
  1384. USHORT usPixelClock;
  1385. UCHAR ucTransmitterID;
  1386. UCHAR ucEncodeMode;
  1387. union
  1388. {
  1389. UCHAR ucDVOConfig; //if DVO, need passing link rate and output 12bitlow or 24bit
  1390. UCHAR ucConfig; //if none DVO, not defined yet
  1391. };
  1392. UCHAR ucReserved[3];
  1393. }ADJUST_DISPLAY_PLL_PARAMETERS;
  1394. #define ADJUST_DISPLAY_CONFIG_SS_ENABLE 0x10
  1395. #define ADJUST_DISPLAY_PLL_PS_ALLOCATION ADJUST_DISPLAY_PLL_PARAMETERS
  1396. typedef struct _ADJUST_DISPLAY_PLL_INPUT_PARAMETERS_V3
  1397. {
  1398. USHORT usPixelClock; // target pixel clock
  1399. UCHAR ucTransmitterID; // GPU transmitter id defined in objectid.h
  1400. UCHAR ucEncodeMode; // encoder mode: CRT, LVDS, DP, TMDS or HDMI
  1401. UCHAR ucDispPllConfig; // display pll configure parameter defined as following DISPPLL_CONFIG_XXXX
  1402. UCHAR ucExtTransmitterID; // external encoder id.
  1403. UCHAR ucReserved[2];
  1404. }ADJUST_DISPLAY_PLL_INPUT_PARAMETERS_V3;
  1405. // usDispPllConfig v1.2 for RoadRunner
  1406. #define DISPPLL_CONFIG_DVO_RATE_SEL 0x0001 // need only when ucTransmitterID = DVO
  1407. #define DISPPLL_CONFIG_DVO_DDR_SPEED 0x0000 // need only when ucTransmitterID = DVO
  1408. #define DISPPLL_CONFIG_DVO_SDR_SPEED 0x0001 // need only when ucTransmitterID = DVO
  1409. #define DISPPLL_CONFIG_DVO_OUTPUT_SEL 0x000c // need only when ucTransmitterID = DVO
  1410. #define DISPPLL_CONFIG_DVO_LOW12BIT 0x0000 // need only when ucTransmitterID = DVO
  1411. #define DISPPLL_CONFIG_DVO_UPPER12BIT 0x0004 // need only when ucTransmitterID = DVO
  1412. #define DISPPLL_CONFIG_DVO_24BIT 0x0008 // need only when ucTransmitterID = DVO
  1413. #define DISPPLL_CONFIG_SS_ENABLE 0x0010 // Only used when ucEncoderMode = DP or LVDS
  1414. #define DISPPLL_CONFIG_COHERENT_MODE 0x0020 // Only used when ucEncoderMode = TMDS or HDMI
  1415. #define DISPPLL_CONFIG_DUAL_LINK 0x0040 // Only used when ucEncoderMode = TMDS or LVDS
  1416. typedef struct _ADJUST_DISPLAY_PLL_OUTPUT_PARAMETERS_V3
  1417. {
  1418. ULONG ulDispPllFreq; // return display PPLL freq which is used to generate the pixclock, and related idclk, symclk etc
  1419. UCHAR ucRefDiv; // if it is none-zero, it is used to be calculated the other ppll parameter fb_divider and post_div ( if it is not given )
  1420. UCHAR ucPostDiv; // if it is none-zero, it is used to be calculated the other ppll parameter fb_divider
  1421. UCHAR ucReserved[2];
  1422. }ADJUST_DISPLAY_PLL_OUTPUT_PARAMETERS_V3;
  1423. typedef struct _ADJUST_DISPLAY_PLL_PS_ALLOCATION_V3
  1424. {
  1425. union
  1426. {
  1427. ADJUST_DISPLAY_PLL_INPUT_PARAMETERS_V3 sInput;
  1428. ADJUST_DISPLAY_PLL_OUTPUT_PARAMETERS_V3 sOutput;
  1429. };
  1430. } ADJUST_DISPLAY_PLL_PS_ALLOCATION_V3;
  1431. /****************************************************************************/
  1432. // Structures used by EnableYUVTable
  1433. /****************************************************************************/
  1434. typedef struct _ENABLE_YUV_PARAMETERS
  1435. {
  1436. UCHAR ucEnable; // ATOM_ENABLE:Enable YUV or ATOM_DISABLE:Disable YUV (RGB)
  1437. UCHAR ucCRTC; // Which CRTC needs this YUV or RGB format
  1438. UCHAR ucPadding[2];
  1439. }ENABLE_YUV_PARAMETERS;
  1440. #define ENABLE_YUV_PS_ALLOCATION ENABLE_YUV_PARAMETERS
  1441. /****************************************************************************/
  1442. // Structures used by GetMemoryClockTable
  1443. /****************************************************************************/
  1444. typedef struct _GET_MEMORY_CLOCK_PARAMETERS
  1445. {
  1446. ULONG ulReturnMemoryClock; // current memory speed in 10KHz unit
  1447. } GET_MEMORY_CLOCK_PARAMETERS;
  1448. #define GET_MEMORY_CLOCK_PS_ALLOCATION GET_MEMORY_CLOCK_PARAMETERS
  1449. /****************************************************************************/
  1450. // Structures used by GetEngineClockTable
  1451. /****************************************************************************/
  1452. typedef struct _GET_ENGINE_CLOCK_PARAMETERS
  1453. {
  1454. ULONG ulReturnEngineClock; // current engine speed in 10KHz unit
  1455. } GET_ENGINE_CLOCK_PARAMETERS;
  1456. #define GET_ENGINE_CLOCK_PS_ALLOCATION GET_ENGINE_CLOCK_PARAMETERS
  1457. /****************************************************************************/
  1458. // Following Structures and constant may be obsolete
  1459. /****************************************************************************/
  1460. //Maxium 8 bytes,the data read in will be placed in the parameter space.
  1461. //Read operaion successeful when the paramter space is non-zero, otherwise read operation failed
  1462. typedef struct _READ_EDID_FROM_HW_I2C_DATA_PARAMETERS
  1463. {
  1464. USHORT usPrescale; //Ratio between Engine clock and I2C clock
  1465. USHORT usVRAMAddress; //Address in Frame Buffer where to pace raw EDID
  1466. USHORT usStatus; //When use output: lower byte EDID checksum, high byte hardware status
  1467. //WHen use input: lower byte as 'byte to read':currently limited to 128byte or 1byte
  1468. UCHAR ucSlaveAddr; //Read from which slave
  1469. UCHAR ucLineNumber; //Read from which HW assisted line
  1470. }READ_EDID_FROM_HW_I2C_DATA_PARAMETERS;
  1471. #define READ_EDID_FROM_HW_I2C_DATA_PS_ALLOCATION READ_EDID_FROM_HW_I2C_DATA_PARAMETERS
  1472. #define ATOM_WRITE_I2C_FORMAT_PSOFFSET_PSDATABYTE 0
  1473. #define ATOM_WRITE_I2C_FORMAT_PSOFFSET_PSTWODATABYTES 1
  1474. #define ATOM_WRITE_I2C_FORMAT_PSCOUNTER_PSOFFSET_IDDATABLOCK 2
  1475. #define ATOM_WRITE_I2C_FORMAT_PSCOUNTER_IDOFFSET_PLUS_IDDATABLOCK 3
  1476. #define ATOM_WRITE_I2C_FORMAT_IDCOUNTER_IDOFFSET_IDDATABLOCK 4
  1477. typedef struct _WRITE_ONE_BYTE_HW_I2C_DATA_PARAMETERS
  1478. {
  1479. USHORT usPrescale; //Ratio between Engine clock and I2C clock
  1480. USHORT usByteOffset; //Write to which byte
  1481. //Upper portion of usByteOffset is Format of data
  1482. //1bytePS+offsetPS
  1483. //2bytesPS+offsetPS
  1484. //blockID+offsetPS
  1485. //blockID+offsetID
  1486. //blockID+counterID+offsetID
  1487. UCHAR ucData; //PS data1
  1488. UCHAR ucStatus; //Status byte 1=success, 2=failure, Also is used as PS data2
  1489. UCHAR ucSlaveAddr; //Write to which slave
  1490. UCHAR ucLineNumber; //Write from which HW assisted line
  1491. }WRITE_ONE_BYTE_HW_I2C_DATA_PARAMETERS;
  1492. #define WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION WRITE_ONE_BYTE_HW_I2C_DATA_PARAMETERS
  1493. typedef struct _SET_UP_HW_I2C_DATA_PARAMETERS
  1494. {
  1495. USHORT usPrescale; //Ratio between Engine clock and I2C clock
  1496. UCHAR ucSlaveAddr; //Write to which slave
  1497. UCHAR ucLineNumber; //Write from which HW assisted line
  1498. }SET_UP_HW_I2C_DATA_PARAMETERS;
  1499. /**************************************************************************/
  1500. #define SPEED_FAN_CONTROL_PS_ALLOCATION WRITE_ONE_BYTE_HW_I2C_DATA_PARAMETERS
  1501. /****************************************************************************/
  1502. // Structures used by PowerConnectorDetectionTable
  1503. /****************************************************************************/
  1504. typedef struct _POWER_CONNECTOR_DETECTION_PARAMETERS
  1505. {
  1506. UCHAR ucPowerConnectorStatus; //Used for return value 0: detected, 1:not detected
  1507. UCHAR ucPwrBehaviorId;
  1508. USHORT usPwrBudget; //how much power currently boot to in unit of watt
  1509. }POWER_CONNECTOR_DETECTION_PARAMETERS;
  1510. typedef struct POWER_CONNECTOR_DETECTION_PS_ALLOCATION
  1511. {
  1512. UCHAR ucPowerConnectorStatus; //Used for return value 0: detected, 1:not detected
  1513. UCHAR ucReserved;
  1514. USHORT usPwrBudget; //how much power currently boot to in unit of watt
  1515. WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION sReserved;
  1516. }POWER_CONNECTOR_DETECTION_PS_ALLOCATION;
  1517. /****************************LVDS SS Command Table Definitions**********************/
  1518. /****************************************************************************/
  1519. // Structures used by EnableSpreadSpectrumOnPPLLTable
  1520. /****************************************************************************/
  1521. typedef struct _ENABLE_LVDS_SS_PARAMETERS
  1522. {
  1523. USHORT usSpreadSpectrumPercentage;
  1524. UCHAR ucSpreadSpectrumType; //Bit1=0 Down Spread,=1 Center Spread. Bit1=1 Ext. =0 Int. Others:TBD
  1525. UCHAR ucSpreadSpectrumStepSize_Delay; //bits3:2 SS_STEP_SIZE; bit 6:4 SS_DELAY
  1526. UCHAR ucEnable; //ATOM_ENABLE or ATOM_DISABLE
  1527. UCHAR ucPadding[3];
  1528. }ENABLE_LVDS_SS_PARAMETERS;
  1529. //ucTableFormatRevision=1,ucTableContentRevision=2
  1530. typedef struct _ENABLE_LVDS_SS_PARAMETERS_V2
  1531. {
  1532. USHORT usSpreadSpectrumPercentage;
  1533. UCHAR ucSpreadSpectrumType; //Bit1=0 Down Spread,=1 Center Spread. Bit1=1 Ext. =0 Int. Others:TBD
  1534. UCHAR ucSpreadSpectrumStep; //
  1535. UCHAR ucEnable; //ATOM_ENABLE or ATOM_DISABLE
  1536. UCHAR ucSpreadSpectrumDelay;
  1537. UCHAR ucSpreadSpectrumRange;
  1538. UCHAR ucPadding;
  1539. }ENABLE_LVDS_SS_PARAMETERS_V2;
  1540. //This new structure is based on ENABLE_LVDS_SS_PARAMETERS but expands to SS on PPLL, so other devices can use SS.
  1541. typedef struct _ENABLE_SPREAD_SPECTRUM_ON_PPLL
  1542. {
  1543. USHORT usSpreadSpectrumPercentage;
  1544. UCHAR ucSpreadSpectrumType; // Bit1=0 Down Spread,=1 Center Spread. Bit1=1 Ext. =0 Int. Others:TBD
  1545. UCHAR ucSpreadSpectrumStep; //
  1546. UCHAR ucEnable; // ATOM_ENABLE or ATOM_DISABLE
  1547. UCHAR ucSpreadSpectrumDelay;
  1548. UCHAR ucSpreadSpectrumRange;
  1549. UCHAR ucPpll; // ATOM_PPLL1/ATOM_PPLL2
  1550. }ENABLE_SPREAD_SPECTRUM_ON_PPLL;
  1551. typedef struct _ENABLE_SPREAD_SPECTRUM_ON_PPLL_V2
  1552. {
  1553. USHORT usSpreadSpectrumPercentage;
  1554. UCHAR ucSpreadSpectrumType; // Bit[0]: 0-Down Spread,1-Center Spread.
  1555. // Bit[1]: 1-Ext. 0-Int.
  1556. // Bit[3:2]: =0 P1PLL =1 P2PLL =2 DCPLL
  1557. // Bits[7:4] reserved
  1558. UCHAR ucEnable; // ATOM_ENABLE or ATOM_DISABLE
  1559. USHORT usSpreadSpectrumAmount; // Includes SS_AMOUNT_FBDIV[7:0] and SS_AMOUNT_NFRAC_SLIP[11:8]
  1560. USHORT usSpreadSpectrumStep; // SS_STEP_SIZE_DSFRAC
  1561. }ENABLE_SPREAD_SPECTRUM_ON_PPLL_V2;
  1562. #define ATOM_PPLL_SS_TYPE_V2_DOWN_SPREAD 0x00
  1563. #define ATOM_PPLL_SS_TYPE_V2_CENTRE_SPREAD 0x01
  1564. #define ATOM_PPLL_SS_TYPE_V2_EXT_SPREAD 0x02
  1565. #define ATOM_PPLL_SS_TYPE_V2_PPLL_SEL_MASK 0x0c
  1566. #define ATOM_PPLL_SS_TYPE_V2_P1PLL 0x00
  1567. #define ATOM_PPLL_SS_TYPE_V2_P2PLL 0x04
  1568. #define ATOM_PPLL_SS_TYPE_V2_DCPLL 0x08
  1569. #define ATOM_PPLL_SS_AMOUNT_V2_FBDIV_MASK 0x00FF
  1570. #define ATOM_PPLL_SS_AMOUNT_V2_FBDIV_SHIFT 0
  1571. #define ATOM_PPLL_SS_AMOUNT_V2_NFRAC_MASK 0x0F00
  1572. #define ATOM_PPLL_SS_AMOUNT_V2_NFRAC_SHIFT 8
  1573. // Used by DCE5.0
  1574. typedef struct _ENABLE_SPREAD_SPECTRUM_ON_PPLL_V3
  1575. {
  1576. USHORT usSpreadSpectrumAmountFrac; // SS_AMOUNT_DSFRAC New in DCE5.0
  1577. UCHAR ucSpreadSpectrumType; // Bit[0]: 0-Down Spread,1-Center Spread.
  1578. // Bit[1]: 1-Ext. 0-Int.
  1579. // Bit[3:2]: =0 P1PLL =1 P2PLL =2 DCPLL
  1580. // Bits[7:4] reserved
  1581. UCHAR ucEnable; // ATOM_ENABLE or ATOM_DISABLE
  1582. USHORT usSpreadSpectrumAmount; // Includes SS_AMOUNT_FBDIV[7:0] and SS_AMOUNT_NFRAC_SLIP[11:8]
  1583. USHORT usSpreadSpectrumStep; // SS_STEP_SIZE_DSFRAC
  1584. }ENABLE_SPREAD_SPECTRUM_ON_PPLL_V3;
  1585. #define ATOM_PPLL_SS_TYPE_V3_DOWN_SPREAD 0x00
  1586. #define ATOM_PPLL_SS_TYPE_V3_CENTRE_SPREAD 0x01
  1587. #define ATOM_PPLL_SS_TYPE_V3_EXT_SPREAD 0x02
  1588. #define ATOM_PPLL_SS_TYPE_V3_PPLL_SEL_MASK 0x0c
  1589. #define ATOM_PPLL_SS_TYPE_V3_P1PLL 0x00
  1590. #define ATOM_PPLL_SS_TYPE_V3_P2PLL 0x04
  1591. #define ATOM_PPLL_SS_TYPE_V3_DCPLL 0x08
  1592. #define ATOM_PPLL_SS_AMOUNT_V3_FBDIV_MASK 0x00FF
  1593. #define ATOM_PPLL_SS_AMOUNT_V3_FBDIV_SHIFT 0
  1594. #define ATOM_PPLL_SS_AMOUNT_V3_NFRAC_MASK 0x0F00
  1595. #define ATOM_PPLL_SS_AMOUNT_V3_NFRAC_SHIFT 8
  1596. #define ENABLE_SPREAD_SPECTRUM_ON_PPLL_PS_ALLOCATION ENABLE_SPREAD_SPECTRUM_ON_PPLL
  1597. /**************************************************************************/
  1598. typedef struct _SET_PIXEL_CLOCK_PS_ALLOCATION
  1599. {
  1600. PIXEL_CLOCK_PARAMETERS sPCLKInput;
  1601. ENABLE_SPREAD_SPECTRUM_ON_PPLL sReserved;//Caller doesn't need to init this portion
  1602. }SET_PIXEL_CLOCK_PS_ALLOCATION;
  1603. #define ENABLE_VGA_RENDER_PS_ALLOCATION SET_PIXEL_CLOCK_PS_ALLOCATION
  1604. /****************************************************************************/
  1605. // Structures used by ###
  1606. /****************************************************************************/
  1607. typedef struct _MEMORY_TRAINING_PARAMETERS
  1608. {
  1609. ULONG ulTargetMemoryClock; //In 10Khz unit
  1610. }MEMORY_TRAINING_PARAMETERS;
  1611. #define MEMORY_TRAINING_PS_ALLOCATION MEMORY_TRAINING_PARAMETERS
  1612. /****************************LVDS and other encoder command table definitions **********************/
  1613. /****************************************************************************/
  1614. // Structures used by LVDSEncoderControlTable (Before DCE30)
  1615. // LVTMAEncoderControlTable (Before DCE30)
  1616. // TMDSAEncoderControlTable (Before DCE30)
  1617. /****************************************************************************/
  1618. typedef struct _LVDS_ENCODER_CONTROL_PARAMETERS
  1619. {
  1620. USHORT usPixelClock; // in 10KHz; for bios convenient
  1621. UCHAR ucMisc; // bit0=0: Enable single link
  1622. // =1: Enable dual link
  1623. // Bit1=0: 666RGB
  1624. // =1: 888RGB
  1625. UCHAR ucAction; // 0: turn off encoder
  1626. // 1: setup and turn on encoder
  1627. }LVDS_ENCODER_CONTROL_PARAMETERS;
  1628. #define LVDS_ENCODER_CONTROL_PS_ALLOCATION LVDS_ENCODER_CONTROL_PARAMETERS
  1629. #define TMDS1_ENCODER_CONTROL_PARAMETERS LVDS_ENCODER_CONTROL_PARAMETERS
  1630. #define TMDS1_ENCODER_CONTROL_PS_ALLOCATION TMDS1_ENCODER_CONTROL_PARAMETERS
  1631. #define TMDS2_ENCODER_CONTROL_PARAMETERS TMDS1_ENCODER_CONTROL_PARAMETERS
  1632. #define TMDS2_ENCODER_CONTROL_PS_ALLOCATION TMDS2_ENCODER_CONTROL_PARAMETERS
  1633. //ucTableFormatRevision=1,ucTableContentRevision=2
  1634. typedef struct _LVDS_ENCODER_CONTROL_PARAMETERS_V2
  1635. {
  1636. USHORT usPixelClock; // in 10KHz; for bios convenient
  1637. UCHAR ucMisc; // see PANEL_ENCODER_MISC_xx defintions below
  1638. UCHAR ucAction; // 0: turn off encoder
  1639. // 1: setup and turn on encoder
  1640. UCHAR ucTruncate; // bit0=0: Disable truncate
  1641. // =1: Enable truncate
  1642. // bit4=0: 666RGB
  1643. // =1: 888RGB
  1644. UCHAR ucSpatial; // bit0=0: Disable spatial dithering
  1645. // =1: Enable spatial dithering
  1646. // bit4=0: 666RGB
  1647. // =1: 888RGB
  1648. UCHAR ucTemporal; // bit0=0: Disable temporal dithering
  1649. // =1: Enable temporal dithering
  1650. // bit4=0: 666RGB
  1651. // =1: 888RGB
  1652. // bit5=0: Gray level 2
  1653. // =1: Gray level 4
  1654. UCHAR ucFRC; // bit4=0: 25FRC_SEL pattern E
  1655. // =1: 25FRC_SEL pattern F
  1656. // bit6:5=0: 50FRC_SEL pattern A
  1657. // =1: 50FRC_SEL pattern B
  1658. // =2: 50FRC_SEL pattern C
  1659. // =3: 50FRC_SEL pattern D
  1660. // bit7=0: 75FRC_SEL pattern E
  1661. // =1: 75FRC_SEL pattern F
  1662. }LVDS_ENCODER_CONTROL_PARAMETERS_V2;
  1663. #define LVDS_ENCODER_CONTROL_PS_ALLOCATION_V2 LVDS_ENCODER_CONTROL_PARAMETERS_V2
  1664. #define TMDS1_ENCODER_CONTROL_PARAMETERS_V2 LVDS_ENCODER_CONTROL_PARAMETERS_V2
  1665. #define TMDS1_ENCODER_CONTROL_PS_ALLOCATION_V2 TMDS1_ENCODER_CONTROL_PARAMETERS_V2
  1666. #define TMDS2_ENCODER_CONTROL_PARAMETERS_V2 TMDS1_ENCODER_CONTROL_PARAMETERS_V2
  1667. #define TMDS2_ENCODER_CONTROL_PS_ALLOCATION_V2 TMDS2_ENCODER_CONTROL_PARAMETERS_V2
  1668. #define LVDS_ENCODER_CONTROL_PARAMETERS_V3 LVDS_ENCODER_CONTROL_PARAMETERS_V2
  1669. #define LVDS_ENCODER_CONTROL_PS_ALLOCATION_V3 LVDS_ENCODER_CONTROL_PARAMETERS_V3
  1670. #define TMDS1_ENCODER_CONTROL_PARAMETERS_V3 LVDS_ENCODER_CONTROL_PARAMETERS_V3
  1671. #define TMDS1_ENCODER_CONTROL_PS_ALLOCATION_V3 TMDS1_ENCODER_CONTROL_PARAMETERS_V3
  1672. #define TMDS2_ENCODER_CONTROL_PARAMETERS_V3 LVDS_ENCODER_CONTROL_PARAMETERS_V3
  1673. #define TMDS2_ENCODER_CONTROL_PS_ALLOCATION_V3 TMDS2_ENCODER_CONTROL_PARAMETERS_V3
  1674. /****************************************************************************/
  1675. // Structures used by ###
  1676. /****************************************************************************/
  1677. typedef struct _ENABLE_EXTERNAL_TMDS_ENCODER_PARAMETERS
  1678. {
  1679. UCHAR ucEnable; // Enable or Disable External TMDS encoder
  1680. UCHAR ucMisc; // Bit0=0:Enable Single link;=1:Enable Dual link;Bit1 {=0:666RGB, =1:888RGB}
  1681. UCHAR ucPadding[2];
  1682. }ENABLE_EXTERNAL_TMDS_ENCODER_PARAMETERS;
  1683. typedef struct _ENABLE_EXTERNAL_TMDS_ENCODER_PS_ALLOCATION
  1684. {
  1685. ENABLE_EXTERNAL_TMDS_ENCODER_PARAMETERS sXTmdsEncoder;
  1686. WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION sReserved; //Caller doesn't need to init this portion
  1687. }ENABLE_EXTERNAL_TMDS_ENCODER_PS_ALLOCATION;
  1688. #define ENABLE_EXTERNAL_TMDS_ENCODER_PARAMETERS_V2 LVDS_ENCODER_CONTROL_PARAMETERS_V2
  1689. typedef struct _ENABLE_EXTERNAL_TMDS_ENCODER_PS_ALLOCATION_V2
  1690. {
  1691. ENABLE_EXTERNAL_TMDS_ENCODER_PARAMETERS_V2 sXTmdsEncoder;
  1692. WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION sReserved; //Caller doesn't need to init this portion
  1693. }ENABLE_EXTERNAL_TMDS_ENCODER_PS_ALLOCATION_V2;
  1694. typedef struct _EXTERNAL_ENCODER_CONTROL_PS_ALLOCATION
  1695. {
  1696. DIG_ENCODER_CONTROL_PARAMETERS sDigEncoder;
  1697. WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION sReserved;
  1698. }EXTERNAL_ENCODER_CONTROL_PS_ALLOCATION;
  1699. /****************************************************************************/
  1700. // Structures used by DVOEncoderControlTable
  1701. /****************************************************************************/
  1702. //ucTableFormatRevision=1,ucTableContentRevision=3
  1703. //ucDVOConfig:
  1704. #define DVO_ENCODER_CONFIG_RATE_SEL 0x01
  1705. #define DVO_ENCODER_CONFIG_DDR_SPEED 0x00
  1706. #define DVO_ENCODER_CONFIG_SDR_SPEED 0x01
  1707. #define DVO_ENCODER_CONFIG_OUTPUT_SEL 0x0c
  1708. #define DVO_ENCODER_CONFIG_LOW12BIT 0x00
  1709. #define DVO_ENCODER_CONFIG_UPPER12BIT 0x04
  1710. #define DVO_ENCODER_CONFIG_24BIT 0x08
  1711. typedef struct _DVO_ENCODER_CONTROL_PARAMETERS_V3
  1712. {
  1713. USHORT usPixelClock;
  1714. UCHAR ucDVOConfig;
  1715. UCHAR ucAction; //ATOM_ENABLE/ATOM_DISABLE/ATOM_HPD_INIT
  1716. UCHAR ucReseved[4];
  1717. }DVO_ENCODER_CONTROL_PARAMETERS_V3;
  1718. #define DVO_ENCODER_CONTROL_PS_ALLOCATION_V3 DVO_ENCODER_CONTROL_PARAMETERS_V3
  1719. //ucTableFormatRevision=1
  1720. //ucTableContentRevision=3 structure is not changed but usMisc add bit 1 as another input for
  1721. // bit1=0: non-coherent mode
  1722. // =1: coherent mode
  1723. //==========================================================================================
  1724. //Only change is here next time when changing encoder parameter definitions again!
  1725. #define LVDS_ENCODER_CONTROL_PARAMETERS_LAST LVDS_ENCODER_CONTROL_PARAMETERS_V3
  1726. #define LVDS_ENCODER_CONTROL_PS_ALLOCATION_LAST LVDS_ENCODER_CONTROL_PARAMETERS_LAST
  1727. #define TMDS1_ENCODER_CONTROL_PARAMETERS_LAST LVDS_ENCODER_CONTROL_PARAMETERS_V3
  1728. #define TMDS1_ENCODER_CONTROL_PS_ALLOCATION_LAST TMDS1_ENCODER_CONTROL_PARAMETERS_LAST
  1729. #define TMDS2_ENCODER_CONTROL_PARAMETERS_LAST LVDS_ENCODER_CONTROL_PARAMETERS_V3
  1730. #define TMDS2_ENCODER_CONTROL_PS_ALLOCATION_LAST TMDS2_ENCODER_CONTROL_PARAMETERS_LAST
  1731. #define DVO_ENCODER_CONTROL_PARAMETERS_LAST DVO_ENCODER_CONTROL_PARAMETERS
  1732. #define DVO_ENCODER_CONTROL_PS_ALLOCATION_LAST DVO_ENCODER_CONTROL_PS_ALLOCATION
  1733. //==========================================================================================
  1734. #define PANEL_ENCODER_MISC_DUAL 0x01
  1735. #define PANEL_ENCODER_MISC_COHERENT 0x02
  1736. #define PANEL_ENCODER_MISC_TMDS_LINKB 0x04
  1737. #define PANEL_ENCODER_MISC_HDMI_TYPE 0x08
  1738. #define PANEL_ENCODER_ACTION_DISABLE ATOM_DISABLE
  1739. #define PANEL_ENCODER_ACTION_ENABLE ATOM_ENABLE
  1740. #define PANEL_ENCODER_ACTION_COHERENTSEQ (ATOM_ENABLE+1)
  1741. #define PANEL_ENCODER_TRUNCATE_EN 0x01
  1742. #define PANEL_ENCODER_TRUNCATE_DEPTH 0x10
  1743. #define PANEL_ENCODER_SPATIAL_DITHER_EN 0x01
  1744. #define PANEL_ENCODER_SPATIAL_DITHER_DEPTH 0x10
  1745. #define PANEL_ENCODER_TEMPORAL_DITHER_EN 0x01
  1746. #define PANEL_ENCODER_TEMPORAL_DITHER_DEPTH 0x10
  1747. #define PANEL_ENCODER_TEMPORAL_LEVEL_4 0x20
  1748. #define PANEL_ENCODER_25FRC_MASK 0x10
  1749. #define PANEL_ENCODER_25FRC_E 0x00
  1750. #define PANEL_ENCODER_25FRC_F 0x10
  1751. #define PANEL_ENCODER_50FRC_MASK 0x60
  1752. #define PANEL_ENCODER_50FRC_A 0x00
  1753. #define PANEL_ENCODER_50FRC_B 0x20
  1754. #define PANEL_ENCODER_50FRC_C 0x40
  1755. #define PANEL_ENCODER_50FRC_D 0x60
  1756. #define PANEL_ENCODER_75FRC_MASK 0x80
  1757. #define PANEL_ENCODER_75FRC_E 0x00
  1758. #define PANEL_ENCODER_75FRC_F 0x80
  1759. /****************************************************************************/
  1760. // Structures used by SetVoltageTable
  1761. /****************************************************************************/
  1762. #define SET_VOLTAGE_TYPE_ASIC_VDDC 1
  1763. #define SET_VOLTAGE_TYPE_ASIC_MVDDC 2
  1764. #define SET_VOLTAGE_TYPE_ASIC_MVDDQ 3
  1765. #define SET_VOLTAGE_TYPE_ASIC_VDDCI 4
  1766. #define SET_VOLTAGE_INIT_MODE 5
  1767. #define SET_VOLTAGE_GET_MAX_VOLTAGE 6 //Gets the Max. voltage for the soldered Asic
  1768. #define SET_ASIC_VOLTAGE_MODE_ALL_SOURCE 0x1
  1769. #define SET_ASIC_VOLTAGE_MODE_SOURCE_A 0x2
  1770. #define SET_ASIC_VOLTAGE_MODE_SOURCE_B 0x4
  1771. #define SET_ASIC_VOLTAGE_MODE_SET_VOLTAGE 0x0
  1772. #define SET_ASIC_VOLTAGE_MODE_GET_GPIOVAL 0x1
  1773. #define SET_ASIC_VOLTAGE_MODE_GET_GPIOMASK 0x2
  1774. typedef struct _SET_VOLTAGE_PARAMETERS
  1775. {
  1776. UCHAR ucVoltageType; // To tell which voltage to set up, VDDC/MVDDC/MVDDQ
  1777. UCHAR ucVoltageMode; // To set all, to set source A or source B or ...
  1778. UCHAR ucVoltageIndex; // An index to tell which voltage level
  1779. UCHAR ucReserved;
  1780. }SET_VOLTAGE_PARAMETERS;
  1781. typedef struct _SET_VOLTAGE_PARAMETERS_V2
  1782. {
  1783. UCHAR ucVoltageType; // To tell which voltage to set up, VDDC/MVDDC/MVDDQ
  1784. UCHAR ucVoltageMode; // Not used, maybe use for state machine for differen power mode
  1785. USHORT usVoltageLevel; // real voltage level
  1786. }SET_VOLTAGE_PARAMETERS_V2;
  1787. typedef struct _SET_VOLTAGE_PS_ALLOCATION
  1788. {
  1789. SET_VOLTAGE_PARAMETERS sASICSetVoltage;
  1790. WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION sReserved;
  1791. }SET_VOLTAGE_PS_ALLOCATION;
  1792. /****************************************************************************/
  1793. // Structures used by TVEncoderControlTable
  1794. /****************************************************************************/
  1795. typedef struct _TV_ENCODER_CONTROL_PARAMETERS
  1796. {
  1797. USHORT usPixelClock; // in 10KHz; for bios convenient
  1798. UCHAR ucTvStandard; // See definition "ATOM_TV_NTSC ..."
  1799. UCHAR ucAction; // 0: turn off encoder
  1800. // 1: setup and turn on encoder
  1801. }TV_ENCODER_CONTROL_PARAMETERS;
  1802. typedef struct _TV_ENCODER_CONTROL_PS_ALLOCATION
  1803. {
  1804. TV_ENCODER_CONTROL_PARAMETERS sTVEncoder;
  1805. WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION sReserved; // Don't set this one
  1806. }TV_ENCODER_CONTROL_PS_ALLOCATION;
  1807. //==============================Data Table Portion====================================
  1808. /****************************************************************************/
  1809. // Structure used in Data.mtb
  1810. /****************************************************************************/
  1811. typedef struct _ATOM_MASTER_LIST_OF_DATA_TABLES
  1812. {
  1813. USHORT UtilityPipeLine; // Offest for the utility to get parser info,Don't change this position!
  1814. USHORT MultimediaCapabilityInfo; // Only used by MM Lib,latest version 1.1, not configuable from Bios, need to include the table to build Bios
  1815. USHORT MultimediaConfigInfo; // Only used by MM Lib,latest version 2.1, not configuable from Bios, need to include the table to build Bios
  1816. USHORT StandardVESA_Timing; // Only used by Bios
  1817. USHORT FirmwareInfo; // Shared by various SW components,latest version 1.4
  1818. USHORT DAC_Info; // Will be obsolete from R600
  1819. USHORT LCD_Info; // Shared by various SW components,latest version 1.3, was called LVDS_Info
  1820. USHORT TMDS_Info; // Will be obsolete from R600
  1821. USHORT AnalogTV_Info; // Shared by various SW components,latest version 1.1
  1822. USHORT SupportedDevicesInfo; // Will be obsolete from R600
  1823. USHORT GPIO_I2C_Info; // Shared by various SW components,latest version 1.2 will be used from R600
  1824. USHORT VRAM_UsageByFirmware; // Shared by various SW components,latest version 1.3 will be used from R600
  1825. USHORT GPIO_Pin_LUT; // Shared by various SW components,latest version 1.1
  1826. USHORT VESA_ToInternalModeLUT; // Only used by Bios
  1827. USHORT ComponentVideoInfo; // Shared by various SW components,latest version 2.1 will be used from R600
  1828. USHORT PowerPlayInfo; // Shared by various SW components,latest version 2.1,new design from R600
  1829. USHORT CompassionateData; // Will be obsolete from R600
  1830. USHORT SaveRestoreInfo; // Only used by Bios
  1831. USHORT PPLL_SS_Info; // Shared by various SW components,latest version 1.2, used to call SS_Info, change to new name because of int ASIC SS info
  1832. USHORT OemInfo; // Defined and used by external SW, should be obsolete soon
  1833. USHORT XTMDS_Info; // Will be obsolete from R600
  1834. USHORT MclkSS_Info; // Shared by various SW components,latest version 1.1, only enabled when ext SS chip is used
  1835. USHORT Object_Header; // Shared by various SW components,latest version 1.1
  1836. USHORT IndirectIOAccess; // Only used by Bios,this table position can't change at all!!
  1837. USHORT MC_InitParameter; // Only used by command table
  1838. USHORT ASIC_VDDC_Info; // Will be obsolete from R600
  1839. USHORT ASIC_InternalSS_Info; // New tabel name from R600, used to be called "ASIC_MVDDC_Info"
  1840. USHORT TV_VideoMode; // Only used by command table
  1841. USHORT VRAM_Info; // Only used by command table, latest version 1.3
  1842. USHORT MemoryTrainingInfo; // Used for VBIOS and Diag utility for memory training purpose since R600. the new table rev start from 2.1
  1843. USHORT IntegratedSystemInfo; // Shared by various SW components
  1844. USHORT ASIC_ProfilingInfo; // New table name from R600, used to be called "ASIC_VDDCI_Info" for pre-R600
  1845. USHORT VoltageObjectInfo; // Shared by various SW components, latest version 1.1
  1846. USHORT PowerSourceInfo; // Shared by various SW components, latest versoin 1.1
  1847. }ATOM_MASTER_LIST_OF_DATA_TABLES;
  1848. // For backward compatible
  1849. #define LVDS_Info LCD_Info
  1850. typedef struct _ATOM_MASTER_DATA_TABLE
  1851. {
  1852. ATOM_COMMON_TABLE_HEADER sHeader;
  1853. ATOM_MASTER_LIST_OF_DATA_TABLES ListOfDataTables;
  1854. }ATOM_MASTER_DATA_TABLE;
  1855. /****************************************************************************/
  1856. // Structure used in MultimediaCapabilityInfoTable
  1857. /****************************************************************************/
  1858. typedef struct _ATOM_MULTIMEDIA_CAPABILITY_INFO
  1859. {
  1860. ATOM_COMMON_TABLE_HEADER sHeader;
  1861. ULONG ulSignature; // HW info table signature string "$ATI"
  1862. UCHAR ucI2C_Type; // I2C type (normal GP_IO, ImpactTV GP_IO, Dedicated I2C pin, etc)
  1863. UCHAR ucTV_OutInfo; // Type of TV out supported (3:0) and video out crystal frequency (6:4) and TV data port (7)
  1864. UCHAR ucVideoPortInfo; // Provides the video port capabilities
  1865. UCHAR ucHostPortInfo; // Provides host port configuration information
  1866. }ATOM_MULTIMEDIA_CAPABILITY_INFO;
  1867. /****************************************************************************/
  1868. // Structure used in MultimediaConfigInfoTable
  1869. /****************************************************************************/
  1870. typedef struct _ATOM_MULTIMEDIA_CONFIG_INFO
  1871. {
  1872. ATOM_COMMON_TABLE_HEADER sHeader;
  1873. ULONG ulSignature; // MM info table signature sting "$MMT"
  1874. UCHAR ucTunerInfo; // Type of tuner installed on the adapter (4:0) and video input for tuner (7:5)
  1875. UCHAR ucAudioChipInfo; // List the audio chip type (3:0) product type (4) and OEM revision (7:5)
  1876. UCHAR ucProductID; // Defines as OEM ID or ATI board ID dependent on product type setting
  1877. UCHAR ucMiscInfo1; // Tuner voltage (1:0) HW teletext support (3:2) FM audio decoder (5:4) reserved (6) audio scrambling (7)
  1878. UCHAR ucMiscInfo2; // I2S input config (0) I2S output config (1) I2S Audio Chip (4:2) SPDIF Output Config (5) reserved (7:6)
  1879. UCHAR ucMiscInfo3; // Video Decoder Type (3:0) Video In Standard/Crystal (7:4)
  1880. UCHAR ucMiscInfo4; // Video Decoder Host Config (2:0) reserved (7:3)
  1881. UCHAR ucVideoInput0Info;// Video Input 0 Type (1:0) F/B setting (2) physical connector ID (5:3) reserved (7:6)
  1882. UCHAR ucVideoInput1Info;// Video Input 1 Type (1:0) F/B setting (2) physical connector ID (5:3) reserved (7:6)
  1883. UCHAR ucVideoInput2Info;// Video Input 2 Type (1:0) F/B setting (2) physical connector ID (5:3) reserved (7:6)
  1884. UCHAR ucVideoInput3Info;// Video Input 3 Type (1:0) F/B setting (2) physical connector ID (5:3) reserved (7:6)
  1885. UCHAR ucVideoInput4Info;// Video Input 4 Type (1:0) F/B setting (2) physical connector ID (5:3) reserved (7:6)
  1886. }ATOM_MULTIMEDIA_CONFIG_INFO;
  1887. /****************************************************************************/
  1888. // Structures used in FirmwareInfoTable
  1889. /****************************************************************************/
  1890. // usBIOSCapability Definition:
  1891. // Bit 0 = 0: Bios image is not Posted, =1:Bios image is Posted;
  1892. // Bit 1 = 0: Dual CRTC is not supported, =1: Dual CRTC is supported;
  1893. // Bit 2 = 0: Extended Desktop is not supported, =1: Extended Desktop is supported;
  1894. // Others: Reserved
  1895. #define ATOM_BIOS_INFO_ATOM_FIRMWARE_POSTED 0x0001
  1896. #define ATOM_BIOS_INFO_DUAL_CRTC_SUPPORT 0x0002
  1897. #define ATOM_BIOS_INFO_EXTENDED_DESKTOP_SUPPORT 0x0004
  1898. #define ATOM_BIOS_INFO_MEMORY_CLOCK_SS_SUPPORT 0x0008 // (valid from v1.1 ~v1.4):=1: memclk SS enable, =0 memclk SS disable.
  1899. #define ATOM_BIOS_INFO_ENGINE_CLOCK_SS_SUPPORT 0x0010 // (valid from v1.1 ~v1.4):=1: engclk SS enable, =0 engclk SS disable.
  1900. #define ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU 0x0020
  1901. #define ATOM_BIOS_INFO_WMI_SUPPORT 0x0040
  1902. #define ATOM_BIOS_INFO_PPMODE_ASSIGNGED_BY_SYSTEM 0x0080
  1903. #define ATOM_BIOS_INFO_HYPERMEMORY_SUPPORT 0x0100
  1904. #define ATOM_BIOS_INFO_HYPERMEMORY_SIZE_MASK 0x1E00
  1905. #define ATOM_BIOS_INFO_VPOST_WITHOUT_FIRST_MODE_SET 0x2000
  1906. #define ATOM_BIOS_INFO_BIOS_SCRATCH6_SCL2_REDEFINE 0x4000
  1907. #define ATOM_BIOS_INFO_MEMORY_CLOCK_EXT_SS_SUPPORT 0x0008 // (valid from v2.1 ): =1: memclk ss enable with external ss chip
  1908. #define ATOM_BIOS_INFO_ENGINE_CLOCK_EXT_SS_SUPPORT 0x0010 // (valid from v2.1 ): =1: engclk ss enable with external ss chip
  1909. #ifndef _H2INC
  1910. //Please don't add or expand this bitfield structure below, this one will retire soon.!
  1911. typedef struct _ATOM_FIRMWARE_CAPABILITY
  1912. {
  1913. #if ATOM_BIG_ENDIAN
  1914. USHORT Reserved:3;
  1915. USHORT HyperMemory_Size:4;
  1916. USHORT HyperMemory_Support:1;
  1917. USHORT PPMode_Assigned:1;
  1918. USHORT WMI_SUPPORT:1;
  1919. USHORT GPUControlsBL:1;
  1920. USHORT EngineClockSS_Support:1;
  1921. USHORT MemoryClockSS_Support:1;
  1922. USHORT ExtendedDesktopSupport:1;
  1923. USHORT DualCRTC_Support:1;
  1924. USHORT FirmwarePosted:1;
  1925. #else
  1926. USHORT FirmwarePosted:1;
  1927. USHORT DualCRTC_Support:1;
  1928. USHORT ExtendedDesktopSupport:1;
  1929. USHORT MemoryClockSS_Support:1;
  1930. USHORT EngineClockSS_Support:1;
  1931. USHORT GPUControlsBL:1;
  1932. USHORT WMI_SUPPORT:1;
  1933. USHORT PPMode_Assigned:1;
  1934. USHORT HyperMemory_Support:1;
  1935. USHORT HyperMemory_Size:4;
  1936. USHORT Reserved:3;
  1937. #endif
  1938. }ATOM_FIRMWARE_CAPABILITY;
  1939. typedef union _ATOM_FIRMWARE_CAPABILITY_ACCESS
  1940. {
  1941. ATOM_FIRMWARE_CAPABILITY sbfAccess;
  1942. USHORT susAccess;
  1943. }ATOM_FIRMWARE_CAPABILITY_ACCESS;
  1944. #else
  1945. typedef union _ATOM_FIRMWARE_CAPABILITY_ACCESS
  1946. {
  1947. USHORT susAccess;
  1948. }ATOM_FIRMWARE_CAPABILITY_ACCESS;
  1949. #endif
  1950. typedef struct _ATOM_FIRMWARE_INFO
  1951. {
  1952. ATOM_COMMON_TABLE_HEADER sHeader;
  1953. ULONG ulFirmwareRevision;
  1954. ULONG ulDefaultEngineClock; //In 10Khz unit
  1955. ULONG ulDefaultMemoryClock; //In 10Khz unit
  1956. ULONG ulDriverTargetEngineClock; //In 10Khz unit
  1957. ULONG ulDriverTargetMemoryClock; //In 10Khz unit
  1958. ULONG ulMaxEngineClockPLL_Output; //In 10Khz unit
  1959. ULONG ulMaxMemoryClockPLL_Output; //In 10Khz unit
  1960. ULONG ulMaxPixelClockPLL_Output; //In 10Khz unit
  1961. ULONG ulASICMaxEngineClock; //In 10Khz unit
  1962. ULONG ulASICMaxMemoryClock; //In 10Khz unit
  1963. UCHAR ucASICMaxTemperature;
  1964. UCHAR ucPadding[3]; //Don't use them
  1965. ULONG aulReservedForBIOS[3]; //Don't use them
  1966. USHORT usMinEngineClockPLL_Input; //In 10Khz unit
  1967. USHORT usMaxEngineClockPLL_Input; //In 10Khz unit
  1968. USHORT usMinEngineClockPLL_Output; //In 10Khz unit
  1969. USHORT usMinMemoryClockPLL_Input; //In 10Khz unit
  1970. USHORT usMaxMemoryClockPLL_Input; //In 10Khz unit
  1971. USHORT usMinMemoryClockPLL_Output; //In 10Khz unit
  1972. USHORT usMaxPixelClock; //In 10Khz unit, Max. Pclk
  1973. USHORT usMinPixelClockPLL_Input; //In 10Khz unit
  1974. USHORT usMaxPixelClockPLL_Input; //In 10Khz unit
  1975. USHORT usMinPixelClockPLL_Output; //In 10Khz unit, the definitions above can't change!!!
  1976. ATOM_FIRMWARE_CAPABILITY_ACCESS usFirmwareCapability;
  1977. USHORT usReferenceClock; //In 10Khz unit
  1978. USHORT usPM_RTS_Location; //RTS PM4 starting location in ROM in 1Kb unit
  1979. UCHAR ucPM_RTS_StreamSize; //RTS PM4 packets in Kb unit
  1980. UCHAR ucDesign_ID; //Indicate what is the board design
  1981. UCHAR ucMemoryModule_ID; //Indicate what is the board design
  1982. }ATOM_FIRMWARE_INFO;
  1983. typedef struct _ATOM_FIRMWARE_INFO_V1_2
  1984. {
  1985. ATOM_COMMON_TABLE_HEADER sHeader;
  1986. ULONG ulFirmwareRevision;
  1987. ULONG ulDefaultEngineClock; //In 10Khz unit
  1988. ULONG ulDefaultMemoryClock; //In 10Khz unit
  1989. ULONG ulDriverTargetEngineClock; //In 10Khz unit
  1990. ULONG ulDriverTargetMemoryClock; //In 10Khz unit
  1991. ULONG ulMaxEngineClockPLL_Output; //In 10Khz unit
  1992. ULONG ulMaxMemoryClockPLL_Output; //In 10Khz unit
  1993. ULONG ulMaxPixelClockPLL_Output; //In 10Khz unit
  1994. ULONG ulASICMaxEngineClock; //In 10Khz unit
  1995. ULONG ulASICMaxMemoryClock; //In 10Khz unit
  1996. UCHAR ucASICMaxTemperature;
  1997. UCHAR ucMinAllowedBL_Level;
  1998. UCHAR ucPadding[2]; //Don't use them
  1999. ULONG aulReservedForBIOS[2]; //Don't use them
  2000. ULONG ulMinPixelClockPLL_Output; //In 10Khz unit
  2001. USHORT usMinEngineClockPLL_Input; //In 10Khz unit
  2002. USHORT usMaxEngineClockPLL_Input; //In 10Khz unit
  2003. USHORT usMinEngineClockPLL_Output; //In 10Khz unit
  2004. USHORT usMinMemoryClockPLL_Input; //In 10Khz unit
  2005. USHORT usMaxMemoryClockPLL_Input; //In 10Khz unit
  2006. USHORT usMinMemoryClockPLL_Output; //In 10Khz unit
  2007. USHORT usMaxPixelClock; //In 10Khz unit, Max. Pclk
  2008. USHORT usMinPixelClockPLL_Input; //In 10Khz unit
  2009. USHORT usMaxPixelClockPLL_Input; //In 10Khz unit
  2010. USHORT usMinPixelClockPLL_Output; //In 10Khz unit - lower 16bit of ulMinPixelClockPLL_Output
  2011. ATOM_FIRMWARE_CAPABILITY_ACCESS usFirmwareCapability;
  2012. USHORT usReferenceClock; //In 10Khz unit
  2013. USHORT usPM_RTS_Location; //RTS PM4 starting location in ROM in 1Kb unit
  2014. UCHAR ucPM_RTS_StreamSize; //RTS PM4 packets in Kb unit
  2015. UCHAR ucDesign_ID; //Indicate what is the board design
  2016. UCHAR ucMemoryModule_ID; //Indicate what is the board design
  2017. }ATOM_FIRMWARE_INFO_V1_2;
  2018. typedef struct _ATOM_FIRMWARE_INFO_V1_3
  2019. {
  2020. ATOM_COMMON_TABLE_HEADER sHeader;
  2021. ULONG ulFirmwareRevision;
  2022. ULONG ulDefaultEngineClock; //In 10Khz unit
  2023. ULONG ulDefaultMemoryClock; //In 10Khz unit
  2024. ULONG ulDriverTargetEngineClock; //In 10Khz unit
  2025. ULONG ulDriverTargetMemoryClock; //In 10Khz unit
  2026. ULONG ulMaxEngineClockPLL_Output; //In 10Khz unit
  2027. ULONG ulMaxMemoryClockPLL_Output; //In 10Khz unit
  2028. ULONG ulMaxPixelClockPLL_Output; //In 10Khz unit
  2029. ULONG ulASICMaxEngineClock; //In 10Khz unit
  2030. ULONG ulASICMaxMemoryClock; //In 10Khz unit
  2031. UCHAR ucASICMaxTemperature;
  2032. UCHAR ucMinAllowedBL_Level;
  2033. UCHAR ucPadding[2]; //Don't use them
  2034. ULONG aulReservedForBIOS; //Don't use them
  2035. ULONG ul3DAccelerationEngineClock;//In 10Khz unit
  2036. ULONG ulMinPixelClockPLL_Output; //In 10Khz unit
  2037. USHORT usMinEngineClockPLL_Input; //In 10Khz unit
  2038. USHORT usMaxEngineClockPLL_Input; //In 10Khz unit
  2039. USHORT usMinEngineClockPLL_Output; //In 10Khz unit
  2040. USHORT usMinMemoryClockPLL_Input; //In 10Khz unit
  2041. USHORT usMaxMemoryClockPLL_Input; //In 10Khz unit
  2042. USHORT usMinMemoryClockPLL_Output; //In 10Khz unit
  2043. USHORT usMaxPixelClock; //In 10Khz unit, Max. Pclk
  2044. USHORT usMinPixelClockPLL_Input; //In 10Khz unit
  2045. USHORT usMaxPixelClockPLL_Input; //In 10Khz unit
  2046. USHORT usMinPixelClockPLL_Output; //In 10Khz unit - lower 16bit of ulMinPixelClockPLL_Output
  2047. ATOM_FIRMWARE_CAPABILITY_ACCESS usFirmwareCapability;
  2048. USHORT usReferenceClock; //In 10Khz unit
  2049. USHORT usPM_RTS_Location; //RTS PM4 starting location in ROM in 1Kb unit
  2050. UCHAR ucPM_RTS_StreamSize; //RTS PM4 packets in Kb unit
  2051. UCHAR ucDesign_ID; //Indicate what is the board design
  2052. UCHAR ucMemoryModule_ID; //Indicate what is the board design
  2053. }ATOM_FIRMWARE_INFO_V1_3;
  2054. typedef struct _ATOM_FIRMWARE_INFO_V1_4
  2055. {
  2056. ATOM_COMMON_TABLE_HEADER sHeader;
  2057. ULONG ulFirmwareRevision;
  2058. ULONG ulDefaultEngineClock; //In 10Khz unit
  2059. ULONG ulDefaultMemoryClock; //In 10Khz unit
  2060. ULONG ulDriverTargetEngineClock; //In 10Khz unit
  2061. ULONG ulDriverTargetMemoryClock; //In 10Khz unit
  2062. ULONG ulMaxEngineClockPLL_Output; //In 10Khz unit
  2063. ULONG ulMaxMemoryClockPLL_Output; //In 10Khz unit
  2064. ULONG ulMaxPixelClockPLL_Output; //In 10Khz unit
  2065. ULONG ulASICMaxEngineClock; //In 10Khz unit
  2066. ULONG ulASICMaxMemoryClock; //In 10Khz unit
  2067. UCHAR ucASICMaxTemperature;
  2068. UCHAR ucMinAllowedBL_Level;
  2069. USHORT usBootUpVDDCVoltage; //In MV unit
  2070. USHORT usLcdMinPixelClockPLL_Output; // In MHz unit
  2071. USHORT usLcdMaxPixelClockPLL_Output; // In MHz unit
  2072. ULONG ul3DAccelerationEngineClock;//In 10Khz unit
  2073. ULONG ulMinPixelClockPLL_Output; //In 10Khz unit
  2074. USHORT usMinEngineClockPLL_Input; //In 10Khz unit
  2075. USHORT usMaxEngineClockPLL_Input; //In 10Khz unit
  2076. USHORT usMinEngineClockPLL_Output; //In 10Khz unit
  2077. USHORT usMinMemoryClockPLL_Input; //In 10Khz unit
  2078. USHORT usMaxMemoryClockPLL_Input; //In 10Khz unit
  2079. USHORT usMinMemoryClockPLL_Output; //In 10Khz unit
  2080. USHORT usMaxPixelClock; //In 10Khz unit, Max. Pclk
  2081. USHORT usMinPixelClockPLL_Input; //In 10Khz unit
  2082. USHORT usMaxPixelClockPLL_Input; //In 10Khz unit
  2083. USHORT usMinPixelClockPLL_Output; //In 10Khz unit - lower 16bit of ulMinPixelClockPLL_Output
  2084. ATOM_FIRMWARE_CAPABILITY_ACCESS usFirmwareCapability;
  2085. USHORT usReferenceClock; //In 10Khz unit
  2086. USHORT usPM_RTS_Location; //RTS PM4 starting location in ROM in 1Kb unit
  2087. UCHAR ucPM_RTS_StreamSize; //RTS PM4 packets in Kb unit
  2088. UCHAR ucDesign_ID; //Indicate what is the board design
  2089. UCHAR ucMemoryModule_ID; //Indicate what is the board design
  2090. }ATOM_FIRMWARE_INFO_V1_4;
  2091. //the structure below to be used from Cypress
  2092. typedef struct _ATOM_FIRMWARE_INFO_V2_1
  2093. {
  2094. ATOM_COMMON_TABLE_HEADER sHeader;
  2095. ULONG ulFirmwareRevision;
  2096. ULONG ulDefaultEngineClock; //In 10Khz unit
  2097. ULONG ulDefaultMemoryClock; //In 10Khz unit
  2098. ULONG ulReserved1;
  2099. ULONG ulReserved2;
  2100. ULONG ulMaxEngineClockPLL_Output; //In 10Khz unit
  2101. ULONG ulMaxMemoryClockPLL_Output; //In 10Khz unit
  2102. ULONG ulMaxPixelClockPLL_Output; //In 10Khz unit
  2103. ULONG ulBinaryAlteredInfo; //Was ulASICMaxEngineClock
  2104. ULONG ulDefaultDispEngineClkFreq; //In 10Khz unit
  2105. UCHAR ucReserved1; //Was ucASICMaxTemperature;
  2106. UCHAR ucMinAllowedBL_Level;
  2107. USHORT usBootUpVDDCVoltage; //In MV unit
  2108. USHORT usLcdMinPixelClockPLL_Output; // In MHz unit
  2109. USHORT usLcdMaxPixelClockPLL_Output; // In MHz unit
  2110. ULONG ulReserved4; //Was ulAsicMaximumVoltage
  2111. ULONG ulMinPixelClockPLL_Output; //In 10Khz unit
  2112. USHORT usMinEngineClockPLL_Input; //In 10Khz unit
  2113. USHORT usMaxEngineClockPLL_Input; //In 10Khz unit
  2114. USHORT usMinEngineClockPLL_Output; //In 10Khz unit
  2115. USHORT usMinMemoryClockPLL_Input; //In 10Khz unit
  2116. USHORT usMaxMemoryClockPLL_Input; //In 10Khz unit
  2117. USHORT usMinMemoryClockPLL_Output; //In 10Khz unit
  2118. USHORT usMaxPixelClock; //In 10Khz unit, Max. Pclk
  2119. USHORT usMinPixelClockPLL_Input; //In 10Khz unit
  2120. USHORT usMaxPixelClockPLL_Input; //In 10Khz unit
  2121. USHORT usMinPixelClockPLL_Output; //In 10Khz unit - lower 16bit of ulMinPixelClockPLL_Output
  2122. ATOM_FIRMWARE_CAPABILITY_ACCESS usFirmwareCapability;
  2123. USHORT usCoreReferenceClock; //In 10Khz unit
  2124. USHORT usMemoryReferenceClock; //In 10Khz unit
  2125. USHORT usUniphyDPModeExtClkFreq; //In 10Khz unit, if it is 0, In DP Mode Uniphy Input clock from internal PPLL, otherwise Input clock from external Spread clock
  2126. UCHAR ucMemoryModule_ID; //Indicate what is the board design
  2127. UCHAR ucReserved4[3];
  2128. }ATOM_FIRMWARE_INFO_V2_1;
  2129. //the structure below to be used from NI
  2130. //ucTableFormatRevision=2
  2131. //ucTableContentRevision=2
  2132. typedef struct _ATOM_FIRMWARE_INFO_V2_2
  2133. {
  2134. ATOM_COMMON_TABLE_HEADER sHeader;
  2135. ULONG ulFirmwareRevision;
  2136. ULONG ulDefaultEngineClock; //In 10Khz unit
  2137. ULONG ulDefaultMemoryClock; //In 10Khz unit
  2138. ULONG ulReserved[2];
  2139. ULONG ulReserved1; //Was ulMaxEngineClockPLL_Output; //In 10Khz unit*
  2140. ULONG ulReserved2; //Was ulMaxMemoryClockPLL_Output; //In 10Khz unit*
  2141. ULONG ulMaxPixelClockPLL_Output; //In 10Khz unit
  2142. ULONG ulBinaryAlteredInfo; //Was ulASICMaxEngineClock ?
  2143. ULONG ulDefaultDispEngineClkFreq; //In 10Khz unit. This is the frequency before DCDTO, corresponding to usBootUpVDDCVoltage.
  2144. UCHAR ucReserved3; //Was ucASICMaxTemperature;
  2145. UCHAR ucMinAllowedBL_Level;
  2146. USHORT usBootUpVDDCVoltage; //In MV unit
  2147. USHORT usLcdMinPixelClockPLL_Output; // In MHz unit
  2148. USHORT usLcdMaxPixelClockPLL_Output; // In MHz unit
  2149. ULONG ulReserved4; //Was ulAsicMaximumVoltage
  2150. ULONG ulMinPixelClockPLL_Output; //In 10Khz unit
  2151. ULONG ulReserved5; //Was usMinEngineClockPLL_Input and usMaxEngineClockPLL_Input
  2152. ULONG ulReserved6; //Was usMinEngineClockPLL_Output and usMinMemoryClockPLL_Input
  2153. ULONG ulReserved7; //Was usMaxMemoryClockPLL_Input and usMinMemoryClockPLL_Output
  2154. USHORT usReserved11; //Was usMaxPixelClock; //In 10Khz unit, Max. Pclk used only for DAC
  2155. USHORT usMinPixelClockPLL_Input; //In 10Khz unit
  2156. USHORT usMaxPixelClockPLL_Input; //In 10Khz unit
  2157. USHORT usBootUpVDDCIVoltage; //In unit of mv; Was usMinPixelClockPLL_Output;
  2158. ATOM_FIRMWARE_CAPABILITY_ACCESS usFirmwareCapability;
  2159. USHORT usCoreReferenceClock; //In 10Khz unit
  2160. USHORT usMemoryReferenceClock; //In 10Khz unit
  2161. USHORT usUniphyDPModeExtClkFreq; //In 10Khz unit, if it is 0, In DP Mode Uniphy Input clock from internal PPLL, otherwise Input clock from external Spread clock
  2162. UCHAR ucMemoryModule_ID; //Indicate what is the board design
  2163. UCHAR ucReserved9[3];
  2164. USHORT usBootUpMVDDCVoltage; //In unit of mv; Was usMinPixelClockPLL_Output;
  2165. USHORT usReserved12;
  2166. ULONG ulReserved10[3]; // New added comparing to previous version
  2167. }ATOM_FIRMWARE_INFO_V2_2;
  2168. #define ATOM_FIRMWARE_INFO_LAST ATOM_FIRMWARE_INFO_V2_2
  2169. /****************************************************************************/
  2170. // Structures used in IntegratedSystemInfoTable
  2171. /****************************************************************************/
  2172. #define IGP_CAP_FLAG_DYNAMIC_CLOCK_EN 0x2
  2173. #define IGP_CAP_FLAG_AC_CARD 0x4
  2174. #define IGP_CAP_FLAG_SDVO_CARD 0x8
  2175. #define IGP_CAP_FLAG_POSTDIV_BY_2_MODE 0x10
  2176. typedef struct _ATOM_INTEGRATED_SYSTEM_INFO
  2177. {
  2178. ATOM_COMMON_TABLE_HEADER sHeader;
  2179. ULONG ulBootUpEngineClock; //in 10kHz unit
  2180. ULONG ulBootUpMemoryClock; //in 10kHz unit
  2181. ULONG ulMaxSystemMemoryClock; //in 10kHz unit
  2182. ULONG ulMinSystemMemoryClock; //in 10kHz unit
  2183. UCHAR ucNumberOfCyclesInPeriodHi;
  2184. UCHAR ucLCDTimingSel; //=0:not valid.!=0 sel this timing descriptor from LCD EDID.
  2185. USHORT usReserved1;
  2186. USHORT usInterNBVoltageLow; //An intermidiate PMW value to set the voltage
  2187. USHORT usInterNBVoltageHigh; //Another intermidiate PMW value to set the voltage
  2188. ULONG ulReserved[2];
  2189. USHORT usFSBClock; //In MHz unit
  2190. USHORT usCapabilityFlag; //Bit0=1 indicates the fake HDMI support,Bit1=0/1 for Dynamic clocking dis/enable
  2191. //Bit[3:2]== 0:No PCIE card, 1:AC card, 2:SDVO card
  2192. //Bit[4]==1: P/2 mode, ==0: P/1 mode
  2193. USHORT usPCIENBCfgReg7; //bit[7:0]=MUX_Sel, bit[9:8]=MUX_SEL_LEVEL2, bit[10]=Lane_Reversal
  2194. USHORT usK8MemoryClock; //in MHz unit
  2195. USHORT usK8SyncStartDelay; //in 0.01 us unit
  2196. USHORT usK8DataReturnTime; //in 0.01 us unit
  2197. UCHAR ucMaxNBVoltage;
  2198. UCHAR ucMinNBVoltage;
  2199. UCHAR ucMemoryType; //[7:4]=1:DDR1;=2:DDR2;=3:DDR3.[3:0] is reserved
  2200. UCHAR ucNumberOfCyclesInPeriod; //CG.FVTHROT_PWM_CTRL_REG0.NumberOfCyclesInPeriod
  2201. UCHAR ucStartingPWM_HighTime; //CG.FVTHROT_PWM_CTRL_REG0.StartingPWM_HighTime
  2202. UCHAR ucHTLinkWidth; //16 bit vs. 8 bit
  2203. UCHAR ucMaxNBVoltageHigh;
  2204. UCHAR ucMinNBVoltageHigh;
  2205. }ATOM_INTEGRATED_SYSTEM_INFO;
  2206. /* Explanation on entries in ATOM_INTEGRATED_SYSTEM_INFO
  2207. ulBootUpMemoryClock: For Intel IGP,it's the UMA system memory clock
  2208. For AMD IGP,it's 0 if no SidePort memory installed or it's the boot-up SidePort memory clock
  2209. ulMaxSystemMemoryClock: For Intel IGP,it's the Max freq from memory SPD if memory runs in ASYNC mode or otherwise (SYNC mode) it's 0
  2210. For AMD IGP,for now this can be 0
  2211. ulMinSystemMemoryClock: For Intel IGP,it's 133MHz if memory runs in ASYNC mode or otherwise (SYNC mode) it's 0
  2212. For AMD IGP,for now this can be 0
  2213. usFSBClock: For Intel IGP,it's FSB Freq
  2214. For AMD IGP,it's HT Link Speed
  2215. usK8MemoryClock: For AMD IGP only. For RevF CPU, set it to 200
  2216. usK8SyncStartDelay: For AMD IGP only. Memory access latency in K8, required for watermark calculation
  2217. usK8DataReturnTime: For AMD IGP only. Memory access latency in K8, required for watermark calculation
  2218. VC:Voltage Control
  2219. ucMaxNBVoltage: Voltage regulator dependent PWM value. Low 8 bits of the value for the max voltage.Set this one to 0xFF if VC without PWM. Set this to 0x0 if no VC at all.
  2220. ucMinNBVoltage: Voltage regulator dependent PWM value. Low 8 bits of the value for the min voltage.Set this one to 0x00 if VC without PWM or no VC at all.
  2221. ucNumberOfCyclesInPeriod: Indicate how many cycles when PWM duty is 100%. low 8 bits of the value.
  2222. ucNumberOfCyclesInPeriodHi: Indicate how many cycles when PWM duty is 100%. high 8 bits of the value.If the PWM has an inverter,set bit [7]==1,otherwise set it 0
  2223. ucMaxNBVoltageHigh: Voltage regulator dependent PWM value. High 8 bits of the value for the max voltage.Set this one to 0xFF if VC without PWM. Set this to 0x0 if no VC at all.
  2224. ucMinNBVoltageHigh: Voltage regulator dependent PWM value. High 8 bits of the value for the min voltage.Set this one to 0x00 if VC without PWM or no VC at all.
  2225. usInterNBVoltageLow: Voltage regulator dependent PWM value. The value makes the the voltage >=Min NB voltage but <=InterNBVoltageHigh. Set this to 0x0000 if VC without PWM or no VC at all.
  2226. usInterNBVoltageHigh: Voltage regulator dependent PWM value. The value makes the the voltage >=InterNBVoltageLow but <=Max NB voltage.Set this to 0x0000 if VC without PWM or no VC at all.
  2227. */
  2228. /*
  2229. The following IGP table is introduced from RS780, which is supposed to be put by SBIOS in FB before IGP VBIOS starts VPOST;
  2230. Then VBIOS will copy the whole structure to its image so all GPU SW components can access this data structure to get whatever they need.
  2231. The enough reservation should allow us to never change table revisions. Whenever needed, a GPU SW component can use reserved portion for new data entries.
  2232. SW components can access the IGP system infor structure in the same way as before
  2233. */
  2234. typedef struct _ATOM_INTEGRATED_SYSTEM_INFO_V2
  2235. {
  2236. ATOM_COMMON_TABLE_HEADER sHeader;
  2237. ULONG ulBootUpEngineClock; //in 10kHz unit
  2238. ULONG ulReserved1[2]; //must be 0x0 for the reserved
  2239. ULONG ulBootUpUMAClock; //in 10kHz unit
  2240. ULONG ulBootUpSidePortClock; //in 10kHz unit
  2241. ULONG ulMinSidePortClock; //in 10kHz unit
  2242. ULONG ulReserved2[6]; //must be 0x0 for the reserved
  2243. ULONG ulSystemConfig; //see explanation below
  2244. ULONG ulBootUpReqDisplayVector;
  2245. ULONG ulOtherDisplayMisc;
  2246. ULONG ulDDISlot1Config;
  2247. ULONG ulDDISlot2Config;
  2248. UCHAR ucMemoryType; //[3:0]=1:DDR1;=2:DDR2;=3:DDR3.[7:4] is reserved
  2249. UCHAR ucUMAChannelNumber;
  2250. UCHAR ucDockingPinBit;
  2251. UCHAR ucDockingPinPolarity;
  2252. ULONG ulDockingPinCFGInfo;
  2253. ULONG ulCPUCapInfo;
  2254. USHORT usNumberOfCyclesInPeriod;
  2255. USHORT usMaxNBVoltage;
  2256. USHORT usMinNBVoltage;
  2257. USHORT usBootUpNBVoltage;
  2258. ULONG ulHTLinkFreq; //in 10Khz
  2259. USHORT usMinHTLinkWidth;
  2260. USHORT usMaxHTLinkWidth;
  2261. USHORT usUMASyncStartDelay;
  2262. USHORT usUMADataReturnTime;
  2263. USHORT usLinkStatusZeroTime;
  2264. USHORT usDACEfuse; //for storing badgap value (for RS880 only)
  2265. ULONG ulHighVoltageHTLinkFreq; // in 10Khz
  2266. ULONG ulLowVoltageHTLinkFreq; // in 10Khz
  2267. USHORT usMaxUpStreamHTLinkWidth;
  2268. USHORT usMaxDownStreamHTLinkWidth;
  2269. USHORT usMinUpStreamHTLinkWidth;
  2270. USHORT usMinDownStreamHTLinkWidth;
  2271. USHORT usFirmwareVersion; //0 means FW is not supported. Otherwise it's the FW version loaded by SBIOS and driver should enable FW.
  2272. USHORT usFullT0Time; // Input to calculate minimum HT link change time required by NB P-State. Unit is 0.01us.
  2273. ULONG ulReserved3[96]; //must be 0x0
  2274. }ATOM_INTEGRATED_SYSTEM_INFO_V2;
  2275. /*
  2276. ulBootUpEngineClock: Boot-up Engine Clock in 10Khz;
  2277. ulBootUpUMAClock: Boot-up UMA Clock in 10Khz; it must be 0x0 when UMA is not present
  2278. ulBootUpSidePortClock: Boot-up SidePort Clock in 10Khz; it must be 0x0 when SidePort Memory is not present,this could be equal to or less than maximum supported Sideport memory clock
  2279. ulSystemConfig:
  2280. Bit[0]=1: PowerExpress mode =0 Non-PowerExpress mode;
  2281. Bit[1]=1: system boots up at AMD overdrived state or user customized mode. In this case, driver will just stick to this boot-up mode. No other PowerPlay state
  2282. =0: system boots up at driver control state. Power state depends on PowerPlay table.
  2283. Bit[2]=1: PWM method is used on NB voltage control. =0: GPIO method is used.
  2284. Bit[3]=1: Only one power state(Performance) will be supported.
  2285. =0: Multiple power states supported from PowerPlay table.
  2286. Bit[4]=1: CLMC is supported and enabled on current system.
  2287. =0: CLMC is not supported or enabled on current system. SBIOS need to support HT link/freq change through ATIF interface.
  2288. Bit[5]=1: Enable CDLW for all driver control power states. Max HT width is from SBIOS, while Min HT width is determined by display requirement.
  2289. =0: CDLW is disabled. If CLMC is enabled case, Min HT width will be set equal to Max HT width. If CLMC disabled case, Max HT width will be applied.
  2290. Bit[6]=1: High Voltage requested for all power states. In this case, voltage will be forced at 1.1v and powerplay table voltage drop/throttling request will be ignored.
  2291. =0: Voltage settings is determined by powerplay table.
  2292. Bit[7]=1: Enable CLMC as hybrid Mode. CDLD and CILR will be disabled in this case and we're using legacy C1E. This is workaround for CPU(Griffin) performance issue.
  2293. =0: Enable CLMC as regular mode, CDLD and CILR will be enabled.
  2294. Bit[8]=1: CDLF is supported and enabled on current system.
  2295. =0: CDLF is not supported or enabled on current system.
  2296. Bit[9]=1: DLL Shut Down feature is enabled on current system.
  2297. =0: DLL Shut Down feature is not enabled or supported on current system.
  2298. ulBootUpReqDisplayVector: This dword is a bit vector indicates what display devices are requested during boot-up. Refer to ATOM_DEVICE_xxx_SUPPORT for the bit vector definitions.
  2299. ulOtherDisplayMisc: [15:8]- Bootup LCD Expansion selection; 0-center, 1-full panel size expansion;
  2300. [7:0] - BootupTV standard selection; This is a bit vector to indicate what TV standards are supported by the system. Refer to ucTVSupportedStd definition;
  2301. ulDDISlot1Config: Describes the PCIE lane configuration on this DDI PCIE slot (ADD2 card) or connector (Mobile design).
  2302. [3:0] - Bit vector to indicate PCIE lane config of the DDI slot/connector on chassis (bit 0=1 lane 3:0; bit 1=1 lane 7:4; bit 2=1 lane 11:8; bit 3=1 lane 15:12)
  2303. [7:4] - Bit vector to indicate PCIE lane config of the same DDI slot/connector on docking station (bit 4=1 lane 3:0; bit 5=1 lane 7:4; bit 6=1 lane 11:8; bit 7=1 lane 15:12)
  2304. When a DDI connector is not "paired" (meaming two connections mutualexclusive on chassis or docking, only one of them can be connected at one time.
  2305. in both chassis and docking, SBIOS has to duplicate the same PCIE lane info from chassis to docking or vice versa. For example:
  2306. one DDI connector is only populated in docking with PCIE lane 8-11, but there is no paired connection on chassis, SBIOS has to copy bit 6 to bit 2.
  2307. [15:8] - Lane configuration attribute;
  2308. [23:16]- Connector type, possible value:
  2309. CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D
  2310. CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D
  2311. CONNECTOR_OBJECT_ID_HDMI_TYPE_A
  2312. CONNECTOR_OBJECT_ID_DISPLAYPORT
  2313. CONNECTOR_OBJECT_ID_eDP
  2314. [31:24]- Reserved
  2315. ulDDISlot2Config: Same as Slot1.
  2316. ucMemoryType: SidePort memory type, set it to 0x0 when Sideport memory is not installed. Driver needs this info to change sideport memory clock. Not for display in CCC.
  2317. For IGP, Hypermemory is the only memory type showed in CCC.
  2318. ucUMAChannelNumber: how many channels for the UMA;
  2319. ulDockingPinCFGInfo: [15:0]-Bus/Device/Function # to CFG to read this Docking Pin; [31:16]-reg offset in CFG to read this pin
  2320. ucDockingPinBit: which bit in this register to read the pin status;
  2321. ucDockingPinPolarity:Polarity of the pin when docked;
  2322. ulCPUCapInfo: [7:0]=1:Griffin;[7:0]=2:Greyhound;[7:0]=3:K8, [7:0]=4:Pharaoh, other bits reserved for now and must be 0x0
  2323. usNumberOfCyclesInPeriod:Indicate how many cycles when PWM duty is 100%.
  2324. usMaxNBVoltage:Max. voltage control value in either PWM or GPIO mode.
  2325. usMinNBVoltage:Min. voltage control value in either PWM or GPIO mode.
  2326. GPIO mode: both usMaxNBVoltage & usMinNBVoltage have a valid value ulSystemConfig.SYSTEM_CONFIG_USE_PWM_ON_VOLTAGE=0
  2327. PWM mode: both usMaxNBVoltage & usMinNBVoltage have a valid value ulSystemConfig.SYSTEM_CONFIG_USE_PWM_ON_VOLTAGE=1
  2328. GPU SW don't control mode: usMaxNBVoltage & usMinNBVoltage=0 and no care about ulSystemConfig.SYSTEM_CONFIG_USE_PWM_ON_VOLTAGE
  2329. usBootUpNBVoltage:Boot-up voltage regulator dependent PWM value.
  2330. ulHTLinkFreq: Bootup HT link Frequency in 10Khz.
  2331. usMinHTLinkWidth: Bootup minimum HT link width. If CDLW disabled, this is equal to usMaxHTLinkWidth.
  2332. If CDLW enabled, both upstream and downstream width should be the same during bootup.
  2333. usMaxHTLinkWidth: Bootup maximum HT link width. If CDLW disabled, this is equal to usMinHTLinkWidth.
  2334. If CDLW enabled, both upstream and downstream width should be the same during bootup.
  2335. usUMASyncStartDelay: Memory access latency, required for watermark calculation
  2336. usUMADataReturnTime: Memory access latency, required for watermark calculation
  2337. usLinkStatusZeroTime:Memory access latency required for watermark calculation, set this to 0x0 for K8 CPU, set a proper value in 0.01 the unit of us
  2338. for Griffin or Greyhound. SBIOS needs to convert to actual time by:
  2339. if T0Ttime [5:4]=00b, then usLinkStatusZeroTime=T0Ttime [3:0]*0.1us (0.0 to 1.5us)
  2340. if T0Ttime [5:4]=01b, then usLinkStatusZeroTime=T0Ttime [3:0]*0.5us (0.0 to 7.5us)
  2341. if T0Ttime [5:4]=10b, then usLinkStatusZeroTime=T0Ttime [3:0]*2.0us (0.0 to 30us)
  2342. if T0Ttime [5:4]=11b, and T0Ttime [3:0]=0x0 to 0xa, then usLinkStatusZeroTime=T0Ttime [3:0]*20us (0.0 to 200us)
  2343. ulHighVoltageHTLinkFreq: HT link frequency for power state with low voltage. If boot up runs in HT1, this must be 0.
  2344. This must be less than or equal to ulHTLinkFreq(bootup frequency).
  2345. ulLowVoltageHTLinkFreq: HT link frequency for power state with low voltage or voltage scaling 1.0v~1.1v. If boot up runs in HT1, this must be 0.
  2346. This must be less than or equal to ulHighVoltageHTLinkFreq.
  2347. usMaxUpStreamHTLinkWidth: Asymmetric link width support in the future, to replace usMaxHTLinkWidth. Not used for now.
  2348. usMaxDownStreamHTLinkWidth: same as above.
  2349. usMinUpStreamHTLinkWidth: Asymmetric link width support in the future, to replace usMinHTLinkWidth. Not used for now.
  2350. usMinDownStreamHTLinkWidth: same as above.
  2351. */
  2352. // ATOM_INTEGRATED_SYSTEM_INFO::ulCPUCapInfo - CPU type definition
  2353. #define INTEGRATED_SYSTEM_INFO__UNKNOWN_CPU 0
  2354. #define INTEGRATED_SYSTEM_INFO__AMD_CPU__GRIFFIN 1
  2355. #define INTEGRATED_SYSTEM_INFO__AMD_CPU__GREYHOUND 2
  2356. #define INTEGRATED_SYSTEM_INFO__AMD_CPU__K8 3
  2357. #define INTEGRATED_SYSTEM_INFO__AMD_CPU__PHARAOH 4
  2358. #define INTEGRATED_SYSTEM_INFO__AMD_CPU__MAX_CODE INTEGRATED_SYSTEM_INFO__AMD_CPU__PHARAOH // this deff reflects max defined CPU code
  2359. #define SYSTEM_CONFIG_POWEREXPRESS_ENABLE 0x00000001
  2360. #define SYSTEM_CONFIG_RUN_AT_OVERDRIVE_ENGINE 0x00000002
  2361. #define SYSTEM_CONFIG_USE_PWM_ON_VOLTAGE 0x00000004
  2362. #define SYSTEM_CONFIG_PERFORMANCE_POWERSTATE_ONLY 0x00000008
  2363. #define SYSTEM_CONFIG_CLMC_ENABLED 0x00000010
  2364. #define SYSTEM_CONFIG_CDLW_ENABLED 0x00000020
  2365. #define SYSTEM_CONFIG_HIGH_VOLTAGE_REQUESTED 0x00000040
  2366. #define SYSTEM_CONFIG_CLMC_HYBRID_MODE_ENABLED 0x00000080
  2367. #define SYSTEM_CONFIG_CDLF_ENABLED 0x00000100
  2368. #define SYSTEM_CONFIG_DLL_SHUTDOWN_ENABLED 0x00000200
  2369. #define IGP_DDI_SLOT_LANE_CONFIG_MASK 0x000000FF
  2370. #define b0IGP_DDI_SLOT_LANE_MAP_MASK 0x0F
  2371. #define b0IGP_DDI_SLOT_DOCKING_LANE_MAP_MASK 0xF0
  2372. #define b0IGP_DDI_SLOT_CONFIG_LANE_0_3 0x01
  2373. #define b0IGP_DDI_SLOT_CONFIG_LANE_4_7 0x02
  2374. #define b0IGP_DDI_SLOT_CONFIG_LANE_8_11 0x04
  2375. #define b0IGP_DDI_SLOT_CONFIG_LANE_12_15 0x08
  2376. #define IGP_DDI_SLOT_ATTRIBUTE_MASK 0x0000FF00
  2377. #define IGP_DDI_SLOT_CONFIG_REVERSED 0x00000100
  2378. #define b1IGP_DDI_SLOT_CONFIG_REVERSED 0x01
  2379. #define IGP_DDI_SLOT_CONNECTOR_TYPE_MASK 0x00FF0000
  2380. // IntegratedSystemInfoTable new Rev is V5 after V2, because of the real rev of V2 is v1.4. This rev is used for RR
  2381. typedef struct _ATOM_INTEGRATED_SYSTEM_INFO_V5
  2382. {
  2383. ATOM_COMMON_TABLE_HEADER sHeader;
  2384. ULONG ulBootUpEngineClock; //in 10kHz unit
  2385. ULONG ulDentistVCOFreq; //Dentist VCO clock in 10kHz unit, the source of GPU SCLK, LCLK, UCLK and VCLK.
  2386. ULONG ulLClockFreq; //GPU Lclk freq in 10kHz unit, have relationship with NCLK in NorthBridge
  2387. ULONG ulBootUpUMAClock; //in 10kHz unit
  2388. ULONG ulReserved1[8]; //must be 0x0 for the reserved
  2389. ULONG ulBootUpReqDisplayVector;
  2390. ULONG ulOtherDisplayMisc;
  2391. ULONG ulReserved2[4]; //must be 0x0 for the reserved
  2392. ULONG ulSystemConfig; //TBD
  2393. ULONG ulCPUCapInfo; //TBD
  2394. USHORT usMaxNBVoltage; //high NB voltage, calculated using current VDDNB (D24F2xDC) and VDDNB offset fuse;
  2395. USHORT usMinNBVoltage; //low NB voltage, calculated using current VDDNB (D24F2xDC) and VDDNB offset fuse;
  2396. USHORT usBootUpNBVoltage; //boot up NB voltage
  2397. UCHAR ucHtcTmpLmt; //bit [22:16] of D24F3x64 Hardware Thermal Control (HTC) Register, may not be needed, TBD
  2398. UCHAR ucTjOffset; //bit [28:22] of D24F3xE4 Thermtrip Status Register,may not be needed, TBD
  2399. ULONG ulReserved3[4]; //must be 0x0 for the reserved
  2400. ULONG ulDDISlot1Config; //see above ulDDISlot1Config definition
  2401. ULONG ulDDISlot2Config;
  2402. ULONG ulDDISlot3Config;
  2403. ULONG ulDDISlot4Config;
  2404. ULONG ulReserved4[4]; //must be 0x0 for the reserved
  2405. UCHAR ucMemoryType; //[3:0]=1:DDR1;=2:DDR2;=3:DDR3.[7:4] is reserved
  2406. UCHAR ucUMAChannelNumber;
  2407. USHORT usReserved;
  2408. ULONG ulReserved5[4]; //must be 0x0 for the reserved
  2409. ULONG ulCSR_M3_ARB_CNTL_DEFAULT[10];//arrays with values for CSR M3 arbiter for default
  2410. ULONG ulCSR_M3_ARB_CNTL_UVD[10]; //arrays with values for CSR M3 arbiter for UVD playback
  2411. ULONG ulCSR_M3_ARB_CNTL_FS3D[10];//arrays with values for CSR M3 arbiter for Full Screen 3D applications
  2412. ULONG ulReserved6[61]; //must be 0x0
  2413. }ATOM_INTEGRATED_SYSTEM_INFO_V5;
  2414. #define ATOM_CRT_INT_ENCODER1_INDEX 0x00000000
  2415. #define ATOM_LCD_INT_ENCODER1_INDEX 0x00000001
  2416. #define ATOM_TV_INT_ENCODER1_INDEX 0x00000002
  2417. #define ATOM_DFP_INT_ENCODER1_INDEX 0x00000003
  2418. #define ATOM_CRT_INT_ENCODER2_INDEX 0x00000004
  2419. #define ATOM_LCD_EXT_ENCODER1_INDEX 0x00000005
  2420. #define ATOM_TV_EXT_ENCODER1_INDEX 0x00000006
  2421. #define ATOM_DFP_EXT_ENCODER1_INDEX 0x00000007
  2422. #define ATOM_CV_INT_ENCODER1_INDEX 0x00000008
  2423. #define ATOM_DFP_INT_ENCODER2_INDEX 0x00000009
  2424. #define ATOM_CRT_EXT_ENCODER1_INDEX 0x0000000A
  2425. #define ATOM_CV_EXT_ENCODER1_INDEX 0x0000000B
  2426. #define ATOM_DFP_INT_ENCODER3_INDEX 0x0000000C
  2427. #define ATOM_DFP_INT_ENCODER4_INDEX 0x0000000D
  2428. // define ASIC internal encoder id ( bit vector ), used for CRTC_SourceSelTable
  2429. #define ASIC_INT_DAC1_ENCODER_ID 0x00
  2430. #define ASIC_INT_TV_ENCODER_ID 0x02
  2431. #define ASIC_INT_DIG1_ENCODER_ID 0x03
  2432. #define ASIC_INT_DAC2_ENCODER_ID 0x04
  2433. #define ASIC_EXT_TV_ENCODER_ID 0x06
  2434. #define ASIC_INT_DVO_ENCODER_ID 0x07
  2435. #define ASIC_INT_DIG2_ENCODER_ID 0x09
  2436. #define ASIC_EXT_DIG_ENCODER_ID 0x05
  2437. #define ASIC_EXT_DIG2_ENCODER_ID 0x08
  2438. #define ASIC_INT_DIG3_ENCODER_ID 0x0a
  2439. #define ASIC_INT_DIG4_ENCODER_ID 0x0b
  2440. #define ASIC_INT_DIG5_ENCODER_ID 0x0c
  2441. #define ASIC_INT_DIG6_ENCODER_ID 0x0d
  2442. //define Encoder attribute
  2443. #define ATOM_ANALOG_ENCODER 0
  2444. #define ATOM_DIGITAL_ENCODER 1
  2445. #define ATOM_DP_ENCODER 2
  2446. #define ATOM_ENCODER_ENUM_MASK 0x70
  2447. #define ATOM_ENCODER_ENUM_ID1 0x00
  2448. #define ATOM_ENCODER_ENUM_ID2 0x10
  2449. #define ATOM_ENCODER_ENUM_ID3 0x20
  2450. #define ATOM_ENCODER_ENUM_ID4 0x30
  2451. #define ATOM_ENCODER_ENUM_ID5 0x40
  2452. #define ATOM_ENCODER_ENUM_ID6 0x50
  2453. #define ATOM_DEVICE_CRT1_INDEX 0x00000000
  2454. #define ATOM_DEVICE_LCD1_INDEX 0x00000001
  2455. #define ATOM_DEVICE_TV1_INDEX 0x00000002
  2456. #define ATOM_DEVICE_DFP1_INDEX 0x00000003
  2457. #define ATOM_DEVICE_CRT2_INDEX 0x00000004
  2458. #define ATOM_DEVICE_LCD2_INDEX 0x00000005
  2459. #define ATOM_DEVICE_DFP6_INDEX 0x00000006
  2460. #define ATOM_DEVICE_DFP2_INDEX 0x00000007
  2461. #define ATOM_DEVICE_CV_INDEX 0x00000008
  2462. #define ATOM_DEVICE_DFP3_INDEX 0x00000009
  2463. #define ATOM_DEVICE_DFP4_INDEX 0x0000000A
  2464. #define ATOM_DEVICE_DFP5_INDEX 0x0000000B
  2465. #define ATOM_DEVICE_RESERVEDC_INDEX 0x0000000C
  2466. #define ATOM_DEVICE_RESERVEDD_INDEX 0x0000000D
  2467. #define ATOM_DEVICE_RESERVEDE_INDEX 0x0000000E
  2468. #define ATOM_DEVICE_RESERVEDF_INDEX 0x0000000F
  2469. #define ATOM_MAX_SUPPORTED_DEVICE_INFO (ATOM_DEVICE_DFP3_INDEX+1)
  2470. #define ATOM_MAX_SUPPORTED_DEVICE_INFO_2 ATOM_MAX_SUPPORTED_DEVICE_INFO
  2471. #define ATOM_MAX_SUPPORTED_DEVICE_INFO_3 (ATOM_DEVICE_DFP5_INDEX + 1 )
  2472. #define ATOM_MAX_SUPPORTED_DEVICE (ATOM_DEVICE_RESERVEDF_INDEX+1)
  2473. #define ATOM_DEVICE_CRT1_SUPPORT (0x1L << ATOM_DEVICE_CRT1_INDEX )
  2474. #define ATOM_DEVICE_LCD1_SUPPORT (0x1L << ATOM_DEVICE_LCD1_INDEX )
  2475. #define ATOM_DEVICE_TV1_SUPPORT (0x1L << ATOM_DEVICE_TV1_INDEX )
  2476. #define ATOM_DEVICE_DFP1_SUPPORT (0x1L << ATOM_DEVICE_DFP1_INDEX )
  2477. #define ATOM_DEVICE_CRT2_SUPPORT (0x1L << ATOM_DEVICE_CRT2_INDEX )
  2478. #define ATOM_DEVICE_LCD2_SUPPORT (0x1L << ATOM_DEVICE_LCD2_INDEX )
  2479. #define ATOM_DEVICE_DFP6_SUPPORT (0x1L << ATOM_DEVICE_DFP6_INDEX )
  2480. #define ATOM_DEVICE_DFP2_SUPPORT (0x1L << ATOM_DEVICE_DFP2_INDEX )
  2481. #define ATOM_DEVICE_CV_SUPPORT (0x1L << ATOM_DEVICE_CV_INDEX )
  2482. #define ATOM_DEVICE_DFP3_SUPPORT (0x1L << ATOM_DEVICE_DFP3_INDEX )
  2483. #define ATOM_DEVICE_DFP4_SUPPORT (0x1L << ATOM_DEVICE_DFP4_INDEX )
  2484. #define ATOM_DEVICE_DFP5_SUPPORT (0x1L << ATOM_DEVICE_DFP5_INDEX )
  2485. #define ATOM_DEVICE_CRT_SUPPORT (ATOM_DEVICE_CRT1_SUPPORT | ATOM_DEVICE_CRT2_SUPPORT)
  2486. #define ATOM_DEVICE_DFP_SUPPORT (ATOM_DEVICE_DFP1_SUPPORT | ATOM_DEVICE_DFP2_SUPPORT | ATOM_DEVICE_DFP3_SUPPORT | ATOM_DEVICE_DFP4_SUPPORT | ATOM_DEVICE_DFP5_SUPPORT | ATOM_DEVICE_DFP6_SUPPORT)
  2487. #define ATOM_DEVICE_TV_SUPPORT (ATOM_DEVICE_TV1_SUPPORT)
  2488. #define ATOM_DEVICE_LCD_SUPPORT (ATOM_DEVICE_LCD1_SUPPORT | ATOM_DEVICE_LCD2_SUPPORT)
  2489. #define ATOM_DEVICE_CONNECTOR_TYPE_MASK 0x000000F0
  2490. #define ATOM_DEVICE_CONNECTOR_TYPE_SHIFT 0x00000004
  2491. #define ATOM_DEVICE_CONNECTOR_VGA 0x00000001
  2492. #define ATOM_DEVICE_CONNECTOR_DVI_I 0x00000002
  2493. #define ATOM_DEVICE_CONNECTOR_DVI_D 0x00000003
  2494. #define ATOM_DEVICE_CONNECTOR_DVI_A 0x00000004
  2495. #define ATOM_DEVICE_CONNECTOR_SVIDEO 0x00000005
  2496. #define ATOM_DEVICE_CONNECTOR_COMPOSITE 0x00000006
  2497. #define ATOM_DEVICE_CONNECTOR_LVDS 0x00000007
  2498. #define ATOM_DEVICE_CONNECTOR_DIGI_LINK 0x00000008
  2499. #define ATOM_DEVICE_CONNECTOR_SCART 0x00000009
  2500. #define ATOM_DEVICE_CONNECTOR_HDMI_TYPE_A 0x0000000A
  2501. #define ATOM_DEVICE_CONNECTOR_HDMI_TYPE_B 0x0000000B
  2502. #define ATOM_DEVICE_CONNECTOR_CASE_1 0x0000000E
  2503. #define ATOM_DEVICE_CONNECTOR_DISPLAYPORT 0x0000000F
  2504. #define ATOM_DEVICE_DAC_INFO_MASK 0x0000000F
  2505. #define ATOM_DEVICE_DAC_INFO_SHIFT 0x00000000
  2506. #define ATOM_DEVICE_DAC_INFO_NODAC 0x00000000
  2507. #define ATOM_DEVICE_DAC_INFO_DACA 0x00000001
  2508. #define ATOM_DEVICE_DAC_INFO_DACB 0x00000002
  2509. #define ATOM_DEVICE_DAC_INFO_EXDAC 0x00000003
  2510. #define ATOM_DEVICE_I2C_ID_NOI2C 0x00000000
  2511. #define ATOM_DEVICE_I2C_LINEMUX_MASK 0x0000000F
  2512. #define ATOM_DEVICE_I2C_LINEMUX_SHIFT 0x00000000
  2513. #define ATOM_DEVICE_I2C_ID_MASK 0x00000070
  2514. #define ATOM_DEVICE_I2C_ID_SHIFT 0x00000004
  2515. #define ATOM_DEVICE_I2C_ID_IS_FOR_NON_MM_USE 0x00000001
  2516. #define ATOM_DEVICE_I2C_ID_IS_FOR_MM_USE 0x00000002
  2517. #define ATOM_DEVICE_I2C_ID_IS_FOR_SDVO_USE 0x00000003 //For IGP RS600
  2518. #define ATOM_DEVICE_I2C_ID_IS_FOR_DAC_SCL 0x00000004 //For IGP RS690
  2519. #define ATOM_DEVICE_I2C_HARDWARE_CAP_MASK 0x00000080
  2520. #define ATOM_DEVICE_I2C_HARDWARE_CAP_SHIFT 0x00000007
  2521. #define ATOM_DEVICE_USES_SOFTWARE_ASSISTED_I2C 0x00000000
  2522. #define ATOM_DEVICE_USES_HARDWARE_ASSISTED_I2C 0x00000001
  2523. // usDeviceSupport:
  2524. // Bits0 = 0 - no CRT1 support= 1- CRT1 is supported
  2525. // Bit 1 = 0 - no LCD1 support= 1- LCD1 is supported
  2526. // Bit 2 = 0 - no TV1 support= 1- TV1 is supported
  2527. // Bit 3 = 0 - no DFP1 support= 1- DFP1 is supported
  2528. // Bit 4 = 0 - no CRT2 support= 1- CRT2 is supported
  2529. // Bit 5 = 0 - no LCD2 support= 1- LCD2 is supported
  2530. // Bit 6 = 0 - no DFP6 support= 1- DFP6 is supported
  2531. // Bit 7 = 0 - no DFP2 support= 1- DFP2 is supported
  2532. // Bit 8 = 0 - no CV support= 1- CV is supported
  2533. // Bit 9 = 0 - no DFP3 support= 1- DFP3 is supported
  2534. // Bit 10 = 0 - no DFP4 support= 1- DFP4 is supported
  2535. // Bit 11 = 0 - no DFP5 support= 1- DFP5 is supported
  2536. //
  2537. //
  2538. /****************************************************************************/
  2539. /* Structure used in MclkSS_InfoTable */
  2540. /****************************************************************************/
  2541. // ucI2C_ConfigID
  2542. // [7:0] - I2C LINE Associate ID
  2543. // = 0 - no I2C
  2544. // [7] - HW_Cap = 1, [6:0]=HW assisted I2C ID(HW line selection)
  2545. // = 0, [6:0]=SW assisted I2C ID
  2546. // [6-4] - HW_ENGINE_ID = 1, HW engine for NON multimedia use
  2547. // = 2, HW engine for Multimedia use
  2548. // = 3-7 Reserved for future I2C engines
  2549. // [3-0] - I2C_LINE_MUX = A Mux number when it's HW assisted I2C or GPIO ID when it's SW I2C
  2550. typedef struct _ATOM_I2C_ID_CONFIG
  2551. {
  2552. #if ATOM_BIG_ENDIAN
  2553. UCHAR bfHW_Capable:1;
  2554. UCHAR bfHW_EngineID:3;
  2555. UCHAR bfI2C_LineMux:4;
  2556. #else
  2557. UCHAR bfI2C_LineMux:4;
  2558. UCHAR bfHW_EngineID:3;
  2559. UCHAR bfHW_Capable:1;
  2560. #endif
  2561. }ATOM_I2C_ID_CONFIG;
  2562. typedef union _ATOM_I2C_ID_CONFIG_ACCESS
  2563. {
  2564. ATOM_I2C_ID_CONFIG sbfAccess;
  2565. UCHAR ucAccess;
  2566. }ATOM_I2C_ID_CONFIG_ACCESS;
  2567. /****************************************************************************/
  2568. // Structure used in GPIO_I2C_InfoTable
  2569. /****************************************************************************/
  2570. typedef struct _ATOM_GPIO_I2C_ASSIGMENT
  2571. {
  2572. USHORT usClkMaskRegisterIndex;
  2573. USHORT usClkEnRegisterIndex;
  2574. USHORT usClkY_RegisterIndex;
  2575. USHORT usClkA_RegisterIndex;
  2576. USHORT usDataMaskRegisterIndex;
  2577. USHORT usDataEnRegisterIndex;
  2578. USHORT usDataY_RegisterIndex;
  2579. USHORT usDataA_RegisterIndex;
  2580. ATOM_I2C_ID_CONFIG_ACCESS sucI2cId;
  2581. UCHAR ucClkMaskShift;
  2582. UCHAR ucClkEnShift;
  2583. UCHAR ucClkY_Shift;
  2584. UCHAR ucClkA_Shift;
  2585. UCHAR ucDataMaskShift;
  2586. UCHAR ucDataEnShift;
  2587. UCHAR ucDataY_Shift;
  2588. UCHAR ucDataA_Shift;
  2589. UCHAR ucReserved1;
  2590. UCHAR ucReserved2;
  2591. }ATOM_GPIO_I2C_ASSIGMENT;
  2592. typedef struct _ATOM_GPIO_I2C_INFO
  2593. {
  2594. ATOM_COMMON_TABLE_HEADER sHeader;
  2595. ATOM_GPIO_I2C_ASSIGMENT asGPIO_Info[ATOM_MAX_SUPPORTED_DEVICE];
  2596. }ATOM_GPIO_I2C_INFO;
  2597. /****************************************************************************/
  2598. // Common Structure used in other structures
  2599. /****************************************************************************/
  2600. #ifndef _H2INC
  2601. //Please don't add or expand this bitfield structure below, this one will retire soon.!
  2602. typedef struct _ATOM_MODE_MISC_INFO
  2603. {
  2604. #if ATOM_BIG_ENDIAN
  2605. USHORT Reserved:6;
  2606. USHORT RGB888:1;
  2607. USHORT DoubleClock:1;
  2608. USHORT Interlace:1;
  2609. USHORT CompositeSync:1;
  2610. USHORT V_ReplicationBy2:1;
  2611. USHORT H_ReplicationBy2:1;
  2612. USHORT VerticalCutOff:1;
  2613. USHORT VSyncPolarity:1; //0=Active High, 1=Active Low
  2614. USHORT HSyncPolarity:1; //0=Active High, 1=Active Low
  2615. USHORT HorizontalCutOff:1;
  2616. #else
  2617. USHORT HorizontalCutOff:1;
  2618. USHORT HSyncPolarity:1; //0=Active High, 1=Active Low
  2619. USHORT VSyncPolarity:1; //0=Active High, 1=Active Low
  2620. USHORT VerticalCutOff:1;
  2621. USHORT H_ReplicationBy2:1;
  2622. USHORT V_ReplicationBy2:1;
  2623. USHORT CompositeSync:1;
  2624. USHORT Interlace:1;
  2625. USHORT DoubleClock:1;
  2626. USHORT RGB888:1;
  2627. USHORT Reserved:6;
  2628. #endif
  2629. }ATOM_MODE_MISC_INFO;
  2630. typedef union _ATOM_MODE_MISC_INFO_ACCESS
  2631. {
  2632. ATOM_MODE_MISC_INFO sbfAccess;
  2633. USHORT usAccess;
  2634. }ATOM_MODE_MISC_INFO_ACCESS;
  2635. #else
  2636. typedef union _ATOM_MODE_MISC_INFO_ACCESS
  2637. {
  2638. USHORT usAccess;
  2639. }ATOM_MODE_MISC_INFO_ACCESS;
  2640. #endif
  2641. // usModeMiscInfo-
  2642. #define ATOM_H_CUTOFF 0x01
  2643. #define ATOM_HSYNC_POLARITY 0x02 //0=Active High, 1=Active Low
  2644. #define ATOM_VSYNC_POLARITY 0x04 //0=Active High, 1=Active Low
  2645. #define ATOM_V_CUTOFF 0x08
  2646. #define ATOM_H_REPLICATIONBY2 0x10
  2647. #define ATOM_V_REPLICATIONBY2 0x20
  2648. #define ATOM_COMPOSITESYNC 0x40
  2649. #define ATOM_INTERLACE 0x80
  2650. #define ATOM_DOUBLE_CLOCK_MODE 0x100
  2651. #define ATOM_RGB888_MODE 0x200
  2652. //usRefreshRate-
  2653. #define ATOM_REFRESH_43 43
  2654. #define ATOM_REFRESH_47 47
  2655. #define ATOM_REFRESH_56 56
  2656. #define ATOM_REFRESH_60 60
  2657. #define ATOM_REFRESH_65 65
  2658. #define ATOM_REFRESH_70 70
  2659. #define ATOM_REFRESH_72 72
  2660. #define ATOM_REFRESH_75 75
  2661. #define ATOM_REFRESH_85 85
  2662. // ATOM_MODE_TIMING data are exactly the same as VESA timing data.
  2663. // Translation from EDID to ATOM_MODE_TIMING, use the following formula.
  2664. //
  2665. // VESA_HTOTAL = VESA_ACTIVE + 2* VESA_BORDER + VESA_BLANK
  2666. // = EDID_HA + EDID_HBL
  2667. // VESA_HDISP = VESA_ACTIVE = EDID_HA
  2668. // VESA_HSYNC_START = VESA_ACTIVE + VESA_BORDER + VESA_FRONT_PORCH
  2669. // = EDID_HA + EDID_HSO
  2670. // VESA_HSYNC_WIDTH = VESA_HSYNC_TIME = EDID_HSPW
  2671. // VESA_BORDER = EDID_BORDER
  2672. /****************************************************************************/
  2673. // Structure used in SetCRTC_UsingDTDTimingTable
  2674. /****************************************************************************/
  2675. typedef struct _SET_CRTC_USING_DTD_TIMING_PARAMETERS
  2676. {
  2677. USHORT usH_Size;
  2678. USHORT usH_Blanking_Time;
  2679. USHORT usV_Size;
  2680. USHORT usV_Blanking_Time;
  2681. USHORT usH_SyncOffset;
  2682. USHORT usH_SyncWidth;
  2683. USHORT usV_SyncOffset;
  2684. USHORT usV_SyncWidth;
  2685. ATOM_MODE_MISC_INFO_ACCESS susModeMiscInfo;
  2686. UCHAR ucH_Border; // From DFP EDID
  2687. UCHAR ucV_Border;
  2688. UCHAR ucCRTC; // ATOM_CRTC1 or ATOM_CRTC2
  2689. UCHAR ucPadding[3];
  2690. }SET_CRTC_USING_DTD_TIMING_PARAMETERS;
  2691. /****************************************************************************/
  2692. // Structure used in SetCRTC_TimingTable
  2693. /****************************************************************************/
  2694. typedef struct _SET_CRTC_TIMING_PARAMETERS
  2695. {
  2696. USHORT usH_Total; // horizontal total
  2697. USHORT usH_Disp; // horizontal display
  2698. USHORT usH_SyncStart; // horozontal Sync start
  2699. USHORT usH_SyncWidth; // horizontal Sync width
  2700. USHORT usV_Total; // vertical total
  2701. USHORT usV_Disp; // vertical display
  2702. USHORT usV_SyncStart; // vertical Sync start
  2703. USHORT usV_SyncWidth; // vertical Sync width
  2704. ATOM_MODE_MISC_INFO_ACCESS susModeMiscInfo;
  2705. UCHAR ucCRTC; // ATOM_CRTC1 or ATOM_CRTC2
  2706. UCHAR ucOverscanRight; // right
  2707. UCHAR ucOverscanLeft; // left
  2708. UCHAR ucOverscanBottom; // bottom
  2709. UCHAR ucOverscanTop; // top
  2710. UCHAR ucReserved;
  2711. }SET_CRTC_TIMING_PARAMETERS;
  2712. #define SET_CRTC_TIMING_PARAMETERS_PS_ALLOCATION SET_CRTC_TIMING_PARAMETERS
  2713. /****************************************************************************/
  2714. // Structure used in StandardVESA_TimingTable
  2715. // AnalogTV_InfoTable
  2716. // ComponentVideoInfoTable
  2717. /****************************************************************************/
  2718. typedef struct _ATOM_MODE_TIMING
  2719. {
  2720. USHORT usCRTC_H_Total;
  2721. USHORT usCRTC_H_Disp;
  2722. USHORT usCRTC_H_SyncStart;
  2723. USHORT usCRTC_H_SyncWidth;
  2724. USHORT usCRTC_V_Total;
  2725. USHORT usCRTC_V_Disp;
  2726. USHORT usCRTC_V_SyncStart;
  2727. USHORT usCRTC_V_SyncWidth;
  2728. USHORT usPixelClock; //in 10Khz unit
  2729. ATOM_MODE_MISC_INFO_ACCESS susModeMiscInfo;
  2730. USHORT usCRTC_OverscanRight;
  2731. USHORT usCRTC_OverscanLeft;
  2732. USHORT usCRTC_OverscanBottom;
  2733. USHORT usCRTC_OverscanTop;
  2734. USHORT usReserve;
  2735. UCHAR ucInternalModeNumber;
  2736. UCHAR ucRefreshRate;
  2737. }ATOM_MODE_TIMING;
  2738. typedef struct _ATOM_DTD_FORMAT
  2739. {
  2740. USHORT usPixClk;
  2741. USHORT usHActive;
  2742. USHORT usHBlanking_Time;
  2743. USHORT usVActive;
  2744. USHORT usVBlanking_Time;
  2745. USHORT usHSyncOffset;
  2746. USHORT usHSyncWidth;
  2747. USHORT usVSyncOffset;
  2748. USHORT usVSyncWidth;
  2749. USHORT usImageHSize;
  2750. USHORT usImageVSize;
  2751. UCHAR ucHBorder;
  2752. UCHAR ucVBorder;
  2753. ATOM_MODE_MISC_INFO_ACCESS susModeMiscInfo;
  2754. UCHAR ucInternalModeNumber;
  2755. UCHAR ucRefreshRate;
  2756. }ATOM_DTD_FORMAT;
  2757. /****************************************************************************/
  2758. // Structure used in LVDS_InfoTable
  2759. // * Need a document to describe this table
  2760. /****************************************************************************/
  2761. #define SUPPORTED_LCD_REFRESHRATE_30Hz 0x0004
  2762. #define SUPPORTED_LCD_REFRESHRATE_40Hz 0x0008
  2763. #define SUPPORTED_LCD_REFRESHRATE_50Hz 0x0010
  2764. #define SUPPORTED_LCD_REFRESHRATE_60Hz 0x0020
  2765. //ucTableFormatRevision=1
  2766. //ucTableContentRevision=1
  2767. typedef struct _ATOM_LVDS_INFO
  2768. {
  2769. ATOM_COMMON_TABLE_HEADER sHeader;
  2770. ATOM_DTD_FORMAT sLCDTiming;
  2771. USHORT usModePatchTableOffset;
  2772. USHORT usSupportedRefreshRate; //Refer to panel info table in ATOMBIOS extension Spec.
  2773. USHORT usOffDelayInMs;
  2774. UCHAR ucPowerSequenceDigOntoDEin10Ms;
  2775. UCHAR ucPowerSequenceDEtoBLOnin10Ms;
  2776. UCHAR ucLVDS_Misc; // Bit0:{=0:single, =1:dual},Bit1 {=0:666RGB, =1:888RGB},Bit2:3:{Grey level}
  2777. // Bit4:{=0:LDI format for RGB888, =1 FPDI format for RGB888}
  2778. // Bit5:{=0:Spatial Dithering disabled;1 Spatial Dithering enabled}
  2779. // Bit6:{=0:Temporal Dithering disabled;1 Temporal Dithering enabled}
  2780. UCHAR ucPanelDefaultRefreshRate;
  2781. UCHAR ucPanelIdentification;
  2782. UCHAR ucSS_Id;
  2783. }ATOM_LVDS_INFO;
  2784. //ucTableFormatRevision=1
  2785. //ucTableContentRevision=2
  2786. typedef struct _ATOM_LVDS_INFO_V12
  2787. {
  2788. ATOM_COMMON_TABLE_HEADER sHeader;
  2789. ATOM_DTD_FORMAT sLCDTiming;
  2790. USHORT usExtInfoTableOffset;
  2791. USHORT usSupportedRefreshRate; //Refer to panel info table in ATOMBIOS extension Spec.
  2792. USHORT usOffDelayInMs;
  2793. UCHAR ucPowerSequenceDigOntoDEin10Ms;
  2794. UCHAR ucPowerSequenceDEtoBLOnin10Ms;
  2795. UCHAR ucLVDS_Misc; // Bit0:{=0:single, =1:dual},Bit1 {=0:666RGB, =1:888RGB},Bit2:3:{Grey level}
  2796. // Bit4:{=0:LDI format for RGB888, =1 FPDI format for RGB888}
  2797. // Bit5:{=0:Spatial Dithering disabled;1 Spatial Dithering enabled}
  2798. // Bit6:{=0:Temporal Dithering disabled;1 Temporal Dithering enabled}
  2799. UCHAR ucPanelDefaultRefreshRate;
  2800. UCHAR ucPanelIdentification;
  2801. UCHAR ucSS_Id;
  2802. USHORT usLCDVenderID;
  2803. USHORT usLCDProductID;
  2804. UCHAR ucLCDPanel_SpecialHandlingCap;
  2805. UCHAR ucPanelInfoSize; // start from ATOM_DTD_FORMAT to end of panel info, include ExtInfoTable
  2806. UCHAR ucReserved[2];
  2807. }ATOM_LVDS_INFO_V12;
  2808. //Definitions for ucLCDPanel_SpecialHandlingCap:
  2809. //Once DAL sees this CAP is set, it will read EDID from LCD on its own instead of using sLCDTiming in ATOM_LVDS_INFO_V12.
  2810. //Other entries in ATOM_LVDS_INFO_V12 are still valid/useful to DAL
  2811. #define LCDPANEL_CAP_READ_EDID 0x1
  2812. //If a design supports DRR (dynamic refresh rate) on internal panels (LVDS or EDP), this cap is set in ucLCDPanel_SpecialHandlingCap together
  2813. //with multiple supported refresh rates@usSupportedRefreshRate. This cap should not be set when only slow refresh rate is supported (static
  2814. //refresh rate switch by SW. This is only valid from ATOM_LVDS_INFO_V12
  2815. #define LCDPANEL_CAP_DRR_SUPPORTED 0x2
  2816. //Use this cap bit for a quick reference whether an embadded panel (LCD1 ) is LVDS or eDP.
  2817. #define LCDPANEL_CAP_eDP 0x4
  2818. //Color Bit Depth definition in EDID V1.4 @BYTE 14h
  2819. //Bit 6 5 4
  2820. // 0 0 0 - Color bit depth is undefined
  2821. // 0 0 1 - 6 Bits per Primary Color
  2822. // 0 1 0 - 8 Bits per Primary Color
  2823. // 0 1 1 - 10 Bits per Primary Color
  2824. // 1 0 0 - 12 Bits per Primary Color
  2825. // 1 0 1 - 14 Bits per Primary Color
  2826. // 1 1 0 - 16 Bits per Primary Color
  2827. // 1 1 1 - Reserved
  2828. #define PANEL_COLOR_BIT_DEPTH_MASK 0x70
  2829. // Bit7:{=0:Random Dithering disabled;1 Random Dithering enabled}
  2830. #define PANEL_RANDOM_DITHER 0x80
  2831. #define PANEL_RANDOM_DITHER_MASK 0x80
  2832. #define ATOM_LVDS_INFO_LAST ATOM_LVDS_INFO_V12 // no need to change this
  2833. /****************************************************************************/
  2834. // Structures used by LCD_InfoTable V1.3 Note: previous version was called ATOM_LVDS_INFO_V12
  2835. // ASIC Families: NI
  2836. // ucTableFormatRevision=1
  2837. // ucTableContentRevision=3
  2838. /****************************************************************************/
  2839. typedef struct _ATOM_LCD_INFO_V13
  2840. {
  2841. ATOM_COMMON_TABLE_HEADER sHeader;
  2842. ATOM_DTD_FORMAT sLCDTiming;
  2843. USHORT usExtInfoTableOffset;
  2844. USHORT usSupportedRefreshRate; //Refer to panel info table in ATOMBIOS extension Spec.
  2845. ULONG ulReserved0;
  2846. UCHAR ucLCD_Misc; // Reorganized in V13
  2847. // Bit0: {=0:single, =1:dual},
  2848. // Bit1: {=0:LDI format for RGB888, =1 FPDI format for RGB888} // was {=0:666RGB, =1:888RGB},
  2849. // Bit3:2: {Grey level}
  2850. // Bit6:4 Color Bit Depth definition (see below definition in EDID V1.4 @BYTE 14h)
  2851. // Bit7 Reserved. was for ATOM_PANEL_MISC_API_ENABLED, still need it?
  2852. UCHAR ucPanelDefaultRefreshRate;
  2853. UCHAR ucPanelIdentification;
  2854. UCHAR ucSS_Id;
  2855. USHORT usLCDVenderID;
  2856. USHORT usLCDProductID;
  2857. UCHAR ucLCDPanel_SpecialHandlingCap; // Reorganized in V13
  2858. // Bit0: Once DAL sees this CAP is set, it will read EDID from LCD on its own
  2859. // Bit1: See LCDPANEL_CAP_DRR_SUPPORTED
  2860. // Bit2: a quick reference whether an embadded panel (LCD1 ) is LVDS (0) or eDP (1)
  2861. // Bit7-3: Reserved
  2862. UCHAR ucPanelInfoSize; // start from ATOM_DTD_FORMAT to end of panel info, include ExtInfoTable
  2863. USHORT usBacklightPWM; // Backlight PWM in Hz. New in _V13
  2864. UCHAR ucPowerSequenceDIGONtoDE_in4Ms;
  2865. UCHAR ucPowerSequenceDEtoVARY_BL_in4Ms;
  2866. UCHAR ucPowerSequenceDEtoDIGON_in4Ms;
  2867. UCHAR ucPowerSequenceVARY_BLtoDE_in4Ms;
  2868. UCHAR ucOffDelay_in4Ms;
  2869. UCHAR ucPowerSequenceVARY_BLtoBLON_in4Ms;
  2870. UCHAR ucPowerSequenceBLONtoVARY_BL_in4Ms;
  2871. UCHAR ucReserved1;
  2872. ULONG ulReserved[4];
  2873. }ATOM_LCD_INFO_V13;
  2874. #define ATOM_LCD_INFO_LAST ATOM_LCD_INFO_V13
  2875. //Definitions for ucLCD_Misc
  2876. #define ATOM_PANEL_MISC_V13_DUAL 0x00000001
  2877. #define ATOM_PANEL_MISC_V13_FPDI 0x00000002
  2878. #define ATOM_PANEL_MISC_V13_GREY_LEVEL 0x0000000C
  2879. #define ATOM_PANEL_MISC_V13_GREY_LEVEL_SHIFT 2
  2880. #define ATOM_PANEL_MISC_V13_COLOR_BIT_DEPTH_MASK 0x70
  2881. #define ATOM_PANEL_MISC_V13_6BIT_PER_COLOR 0x10
  2882. #define ATOM_PANEL_MISC_V13_8BIT_PER_COLOR 0x20
  2883. //Color Bit Depth definition in EDID V1.4 @BYTE 14h
  2884. //Bit 6 5 4
  2885. // 0 0 0 - Color bit depth is undefined
  2886. // 0 0 1 - 6 Bits per Primary Color
  2887. // 0 1 0 - 8 Bits per Primary Color
  2888. // 0 1 1 - 10 Bits per Primary Color
  2889. // 1 0 0 - 12 Bits per Primary Color
  2890. // 1 0 1 - 14 Bits per Primary Color
  2891. // 1 1 0 - 16 Bits per Primary Color
  2892. // 1 1 1 - Reserved
  2893. //Definitions for ucLCDPanel_SpecialHandlingCap:
  2894. //Once DAL sees this CAP is set, it will read EDID from LCD on its own instead of using sLCDTiming in ATOM_LVDS_INFO_V12.
  2895. //Other entries in ATOM_LVDS_INFO_V12 are still valid/useful to DAL
  2896. #define LCDPANEL_CAP_V13_READ_EDID 0x1 // = LCDPANEL_CAP_READ_EDID no change comparing to previous version
  2897. //If a design supports DRR (dynamic refresh rate) on internal panels (LVDS or EDP), this cap is set in ucLCDPanel_SpecialHandlingCap together
  2898. //with multiple supported refresh rates@usSupportedRefreshRate. This cap should not be set when only slow refresh rate is supported (static
  2899. //refresh rate switch by SW. This is only valid from ATOM_LVDS_INFO_V12
  2900. #define LCDPANEL_CAP_V13_DRR_SUPPORTED 0x2 // = LCDPANEL_CAP_DRR_SUPPORTED no change comparing to previous version
  2901. //Use this cap bit for a quick reference whether an embadded panel (LCD1 ) is LVDS or eDP.
  2902. #define LCDPANEL_CAP_V13_eDP 0x4 // = LCDPANEL_CAP_eDP no change comparing to previous version
  2903. typedef struct _ATOM_PATCH_RECORD_MODE
  2904. {
  2905. UCHAR ucRecordType;
  2906. USHORT usHDisp;
  2907. USHORT usVDisp;
  2908. }ATOM_PATCH_RECORD_MODE;
  2909. typedef struct _ATOM_LCD_RTS_RECORD
  2910. {
  2911. UCHAR ucRecordType;
  2912. UCHAR ucRTSValue;
  2913. }ATOM_LCD_RTS_RECORD;
  2914. //!! If the record below exits, it shoud always be the first record for easy use in command table!!!
  2915. // The record below is only used when LVDS_Info is present. From ATOM_LVDS_INFO_V12, use ucLCDPanel_SpecialHandlingCap instead.
  2916. typedef struct _ATOM_LCD_MODE_CONTROL_CAP
  2917. {
  2918. UCHAR ucRecordType;
  2919. USHORT usLCDCap;
  2920. }ATOM_LCD_MODE_CONTROL_CAP;
  2921. #define LCD_MODE_CAP_BL_OFF 1
  2922. #define LCD_MODE_CAP_CRTC_OFF 2
  2923. #define LCD_MODE_CAP_PANEL_OFF 4
  2924. typedef struct _ATOM_FAKE_EDID_PATCH_RECORD
  2925. {
  2926. UCHAR ucRecordType;
  2927. UCHAR ucFakeEDIDLength;
  2928. UCHAR ucFakeEDIDString[1]; // This actually has ucFakeEdidLength elements.
  2929. } ATOM_FAKE_EDID_PATCH_RECORD;
  2930. typedef struct _ATOM_PANEL_RESOLUTION_PATCH_RECORD
  2931. {
  2932. UCHAR ucRecordType;
  2933. USHORT usHSize;
  2934. USHORT usVSize;
  2935. }ATOM_PANEL_RESOLUTION_PATCH_RECORD;
  2936. #define LCD_MODE_PATCH_RECORD_MODE_TYPE 1
  2937. #define LCD_RTS_RECORD_TYPE 2
  2938. #define LCD_CAP_RECORD_TYPE 3
  2939. #define LCD_FAKE_EDID_PATCH_RECORD_TYPE 4
  2940. #define LCD_PANEL_RESOLUTION_RECORD_TYPE 5
  2941. #define ATOM_RECORD_END_TYPE 0xFF
  2942. /****************************Spread Spectrum Info Table Definitions **********************/
  2943. //ucTableFormatRevision=1
  2944. //ucTableContentRevision=2
  2945. typedef struct _ATOM_SPREAD_SPECTRUM_ASSIGNMENT
  2946. {
  2947. USHORT usSpreadSpectrumPercentage;
  2948. UCHAR ucSpreadSpectrumType; //Bit1=0 Down Spread,=1 Center Spread. Bit1=1 Ext. =0 Int. Bit2=1: PCIE REFCLK SS =0 iternal PPLL SS Others:TBD
  2949. UCHAR ucSS_Step;
  2950. UCHAR ucSS_Delay;
  2951. UCHAR ucSS_Id;
  2952. UCHAR ucRecommendedRef_Div;
  2953. UCHAR ucSS_Range; //it was reserved for V11
  2954. }ATOM_SPREAD_SPECTRUM_ASSIGNMENT;
  2955. #define ATOM_MAX_SS_ENTRY 16
  2956. #define ATOM_DP_SS_ID1 0x0f1 // SS ID for internal DP stream at 2.7Ghz. if ATOM_DP_SS_ID2 does not exist in SS_InfoTable, it is used for internal DP stream at 1.62Ghz as well.
  2957. #define ATOM_DP_SS_ID2 0x0f2 // SS ID for internal DP stream at 1.62Ghz, if it exists in SS_InfoTable.
  2958. #define ATOM_LVLINK_2700MHz_SS_ID 0x0f3 // SS ID for LV link translator chip at 2.7Ghz
  2959. #define ATOM_LVLINK_1620MHz_SS_ID 0x0f4 // SS ID for LV link translator chip at 1.62Ghz
  2960. #define ATOM_SS_DOWN_SPREAD_MODE_MASK 0x00000000
  2961. #define ATOM_SS_DOWN_SPREAD_MODE 0x00000000
  2962. #define ATOM_SS_CENTRE_SPREAD_MODE_MASK 0x00000001
  2963. #define ATOM_SS_CENTRE_SPREAD_MODE 0x00000001
  2964. #define ATOM_INTERNAL_SS_MASK 0x00000000
  2965. #define ATOM_EXTERNAL_SS_MASK 0x00000002
  2966. #define EXEC_SS_STEP_SIZE_SHIFT 2
  2967. #define EXEC_SS_DELAY_SHIFT 4
  2968. #define ACTIVEDATA_TO_BLON_DELAY_SHIFT 4
  2969. typedef struct _ATOM_SPREAD_SPECTRUM_INFO
  2970. {
  2971. ATOM_COMMON_TABLE_HEADER sHeader;
  2972. ATOM_SPREAD_SPECTRUM_ASSIGNMENT asSS_Info[ATOM_MAX_SS_ENTRY];
  2973. }ATOM_SPREAD_SPECTRUM_INFO;
  2974. /****************************************************************************/
  2975. // Structure used in AnalogTV_InfoTable (Top level)
  2976. /****************************************************************************/
  2977. //ucTVBootUpDefaultStd definition:
  2978. //ATOM_TV_NTSC 1
  2979. //ATOM_TV_NTSCJ 2
  2980. //ATOM_TV_PAL 3
  2981. //ATOM_TV_PALM 4
  2982. //ATOM_TV_PALCN 5
  2983. //ATOM_TV_PALN 6
  2984. //ATOM_TV_PAL60 7
  2985. //ATOM_TV_SECAM 8
  2986. //ucTVSupportedStd definition:
  2987. #define NTSC_SUPPORT 0x1
  2988. #define NTSCJ_SUPPORT 0x2
  2989. #define PAL_SUPPORT 0x4
  2990. #define PALM_SUPPORT 0x8
  2991. #define PALCN_SUPPORT 0x10
  2992. #define PALN_SUPPORT 0x20
  2993. #define PAL60_SUPPORT 0x40
  2994. #define SECAM_SUPPORT 0x80
  2995. #define MAX_SUPPORTED_TV_TIMING 2
  2996. typedef struct _ATOM_ANALOG_TV_INFO
  2997. {
  2998. ATOM_COMMON_TABLE_HEADER sHeader;
  2999. UCHAR ucTV_SupportedStandard;
  3000. UCHAR ucTV_BootUpDefaultStandard;
  3001. UCHAR ucExt_TV_ASIC_ID;
  3002. UCHAR ucExt_TV_ASIC_SlaveAddr;
  3003. /*ATOM_DTD_FORMAT aModeTimings[MAX_SUPPORTED_TV_TIMING];*/
  3004. ATOM_MODE_TIMING aModeTimings[MAX_SUPPORTED_TV_TIMING];
  3005. }ATOM_ANALOG_TV_INFO;
  3006. #define MAX_SUPPORTED_TV_TIMING_V1_2 3
  3007. typedef struct _ATOM_ANALOG_TV_INFO_V1_2
  3008. {
  3009. ATOM_COMMON_TABLE_HEADER sHeader;
  3010. UCHAR ucTV_SupportedStandard;
  3011. UCHAR ucTV_BootUpDefaultStandard;
  3012. UCHAR ucExt_TV_ASIC_ID;
  3013. UCHAR ucExt_TV_ASIC_SlaveAddr;
  3014. ATOM_DTD_FORMAT aModeTimings[MAX_SUPPORTED_TV_TIMING_V1_2];
  3015. }ATOM_ANALOG_TV_INFO_V1_2;
  3016. typedef struct _ATOM_DPCD_INFO
  3017. {
  3018. UCHAR ucRevisionNumber; //10h : Revision 1.0; 11h : Revision 1.1
  3019. UCHAR ucMaxLinkRate; //06h : 1.62Gbps per lane; 0Ah = 2.7Gbps per lane
  3020. UCHAR ucMaxLane; //Bits 4:0 = MAX_LANE_COUNT (1/2/4). Bit 7 = ENHANCED_FRAME_CAP
  3021. UCHAR ucMaxDownSpread; //Bit0 = 0: No Down spread; Bit0 = 1: 0.5% (Subject to change according to DP spec)
  3022. }ATOM_DPCD_INFO;
  3023. #define ATOM_DPCD_MAX_LANE_MASK 0x1F
  3024. /**************************************************************************/
  3025. // VRAM usage and their defintions
  3026. // One chunk of VRAM used by Bios are for HWICON surfaces,EDID data.
  3027. // Current Mode timing and Dail Timing and/or STD timing data EACH device. They can be broken down as below.
  3028. // All the addresses below are the offsets from the frame buffer start.They all MUST be Dword aligned!
  3029. // To driver: The physical address of this memory portion=mmFB_START(4K aligned)+ATOMBIOS_VRAM_USAGE_START_ADDR+ATOM_x_ADDR
  3030. // To Bios: ATOMBIOS_VRAM_USAGE_START_ADDR+ATOM_x_ADDR->MM_INDEX
  3031. #ifndef VESA_MEMORY_IN_64K_BLOCK
  3032. #define VESA_MEMORY_IN_64K_BLOCK 0x100 //256*64K=16Mb (Max. VESA memory is 16Mb!)
  3033. #endif
  3034. #define ATOM_EDID_RAW_DATASIZE 256 //In Bytes
  3035. #define ATOM_HWICON_SURFACE_SIZE 4096 //In Bytes
  3036. #define ATOM_HWICON_INFOTABLE_SIZE 32
  3037. #define MAX_DTD_MODE_IN_VRAM 6
  3038. #define ATOM_DTD_MODE_SUPPORT_TBL_SIZE (MAX_DTD_MODE_IN_VRAM*28) //28= (SIZEOF ATOM_DTD_FORMAT)
  3039. #define ATOM_STD_MODE_SUPPORT_TBL_SIZE 32*8 //32 is a predefined number,8= (SIZEOF ATOM_STD_FORMAT)
  3040. //20 bytes for Encoder Type and DPCD in STD EDID area
  3041. #define DFP_ENCODER_TYPE_OFFSET (ATOM_EDID_RAW_DATASIZE + ATOM_DTD_MODE_SUPPORT_TBL_SIZE + ATOM_STD_MODE_SUPPORT_TBL_SIZE - 20)
  3042. #define ATOM_DP_DPCD_OFFSET (DFP_ENCODER_TYPE_OFFSET + 4 )
  3043. #define ATOM_HWICON1_SURFACE_ADDR 0
  3044. #define ATOM_HWICON2_SURFACE_ADDR (ATOM_HWICON1_SURFACE_ADDR + ATOM_HWICON_SURFACE_SIZE)
  3045. #define ATOM_HWICON_INFOTABLE_ADDR (ATOM_HWICON2_SURFACE_ADDR + ATOM_HWICON_SURFACE_SIZE)
  3046. #define ATOM_CRT1_EDID_ADDR (ATOM_HWICON_INFOTABLE_ADDR + ATOM_HWICON_INFOTABLE_SIZE)
  3047. #define ATOM_CRT1_DTD_MODE_TBL_ADDR (ATOM_CRT1_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3048. #define ATOM_CRT1_STD_MODE_TBL_ADDR (ATOM_CRT1_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3049. #define ATOM_LCD1_EDID_ADDR (ATOM_CRT1_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3050. #define ATOM_LCD1_DTD_MODE_TBL_ADDR (ATOM_LCD1_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3051. #define ATOM_LCD1_STD_MODE_TBL_ADDR (ATOM_LCD1_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3052. #define ATOM_TV1_DTD_MODE_TBL_ADDR (ATOM_LCD1_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3053. #define ATOM_DFP1_EDID_ADDR (ATOM_TV1_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3054. #define ATOM_DFP1_DTD_MODE_TBL_ADDR (ATOM_DFP1_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3055. #define ATOM_DFP1_STD_MODE_TBL_ADDR (ATOM_DFP1_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3056. #define ATOM_CRT2_EDID_ADDR (ATOM_DFP1_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3057. #define ATOM_CRT2_DTD_MODE_TBL_ADDR (ATOM_CRT2_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3058. #define ATOM_CRT2_STD_MODE_TBL_ADDR (ATOM_CRT2_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3059. #define ATOM_LCD2_EDID_ADDR (ATOM_CRT2_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3060. #define ATOM_LCD2_DTD_MODE_TBL_ADDR (ATOM_LCD2_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3061. #define ATOM_LCD2_STD_MODE_TBL_ADDR (ATOM_LCD2_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3062. #define ATOM_DFP6_EDID_ADDR (ATOM_LCD2_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3063. #define ATOM_DFP6_DTD_MODE_TBL_ADDR (ATOM_DFP6_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3064. #define ATOM_DFP6_STD_MODE_TBL_ADDR (ATOM_DFP6_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3065. #define ATOM_DFP2_EDID_ADDR (ATOM_DFP6_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3066. #define ATOM_DFP2_DTD_MODE_TBL_ADDR (ATOM_DFP2_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3067. #define ATOM_DFP2_STD_MODE_TBL_ADDR (ATOM_DFP2_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3068. #define ATOM_CV_EDID_ADDR (ATOM_DFP2_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3069. #define ATOM_CV_DTD_MODE_TBL_ADDR (ATOM_CV_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3070. #define ATOM_CV_STD_MODE_TBL_ADDR (ATOM_CV_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3071. #define ATOM_DFP3_EDID_ADDR (ATOM_CV_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3072. #define ATOM_DFP3_DTD_MODE_TBL_ADDR (ATOM_DFP3_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3073. #define ATOM_DFP3_STD_MODE_TBL_ADDR (ATOM_DFP3_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3074. #define ATOM_DFP4_EDID_ADDR (ATOM_DFP3_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3075. #define ATOM_DFP4_DTD_MODE_TBL_ADDR (ATOM_DFP4_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3076. #define ATOM_DFP4_STD_MODE_TBL_ADDR (ATOM_DFP4_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3077. #define ATOM_DFP5_EDID_ADDR (ATOM_DFP4_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3078. #define ATOM_DFP5_DTD_MODE_TBL_ADDR (ATOM_DFP5_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3079. #define ATOM_DFP5_STD_MODE_TBL_ADDR (ATOM_DFP5_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3080. #define ATOM_DP_TRAINING_TBL_ADDR (ATOM_DFP5_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3081. #define ATOM_STACK_STORAGE_START (ATOM_DP_TRAINING_TBL_ADDR + 1024)
  3082. #define ATOM_STACK_STORAGE_END ATOM_STACK_STORAGE_START + 512
  3083. //The size below is in Kb!
  3084. #define ATOM_VRAM_RESERVE_SIZE ((((ATOM_STACK_STORAGE_END - ATOM_HWICON1_SURFACE_ADDR)>>10)+4)&0xFFFC)
  3085. #define ATOM_VRAM_RESERVE_V2_SIZE 32
  3086. #define ATOM_VRAM_OPERATION_FLAGS_MASK 0xC0000000L
  3087. #define ATOM_VRAM_OPERATION_FLAGS_SHIFT 30
  3088. #define ATOM_VRAM_BLOCK_NEEDS_NO_RESERVATION 0x1
  3089. #define ATOM_VRAM_BLOCK_NEEDS_RESERVATION 0x0
  3090. /***********************************************************************************/
  3091. // Structure used in VRAM_UsageByFirmwareTable
  3092. // Note1: This table is filled by SetBiosReservationStartInFB in CoreCommSubs.asm
  3093. // at running time.
  3094. // note2: From RV770, the memory is more than 32bit addressable, so we will change
  3095. // ucTableFormatRevision=1,ucTableContentRevision=4, the strcuture remains
  3096. // exactly same as 1.1 and 1.2 (1.3 is never in use), but ulStartAddrUsedByFirmware
  3097. // (in offset to start of memory address) is KB aligned instead of byte aligend.
  3098. /***********************************************************************************/
  3099. // Note3:
  3100. /* If we change usReserved to "usFBUsedbyDrvInKB", then to VBIOS this usFBUsedbyDrvInKB is a predefined, unchanged constant across VGA or non VGA adapter,
  3101. for CAIL, The size of FB access area is known, only thing missing is the Offset of FB Access area, so we can have:
  3102. If (ulStartAddrUsedByFirmware!=0)
  3103. FBAccessAreaOffset= ulStartAddrUsedByFirmware - usFBUsedbyDrvInKB;
  3104. Reserved area has been claimed by VBIOS including this FB access area; CAIL doesn't need to reserve any extra area for this purpose
  3105. else //Non VGA case
  3106. if (FB_Size<=2Gb)
  3107. FBAccessAreaOffset= FB_Size - usFBUsedbyDrvInKB;
  3108. else
  3109. FBAccessAreaOffset= Aper_Size - usFBUsedbyDrvInKB
  3110. CAIL needs to claim an reserved area defined by FBAccessAreaOffset and usFBUsedbyDrvInKB in non VGA case.*/
  3111. #define ATOM_MAX_FIRMWARE_VRAM_USAGE_INFO 1
  3112. typedef struct _ATOM_FIRMWARE_VRAM_RESERVE_INFO
  3113. {
  3114. ULONG ulStartAddrUsedByFirmware;
  3115. USHORT usFirmwareUseInKb;
  3116. USHORT usReserved;
  3117. }ATOM_FIRMWARE_VRAM_RESERVE_INFO;
  3118. typedef struct _ATOM_VRAM_USAGE_BY_FIRMWARE
  3119. {
  3120. ATOM_COMMON_TABLE_HEADER sHeader;
  3121. ATOM_FIRMWARE_VRAM_RESERVE_INFO asFirmwareVramReserveInfo[ATOM_MAX_FIRMWARE_VRAM_USAGE_INFO];
  3122. }ATOM_VRAM_USAGE_BY_FIRMWARE;
  3123. // change verion to 1.5, when allow driver to allocate the vram area for command table access.
  3124. typedef struct _ATOM_FIRMWARE_VRAM_RESERVE_INFO_V1_5
  3125. {
  3126. ULONG ulStartAddrUsedByFirmware;
  3127. USHORT usFirmwareUseInKb;
  3128. USHORT usFBUsedByDrvInKb;
  3129. }ATOM_FIRMWARE_VRAM_RESERVE_INFO_V1_5;
  3130. typedef struct _ATOM_VRAM_USAGE_BY_FIRMWARE_V1_5
  3131. {
  3132. ATOM_COMMON_TABLE_HEADER sHeader;
  3133. ATOM_FIRMWARE_VRAM_RESERVE_INFO_V1_5 asFirmwareVramReserveInfo[ATOM_MAX_FIRMWARE_VRAM_USAGE_INFO];
  3134. }ATOM_VRAM_USAGE_BY_FIRMWARE_V1_5;
  3135. /****************************************************************************/
  3136. // Structure used in GPIO_Pin_LUTTable
  3137. /****************************************************************************/
  3138. typedef struct _ATOM_GPIO_PIN_ASSIGNMENT
  3139. {
  3140. USHORT usGpioPin_AIndex;
  3141. UCHAR ucGpioPinBitShift;
  3142. UCHAR ucGPIO_ID;
  3143. }ATOM_GPIO_PIN_ASSIGNMENT;
  3144. typedef struct _ATOM_GPIO_PIN_LUT
  3145. {
  3146. ATOM_COMMON_TABLE_HEADER sHeader;
  3147. ATOM_GPIO_PIN_ASSIGNMENT asGPIO_Pin[1];
  3148. }ATOM_GPIO_PIN_LUT;
  3149. /****************************************************************************/
  3150. // Structure used in ComponentVideoInfoTable
  3151. /****************************************************************************/
  3152. #define GPIO_PIN_ACTIVE_HIGH 0x1
  3153. #define MAX_SUPPORTED_CV_STANDARDS 5
  3154. // definitions for ATOM_D_INFO.ucSettings
  3155. #define ATOM_GPIO_SETTINGS_BITSHIFT_MASK 0x1F // [4:0]
  3156. #define ATOM_GPIO_SETTINGS_RESERVED_MASK 0x60 // [6:5] = must be zeroed out
  3157. #define ATOM_GPIO_SETTINGS_ACTIVE_MASK 0x80 // [7]
  3158. typedef struct _ATOM_GPIO_INFO
  3159. {
  3160. USHORT usAOffset;
  3161. UCHAR ucSettings;
  3162. UCHAR ucReserved;
  3163. }ATOM_GPIO_INFO;
  3164. // definitions for ATOM_COMPONENT_VIDEO_INFO.ucMiscInfo (bit vector)
  3165. #define ATOM_CV_RESTRICT_FORMAT_SELECTION 0x2
  3166. // definitions for ATOM_COMPONENT_VIDEO_INFO.uc480i/uc480p/uc720p/uc1080i
  3167. #define ATOM_GPIO_DEFAULT_MODE_EN 0x80 //[7];
  3168. #define ATOM_GPIO_SETTING_PERMODE_MASK 0x7F //[6:0]
  3169. // definitions for ATOM_COMPONENT_VIDEO_INFO.ucLetterBoxMode
  3170. //Line 3 out put 5V.
  3171. #define ATOM_CV_LINE3_ASPECTRATIO_16_9_GPIO_A 0x01 //represent gpio 3 state for 16:9
  3172. #define ATOM_CV_LINE3_ASPECTRATIO_16_9_GPIO_B 0x02 //represent gpio 4 state for 16:9
  3173. #define ATOM_CV_LINE3_ASPECTRATIO_16_9_GPIO_SHIFT 0x0
  3174. //Line 3 out put 2.2V
  3175. #define ATOM_CV_LINE3_ASPECTRATIO_4_3_LETBOX_GPIO_A 0x04 //represent gpio 3 state for 4:3 Letter box
  3176. #define ATOM_CV_LINE3_ASPECTRATIO_4_3_LETBOX_GPIO_B 0x08 //represent gpio 4 state for 4:3 Letter box
  3177. #define ATOM_CV_LINE3_ASPECTRATIO_4_3_LETBOX_GPIO_SHIFT 0x2
  3178. //Line 3 out put 0V
  3179. #define ATOM_CV_LINE3_ASPECTRATIO_4_3_GPIO_A 0x10 //represent gpio 3 state for 4:3
  3180. #define ATOM_CV_LINE3_ASPECTRATIO_4_3_GPIO_B 0x20 //represent gpio 4 state for 4:3
  3181. #define ATOM_CV_LINE3_ASPECTRATIO_4_3_GPIO_SHIFT 0x4
  3182. #define ATOM_CV_LINE3_ASPECTRATIO_MASK 0x3F // bit [5:0]
  3183. #define ATOM_CV_LINE3_ASPECTRATIO_EXIST 0x80 //bit 7
  3184. //GPIO bit index in gpio setting per mode value, also represend the block no. in gpio blocks.
  3185. #define ATOM_GPIO_INDEX_LINE3_ASPECRATIO_GPIO_A 3 //bit 3 in uc480i/uc480p/uc720p/uc1080i, which represend the default gpio bit setting for the mode.
  3186. #define ATOM_GPIO_INDEX_LINE3_ASPECRATIO_GPIO_B 4 //bit 4 in uc480i/uc480p/uc720p/uc1080i, which represend the default gpio bit setting for the mode.
  3187. typedef struct _ATOM_COMPONENT_VIDEO_INFO
  3188. {
  3189. ATOM_COMMON_TABLE_HEADER sHeader;
  3190. USHORT usMask_PinRegisterIndex;
  3191. USHORT usEN_PinRegisterIndex;
  3192. USHORT usY_PinRegisterIndex;
  3193. USHORT usA_PinRegisterIndex;
  3194. UCHAR ucBitShift;
  3195. UCHAR ucPinActiveState; //ucPinActiveState: Bit0=1 active high, =0 active low
  3196. ATOM_DTD_FORMAT sReserved; // must be zeroed out
  3197. UCHAR ucMiscInfo;
  3198. UCHAR uc480i;
  3199. UCHAR uc480p;
  3200. UCHAR uc720p;
  3201. UCHAR uc1080i;
  3202. UCHAR ucLetterBoxMode;
  3203. UCHAR ucReserved[3];
  3204. UCHAR ucNumOfWbGpioBlocks; //For Component video D-Connector support. If zere, NTSC type connector
  3205. ATOM_GPIO_INFO aWbGpioStateBlock[MAX_SUPPORTED_CV_STANDARDS];
  3206. ATOM_DTD_FORMAT aModeTimings[MAX_SUPPORTED_CV_STANDARDS];
  3207. }ATOM_COMPONENT_VIDEO_INFO;
  3208. //ucTableFormatRevision=2
  3209. //ucTableContentRevision=1
  3210. typedef struct _ATOM_COMPONENT_VIDEO_INFO_V21
  3211. {
  3212. ATOM_COMMON_TABLE_HEADER sHeader;
  3213. UCHAR ucMiscInfo;
  3214. UCHAR uc480i;
  3215. UCHAR uc480p;
  3216. UCHAR uc720p;
  3217. UCHAR uc1080i;
  3218. UCHAR ucReserved;
  3219. UCHAR ucLetterBoxMode;
  3220. UCHAR ucNumOfWbGpioBlocks; //For Component video D-Connector support. If zere, NTSC type connector
  3221. ATOM_GPIO_INFO aWbGpioStateBlock[MAX_SUPPORTED_CV_STANDARDS];
  3222. ATOM_DTD_FORMAT aModeTimings[MAX_SUPPORTED_CV_STANDARDS];
  3223. }ATOM_COMPONENT_VIDEO_INFO_V21;
  3224. #define ATOM_COMPONENT_VIDEO_INFO_LAST ATOM_COMPONENT_VIDEO_INFO_V21
  3225. /****************************************************************************/
  3226. // Structure used in object_InfoTable
  3227. /****************************************************************************/
  3228. typedef struct _ATOM_OBJECT_HEADER
  3229. {
  3230. ATOM_COMMON_TABLE_HEADER sHeader;
  3231. USHORT usDeviceSupport;
  3232. USHORT usConnectorObjectTableOffset;
  3233. USHORT usRouterObjectTableOffset;
  3234. USHORT usEncoderObjectTableOffset;
  3235. USHORT usProtectionObjectTableOffset; //only available when Protection block is independent.
  3236. USHORT usDisplayPathTableOffset;
  3237. }ATOM_OBJECT_HEADER;
  3238. typedef struct _ATOM_OBJECT_HEADER_V3
  3239. {
  3240. ATOM_COMMON_TABLE_HEADER sHeader;
  3241. USHORT usDeviceSupport;
  3242. USHORT usConnectorObjectTableOffset;
  3243. USHORT usRouterObjectTableOffset;
  3244. USHORT usEncoderObjectTableOffset;
  3245. USHORT usProtectionObjectTableOffset; //only available when Protection block is independent.
  3246. USHORT usDisplayPathTableOffset;
  3247. USHORT usMiscObjectTableOffset;
  3248. }ATOM_OBJECT_HEADER_V3;
  3249. typedef struct _ATOM_DISPLAY_OBJECT_PATH
  3250. {
  3251. USHORT usDeviceTag; //supported device
  3252. USHORT usSize; //the size of ATOM_DISPLAY_OBJECT_PATH
  3253. USHORT usConnObjectId; //Connector Object ID
  3254. USHORT usGPUObjectId; //GPU ID
  3255. USHORT usGraphicObjIds[1]; //1st Encoder Obj source from GPU to last Graphic Obj destinate to connector.
  3256. }ATOM_DISPLAY_OBJECT_PATH;
  3257. typedef struct _ATOM_DISPLAY_EXTERNAL_OBJECT_PATH
  3258. {
  3259. USHORT usDeviceTag; //supported device
  3260. USHORT usSize; //the size of ATOM_DISPLAY_OBJECT_PATH
  3261. USHORT usConnObjectId; //Connector Object ID
  3262. USHORT usGPUObjectId; //GPU ID
  3263. USHORT usGraphicObjIds[2]; //usGraphicObjIds[0]= GPU internal encoder, usGraphicObjIds[1]= external encoder
  3264. }ATOM_DISPLAY_EXTERNAL_OBJECT_PATH;
  3265. typedef struct _ATOM_DISPLAY_OBJECT_PATH_TABLE
  3266. {
  3267. UCHAR ucNumOfDispPath;
  3268. UCHAR ucVersion;
  3269. UCHAR ucPadding[2];
  3270. ATOM_DISPLAY_OBJECT_PATH asDispPath[1];
  3271. }ATOM_DISPLAY_OBJECT_PATH_TABLE;
  3272. typedef struct _ATOM_OBJECT //each object has this structure
  3273. {
  3274. USHORT usObjectID;
  3275. USHORT usSrcDstTableOffset;
  3276. USHORT usRecordOffset; //this pointing to a bunch of records defined below
  3277. USHORT usReserved;
  3278. }ATOM_OBJECT;
  3279. typedef struct _ATOM_OBJECT_TABLE //Above 4 object table offset pointing to a bunch of objects all have this structure
  3280. {
  3281. UCHAR ucNumberOfObjects;
  3282. UCHAR ucPadding[3];
  3283. ATOM_OBJECT asObjects[1];
  3284. }ATOM_OBJECT_TABLE;
  3285. typedef struct _ATOM_SRC_DST_TABLE_FOR_ONE_OBJECT //usSrcDstTableOffset pointing to this structure
  3286. {
  3287. UCHAR ucNumberOfSrc;
  3288. USHORT usSrcObjectID[1];
  3289. UCHAR ucNumberOfDst;
  3290. USHORT usDstObjectID[1];
  3291. }ATOM_SRC_DST_TABLE_FOR_ONE_OBJECT;
  3292. //Two definitions below are for OPM on MXM module designs
  3293. #define EXT_HPDPIN_LUTINDEX_0 0
  3294. #define EXT_HPDPIN_LUTINDEX_1 1
  3295. #define EXT_HPDPIN_LUTINDEX_2 2
  3296. #define EXT_HPDPIN_LUTINDEX_3 3
  3297. #define EXT_HPDPIN_LUTINDEX_4 4
  3298. #define EXT_HPDPIN_LUTINDEX_5 5
  3299. #define EXT_HPDPIN_LUTINDEX_6 6
  3300. #define EXT_HPDPIN_LUTINDEX_7 7
  3301. #define MAX_NUMBER_OF_EXT_HPDPIN_LUT_ENTRIES (EXT_HPDPIN_LUTINDEX_7+1)
  3302. #define EXT_AUXDDC_LUTINDEX_0 0
  3303. #define EXT_AUXDDC_LUTINDEX_1 1
  3304. #define EXT_AUXDDC_LUTINDEX_2 2
  3305. #define EXT_AUXDDC_LUTINDEX_3 3
  3306. #define EXT_AUXDDC_LUTINDEX_4 4
  3307. #define EXT_AUXDDC_LUTINDEX_5 5
  3308. #define EXT_AUXDDC_LUTINDEX_6 6
  3309. #define EXT_AUXDDC_LUTINDEX_7 7
  3310. #define MAX_NUMBER_OF_EXT_AUXDDC_LUT_ENTRIES (EXT_AUXDDC_LUTINDEX_7+1)
  3311. //ucChannelMapping are defined as following
  3312. //for DP connector, eDP, DP to VGA/LVDS
  3313. //Bit[1:0]: Define which pin connect to DP connector DP_Lane0, =0: source from GPU pin TX0, =1: from GPU pin TX1, =2: from GPU pin TX2, =3 from GPU pin TX3
  3314. //Bit[3:2]: Define which pin connect to DP connector DP_Lane1, =0: source from GPU pin TX0, =1: from GPU pin TX1, =2: from GPU pin TX2, =3 from GPU pin TX3
  3315. //Bit[5:4]: Define which pin connect to DP connector DP_Lane2, =0: source from GPU pin TX0, =1: from GPU pin TX1, =2: from GPU pin TX2, =3 from GPU pin TX3
  3316. //Bit[7:6]: Define which pin connect to DP connector DP_Lane3, =0: source from GPU pin TX0, =1: from GPU pin TX1, =2: from GPU pin TX2, =3 from GPU pin TX3
  3317. typedef struct _ATOM_DP_CONN_CHANNEL_MAPPING
  3318. {
  3319. #if ATOM_BIG_ENDIAN
  3320. UCHAR ucDP_Lane3_Source:2;
  3321. UCHAR ucDP_Lane2_Source:2;
  3322. UCHAR ucDP_Lane1_Source:2;
  3323. UCHAR ucDP_Lane0_Source:2;
  3324. #else
  3325. UCHAR ucDP_Lane0_Source:2;
  3326. UCHAR ucDP_Lane1_Source:2;
  3327. UCHAR ucDP_Lane2_Source:2;
  3328. UCHAR ucDP_Lane3_Source:2;
  3329. #endif
  3330. }ATOM_DP_CONN_CHANNEL_MAPPING;
  3331. //for DVI/HDMI, in dual link case, both links have to have same mapping.
  3332. //Bit[1:0]: Define which pin connect to DVI connector data Lane2, =0: source from GPU pin TX0, =1: from GPU pin TX1, =2: from GPU pin TX2, =3 from GPU pin TX3
  3333. //Bit[3:2]: Define which pin connect to DVI connector data Lane1, =0: source from GPU pin TX0, =1: from GPU pin TX1, =2: from GPU pin TX2, =3 from GPU pin TX3
  3334. //Bit[5:4]: Define which pin connect to DVI connector data Lane0, =0: source from GPU pin TX0, =1: from GPU pin TX1, =2: from GPU pin TX2, =3 from GPU pin TX3
  3335. //Bit[7:6]: Define which pin connect to DVI connector clock lane, =0: source from GPU pin TX0, =1: from GPU pin TX1, =2: from GPU pin TX2, =3 from GPU pin TX3
  3336. typedef struct _ATOM_DVI_CONN_CHANNEL_MAPPING
  3337. {
  3338. #if ATOM_BIG_ENDIAN
  3339. UCHAR ucDVI_CLK_Source:2;
  3340. UCHAR ucDVI_DATA0_Source:2;
  3341. UCHAR ucDVI_DATA1_Source:2;
  3342. UCHAR ucDVI_DATA2_Source:2;
  3343. #else
  3344. UCHAR ucDVI_DATA2_Source:2;
  3345. UCHAR ucDVI_DATA1_Source:2;
  3346. UCHAR ucDVI_DATA0_Source:2;
  3347. UCHAR ucDVI_CLK_Source:2;
  3348. #endif
  3349. }ATOM_DVI_CONN_CHANNEL_MAPPING;
  3350. typedef struct _EXT_DISPLAY_PATH
  3351. {
  3352. USHORT usDeviceTag; //A bit vector to show what devices are supported
  3353. USHORT usDeviceACPIEnum; //16bit device ACPI id.
  3354. USHORT usDeviceConnector; //A physical connector for displays to plug in, using object connector definitions
  3355. UCHAR ucExtAUXDDCLutIndex; //An index into external AUX/DDC channel LUT
  3356. UCHAR ucExtHPDPINLutIndex; //An index into external HPD pin LUT
  3357. USHORT usExtEncoderObjId; //external encoder object id
  3358. union{
  3359. UCHAR ucChannelMapping; // if ucChannelMapping=0, using default one to one mapping
  3360. ATOM_DP_CONN_CHANNEL_MAPPING asDPMapping;
  3361. ATOM_DVI_CONN_CHANNEL_MAPPING asDVIMapping;
  3362. };
  3363. UCHAR ucReserved;
  3364. USHORT usReserved[2];
  3365. }EXT_DISPLAY_PATH;
  3366. #define NUMBER_OF_UCHAR_FOR_GUID 16
  3367. #define MAX_NUMBER_OF_EXT_DISPLAY_PATH 7
  3368. typedef struct _ATOM_EXTERNAL_DISPLAY_CONNECTION_INFO
  3369. {
  3370. ATOM_COMMON_TABLE_HEADER sHeader;
  3371. UCHAR ucGuid [NUMBER_OF_UCHAR_FOR_GUID]; // a GUID is a 16 byte long string
  3372. EXT_DISPLAY_PATH sPath[MAX_NUMBER_OF_EXT_DISPLAY_PATH]; // total of fixed 7 entries.
  3373. UCHAR ucChecksum; // a simple Checksum of the sum of whole structure equal to 0x0.
  3374. UCHAR uc3DStereoPinId; // use for eDP panel
  3375. UCHAR Reserved [6]; // for potential expansion
  3376. }ATOM_EXTERNAL_DISPLAY_CONNECTION_INFO;
  3377. //Related definitions, all records are different but they have a commond header
  3378. typedef struct _ATOM_COMMON_RECORD_HEADER
  3379. {
  3380. UCHAR ucRecordType; //An emun to indicate the record type
  3381. UCHAR ucRecordSize; //The size of the whole record in byte
  3382. }ATOM_COMMON_RECORD_HEADER;
  3383. #define ATOM_I2C_RECORD_TYPE 1
  3384. #define ATOM_HPD_INT_RECORD_TYPE 2
  3385. #define ATOM_OUTPUT_PROTECTION_RECORD_TYPE 3
  3386. #define ATOM_CONNECTOR_DEVICE_TAG_RECORD_TYPE 4
  3387. #define ATOM_CONNECTOR_DVI_EXT_INPUT_RECORD_TYPE 5 //Obsolete, switch to use GPIO_CNTL_RECORD_TYPE
  3388. #define ATOM_ENCODER_FPGA_CONTROL_RECORD_TYPE 6 //Obsolete, switch to use GPIO_CNTL_RECORD_TYPE
  3389. #define ATOM_CONNECTOR_CVTV_SHARE_DIN_RECORD_TYPE 7
  3390. #define ATOM_JTAG_RECORD_TYPE 8 //Obsolete, switch to use GPIO_CNTL_RECORD_TYPE
  3391. #define ATOM_OBJECT_GPIO_CNTL_RECORD_TYPE 9
  3392. #define ATOM_ENCODER_DVO_CF_RECORD_TYPE 10
  3393. #define ATOM_CONNECTOR_CF_RECORD_TYPE 11
  3394. #define ATOM_CONNECTOR_HARDCODE_DTD_RECORD_TYPE 12
  3395. #define ATOM_CONNECTOR_PCIE_SUBCONNECTOR_RECORD_TYPE 13
  3396. #define ATOM_ROUTER_DDC_PATH_SELECT_RECORD_TYPE 14
  3397. #define ATOM_ROUTER_DATA_CLOCK_PATH_SELECT_RECORD_TYPE 15
  3398. #define ATOM_CONNECTOR_HPDPIN_LUT_RECORD_TYPE 16 //This is for the case when connectors are not known to object table
  3399. #define ATOM_CONNECTOR_AUXDDC_LUT_RECORD_TYPE 17 //This is for the case when connectors are not known to object table
  3400. #define ATOM_OBJECT_LINK_RECORD_TYPE 18 //Once this record is present under one object, it indicats the oobject is linked to another obj described by the record
  3401. #define ATOM_CONNECTOR_REMOTE_CAP_RECORD_TYPE 19
  3402. #define ATOM_ENCODER_CAP_RECORD_TYPE 20
  3403. //Must be updated when new record type is added,equal to that record definition!
  3404. #define ATOM_MAX_OBJECT_RECORD_NUMBER ATOM_ENCODER_CAP_RECORD_TYPE
  3405. typedef struct _ATOM_I2C_RECORD
  3406. {
  3407. ATOM_COMMON_RECORD_HEADER sheader;
  3408. ATOM_I2C_ID_CONFIG sucI2cId;
  3409. UCHAR ucI2CAddr; //The slave address, it's 0 when the record is attached to connector for DDC
  3410. }ATOM_I2C_RECORD;
  3411. typedef struct _ATOM_HPD_INT_RECORD
  3412. {
  3413. ATOM_COMMON_RECORD_HEADER sheader;
  3414. UCHAR ucHPDIntGPIOID; //Corresponding block in GPIO_PIN_INFO table gives the pin info
  3415. UCHAR ucPlugged_PinState;
  3416. }ATOM_HPD_INT_RECORD;
  3417. typedef struct _ATOM_OUTPUT_PROTECTION_RECORD
  3418. {
  3419. ATOM_COMMON_RECORD_HEADER sheader;
  3420. UCHAR ucProtectionFlag;
  3421. UCHAR ucReserved;
  3422. }ATOM_OUTPUT_PROTECTION_RECORD;
  3423. typedef struct _ATOM_CONNECTOR_DEVICE_TAG
  3424. {
  3425. ULONG ulACPIDeviceEnum; //Reserved for now
  3426. USHORT usDeviceID; //This Id is same as "ATOM_DEVICE_XXX_SUPPORT"
  3427. USHORT usPadding;
  3428. }ATOM_CONNECTOR_DEVICE_TAG;
  3429. typedef struct _ATOM_CONNECTOR_DEVICE_TAG_RECORD
  3430. {
  3431. ATOM_COMMON_RECORD_HEADER sheader;
  3432. UCHAR ucNumberOfDevice;
  3433. UCHAR ucReserved;
  3434. ATOM_CONNECTOR_DEVICE_TAG asDeviceTag[1]; //This Id is same as "ATOM_DEVICE_XXX_SUPPORT", 1 is only for allocation
  3435. }ATOM_CONNECTOR_DEVICE_TAG_RECORD;
  3436. typedef struct _ATOM_CONNECTOR_DVI_EXT_INPUT_RECORD
  3437. {
  3438. ATOM_COMMON_RECORD_HEADER sheader;
  3439. UCHAR ucConfigGPIOID;
  3440. UCHAR ucConfigGPIOState; //Set to 1 when it's active high to enable external flow in
  3441. UCHAR ucFlowinGPIPID;
  3442. UCHAR ucExtInGPIPID;
  3443. }ATOM_CONNECTOR_DVI_EXT_INPUT_RECORD;
  3444. typedef struct _ATOM_ENCODER_FPGA_CONTROL_RECORD
  3445. {
  3446. ATOM_COMMON_RECORD_HEADER sheader;
  3447. UCHAR ucCTL1GPIO_ID;
  3448. UCHAR ucCTL1GPIOState; //Set to 1 when it's active high
  3449. UCHAR ucCTL2GPIO_ID;
  3450. UCHAR ucCTL2GPIOState; //Set to 1 when it's active high
  3451. UCHAR ucCTL3GPIO_ID;
  3452. UCHAR ucCTL3GPIOState; //Set to 1 when it's active high
  3453. UCHAR ucCTLFPGA_IN_ID;
  3454. UCHAR ucPadding[3];
  3455. }ATOM_ENCODER_FPGA_CONTROL_RECORD;
  3456. typedef struct _ATOM_CONNECTOR_CVTV_SHARE_DIN_RECORD
  3457. {
  3458. ATOM_COMMON_RECORD_HEADER sheader;
  3459. UCHAR ucGPIOID; //Corresponding block in GPIO_PIN_INFO table gives the pin info
  3460. UCHAR ucTVActiveState; //Indicating when the pin==0 or 1 when TV is connected
  3461. }ATOM_CONNECTOR_CVTV_SHARE_DIN_RECORD;
  3462. typedef struct _ATOM_JTAG_RECORD
  3463. {
  3464. ATOM_COMMON_RECORD_HEADER sheader;
  3465. UCHAR ucTMSGPIO_ID;
  3466. UCHAR ucTMSGPIOState; //Set to 1 when it's active high
  3467. UCHAR ucTCKGPIO_ID;
  3468. UCHAR ucTCKGPIOState; //Set to 1 when it's active high
  3469. UCHAR ucTDOGPIO_ID;
  3470. UCHAR ucTDOGPIOState; //Set to 1 when it's active high
  3471. UCHAR ucTDIGPIO_ID;
  3472. UCHAR ucTDIGPIOState; //Set to 1 when it's active high
  3473. UCHAR ucPadding[2];
  3474. }ATOM_JTAG_RECORD;
  3475. //The following generic object gpio pin control record type will replace JTAG_RECORD/FPGA_CONTROL_RECORD/DVI_EXT_INPUT_RECORD above gradually
  3476. typedef struct _ATOM_GPIO_PIN_CONTROL_PAIR
  3477. {
  3478. UCHAR ucGPIOID; // GPIO_ID, find the corresponding ID in GPIO_LUT table
  3479. UCHAR ucGPIO_PinState; // Pin state showing how to set-up the pin
  3480. }ATOM_GPIO_PIN_CONTROL_PAIR;
  3481. typedef struct _ATOM_OBJECT_GPIO_CNTL_RECORD
  3482. {
  3483. ATOM_COMMON_RECORD_HEADER sheader;
  3484. UCHAR ucFlags; // Future expnadibility
  3485. UCHAR ucNumberOfPins; // Number of GPIO pins used to control the object
  3486. ATOM_GPIO_PIN_CONTROL_PAIR asGpio[1]; // the real gpio pin pair determined by number of pins ucNumberOfPins
  3487. }ATOM_OBJECT_GPIO_CNTL_RECORD;
  3488. //Definitions for GPIO pin state
  3489. #define GPIO_PIN_TYPE_INPUT 0x00
  3490. #define GPIO_PIN_TYPE_OUTPUT 0x10
  3491. #define GPIO_PIN_TYPE_HW_CONTROL 0x20
  3492. //For GPIO_PIN_TYPE_OUTPUT the following is defined
  3493. #define GPIO_PIN_OUTPUT_STATE_MASK 0x01
  3494. #define GPIO_PIN_OUTPUT_STATE_SHIFT 0
  3495. #define GPIO_PIN_STATE_ACTIVE_LOW 0x0
  3496. #define GPIO_PIN_STATE_ACTIVE_HIGH 0x1
  3497. // Indexes to GPIO array in GLSync record
  3498. #define ATOM_GPIO_INDEX_GLSYNC_REFCLK 0
  3499. #define ATOM_GPIO_INDEX_GLSYNC_HSYNC 1
  3500. #define ATOM_GPIO_INDEX_GLSYNC_VSYNC 2
  3501. #define ATOM_GPIO_INDEX_GLSYNC_SWAP_REQ 3
  3502. #define ATOM_GPIO_INDEX_GLSYNC_SWAP_GNT 4
  3503. #define ATOM_GPIO_INDEX_GLSYNC_INTERRUPT 5
  3504. #define ATOM_GPIO_INDEX_GLSYNC_V_RESET 6
  3505. #define ATOM_GPIO_INDEX_GLSYNC_MAX 7
  3506. typedef struct _ATOM_ENCODER_DVO_CF_RECORD
  3507. {
  3508. ATOM_COMMON_RECORD_HEADER sheader;
  3509. ULONG ulStrengthControl; // DVOA strength control for CF
  3510. UCHAR ucPadding[2];
  3511. }ATOM_ENCODER_DVO_CF_RECORD;
  3512. // Bit maps for ATOM_ENCODER_CAP_RECORD.ucEncoderCap
  3513. #define ATOM_ENCODER_CAP_RECORD_HBR2 0x01 // DP1.2 HBR2 is supported by this path
  3514. typedef struct _ATOM_ENCODER_CAP_RECORD
  3515. {
  3516. ATOM_COMMON_RECORD_HEADER sheader;
  3517. union {
  3518. USHORT usEncoderCap;
  3519. struct {
  3520. #if ATOM_BIG_ENDIAN
  3521. USHORT usReserved:15; // Bit1-15 may be defined for other capability in future
  3522. USHORT usHBR2Cap:1; // Bit0 is for DP1.2 HBR2 capability.
  3523. #else
  3524. USHORT usHBR2Cap:1; // Bit0 is for DP1.2 HBR2 capability.
  3525. USHORT usReserved:15; // Bit1-15 may be defined for other capability in future
  3526. #endif
  3527. };
  3528. };
  3529. }ATOM_ENCODER_CAP_RECORD;
  3530. // value for ATOM_CONNECTOR_CF_RECORD.ucConnectedDvoBundle
  3531. #define ATOM_CONNECTOR_CF_RECORD_CONNECTED_UPPER12BITBUNDLEA 1
  3532. #define ATOM_CONNECTOR_CF_RECORD_CONNECTED_LOWER12BITBUNDLEB 2
  3533. typedef struct _ATOM_CONNECTOR_CF_RECORD
  3534. {
  3535. ATOM_COMMON_RECORD_HEADER sheader;
  3536. USHORT usMaxPixClk;
  3537. UCHAR ucFlowCntlGpioId;
  3538. UCHAR ucSwapCntlGpioId;
  3539. UCHAR ucConnectedDvoBundle;
  3540. UCHAR ucPadding;
  3541. }ATOM_CONNECTOR_CF_RECORD;
  3542. typedef struct _ATOM_CONNECTOR_HARDCODE_DTD_RECORD
  3543. {
  3544. ATOM_COMMON_RECORD_HEADER sheader;
  3545. ATOM_DTD_FORMAT asTiming;
  3546. }ATOM_CONNECTOR_HARDCODE_DTD_RECORD;
  3547. typedef struct _ATOM_CONNECTOR_PCIE_SUBCONNECTOR_RECORD
  3548. {
  3549. ATOM_COMMON_RECORD_HEADER sheader; //ATOM_CONNECTOR_PCIE_SUBCONNECTOR_RECORD_TYPE
  3550. UCHAR ucSubConnectorType; //CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D|X_ID_DUAL_LINK_DVI_D|HDMI_TYPE_A
  3551. UCHAR ucReserved;
  3552. }ATOM_CONNECTOR_PCIE_SUBCONNECTOR_RECORD;
  3553. typedef struct _ATOM_ROUTER_DDC_PATH_SELECT_RECORD
  3554. {
  3555. ATOM_COMMON_RECORD_HEADER sheader;
  3556. UCHAR ucMuxType; //decide the number of ucMuxState, =0, no pin state, =1: single state with complement, >1: multiple state
  3557. UCHAR ucMuxControlPin;
  3558. UCHAR ucMuxState[2]; //for alligment purpose
  3559. }ATOM_ROUTER_DDC_PATH_SELECT_RECORD;
  3560. typedef struct _ATOM_ROUTER_DATA_CLOCK_PATH_SELECT_RECORD
  3561. {
  3562. ATOM_COMMON_RECORD_HEADER sheader;
  3563. UCHAR ucMuxType;
  3564. UCHAR ucMuxControlPin;
  3565. UCHAR ucMuxState[2]; //for alligment purpose
  3566. }ATOM_ROUTER_DATA_CLOCK_PATH_SELECT_RECORD;
  3567. // define ucMuxType
  3568. #define ATOM_ROUTER_MUX_PIN_STATE_MASK 0x0f
  3569. #define ATOM_ROUTER_MUX_PIN_SINGLE_STATE_COMPLEMENT 0x01
  3570. typedef struct _ATOM_CONNECTOR_HPDPIN_LUT_RECORD //record for ATOM_CONNECTOR_HPDPIN_LUT_RECORD_TYPE
  3571. {
  3572. ATOM_COMMON_RECORD_HEADER sheader;
  3573. UCHAR ucHPDPINMap[MAX_NUMBER_OF_EXT_HPDPIN_LUT_ENTRIES]; //An fixed size array which maps external pins to internal GPIO_PIN_INFO table
  3574. }ATOM_CONNECTOR_HPDPIN_LUT_RECORD;
  3575. typedef struct _ATOM_CONNECTOR_AUXDDC_LUT_RECORD //record for ATOM_CONNECTOR_AUXDDC_LUT_RECORD_TYPE
  3576. {
  3577. ATOM_COMMON_RECORD_HEADER sheader;
  3578. ATOM_I2C_ID_CONFIG ucAUXDDCMap[MAX_NUMBER_OF_EXT_AUXDDC_LUT_ENTRIES]; //An fixed size array which maps external pins to internal DDC ID
  3579. }ATOM_CONNECTOR_AUXDDC_LUT_RECORD;
  3580. typedef struct _ATOM_OBJECT_LINK_RECORD
  3581. {
  3582. ATOM_COMMON_RECORD_HEADER sheader;
  3583. USHORT usObjectID; //could be connector, encorder or other object in object.h
  3584. }ATOM_OBJECT_LINK_RECORD;
  3585. typedef struct _ATOM_CONNECTOR_REMOTE_CAP_RECORD
  3586. {
  3587. ATOM_COMMON_RECORD_HEADER sheader;
  3588. USHORT usReserved;
  3589. }ATOM_CONNECTOR_REMOTE_CAP_RECORD;
  3590. /****************************************************************************/
  3591. // ASIC voltage data table
  3592. /****************************************************************************/
  3593. typedef struct _ATOM_VOLTAGE_INFO_HEADER
  3594. {
  3595. USHORT usVDDCBaseLevel; //In number of 50mv unit
  3596. USHORT usReserved; //For possible extension table offset
  3597. UCHAR ucNumOfVoltageEntries;
  3598. UCHAR ucBytesPerVoltageEntry;
  3599. UCHAR ucVoltageStep; //Indicating in how many mv increament is one step, 0.5mv unit
  3600. UCHAR ucDefaultVoltageEntry;
  3601. UCHAR ucVoltageControlI2cLine;
  3602. UCHAR ucVoltageControlAddress;
  3603. UCHAR ucVoltageControlOffset;
  3604. }ATOM_VOLTAGE_INFO_HEADER;
  3605. typedef struct _ATOM_VOLTAGE_INFO
  3606. {
  3607. ATOM_COMMON_TABLE_HEADER sHeader;
  3608. ATOM_VOLTAGE_INFO_HEADER viHeader;
  3609. UCHAR ucVoltageEntries[64]; //64 is for allocation, the actual number of entry is present at ucNumOfVoltageEntries*ucBytesPerVoltageEntry
  3610. }ATOM_VOLTAGE_INFO;
  3611. typedef struct _ATOM_VOLTAGE_FORMULA
  3612. {
  3613. USHORT usVoltageBaseLevel; // In number of 1mv unit
  3614. USHORT usVoltageStep; // Indicating in how many mv increament is one step, 1mv unit
  3615. UCHAR ucNumOfVoltageEntries; // Number of Voltage Entry, which indicate max Voltage
  3616. UCHAR ucFlag; // bit0=0 :step is 1mv =1 0.5mv
  3617. UCHAR ucBaseVID; // if there is no lookup table, VID= BaseVID + ( Vol - BaseLevle ) /VoltageStep
  3618. UCHAR ucReserved;
  3619. UCHAR ucVIDAdjustEntries[32]; // 32 is for allocation, the actual number of entry is present at ucNumOfVoltageEntries
  3620. }ATOM_VOLTAGE_FORMULA;
  3621. typedef struct _VOLTAGE_LUT_ENTRY
  3622. {
  3623. USHORT usVoltageCode; // The Voltage ID, either GPIO or I2C code
  3624. USHORT usVoltageValue; // The corresponding Voltage Value, in mV
  3625. }VOLTAGE_LUT_ENTRY;
  3626. typedef struct _ATOM_VOLTAGE_FORMULA_V2
  3627. {
  3628. UCHAR ucNumOfVoltageEntries; // Number of Voltage Entry, which indicate max Voltage
  3629. UCHAR ucReserved[3];
  3630. VOLTAGE_LUT_ENTRY asVIDAdjustEntries[32];// 32 is for allocation, the actual number of entries is in ucNumOfVoltageEntries
  3631. }ATOM_VOLTAGE_FORMULA_V2;
  3632. typedef struct _ATOM_VOLTAGE_CONTROL
  3633. {
  3634. UCHAR ucVoltageControlId; //Indicate it is controlled by I2C or GPIO or HW state machine
  3635. UCHAR ucVoltageControlI2cLine;
  3636. UCHAR ucVoltageControlAddress;
  3637. UCHAR ucVoltageControlOffset;
  3638. USHORT usGpioPin_AIndex; //GPIO_PAD register index
  3639. UCHAR ucGpioPinBitShift[9]; //at most 8 pin support 255 VIDs, termintate with 0xff
  3640. UCHAR ucReserved;
  3641. }ATOM_VOLTAGE_CONTROL;
  3642. // Define ucVoltageControlId
  3643. #define VOLTAGE_CONTROLLED_BY_HW 0x00
  3644. #define VOLTAGE_CONTROLLED_BY_I2C_MASK 0x7F
  3645. #define VOLTAGE_CONTROLLED_BY_GPIO 0x80
  3646. #define VOLTAGE_CONTROL_ID_LM64 0x01 //I2C control, used for R5xx Core Voltage
  3647. #define VOLTAGE_CONTROL_ID_DAC 0x02 //I2C control, used for R5xx/R6xx MVDDC,MVDDQ or VDDCI
  3648. #define VOLTAGE_CONTROL_ID_VT116xM 0x03 //I2C control, used for R6xx Core Voltage
  3649. #define VOLTAGE_CONTROL_ID_DS4402 0x04
  3650. #define VOLTAGE_CONTROL_ID_UP6266 0x05
  3651. #define VOLTAGE_CONTROL_ID_SCORPIO 0x06
  3652. #define VOLTAGE_CONTROL_ID_VT1556M 0x07
  3653. #define VOLTAGE_CONTROL_ID_CHL822x 0x08
  3654. #define VOLTAGE_CONTROL_ID_VT1586M 0x09
  3655. typedef struct _ATOM_VOLTAGE_OBJECT
  3656. {
  3657. UCHAR ucVoltageType; //Indicate Voltage Source: VDDC, MVDDC, MVDDQ or MVDDCI
  3658. UCHAR ucSize; //Size of Object
  3659. ATOM_VOLTAGE_CONTROL asControl; //describ how to control
  3660. ATOM_VOLTAGE_FORMULA asFormula; //Indicate How to convert real Voltage to VID
  3661. }ATOM_VOLTAGE_OBJECT;
  3662. typedef struct _ATOM_VOLTAGE_OBJECT_V2
  3663. {
  3664. UCHAR ucVoltageType; //Indicate Voltage Source: VDDC, MVDDC, MVDDQ or MVDDCI
  3665. UCHAR ucSize; //Size of Object
  3666. ATOM_VOLTAGE_CONTROL asControl; //describ how to control
  3667. ATOM_VOLTAGE_FORMULA_V2 asFormula; //Indicate How to convert real Voltage to VID
  3668. }ATOM_VOLTAGE_OBJECT_V2;
  3669. typedef struct _ATOM_VOLTAGE_OBJECT_INFO
  3670. {
  3671. ATOM_COMMON_TABLE_HEADER sHeader;
  3672. ATOM_VOLTAGE_OBJECT asVoltageObj[3]; //Info for Voltage control
  3673. }ATOM_VOLTAGE_OBJECT_INFO;
  3674. typedef struct _ATOM_VOLTAGE_OBJECT_INFO_V2
  3675. {
  3676. ATOM_COMMON_TABLE_HEADER sHeader;
  3677. ATOM_VOLTAGE_OBJECT_V2 asVoltageObj[3]; //Info for Voltage control
  3678. }ATOM_VOLTAGE_OBJECT_INFO_V2;
  3679. typedef struct _ATOM_LEAKID_VOLTAGE
  3680. {
  3681. UCHAR ucLeakageId;
  3682. UCHAR ucReserved;
  3683. USHORT usVoltage;
  3684. }ATOM_LEAKID_VOLTAGE;
  3685. typedef struct _ATOM_ASIC_PROFILE_VOLTAGE
  3686. {
  3687. UCHAR ucProfileId;
  3688. UCHAR ucReserved;
  3689. USHORT usSize;
  3690. USHORT usEfuseSpareStartAddr;
  3691. USHORT usFuseIndex[8]; //from LSB to MSB, Max 8bit,end of 0xffff if less than 8 efuse id,
  3692. ATOM_LEAKID_VOLTAGE asLeakVol[2]; //Leakid and relatd voltage
  3693. }ATOM_ASIC_PROFILE_VOLTAGE;
  3694. //ucProfileId
  3695. #define ATOM_ASIC_PROFILE_ID_EFUSE_VOLTAGE 1
  3696. #define ATOM_ASIC_PROFILE_ID_EFUSE_PERFORMANCE_VOLTAGE 1
  3697. #define ATOM_ASIC_PROFILE_ID_EFUSE_THERMAL_VOLTAGE 2
  3698. typedef struct _ATOM_ASIC_PROFILING_INFO
  3699. {
  3700. ATOM_COMMON_TABLE_HEADER asHeader;
  3701. ATOM_ASIC_PROFILE_VOLTAGE asVoltage;
  3702. }ATOM_ASIC_PROFILING_INFO;
  3703. typedef struct _ATOM_POWER_SOURCE_OBJECT
  3704. {
  3705. UCHAR ucPwrSrcId; // Power source
  3706. UCHAR ucPwrSensorType; // GPIO, I2C or none
  3707. UCHAR ucPwrSensId; // if GPIO detect, it is GPIO id, if I2C detect, it is I2C id
  3708. UCHAR ucPwrSensSlaveAddr; // Slave address if I2C detect
  3709. UCHAR ucPwrSensRegIndex; // I2C register Index if I2C detect
  3710. UCHAR ucPwrSensRegBitMask; // detect which bit is used if I2C detect
  3711. UCHAR ucPwrSensActiveState; // high active or low active
  3712. UCHAR ucReserve[3]; // reserve
  3713. USHORT usSensPwr; // in unit of watt
  3714. }ATOM_POWER_SOURCE_OBJECT;
  3715. typedef struct _ATOM_POWER_SOURCE_INFO
  3716. {
  3717. ATOM_COMMON_TABLE_HEADER asHeader;
  3718. UCHAR asPwrbehave[16];
  3719. ATOM_POWER_SOURCE_OBJECT asPwrObj[1];
  3720. }ATOM_POWER_SOURCE_INFO;
  3721. //Define ucPwrSrcId
  3722. #define POWERSOURCE_PCIE_ID1 0x00
  3723. #define POWERSOURCE_6PIN_CONNECTOR_ID1 0x01
  3724. #define POWERSOURCE_8PIN_CONNECTOR_ID1 0x02
  3725. #define POWERSOURCE_6PIN_CONNECTOR_ID2 0x04
  3726. #define POWERSOURCE_8PIN_CONNECTOR_ID2 0x08
  3727. //define ucPwrSensorId
  3728. #define POWER_SENSOR_ALWAYS 0x00
  3729. #define POWER_SENSOR_GPIO 0x01
  3730. #define POWER_SENSOR_I2C 0x02
  3731. typedef struct _ATOM_CLK_VOLT_CAPABILITY
  3732. {
  3733. ULONG ulVoltageIndex; // The Voltage Index indicated by FUSE, same voltage index shared with SCLK DPM fuse table
  3734. ULONG ulMaximumSupportedCLK; // Maximum clock supported with specified voltage index, unit in 10kHz
  3735. }ATOM_CLK_VOLT_CAPABILITY;
  3736. typedef struct _ATOM_AVAILABLE_SCLK_LIST
  3737. {
  3738. ULONG ulSupportedSCLK; // Maximum clock supported with specified voltage index, unit in 10kHz
  3739. USHORT usVoltageIndex; // The Voltage Index indicated by FUSE for specified SCLK
  3740. USHORT usVoltageID; // The Voltage ID indicated by FUSE for specified SCLK
  3741. }ATOM_AVAILABLE_SCLK_LIST;
  3742. // ATOM_INTEGRATED_SYSTEM_INFO_V6 ulSystemConfig cap definition
  3743. #define ATOM_IGP_INFO_V6_SYSTEM_CONFIG__PCIE_POWER_GATING_ENABLE 1 // refer to ulSystemConfig bit[0]
  3744. // this IntegrateSystemInfoTable is used for Liano/Ontario APU
  3745. typedef struct _ATOM_INTEGRATED_SYSTEM_INFO_V6
  3746. {
  3747. ATOM_COMMON_TABLE_HEADER sHeader;
  3748. ULONG ulBootUpEngineClock;
  3749. ULONG ulDentistVCOFreq;
  3750. ULONG ulBootUpUMAClock;
  3751. ATOM_CLK_VOLT_CAPABILITY sDISPCLK_Voltage[4];
  3752. ULONG ulBootUpReqDisplayVector;
  3753. ULONG ulOtherDisplayMisc;
  3754. ULONG ulGPUCapInfo;
  3755. ULONG ulSB_MMIO_Base_Addr;
  3756. USHORT usRequestedPWMFreqInHz;
  3757. UCHAR ucHtcTmpLmt;
  3758. UCHAR ucHtcHystLmt;
  3759. ULONG ulMinEngineClock;
  3760. ULONG ulSystemConfig;
  3761. ULONG ulCPUCapInfo;
  3762. USHORT usNBP0Voltage;
  3763. USHORT usNBP1Voltage;
  3764. USHORT usBootUpNBVoltage;
  3765. USHORT usExtDispConnInfoOffset;
  3766. USHORT usPanelRefreshRateRange;
  3767. UCHAR ucMemoryType;
  3768. UCHAR ucUMAChannelNumber;
  3769. ULONG ulCSR_M3_ARB_CNTL_DEFAULT[10];
  3770. ULONG ulCSR_M3_ARB_CNTL_UVD[10];
  3771. ULONG ulCSR_M3_ARB_CNTL_FS3D[10];
  3772. ATOM_AVAILABLE_SCLK_LIST sAvail_SCLK[5];
  3773. ULONG ulGMCRestoreResetTime;
  3774. ULONG ulMinimumNClk;
  3775. ULONG ulIdleNClk;
  3776. ULONG ulDDR_DLL_PowerUpTime;
  3777. ULONG ulDDR_PLL_PowerUpTime;
  3778. USHORT usPCIEClkSSPercentage;
  3779. USHORT usPCIEClkSSType;
  3780. USHORT usLvdsSSPercentage;
  3781. USHORT usLvdsSSpreadRateIn10Hz;
  3782. USHORT usHDMISSPercentage;
  3783. USHORT usHDMISSpreadRateIn10Hz;
  3784. USHORT usDVISSPercentage;
  3785. USHORT usDVISSpreadRateIn10Hz;
  3786. ULONG ulReserved3[21];
  3787. ATOM_EXTERNAL_DISPLAY_CONNECTION_INFO sExtDispConnInfo;
  3788. }ATOM_INTEGRATED_SYSTEM_INFO_V6;
  3789. // ulGPUCapInfo
  3790. #define INTEGRATED_SYSTEM_INFO_V6_GPUCAPINFO__TMDSHDMI_COHERENT_SINGLEPLL_MODE 0x01
  3791. #define INTEGRATED_SYSTEM_INFO_V6_GPUCAPINFO__DISABLE_AUX_HW_MODE_DETECTION 0x08
  3792. // ulOtherDisplayMisc
  3793. #define INTEGRATED_SYSTEM_INFO__GET_EDID_CALLBACK_FUNC_SUPPORT 0x01
  3794. /**********************************************************************************************************************
  3795. ATOM_INTEGRATED_SYSTEM_INFO_V6 Description
  3796. ulBootUpEngineClock: VBIOS bootup Engine clock frequency, in 10kHz unit. if it is equal 0, then VBIOS use pre-defined bootup engine clock
  3797. ulDentistVCOFreq: Dentist VCO clock in 10kHz unit.
  3798. ulBootUpUMAClock: System memory boot up clock frequency in 10Khz unit.
  3799. sDISPCLK_Voltage: Report Display clock voltage requirement.
  3800. ulBootUpReqDisplayVector: VBIOS boot up display IDs, following are supported devices in Liano/Ontaio projects:
  3801. ATOM_DEVICE_CRT1_SUPPORT 0x0001
  3802. ATOM_DEVICE_CRT2_SUPPORT 0x0010
  3803. ATOM_DEVICE_DFP1_SUPPORT 0x0008
  3804. ATOM_DEVICE_DFP6_SUPPORT 0x0040
  3805. ATOM_DEVICE_DFP2_SUPPORT 0x0080
  3806. ATOM_DEVICE_DFP3_SUPPORT 0x0200
  3807. ATOM_DEVICE_DFP4_SUPPORT 0x0400
  3808. ATOM_DEVICE_DFP5_SUPPORT 0x0800
  3809. ATOM_DEVICE_LCD1_SUPPORT 0x0002
  3810. ulOtherDisplayMisc: Other display related flags, not defined yet.
  3811. ulGPUCapInfo: bit[0]=0: TMDS/HDMI Coherent Mode use cascade PLL mode.
  3812. =1: TMDS/HDMI Coherent Mode use signel PLL mode.
  3813. bit[3]=0: Enable HW AUX mode detection logic
  3814. =1: Disable HW AUX mode dettion logic
  3815. ulSB_MMIO_Base_Addr: Physical Base address to SB MMIO space. Driver needs to initialize it for SMU usage.
  3816. usRequestedPWMFreqInHz: When it's set to 0x0 by SBIOS: the LCD BackLight is not controlled by GPU(SW).
  3817. Any attempt to change BL using VBIOS function or enable VariBri from PP table is not effective since ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU==0;
  3818. When it's set to a non-zero frequency, the BackLight is controlled by GPU (SW) in one of two ways below:
  3819. 1. SW uses the GPU BL PWM output to control the BL, in chis case, this non-zero frequency determines what freq GPU should use;
  3820. VBIOS will set up proper PWM frequency and ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU==1,as the result,
  3821. Changing BL using VBIOS function is functional in both driver and non-driver present environment;
  3822. and enabling VariBri under the driver environment from PP table is optional.
  3823. 2. SW uses other means to control BL (like DPCD),this non-zero frequency serves as a flag only indicating
  3824. that BL control from GPU is expected.
  3825. VBIOS will NOT set up PWM frequency but make ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU==1
  3826. Changing BL using VBIOS function could be functional in both driver and non-driver present environment,but
  3827. it's per platform
  3828. and enabling VariBri under the driver environment from PP table is optional.
  3829. ucHtcTmpLmt: Refer to D18F3x64 bit[22:16], HtcTmpLmt.
  3830. Threshold on value to enter HTC_active state.
  3831. ucHtcHystLmt: Refer to D18F3x64 bit[27:24], HtcHystLmt.
  3832. To calculate threshold off value to exit HTC_active state, which is Threshold on vlaue minus ucHtcHystLmt.
  3833. ulMinEngineClock: Minimum SCLK allowed in 10kHz unit. This is calculated based on WRCK Fuse settings.
  3834. ulSystemConfig: Bit[0]=0: PCIE Power Gating Disabled
  3835. =1: PCIE Power Gating Enabled
  3836. Bit[1]=0: DDR-DLL shut-down feature disabled.
  3837. 1: DDR-DLL shut-down feature enabled.
  3838. Bit[2]=0: DDR-PLL Power down feature disabled.
  3839. 1: DDR-PLL Power down feature enabled.
  3840. ulCPUCapInfo: TBD
  3841. usNBP0Voltage: VID for voltage on NB P0 State
  3842. usNBP1Voltage: VID for voltage on NB P1 State
  3843. usBootUpNBVoltage: Voltage Index of GNB voltage configured by SBIOS, which is suffcient to support VBIOS DISPCLK requirement.
  3844. usExtDispConnInfoOffset: Offset to sExtDispConnInfo inside the structure
  3845. usPanelRefreshRateRange: Bit vector for LCD supported refresh rate range. If DRR is requestd by the platform, at least two bits need to be set
  3846. to indicate a range.
  3847. SUPPORTED_LCD_REFRESHRATE_30Hz 0x0004
  3848. SUPPORTED_LCD_REFRESHRATE_40Hz 0x0008
  3849. SUPPORTED_LCD_REFRESHRATE_50Hz 0x0010
  3850. SUPPORTED_LCD_REFRESHRATE_60Hz 0x0020
  3851. ucMemoryType: [3:0]=1:DDR1;=2:DDR2;=3:DDR3.[7:4] is reserved.
  3852. ucUMAChannelNumber: System memory channel numbers.
  3853. ulCSR_M3_ARB_CNTL_DEFAULT[10]: Arrays with values for CSR M3 arbiter for default
  3854. ulCSR_M3_ARB_CNTL_UVD[10]: Arrays with values for CSR M3 arbiter for UVD playback.
  3855. ulCSR_M3_ARB_CNTL_FS3D[10]: Arrays with values for CSR M3 arbiter for Full Screen 3D applications.
  3856. sAvail_SCLK[5]: Arrays to provide available list of SLCK and corresponding voltage, order from low to high
  3857. ulGMCRestoreResetTime: GMC power restore and GMC reset time to calculate data reconnection latency. Unit in ns.
  3858. ulMinimumNClk: Minimum NCLK speed among all NB-Pstates to calcualte data reconnection latency. Unit in 10kHz.
  3859. ulIdleNClk: NCLK speed while memory runs in self-refresh state. Unit in 10kHz.
  3860. ulDDR_DLL_PowerUpTime: DDR PHY DLL power up time. Unit in ns.
  3861. ulDDR_PLL_PowerUpTime: DDR PHY PLL power up time. Unit in ns.
  3862. usPCIEClkSSPercentage: PCIE Clock Spread Spectrum Percentage in unit 0.01%; 100 mean 1%.
  3863. usPCIEClkSSType: PCIE Clock Spread Spectrum Type. 0 for Down spread(default); 1 for Center spread.
  3864. usLvdsSSPercentage: LVDS panel ( not include eDP ) Spread Spectrum Percentage in unit of 0.01%, =0, use VBIOS default setting.
  3865. usLvdsSSpreadRateIn10Hz: LVDS panel ( not include eDP ) Spread Spectrum frequency in unit of 10Hz, =0, use VBIOS default setting.
  3866. usHDMISSPercentage: HDMI Spread Spectrum Percentage in unit 0.01%; 100 mean 1%, =0, use VBIOS default setting.
  3867. usHDMISSpreadRateIn10Hz: HDMI Spread Spectrum frequency in unit of 10Hz, =0, use VBIOS default setting.
  3868. usDVISSPercentage: DVI Spread Spectrum Percentage in unit 0.01%; 100 mean 1%, =0, use VBIOS default setting.
  3869. usDVISSpreadRateIn10Hz: DVI Spread Spectrum frequency in unit of 10Hz, =0, use VBIOS default setting.
  3870. **********************************************************************************************************************/
  3871. /**************************************************************************/
  3872. // This portion is only used when ext thermal chip or engine/memory clock SS chip is populated on a design
  3873. //Memory SS Info Table
  3874. //Define Memory Clock SS chip ID
  3875. #define ICS91719 1
  3876. #define ICS91720 2
  3877. //Define one structure to inform SW a "block of data" writing to external SS chip via I2C protocol
  3878. typedef struct _ATOM_I2C_DATA_RECORD
  3879. {
  3880. UCHAR ucNunberOfBytes; //Indicates how many bytes SW needs to write to the external ASIC for one block, besides to "Start" and "Stop"
  3881. UCHAR ucI2CData[1]; //I2C data in bytes, should be less than 16 bytes usually
  3882. }ATOM_I2C_DATA_RECORD;
  3883. //Define one structure to inform SW how many blocks of data writing to external SS chip via I2C protocol, in addition to other information
  3884. typedef struct _ATOM_I2C_DEVICE_SETUP_INFO
  3885. {
  3886. ATOM_I2C_ID_CONFIG_ACCESS sucI2cId; //I2C line and HW/SW assisted cap.
  3887. UCHAR ucSSChipID; //SS chip being used
  3888. UCHAR ucSSChipSlaveAddr; //Slave Address to set up this SS chip
  3889. UCHAR ucNumOfI2CDataRecords; //number of data block
  3890. ATOM_I2C_DATA_RECORD asI2CData[1];
  3891. }ATOM_I2C_DEVICE_SETUP_INFO;
  3892. //==========================================================================================
  3893. typedef struct _ATOM_ASIC_MVDD_INFO
  3894. {
  3895. ATOM_COMMON_TABLE_HEADER sHeader;
  3896. ATOM_I2C_DEVICE_SETUP_INFO asI2CSetup[1];
  3897. }ATOM_ASIC_MVDD_INFO;
  3898. //==========================================================================================
  3899. #define ATOM_MCLK_SS_INFO ATOM_ASIC_MVDD_INFO
  3900. //==========================================================================================
  3901. /**************************************************************************/
  3902. typedef struct _ATOM_ASIC_SS_ASSIGNMENT
  3903. {
  3904. ULONG ulTargetClockRange; //Clock Out frequence (VCO ), in unit of 10Khz
  3905. USHORT usSpreadSpectrumPercentage; //in unit of 0.01%
  3906. USHORT usSpreadRateInKhz; //in unit of kHz, modulation freq
  3907. UCHAR ucClockIndication; //Indicate which clock source needs SS
  3908. UCHAR ucSpreadSpectrumMode; //Bit1=0 Down Spread,=1 Center Spread.
  3909. UCHAR ucReserved[2];
  3910. }ATOM_ASIC_SS_ASSIGNMENT;
  3911. //Define ucClockIndication, SW uses the IDs below to search if the SS is required/enabled on a clock branch/signal type.
  3912. //SS is not required or enabled if a match is not found.
  3913. #define ASIC_INTERNAL_MEMORY_SS 1
  3914. #define ASIC_INTERNAL_ENGINE_SS 2
  3915. #define ASIC_INTERNAL_UVD_SS 3
  3916. #define ASIC_INTERNAL_SS_ON_TMDS 4
  3917. #define ASIC_INTERNAL_SS_ON_HDMI 5
  3918. #define ASIC_INTERNAL_SS_ON_LVDS 6
  3919. #define ASIC_INTERNAL_SS_ON_DP 7
  3920. #define ASIC_INTERNAL_SS_ON_DCPLL 8
  3921. #define ASIC_EXTERNAL_SS_ON_DP_CLOCK 9
  3922. typedef struct _ATOM_ASIC_SS_ASSIGNMENT_V2
  3923. {
  3924. ULONG ulTargetClockRange; //For mem/engine/uvd, Clock Out frequence (VCO ), in unit of 10Khz
  3925. //For TMDS/HDMI/LVDS, it is pixel clock , for DP, it is link clock ( 27000 or 16200 )
  3926. USHORT usSpreadSpectrumPercentage; //in unit of 0.01%
  3927. USHORT usSpreadRateIn10Hz; //in unit of 10Hz, modulation freq
  3928. UCHAR ucClockIndication; //Indicate which clock source needs SS
  3929. UCHAR ucSpreadSpectrumMode; //Bit0=0 Down Spread,=1 Center Spread, bit1=0: internal SS bit1=1: external SS
  3930. UCHAR ucReserved[2];
  3931. }ATOM_ASIC_SS_ASSIGNMENT_V2;
  3932. //ucSpreadSpectrumMode
  3933. //#define ATOM_SS_DOWN_SPREAD_MODE_MASK 0x00000000
  3934. //#define ATOM_SS_DOWN_SPREAD_MODE 0x00000000
  3935. //#define ATOM_SS_CENTRE_SPREAD_MODE_MASK 0x00000001
  3936. //#define ATOM_SS_CENTRE_SPREAD_MODE 0x00000001
  3937. //#define ATOM_INTERNAL_SS_MASK 0x00000000
  3938. //#define ATOM_EXTERNAL_SS_MASK 0x00000002
  3939. typedef struct _ATOM_ASIC_INTERNAL_SS_INFO
  3940. {
  3941. ATOM_COMMON_TABLE_HEADER sHeader;
  3942. ATOM_ASIC_SS_ASSIGNMENT asSpreadSpectrum[4];
  3943. }ATOM_ASIC_INTERNAL_SS_INFO;
  3944. typedef struct _ATOM_ASIC_INTERNAL_SS_INFO_V2
  3945. {
  3946. ATOM_COMMON_TABLE_HEADER sHeader;
  3947. ATOM_ASIC_SS_ASSIGNMENT_V2 asSpreadSpectrum[1]; //this is point only.
  3948. }ATOM_ASIC_INTERNAL_SS_INFO_V2;
  3949. typedef struct _ATOM_ASIC_SS_ASSIGNMENT_V3
  3950. {
  3951. ULONG ulTargetClockRange; //For mem/engine/uvd, Clock Out frequence (VCO ), in unit of 10Khz
  3952. //For TMDS/HDMI/LVDS, it is pixel clock , for DP, it is link clock ( 27000 or 16200 )
  3953. USHORT usSpreadSpectrumPercentage; //in unit of 0.01%
  3954. USHORT usSpreadRateIn10Hz; //in unit of 10Hz, modulation freq
  3955. UCHAR ucClockIndication; //Indicate which clock source needs SS
  3956. UCHAR ucSpreadSpectrumMode; //Bit0=0 Down Spread,=1 Center Spread, bit1=0: internal SS bit1=1: external SS
  3957. UCHAR ucReserved[2];
  3958. }ATOM_ASIC_SS_ASSIGNMENT_V3;
  3959. typedef struct _ATOM_ASIC_INTERNAL_SS_INFO_V3
  3960. {
  3961. ATOM_COMMON_TABLE_HEADER sHeader;
  3962. ATOM_ASIC_SS_ASSIGNMENT_V3 asSpreadSpectrum[1]; //this is pointer only.
  3963. }ATOM_ASIC_INTERNAL_SS_INFO_V3;
  3964. //==============================Scratch Pad Definition Portion===============================
  3965. #define ATOM_DEVICE_CONNECT_INFO_DEF 0
  3966. #define ATOM_ROM_LOCATION_DEF 1
  3967. #define ATOM_TV_STANDARD_DEF 2
  3968. #define ATOM_ACTIVE_INFO_DEF 3
  3969. #define ATOM_LCD_INFO_DEF 4
  3970. #define ATOM_DOS_REQ_INFO_DEF 5
  3971. #define ATOM_ACC_CHANGE_INFO_DEF 6
  3972. #define ATOM_DOS_MODE_INFO_DEF 7
  3973. #define ATOM_I2C_CHANNEL_STATUS_DEF 8
  3974. #define ATOM_I2C_CHANNEL_STATUS1_DEF 9
  3975. // BIOS_0_SCRATCH Definition
  3976. #define ATOM_S0_CRT1_MONO 0x00000001L
  3977. #define ATOM_S0_CRT1_COLOR 0x00000002L
  3978. #define ATOM_S0_CRT1_MASK (ATOM_S0_CRT1_MONO+ATOM_S0_CRT1_COLOR)
  3979. #define ATOM_S0_TV1_COMPOSITE_A 0x00000004L
  3980. #define ATOM_S0_TV1_SVIDEO_A 0x00000008L
  3981. #define ATOM_S0_TV1_MASK_A (ATOM_S0_TV1_COMPOSITE_A+ATOM_S0_TV1_SVIDEO_A)
  3982. #define ATOM_S0_CV_A 0x00000010L
  3983. #define ATOM_S0_CV_DIN_A 0x00000020L
  3984. #define ATOM_S0_CV_MASK_A (ATOM_S0_CV_A+ATOM_S0_CV_DIN_A)
  3985. #define ATOM_S0_CRT2_MONO 0x00000100L
  3986. #define ATOM_S0_CRT2_COLOR 0x00000200L
  3987. #define ATOM_S0_CRT2_MASK (ATOM_S0_CRT2_MONO+ATOM_S0_CRT2_COLOR)
  3988. #define ATOM_S0_TV1_COMPOSITE 0x00000400L
  3989. #define ATOM_S0_TV1_SVIDEO 0x00000800L
  3990. #define ATOM_S0_TV1_SCART 0x00004000L
  3991. #define ATOM_S0_TV1_MASK (ATOM_S0_TV1_COMPOSITE+ATOM_S0_TV1_SVIDEO+ATOM_S0_TV1_SCART)
  3992. #define ATOM_S0_CV 0x00001000L
  3993. #define ATOM_S0_CV_DIN 0x00002000L
  3994. #define ATOM_S0_CV_MASK (ATOM_S0_CV+ATOM_S0_CV_DIN)
  3995. #define ATOM_S0_DFP1 0x00010000L
  3996. #define ATOM_S0_DFP2 0x00020000L
  3997. #define ATOM_S0_LCD1 0x00040000L
  3998. #define ATOM_S0_LCD2 0x00080000L
  3999. #define ATOM_S0_DFP6 0x00100000L
  4000. #define ATOM_S0_DFP3 0x00200000L
  4001. #define ATOM_S0_DFP4 0x00400000L
  4002. #define ATOM_S0_DFP5 0x00800000L
  4003. #define ATOM_S0_DFP_MASK ATOM_S0_DFP1 | ATOM_S0_DFP2 | ATOM_S0_DFP3 | ATOM_S0_DFP4 | ATOM_S0_DFP5 | ATOM_S0_DFP6
  4004. #define ATOM_S0_FAD_REGISTER_BUG 0x02000000L // If set, indicates we are running a PCIE asic with
  4005. // the FAD/HDP reg access bug. Bit is read by DAL, this is obsolete from RV5xx
  4006. #define ATOM_S0_THERMAL_STATE_MASK 0x1C000000L
  4007. #define ATOM_S0_THERMAL_STATE_SHIFT 26
  4008. #define ATOM_S0_SYSTEM_POWER_STATE_MASK 0xE0000000L
  4009. #define ATOM_S0_SYSTEM_POWER_STATE_SHIFT 29
  4010. #define ATOM_S0_SYSTEM_POWER_STATE_VALUE_AC 1
  4011. #define ATOM_S0_SYSTEM_POWER_STATE_VALUE_DC 2
  4012. #define ATOM_S0_SYSTEM_POWER_STATE_VALUE_LITEAC 3
  4013. #define ATOM_S0_SYSTEM_POWER_STATE_VALUE_LIT2AC 4
  4014. //Byte aligned definition for BIOS usage
  4015. #define ATOM_S0_CRT1_MONOb0 0x01
  4016. #define ATOM_S0_CRT1_COLORb0 0x02
  4017. #define ATOM_S0_CRT1_MASKb0 (ATOM_S0_CRT1_MONOb0+ATOM_S0_CRT1_COLORb0)
  4018. #define ATOM_S0_TV1_COMPOSITEb0 0x04
  4019. #define ATOM_S0_TV1_SVIDEOb0 0x08
  4020. #define ATOM_S0_TV1_MASKb0 (ATOM_S0_TV1_COMPOSITEb0+ATOM_S0_TV1_SVIDEOb0)
  4021. #define ATOM_S0_CVb0 0x10
  4022. #define ATOM_S0_CV_DINb0 0x20
  4023. #define ATOM_S0_CV_MASKb0 (ATOM_S0_CVb0+ATOM_S0_CV_DINb0)
  4024. #define ATOM_S0_CRT2_MONOb1 0x01
  4025. #define ATOM_S0_CRT2_COLORb1 0x02
  4026. #define ATOM_S0_CRT2_MASKb1 (ATOM_S0_CRT2_MONOb1+ATOM_S0_CRT2_COLORb1)
  4027. #define ATOM_S0_TV1_COMPOSITEb1 0x04
  4028. #define ATOM_S0_TV1_SVIDEOb1 0x08
  4029. #define ATOM_S0_TV1_SCARTb1 0x40
  4030. #define ATOM_S0_TV1_MASKb1 (ATOM_S0_TV1_COMPOSITEb1+ATOM_S0_TV1_SVIDEOb1+ATOM_S0_TV1_SCARTb1)
  4031. #define ATOM_S0_CVb1 0x10
  4032. #define ATOM_S0_CV_DINb1 0x20
  4033. #define ATOM_S0_CV_MASKb1 (ATOM_S0_CVb1+ATOM_S0_CV_DINb1)
  4034. #define ATOM_S0_DFP1b2 0x01
  4035. #define ATOM_S0_DFP2b2 0x02
  4036. #define ATOM_S0_LCD1b2 0x04
  4037. #define ATOM_S0_LCD2b2 0x08
  4038. #define ATOM_S0_DFP6b2 0x10
  4039. #define ATOM_S0_DFP3b2 0x20
  4040. #define ATOM_S0_DFP4b2 0x40
  4041. #define ATOM_S0_DFP5b2 0x80
  4042. #define ATOM_S0_THERMAL_STATE_MASKb3 0x1C
  4043. #define ATOM_S0_THERMAL_STATE_SHIFTb3 2
  4044. #define ATOM_S0_SYSTEM_POWER_STATE_MASKb3 0xE0
  4045. #define ATOM_S0_LCD1_SHIFT 18
  4046. // BIOS_1_SCRATCH Definition
  4047. #define ATOM_S1_ROM_LOCATION_MASK 0x0000FFFFL
  4048. #define ATOM_S1_PCI_BUS_DEV_MASK 0xFFFF0000L
  4049. // BIOS_2_SCRATCH Definition
  4050. #define ATOM_S2_TV1_STANDARD_MASK 0x0000000FL
  4051. #define ATOM_S2_CURRENT_BL_LEVEL_MASK 0x0000FF00L
  4052. #define ATOM_S2_CURRENT_BL_LEVEL_SHIFT 8
  4053. #define ATOM_S2_FORCEDLOWPWRMODE_STATE_MASK 0x0C000000L
  4054. #define ATOM_S2_FORCEDLOWPWRMODE_STATE_MASK_SHIFT 26
  4055. #define ATOM_S2_FORCEDLOWPWRMODE_STATE_CHANGE 0x10000000L
  4056. #define ATOM_S2_DEVICE_DPMS_STATE 0x00010000L
  4057. #define ATOM_S2_VRI_BRIGHT_ENABLE 0x20000000L
  4058. #define ATOM_S2_DISPLAY_ROTATION_0_DEGREE 0x0
  4059. #define ATOM_S2_DISPLAY_ROTATION_90_DEGREE 0x1
  4060. #define ATOM_S2_DISPLAY_ROTATION_180_DEGREE 0x2
  4061. #define ATOM_S2_DISPLAY_ROTATION_270_DEGREE 0x3
  4062. #define ATOM_S2_DISPLAY_ROTATION_DEGREE_SHIFT 30
  4063. #define ATOM_S2_DISPLAY_ROTATION_ANGLE_MASK 0xC0000000L
  4064. //Byte aligned definition for BIOS usage
  4065. #define ATOM_S2_TV1_STANDARD_MASKb0 0x0F
  4066. #define ATOM_S2_CURRENT_BL_LEVEL_MASKb1 0xFF
  4067. #define ATOM_S2_DEVICE_DPMS_STATEb2 0x01
  4068. #define ATOM_S2_DEVICE_DPMS_MASKw1 0x3FF
  4069. #define ATOM_S2_FORCEDLOWPWRMODE_STATE_MASKb3 0x0C
  4070. #define ATOM_S2_FORCEDLOWPWRMODE_STATE_CHANGEb3 0x10
  4071. #define ATOM_S2_VRI_BRIGHT_ENABLEb3 0x20
  4072. #define ATOM_S2_ROTATION_STATE_MASKb3 0xC0
  4073. // BIOS_3_SCRATCH Definition
  4074. #define ATOM_S3_CRT1_ACTIVE 0x00000001L
  4075. #define ATOM_S3_LCD1_ACTIVE 0x00000002L
  4076. #define ATOM_S3_TV1_ACTIVE 0x00000004L
  4077. #define ATOM_S3_DFP1_ACTIVE 0x00000008L
  4078. #define ATOM_S3_CRT2_ACTIVE 0x00000010L
  4079. #define ATOM_S3_LCD2_ACTIVE 0x00000020L
  4080. #define ATOM_S3_DFP6_ACTIVE 0x00000040L
  4081. #define ATOM_S3_DFP2_ACTIVE 0x00000080L
  4082. #define ATOM_S3_CV_ACTIVE 0x00000100L
  4083. #define ATOM_S3_DFP3_ACTIVE 0x00000200L
  4084. #define ATOM_S3_DFP4_ACTIVE 0x00000400L
  4085. #define ATOM_S3_DFP5_ACTIVE 0x00000800L
  4086. #define ATOM_S3_DEVICE_ACTIVE_MASK 0x00000FFFL
  4087. #define ATOM_S3_LCD_FULLEXPANSION_ACTIVE 0x00001000L
  4088. #define ATOM_S3_LCD_EXPANSION_ASPEC_RATIO_ACTIVE 0x00002000L
  4089. #define ATOM_S3_CRT1_CRTC_ACTIVE 0x00010000L
  4090. #define ATOM_S3_LCD1_CRTC_ACTIVE 0x00020000L
  4091. #define ATOM_S3_TV1_CRTC_ACTIVE 0x00040000L
  4092. #define ATOM_S3_DFP1_CRTC_ACTIVE 0x00080000L
  4093. #define ATOM_S3_CRT2_CRTC_ACTIVE 0x00100000L
  4094. #define ATOM_S3_LCD2_CRTC_ACTIVE 0x00200000L
  4095. #define ATOM_S3_DFP6_CRTC_ACTIVE 0x00400000L
  4096. #define ATOM_S3_DFP2_CRTC_ACTIVE 0x00800000L
  4097. #define ATOM_S3_CV_CRTC_ACTIVE 0x01000000L
  4098. #define ATOM_S3_DFP3_CRTC_ACTIVE 0x02000000L
  4099. #define ATOM_S3_DFP4_CRTC_ACTIVE 0x04000000L
  4100. #define ATOM_S3_DFP5_CRTC_ACTIVE 0x08000000L
  4101. #define ATOM_S3_DEVICE_CRTC_ACTIVE_MASK 0x0FFF0000L
  4102. #define ATOM_S3_ASIC_GUI_ENGINE_HUNG 0x20000000L
  4103. //Below two definitions are not supported in pplib, but in the old powerplay in DAL
  4104. #define ATOM_S3_ALLOW_FAST_PWR_SWITCH 0x40000000L
  4105. #define ATOM_S3_RQST_GPU_USE_MIN_PWR 0x80000000L
  4106. //Byte aligned definition for BIOS usage
  4107. #define ATOM_S3_CRT1_ACTIVEb0 0x01
  4108. #define ATOM_S3_LCD1_ACTIVEb0 0x02
  4109. #define ATOM_S3_TV1_ACTIVEb0 0x04
  4110. #define ATOM_S3_DFP1_ACTIVEb0 0x08
  4111. #define ATOM_S3_CRT2_ACTIVEb0 0x10
  4112. #define ATOM_S3_LCD2_ACTIVEb0 0x20
  4113. #define ATOM_S3_DFP6_ACTIVEb0 0x40
  4114. #define ATOM_S3_DFP2_ACTIVEb0 0x80
  4115. #define ATOM_S3_CV_ACTIVEb1 0x01
  4116. #define ATOM_S3_DFP3_ACTIVEb1 0x02
  4117. #define ATOM_S3_DFP4_ACTIVEb1 0x04
  4118. #define ATOM_S3_DFP5_ACTIVEb1 0x08
  4119. #define ATOM_S3_ACTIVE_CRTC1w0 0xFFF
  4120. #define ATOM_S3_CRT1_CRTC_ACTIVEb2 0x01
  4121. #define ATOM_S3_LCD1_CRTC_ACTIVEb2 0x02
  4122. #define ATOM_S3_TV1_CRTC_ACTIVEb2 0x04
  4123. #define ATOM_S3_DFP1_CRTC_ACTIVEb2 0x08
  4124. #define ATOM_S3_CRT2_CRTC_ACTIVEb2 0x10
  4125. #define ATOM_S3_LCD2_CRTC_ACTIVEb2 0x20
  4126. #define ATOM_S3_DFP6_CRTC_ACTIVEb2 0x40
  4127. #define ATOM_S3_DFP2_CRTC_ACTIVEb2 0x80
  4128. #define ATOM_S3_CV_CRTC_ACTIVEb3 0x01
  4129. #define ATOM_S3_DFP3_CRTC_ACTIVEb3 0x02
  4130. #define ATOM_S3_DFP4_CRTC_ACTIVEb3 0x04
  4131. #define ATOM_S3_DFP5_CRTC_ACTIVEb3 0x08
  4132. #define ATOM_S3_ACTIVE_CRTC2w1 0xFFF
  4133. // BIOS_4_SCRATCH Definition
  4134. #define ATOM_S4_LCD1_PANEL_ID_MASK 0x000000FFL
  4135. #define ATOM_S4_LCD1_REFRESH_MASK 0x0000FF00L
  4136. #define ATOM_S4_LCD1_REFRESH_SHIFT 8
  4137. //Byte aligned definition for BIOS usage
  4138. #define ATOM_S4_LCD1_PANEL_ID_MASKb0 0x0FF
  4139. #define ATOM_S4_LCD1_REFRESH_MASKb1 ATOM_S4_LCD1_PANEL_ID_MASKb0
  4140. #define ATOM_S4_VRAM_INFO_MASKb2 ATOM_S4_LCD1_PANEL_ID_MASKb0
  4141. // BIOS_5_SCRATCH Definition, BIOS_5_SCRATCH is used by Firmware only !!!!
  4142. #define ATOM_S5_DOS_REQ_CRT1b0 0x01
  4143. #define ATOM_S5_DOS_REQ_LCD1b0 0x02
  4144. #define ATOM_S5_DOS_REQ_TV1b0 0x04
  4145. #define ATOM_S5_DOS_REQ_DFP1b0 0x08
  4146. #define ATOM_S5_DOS_REQ_CRT2b0 0x10
  4147. #define ATOM_S5_DOS_REQ_LCD2b0 0x20
  4148. #define ATOM_S5_DOS_REQ_DFP6b0 0x40
  4149. #define ATOM_S5_DOS_REQ_DFP2b0 0x80
  4150. #define ATOM_S5_DOS_REQ_CVb1 0x01
  4151. #define ATOM_S5_DOS_REQ_DFP3b1 0x02
  4152. #define ATOM_S5_DOS_REQ_DFP4b1 0x04
  4153. #define ATOM_S5_DOS_REQ_DFP5b1 0x08
  4154. #define ATOM_S5_DOS_REQ_DEVICEw0 0x0FFF
  4155. #define ATOM_S5_DOS_REQ_CRT1 0x0001
  4156. #define ATOM_S5_DOS_REQ_LCD1 0x0002
  4157. #define ATOM_S5_DOS_REQ_TV1 0x0004
  4158. #define ATOM_S5_DOS_REQ_DFP1 0x0008
  4159. #define ATOM_S5_DOS_REQ_CRT2 0x0010
  4160. #define ATOM_S5_DOS_REQ_LCD2 0x0020
  4161. #define ATOM_S5_DOS_REQ_DFP6 0x0040
  4162. #define ATOM_S5_DOS_REQ_DFP2 0x0080
  4163. #define ATOM_S5_DOS_REQ_CV 0x0100
  4164. #define ATOM_S5_DOS_REQ_DFP3 0x0200
  4165. #define ATOM_S5_DOS_REQ_DFP4 0x0400
  4166. #define ATOM_S5_DOS_REQ_DFP5 0x0800
  4167. #define ATOM_S5_DOS_FORCE_CRT1b2 ATOM_S5_DOS_REQ_CRT1b0
  4168. #define ATOM_S5_DOS_FORCE_TV1b2 ATOM_S5_DOS_REQ_TV1b0
  4169. #define ATOM_S5_DOS_FORCE_CRT2b2 ATOM_S5_DOS_REQ_CRT2b0
  4170. #define ATOM_S5_DOS_FORCE_CVb3 ATOM_S5_DOS_REQ_CVb1
  4171. #define ATOM_S5_DOS_FORCE_DEVICEw1 (ATOM_S5_DOS_FORCE_CRT1b2+ATOM_S5_DOS_FORCE_TV1b2+ATOM_S5_DOS_FORCE_CRT2b2+\
  4172. (ATOM_S5_DOS_FORCE_CVb3<<8))
  4173. // BIOS_6_SCRATCH Definition
  4174. #define ATOM_S6_DEVICE_CHANGE 0x00000001L
  4175. #define ATOM_S6_SCALER_CHANGE 0x00000002L
  4176. #define ATOM_S6_LID_CHANGE 0x00000004L
  4177. #define ATOM_S6_DOCKING_CHANGE 0x00000008L
  4178. #define ATOM_S6_ACC_MODE 0x00000010L
  4179. #define ATOM_S6_EXT_DESKTOP_MODE 0x00000020L
  4180. #define ATOM_S6_LID_STATE 0x00000040L
  4181. #define ATOM_S6_DOCK_STATE 0x00000080L
  4182. #define ATOM_S6_CRITICAL_STATE 0x00000100L
  4183. #define ATOM_S6_HW_I2C_BUSY_STATE 0x00000200L
  4184. #define ATOM_S6_THERMAL_STATE_CHANGE 0x00000400L
  4185. #define ATOM_S6_INTERRUPT_SET_BY_BIOS 0x00000800L
  4186. #define ATOM_S6_REQ_LCD_EXPANSION_FULL 0x00001000L //Normal expansion Request bit for LCD
  4187. #define ATOM_S6_REQ_LCD_EXPANSION_ASPEC_RATIO 0x00002000L //Aspect ratio expansion Request bit for LCD
  4188. #define ATOM_S6_DISPLAY_STATE_CHANGE 0x00004000L //This bit is recycled when ATOM_BIOS_INFO_BIOS_SCRATCH6_SCL2_REDEFINE is set,previously it's SCL2_H_expansion
  4189. #define ATOM_S6_I2C_STATE_CHANGE 0x00008000L //This bit is recycled,when ATOM_BIOS_INFO_BIOS_SCRATCH6_SCL2_REDEFINE is set,previously it's SCL2_V_expansion
  4190. #define ATOM_S6_ACC_REQ_CRT1 0x00010000L
  4191. #define ATOM_S6_ACC_REQ_LCD1 0x00020000L
  4192. #define ATOM_S6_ACC_REQ_TV1 0x00040000L
  4193. #define ATOM_S6_ACC_REQ_DFP1 0x00080000L
  4194. #define ATOM_S6_ACC_REQ_CRT2 0x00100000L
  4195. #define ATOM_S6_ACC_REQ_LCD2 0x00200000L
  4196. #define ATOM_S6_ACC_REQ_DFP6 0x00400000L
  4197. #define ATOM_S6_ACC_REQ_DFP2 0x00800000L
  4198. #define ATOM_S6_ACC_REQ_CV 0x01000000L
  4199. #define ATOM_S6_ACC_REQ_DFP3 0x02000000L
  4200. #define ATOM_S6_ACC_REQ_DFP4 0x04000000L
  4201. #define ATOM_S6_ACC_REQ_DFP5 0x08000000L
  4202. #define ATOM_S6_ACC_REQ_MASK 0x0FFF0000L
  4203. #define ATOM_S6_SYSTEM_POWER_MODE_CHANGE 0x10000000L
  4204. #define ATOM_S6_ACC_BLOCK_DISPLAY_SWITCH 0x20000000L
  4205. #define ATOM_S6_VRI_BRIGHTNESS_CHANGE 0x40000000L
  4206. #define ATOM_S6_CONFIG_DISPLAY_CHANGE_MASK 0x80000000L
  4207. //Byte aligned definition for BIOS usage
  4208. #define ATOM_S6_DEVICE_CHANGEb0 0x01
  4209. #define ATOM_S6_SCALER_CHANGEb0 0x02
  4210. #define ATOM_S6_LID_CHANGEb0 0x04
  4211. #define ATOM_S6_DOCKING_CHANGEb0 0x08
  4212. #define ATOM_S6_ACC_MODEb0 0x10
  4213. #define ATOM_S6_EXT_DESKTOP_MODEb0 0x20
  4214. #define ATOM_S6_LID_STATEb0 0x40
  4215. #define ATOM_S6_DOCK_STATEb0 0x80
  4216. #define ATOM_S6_CRITICAL_STATEb1 0x01
  4217. #define ATOM_S6_HW_I2C_BUSY_STATEb1 0x02
  4218. #define ATOM_S6_THERMAL_STATE_CHANGEb1 0x04
  4219. #define ATOM_S6_INTERRUPT_SET_BY_BIOSb1 0x08
  4220. #define ATOM_S6_REQ_LCD_EXPANSION_FULLb1 0x10
  4221. #define ATOM_S6_REQ_LCD_EXPANSION_ASPEC_RATIOb1 0x20
  4222. #define ATOM_S6_ACC_REQ_CRT1b2 0x01
  4223. #define ATOM_S6_ACC_REQ_LCD1b2 0x02
  4224. #define ATOM_S6_ACC_REQ_TV1b2 0x04
  4225. #define ATOM_S6_ACC_REQ_DFP1b2 0x08
  4226. #define ATOM_S6_ACC_REQ_CRT2b2 0x10
  4227. #define ATOM_S6_ACC_REQ_LCD2b2 0x20
  4228. #define ATOM_S6_ACC_REQ_DFP6b2 0x40
  4229. #define ATOM_S6_ACC_REQ_DFP2b2 0x80
  4230. #define ATOM_S6_ACC_REQ_CVb3 0x01
  4231. #define ATOM_S6_ACC_REQ_DFP3b3 0x02
  4232. #define ATOM_S6_ACC_REQ_DFP4b3 0x04
  4233. #define ATOM_S6_ACC_REQ_DFP5b3 0x08
  4234. #define ATOM_S6_ACC_REQ_DEVICEw1 ATOM_S5_DOS_REQ_DEVICEw0
  4235. #define ATOM_S6_SYSTEM_POWER_MODE_CHANGEb3 0x10
  4236. #define ATOM_S6_ACC_BLOCK_DISPLAY_SWITCHb3 0x20
  4237. #define ATOM_S6_VRI_BRIGHTNESS_CHANGEb3 0x40
  4238. #define ATOM_S6_CONFIG_DISPLAY_CHANGEb3 0x80
  4239. #define ATOM_S6_DEVICE_CHANGE_SHIFT 0
  4240. #define ATOM_S6_SCALER_CHANGE_SHIFT 1
  4241. #define ATOM_S6_LID_CHANGE_SHIFT 2
  4242. #define ATOM_S6_DOCKING_CHANGE_SHIFT 3
  4243. #define ATOM_S6_ACC_MODE_SHIFT 4
  4244. #define ATOM_S6_EXT_DESKTOP_MODE_SHIFT 5
  4245. #define ATOM_S6_LID_STATE_SHIFT 6
  4246. #define ATOM_S6_DOCK_STATE_SHIFT 7
  4247. #define ATOM_S6_CRITICAL_STATE_SHIFT 8
  4248. #define ATOM_S6_HW_I2C_BUSY_STATE_SHIFT 9
  4249. #define ATOM_S6_THERMAL_STATE_CHANGE_SHIFT 10
  4250. #define ATOM_S6_INTERRUPT_SET_BY_BIOS_SHIFT 11
  4251. #define ATOM_S6_REQ_SCALER_SHIFT 12
  4252. #define ATOM_S6_REQ_SCALER_ARATIO_SHIFT 13
  4253. #define ATOM_S6_DISPLAY_STATE_CHANGE_SHIFT 14
  4254. #define ATOM_S6_I2C_STATE_CHANGE_SHIFT 15
  4255. #define ATOM_S6_SYSTEM_POWER_MODE_CHANGE_SHIFT 28
  4256. #define ATOM_S6_ACC_BLOCK_DISPLAY_SWITCH_SHIFT 29
  4257. #define ATOM_S6_VRI_BRIGHTNESS_CHANGE_SHIFT 30
  4258. #define ATOM_S6_CONFIG_DISPLAY_CHANGE_SHIFT 31
  4259. // BIOS_7_SCRATCH Definition, BIOS_7_SCRATCH is used by Firmware only !!!!
  4260. #define ATOM_S7_DOS_MODE_TYPEb0 0x03
  4261. #define ATOM_S7_DOS_MODE_VGAb0 0x00
  4262. #define ATOM_S7_DOS_MODE_VESAb0 0x01
  4263. #define ATOM_S7_DOS_MODE_EXTb0 0x02
  4264. #define ATOM_S7_DOS_MODE_PIXEL_DEPTHb0 0x0C
  4265. #define ATOM_S7_DOS_MODE_PIXEL_FORMATb0 0xF0
  4266. #define ATOM_S7_DOS_8BIT_DAC_ENb1 0x01
  4267. #define ATOM_S7_DOS_MODE_NUMBERw1 0x0FFFF
  4268. #define ATOM_S7_DOS_8BIT_DAC_EN_SHIFT 8
  4269. // BIOS_8_SCRATCH Definition
  4270. #define ATOM_S8_I2C_CHANNEL_BUSY_MASK 0x00000FFFF
  4271. #define ATOM_S8_I2C_HW_ENGINE_BUSY_MASK 0x0FFFF0000
  4272. #define ATOM_S8_I2C_CHANNEL_BUSY_SHIFT 0
  4273. #define ATOM_S8_I2C_ENGINE_BUSY_SHIFT 16
  4274. // BIOS_9_SCRATCH Definition
  4275. #ifndef ATOM_S9_I2C_CHANNEL_COMPLETED_MASK
  4276. #define ATOM_S9_I2C_CHANNEL_COMPLETED_MASK 0x0000FFFF
  4277. #endif
  4278. #ifndef ATOM_S9_I2C_CHANNEL_ABORTED_MASK
  4279. #define ATOM_S9_I2C_CHANNEL_ABORTED_MASK 0xFFFF0000
  4280. #endif
  4281. #ifndef ATOM_S9_I2C_CHANNEL_COMPLETED_SHIFT
  4282. #define ATOM_S9_I2C_CHANNEL_COMPLETED_SHIFT 0
  4283. #endif
  4284. #ifndef ATOM_S9_I2C_CHANNEL_ABORTED_SHIFT
  4285. #define ATOM_S9_I2C_CHANNEL_ABORTED_SHIFT 16
  4286. #endif
  4287. #define ATOM_FLAG_SET 0x20
  4288. #define ATOM_FLAG_CLEAR 0
  4289. #define CLEAR_ATOM_S6_ACC_MODE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_ACC_MODE_SHIFT | ATOM_FLAG_CLEAR)
  4290. #define SET_ATOM_S6_DEVICE_CHANGE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_DEVICE_CHANGE_SHIFT | ATOM_FLAG_SET)
  4291. #define SET_ATOM_S6_VRI_BRIGHTNESS_CHANGE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_VRI_BRIGHTNESS_CHANGE_SHIFT | ATOM_FLAG_SET)
  4292. #define SET_ATOM_S6_SCALER_CHANGE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_SCALER_CHANGE_SHIFT | ATOM_FLAG_SET)
  4293. #define SET_ATOM_S6_LID_CHANGE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_LID_CHANGE_SHIFT | ATOM_FLAG_SET)
  4294. #define SET_ATOM_S6_LID_STATE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_LID_STATE_SHIFT | ATOM_FLAG_SET)
  4295. #define CLEAR_ATOM_S6_LID_STATE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_LID_STATE_SHIFT | ATOM_FLAG_CLEAR)
  4296. #define SET_ATOM_S6_DOCK_CHANGE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_DOCKING_CHANGE_SHIFT | ATOM_FLAG_SET)
  4297. #define SET_ATOM_S6_DOCK_STATE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_DOCK_STATE_SHIFT | ATOM_FLAG_SET)
  4298. #define CLEAR_ATOM_S6_DOCK_STATE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_DOCK_STATE_SHIFT | ATOM_FLAG_CLEAR)
  4299. #define SET_ATOM_S6_THERMAL_STATE_CHANGE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_THERMAL_STATE_CHANGE_SHIFT | ATOM_FLAG_SET)
  4300. #define SET_ATOM_S6_SYSTEM_POWER_MODE_CHANGE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_SYSTEM_POWER_MODE_CHANGE_SHIFT | ATOM_FLAG_SET)
  4301. #define SET_ATOM_S6_INTERRUPT_SET_BY_BIOS ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_INTERRUPT_SET_BY_BIOS_SHIFT | ATOM_FLAG_SET)
  4302. #define SET_ATOM_S6_CRITICAL_STATE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_CRITICAL_STATE_SHIFT | ATOM_FLAG_SET)
  4303. #define CLEAR_ATOM_S6_CRITICAL_STATE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_CRITICAL_STATE_SHIFT | ATOM_FLAG_CLEAR)
  4304. #define SET_ATOM_S6_REQ_SCALER ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_REQ_SCALER_SHIFT | ATOM_FLAG_SET)
  4305. #define CLEAR_ATOM_S6_REQ_SCALER ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_REQ_SCALER_SHIFT | ATOM_FLAG_CLEAR )
  4306. #define SET_ATOM_S6_REQ_SCALER_ARATIO ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_REQ_SCALER_ARATIO_SHIFT | ATOM_FLAG_SET )
  4307. #define CLEAR_ATOM_S6_REQ_SCALER_ARATIO ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_REQ_SCALER_ARATIO_SHIFT | ATOM_FLAG_CLEAR )
  4308. #define SET_ATOM_S6_I2C_STATE_CHANGE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_I2C_STATE_CHANGE_SHIFT | ATOM_FLAG_SET )
  4309. #define SET_ATOM_S6_DISPLAY_STATE_CHANGE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_DISPLAY_STATE_CHANGE_SHIFT | ATOM_FLAG_SET )
  4310. #define SET_ATOM_S6_DEVICE_RECONFIG ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_CONFIG_DISPLAY_CHANGE_SHIFT | ATOM_FLAG_SET)
  4311. #define CLEAR_ATOM_S0_LCD1 ((ATOM_DEVICE_CONNECT_INFO_DEF << 8 )| ATOM_S0_LCD1_SHIFT | ATOM_FLAG_CLEAR )
  4312. #define SET_ATOM_S7_DOS_8BIT_DAC_EN ((ATOM_DOS_MODE_INFO_DEF << 8 )|ATOM_S7_DOS_8BIT_DAC_EN_SHIFT | ATOM_FLAG_SET )
  4313. #define CLEAR_ATOM_S7_DOS_8BIT_DAC_EN ((ATOM_DOS_MODE_INFO_DEF << 8 )|ATOM_S7_DOS_8BIT_DAC_EN_SHIFT | ATOM_FLAG_CLEAR )
  4314. /****************************************************************************/
  4315. //Portion II: Definitinos only used in Driver
  4316. /****************************************************************************/
  4317. // Macros used by driver
  4318. #ifdef __cplusplus
  4319. #define GetIndexIntoMasterTable(MasterOrData, FieldName) ((reinterpret_cast<char*>(&(static_cast<ATOM_MASTER_LIST_OF_##MasterOrData##_TABLES*>(0))->FieldName)-static_cast<char*>(0))/sizeof(USHORT))
  4320. #define GET_COMMAND_TABLE_COMMANDSET_REVISION(TABLE_HEADER_OFFSET) (((static_cast<ATOM_COMMON_TABLE_HEADER*>(TABLE_HEADER_OFFSET))->ucTableFormatRevision )&0x3F)
  4321. #define GET_COMMAND_TABLE_PARAMETER_REVISION(TABLE_HEADER_OFFSET) (((static_cast<ATOM_COMMON_TABLE_HEADER*>(TABLE_HEADER_OFFSET))->ucTableContentRevision)&0x3F)
  4322. #else // not __cplusplus
  4323. #define GetIndexIntoMasterTable(MasterOrData, FieldName) (((char*)(&((ATOM_MASTER_LIST_OF_##MasterOrData##_TABLES*)0)->FieldName)-(char*)0)/sizeof(USHORT))
  4324. #define GET_COMMAND_TABLE_COMMANDSET_REVISION(TABLE_HEADER_OFFSET) ((((ATOM_COMMON_TABLE_HEADER*)TABLE_HEADER_OFFSET)->ucTableFormatRevision)&0x3F)
  4325. #define GET_COMMAND_TABLE_PARAMETER_REVISION(TABLE_HEADER_OFFSET) ((((ATOM_COMMON_TABLE_HEADER*)TABLE_HEADER_OFFSET)->ucTableContentRevision)&0x3F)
  4326. #endif // __cplusplus
  4327. #define GET_DATA_TABLE_MAJOR_REVISION GET_COMMAND_TABLE_COMMANDSET_REVISION
  4328. #define GET_DATA_TABLE_MINOR_REVISION GET_COMMAND_TABLE_PARAMETER_REVISION
  4329. /****************************************************************************/
  4330. //Portion III: Definitinos only used in VBIOS
  4331. /****************************************************************************/
  4332. #define ATOM_DAC_SRC 0x80
  4333. #define ATOM_SRC_DAC1 0
  4334. #define ATOM_SRC_DAC2 0x80
  4335. typedef struct _MEMORY_PLLINIT_PARAMETERS
  4336. {
  4337. ULONG ulTargetMemoryClock; //In 10Khz unit
  4338. UCHAR ucAction; //not define yet
  4339. UCHAR ucFbDiv_Hi; //Fbdiv Hi byte
  4340. UCHAR ucFbDiv; //FB value
  4341. UCHAR ucPostDiv; //Post div
  4342. }MEMORY_PLLINIT_PARAMETERS;
  4343. #define MEMORY_PLLINIT_PS_ALLOCATION MEMORY_PLLINIT_PARAMETERS
  4344. #define GPIO_PIN_WRITE 0x01
  4345. #define GPIO_PIN_READ 0x00
  4346. typedef struct _GPIO_PIN_CONTROL_PARAMETERS
  4347. {
  4348. UCHAR ucGPIO_ID; //return value, read from GPIO pins
  4349. UCHAR ucGPIOBitShift; //define which bit in uGPIOBitVal need to be update
  4350. UCHAR ucGPIOBitVal; //Set/Reset corresponding bit defined in ucGPIOBitMask
  4351. UCHAR ucAction; //=GPIO_PIN_WRITE: Read; =GPIO_PIN_READ: Write
  4352. }GPIO_PIN_CONTROL_PARAMETERS;
  4353. typedef struct _ENABLE_SCALER_PARAMETERS
  4354. {
  4355. UCHAR ucScaler; // ATOM_SCALER1, ATOM_SCALER2
  4356. UCHAR ucEnable; // ATOM_SCALER_DISABLE or ATOM_SCALER_CENTER or ATOM_SCALER_EXPANSION
  4357. UCHAR ucTVStandard; //
  4358. UCHAR ucPadding[1];
  4359. }ENABLE_SCALER_PARAMETERS;
  4360. #define ENABLE_SCALER_PS_ALLOCATION ENABLE_SCALER_PARAMETERS
  4361. //ucEnable:
  4362. #define SCALER_BYPASS_AUTO_CENTER_NO_REPLICATION 0
  4363. #define SCALER_BYPASS_AUTO_CENTER_AUTO_REPLICATION 1
  4364. #define SCALER_ENABLE_2TAP_ALPHA_MODE 2
  4365. #define SCALER_ENABLE_MULTITAP_MODE 3
  4366. typedef struct _ENABLE_HARDWARE_ICON_CURSOR_PARAMETERS
  4367. {
  4368. ULONG usHWIconHorzVertPosn; // Hardware Icon Vertical position
  4369. UCHAR ucHWIconVertOffset; // Hardware Icon Vertical offset
  4370. UCHAR ucHWIconHorzOffset; // Hardware Icon Horizontal offset
  4371. UCHAR ucSelection; // ATOM_CURSOR1 or ATOM_ICON1 or ATOM_CURSOR2 or ATOM_ICON2
  4372. UCHAR ucEnable; // ATOM_ENABLE or ATOM_DISABLE
  4373. }ENABLE_HARDWARE_ICON_CURSOR_PARAMETERS;
  4374. typedef struct _ENABLE_HARDWARE_ICON_CURSOR_PS_ALLOCATION
  4375. {
  4376. ENABLE_HARDWARE_ICON_CURSOR_PARAMETERS sEnableIcon;
  4377. ENABLE_CRTC_PARAMETERS sReserved;
  4378. }ENABLE_HARDWARE_ICON_CURSOR_PS_ALLOCATION;
  4379. typedef struct _ENABLE_GRAPH_SURFACE_PARAMETERS
  4380. {
  4381. USHORT usHight; // Image Hight
  4382. USHORT usWidth; // Image Width
  4383. UCHAR ucSurface; // Surface 1 or 2
  4384. UCHAR ucPadding[3];
  4385. }ENABLE_GRAPH_SURFACE_PARAMETERS;
  4386. typedef struct _ENABLE_GRAPH_SURFACE_PARAMETERS_V1_2
  4387. {
  4388. USHORT usHight; // Image Hight
  4389. USHORT usWidth; // Image Width
  4390. UCHAR ucSurface; // Surface 1 or 2
  4391. UCHAR ucEnable; // ATOM_ENABLE or ATOM_DISABLE
  4392. UCHAR ucPadding[2];
  4393. }ENABLE_GRAPH_SURFACE_PARAMETERS_V1_2;
  4394. typedef struct _ENABLE_GRAPH_SURFACE_PARAMETERS_V1_3
  4395. {
  4396. USHORT usHight; // Image Hight
  4397. USHORT usWidth; // Image Width
  4398. UCHAR ucSurface; // Surface 1 or 2
  4399. UCHAR ucEnable; // ATOM_ENABLE or ATOM_DISABLE
  4400. USHORT usDeviceId; // Active Device Id for this surface. If no device, set to 0.
  4401. }ENABLE_GRAPH_SURFACE_PARAMETERS_V1_3;
  4402. typedef struct _ENABLE_GRAPH_SURFACE_PS_ALLOCATION
  4403. {
  4404. ENABLE_GRAPH_SURFACE_PARAMETERS sSetSurface;
  4405. ENABLE_YUV_PS_ALLOCATION sReserved; // Don't set this one
  4406. }ENABLE_GRAPH_SURFACE_PS_ALLOCATION;
  4407. typedef struct _MEMORY_CLEAN_UP_PARAMETERS
  4408. {
  4409. USHORT usMemoryStart; //in 8Kb boundary, offset from memory base address
  4410. USHORT usMemorySize; //8Kb blocks aligned
  4411. }MEMORY_CLEAN_UP_PARAMETERS;
  4412. #define MEMORY_CLEAN_UP_PS_ALLOCATION MEMORY_CLEAN_UP_PARAMETERS
  4413. typedef struct _GET_DISPLAY_SURFACE_SIZE_PARAMETERS
  4414. {
  4415. USHORT usX_Size; //When use as input parameter, usX_Size indicates which CRTC
  4416. USHORT usY_Size;
  4417. }GET_DISPLAY_SURFACE_SIZE_PARAMETERS;
  4418. typedef struct _INDIRECT_IO_ACCESS
  4419. {
  4420. ATOM_COMMON_TABLE_HEADER sHeader;
  4421. UCHAR IOAccessSequence[256];
  4422. } INDIRECT_IO_ACCESS;
  4423. #define INDIRECT_READ 0x00
  4424. #define INDIRECT_WRITE 0x80
  4425. #define INDIRECT_IO_MM 0
  4426. #define INDIRECT_IO_PLL 1
  4427. #define INDIRECT_IO_MC 2
  4428. #define INDIRECT_IO_PCIE 3
  4429. #define INDIRECT_IO_PCIEP 4
  4430. #define INDIRECT_IO_NBMISC 5
  4431. #define INDIRECT_IO_PLL_READ INDIRECT_IO_PLL | INDIRECT_READ
  4432. #define INDIRECT_IO_PLL_WRITE INDIRECT_IO_PLL | INDIRECT_WRITE
  4433. #define INDIRECT_IO_MC_READ INDIRECT_IO_MC | INDIRECT_READ
  4434. #define INDIRECT_IO_MC_WRITE INDIRECT_IO_MC | INDIRECT_WRITE
  4435. #define INDIRECT_IO_PCIE_READ INDIRECT_IO_PCIE | INDIRECT_READ
  4436. #define INDIRECT_IO_PCIE_WRITE INDIRECT_IO_PCIE | INDIRECT_WRITE
  4437. #define INDIRECT_IO_PCIEP_READ INDIRECT_IO_PCIEP | INDIRECT_READ
  4438. #define INDIRECT_IO_PCIEP_WRITE INDIRECT_IO_PCIEP | INDIRECT_WRITE
  4439. #define INDIRECT_IO_NBMISC_READ INDIRECT_IO_NBMISC | INDIRECT_READ
  4440. #define INDIRECT_IO_NBMISC_WRITE INDIRECT_IO_NBMISC | INDIRECT_WRITE
  4441. typedef struct _ATOM_OEM_INFO
  4442. {
  4443. ATOM_COMMON_TABLE_HEADER sHeader;
  4444. ATOM_I2C_ID_CONFIG_ACCESS sucI2cId;
  4445. }ATOM_OEM_INFO;
  4446. typedef struct _ATOM_TV_MODE
  4447. {
  4448. UCHAR ucVMode_Num; //Video mode number
  4449. UCHAR ucTV_Mode_Num; //Internal TV mode number
  4450. }ATOM_TV_MODE;
  4451. typedef struct _ATOM_BIOS_INT_TVSTD_MODE
  4452. {
  4453. ATOM_COMMON_TABLE_HEADER sHeader;
  4454. USHORT usTV_Mode_LUT_Offset; // Pointer to standard to internal number conversion table
  4455. USHORT usTV_FIFO_Offset; // Pointer to FIFO entry table
  4456. USHORT usNTSC_Tbl_Offset; // Pointer to SDTV_Mode_NTSC table
  4457. USHORT usPAL_Tbl_Offset; // Pointer to SDTV_Mode_PAL table
  4458. USHORT usCV_Tbl_Offset; // Pointer to SDTV_Mode_PAL table
  4459. }ATOM_BIOS_INT_TVSTD_MODE;
  4460. typedef struct _ATOM_TV_MODE_SCALER_PTR
  4461. {
  4462. USHORT ucFilter0_Offset; //Pointer to filter format 0 coefficients
  4463. USHORT usFilter1_Offset; //Pointer to filter format 0 coefficients
  4464. UCHAR ucTV_Mode_Num;
  4465. }ATOM_TV_MODE_SCALER_PTR;
  4466. typedef struct _ATOM_STANDARD_VESA_TIMING
  4467. {
  4468. ATOM_COMMON_TABLE_HEADER sHeader;
  4469. ATOM_DTD_FORMAT aModeTimings[16]; // 16 is not the real array number, just for initial allocation
  4470. }ATOM_STANDARD_VESA_TIMING;
  4471. typedef struct _ATOM_STD_FORMAT
  4472. {
  4473. USHORT usSTD_HDisp;
  4474. USHORT usSTD_VDisp;
  4475. USHORT usSTD_RefreshRate;
  4476. USHORT usReserved;
  4477. }ATOM_STD_FORMAT;
  4478. typedef struct _ATOM_VESA_TO_EXTENDED_MODE
  4479. {
  4480. USHORT usVESA_ModeNumber;
  4481. USHORT usExtendedModeNumber;
  4482. }ATOM_VESA_TO_EXTENDED_MODE;
  4483. typedef struct _ATOM_VESA_TO_INTENAL_MODE_LUT
  4484. {
  4485. ATOM_COMMON_TABLE_HEADER sHeader;
  4486. ATOM_VESA_TO_EXTENDED_MODE asVESA_ToExtendedModeInfo[76];
  4487. }ATOM_VESA_TO_INTENAL_MODE_LUT;
  4488. /*************** ATOM Memory Related Data Structure ***********************/
  4489. typedef struct _ATOM_MEMORY_VENDOR_BLOCK{
  4490. UCHAR ucMemoryType;
  4491. UCHAR ucMemoryVendor;
  4492. UCHAR ucAdjMCId;
  4493. UCHAR ucDynClkId;
  4494. ULONG ulDllResetClkRange;
  4495. }ATOM_MEMORY_VENDOR_BLOCK;
  4496. typedef struct _ATOM_MEMORY_SETTING_ID_CONFIG{
  4497. #if ATOM_BIG_ENDIAN
  4498. ULONG ucMemBlkId:8;
  4499. ULONG ulMemClockRange:24;
  4500. #else
  4501. ULONG ulMemClockRange:24;
  4502. ULONG ucMemBlkId:8;
  4503. #endif
  4504. }ATOM_MEMORY_SETTING_ID_CONFIG;
  4505. typedef union _ATOM_MEMORY_SETTING_ID_CONFIG_ACCESS
  4506. {
  4507. ATOM_MEMORY_SETTING_ID_CONFIG slAccess;
  4508. ULONG ulAccess;
  4509. }ATOM_MEMORY_SETTING_ID_CONFIG_ACCESS;
  4510. typedef struct _ATOM_MEMORY_SETTING_DATA_BLOCK{
  4511. ATOM_MEMORY_SETTING_ID_CONFIG_ACCESS ulMemoryID;
  4512. ULONG aulMemData[1];
  4513. }ATOM_MEMORY_SETTING_DATA_BLOCK;
  4514. typedef struct _ATOM_INIT_REG_INDEX_FORMAT{
  4515. USHORT usRegIndex; // MC register index
  4516. UCHAR ucPreRegDataLength; // offset in ATOM_INIT_REG_DATA_BLOCK.saRegDataBuf
  4517. }ATOM_INIT_REG_INDEX_FORMAT;
  4518. typedef struct _ATOM_INIT_REG_BLOCK{
  4519. USHORT usRegIndexTblSize; //size of asRegIndexBuf
  4520. USHORT usRegDataBlkSize; //size of ATOM_MEMORY_SETTING_DATA_BLOCK
  4521. ATOM_INIT_REG_INDEX_FORMAT asRegIndexBuf[1];
  4522. ATOM_MEMORY_SETTING_DATA_BLOCK asRegDataBuf[1];
  4523. }ATOM_INIT_REG_BLOCK;
  4524. #define END_OF_REG_INDEX_BLOCK 0x0ffff
  4525. #define END_OF_REG_DATA_BLOCK 0x00000000
  4526. #define ATOM_INIT_REG_MASK_FLAG 0x80
  4527. #define CLOCK_RANGE_HIGHEST 0x00ffffff
  4528. #define VALUE_DWORD SIZEOF ULONG
  4529. #define VALUE_SAME_AS_ABOVE 0
  4530. #define VALUE_MASK_DWORD 0x84
  4531. #define INDEX_ACCESS_RANGE_BEGIN (VALUE_DWORD + 1)
  4532. #define INDEX_ACCESS_RANGE_END (INDEX_ACCESS_RANGE_BEGIN + 1)
  4533. #define VALUE_INDEX_ACCESS_SINGLE (INDEX_ACCESS_RANGE_END + 1)
  4534. //#define ACCESS_MCIODEBUGIND 0x40 //defined in BIOS code
  4535. #define ACCESS_PLACEHOLDER 0x80
  4536. typedef struct _ATOM_MC_INIT_PARAM_TABLE
  4537. {
  4538. ATOM_COMMON_TABLE_HEADER sHeader;
  4539. USHORT usAdjustARB_SEQDataOffset;
  4540. USHORT usMCInitMemTypeTblOffset;
  4541. USHORT usMCInitCommonTblOffset;
  4542. USHORT usMCInitPowerDownTblOffset;
  4543. ULONG ulARB_SEQDataBuf[32];
  4544. ATOM_INIT_REG_BLOCK asMCInitMemType;
  4545. ATOM_INIT_REG_BLOCK asMCInitCommon;
  4546. }ATOM_MC_INIT_PARAM_TABLE;
  4547. #define _4Mx16 0x2
  4548. #define _4Mx32 0x3
  4549. #define _8Mx16 0x12
  4550. #define _8Mx32 0x13
  4551. #define _16Mx16 0x22
  4552. #define _16Mx32 0x23
  4553. #define _32Mx16 0x32
  4554. #define _32Mx32 0x33
  4555. #define _64Mx8 0x41
  4556. #define _64Mx16 0x42
  4557. #define _64Mx32 0x43
  4558. #define _128Mx8 0x51
  4559. #define _128Mx16 0x52
  4560. #define _256Mx8 0x61
  4561. #define SAMSUNG 0x1
  4562. #define INFINEON 0x2
  4563. #define ELPIDA 0x3
  4564. #define ETRON 0x4
  4565. #define NANYA 0x5
  4566. #define HYNIX 0x6
  4567. #define MOSEL 0x7
  4568. #define WINBOND 0x8
  4569. #define ESMT 0x9
  4570. #define MICRON 0xF
  4571. #define QIMONDA INFINEON
  4572. #define PROMOS MOSEL
  4573. #define KRETON INFINEON
  4574. #define ELIXIR NANYA
  4575. /////////////Support for GDDR5 MC uCode to reside in upper 64K of ROM/////////////
  4576. #define UCODE_ROM_START_ADDRESS 0x1b800
  4577. #define UCODE_SIGNATURE 0x4375434d // 'MCuC' - MC uCode
  4578. //uCode block header for reference
  4579. typedef struct _MCuCodeHeader
  4580. {
  4581. ULONG ulSignature;
  4582. UCHAR ucRevision;
  4583. UCHAR ucChecksum;
  4584. UCHAR ucReserved1;
  4585. UCHAR ucReserved2;
  4586. USHORT usParametersLength;
  4587. USHORT usUCodeLength;
  4588. USHORT usReserved1;
  4589. USHORT usReserved2;
  4590. } MCuCodeHeader;
  4591. //////////////////////////////////////////////////////////////////////////////////
  4592. #define ATOM_MAX_NUMBER_OF_VRAM_MODULE 16
  4593. #define ATOM_VRAM_MODULE_MEMORY_VENDOR_ID_MASK 0xF
  4594. typedef struct _ATOM_VRAM_MODULE_V1
  4595. {
  4596. ULONG ulReserved;
  4597. USHORT usEMRSValue;
  4598. USHORT usMRSValue;
  4599. USHORT usReserved;
  4600. UCHAR ucExtMemoryID; // An external indicator (by hardcode, callback or pin) to tell what is the current memory module
  4601. UCHAR ucMemoryType; // [7:4]=0x1:DDR1;=0x2:DDR2;=0x3:DDR3;=0x4:DDR4;[3:0] reserved;
  4602. UCHAR ucMemoryVenderID; // Predefined,never change across designs or memory type/vender
  4603. UCHAR ucMemoryDeviceCfg; // [7:4]=0x0:4M;=0x1:8M;=0x2:16M;0x3:32M....[3:0]=0x0:x4;=0x1:x8;=0x2:x16;=0x3:x32...
  4604. UCHAR ucRow; // Number of Row,in power of 2;
  4605. UCHAR ucColumn; // Number of Column,in power of 2;
  4606. UCHAR ucBank; // Nunber of Bank;
  4607. UCHAR ucRank; // Number of Rank, in power of 2
  4608. UCHAR ucChannelNum; // Number of channel;
  4609. UCHAR ucChannelConfig; // [3:0]=Indication of what channel combination;[4:7]=Channel bit width, in number of 2
  4610. UCHAR ucDefaultMVDDQ_ID; // Default MVDDQ setting for this memory block, ID linking to MVDDQ info table to find real set-up data;
  4611. UCHAR ucDefaultMVDDC_ID; // Default MVDDC setting for this memory block, ID linking to MVDDC info table to find real set-up data;
  4612. UCHAR ucReserved[2];
  4613. }ATOM_VRAM_MODULE_V1;
  4614. typedef struct _ATOM_VRAM_MODULE_V2
  4615. {
  4616. ULONG ulReserved;
  4617. ULONG ulFlags; // To enable/disable functionalities based on memory type
  4618. ULONG ulEngineClock; // Override of default engine clock for particular memory type
  4619. ULONG ulMemoryClock; // Override of default memory clock for particular memory type
  4620. USHORT usEMRS2Value; // EMRS2 Value is used for GDDR2 and GDDR4 memory type
  4621. USHORT usEMRS3Value; // EMRS3 Value is used for GDDR2 and GDDR4 memory type
  4622. USHORT usEMRSValue;
  4623. USHORT usMRSValue;
  4624. USHORT usReserved;
  4625. UCHAR ucExtMemoryID; // An external indicator (by hardcode, callback or pin) to tell what is the current memory module
  4626. UCHAR ucMemoryType; // [7:4]=0x1:DDR1;=0x2:DDR2;=0x3:DDR3;=0x4:DDR4;[3:0] - must not be used for now;
  4627. UCHAR ucMemoryVenderID; // Predefined,never change across designs or memory type/vender. If not predefined, vendor detection table gets executed
  4628. UCHAR ucMemoryDeviceCfg; // [7:4]=0x0:4M;=0x1:8M;=0x2:16M;0x3:32M....[3:0]=0x0:x4;=0x1:x8;=0x2:x16;=0x3:x32...
  4629. UCHAR ucRow; // Number of Row,in power of 2;
  4630. UCHAR ucColumn; // Number of Column,in power of 2;
  4631. UCHAR ucBank; // Nunber of Bank;
  4632. UCHAR ucRank; // Number of Rank, in power of 2
  4633. UCHAR ucChannelNum; // Number of channel;
  4634. UCHAR ucChannelConfig; // [3:0]=Indication of what channel combination;[4:7]=Channel bit width, in number of 2
  4635. UCHAR ucDefaultMVDDQ_ID; // Default MVDDQ setting for this memory block, ID linking to MVDDQ info table to find real set-up data;
  4636. UCHAR ucDefaultMVDDC_ID; // Default MVDDC setting for this memory block, ID linking to MVDDC info table to find real set-up data;
  4637. UCHAR ucRefreshRateFactor;
  4638. UCHAR ucReserved[3];
  4639. }ATOM_VRAM_MODULE_V2;
  4640. typedef struct _ATOM_MEMORY_TIMING_FORMAT
  4641. {
  4642. ULONG ulClkRange; // memory clock in 10kHz unit, when target memory clock is below this clock, use this memory timing
  4643. union{
  4644. USHORT usMRS; // mode register
  4645. USHORT usDDR3_MR0;
  4646. };
  4647. union{
  4648. USHORT usEMRS; // extended mode register
  4649. USHORT usDDR3_MR1;
  4650. };
  4651. UCHAR ucCL; // CAS latency
  4652. UCHAR ucWL; // WRITE Latency
  4653. UCHAR uctRAS; // tRAS
  4654. UCHAR uctRC; // tRC
  4655. UCHAR uctRFC; // tRFC
  4656. UCHAR uctRCDR; // tRCDR
  4657. UCHAR uctRCDW; // tRCDW
  4658. UCHAR uctRP; // tRP
  4659. UCHAR uctRRD; // tRRD
  4660. UCHAR uctWR; // tWR
  4661. UCHAR uctWTR; // tWTR
  4662. UCHAR uctPDIX; // tPDIX
  4663. UCHAR uctFAW; // tFAW
  4664. UCHAR uctAOND; // tAOND
  4665. union
  4666. {
  4667. struct {
  4668. UCHAR ucflag; // flag to control memory timing calculation. bit0= control EMRS2 Infineon
  4669. UCHAR ucReserved;
  4670. };
  4671. USHORT usDDR3_MR2;
  4672. };
  4673. }ATOM_MEMORY_TIMING_FORMAT;
  4674. typedef struct _ATOM_MEMORY_TIMING_FORMAT_V1
  4675. {
  4676. ULONG ulClkRange; // memory clock in 10kHz unit, when target memory clock is below this clock, use this memory timing
  4677. USHORT usMRS; // mode register
  4678. USHORT usEMRS; // extended mode register
  4679. UCHAR ucCL; // CAS latency
  4680. UCHAR ucWL; // WRITE Latency
  4681. UCHAR uctRAS; // tRAS
  4682. UCHAR uctRC; // tRC
  4683. UCHAR uctRFC; // tRFC
  4684. UCHAR uctRCDR; // tRCDR
  4685. UCHAR uctRCDW; // tRCDW
  4686. UCHAR uctRP; // tRP
  4687. UCHAR uctRRD; // tRRD
  4688. UCHAR uctWR; // tWR
  4689. UCHAR uctWTR; // tWTR
  4690. UCHAR uctPDIX; // tPDIX
  4691. UCHAR uctFAW; // tFAW
  4692. UCHAR uctAOND; // tAOND
  4693. UCHAR ucflag; // flag to control memory timing calculation. bit0= control EMRS2 Infineon
  4694. ////////////////////////////////////GDDR parameters///////////////////////////////////
  4695. UCHAR uctCCDL; //
  4696. UCHAR uctCRCRL; //
  4697. UCHAR uctCRCWL; //
  4698. UCHAR uctCKE; //
  4699. UCHAR uctCKRSE; //
  4700. UCHAR uctCKRSX; //
  4701. UCHAR uctFAW32; //
  4702. UCHAR ucMR5lo; //
  4703. UCHAR ucMR5hi; //
  4704. UCHAR ucTerminator;
  4705. }ATOM_MEMORY_TIMING_FORMAT_V1;
  4706. typedef struct _ATOM_MEMORY_TIMING_FORMAT_V2
  4707. {
  4708. ULONG ulClkRange; // memory clock in 10kHz unit, when target memory clock is below this clock, use this memory timing
  4709. USHORT usMRS; // mode register
  4710. USHORT usEMRS; // extended mode register
  4711. UCHAR ucCL; // CAS latency
  4712. UCHAR ucWL; // WRITE Latency
  4713. UCHAR uctRAS; // tRAS
  4714. UCHAR uctRC; // tRC
  4715. UCHAR uctRFC; // tRFC
  4716. UCHAR uctRCDR; // tRCDR
  4717. UCHAR uctRCDW; // tRCDW
  4718. UCHAR uctRP; // tRP
  4719. UCHAR uctRRD; // tRRD
  4720. UCHAR uctWR; // tWR
  4721. UCHAR uctWTR; // tWTR
  4722. UCHAR uctPDIX; // tPDIX
  4723. UCHAR uctFAW; // tFAW
  4724. UCHAR uctAOND; // tAOND
  4725. UCHAR ucflag; // flag to control memory timing calculation. bit0= control EMRS2 Infineon
  4726. ////////////////////////////////////GDDR parameters///////////////////////////////////
  4727. UCHAR uctCCDL; //
  4728. UCHAR uctCRCRL; //
  4729. UCHAR uctCRCWL; //
  4730. UCHAR uctCKE; //
  4731. UCHAR uctCKRSE; //
  4732. UCHAR uctCKRSX; //
  4733. UCHAR uctFAW32; //
  4734. UCHAR ucMR4lo; //
  4735. UCHAR ucMR4hi; //
  4736. UCHAR ucMR5lo; //
  4737. UCHAR ucMR5hi; //
  4738. UCHAR ucTerminator;
  4739. UCHAR ucReserved;
  4740. }ATOM_MEMORY_TIMING_FORMAT_V2;
  4741. typedef struct _ATOM_MEMORY_FORMAT
  4742. {
  4743. ULONG ulDllDisClock; // memory DLL will be disable when target memory clock is below this clock
  4744. union{
  4745. USHORT usEMRS2Value; // EMRS2 Value is used for GDDR2 and GDDR4 memory type
  4746. USHORT usDDR3_Reserved; // Not used for DDR3 memory
  4747. };
  4748. union{
  4749. USHORT usEMRS3Value; // EMRS3 Value is used for GDDR2 and GDDR4 memory type
  4750. USHORT usDDR3_MR3; // Used for DDR3 memory
  4751. };
  4752. UCHAR ucMemoryType; // [7:4]=0x1:DDR1;=0x2:DDR2;=0x3:DDR3;=0x4:DDR4;[3:0] - must not be used for now;
  4753. UCHAR ucMemoryVenderID; // Predefined,never change across designs or memory type/vender. If not predefined, vendor detection table gets executed
  4754. UCHAR ucRow; // Number of Row,in power of 2;
  4755. UCHAR ucColumn; // Number of Column,in power of 2;
  4756. UCHAR ucBank; // Nunber of Bank;
  4757. UCHAR ucRank; // Number of Rank, in power of 2
  4758. UCHAR ucBurstSize; // burst size, 0= burst size=4 1= burst size=8
  4759. UCHAR ucDllDisBit; // position of DLL Enable/Disable bit in EMRS ( Extended Mode Register )
  4760. UCHAR ucRefreshRateFactor; // memory refresh rate in unit of ms
  4761. UCHAR ucDensity; // _8Mx32, _16Mx32, _16Mx16, _32Mx16
  4762. UCHAR ucPreamble; //[7:4] Write Preamble, [3:0] Read Preamble
  4763. UCHAR ucMemAttrib; // Memory Device Addribute, like RDBI/WDBI etc
  4764. ATOM_MEMORY_TIMING_FORMAT asMemTiming[5]; //Memory Timing block sort from lower clock to higher clock
  4765. }ATOM_MEMORY_FORMAT;
  4766. typedef struct _ATOM_VRAM_MODULE_V3
  4767. {
  4768. ULONG ulChannelMapCfg; // board dependent paramenter:Channel combination
  4769. USHORT usSize; // size of ATOM_VRAM_MODULE_V3
  4770. USHORT usDefaultMVDDQ; // board dependent parameter:Default Memory Core Voltage
  4771. USHORT usDefaultMVDDC; // board dependent parameter:Default Memory IO Voltage
  4772. UCHAR ucExtMemoryID; // An external indicator (by hardcode, callback or pin) to tell what is the current memory module
  4773. UCHAR ucChannelNum; // board dependent parameter:Number of channel;
  4774. UCHAR ucChannelSize; // board dependent parameter:32bit or 64bit
  4775. UCHAR ucVREFI; // board dependnt parameter: EXT or INT +160mv to -140mv
  4776. UCHAR ucNPL_RT; // board dependent parameter:NPL round trip delay, used for calculate memory timing parameters
  4777. UCHAR ucFlag; // To enable/disable functionalities based on memory type
  4778. ATOM_MEMORY_FORMAT asMemory; // describ all of video memory parameters from memory spec
  4779. }ATOM_VRAM_MODULE_V3;
  4780. //ATOM_VRAM_MODULE_V3.ucNPL_RT
  4781. #define NPL_RT_MASK 0x0f
  4782. #define BATTERY_ODT_MASK 0xc0
  4783. #define ATOM_VRAM_MODULE ATOM_VRAM_MODULE_V3
  4784. typedef struct _ATOM_VRAM_MODULE_V4
  4785. {
  4786. ULONG ulChannelMapCfg; // board dependent parameter: Channel combination
  4787. USHORT usModuleSize; // size of ATOM_VRAM_MODULE_V4, make it easy for VBIOS to look for next entry of VRAM_MODULE
  4788. USHORT usPrivateReserved; // BIOS internal reserved space to optimize code size, updated by the compiler, shouldn't be modified manually!!
  4789. // MC_ARB_RAMCFG (includes NOOFBANK,NOOFRANKS,NOOFROWS,NOOFCOLS)
  4790. USHORT usReserved;
  4791. UCHAR ucExtMemoryID; // An external indicator (by hardcode, callback or pin) to tell what is the current memory module
  4792. UCHAR ucMemoryType; // [7:4]=0x1:DDR1;=0x2:DDR2;=0x3:DDR3;=0x4:DDR4; 0x5:DDR5 [3:0] - Must be 0x0 for now;
  4793. UCHAR ucChannelNum; // Number of channels present in this module config
  4794. UCHAR ucChannelWidth; // 0 - 32 bits; 1 - 64 bits
  4795. UCHAR ucDensity; // _8Mx32, _16Mx32, _16Mx16, _32Mx16
  4796. UCHAR ucFlag; // To enable/disable functionalities based on memory type
  4797. UCHAR ucMisc; // bit0: 0 - single rank; 1 - dual rank; bit2: 0 - burstlength 4, 1 - burstlength 8
  4798. UCHAR ucVREFI; // board dependent parameter
  4799. UCHAR ucNPL_RT; // board dependent parameter:NPL round trip delay, used for calculate memory timing parameters
  4800. UCHAR ucPreamble; // [7:4] Write Preamble, [3:0] Read Preamble
  4801. UCHAR ucMemorySize; // BIOS internal reserved space to optimize code size, updated by the compiler, shouldn't be modified manually!!
  4802. // Total memory size in unit of 16MB for CONFIG_MEMSIZE - bit[23:0] zeros
  4803. UCHAR ucReserved[3];
  4804. //compare with V3, we flat the struct by merging ATOM_MEMORY_FORMAT (as is) into V4 as the same level
  4805. union{
  4806. USHORT usEMRS2Value; // EMRS2 Value is used for GDDR2 and GDDR4 memory type
  4807. USHORT usDDR3_Reserved;
  4808. };
  4809. union{
  4810. USHORT usEMRS3Value; // EMRS3 Value is used for GDDR2 and GDDR4 memory type
  4811. USHORT usDDR3_MR3; // Used for DDR3 memory
  4812. };
  4813. UCHAR ucMemoryVenderID; // Predefined, If not predefined, vendor detection table gets executed
  4814. UCHAR ucRefreshRateFactor; // [1:0]=RefreshFactor (00=8ms, 01=16ms, 10=32ms,11=64ms)
  4815. UCHAR ucReserved2[2];
  4816. ATOM_MEMORY_TIMING_FORMAT asMemTiming[5];//Memory Timing block sort from lower clock to higher clock
  4817. }ATOM_VRAM_MODULE_V4;
  4818. #define VRAM_MODULE_V4_MISC_RANK_MASK 0x3
  4819. #define VRAM_MODULE_V4_MISC_DUAL_RANK 0x1
  4820. #define VRAM_MODULE_V4_MISC_BL_MASK 0x4
  4821. #define VRAM_MODULE_V4_MISC_BL8 0x4
  4822. #define VRAM_MODULE_V4_MISC_DUAL_CS 0x10
  4823. typedef struct _ATOM_VRAM_MODULE_V5
  4824. {
  4825. ULONG ulChannelMapCfg; // board dependent parameter: Channel combination
  4826. USHORT usModuleSize; // size of ATOM_VRAM_MODULE_V4, make it easy for VBIOS to look for next entry of VRAM_MODULE
  4827. USHORT usPrivateReserved; // BIOS internal reserved space to optimize code size, updated by the compiler, shouldn't be modified manually!!
  4828. // MC_ARB_RAMCFG (includes NOOFBANK,NOOFRANKS,NOOFROWS,NOOFCOLS)
  4829. USHORT usReserved;
  4830. UCHAR ucExtMemoryID; // An external indicator (by hardcode, callback or pin) to tell what is the current memory module
  4831. UCHAR ucMemoryType; // [7:4]=0x1:DDR1;=0x2:DDR2;=0x3:DDR3;=0x4:DDR4; 0x5:DDR5 [3:0] - Must be 0x0 for now;
  4832. UCHAR ucChannelNum; // Number of channels present in this module config
  4833. UCHAR ucChannelWidth; // 0 - 32 bits; 1 - 64 bits
  4834. UCHAR ucDensity; // _8Mx32, _16Mx32, _16Mx16, _32Mx16
  4835. UCHAR ucFlag; // To enable/disable functionalities based on memory type
  4836. UCHAR ucMisc; // bit0: 0 - single rank; 1 - dual rank; bit2: 0 - burstlength 4, 1 - burstlength 8
  4837. UCHAR ucVREFI; // board dependent parameter
  4838. UCHAR ucNPL_RT; // board dependent parameter:NPL round trip delay, used for calculate memory timing parameters
  4839. UCHAR ucPreamble; // [7:4] Write Preamble, [3:0] Read Preamble
  4840. UCHAR ucMemorySize; // BIOS internal reserved space to optimize code size, updated by the compiler, shouldn't be modified manually!!
  4841. // Total memory size in unit of 16MB for CONFIG_MEMSIZE - bit[23:0] zeros
  4842. UCHAR ucReserved[3];
  4843. //compare with V3, we flat the struct by merging ATOM_MEMORY_FORMAT (as is) into V4 as the same level
  4844. USHORT usEMRS2Value; // EMRS2 Value is used for GDDR2 and GDDR4 memory type
  4845. USHORT usEMRS3Value; // EMRS3 Value is used for GDDR2 and GDDR4 memory type
  4846. UCHAR ucMemoryVenderID; // Predefined, If not predefined, vendor detection table gets executed
  4847. UCHAR ucRefreshRateFactor; // [1:0]=RefreshFactor (00=8ms, 01=16ms, 10=32ms,11=64ms)
  4848. UCHAR ucFIFODepth; // FIFO depth supposes to be detected during vendor detection, but if we dont do vendor detection we have to hardcode FIFO Depth
  4849. UCHAR ucCDR_Bandwidth; // [0:3]=Read CDR bandwidth, [4:7] - Write CDR Bandwidth
  4850. ATOM_MEMORY_TIMING_FORMAT_V1 asMemTiming[5];//Memory Timing block sort from lower clock to higher clock
  4851. }ATOM_VRAM_MODULE_V5;
  4852. typedef struct _ATOM_VRAM_MODULE_V6
  4853. {
  4854. ULONG ulChannelMapCfg; // board dependent parameter: Channel combination
  4855. USHORT usModuleSize; // size of ATOM_VRAM_MODULE_V4, make it easy for VBIOS to look for next entry of VRAM_MODULE
  4856. USHORT usPrivateReserved; // BIOS internal reserved space to optimize code size, updated by the compiler, shouldn't be modified manually!!
  4857. // MC_ARB_RAMCFG (includes NOOFBANK,NOOFRANKS,NOOFROWS,NOOFCOLS)
  4858. USHORT usReserved;
  4859. UCHAR ucExtMemoryID; // An external indicator (by hardcode, callback or pin) to tell what is the current memory module
  4860. UCHAR ucMemoryType; // [7:4]=0x1:DDR1;=0x2:DDR2;=0x3:DDR3;=0x4:DDR4; 0x5:DDR5 [3:0] - Must be 0x0 for now;
  4861. UCHAR ucChannelNum; // Number of channels present in this module config
  4862. UCHAR ucChannelWidth; // 0 - 32 bits; 1 - 64 bits
  4863. UCHAR ucDensity; // _8Mx32, _16Mx32, _16Mx16, _32Mx16
  4864. UCHAR ucFlag; // To enable/disable functionalities based on memory type
  4865. UCHAR ucMisc; // bit0: 0 - single rank; 1 - dual rank; bit2: 0 - burstlength 4, 1 - burstlength 8
  4866. UCHAR ucVREFI; // board dependent parameter
  4867. UCHAR ucNPL_RT; // board dependent parameter:NPL round trip delay, used for calculate memory timing parameters
  4868. UCHAR ucPreamble; // [7:4] Write Preamble, [3:0] Read Preamble
  4869. UCHAR ucMemorySize; // BIOS internal reserved space to optimize code size, updated by the compiler, shouldn't be modified manually!!
  4870. // Total memory size in unit of 16MB for CONFIG_MEMSIZE - bit[23:0] zeros
  4871. UCHAR ucReserved[3];
  4872. //compare with V3, we flat the struct by merging ATOM_MEMORY_FORMAT (as is) into V4 as the same level
  4873. USHORT usEMRS2Value; // EMRS2 Value is used for GDDR2 and GDDR4 memory type
  4874. USHORT usEMRS3Value; // EMRS3 Value is used for GDDR2 and GDDR4 memory type
  4875. UCHAR ucMemoryVenderID; // Predefined, If not predefined, vendor detection table gets executed
  4876. UCHAR ucRefreshRateFactor; // [1:0]=RefreshFactor (00=8ms, 01=16ms, 10=32ms,11=64ms)
  4877. UCHAR ucFIFODepth; // FIFO depth supposes to be detected during vendor detection, but if we dont do vendor detection we have to hardcode FIFO Depth
  4878. UCHAR ucCDR_Bandwidth; // [0:3]=Read CDR bandwidth, [4:7] - Write CDR Bandwidth
  4879. ATOM_MEMORY_TIMING_FORMAT_V2 asMemTiming[5];//Memory Timing block sort from lower clock to higher clock
  4880. }ATOM_VRAM_MODULE_V6;
  4881. typedef struct _ATOM_VRAM_MODULE_V7
  4882. {
  4883. // Design Specific Values
  4884. ULONG ulChannelMapCfg; // mmMC_SHARED_CHREMAP
  4885. USHORT usModuleSize; // Size of ATOM_VRAM_MODULE_V7
  4886. USHORT usPrivateReserved; // MC_ARB_RAMCFG (includes NOOFBANK,NOOFRANKS,NOOFROWS,NOOFCOLS)
  4887. USHORT usReserved;
  4888. UCHAR ucExtMemoryID; // Current memory module ID
  4889. UCHAR ucMemoryType; // MEM_TYPE_DDR2/DDR3/GDDR3/GDDR5
  4890. UCHAR ucChannelNum; // Number of mem. channels supported in this module
  4891. UCHAR ucChannelWidth; // CHANNEL_16BIT/CHANNEL_32BIT/CHANNEL_64BIT
  4892. UCHAR ucDensity; // _8Mx32, _16Mx32, _16Mx16, _32Mx16
  4893. UCHAR ucReserve; // Former container for Mx_FLAGS like DBI_AC_MODE_ENABLE_ASIC for GDDR4. Not used now.
  4894. UCHAR ucMisc; // RANK_OF_THISMEMORY etc.
  4895. UCHAR ucVREFI; // Not used.
  4896. UCHAR ucNPL_RT; // Round trip delay (MC_SEQ_CAS_TIMING [28:24]:TCL=CL+NPL_RT-2). Always 2.
  4897. UCHAR ucPreamble; // [7:4] Write Preamble, [3:0] Read Preamble
  4898. UCHAR ucMemorySize; // Total memory size in unit of 16MB for CONFIG_MEMSIZE - bit[23:0] zeros
  4899. UCHAR ucReserved[3];
  4900. // Memory Module specific values
  4901. USHORT usEMRS2Value; // EMRS2/MR2 Value.
  4902. USHORT usEMRS3Value; // EMRS3/MR3 Value.
  4903. UCHAR ucMemoryVenderID; // [7:4] Revision, [3:0] Vendor code
  4904. UCHAR ucRefreshRateFactor; // [1:0]=RefreshFactor (00=8ms, 01=16ms, 10=32ms,11=64ms)
  4905. UCHAR ucFIFODepth; // FIFO depth can be detected during vendor detection, here is hardcoded per memory
  4906. UCHAR ucCDR_Bandwidth; // [0:3]=Read CDR bandwidth, [4:7] - Write CDR Bandwidth
  4907. char strMemPNString[20]; // part number end with '0'.
  4908. }ATOM_VRAM_MODULE_V7;
  4909. typedef struct _ATOM_VRAM_INFO_V2
  4910. {
  4911. ATOM_COMMON_TABLE_HEADER sHeader;
  4912. UCHAR ucNumOfVRAMModule;
  4913. ATOM_VRAM_MODULE aVramInfo[ATOM_MAX_NUMBER_OF_VRAM_MODULE]; // just for allocation, real number of blocks is in ucNumOfVRAMModule;
  4914. }ATOM_VRAM_INFO_V2;
  4915. typedef struct _ATOM_VRAM_INFO_V3
  4916. {
  4917. ATOM_COMMON_TABLE_HEADER sHeader;
  4918. USHORT usMemAdjustTblOffset; // offset of ATOM_INIT_REG_BLOCK structure for memory vendor specific MC adjust setting
  4919. USHORT usMemClkPatchTblOffset; // offset of ATOM_INIT_REG_BLOCK structure for memory clock specific MC setting
  4920. USHORT usRerseved;
  4921. UCHAR aVID_PinsShift[9]; // 8 bit strap maximum+terminator
  4922. UCHAR ucNumOfVRAMModule;
  4923. ATOM_VRAM_MODULE aVramInfo[ATOM_MAX_NUMBER_OF_VRAM_MODULE]; // just for allocation, real number of blocks is in ucNumOfVRAMModule;
  4924. ATOM_INIT_REG_BLOCK asMemPatch; // for allocation
  4925. // ATOM_INIT_REG_BLOCK aMemAdjust;
  4926. }ATOM_VRAM_INFO_V3;
  4927. #define ATOM_VRAM_INFO_LAST ATOM_VRAM_INFO_V3
  4928. typedef struct _ATOM_VRAM_INFO_V4
  4929. {
  4930. ATOM_COMMON_TABLE_HEADER sHeader;
  4931. USHORT usMemAdjustTblOffset; // offset of ATOM_INIT_REG_BLOCK structure for memory vendor specific MC adjust setting
  4932. USHORT usMemClkPatchTblOffset; // offset of ATOM_INIT_REG_BLOCK structure for memory clock specific MC setting
  4933. USHORT usRerseved;
  4934. UCHAR ucMemDQ7_0ByteRemap; // DQ line byte remap, =0: Memory Data line BYTE0, =1: BYTE1, =2: BYTE2, =3: BYTE3
  4935. ULONG ulMemDQ7_0BitRemap; // each DQ line ( 7~0) use 3bits, like: DQ0=Bit[2:0], DQ1:[5:3], ... DQ7:[23:21]
  4936. UCHAR ucReservde[4];
  4937. UCHAR ucNumOfVRAMModule;
  4938. ATOM_VRAM_MODULE_V4 aVramInfo[ATOM_MAX_NUMBER_OF_VRAM_MODULE]; // just for allocation, real number of blocks is in ucNumOfVRAMModule;
  4939. ATOM_INIT_REG_BLOCK asMemPatch; // for allocation
  4940. // ATOM_INIT_REG_BLOCK aMemAdjust;
  4941. }ATOM_VRAM_INFO_V4;
  4942. typedef struct _ATOM_VRAM_INFO_HEADER_V2_1
  4943. {
  4944. ATOM_COMMON_TABLE_HEADER sHeader;
  4945. USHORT usMemAdjustTblOffset; // offset of ATOM_INIT_REG_BLOCK structure for memory vendor specific MC adjust setting
  4946. USHORT usMemClkPatchTblOffset; // offset of ATOM_INIT_REG_BLOCK structure for memory clock specific MC setting
  4947. USHORT usReserved[4];
  4948. UCHAR ucNumOfVRAMModule; // indicate number of VRAM module
  4949. UCHAR ucMemoryClkPatchTblVer; // version of memory AC timing register list
  4950. UCHAR ucVramModuleVer; // indicate ATOM_VRAM_MODUE version
  4951. UCHAR ucReserved;
  4952. ATOM_VRAM_MODULE_V7 aVramInfo[ATOM_MAX_NUMBER_OF_VRAM_MODULE]; // just for allocation, real number of blocks is in ucNumOfVRAMModule;
  4953. }ATOM_VRAM_INFO_HEADER_V2_1;
  4954. typedef struct _ATOM_VRAM_GPIO_DETECTION_INFO
  4955. {
  4956. ATOM_COMMON_TABLE_HEADER sHeader;
  4957. UCHAR aVID_PinsShift[9]; //8 bit strap maximum+terminator
  4958. }ATOM_VRAM_GPIO_DETECTION_INFO;
  4959. typedef struct _ATOM_MEMORY_TRAINING_INFO
  4960. {
  4961. ATOM_COMMON_TABLE_HEADER sHeader;
  4962. UCHAR ucTrainingLoop;
  4963. UCHAR ucReserved[3];
  4964. ATOM_INIT_REG_BLOCK asMemTrainingSetting;
  4965. }ATOM_MEMORY_TRAINING_INFO;
  4966. typedef struct SW_I2C_CNTL_DATA_PARAMETERS
  4967. {
  4968. UCHAR ucControl;
  4969. UCHAR ucData;
  4970. UCHAR ucSatus;
  4971. UCHAR ucTemp;
  4972. } SW_I2C_CNTL_DATA_PARAMETERS;
  4973. #define SW_I2C_CNTL_DATA_PS_ALLOCATION SW_I2C_CNTL_DATA_PARAMETERS
  4974. typedef struct _SW_I2C_IO_DATA_PARAMETERS
  4975. {
  4976. USHORT GPIO_Info;
  4977. UCHAR ucAct;
  4978. UCHAR ucData;
  4979. } SW_I2C_IO_DATA_PARAMETERS;
  4980. #define SW_I2C_IO_DATA_PS_ALLOCATION SW_I2C_IO_DATA_PARAMETERS
  4981. /****************************SW I2C CNTL DEFINITIONS**********************/
  4982. #define SW_I2C_IO_RESET 0
  4983. #define SW_I2C_IO_GET 1
  4984. #define SW_I2C_IO_DRIVE 2
  4985. #define SW_I2C_IO_SET 3
  4986. #define SW_I2C_IO_START 4
  4987. #define SW_I2C_IO_CLOCK 0
  4988. #define SW_I2C_IO_DATA 0x80
  4989. #define SW_I2C_IO_ZERO 0
  4990. #define SW_I2C_IO_ONE 0x100
  4991. #define SW_I2C_CNTL_READ 0
  4992. #define SW_I2C_CNTL_WRITE 1
  4993. #define SW_I2C_CNTL_START 2
  4994. #define SW_I2C_CNTL_STOP 3
  4995. #define SW_I2C_CNTL_OPEN 4
  4996. #define SW_I2C_CNTL_CLOSE 5
  4997. #define SW_I2C_CNTL_WRITE1BIT 6
  4998. //==============================VESA definition Portion===============================
  4999. #define VESA_OEM_PRODUCT_REV "01.00"
  5000. #define VESA_MODE_ATTRIBUTE_MODE_SUPPORT 0xBB //refer to VBE spec p.32, no TTY support
  5001. #define VESA_MODE_WIN_ATTRIBUTE 7
  5002. #define VESA_WIN_SIZE 64
  5003. typedef struct _PTR_32_BIT_STRUCTURE
  5004. {
  5005. USHORT Offset16;
  5006. USHORT Segment16;
  5007. } PTR_32_BIT_STRUCTURE;
  5008. typedef union _PTR_32_BIT_UNION
  5009. {
  5010. PTR_32_BIT_STRUCTURE SegmentOffset;
  5011. ULONG Ptr32_Bit;
  5012. } PTR_32_BIT_UNION;
  5013. typedef struct _VBE_1_2_INFO_BLOCK_UPDATABLE
  5014. {
  5015. UCHAR VbeSignature[4];
  5016. USHORT VbeVersion;
  5017. PTR_32_BIT_UNION OemStringPtr;
  5018. UCHAR Capabilities[4];
  5019. PTR_32_BIT_UNION VideoModePtr;
  5020. USHORT TotalMemory;
  5021. } VBE_1_2_INFO_BLOCK_UPDATABLE;
  5022. typedef struct _VBE_2_0_INFO_BLOCK_UPDATABLE
  5023. {
  5024. VBE_1_2_INFO_BLOCK_UPDATABLE CommonBlock;
  5025. USHORT OemSoftRev;
  5026. PTR_32_BIT_UNION OemVendorNamePtr;
  5027. PTR_32_BIT_UNION OemProductNamePtr;
  5028. PTR_32_BIT_UNION OemProductRevPtr;
  5029. } VBE_2_0_INFO_BLOCK_UPDATABLE;
  5030. typedef union _VBE_VERSION_UNION
  5031. {
  5032. VBE_2_0_INFO_BLOCK_UPDATABLE VBE_2_0_InfoBlock;
  5033. VBE_1_2_INFO_BLOCK_UPDATABLE VBE_1_2_InfoBlock;
  5034. } VBE_VERSION_UNION;
  5035. typedef struct _VBE_INFO_BLOCK
  5036. {
  5037. VBE_VERSION_UNION UpdatableVBE_Info;
  5038. UCHAR Reserved[222];
  5039. UCHAR OemData[256];
  5040. } VBE_INFO_BLOCK;
  5041. typedef struct _VBE_FP_INFO
  5042. {
  5043. USHORT HSize;
  5044. USHORT VSize;
  5045. USHORT FPType;
  5046. UCHAR RedBPP;
  5047. UCHAR GreenBPP;
  5048. UCHAR BlueBPP;
  5049. UCHAR ReservedBPP;
  5050. ULONG RsvdOffScrnMemSize;
  5051. ULONG RsvdOffScrnMEmPtr;
  5052. UCHAR Reserved[14];
  5053. } VBE_FP_INFO;
  5054. typedef struct _VESA_MODE_INFO_BLOCK
  5055. {
  5056. // Mandatory information for all VBE revisions
  5057. USHORT ModeAttributes; // dw ? ; mode attributes
  5058. UCHAR WinAAttributes; // db ? ; window A attributes
  5059. UCHAR WinBAttributes; // db ? ; window B attributes
  5060. USHORT WinGranularity; // dw ? ; window granularity
  5061. USHORT WinSize; // dw ? ; window size
  5062. USHORT WinASegment; // dw ? ; window A start segment
  5063. USHORT WinBSegment; // dw ? ; window B start segment
  5064. ULONG WinFuncPtr; // dd ? ; real mode pointer to window function
  5065. USHORT BytesPerScanLine;// dw ? ; bytes per scan line
  5066. //; Mandatory information for VBE 1.2 and above
  5067. USHORT XResolution; // dw ? ; horizontal resolution in pixels or characters
  5068. USHORT YResolution; // dw ? ; vertical resolution in pixels or characters
  5069. UCHAR XCharSize; // db ? ; character cell width in pixels
  5070. UCHAR YCharSize; // db ? ; character cell height in pixels
  5071. UCHAR NumberOfPlanes; // db ? ; number of memory planes
  5072. UCHAR BitsPerPixel; // db ? ; bits per pixel
  5073. UCHAR NumberOfBanks; // db ? ; number of banks
  5074. UCHAR MemoryModel; // db ? ; memory model type
  5075. UCHAR BankSize; // db ? ; bank size in KB
  5076. UCHAR NumberOfImagePages;// db ? ; number of images
  5077. UCHAR ReservedForPageFunction;//db 1 ; reserved for page function
  5078. //; Direct Color fields(required for direct/6 and YUV/7 memory models)
  5079. UCHAR RedMaskSize; // db ? ; size of direct color red mask in bits
  5080. UCHAR RedFieldPosition; // db ? ; bit position of lsb of red mask
  5081. UCHAR GreenMaskSize; // db ? ; size of direct color green mask in bits
  5082. UCHAR GreenFieldPosition; // db ? ; bit position of lsb of green mask
  5083. UCHAR BlueMaskSize; // db ? ; size of direct color blue mask in bits
  5084. UCHAR BlueFieldPosition; // db ? ; bit position of lsb of blue mask
  5085. UCHAR RsvdMaskSize; // db ? ; size of direct color reserved mask in bits
  5086. UCHAR RsvdFieldPosition; // db ? ; bit position of lsb of reserved mask
  5087. UCHAR DirectColorModeInfo;// db ? ; direct color mode attributes
  5088. //; Mandatory information for VBE 2.0 and above
  5089. ULONG PhysBasePtr; // dd ? ; physical address for flat memory frame buffer
  5090. ULONG Reserved_1; // dd 0 ; reserved - always set to 0
  5091. USHORT Reserved_2; // dw 0 ; reserved - always set to 0
  5092. //; Mandatory information for VBE 3.0 and above
  5093. USHORT LinBytesPerScanLine; // dw ? ; bytes per scan line for linear modes
  5094. UCHAR BnkNumberOfImagePages;// db ? ; number of images for banked modes
  5095. UCHAR LinNumberOfImagPages; // db ? ; number of images for linear modes
  5096. UCHAR LinRedMaskSize; // db ? ; size of direct color red mask(linear modes)
  5097. UCHAR LinRedFieldPosition; // db ? ; bit position of lsb of red mask(linear modes)
  5098. UCHAR LinGreenMaskSize; // db ? ; size of direct color green mask(linear modes)
  5099. UCHAR LinGreenFieldPosition;// db ? ; bit position of lsb of green mask(linear modes)
  5100. UCHAR LinBlueMaskSize; // db ? ; size of direct color blue mask(linear modes)
  5101. UCHAR LinBlueFieldPosition; // db ? ; bit position of lsb of blue mask(linear modes)
  5102. UCHAR LinRsvdMaskSize; // db ? ; size of direct color reserved mask(linear modes)
  5103. UCHAR LinRsvdFieldPosition; // db ? ; bit position of lsb of reserved mask(linear modes)
  5104. ULONG MaxPixelClock; // dd ? ; maximum pixel clock(in Hz) for graphics mode
  5105. UCHAR Reserved; // db 190 dup (0)
  5106. } VESA_MODE_INFO_BLOCK;
  5107. // BIOS function CALLS
  5108. #define ATOM_BIOS_EXTENDED_FUNCTION_CODE 0xA0 // ATI Extended Function code
  5109. #define ATOM_BIOS_FUNCTION_COP_MODE 0x00
  5110. #define ATOM_BIOS_FUNCTION_SHORT_QUERY1 0x04
  5111. #define ATOM_BIOS_FUNCTION_SHORT_QUERY2 0x05
  5112. #define ATOM_BIOS_FUNCTION_SHORT_QUERY3 0x06
  5113. #define ATOM_BIOS_FUNCTION_GET_DDC 0x0B
  5114. #define ATOM_BIOS_FUNCTION_ASIC_DSTATE 0x0E
  5115. #define ATOM_BIOS_FUNCTION_DEBUG_PLAY 0x0F
  5116. #define ATOM_BIOS_FUNCTION_STV_STD 0x16
  5117. #define ATOM_BIOS_FUNCTION_DEVICE_DET 0x17
  5118. #define ATOM_BIOS_FUNCTION_DEVICE_SWITCH 0x18
  5119. #define ATOM_BIOS_FUNCTION_PANEL_CONTROL 0x82
  5120. #define ATOM_BIOS_FUNCTION_OLD_DEVICE_DET 0x83
  5121. #define ATOM_BIOS_FUNCTION_OLD_DEVICE_SWITCH 0x84
  5122. #define ATOM_BIOS_FUNCTION_HW_ICON 0x8A
  5123. #define ATOM_BIOS_FUNCTION_SET_CMOS 0x8B
  5124. #define SUB_FUNCTION_UPDATE_DISPLAY_INFO 0x8000 // Sub function 80
  5125. #define SUB_FUNCTION_UPDATE_EXPANSION_INFO 0x8100 // Sub function 80
  5126. #define ATOM_BIOS_FUNCTION_DISPLAY_INFO 0x8D
  5127. #define ATOM_BIOS_FUNCTION_DEVICE_ON_OFF 0x8E
  5128. #define ATOM_BIOS_FUNCTION_VIDEO_STATE 0x8F
  5129. #define ATOM_SUB_FUNCTION_GET_CRITICAL_STATE 0x0300 // Sub function 03
  5130. #define ATOM_SUB_FUNCTION_GET_LIDSTATE 0x0700 // Sub function 7
  5131. #define ATOM_SUB_FUNCTION_THERMAL_STATE_NOTICE 0x1400 // Notify caller the current thermal state
  5132. #define ATOM_SUB_FUNCTION_CRITICAL_STATE_NOTICE 0x8300 // Notify caller the current critical state
  5133. #define ATOM_SUB_FUNCTION_SET_LIDSTATE 0x8500 // Sub function 85
  5134. #define ATOM_SUB_FUNCTION_GET_REQ_DISPLAY_FROM_SBIOS_MODE 0x8900// Sub function 89
  5135. #define ATOM_SUB_FUNCTION_INFORM_ADC_SUPPORT 0x9400 // Notify caller that ADC is supported
  5136. #define ATOM_BIOS_FUNCTION_VESA_DPMS 0x4F10 // Set DPMS
  5137. #define ATOM_SUB_FUNCTION_SET_DPMS 0x0001 // BL: Sub function 01
  5138. #define ATOM_SUB_FUNCTION_GET_DPMS 0x0002 // BL: Sub function 02
  5139. #define ATOM_PARAMETER_VESA_DPMS_ON 0x0000 // BH Parameter for DPMS ON.
  5140. #define ATOM_PARAMETER_VESA_DPMS_STANDBY 0x0100 // BH Parameter for DPMS STANDBY
  5141. #define ATOM_PARAMETER_VESA_DPMS_SUSPEND 0x0200 // BH Parameter for DPMS SUSPEND
  5142. #define ATOM_PARAMETER_VESA_DPMS_OFF 0x0400 // BH Parameter for DPMS OFF
  5143. #define ATOM_PARAMETER_VESA_DPMS_REDUCE_ON 0x0800 // BH Parameter for DPMS REDUCE ON (NOT SUPPORTED)
  5144. #define ATOM_BIOS_RETURN_CODE_MASK 0x0000FF00L
  5145. #define ATOM_BIOS_REG_HIGH_MASK 0x0000FF00L
  5146. #define ATOM_BIOS_REG_LOW_MASK 0x000000FFL
  5147. // structure used for VBIOS only
  5148. //DispOutInfoTable
  5149. typedef struct _ASIC_TRANSMITTER_INFO
  5150. {
  5151. USHORT usTransmitterObjId;
  5152. USHORT usSupportDevice;
  5153. UCHAR ucTransmitterCmdTblId;
  5154. UCHAR ucConfig;
  5155. UCHAR ucEncoderID; //available 1st encoder ( default )
  5156. UCHAR ucOptionEncoderID; //available 2nd encoder ( optional )
  5157. UCHAR uc2ndEncoderID;
  5158. UCHAR ucReserved;
  5159. }ASIC_TRANSMITTER_INFO;
  5160. #define ASIC_TRANSMITTER_INFO_CONFIG__DVO_SDR_MODE 0x01
  5161. #define ASIC_TRANSMITTER_INFO_CONFIG__COHERENT_MODE 0x02
  5162. #define ASIC_TRANSMITTER_INFO_CONFIG__ENCODEROBJ_ID_MASK 0xc4
  5163. #define ASIC_TRANSMITTER_INFO_CONFIG__ENCODER_A 0x00
  5164. #define ASIC_TRANSMITTER_INFO_CONFIG__ENCODER_B 0x04
  5165. #define ASIC_TRANSMITTER_INFO_CONFIG__ENCODER_C 0x40
  5166. #define ASIC_TRANSMITTER_INFO_CONFIG__ENCODER_D 0x44
  5167. #define ASIC_TRANSMITTER_INFO_CONFIG__ENCODER_E 0x80
  5168. #define ASIC_TRANSMITTER_INFO_CONFIG__ENCODER_F 0x84
  5169. typedef struct _ASIC_ENCODER_INFO
  5170. {
  5171. UCHAR ucEncoderID;
  5172. UCHAR ucEncoderConfig;
  5173. USHORT usEncoderCmdTblId;
  5174. }ASIC_ENCODER_INFO;
  5175. typedef struct _ATOM_DISP_OUT_INFO
  5176. {
  5177. ATOM_COMMON_TABLE_HEADER sHeader;
  5178. USHORT ptrTransmitterInfo;
  5179. USHORT ptrEncoderInfo;
  5180. ASIC_TRANSMITTER_INFO asTransmitterInfo[1];
  5181. ASIC_ENCODER_INFO asEncoderInfo[1];
  5182. }ATOM_DISP_OUT_INFO;
  5183. typedef struct _ATOM_DISP_OUT_INFO_V2
  5184. {
  5185. ATOM_COMMON_TABLE_HEADER sHeader;
  5186. USHORT ptrTransmitterInfo;
  5187. USHORT ptrEncoderInfo;
  5188. USHORT ptrMainCallParserFar; // direct address of main parser call in VBIOS binary.
  5189. ASIC_TRANSMITTER_INFO asTransmitterInfo[1];
  5190. ASIC_ENCODER_INFO asEncoderInfo[1];
  5191. }ATOM_DISP_OUT_INFO_V2;
  5192. // DispDevicePriorityInfo
  5193. typedef struct _ATOM_DISPLAY_DEVICE_PRIORITY_INFO
  5194. {
  5195. ATOM_COMMON_TABLE_HEADER sHeader;
  5196. USHORT asDevicePriority[16];
  5197. }ATOM_DISPLAY_DEVICE_PRIORITY_INFO;
  5198. //ProcessAuxChannelTransactionTable
  5199. typedef struct _PROCESS_AUX_CHANNEL_TRANSACTION_PARAMETERS
  5200. {
  5201. USHORT lpAuxRequest;
  5202. USHORT lpDataOut;
  5203. UCHAR ucChannelID;
  5204. union
  5205. {
  5206. UCHAR ucReplyStatus;
  5207. UCHAR ucDelay;
  5208. };
  5209. UCHAR ucDataOutLen;
  5210. UCHAR ucReserved;
  5211. }PROCESS_AUX_CHANNEL_TRANSACTION_PARAMETERS;
  5212. //ProcessAuxChannelTransactionTable
  5213. typedef struct _PROCESS_AUX_CHANNEL_TRANSACTION_PARAMETERS_V2
  5214. {
  5215. USHORT lpAuxRequest;
  5216. USHORT lpDataOut;
  5217. UCHAR ucChannelID;
  5218. union
  5219. {
  5220. UCHAR ucReplyStatus;
  5221. UCHAR ucDelay;
  5222. };
  5223. UCHAR ucDataOutLen;
  5224. UCHAR ucHPD_ID; //=0: HPD1, =1: HPD2, =2: HPD3, =3: HPD4, =4: HPD5, =5: HPD6
  5225. }PROCESS_AUX_CHANNEL_TRANSACTION_PARAMETERS_V2;
  5226. #define PROCESS_AUX_CHANNEL_TRANSACTION_PS_ALLOCATION PROCESS_AUX_CHANNEL_TRANSACTION_PARAMETERS
  5227. //GetSinkType
  5228. typedef struct _DP_ENCODER_SERVICE_PARAMETERS
  5229. {
  5230. USHORT ucLinkClock;
  5231. union
  5232. {
  5233. UCHAR ucConfig; // for DP training command
  5234. UCHAR ucI2cId; // use for GET_SINK_TYPE command
  5235. };
  5236. UCHAR ucAction;
  5237. UCHAR ucStatus;
  5238. UCHAR ucLaneNum;
  5239. UCHAR ucReserved[2];
  5240. }DP_ENCODER_SERVICE_PARAMETERS;
  5241. // ucAction
  5242. #define ATOM_DP_ACTION_GET_SINK_TYPE 0x01
  5243. /* obselete */
  5244. #define ATOM_DP_ACTION_TRAINING_START 0x02
  5245. #define ATOM_DP_ACTION_TRAINING_COMPLETE 0x03
  5246. #define ATOM_DP_ACTION_TRAINING_PATTERN_SEL 0x04
  5247. #define ATOM_DP_ACTION_SET_VSWING_PREEMP 0x05
  5248. #define ATOM_DP_ACTION_GET_VSWING_PREEMP 0x06
  5249. #define ATOM_DP_ACTION_BLANKING 0x07
  5250. // ucConfig
  5251. #define ATOM_DP_CONFIG_ENCODER_SEL_MASK 0x03
  5252. #define ATOM_DP_CONFIG_DIG1_ENCODER 0x00
  5253. #define ATOM_DP_CONFIG_DIG2_ENCODER 0x01
  5254. #define ATOM_DP_CONFIG_EXTERNAL_ENCODER 0x02
  5255. #define ATOM_DP_CONFIG_LINK_SEL_MASK 0x04
  5256. #define ATOM_DP_CONFIG_LINK_A 0x00
  5257. #define ATOM_DP_CONFIG_LINK_B 0x04
  5258. /* /obselete */
  5259. #define DP_ENCODER_SERVICE_PS_ALLOCATION WRITE_ONE_BYTE_HW_I2C_DATA_PARAMETERS
  5260. typedef struct _DP_ENCODER_SERVICE_PARAMETERS_V2
  5261. {
  5262. USHORT usExtEncoderObjId; // External Encoder Object Id, output parameter only, use when ucAction = DP_SERVICE_V2_ACTION_DET_EXT_CONNECTION
  5263. UCHAR ucAuxId;
  5264. UCHAR ucAction;
  5265. UCHAR ucSinkType; // Iput and Output parameters.
  5266. UCHAR ucHPDId; // Input parameter, used when ucAction = DP_SERVICE_V2_ACTION_DET_EXT_CONNECTION
  5267. UCHAR ucReserved[2];
  5268. }DP_ENCODER_SERVICE_PARAMETERS_V2;
  5269. typedef struct _DP_ENCODER_SERVICE_PS_ALLOCATION_V2
  5270. {
  5271. DP_ENCODER_SERVICE_PARAMETERS_V2 asDPServiceParam;
  5272. PROCESS_AUX_CHANNEL_TRANSACTION_PARAMETERS_V2 asAuxParam;
  5273. }DP_ENCODER_SERVICE_PS_ALLOCATION_V2;
  5274. // ucAction
  5275. #define DP_SERVICE_V2_ACTION_GET_SINK_TYPE 0x01
  5276. #define DP_SERVICE_V2_ACTION_DET_LCD_CONNECTION 0x02
  5277. // DP_TRAINING_TABLE
  5278. #define DPCD_SET_LINKRATE_LANENUM_PATTERN1_TBL_ADDR ATOM_DP_TRAINING_TBL_ADDR
  5279. #define DPCD_SET_SS_CNTL_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 8 )
  5280. #define DPCD_SET_LANE_VSWING_PREEMP_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 16 )
  5281. #define DPCD_SET_TRAINING_PATTERN0_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 24 )
  5282. #define DPCD_SET_TRAINING_PATTERN2_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 32)
  5283. #define DPCD_GET_LINKRATE_LANENUM_SS_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 40)
  5284. #define DPCD_GET_LANE_STATUS_ADJUST_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 48)
  5285. #define DP_I2C_AUX_DDC_WRITE_START_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 60)
  5286. #define DP_I2C_AUX_DDC_WRITE_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 64)
  5287. #define DP_I2C_AUX_DDC_READ_START_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 72)
  5288. #define DP_I2C_AUX_DDC_READ_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 76)
  5289. #define DP_I2C_AUX_DDC_WRITE_END_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 80)
  5290. #define DP_I2C_AUX_DDC_READ_END_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 84)
  5291. typedef struct _PROCESS_I2C_CHANNEL_TRANSACTION_PARAMETERS
  5292. {
  5293. UCHAR ucI2CSpeed;
  5294. union
  5295. {
  5296. UCHAR ucRegIndex;
  5297. UCHAR ucStatus;
  5298. };
  5299. USHORT lpI2CDataOut;
  5300. UCHAR ucFlag;
  5301. UCHAR ucTransBytes;
  5302. UCHAR ucSlaveAddr;
  5303. UCHAR ucLineNumber;
  5304. }PROCESS_I2C_CHANNEL_TRANSACTION_PARAMETERS;
  5305. #define PROCESS_I2C_CHANNEL_TRANSACTION_PS_ALLOCATION PROCESS_I2C_CHANNEL_TRANSACTION_PARAMETERS
  5306. //ucFlag
  5307. #define HW_I2C_WRITE 1
  5308. #define HW_I2C_READ 0
  5309. #define I2C_2BYTE_ADDR 0x02
  5310. typedef struct _SET_HWBLOCK_INSTANCE_PARAMETER_V2
  5311. {
  5312. UCHAR ucHWBlkInst; // HW block instance, 0, 1, 2, ...
  5313. UCHAR ucReserved[3];
  5314. }SET_HWBLOCK_INSTANCE_PARAMETER_V2;
  5315. #define HWBLKINST_INSTANCE_MASK 0x07
  5316. #define HWBLKINST_HWBLK_MASK 0xF0
  5317. #define HWBLKINST_HWBLK_SHIFT 0x04
  5318. //ucHWBlock
  5319. #define SELECT_DISP_ENGINE 0
  5320. #define SELECT_DISP_PLL 1
  5321. #define SELECT_DCIO_UNIPHY_LINK0 2
  5322. #define SELECT_DCIO_UNIPHY_LINK1 3
  5323. #define SELECT_DCIO_IMPCAL 4
  5324. #define SELECT_DCIO_DIG 6
  5325. #define SELECT_CRTC_PIXEL_RATE 7
  5326. #define SELECT_VGA_BLK 8
  5327. /****************************************************************************/
  5328. //Portion VI: Definitinos for vbios MC scratch registers that driver used
  5329. /****************************************************************************/
  5330. #define MC_MISC0__MEMORY_TYPE_MASK 0xF0000000
  5331. #define MC_MISC0__MEMORY_TYPE__GDDR1 0x10000000
  5332. #define MC_MISC0__MEMORY_TYPE__DDR2 0x20000000
  5333. #define MC_MISC0__MEMORY_TYPE__GDDR3 0x30000000
  5334. #define MC_MISC0__MEMORY_TYPE__GDDR4 0x40000000
  5335. #define MC_MISC0__MEMORY_TYPE__GDDR5 0x50000000
  5336. #define MC_MISC0__MEMORY_TYPE__DDR3 0xB0000000
  5337. /****************************************************************************/
  5338. //Portion VI: Definitinos being oboselete
  5339. /****************************************************************************/
  5340. //==========================================================================================
  5341. //Remove the definitions below when driver is ready!
  5342. typedef struct _ATOM_DAC_INFO
  5343. {
  5344. ATOM_COMMON_TABLE_HEADER sHeader;
  5345. USHORT usMaxFrequency; // in 10kHz unit
  5346. USHORT usReserved;
  5347. }ATOM_DAC_INFO;
  5348. typedef struct _COMPASSIONATE_DATA
  5349. {
  5350. ATOM_COMMON_TABLE_HEADER sHeader;
  5351. //============================== DAC1 portion
  5352. UCHAR ucDAC1_BG_Adjustment;
  5353. UCHAR ucDAC1_DAC_Adjustment;
  5354. USHORT usDAC1_FORCE_Data;
  5355. //============================== DAC2 portion
  5356. UCHAR ucDAC2_CRT2_BG_Adjustment;
  5357. UCHAR ucDAC2_CRT2_DAC_Adjustment;
  5358. USHORT usDAC2_CRT2_FORCE_Data;
  5359. USHORT usDAC2_CRT2_MUX_RegisterIndex;
  5360. UCHAR ucDAC2_CRT2_MUX_RegisterInfo; //Bit[4:0]=Bit position,Bit[7]=1:Active High;=0 Active Low
  5361. UCHAR ucDAC2_NTSC_BG_Adjustment;
  5362. UCHAR ucDAC2_NTSC_DAC_Adjustment;
  5363. USHORT usDAC2_TV1_FORCE_Data;
  5364. USHORT usDAC2_TV1_MUX_RegisterIndex;
  5365. UCHAR ucDAC2_TV1_MUX_RegisterInfo; //Bit[4:0]=Bit position,Bit[7]=1:Active High;=0 Active Low
  5366. UCHAR ucDAC2_CV_BG_Adjustment;
  5367. UCHAR ucDAC2_CV_DAC_Adjustment;
  5368. USHORT usDAC2_CV_FORCE_Data;
  5369. USHORT usDAC2_CV_MUX_RegisterIndex;
  5370. UCHAR ucDAC2_CV_MUX_RegisterInfo; //Bit[4:0]=Bit position,Bit[7]=1:Active High;=0 Active Low
  5371. UCHAR ucDAC2_PAL_BG_Adjustment;
  5372. UCHAR ucDAC2_PAL_DAC_Adjustment;
  5373. USHORT usDAC2_TV2_FORCE_Data;
  5374. }COMPASSIONATE_DATA;
  5375. /****************************Supported Device Info Table Definitions**********************/
  5376. // ucConnectInfo:
  5377. // [7:4] - connector type
  5378. // = 1 - VGA connector
  5379. // = 2 - DVI-I
  5380. // = 3 - DVI-D
  5381. // = 4 - DVI-A
  5382. // = 5 - SVIDEO
  5383. // = 6 - COMPOSITE
  5384. // = 7 - LVDS
  5385. // = 8 - DIGITAL LINK
  5386. // = 9 - SCART
  5387. // = 0xA - HDMI_type A
  5388. // = 0xB - HDMI_type B
  5389. // = 0xE - Special case1 (DVI+DIN)
  5390. // Others=TBD
  5391. // [3:0] - DAC Associated
  5392. // = 0 - no DAC
  5393. // = 1 - DACA
  5394. // = 2 - DACB
  5395. // = 3 - External DAC
  5396. // Others=TBD
  5397. //
  5398. typedef struct _ATOM_CONNECTOR_INFO
  5399. {
  5400. #if ATOM_BIG_ENDIAN
  5401. UCHAR bfConnectorType:4;
  5402. UCHAR bfAssociatedDAC:4;
  5403. #else
  5404. UCHAR bfAssociatedDAC:4;
  5405. UCHAR bfConnectorType:4;
  5406. #endif
  5407. }ATOM_CONNECTOR_INFO;
  5408. typedef union _ATOM_CONNECTOR_INFO_ACCESS
  5409. {
  5410. ATOM_CONNECTOR_INFO sbfAccess;
  5411. UCHAR ucAccess;
  5412. }ATOM_CONNECTOR_INFO_ACCESS;
  5413. typedef struct _ATOM_CONNECTOR_INFO_I2C
  5414. {
  5415. ATOM_CONNECTOR_INFO_ACCESS sucConnectorInfo;
  5416. ATOM_I2C_ID_CONFIG_ACCESS sucI2cId;
  5417. }ATOM_CONNECTOR_INFO_I2C;
  5418. typedef struct _ATOM_SUPPORTED_DEVICES_INFO
  5419. {
  5420. ATOM_COMMON_TABLE_HEADER sHeader;
  5421. USHORT usDeviceSupport;
  5422. ATOM_CONNECTOR_INFO_I2C asConnInfo[ATOM_MAX_SUPPORTED_DEVICE_INFO];
  5423. }ATOM_SUPPORTED_DEVICES_INFO;
  5424. #define NO_INT_SRC_MAPPED 0xFF
  5425. typedef struct _ATOM_CONNECTOR_INC_SRC_BITMAP
  5426. {
  5427. UCHAR ucIntSrcBitmap;
  5428. }ATOM_CONNECTOR_INC_SRC_BITMAP;
  5429. typedef struct _ATOM_SUPPORTED_DEVICES_INFO_2
  5430. {
  5431. ATOM_COMMON_TABLE_HEADER sHeader;
  5432. USHORT usDeviceSupport;
  5433. ATOM_CONNECTOR_INFO_I2C asConnInfo[ATOM_MAX_SUPPORTED_DEVICE_INFO_2];
  5434. ATOM_CONNECTOR_INC_SRC_BITMAP asIntSrcInfo[ATOM_MAX_SUPPORTED_DEVICE_INFO_2];
  5435. }ATOM_SUPPORTED_DEVICES_INFO_2;
  5436. typedef struct _ATOM_SUPPORTED_DEVICES_INFO_2d1
  5437. {
  5438. ATOM_COMMON_TABLE_HEADER sHeader;
  5439. USHORT usDeviceSupport;
  5440. ATOM_CONNECTOR_INFO_I2C asConnInfo[ATOM_MAX_SUPPORTED_DEVICE];
  5441. ATOM_CONNECTOR_INC_SRC_BITMAP asIntSrcInfo[ATOM_MAX_SUPPORTED_DEVICE];
  5442. }ATOM_SUPPORTED_DEVICES_INFO_2d1;
  5443. #define ATOM_SUPPORTED_DEVICES_INFO_LAST ATOM_SUPPORTED_DEVICES_INFO_2d1
  5444. typedef struct _ATOM_MISC_CONTROL_INFO
  5445. {
  5446. USHORT usFrequency;
  5447. UCHAR ucPLL_ChargePump; // PLL charge-pump gain control
  5448. UCHAR ucPLL_DutyCycle; // PLL duty cycle control
  5449. UCHAR ucPLL_VCO_Gain; // PLL VCO gain control
  5450. UCHAR ucPLL_VoltageSwing; // PLL driver voltage swing control
  5451. }ATOM_MISC_CONTROL_INFO;
  5452. #define ATOM_MAX_MISC_INFO 4
  5453. typedef struct _ATOM_TMDS_INFO
  5454. {
  5455. ATOM_COMMON_TABLE_HEADER sHeader;
  5456. USHORT usMaxFrequency; // in 10Khz
  5457. ATOM_MISC_CONTROL_INFO asMiscInfo[ATOM_MAX_MISC_INFO];
  5458. }ATOM_TMDS_INFO;
  5459. typedef struct _ATOM_ENCODER_ANALOG_ATTRIBUTE
  5460. {
  5461. UCHAR ucTVStandard; //Same as TV standards defined above,
  5462. UCHAR ucPadding[1];
  5463. }ATOM_ENCODER_ANALOG_ATTRIBUTE;
  5464. typedef struct _ATOM_ENCODER_DIGITAL_ATTRIBUTE
  5465. {
  5466. UCHAR ucAttribute; //Same as other digital encoder attributes defined above
  5467. UCHAR ucPadding[1];
  5468. }ATOM_ENCODER_DIGITAL_ATTRIBUTE;
  5469. typedef union _ATOM_ENCODER_ATTRIBUTE
  5470. {
  5471. ATOM_ENCODER_ANALOG_ATTRIBUTE sAlgAttrib;
  5472. ATOM_ENCODER_DIGITAL_ATTRIBUTE sDigAttrib;
  5473. }ATOM_ENCODER_ATTRIBUTE;
  5474. typedef struct _DVO_ENCODER_CONTROL_PARAMETERS
  5475. {
  5476. USHORT usPixelClock;
  5477. USHORT usEncoderID;
  5478. UCHAR ucDeviceType; //Use ATOM_DEVICE_xxx1_Index to indicate device type only.
  5479. UCHAR ucAction; //ATOM_ENABLE/ATOM_DISABLE/ATOM_HPD_INIT
  5480. ATOM_ENCODER_ATTRIBUTE usDevAttr;
  5481. }DVO_ENCODER_CONTROL_PARAMETERS;
  5482. typedef struct _DVO_ENCODER_CONTROL_PS_ALLOCATION
  5483. {
  5484. DVO_ENCODER_CONTROL_PARAMETERS sDVOEncoder;
  5485. WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION sReserved; //Caller doesn't need to init this portion
  5486. }DVO_ENCODER_CONTROL_PS_ALLOCATION;
  5487. #define ATOM_XTMDS_ASIC_SI164_ID 1
  5488. #define ATOM_XTMDS_ASIC_SI178_ID 2
  5489. #define ATOM_XTMDS_ASIC_TFP513_ID 3
  5490. #define ATOM_XTMDS_SUPPORTED_SINGLELINK 0x00000001
  5491. #define ATOM_XTMDS_SUPPORTED_DUALLINK 0x00000002
  5492. #define ATOM_XTMDS_MVPU_FPGA 0x00000004
  5493. typedef struct _ATOM_XTMDS_INFO
  5494. {
  5495. ATOM_COMMON_TABLE_HEADER sHeader;
  5496. USHORT usSingleLinkMaxFrequency;
  5497. ATOM_I2C_ID_CONFIG_ACCESS sucI2cId; //Point the ID on which I2C is used to control external chip
  5498. UCHAR ucXtransimitterID;
  5499. UCHAR ucSupportedLink; // Bit field, bit0=1, single link supported;bit1=1,dual link supported
  5500. UCHAR ucSequnceAlterID; // Even with the same external TMDS asic, it's possible that the program seqence alters
  5501. // due to design. This ID is used to alert driver that the sequence is not "standard"!
  5502. UCHAR ucMasterAddress; // Address to control Master xTMDS Chip
  5503. UCHAR ucSlaveAddress; // Address to control Slave xTMDS Chip
  5504. }ATOM_XTMDS_INFO;
  5505. typedef struct _DFP_DPMS_STATUS_CHANGE_PARAMETERS
  5506. {
  5507. UCHAR ucEnable; // ATOM_ENABLE=On or ATOM_DISABLE=Off
  5508. UCHAR ucDevice; // ATOM_DEVICE_DFP1_INDEX....
  5509. UCHAR ucPadding[2];
  5510. }DFP_DPMS_STATUS_CHANGE_PARAMETERS;
  5511. /****************************Legacy Power Play Table Definitions **********************/
  5512. //Definitions for ulPowerPlayMiscInfo
  5513. #define ATOM_PM_MISCINFO_SPLIT_CLOCK 0x00000000L
  5514. #define ATOM_PM_MISCINFO_USING_MCLK_SRC 0x00000001L
  5515. #define ATOM_PM_MISCINFO_USING_SCLK_SRC 0x00000002L
  5516. #define ATOM_PM_MISCINFO_VOLTAGE_DROP_SUPPORT 0x00000004L
  5517. #define ATOM_PM_MISCINFO_VOLTAGE_DROP_ACTIVE_HIGH 0x00000008L
  5518. #define ATOM_PM_MISCINFO_LOAD_PERFORMANCE_EN 0x00000010L
  5519. #define ATOM_PM_MISCINFO_ENGINE_CLOCK_CONTRL_EN 0x00000020L
  5520. #define ATOM_PM_MISCINFO_MEMORY_CLOCK_CONTRL_EN 0x00000040L
  5521. #define ATOM_PM_MISCINFO_PROGRAM_VOLTAGE 0x00000080L //When this bit set, ucVoltageDropIndex is not an index for GPIO pin, but a voltage ID that SW needs program
  5522. #define ATOM_PM_MISCINFO_ASIC_REDUCED_SPEED_SCLK_EN 0x00000100L
  5523. #define ATOM_PM_MISCINFO_ASIC_DYNAMIC_VOLTAGE_EN 0x00000200L
  5524. #define ATOM_PM_MISCINFO_ASIC_SLEEP_MODE_EN 0x00000400L
  5525. #define ATOM_PM_MISCINFO_LOAD_BALANCE_EN 0x00000800L
  5526. #define ATOM_PM_MISCINFO_DEFAULT_DC_STATE_ENTRY_TRUE 0x00001000L
  5527. #define ATOM_PM_MISCINFO_DEFAULT_LOW_DC_STATE_ENTRY_TRUE 0x00002000L
  5528. #define ATOM_PM_MISCINFO_LOW_LCD_REFRESH_RATE 0x00004000L
  5529. #define ATOM_PM_MISCINFO_DRIVER_DEFAULT_MODE 0x00008000L
  5530. #define ATOM_PM_MISCINFO_OVER_CLOCK_MODE 0x00010000L
  5531. #define ATOM_PM_MISCINFO_OVER_DRIVE_MODE 0x00020000L
  5532. #define ATOM_PM_MISCINFO_POWER_SAVING_MODE 0x00040000L
  5533. #define ATOM_PM_MISCINFO_THERMAL_DIODE_MODE 0x00080000L
  5534. #define ATOM_PM_MISCINFO_FRAME_MODULATION_MASK 0x00300000L //0-FM Disable, 1-2 level FM, 2-4 level FM, 3-Reserved
  5535. #define ATOM_PM_MISCINFO_FRAME_MODULATION_SHIFT 20
  5536. #define ATOM_PM_MISCINFO_DYN_CLK_3D_IDLE 0x00400000L
  5537. #define ATOM_PM_MISCINFO_DYNAMIC_CLOCK_DIVIDER_BY_2 0x00800000L
  5538. #define ATOM_PM_MISCINFO_DYNAMIC_CLOCK_DIVIDER_BY_4 0x01000000L
  5539. #define ATOM_PM_MISCINFO_DYNAMIC_HDP_BLOCK_EN 0x02000000L //When set, Dynamic
  5540. #define ATOM_PM_MISCINFO_DYNAMIC_MC_HOST_BLOCK_EN 0x04000000L //When set, Dynamic
  5541. #define ATOM_PM_MISCINFO_3D_ACCELERATION_EN 0x08000000L //When set, This mode is for acceleated 3D mode
  5542. #define ATOM_PM_MISCINFO_POWERPLAY_SETTINGS_GROUP_MASK 0x70000000L //1-Optimal Battery Life Group, 2-High Battery, 3-Balanced, 4-High Performance, 5- Optimal Performance (Default state with Default clocks)
  5543. #define ATOM_PM_MISCINFO_POWERPLAY_SETTINGS_GROUP_SHIFT 28
  5544. #define ATOM_PM_MISCINFO_ENABLE_BACK_BIAS 0x80000000L
  5545. #define ATOM_PM_MISCINFO2_SYSTEM_AC_LITE_MODE 0x00000001L
  5546. #define ATOM_PM_MISCINFO2_MULTI_DISPLAY_SUPPORT 0x00000002L
  5547. #define ATOM_PM_MISCINFO2_DYNAMIC_BACK_BIAS_EN 0x00000004L
  5548. #define ATOM_PM_MISCINFO2_FS3D_OVERDRIVE_INFO 0x00000008L
  5549. #define ATOM_PM_MISCINFO2_FORCEDLOWPWR_MODE 0x00000010L
  5550. #define ATOM_PM_MISCINFO2_VDDCI_DYNAMIC_VOLTAGE_EN 0x00000020L
  5551. #define ATOM_PM_MISCINFO2_VIDEO_PLAYBACK_CAPABLE 0x00000040L //If this bit is set in multi-pp mode, then driver will pack up one with the minior power consumption.
  5552. //If it's not set in any pp mode, driver will use its default logic to pick a pp mode in video playback
  5553. #define ATOM_PM_MISCINFO2_NOT_VALID_ON_DC 0x00000080L
  5554. #define ATOM_PM_MISCINFO2_STUTTER_MODE_EN 0x00000100L
  5555. #define ATOM_PM_MISCINFO2_UVD_SUPPORT_MODE 0x00000200L
  5556. //ucTableFormatRevision=1
  5557. //ucTableContentRevision=1
  5558. typedef struct _ATOM_POWERMODE_INFO
  5559. {
  5560. ULONG ulMiscInfo; //The power level should be arranged in ascending order
  5561. ULONG ulReserved1; // must set to 0
  5562. ULONG ulReserved2; // must set to 0
  5563. USHORT usEngineClock;
  5564. USHORT usMemoryClock;
  5565. UCHAR ucVoltageDropIndex; // index to GPIO table
  5566. UCHAR ucSelectedPanel_RefreshRate;// panel refresh rate
  5567. UCHAR ucMinTemperature;
  5568. UCHAR ucMaxTemperature;
  5569. UCHAR ucNumPciELanes; // number of PCIE lanes
  5570. }ATOM_POWERMODE_INFO;
  5571. //ucTableFormatRevision=2
  5572. //ucTableContentRevision=1
  5573. typedef struct _ATOM_POWERMODE_INFO_V2
  5574. {
  5575. ULONG ulMiscInfo; //The power level should be arranged in ascending order
  5576. ULONG ulMiscInfo2;
  5577. ULONG ulEngineClock;
  5578. ULONG ulMemoryClock;
  5579. UCHAR ucVoltageDropIndex; // index to GPIO table
  5580. UCHAR ucSelectedPanel_RefreshRate;// panel refresh rate
  5581. UCHAR ucMinTemperature;
  5582. UCHAR ucMaxTemperature;
  5583. UCHAR ucNumPciELanes; // number of PCIE lanes
  5584. }ATOM_POWERMODE_INFO_V2;
  5585. //ucTableFormatRevision=2
  5586. //ucTableContentRevision=2
  5587. typedef struct _ATOM_POWERMODE_INFO_V3
  5588. {
  5589. ULONG ulMiscInfo; //The power level should be arranged in ascending order
  5590. ULONG ulMiscInfo2;
  5591. ULONG ulEngineClock;
  5592. ULONG ulMemoryClock;
  5593. UCHAR ucVoltageDropIndex; // index to Core (VDDC) votage table
  5594. UCHAR ucSelectedPanel_RefreshRate;// panel refresh rate
  5595. UCHAR ucMinTemperature;
  5596. UCHAR ucMaxTemperature;
  5597. UCHAR ucNumPciELanes; // number of PCIE lanes
  5598. UCHAR ucVDDCI_VoltageDropIndex; // index to VDDCI votage table
  5599. }ATOM_POWERMODE_INFO_V3;
  5600. #define ATOM_MAX_NUMBEROF_POWER_BLOCK 8
  5601. #define ATOM_PP_OVERDRIVE_INTBITMAP_AUXWIN 0x01
  5602. #define ATOM_PP_OVERDRIVE_INTBITMAP_OVERDRIVE 0x02
  5603. #define ATOM_PP_OVERDRIVE_THERMALCONTROLLER_LM63 0x01
  5604. #define ATOM_PP_OVERDRIVE_THERMALCONTROLLER_ADM1032 0x02
  5605. #define ATOM_PP_OVERDRIVE_THERMALCONTROLLER_ADM1030 0x03
  5606. #define ATOM_PP_OVERDRIVE_THERMALCONTROLLER_MUA6649 0x04
  5607. #define ATOM_PP_OVERDRIVE_THERMALCONTROLLER_LM64 0x05
  5608. #define ATOM_PP_OVERDRIVE_THERMALCONTROLLER_F75375 0x06
  5609. #define ATOM_PP_OVERDRIVE_THERMALCONTROLLER_ASC7512 0x07 // Andigilog
  5610. typedef struct _ATOM_POWERPLAY_INFO
  5611. {
  5612. ATOM_COMMON_TABLE_HEADER sHeader;
  5613. UCHAR ucOverdriveThermalController;
  5614. UCHAR ucOverdriveI2cLine;
  5615. UCHAR ucOverdriveIntBitmap;
  5616. UCHAR ucOverdriveControllerAddress;
  5617. UCHAR ucSizeOfPowerModeEntry;
  5618. UCHAR ucNumOfPowerModeEntries;
  5619. ATOM_POWERMODE_INFO asPowerPlayInfo[ATOM_MAX_NUMBEROF_POWER_BLOCK];
  5620. }ATOM_POWERPLAY_INFO;
  5621. typedef struct _ATOM_POWERPLAY_INFO_V2
  5622. {
  5623. ATOM_COMMON_TABLE_HEADER sHeader;
  5624. UCHAR ucOverdriveThermalController;
  5625. UCHAR ucOverdriveI2cLine;
  5626. UCHAR ucOverdriveIntBitmap;
  5627. UCHAR ucOverdriveControllerAddress;
  5628. UCHAR ucSizeOfPowerModeEntry;
  5629. UCHAR ucNumOfPowerModeEntries;
  5630. ATOM_POWERMODE_INFO_V2 asPowerPlayInfo[ATOM_MAX_NUMBEROF_POWER_BLOCK];
  5631. }ATOM_POWERPLAY_INFO_V2;
  5632. typedef struct _ATOM_POWERPLAY_INFO_V3
  5633. {
  5634. ATOM_COMMON_TABLE_HEADER sHeader;
  5635. UCHAR ucOverdriveThermalController;
  5636. UCHAR ucOverdriveI2cLine;
  5637. UCHAR ucOverdriveIntBitmap;
  5638. UCHAR ucOverdriveControllerAddress;
  5639. UCHAR ucSizeOfPowerModeEntry;
  5640. UCHAR ucNumOfPowerModeEntries;
  5641. ATOM_POWERMODE_INFO_V3 asPowerPlayInfo[ATOM_MAX_NUMBEROF_POWER_BLOCK];
  5642. }ATOM_POWERPLAY_INFO_V3;
  5643. /* New PPlib */
  5644. /**************************************************************************/
  5645. typedef struct _ATOM_PPLIB_THERMALCONTROLLER
  5646. {
  5647. UCHAR ucType; // one of ATOM_PP_THERMALCONTROLLER_*
  5648. UCHAR ucI2cLine; // as interpreted by DAL I2C
  5649. UCHAR ucI2cAddress;
  5650. UCHAR ucFanParameters; // Fan Control Parameters.
  5651. UCHAR ucFanMinRPM; // Fan Minimum RPM (hundreds) -- for display purposes only.
  5652. UCHAR ucFanMaxRPM; // Fan Maximum RPM (hundreds) -- for display purposes only.
  5653. UCHAR ucReserved; // ----
  5654. UCHAR ucFlags; // to be defined
  5655. } ATOM_PPLIB_THERMALCONTROLLER;
  5656. #define ATOM_PP_FANPARAMETERS_TACHOMETER_PULSES_PER_REVOLUTION_MASK 0x0f
  5657. #define ATOM_PP_FANPARAMETERS_NOFAN 0x80 // No fan is connected to this controller.
  5658. #define ATOM_PP_THERMALCONTROLLER_NONE 0
  5659. #define ATOM_PP_THERMALCONTROLLER_LM63 1 // Not used by PPLib
  5660. #define ATOM_PP_THERMALCONTROLLER_ADM1032 2 // Not used by PPLib
  5661. #define ATOM_PP_THERMALCONTROLLER_ADM1030 3 // Not used by PPLib
  5662. #define ATOM_PP_THERMALCONTROLLER_MUA6649 4 // Not used by PPLib
  5663. #define ATOM_PP_THERMALCONTROLLER_LM64 5
  5664. #define ATOM_PP_THERMALCONTROLLER_F75375 6 // Not used by PPLib
  5665. #define ATOM_PP_THERMALCONTROLLER_RV6xx 7
  5666. #define ATOM_PP_THERMALCONTROLLER_RV770 8
  5667. #define ATOM_PP_THERMALCONTROLLER_ADT7473 9
  5668. #define ATOM_PP_THERMALCONTROLLER_EXTERNAL_GPIO 11
  5669. #define ATOM_PP_THERMALCONTROLLER_EVERGREEN 12
  5670. #define ATOM_PP_THERMALCONTROLLER_EMC2103 13 /* 0x0D */ // Only fan control will be implemented, do NOT show this in PPGen.
  5671. #define ATOM_PP_THERMALCONTROLLER_SUMO 14 /* 0x0E */ // Sumo type, used internally
  5672. #define ATOM_PP_THERMALCONTROLLER_NISLANDS 15
  5673. // Thermal controller 'combo type' to use an external controller for Fan control and an internal controller for thermal.
  5674. // We probably should reserve the bit 0x80 for this use.
  5675. // To keep the number of these types low we should also use the same code for all ASICs (i.e. do not distinguish RV6xx and RV7xx Internal here).
  5676. // The driver can pick the correct internal controller based on the ASIC.
  5677. #define ATOM_PP_THERMALCONTROLLER_ADT7473_WITH_INTERNAL 0x89 // ADT7473 Fan Control + Internal Thermal Controller
  5678. #define ATOM_PP_THERMALCONTROLLER_EMC2103_WITH_INTERNAL 0x8D // EMC2103 Fan Control + Internal Thermal Controller
  5679. typedef struct _ATOM_PPLIB_STATE
  5680. {
  5681. UCHAR ucNonClockStateIndex;
  5682. UCHAR ucClockStateIndices[1]; // variable-sized
  5683. } ATOM_PPLIB_STATE;
  5684. typedef struct _ATOM_PPLIB_FANTABLE
  5685. {
  5686. UCHAR ucFanTableFormat; // Change this if the table format changes or version changes so that the other fields are not the same.
  5687. UCHAR ucTHyst; // Temperature hysteresis. Integer.
  5688. USHORT usTMin; // The temperature, in 0.01 centigrades, below which we just run at a minimal PWM.
  5689. USHORT usTMed; // The middle temperature where we change slopes.
  5690. USHORT usTHigh; // The high point above TMed for adjusting the second slope.
  5691. USHORT usPWMMin; // The minimum PWM value in percent (0.01% increments).
  5692. USHORT usPWMMed; // The PWM value (in percent) at TMed.
  5693. USHORT usPWMHigh; // The PWM value at THigh.
  5694. } ATOM_PPLIB_FANTABLE;
  5695. typedef struct _ATOM_PPLIB_EXTENDEDHEADER
  5696. {
  5697. USHORT usSize;
  5698. ULONG ulMaxEngineClock; // For Overdrive.
  5699. ULONG ulMaxMemoryClock; // For Overdrive.
  5700. // Add extra system parameters here, always adjust size to include all fields.
  5701. } ATOM_PPLIB_EXTENDEDHEADER;
  5702. //// ATOM_PPLIB_POWERPLAYTABLE::ulPlatformCaps
  5703. #define ATOM_PP_PLATFORM_CAP_BACKBIAS 1
  5704. #define ATOM_PP_PLATFORM_CAP_POWERPLAY 2
  5705. #define ATOM_PP_PLATFORM_CAP_SBIOSPOWERSOURCE 4
  5706. #define ATOM_PP_PLATFORM_CAP_ASPM_L0s 8
  5707. #define ATOM_PP_PLATFORM_CAP_ASPM_L1 16
  5708. #define ATOM_PP_PLATFORM_CAP_HARDWAREDC 32
  5709. #define ATOM_PP_PLATFORM_CAP_GEMINIPRIMARY 64
  5710. #define ATOM_PP_PLATFORM_CAP_STEPVDDC 128
  5711. #define ATOM_PP_PLATFORM_CAP_VOLTAGECONTROL 256
  5712. #define ATOM_PP_PLATFORM_CAP_SIDEPORTCONTROL 512
  5713. #define ATOM_PP_PLATFORM_CAP_TURNOFFPLL_ASPML1 1024
  5714. #define ATOM_PP_PLATFORM_CAP_HTLINKCONTROL 2048
  5715. #define ATOM_PP_PLATFORM_CAP_MVDDCONTROL 4096
  5716. #define ATOM_PP_PLATFORM_CAP_GOTO_BOOT_ON_ALERT 0x2000 // Go to boot state on alerts, e.g. on an AC->DC transition.
  5717. #define ATOM_PP_PLATFORM_CAP_DONT_WAIT_FOR_VBLANK_ON_ALERT 0x4000 // Do NOT wait for VBLANK during an alert (e.g. AC->DC transition).
  5718. #define ATOM_PP_PLATFORM_CAP_VDDCI_CONTROL 0x8000 // Does the driver control VDDCI independently from VDDC.
  5719. #define ATOM_PP_PLATFORM_CAP_REGULATOR_HOT 0x00010000 // Enable the 'regulator hot' feature.
  5720. #define ATOM_PP_PLATFORM_CAP_BACO 0x00020000 // Does the driver supports BACO state.
  5721. typedef struct _ATOM_PPLIB_POWERPLAYTABLE
  5722. {
  5723. ATOM_COMMON_TABLE_HEADER sHeader;
  5724. UCHAR ucDataRevision;
  5725. UCHAR ucNumStates;
  5726. UCHAR ucStateEntrySize;
  5727. UCHAR ucClockInfoSize;
  5728. UCHAR ucNonClockSize;
  5729. // offset from start of this table to array of ucNumStates ATOM_PPLIB_STATE structures
  5730. USHORT usStateArrayOffset;
  5731. // offset from start of this table to array of ASIC-specific structures,
  5732. // currently ATOM_PPLIB_CLOCK_INFO.
  5733. USHORT usClockInfoArrayOffset;
  5734. // offset from start of this table to array of ATOM_PPLIB_NONCLOCK_INFO
  5735. USHORT usNonClockInfoArrayOffset;
  5736. USHORT usBackbiasTime; // in microseconds
  5737. USHORT usVoltageTime; // in microseconds
  5738. USHORT usTableSize; //the size of this structure, or the extended structure
  5739. ULONG ulPlatformCaps; // See ATOM_PPLIB_CAPS_*
  5740. ATOM_PPLIB_THERMALCONTROLLER sThermalController;
  5741. USHORT usBootClockInfoOffset;
  5742. USHORT usBootNonClockInfoOffset;
  5743. } ATOM_PPLIB_POWERPLAYTABLE;
  5744. typedef struct _ATOM_PPLIB_POWERPLAYTABLE2
  5745. {
  5746. ATOM_PPLIB_POWERPLAYTABLE basicTable;
  5747. UCHAR ucNumCustomThermalPolicy;
  5748. USHORT usCustomThermalPolicyArrayOffset;
  5749. }ATOM_PPLIB_POWERPLAYTABLE2, *LPATOM_PPLIB_POWERPLAYTABLE2;
  5750. typedef struct _ATOM_PPLIB_POWERPLAYTABLE3
  5751. {
  5752. ATOM_PPLIB_POWERPLAYTABLE2 basicTable2;
  5753. USHORT usFormatID; // To be used ONLY by PPGen.
  5754. USHORT usFanTableOffset;
  5755. USHORT usExtendendedHeaderOffset;
  5756. } ATOM_PPLIB_POWERPLAYTABLE3, *LPATOM_PPLIB_POWERPLAYTABLE3;
  5757. typedef struct _ATOM_PPLIB_POWERPLAYTABLE4
  5758. {
  5759. ATOM_PPLIB_POWERPLAYTABLE3 basicTable3;
  5760. ULONG ulGoldenPPID; // PPGen use only
  5761. ULONG ulGoldenRevision; // PPGen use only
  5762. USHORT usVddcDependencyOnSCLKOffset;
  5763. USHORT usVddciDependencyOnMCLKOffset;
  5764. USHORT usVddcDependencyOnMCLKOffset;
  5765. USHORT usMaxClockVoltageOnDCOffset;
  5766. USHORT usReserved[2];
  5767. } ATOM_PPLIB_POWERPLAYTABLE4, *LPATOM_PPLIB_POWERPLAYTABLE4;
  5768. typedef struct _ATOM_PPLIB_POWERPLAYTABLE5
  5769. {
  5770. ATOM_PPLIB_POWERPLAYTABLE4 basicTable4;
  5771. ULONG ulTDPLimit;
  5772. ULONG ulNearTDPLimit;
  5773. ULONG ulSQRampingThreshold;
  5774. USHORT usCACLeakageTableOffset; // Points to ATOM_PPLIB_CAC_Leakage_Table
  5775. ULONG ulCACLeakage; // TBD, this parameter is still under discussion. Change to ulReserved if not needed.
  5776. ULONG ulReserved;
  5777. } ATOM_PPLIB_POWERPLAYTABLE5, *LPATOM_PPLIB_POWERPLAYTABLE5;
  5778. //// ATOM_PPLIB_NONCLOCK_INFO::usClassification
  5779. #define ATOM_PPLIB_CLASSIFICATION_UI_MASK 0x0007
  5780. #define ATOM_PPLIB_CLASSIFICATION_UI_SHIFT 0
  5781. #define ATOM_PPLIB_CLASSIFICATION_UI_NONE 0
  5782. #define ATOM_PPLIB_CLASSIFICATION_UI_BATTERY 1
  5783. #define ATOM_PPLIB_CLASSIFICATION_UI_BALANCED 3
  5784. #define ATOM_PPLIB_CLASSIFICATION_UI_PERFORMANCE 5
  5785. // 2, 4, 6, 7 are reserved
  5786. #define ATOM_PPLIB_CLASSIFICATION_BOOT 0x0008
  5787. #define ATOM_PPLIB_CLASSIFICATION_THERMAL 0x0010
  5788. #define ATOM_PPLIB_CLASSIFICATION_LIMITEDPOWERSOURCE 0x0020
  5789. #define ATOM_PPLIB_CLASSIFICATION_REST 0x0040
  5790. #define ATOM_PPLIB_CLASSIFICATION_FORCED 0x0080
  5791. #define ATOM_PPLIB_CLASSIFICATION_3DPERFORMANCE 0x0100
  5792. #define ATOM_PPLIB_CLASSIFICATION_OVERDRIVETEMPLATE 0x0200
  5793. #define ATOM_PPLIB_CLASSIFICATION_UVDSTATE 0x0400
  5794. #define ATOM_PPLIB_CLASSIFICATION_3DLOW 0x0800
  5795. #define ATOM_PPLIB_CLASSIFICATION_ACPI 0x1000
  5796. #define ATOM_PPLIB_CLASSIFICATION_HD2STATE 0x2000
  5797. #define ATOM_PPLIB_CLASSIFICATION_HDSTATE 0x4000
  5798. #define ATOM_PPLIB_CLASSIFICATION_SDSTATE 0x8000
  5799. //// ATOM_PPLIB_NONCLOCK_INFO::usClassification2
  5800. #define ATOM_PPLIB_CLASSIFICATION2_LIMITEDPOWERSOURCE_2 0x0001
  5801. #define ATOM_PPLIB_CLASSIFICATION2_ULV 0x0002
  5802. //// ATOM_PPLIB_NONCLOCK_INFO::ulCapsAndSettings
  5803. #define ATOM_PPLIB_SINGLE_DISPLAY_ONLY 0x00000001
  5804. #define ATOM_PPLIB_SUPPORTS_VIDEO_PLAYBACK 0x00000002
  5805. // 0 is 2.5Gb/s, 1 is 5Gb/s
  5806. #define ATOM_PPLIB_PCIE_LINK_SPEED_MASK 0x00000004
  5807. #define ATOM_PPLIB_PCIE_LINK_SPEED_SHIFT 2
  5808. // lanes - 1: 1, 2, 4, 8, 12, 16 permitted by PCIE spec
  5809. #define ATOM_PPLIB_PCIE_LINK_WIDTH_MASK 0x000000F8
  5810. #define ATOM_PPLIB_PCIE_LINK_WIDTH_SHIFT 3
  5811. // lookup into reduced refresh-rate table
  5812. #define ATOM_PPLIB_LIMITED_REFRESHRATE_VALUE_MASK 0x00000F00
  5813. #define ATOM_PPLIB_LIMITED_REFRESHRATE_VALUE_SHIFT 8
  5814. #define ATOM_PPLIB_LIMITED_REFRESHRATE_UNLIMITED 0
  5815. #define ATOM_PPLIB_LIMITED_REFRESHRATE_50HZ 1
  5816. // 2-15 TBD as needed.
  5817. #define ATOM_PPLIB_SOFTWARE_DISABLE_LOADBALANCING 0x00001000
  5818. #define ATOM_PPLIB_SOFTWARE_ENABLE_SLEEP_FOR_TIMESTAMPS 0x00002000
  5819. #define ATOM_PPLIB_DISALLOW_ON_DC 0x00004000
  5820. #define ATOM_PPLIB_ENABLE_VARIBRIGHT 0x00008000
  5821. //memory related flags
  5822. #define ATOM_PPLIB_SWSTATE_MEMORY_DLL_OFF 0x000010000
  5823. //M3 Arb //2bits, current 3 sets of parameters in total
  5824. #define ATOM_PPLIB_M3ARB_MASK 0x00060000
  5825. #define ATOM_PPLIB_M3ARB_SHIFT 17
  5826. #define ATOM_PPLIB_ENABLE_DRR 0x00080000
  5827. // remaining 16 bits are reserved
  5828. typedef struct _ATOM_PPLIB_THERMAL_STATE
  5829. {
  5830. UCHAR ucMinTemperature;
  5831. UCHAR ucMaxTemperature;
  5832. UCHAR ucThermalAction;
  5833. }ATOM_PPLIB_THERMAL_STATE, *LPATOM_PPLIB_THERMAL_STATE;
  5834. // Contained in an array starting at the offset
  5835. // in ATOM_PPLIB_POWERPLAYTABLE::usNonClockInfoArrayOffset.
  5836. // referenced from ATOM_PPLIB_STATE_INFO::ucNonClockStateIndex
  5837. #define ATOM_PPLIB_NONCLOCKINFO_VER1 12
  5838. #define ATOM_PPLIB_NONCLOCKINFO_VER2 24
  5839. typedef struct _ATOM_PPLIB_NONCLOCK_INFO
  5840. {
  5841. USHORT usClassification;
  5842. UCHAR ucMinTemperature;
  5843. UCHAR ucMaxTemperature;
  5844. ULONG ulCapsAndSettings;
  5845. UCHAR ucRequiredPower;
  5846. USHORT usClassification2;
  5847. ULONG ulVCLK;
  5848. ULONG ulDCLK;
  5849. UCHAR ucUnused[5];
  5850. } ATOM_PPLIB_NONCLOCK_INFO;
  5851. // Contained in an array starting at the offset
  5852. // in ATOM_PPLIB_POWERPLAYTABLE::usClockInfoArrayOffset.
  5853. // referenced from ATOM_PPLIB_STATE::ucClockStateIndices
  5854. typedef struct _ATOM_PPLIB_R600_CLOCK_INFO
  5855. {
  5856. USHORT usEngineClockLow;
  5857. UCHAR ucEngineClockHigh;
  5858. USHORT usMemoryClockLow;
  5859. UCHAR ucMemoryClockHigh;
  5860. USHORT usVDDC;
  5861. USHORT usUnused1;
  5862. USHORT usUnused2;
  5863. ULONG ulFlags; // ATOM_PPLIB_R600_FLAGS_*
  5864. } ATOM_PPLIB_R600_CLOCK_INFO;
  5865. // ulFlags in ATOM_PPLIB_R600_CLOCK_INFO
  5866. #define ATOM_PPLIB_R600_FLAGS_PCIEGEN2 1
  5867. #define ATOM_PPLIB_R600_FLAGS_UVDSAFE 2
  5868. #define ATOM_PPLIB_R600_FLAGS_BACKBIASENABLE 4
  5869. #define ATOM_PPLIB_R600_FLAGS_MEMORY_ODT_OFF 8
  5870. #define ATOM_PPLIB_R600_FLAGS_MEMORY_DLL_OFF 16
  5871. #define ATOM_PPLIB_R600_FLAGS_LOWPOWER 32 // On the RV770 use 'low power' setting (sequencer S0).
  5872. typedef struct _ATOM_PPLIB_EVERGREEN_CLOCK_INFO
  5873. {
  5874. USHORT usEngineClockLow;
  5875. UCHAR ucEngineClockHigh;
  5876. USHORT usMemoryClockLow;
  5877. UCHAR ucMemoryClockHigh;
  5878. USHORT usVDDC;
  5879. USHORT usVDDCI;
  5880. USHORT usUnused;
  5881. ULONG ulFlags; // ATOM_PPLIB_R600_FLAGS_*
  5882. } ATOM_PPLIB_EVERGREEN_CLOCK_INFO;
  5883. typedef struct _ATOM_PPLIB_RS780_CLOCK_INFO
  5884. {
  5885. USHORT usLowEngineClockLow; // Low Engine clock in MHz (the same way as on the R600).
  5886. UCHAR ucLowEngineClockHigh;
  5887. USHORT usHighEngineClockLow; // High Engine clock in MHz.
  5888. UCHAR ucHighEngineClockHigh;
  5889. USHORT usMemoryClockLow; // For now one of the ATOM_PPLIB_RS780_SPMCLK_XXXX constants.
  5890. UCHAR ucMemoryClockHigh; // Currentyl unused.
  5891. UCHAR ucPadding; // For proper alignment and size.
  5892. USHORT usVDDC; // For the 780, use: None, Low, High, Variable
  5893. UCHAR ucMaxHTLinkWidth; // From SBIOS - {2, 4, 8, 16}
  5894. UCHAR ucMinHTLinkWidth; // From SBIOS - {2, 4, 8, 16}. Effective only if CDLW enabled. Minimum down stream width could be bigger as display BW requirement.
  5895. USHORT usHTLinkFreq; // See definition ATOM_PPLIB_RS780_HTLINKFREQ_xxx or in MHz(>=200).
  5896. ULONG ulFlags;
  5897. } ATOM_PPLIB_RS780_CLOCK_INFO;
  5898. #define ATOM_PPLIB_RS780_VOLTAGE_NONE 0
  5899. #define ATOM_PPLIB_RS780_VOLTAGE_LOW 1
  5900. #define ATOM_PPLIB_RS780_VOLTAGE_HIGH 2
  5901. #define ATOM_PPLIB_RS780_VOLTAGE_VARIABLE 3
  5902. #define ATOM_PPLIB_RS780_SPMCLK_NONE 0 // We cannot change the side port memory clock, leave it as it is.
  5903. #define ATOM_PPLIB_RS780_SPMCLK_LOW 1
  5904. #define ATOM_PPLIB_RS780_SPMCLK_HIGH 2
  5905. #define ATOM_PPLIB_RS780_HTLINKFREQ_NONE 0
  5906. #define ATOM_PPLIB_RS780_HTLINKFREQ_LOW 1
  5907. #define ATOM_PPLIB_RS780_HTLINKFREQ_HIGH 2
  5908. typedef struct _ATOM_PPLIB_SUMO_CLOCK_INFO{
  5909. USHORT usEngineClockLow; //clockfrequency & 0xFFFF. The unit is in 10khz
  5910. UCHAR ucEngineClockHigh; //clockfrequency >> 16.
  5911. UCHAR vddcIndex; //2-bit vddc index;
  5912. UCHAR leakage; //please use 8-bit absolute value, not the 6-bit % value
  5913. //please initalize to 0
  5914. UCHAR rsv;
  5915. //please initalize to 0
  5916. USHORT rsv1;
  5917. //please initialize to 0s
  5918. ULONG rsv2[2];
  5919. }ATOM_PPLIB_SUMO_CLOCK_INFO;
  5920. typedef struct _ATOM_PPLIB_STATE_V2
  5921. {
  5922. //number of valid dpm levels in this state; Driver uses it to calculate the whole
  5923. //size of the state: sizeof(ATOM_PPLIB_STATE_V2) + (ucNumDPMLevels - 1) * sizeof(UCHAR)
  5924. UCHAR ucNumDPMLevels;
  5925. //a index to the array of nonClockInfos
  5926. UCHAR nonClockInfoIndex;
  5927. /**
  5928. * Driver will read the first ucNumDPMLevels in this array
  5929. */
  5930. UCHAR clockInfoIndex[1];
  5931. } ATOM_PPLIB_STATE_V2;
  5932. typedef struct StateArray{
  5933. //how many states we have
  5934. UCHAR ucNumEntries;
  5935. ATOM_PPLIB_STATE_V2 states[1];
  5936. }StateArray;
  5937. typedef struct ClockInfoArray{
  5938. //how many clock levels we have
  5939. UCHAR ucNumEntries;
  5940. //sizeof(ATOM_PPLIB_SUMO_CLOCK_INFO)
  5941. UCHAR ucEntrySize;
  5942. //this is for Sumo
  5943. ATOM_PPLIB_SUMO_CLOCK_INFO clockInfo[1];
  5944. }ClockInfoArray;
  5945. typedef struct NonClockInfoArray{
  5946. //how many non-clock levels we have. normally should be same as number of states
  5947. UCHAR ucNumEntries;
  5948. //sizeof(ATOM_PPLIB_NONCLOCK_INFO)
  5949. UCHAR ucEntrySize;
  5950. ATOM_PPLIB_NONCLOCK_INFO nonClockInfo[1];
  5951. }NonClockInfoArray;
  5952. typedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Record
  5953. {
  5954. USHORT usClockLow;
  5955. UCHAR ucClockHigh;
  5956. USHORT usVoltage;
  5957. }ATOM_PPLIB_Clock_Voltage_Dependency_Record;
  5958. typedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Table
  5959. {
  5960. UCHAR ucNumEntries; // Number of entries.
  5961. ATOM_PPLIB_Clock_Voltage_Dependency_Record entries[1]; // Dynamically allocate entries.
  5962. }ATOM_PPLIB_Clock_Voltage_Dependency_Table;
  5963. typedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Record
  5964. {
  5965. USHORT usSclkLow;
  5966. UCHAR ucSclkHigh;
  5967. USHORT usMclkLow;
  5968. UCHAR ucMclkHigh;
  5969. USHORT usVddc;
  5970. USHORT usVddci;
  5971. }ATOM_PPLIB_Clock_Voltage_Limit_Record;
  5972. typedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Table
  5973. {
  5974. UCHAR ucNumEntries; // Number of entries.
  5975. ATOM_PPLIB_Clock_Voltage_Limit_Record entries[1]; // Dynamically allocate entries.
  5976. }ATOM_PPLIB_Clock_Voltage_Limit_Table;
  5977. /**************************************************************************/
  5978. // Following definitions are for compatibility issue in different SW components.
  5979. #define ATOM_MASTER_DATA_TABLE_REVISION 0x01
  5980. #define Object_Info Object_Header
  5981. #define AdjustARB_SEQ MC_InitParameter
  5982. #define VRAM_GPIO_DetectionInfo VoltageObjectInfo
  5983. #define ASIC_VDDCI_Info ASIC_ProfilingInfo
  5984. #define ASIC_MVDDQ_Info MemoryTrainingInfo
  5985. #define SS_Info PPLL_SS_Info
  5986. #define ASIC_MVDDC_Info ASIC_InternalSS_Info
  5987. #define DispDevicePriorityInfo SaveRestoreInfo
  5988. #define DispOutInfo TV_VideoMode
  5989. #define ATOM_ENCODER_OBJECT_TABLE ATOM_OBJECT_TABLE
  5990. #define ATOM_CONNECTOR_OBJECT_TABLE ATOM_OBJECT_TABLE
  5991. //New device naming, remove them when both DAL/VBIOS is ready
  5992. #define DFP2I_OUTPUT_CONTROL_PARAMETERS CRT1_OUTPUT_CONTROL_PARAMETERS
  5993. #define DFP2I_OUTPUT_CONTROL_PS_ALLOCATION DFP2I_OUTPUT_CONTROL_PARAMETERS
  5994. #define DFP1X_OUTPUT_CONTROL_PARAMETERS CRT1_OUTPUT_CONTROL_PARAMETERS
  5995. #define DFP1X_OUTPUT_CONTROL_PS_ALLOCATION DFP1X_OUTPUT_CONTROL_PARAMETERS
  5996. #define DFP1I_OUTPUT_CONTROL_PARAMETERS DFP1_OUTPUT_CONTROL_PARAMETERS
  5997. #define DFP1I_OUTPUT_CONTROL_PS_ALLOCATION DFP1_OUTPUT_CONTROL_PS_ALLOCATION
  5998. #define ATOM_DEVICE_DFP1I_SUPPORT ATOM_DEVICE_DFP1_SUPPORT
  5999. #define ATOM_DEVICE_DFP1X_SUPPORT ATOM_DEVICE_DFP2_SUPPORT
  6000. #define ATOM_DEVICE_DFP1I_INDEX ATOM_DEVICE_DFP1_INDEX
  6001. #define ATOM_DEVICE_DFP1X_INDEX ATOM_DEVICE_DFP2_INDEX
  6002. #define ATOM_DEVICE_DFP2I_INDEX 0x00000009
  6003. #define ATOM_DEVICE_DFP2I_SUPPORT (0x1L << ATOM_DEVICE_DFP2I_INDEX)
  6004. #define ATOM_S0_DFP1I ATOM_S0_DFP1
  6005. #define ATOM_S0_DFP1X ATOM_S0_DFP2
  6006. #define ATOM_S0_DFP2I 0x00200000L
  6007. #define ATOM_S0_DFP2Ib2 0x20
  6008. #define ATOM_S2_DFP1I_DPMS_STATE ATOM_S2_DFP1_DPMS_STATE
  6009. #define ATOM_S2_DFP1X_DPMS_STATE ATOM_S2_DFP2_DPMS_STATE
  6010. #define ATOM_S2_DFP2I_DPMS_STATE 0x02000000L
  6011. #define ATOM_S2_DFP2I_DPMS_STATEb3 0x02
  6012. #define ATOM_S3_DFP2I_ACTIVEb1 0x02
  6013. #define ATOM_S3_DFP1I_ACTIVE ATOM_S3_DFP1_ACTIVE
  6014. #define ATOM_S3_DFP1X_ACTIVE ATOM_S3_DFP2_ACTIVE
  6015. #define ATOM_S3_DFP2I_ACTIVE 0x00000200L
  6016. #define ATOM_S3_DFP1I_CRTC_ACTIVE ATOM_S3_DFP1_CRTC_ACTIVE
  6017. #define ATOM_S3_DFP1X_CRTC_ACTIVE ATOM_S3_DFP2_CRTC_ACTIVE
  6018. #define ATOM_S3_DFP2I_CRTC_ACTIVE 0x02000000L
  6019. #define ATOM_S3_DFP2I_CRTC_ACTIVEb3 0x02
  6020. #define ATOM_S5_DOS_REQ_DFP2Ib1 0x02
  6021. #define ATOM_S5_DOS_REQ_DFP2I 0x0200
  6022. #define ATOM_S6_ACC_REQ_DFP1I ATOM_S6_ACC_REQ_DFP1
  6023. #define ATOM_S6_ACC_REQ_DFP1X ATOM_S6_ACC_REQ_DFP2
  6024. #define ATOM_S6_ACC_REQ_DFP2Ib3 0x02
  6025. #define ATOM_S6_ACC_REQ_DFP2I 0x02000000L
  6026. #define TMDS1XEncoderControl DVOEncoderControl
  6027. #define DFP1XOutputControl DVOOutputControl
  6028. #define ExternalDFPOutputControl DFP1XOutputControl
  6029. #define EnableExternalTMDS_Encoder TMDS1XEncoderControl
  6030. #define DFP1IOutputControl TMDSAOutputControl
  6031. #define DFP2IOutputControl LVTMAOutputControl
  6032. #define DAC1_ENCODER_CONTROL_PARAMETERS DAC_ENCODER_CONTROL_PARAMETERS
  6033. #define DAC1_ENCODER_CONTROL_PS_ALLOCATION DAC_ENCODER_CONTROL_PS_ALLOCATION
  6034. #define DAC2_ENCODER_CONTROL_PARAMETERS DAC_ENCODER_CONTROL_PARAMETERS
  6035. #define DAC2_ENCODER_CONTROL_PS_ALLOCATION DAC_ENCODER_CONTROL_PS_ALLOCATION
  6036. #define ucDac1Standard ucDacStandard
  6037. #define ucDac2Standard ucDacStandard
  6038. #define TMDS1EncoderControl TMDSAEncoderControl
  6039. #define TMDS2EncoderControl LVTMAEncoderControl
  6040. #define DFP1OutputControl TMDSAOutputControl
  6041. #define DFP2OutputControl LVTMAOutputControl
  6042. #define CRT1OutputControl DAC1OutputControl
  6043. #define CRT2OutputControl DAC2OutputControl
  6044. //These two lines will be removed for sure in a few days, will follow up with Michael V.
  6045. #define EnableLVDS_SS EnableSpreadSpectrumOnPPLL
  6046. #define ENABLE_LVDS_SS_PARAMETERS_V3 ENABLE_SPREAD_SPECTRUM_ON_PPLL
  6047. //#define ATOM_S2_CRT1_DPMS_STATE 0x00010000L
  6048. //#define ATOM_S2_LCD1_DPMS_STATE ATOM_S2_CRT1_DPMS_STATE
  6049. //#define ATOM_S2_TV1_DPMS_STATE ATOM_S2_CRT1_DPMS_STATE
  6050. //#define ATOM_S2_DFP1_DPMS_STATE ATOM_S2_CRT1_DPMS_STATE
  6051. //#define ATOM_S2_CRT2_DPMS_STATE ATOM_S2_CRT1_DPMS_STATE
  6052. #define ATOM_S6_ACC_REQ_TV2 0x00400000L
  6053. #define ATOM_DEVICE_TV2_INDEX 0x00000006
  6054. #define ATOM_DEVICE_TV2_SUPPORT (0x1L << ATOM_DEVICE_TV2_INDEX)
  6055. #define ATOM_S0_TV2 0x00100000L
  6056. #define ATOM_S3_TV2_ACTIVE ATOM_S3_DFP6_ACTIVE
  6057. #define ATOM_S3_TV2_CRTC_ACTIVE ATOM_S3_DFP6_CRTC_ACTIVE
  6058. //
  6059. #define ATOM_S2_CRT1_DPMS_STATE 0x00010000L
  6060. #define ATOM_S2_LCD1_DPMS_STATE 0x00020000L
  6061. #define ATOM_S2_TV1_DPMS_STATE 0x00040000L
  6062. #define ATOM_S2_DFP1_DPMS_STATE 0x00080000L
  6063. #define ATOM_S2_CRT2_DPMS_STATE 0x00100000L
  6064. #define ATOM_S2_LCD2_DPMS_STATE 0x00200000L
  6065. #define ATOM_S2_TV2_DPMS_STATE 0x00400000L
  6066. #define ATOM_S2_DFP2_DPMS_STATE 0x00800000L
  6067. #define ATOM_S2_CV_DPMS_STATE 0x01000000L
  6068. #define ATOM_S2_DFP3_DPMS_STATE 0x02000000L
  6069. #define ATOM_S2_DFP4_DPMS_STATE 0x04000000L
  6070. #define ATOM_S2_DFP5_DPMS_STATE 0x08000000L
  6071. #define ATOM_S2_CRT1_DPMS_STATEb2 0x01
  6072. #define ATOM_S2_LCD1_DPMS_STATEb2 0x02
  6073. #define ATOM_S2_TV1_DPMS_STATEb2 0x04
  6074. #define ATOM_S2_DFP1_DPMS_STATEb2 0x08
  6075. #define ATOM_S2_CRT2_DPMS_STATEb2 0x10
  6076. #define ATOM_S2_LCD2_DPMS_STATEb2 0x20
  6077. #define ATOM_S2_TV2_DPMS_STATEb2 0x40
  6078. #define ATOM_S2_DFP2_DPMS_STATEb2 0x80
  6079. #define ATOM_S2_CV_DPMS_STATEb3 0x01
  6080. #define ATOM_S2_DFP3_DPMS_STATEb3 0x02
  6081. #define ATOM_S2_DFP4_DPMS_STATEb3 0x04
  6082. #define ATOM_S2_DFP5_DPMS_STATEb3 0x08
  6083. #define ATOM_S3_ASIC_GUI_ENGINE_HUNGb3 0x20
  6084. #define ATOM_S3_ALLOW_FAST_PWR_SWITCHb3 0x40
  6085. #define ATOM_S3_RQST_GPU_USE_MIN_PWRb3 0x80
  6086. /*********************************************************************************/
  6087. #pragma pack() // BIOS data must use byte aligment
  6088. #endif /* _ATOMBIOS_H */