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