1 | /*␊ |
2 | * ati_resolution.h␊ |
3 | * ␊ |
4 | *␊ |
5 | * Created by Le Bidou on 19/03/10.␊ |
6 | * Copyright 2010 ---. All rights reserved.␊ |
7 | *␊ |
8 | */␊ |
9 | ␊ |
10 | #ifndef _ATI_RESOLUTION_H_␊ |
11 | #define _ATI_RESOLUTION_H_␊ |
12 | ␊ |
13 | //#include "libsaio.h"␊ |
14 | #include "autoresolution.h"␊ |
15 | ␊ |
16 | #define ATI_SIGNATURE1 "ATI MOBILITY RADEON"␊ |
17 | #define ATI_SIGNATURE2 "ATI Technologies Inc"␊ |
18 | ␊ |
19 | /****************************************************************************/␉␊ |
20 | /*Shortatombios.h parts: */␊ |
21 | /*Portion I: Definitions shared between VBIOS and Driver */␊ |
22 | /****************************************************************************/␊ |
23 | ␊ |
24 | ␊ |
25 | #define ATOM_VERSION_MAJOR 0x00020000␊ |
26 | #define ATOM_VERSION_MINOR 0x00000002␊ |
27 | ␊ |
28 | #define ATOM_HEADER_VERSION (ATOM_VERSION_MAJOR | ATOM_VERSION_MINOR)␊ |
29 | ␊ |
30 | #pragma pack(1) /* BIOS data must use byte aligment */␊ |
31 | ␊ |
32 | /* Define offset to location of ROM header. */␊ |
33 | ␊ |
34 | #define OFFSET_TO_POINTER_TO_ATOM_ROM_HEADER␉␉0x00000048L␊ |
35 | #define OFFSET_TO_ATOM_ROM_IMAGE_SIZE␉␉␉␉ 0x00000002L␊ |
36 | ␊ |
37 | typedef struct ␊ |
38 | {␊ |
39 | uint16_t structureSize;␊ |
40 | uint8_t TableFormatRevision; /*Change it when the Parser is not backward compatible */␊ |
41 | uint8_t TableContentRevision; /*Change it only when the table needs to change but the firmware */␊ |
42 | /*Image can't be updated, while Driver needs to carry the new table! */␊ |
43 | }atomCommonTableHeader;␊ |
44 | ␊ |
45 | typedef struct␊ |
46 | {␊ |
47 | atomCommonTableHeader␉␉sHeader;␊ |
48 | uint8_t␉ firmWareSignature[4]; /*Signature to distinguish between Atombios and non-atombios, ␊ |
49 | atombios should init it as "ATOM", don't change the position */␊ |
50 | uint16_t biosRuntimeSegmentAddress;␊ |
51 | uint16_t protectedModeInfoOffset;␊ |
52 | uint16_t configFilenameOffset;␊ |
53 | uint16_t cRcBlockOffset;␊ |
54 | uint16_t BiosBootupMessageOffset;␊ |
55 | uint16_t int10Offset;␊ |
56 | uint16_t pciBusDevInitCode;␊ |
57 | uint16_t ioBaseAddress;␊ |
58 | uint16_t subsystemVendorID;␊ |
59 | uint16_t subsystemID;␊ |
60 | uint16_t pciInfoOffset; ␊ |
61 | uint16_t masterCommandTableOffset; /*Offset for SW to get all command table offsets, Don't change the position */␊ |
62 | uint16_t masterDataTableOffset; /*Offset for SW to get all data table offsets, Don't change the position */␊ |
63 | uint8_t extendedFunctionCode;␊ |
64 | uint8_t reserved;␊ |
65 | }atomRomHeader;␊ |
66 | ␊ |
67 | /****************************************************************************/␉␊ |
68 | // Structure used in Data.mtb␊ |
69 | /****************************************************************************/␉␊ |
70 | typedef struct␊ |
71 | {␊ |
72 | uint16_t UtilityPipeLine;␉ // Offest for the utility to get parser info,Don't change this position!␊ |
73 | uint16_t MultimediaCapabilityInfo; // Only used by MM Lib,latest version 1.1, not configuable from Bios, need to include the table to build Bios ␊ |
74 | uint16_t MultimediaConfigInfo; // Only used by MM Lib,latest version 2.1, not configuable from Bios, need to include the table to build Bios␊ |
75 | uint16_t StandardVESA_Timing; // Only used by Bios␊ |
76 | uint16_t FirmwareInfo; // Shared by various SW components,latest version 1.4␊ |
77 | uint16_t DAC_Info; // Will be obsolete from R600␊ |
78 | uint16_t LVDS_Info; // Shared by various SW components,latest version 1.1 ␊ |
79 | uint16_t TMDS_Info; // Will be obsolete from R600␊ |
80 | uint16_t AnalogTV_Info; // Shared by various SW components,latest version 1.1 ␊ |
81 | uint16_t SupportedDevicesInfo; // Will be obsolete from R600␊ |
82 | uint16_t GPIO_I2C_Info; // Shared by various SW components,latest version 1.2 will be used from R600 ␊ |
83 | uint16_t VRAM_UsageByFirmware; // Shared by various SW components,latest version 1.3 will be used from R600␊ |
84 | uint16_t GPIO_Pin_LUT; // Shared by various SW components,latest version 1.1␊ |
85 | uint16_t VESA_ToInternalModeLUT; // Only used by Bios␊ |
86 | uint16_t ComponentVideoInfo; // Shared by various SW components,latest version 2.1 will be used from R600␊ |
87 | uint16_t PowerPlayInfo; // Shared by various SW components,latest version 2.1,new design from R600␊ |
88 | uint16_t CompassionateData; // Will be obsolete from R600␊ |
89 | uint16_t SaveRestoreInfo; // Only used by Bios␊ |
90 | uint16_t 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␊ |
91 | uint16_t OemInfo; // Defined and used by external SW, should be obsolete soon␊ |
92 | uint16_t XTMDS_Info; // Will be obsolete from R600␊ |
93 | uint16_t MclkSS_Info; // Shared by various SW components,latest version 1.1, only enabled when ext SS chip is used␊ |
94 | uint16_t Object_Header; // Shared by various SW components,latest version 1.1␊ |
95 | uint16_t IndirectIOAccess; // Only used by Bios,this table position can't change at all!!␊ |
96 | uint16_t MC_InitParameter; // Only used by command table␊ |
97 | uint16_t ASIC_VDDC_Info;␉␉␉␉␉␉// Will be obsolete from R600␊ |
98 | uint16_t ASIC_InternalSS_Info;␉␉␉// New tabel name from R600, used to be called "ASIC_MVDDC_Info"␊ |
99 | uint16_t TV_VideoMode;␉␉␉␉␉␉␉// Only used by command table␊ |
100 | uint16_t VRAM_Info;␉␉␉␉␉␉␉␉// Only used by command table, latest version 1.3␊ |
101 | uint16_t MemoryTrainingInfo;␉␉␉␉// Used for VBIOS and Diag utility for memory training purpose since R600. the new table rev start from 2.1␊ |
102 | uint16_t IntegratedSystemInfo;␉␉␉// Shared by various SW components␊ |
103 | uint16_t ASIC_ProfilingInfo;␉␉␉␉// New table name from R600, used to be called "ASIC_VDDCI_Info" for pre-R600␊ |
104 | uint16_t VoltageObjectInfo;␉␉␉␉// Shared by various SW components, latest version 1.1␊ |
105 | uint16_t␉␉␉␉PowerSourceInfo;␉␉␉␉␉// Shared by various SW components, latest versoin 1.1␊ |
106 | }atomMasterListOfDataTables;␊ |
107 | ␊ |
108 | typedef struct ␊ |
109 | { ␊ |
110 | atomCommonTableHeader␉␉␉header; ␊ |
111 | atomMasterListOfDataTables␉listOfDataTables;␊ |
112 | }atomMasterDataTable;␊ |
113 | ␊ |
114 | typedef union␊ |
115 | { ␊ |
116 | ␉uint16_t usAccess;␊ |
117 | }atomModeMiscInfoAccess;␊ |
118 | ␊ |
119 | /****************************************************************************/␉␊ |
120 | // Structure used in StandardVESA_TimingTable␊ |
121 | // AnalogTV_InfoTable ␊ |
122 | // ComponentVideoInfoTable␊ |
123 | /****************************************************************************/␉␊ |
124 | typedef struct␊ |
125 | {␊ |
126 | uint16_t hTotal;␊ |
127 | uint16_t hActive;␊ |
128 | uint16_t hSyncStart;␊ |
129 | uint16_t hSyncWidth;␊ |
130 | uint16_t vTotal;␊ |
131 | uint16_t vActive;␊ |
132 | uint16_t vSyncStart;␊ |
133 | uint16_t vSyncWidth;␊ |
134 | uint16_t pixelClock;␉␉␉␉␉ //in 10Khz unit␊ |
135 | atomModeMiscInfoAccess modeMiscInfo;␊ |
136 | uint16_t overscanRight;␊ |
137 | uint16_t overscanLeft;␊ |
138 | uint16_t overscanBottom;␊ |
139 | uint16_t overscanTop;␊ |
140 | uint16_t teserve;␊ |
141 | uint8_t internalModeNumber;␊ |
142 | uint8_t refreshRate;␊ |
143 | }atomModeTiming;␊ |
144 | ␊ |
145 | typedef struct␊ |
146 | {␊ |
147 | uint16_t pixelClock;␊ |
148 | uint16_t hActive;␊ |
149 | uint16_t hBlank;␊ |
150 | uint16_t vActive;␊ |
151 | uint16_t vBlank;␉␉␉␊ |
152 | uint16_t hSyncOffset;␊ |
153 | uint16_t hSyncWidth;␊ |
154 | uint16_t vSyncOffset;␊ |
155 | uint16_t vSyncWidth;␊ |
156 | uint16_t imageHSize;␊ |
157 | uint16_t imageVSize;␊ |
158 | uint8_t hBorder;␊ |
159 | uint8_t vBorder;␊ |
160 | atomModeMiscInfoAccess modeMiscInfo;␊ |
161 | uint8_t internalModeNumber;␊ |
162 | uint8_t refreshRate;␊ |
163 | }atomDtdFormat;␊ |
164 | ␊ |
165 | ␊ |
166 | /****************************************************************************/␉␊ |
167 | /*Original ati_resolution.h parts: */␊ |
168 | /****************************************************************************/␊ |
169 | ␊ |
170 | ␊ |
171 | typedef struct␊ |
172 | {␊ |
173 | atomCommonTableHeader header; ␊ |
174 | uint8_t * ␉␉␉␉ modeTimings;␊ |
175 | }atomStandardVesaTiming;␊ |
176 | ␊ |
177 | ␊ |
178 | ␊ |
179 | ␊ |
180 | typedef struct␊ |
181 | {␊ |
182 | uint8_t *base;␊ |
183 | atomRomHeader *atomRomHeader;␊ |
184 | uint16_t *masterCommandTables;␊ |
185 | uint16_t *masterDataTables;␊ |
186 | } atiBiosTables;␊ |
187 | ␊ |
188 | char detectAtiBiosType(sModeTable * table);␊ |
189 | ␊ |
190 | vBiosMap * openAtiVbios(vBiosMap * map, atiBiosTables atiTables);␊ |
191 | ␊ |
192 | bool atiSetMode_1(sModeTable* map, uint8_t idx, uint32_t* x, uint32_t* y);␊ |
193 | bool atiSetMode_2(sModeTable* map, uint8_t idx, uint32_t* x, uint32_t* y);␊ |
194 | ␊ |
195 | ␊ |
196 | ␊ |
197 | #endif |