atombios.h 450 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284
  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_UNDERLAY_PIPE0 16
  57. #define ATOM_UNDERLAY_PIPE1 17
  58. #define ATOM_CRTC_INVALID 0xFF
  59. #define ATOM_DIGA 0
  60. #define ATOM_DIGB 1
  61. #define ATOM_PPLL1 0
  62. #define ATOM_PPLL2 1
  63. #define ATOM_DCPLL 2
  64. #define ATOM_PPLL0 2
  65. #define ATOM_PPLL3 3
  66. #define ATOM_PHY_PLL0 4
  67. #define ATOM_PHY_PLL1 5
  68. #define ATOM_EXT_PLL1 8
  69. #define ATOM_GCK_DFS 8
  70. #define ATOM_EXT_PLL2 9
  71. #define ATOM_FCH_CLK 9
  72. #define ATOM_EXT_CLOCK 10
  73. #define ATOM_DP_DTO 11
  74. #define ATOM_COMBOPHY_PLL0 20
  75. #define ATOM_COMBOPHY_PLL1 21
  76. #define ATOM_COMBOPHY_PLL2 22
  77. #define ATOM_COMBOPHY_PLL3 23
  78. #define ATOM_COMBOPHY_PLL4 24
  79. #define ATOM_COMBOPHY_PLL5 25
  80. #define ATOM_PPLL_INVALID 0xFF
  81. #define ENCODER_REFCLK_SRC_P1PLL 0
  82. #define ENCODER_REFCLK_SRC_P2PLL 1
  83. #define ENCODER_REFCLK_SRC_DCPLL 2
  84. #define ENCODER_REFCLK_SRC_EXTCLK 3
  85. #define ENCODER_REFCLK_SRC_INVALID 0xFF
  86. #define ATOM_SCALER_DISABLE 0 //For Fudo, it's bypass and auto-cengter & no replication
  87. #define ATOM_SCALER_CENTER 1 //For Fudo, it's bypass and auto-center & auto replication
  88. #define ATOM_SCALER_EXPANSION 2 //For Fudo, it's 2 Tap alpha blending mode
  89. #define ATOM_SCALER_MULTI_EX 3 //For Fudo only, it's multi-tap mode only used to drive TV or CV, only used by Bios
  90. #define ATOM_DISABLE 0
  91. #define ATOM_ENABLE 1
  92. #define ATOM_LCD_BLOFF (ATOM_DISABLE+2)
  93. #define ATOM_LCD_BLON (ATOM_ENABLE+2)
  94. #define ATOM_LCD_BL_BRIGHTNESS_CONTROL (ATOM_ENABLE+3)
  95. #define ATOM_LCD_SELFTEST_START (ATOM_DISABLE+5)
  96. #define ATOM_LCD_SELFTEST_STOP (ATOM_ENABLE+5)
  97. #define ATOM_ENCODER_INIT (ATOM_DISABLE+7)
  98. #define ATOM_INIT (ATOM_DISABLE+7)
  99. #define ATOM_GET_STATUS (ATOM_DISABLE+8)
  100. #define ATOM_BLANKING 1
  101. #define ATOM_BLANKING_OFF 0
  102. #define ATOM_CRT1 0
  103. #define ATOM_CRT2 1
  104. #define ATOM_TV_NTSC 1
  105. #define ATOM_TV_NTSCJ 2
  106. #define ATOM_TV_PAL 3
  107. #define ATOM_TV_PALM 4
  108. #define ATOM_TV_PALCN 5
  109. #define ATOM_TV_PALN 6
  110. #define ATOM_TV_PAL60 7
  111. #define ATOM_TV_SECAM 8
  112. #define ATOM_TV_CV 16
  113. #define ATOM_DAC1_PS2 1
  114. #define ATOM_DAC1_CV 2
  115. #define ATOM_DAC1_NTSC 3
  116. #define ATOM_DAC1_PAL 4
  117. #define ATOM_DAC2_PS2 ATOM_DAC1_PS2
  118. #define ATOM_DAC2_CV ATOM_DAC1_CV
  119. #define ATOM_DAC2_NTSC ATOM_DAC1_NTSC
  120. #define ATOM_DAC2_PAL ATOM_DAC1_PAL
  121. #define ATOM_PM_ON 0
  122. #define ATOM_PM_STANDBY 1
  123. #define ATOM_PM_SUSPEND 2
  124. #define ATOM_PM_OFF 3
  125. // For ATOM_LVDS_INFO_V12
  126. // Bit0:{=0:single, =1:dual},
  127. // Bit1 {=0:666RGB, =1:888RGB},
  128. // Bit2:3:{Grey level}
  129. // Bit4:{=0:LDI format for RGB888, =1 FPDI format for RGB888}
  130. #define ATOM_PANEL_MISC_DUAL 0x00000001
  131. #define ATOM_PANEL_MISC_888RGB 0x00000002
  132. #define ATOM_PANEL_MISC_GREY_LEVEL 0x0000000C
  133. #define ATOM_PANEL_MISC_FPDI 0x00000010
  134. #define ATOM_PANEL_MISC_GREY_LEVEL_SHIFT 2
  135. #define ATOM_PANEL_MISC_SPATIAL 0x00000020
  136. #define ATOM_PANEL_MISC_TEMPORAL 0x00000040
  137. #define ATOM_PANEL_MISC_API_ENABLED 0x00000080
  138. #define MEMTYPE_DDR1 "DDR1"
  139. #define MEMTYPE_DDR2 "DDR2"
  140. #define MEMTYPE_DDR3 "DDR3"
  141. #define MEMTYPE_DDR4 "DDR4"
  142. #define ASIC_BUS_TYPE_PCI "PCI"
  143. #define ASIC_BUS_TYPE_AGP "AGP"
  144. #define ASIC_BUS_TYPE_PCIE "PCI_EXPRESS"
  145. //Maximum size of that FireGL flag string
  146. #define ATOM_FIREGL_FLAG_STRING "FGL" //Flag used to enable FireGL Support
  147. #define ATOM_MAX_SIZE_OF_FIREGL_FLAG_STRING 3 //sizeof( ATOM_FIREGL_FLAG_STRING )
  148. #define ATOM_FAKE_DESKTOP_STRING "DSK" //Flag used to enable mobile ASIC on Desktop
  149. #define ATOM_MAX_SIZE_OF_FAKE_DESKTOP_STRING ATOM_MAX_SIZE_OF_FIREGL_FLAG_STRING
  150. #define ATOM_M54T_FLAG_STRING "M54T" //Flag used to enable M54T Support
  151. #define ATOM_MAX_SIZE_OF_M54T_FLAG_STRING 4 //sizeof( ATOM_M54T_FLAG_STRING )
  152. #define HW_ASSISTED_I2C_STATUS_FAILURE 2
  153. #define HW_ASSISTED_I2C_STATUS_SUCCESS 1
  154. #pragma pack(1) // BIOS data must use byte alignment
  155. // Define offset to location of ROM header.
  156. #define OFFSET_TO_POINTER_TO_ATOM_ROM_HEADER 0x00000048L
  157. #define OFFSET_TO_ATOM_ROM_IMAGE_SIZE 0x00000002L
  158. #define OFFSET_TO_ATOMBIOS_ASIC_BUS_MEM_TYPE 0x94
  159. #define MAXSIZE_OF_ATOMBIOS_ASIC_BUS_MEM_TYPE 20 //including the terminator 0x0!
  160. #define OFFSET_TO_GET_ATOMBIOS_STRINGS_NUMBER 0x002f
  161. #define OFFSET_TO_GET_ATOMBIOS_STRINGS_START 0x006e
  162. /****************************************************************************/
  163. // Common header for all tables (Data table, Command table).
  164. // Every table pointed _ATOM_MASTER_DATA_TABLE has this common header.
  165. // And the pointer actually points to this header.
  166. /****************************************************************************/
  167. typedef struct _ATOM_COMMON_TABLE_HEADER
  168. {
  169. USHORT usStructureSize;
  170. UCHAR ucTableFormatRevision; //Change it when the Parser is not backward compatible
  171. UCHAR ucTableContentRevision; //Change it only when the table needs to change but the firmware
  172. //Image can't be updated, while Driver needs to carry the new table!
  173. }ATOM_COMMON_TABLE_HEADER;
  174. /****************************************************************************/
  175. // Structure stores the ROM header.
  176. /****************************************************************************/
  177. typedef struct _ATOM_ROM_HEADER
  178. {
  179. ATOM_COMMON_TABLE_HEADER sHeader;
  180. UCHAR uaFirmWareSignature[4]; //Signature to distinguish between Atombios and non-atombios,
  181. //atombios should init it as "ATOM", don't change the position
  182. USHORT usBiosRuntimeSegmentAddress;
  183. USHORT usProtectedModeInfoOffset;
  184. USHORT usConfigFilenameOffset;
  185. USHORT usCRC_BlockOffset;
  186. USHORT usBIOS_BootupMessageOffset;
  187. USHORT usInt10Offset;
  188. USHORT usPciBusDevInitCode;
  189. USHORT usIoBaseAddress;
  190. USHORT usSubsystemVendorID;
  191. USHORT usSubsystemID;
  192. USHORT usPCI_InfoOffset;
  193. USHORT usMasterCommandTableOffset;//Offest for SW to get all command table offsets, Don't change the position
  194. USHORT usMasterDataTableOffset; //Offest for SW to get all data table offsets, Don't change the position
  195. UCHAR ucExtendedFunctionCode;
  196. UCHAR ucReserved;
  197. }ATOM_ROM_HEADER;
  198. typedef struct _ATOM_ROM_HEADER_V2_1
  199. {
  200. ATOM_COMMON_TABLE_HEADER sHeader;
  201. UCHAR uaFirmWareSignature[4]; //Signature to distinguish between Atombios and non-atombios,
  202. //atombios should init it as "ATOM", don't change the position
  203. USHORT usBiosRuntimeSegmentAddress;
  204. USHORT usProtectedModeInfoOffset;
  205. USHORT usConfigFilenameOffset;
  206. USHORT usCRC_BlockOffset;
  207. USHORT usBIOS_BootupMessageOffset;
  208. USHORT usInt10Offset;
  209. USHORT usPciBusDevInitCode;
  210. USHORT usIoBaseAddress;
  211. USHORT usSubsystemVendorID;
  212. USHORT usSubsystemID;
  213. USHORT usPCI_InfoOffset;
  214. USHORT usMasterCommandTableOffset;//Offest for SW to get all command table offsets, Don't change the position
  215. USHORT usMasterDataTableOffset; //Offest for SW to get all data table offsets, Don't change the position
  216. UCHAR ucExtendedFunctionCode;
  217. UCHAR ucReserved;
  218. ULONG ulPSPDirTableOffset;
  219. }ATOM_ROM_HEADER_V2_1;
  220. //==============================Command Table Portion====================================
  221. /****************************************************************************/
  222. // Structures used in Command.mtb
  223. /****************************************************************************/
  224. typedef struct _ATOM_MASTER_LIST_OF_COMMAND_TABLES{
  225. USHORT ASIC_Init; //Function Table, used by various SW components,latest version 1.1
  226. USHORT GetDisplaySurfaceSize; //Atomic Table, Used by Bios when enabling HW ICON
  227. USHORT ASIC_RegistersInit; //Atomic Table, indirectly used by various SW components,called from ASIC_Init
  228. USHORT VRAM_BlockVenderDetection; //Atomic Table, used only by Bios
  229. USHORT DIGxEncoderControl; //Only used by Bios
  230. USHORT MemoryControllerInit; //Atomic Table, indirectly used by various SW components,called from ASIC_Init
  231. USHORT EnableCRTCMemReq; //Function Table,directly used by various SW components,latest version 2.1
  232. USHORT MemoryParamAdjust; //Atomic Table, indirectly used by various SW components,called from SetMemoryClock if needed
  233. USHORT DVOEncoderControl; //Function Table,directly used by various SW components,latest version 1.2
  234. USHORT GPIOPinControl; //Atomic Table, only used by Bios
  235. USHORT SetEngineClock; //Function Table,directly used by various SW components,latest version 1.1
  236. USHORT SetMemoryClock; //Function Table,directly used by various SW components,latest version 1.1
  237. USHORT SetPixelClock; //Function Table,directly used by various SW components,latest version 1.2
  238. USHORT EnableDispPowerGating; //Atomic Table, indirectly used by various SW components,called from ASIC_Init
  239. USHORT ResetMemoryDLL; //Atomic Table, indirectly used by various SW components,called from SetMemoryClock
  240. USHORT ResetMemoryDevice; //Atomic Table, indirectly used by various SW components,called from SetMemoryClock
  241. USHORT MemoryPLLInit; //Atomic Table, used only by Bios
  242. USHORT AdjustDisplayPll; //Atomic Table, used by various SW componentes.
  243. USHORT AdjustMemoryController; //Atomic Table, indirectly used by various SW components,called from SetMemoryClock
  244. USHORT EnableASIC_StaticPwrMgt; //Atomic Table, only used by Bios
  245. USHORT SetUniphyInstance; //Atomic Table, only used by Bios
  246. USHORT DAC_LoadDetection; //Atomic Table, directly used by various SW components,latest version 1.2
  247. USHORT LVTMAEncoderControl; //Atomic Table,directly used by various SW components,latest version 1.3
  248. USHORT HW_Misc_Operation; //Atomic Table, directly used by various SW components,latest version 1.1
  249. USHORT DAC1EncoderControl; //Atomic Table, directly used by various SW components,latest version 1.1
  250. USHORT DAC2EncoderControl; //Atomic Table, directly used by various SW components,latest version 1.1
  251. USHORT DVOOutputControl; //Atomic Table, directly used by various SW components,latest version 1.1
  252. USHORT CV1OutputControl; //Atomic Table, Atomic Table, Obsolete from Ry6xx, use DAC2 Output instead
  253. USHORT GetConditionalGoldenSetting; //Only used by Bios
  254. USHORT SMC_Init; //Function Table,directly used by various SW components,latest version 1.1
  255. USHORT PatchMCSetting; //only used by BIOS
  256. USHORT MC_SEQ_Control; //only used by BIOS
  257. USHORT Gfx_Harvesting; //Atomic Table, Obsolete from Ry6xx, Now only used by BIOS for GFX harvesting
  258. USHORT EnableScaler; //Atomic Table, used only by Bios
  259. USHORT BlankCRTC; //Atomic Table, directly used by various SW components,latest version 1.1
  260. USHORT EnableCRTC; //Atomic Table, directly used by various SW components,latest version 1.1
  261. USHORT GetPixelClock; //Atomic Table, directly used by various SW components,latest version 1.1
  262. USHORT EnableVGA_Render; //Function Table,directly used by various SW components,latest version 1.1
  263. USHORT GetSCLKOverMCLKRatio; //Atomic Table, only used by Bios
  264. USHORT SetCRTC_Timing; //Atomic Table, directly used by various SW components,latest version 1.1
  265. USHORT SetCRTC_OverScan; //Atomic Table, used by various SW components,latest version 1.1
  266. USHORT GetSMUClockInfo; //Atomic Table, used only by Bios
  267. USHORT SelectCRTC_Source; //Atomic Table, directly used by various SW components,latest version 1.1
  268. USHORT EnableGraphSurfaces; //Atomic Table, used only by Bios
  269. USHORT UpdateCRTC_DoubleBufferRegisters; //Atomic Table, used only by Bios
  270. USHORT LUT_AutoFill; //Atomic Table, only used by Bios
  271. USHORT SetDCEClock; //Atomic Table, start from DCE11.1, shared by driver and VBIOS, change DISPCLK and DPREFCLK
  272. USHORT GetMemoryClock; //Atomic Table, directly used by various SW components,latest version 1.1
  273. USHORT GetEngineClock; //Atomic Table, directly used by various SW components,latest version 1.1
  274. USHORT SetCRTC_UsingDTDTiming; //Atomic Table, directly used by various SW components,latest version 1.1
  275. USHORT ExternalEncoderControl; //Atomic Table, directly used by various SW components,latest version 2.1
  276. USHORT LVTMAOutputControl; //Atomic Table, directly used by various SW components,latest version 1.1
  277. USHORT VRAM_BlockDetectionByStrap; //Atomic Table, used only by Bios
  278. USHORT MemoryCleanUp; //Atomic Table, only used by Bios
  279. USHORT ProcessI2cChannelTransaction; //Function Table,only used by Bios
  280. USHORT WriteOneByteToHWAssistedI2C; //Function Table,indirectly used by various SW components
  281. USHORT ReadHWAssistedI2CStatus; //Atomic Table, indirectly used by various SW components
  282. USHORT SpeedFanControl; //Function Table,indirectly used by various SW components,called from ASIC_Init
  283. USHORT PowerConnectorDetection; //Atomic Table, directly used by various SW components,latest version 1.1
  284. USHORT MC_Synchronization; //Atomic Table, indirectly used by various SW components,called from SetMemoryClock
  285. USHORT ComputeMemoryEnginePLL; //Atomic Table, indirectly used by various SW components,called from SetMemory/EngineClock
  286. USHORT Gfx_Init; //Atomic Table, indirectly used by various SW components,called from SetMemory or SetEngineClock
  287. USHORT VRAM_GetCurrentInfoBlock; //Atomic Table, used only by Bios
  288. USHORT DynamicMemorySettings; //Atomic Table, indirectly used by various SW components,called from SetMemoryClock
  289. USHORT MemoryTraining; //Atomic Table, used only by Bios
  290. USHORT EnableSpreadSpectrumOnPPLL; //Atomic Table, directly used by various SW components,latest version 1.2
  291. USHORT TMDSAOutputControl; //Atomic Table, directly used by various SW components,latest version 1.1
  292. USHORT SetVoltage; //Function Table,directly and/or indirectly used by various SW components,latest version 1.1
  293. USHORT DAC1OutputControl; //Atomic Table, directly used by various SW components,latest version 1.1
  294. USHORT ReadEfuseValue; //Atomic Table, directly used by various SW components,latest version 1.1
  295. USHORT ComputeMemoryClockParam; //Function Table,only used by Bios, obsolete soon.Switch to use "ReadEDIDFromHWAssistedI2C"
  296. USHORT ClockSource; //Atomic Table, indirectly used by various SW components,called from ASIC_Init
  297. USHORT MemoryDeviceInit; //Atomic Table, indirectly used by various SW components,called from SetMemoryClock
  298. USHORT GetDispObjectInfo; //Atomic Table, indirectly used by various SW components,called from EnableVGARender
  299. USHORT DIG1EncoderControl; //Atomic Table,directly used by various SW components,latest version 1.1
  300. USHORT DIG2EncoderControl; //Atomic Table,directly used by various SW components,latest version 1.1
  301. USHORT DIG1TransmitterControl; //Atomic Table,directly used by various SW components,latest version 1.1
  302. USHORT DIG2TransmitterControl; //Atomic Table,directly used by various SW components,latest version 1.1
  303. USHORT ProcessAuxChannelTransaction; //Function Table,only used by Bios
  304. USHORT DPEncoderService; //Function Table,only used by Bios
  305. USHORT GetVoltageInfo; //Function Table,only used by Bios since SI
  306. }ATOM_MASTER_LIST_OF_COMMAND_TABLES;
  307. // For backward compatible
  308. #define ReadEDIDFromHWAssistedI2C ProcessI2cChannelTransaction
  309. #define DPTranslatorControl DIG2EncoderControl
  310. #define UNIPHYTransmitterControl DIG1TransmitterControl
  311. #define LVTMATransmitterControl DIG2TransmitterControl
  312. #define SetCRTC_DPM_State GetConditionalGoldenSetting
  313. #define ASIC_StaticPwrMgtStatusChange SetUniphyInstance
  314. #define HPDInterruptService ReadHWAssistedI2CStatus
  315. #define EnableVGA_Access GetSCLKOverMCLKRatio
  316. #define EnableYUV GetDispObjectInfo
  317. #define DynamicClockGating EnableDispPowerGating
  318. #define SetupHWAssistedI2CStatus ComputeMemoryClockParam
  319. #define DAC2OutputControl ReadEfuseValue
  320. #define TMDSAEncoderControl PatchMCSetting
  321. #define LVDSEncoderControl MC_SEQ_Control
  322. #define LCD1OutputControl HW_Misc_Operation
  323. #define TV1OutputControl Gfx_Harvesting
  324. #define TVEncoderControl SMC_Init
  325. #define EnableHW_IconCursor SetDCEClock
  326. #define SetCRTC_Replication GetSMUClockInfo
  327. #define MemoryRefreshConversion Gfx_Init
  328. typedef struct _ATOM_MASTER_COMMAND_TABLE
  329. {
  330. ATOM_COMMON_TABLE_HEADER sHeader;
  331. ATOM_MASTER_LIST_OF_COMMAND_TABLES ListOfCommandTables;
  332. }ATOM_MASTER_COMMAND_TABLE;
  333. /****************************************************************************/
  334. // Structures used in every command table
  335. /****************************************************************************/
  336. typedef struct _ATOM_TABLE_ATTRIBUTE
  337. {
  338. #if ATOM_BIG_ENDIAN
  339. USHORT UpdatedByUtility:1; //[15]=Table updated by utility flag
  340. USHORT PS_SizeInBytes:7; //[14:8]=Size of parameter space in Bytes (multiple of a dword),
  341. USHORT WS_SizeInBytes:8; //[7:0]=Size of workspace in Bytes (in multiple of a dword),
  342. #else
  343. USHORT WS_SizeInBytes:8; //[7:0]=Size of workspace in Bytes (in multiple of a dword),
  344. USHORT PS_SizeInBytes:7; //[14:8]=Size of parameter space in Bytes (multiple of a dword),
  345. USHORT UpdatedByUtility:1; //[15]=Table updated by utility flag
  346. #endif
  347. }ATOM_TABLE_ATTRIBUTE;
  348. /****************************************************************************/
  349. // Common header for all command tables.
  350. // Every table pointed by _ATOM_MASTER_COMMAND_TABLE has this common header.
  351. // And the pointer actually points to this header.
  352. /****************************************************************************/
  353. typedef struct _ATOM_COMMON_ROM_COMMAND_TABLE_HEADER
  354. {
  355. ATOM_COMMON_TABLE_HEADER CommonHeader;
  356. ATOM_TABLE_ATTRIBUTE TableAttribute;
  357. }ATOM_COMMON_ROM_COMMAND_TABLE_HEADER;
  358. /****************************************************************************/
  359. // Structures used by ComputeMemoryEnginePLLTable
  360. /****************************************************************************/
  361. #define COMPUTE_MEMORY_PLL_PARAM 1
  362. #define COMPUTE_ENGINE_PLL_PARAM 2
  363. #define ADJUST_MC_SETTING_PARAM 3
  364. /****************************************************************************/
  365. // Structures used by AdjustMemoryControllerTable
  366. /****************************************************************************/
  367. typedef struct _ATOM_ADJUST_MEMORY_CLOCK_FREQ
  368. {
  369. #if ATOM_BIG_ENDIAN
  370. ULONG ulPointerReturnFlag:1; // BYTE_3[7]=1 - Return the pointer to the right Data Block; BYTE_3[7]=0 - Program the right Data Block
  371. ULONG ulMemoryModuleNumber:7; // BYTE_3[6:0]
  372. ULONG ulClockFreq:24;
  373. #else
  374. ULONG ulClockFreq:24;
  375. ULONG ulMemoryModuleNumber:7; // BYTE_3[6:0]
  376. ULONG ulPointerReturnFlag:1; // BYTE_3[7]=1 - Return the pointer to the right Data Block; BYTE_3[7]=0 - Program the right Data Block
  377. #endif
  378. }ATOM_ADJUST_MEMORY_CLOCK_FREQ;
  379. #define POINTER_RETURN_FLAG 0x80
  380. typedef struct _COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS
  381. {
  382. ULONG ulClock; //When returen, it's the re-calculated clock based on given Fb_div Post_Div and ref_div
  383. UCHAR ucAction; //0:reserved //1:Memory //2:Engine
  384. UCHAR ucReserved; //may expand to return larger Fbdiv later
  385. UCHAR ucFbDiv; //return value
  386. UCHAR ucPostDiv; //return value
  387. }COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS;
  388. typedef struct _COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V2
  389. {
  390. ULONG ulClock; //When return, [23:0] return real clock
  391. UCHAR ucAction; //0:reserved;COMPUTE_MEMORY_PLL_PARAM:Memory;COMPUTE_ENGINE_PLL_PARAM:Engine. it return ref_div to be written to register
  392. USHORT usFbDiv; //return Feedback value to be written to register
  393. UCHAR ucPostDiv; //return post div to be written to register
  394. }COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V2;
  395. #define COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_PS_ALLOCATION COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS
  396. #define SET_CLOCK_FREQ_MASK 0x00FFFFFF //Clock change tables only take bit [23:0] as the requested clock value
  397. #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)
  398. #define USE_MEMORY_SELF_REFRESH_MASK 0x02000000 //Only applicable to memory clock change, when set, using memory self refresh during clock transition
  399. #define SKIP_INTERNAL_MEMORY_PARAMETER_CHANGE 0x04000000 //Only applicable to memory clock change, when set, the table will skip predefined internal memory parameter change
  400. #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
  401. #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
  402. #define USE_SS_ENABLED_PIXEL_CLOCK USE_NON_BUS_CLOCK_MASK
  403. #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)
  404. #define b3USE_MEMORY_SELF_REFRESH 0x02 //Only applicable to memory clock change, when set, using memory self refresh during clock transition
  405. #define b3SKIP_INTERNAL_MEMORY_PARAMETER_CHANGE 0x04 //Only applicable to memory clock change, when set, the table will skip predefined internal memory parameter change
  406. #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
  407. #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
  408. #define b3DRAM_SELF_REFRESH_EXIT 0x20 //Applicable to DRAM self refresh exit only. when set, it means it will go to program DRAM self refresh exit path
  409. #define b3SRIOV_INIT_BOOT 0x40 //Use by HV GPU driver only, to load uCode. for ASIC_InitTable SCLK parameter only
  410. #define b3SRIOV_LOAD_UCODE 0x40 //Use by HV GPU driver only, to load uCode. for ASIC_InitTable SCLK parameter only
  411. #define b3SRIOV_SKIP_ASIC_INIT 0x02 //Use by HV GPU driver only, skip ASIC_Init for primary adapter boot. for ASIC_InitTable SCLK parameter only
  412. typedef struct _ATOM_COMPUTE_CLOCK_FREQ
  413. {
  414. #if ATOM_BIG_ENDIAN
  415. ULONG ulComputeClockFlag:8; // =1: COMPUTE_MEMORY_PLL_PARAM, =2: COMPUTE_ENGINE_PLL_PARAM
  416. ULONG ulClockFreq:24; // in unit of 10kHz
  417. #else
  418. ULONG ulClockFreq:24; // in unit of 10kHz
  419. ULONG ulComputeClockFlag:8; // =1: COMPUTE_MEMORY_PLL_PARAM, =2: COMPUTE_ENGINE_PLL_PARAM
  420. #endif
  421. }ATOM_COMPUTE_CLOCK_FREQ;
  422. typedef struct _ATOM_S_MPLL_FB_DIVIDER
  423. {
  424. USHORT usFbDivFrac;
  425. USHORT usFbDiv;
  426. }ATOM_S_MPLL_FB_DIVIDER;
  427. typedef struct _COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V3
  428. {
  429. union
  430. {
  431. ATOM_COMPUTE_CLOCK_FREQ ulClock; //Input Parameter
  432. ULONG ulClockParams; //ULONG access for BE
  433. ATOM_S_MPLL_FB_DIVIDER ulFbDiv; //Output Parameter
  434. };
  435. UCHAR ucRefDiv; //Output Parameter
  436. UCHAR ucPostDiv; //Output Parameter
  437. UCHAR ucCntlFlag; //Output Parameter
  438. UCHAR ucReserved;
  439. }COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V3;
  440. // ucCntlFlag
  441. #define ATOM_PLL_CNTL_FLAG_PLL_POST_DIV_EN 1
  442. #define ATOM_PLL_CNTL_FLAG_MPLL_VCO_MODE 2
  443. #define ATOM_PLL_CNTL_FLAG_FRACTION_DISABLE 4
  444. #define ATOM_PLL_CNTL_FLAG_SPLL_ISPARE_9 8
  445. // V4 are only used for APU which PLL outside GPU
  446. typedef struct _COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V4
  447. {
  448. #if ATOM_BIG_ENDIAN
  449. ULONG ucPostDiv:8; //return parameter: post divider which is used to program to register directly
  450. ULONG ulClock:24; //Input= target clock, output = actual clock
  451. #else
  452. ULONG ulClock:24; //Input= target clock, output = actual clock
  453. ULONG ucPostDiv:8; //return parameter: post divider which is used to program to register directly
  454. #endif
  455. }COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V4;
  456. typedef struct _COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V5
  457. {
  458. union
  459. {
  460. ATOM_COMPUTE_CLOCK_FREQ ulClock; //Input Parameter
  461. ULONG ulClockParams; //ULONG access for BE
  462. ATOM_S_MPLL_FB_DIVIDER ulFbDiv; //Output Parameter
  463. };
  464. UCHAR ucRefDiv; //Output Parameter
  465. UCHAR ucPostDiv; //Output Parameter
  466. union
  467. {
  468. UCHAR ucCntlFlag; //Output Flags
  469. UCHAR ucInputFlag; //Input Flags. ucInputFlag[0] - Strobe(1)/Performance(0) mode
  470. };
  471. UCHAR ucReserved;
  472. }COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V5;
  473. typedef struct _COMPUTE_GPU_CLOCK_INPUT_PARAMETERS_V1_6
  474. {
  475. ATOM_COMPUTE_CLOCK_FREQ ulClock; //Input Parameter
  476. ULONG ulReserved[2];
  477. }COMPUTE_GPU_CLOCK_INPUT_PARAMETERS_V1_6;
  478. //ATOM_COMPUTE_CLOCK_FREQ.ulComputeClockFlag
  479. #define COMPUTE_GPUCLK_INPUT_FLAG_CLK_TYPE_MASK 0x0f
  480. #define COMPUTE_GPUCLK_INPUT_FLAG_DEFAULT_GPUCLK 0x00
  481. #define COMPUTE_GPUCLK_INPUT_FLAG_SCLK 0x01
  482. typedef struct _COMPUTE_GPU_CLOCK_OUTPUT_PARAMETERS_V1_6
  483. {
  484. COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V4 ulClock; //Output Parameter: ucPostDiv=DFS divider
  485. ATOM_S_MPLL_FB_DIVIDER ulFbDiv; //Output Parameter: PLL FB divider
  486. UCHAR ucPllRefDiv; //Output Parameter: PLL ref divider
  487. UCHAR ucPllPostDiv; //Output Parameter: PLL post divider
  488. UCHAR ucPllCntlFlag; //Output Flags: control flag
  489. UCHAR ucReserved;
  490. }COMPUTE_GPU_CLOCK_OUTPUT_PARAMETERS_V1_6;
  491. //ucPllCntlFlag
  492. #define SPLL_CNTL_FLAG_VCO_MODE_MASK 0x03
  493. typedef struct _COMPUTE_GPU_CLOCK_INPUT_PARAMETERS_V1_7
  494. {
  495. ATOM_COMPUTE_CLOCK_FREQ ulClock; //Input Parameter
  496. ULONG ulReserved[5];
  497. }COMPUTE_GPU_CLOCK_INPUT_PARAMETERS_V1_7;
  498. //ATOM_COMPUTE_CLOCK_FREQ.ulComputeClockFlag
  499. #define COMPUTE_GPUCLK_INPUT_FLAG_CLK_TYPE_MASK 0x0f
  500. #define COMPUTE_GPUCLK_INPUT_FLAG_DEFAULT_GPUCLK 0x00
  501. #define COMPUTE_GPUCLK_INPUT_FLAG_SCLK 0x01
  502. typedef struct _COMPUTE_GPU_CLOCK_OUTPUT_PARAMETERS_V1_7
  503. {
  504. COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V4 ulClock; //Output Parameter: ucPostDiv=DFS divider
  505. USHORT usSclk_fcw_frac; //fractional divider of fcw = usSclk_fcw_frac/65536
  506. USHORT usSclk_fcw_int; //integer divider of fcwc
  507. UCHAR ucSclkPostDiv; //PLL post divider = 2^ucSclkPostDiv
  508. UCHAR ucSclkVcoMode; //0: 4G~8Ghz, 1:3G~6Ghz,3: 2G~4Ghz, 2:Reserved
  509. UCHAR ucSclkPllRange; //GreenTable SCLK PLL range entry index ( 0~7 )
  510. UCHAR ucSscEnable;
  511. USHORT usSsc_fcw1_frac; //fcw1_frac when SSC enable
  512. USHORT usSsc_fcw1_int; //fcw1_int when SSC enable
  513. USHORT usReserved;
  514. USHORT usPcc_fcw_int;
  515. USHORT usSsc_fcw_slew_frac; //fcw_slew_frac when SSC enable
  516. USHORT usPcc_fcw_slew_frac;
  517. }COMPUTE_GPU_CLOCK_OUTPUT_PARAMETERS_V1_7;
  518. // ucInputFlag
  519. #define ATOM_PLL_INPUT_FLAG_PLL_STROBE_MODE_EN 1 // 1-StrobeMode, 0-PerformanceMode
  520. // use for ComputeMemoryClockParamTable
  521. typedef struct _COMPUTE_MEMORY_CLOCK_PARAM_PARAMETERS_V2_1
  522. {
  523. union
  524. {
  525. ULONG ulClock;
  526. ATOM_S_MPLL_FB_DIVIDER ulFbDiv; //Output:UPPER_WORD=FB_DIV_INTEGER, LOWER_WORD=FB_DIV_FRAC shl (16-FB_FRACTION_BITS)
  527. };
  528. UCHAR ucDllSpeed; //Output
  529. UCHAR ucPostDiv; //Output
  530. union{
  531. UCHAR ucInputFlag; //Input : ATOM_PLL_INPUT_FLAG_PLL_STROBE_MODE_EN: 1-StrobeMode, 0-PerformanceMode
  532. UCHAR ucPllCntlFlag; //Output:
  533. };
  534. UCHAR ucBWCntl;
  535. }COMPUTE_MEMORY_CLOCK_PARAM_PARAMETERS_V2_1;
  536. // definition of ucInputFlag
  537. #define MPLL_INPUT_FLAG_STROBE_MODE_EN 0x01
  538. // definition of ucPllCntlFlag
  539. #define MPLL_CNTL_FLAG_VCO_MODE_MASK 0x03
  540. #define MPLL_CNTL_FLAG_BYPASS_DQ_PLL 0x04
  541. #define MPLL_CNTL_FLAG_QDR_ENABLE 0x08
  542. #define MPLL_CNTL_FLAG_AD_HALF_RATE 0x10
  543. //MPLL_CNTL_FLAG_BYPASS_AD_PLL has a wrong name, should be BYPASS_DQ_PLL
  544. #define MPLL_CNTL_FLAG_BYPASS_AD_PLL 0x04
  545. // use for ComputeMemoryClockParamTable
  546. typedef struct _COMPUTE_MEMORY_CLOCK_PARAM_PARAMETERS_V2_2
  547. {
  548. COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V4 ulClock;
  549. ULONG ulReserved;
  550. }COMPUTE_MEMORY_CLOCK_PARAM_PARAMETERS_V2_2;
  551. //Input parameter of DynamicMemorySettingsTable
  552. //when ATOM_COMPUTE_CLOCK_FREQ.ulComputeClockFlag = COMPUTE_MEMORY_PLL_PARAM
  553. typedef struct _DYNAMICE_MEMORY_SETTINGS_PARAMETER
  554. {
  555. ATOM_COMPUTE_CLOCK_FREQ ulClock;
  556. ULONG ulReserved[2];
  557. }DYNAMICE_MEMORY_SETTINGS_PARAMETER;
  558. //Input parameter of DynamicMemorySettingsTable
  559. //when ATOM_COMPUTE_CLOCK_FREQ.ulComputeClockFlag == COMPUTE_ENGINE_PLL_PARAM
  560. typedef struct _DYNAMICE_ENGINE_SETTINGS_PARAMETER
  561. {
  562. ATOM_COMPUTE_CLOCK_FREQ ulClock;
  563. ULONG ulMemoryClock;
  564. ULONG ulReserved;
  565. }DYNAMICE_ENGINE_SETTINGS_PARAMETER;
  566. //Input parameter of DynamicMemorySettingsTable ver2.1 and above
  567. //when ATOM_COMPUTE_CLOCK_FREQ.ulComputeClockFlag == ADJUST_MC_SETTING_PARAM
  568. typedef struct _DYNAMICE_MC_DPM_SETTINGS_PARAMETER
  569. {
  570. ATOM_COMPUTE_CLOCK_FREQ ulClock;
  571. UCHAR ucMclkDPMState;
  572. UCHAR ucReserved[3];
  573. ULONG ulReserved;
  574. }DYNAMICE_MC_DPM_SETTINGS_PARAMETER;
  575. //ucMclkDPMState
  576. #define DYNAMIC_MC_DPM_SETTING_LOW_DPM_STATE 0
  577. #define DYNAMIC_MC_DPM_SETTING_MEDIUM_DPM_STATE 1
  578. #define DYNAMIC_MC_DPM_SETTING_HIGH_DPM_STATE 2
  579. typedef union _DYNAMICE_MEMORY_SETTINGS_PARAMETER_V2_1
  580. {
  581. DYNAMICE_MEMORY_SETTINGS_PARAMETER asMCReg;
  582. DYNAMICE_ENGINE_SETTINGS_PARAMETER asMCArbReg;
  583. DYNAMICE_MC_DPM_SETTINGS_PARAMETER asDPMMCReg;
  584. }DYNAMICE_MEMORY_SETTINGS_PARAMETER_V2_1;
  585. /****************************************************************************/
  586. // Structures used by SetEngineClockTable
  587. /****************************************************************************/
  588. typedef struct _SET_ENGINE_CLOCK_PARAMETERS
  589. {
  590. ULONG ulTargetEngineClock; //In 10Khz unit
  591. }SET_ENGINE_CLOCK_PARAMETERS;
  592. typedef struct _SET_ENGINE_CLOCK_PS_ALLOCATION
  593. {
  594. ULONG ulTargetEngineClock; //In 10Khz unit
  595. COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_PS_ALLOCATION sReserved;
  596. }SET_ENGINE_CLOCK_PS_ALLOCATION;
  597. typedef struct _SET_ENGINE_CLOCK_PS_ALLOCATION_V1_2
  598. {
  599. ULONG ulTargetEngineClock; //In 10Khz unit
  600. COMPUTE_GPU_CLOCK_INPUT_PARAMETERS_V1_7 sReserved;
  601. }SET_ENGINE_CLOCK_PS_ALLOCATION_V1_2;
  602. /****************************************************************************/
  603. // Structures used by SetMemoryClockTable
  604. /****************************************************************************/
  605. typedef struct _SET_MEMORY_CLOCK_PARAMETERS
  606. {
  607. ULONG ulTargetMemoryClock; //In 10Khz unit
  608. }SET_MEMORY_CLOCK_PARAMETERS;
  609. typedef struct _SET_MEMORY_CLOCK_PS_ALLOCATION
  610. {
  611. ULONG ulTargetMemoryClock; //In 10Khz unit
  612. COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_PS_ALLOCATION sReserved;
  613. }SET_MEMORY_CLOCK_PS_ALLOCATION;
  614. /****************************************************************************/
  615. // Structures used by ASIC_Init.ctb
  616. /****************************************************************************/
  617. typedef struct _ASIC_INIT_PARAMETERS
  618. {
  619. ULONG ulDefaultEngineClock; //In 10Khz unit
  620. ULONG ulDefaultMemoryClock; //In 10Khz unit
  621. }ASIC_INIT_PARAMETERS;
  622. typedef struct _ASIC_INIT_PS_ALLOCATION
  623. {
  624. ASIC_INIT_PARAMETERS sASICInitClocks;
  625. SET_ENGINE_CLOCK_PS_ALLOCATION sReserved; //Caller doesn't need to init this structure
  626. }ASIC_INIT_PS_ALLOCATION;
  627. typedef struct _ASIC_INIT_CLOCK_PARAMETERS
  628. {
  629. ULONG ulClkFreqIn10Khz:24;
  630. ULONG ucClkFlag:8;
  631. }ASIC_INIT_CLOCK_PARAMETERS;
  632. typedef struct _ASIC_INIT_PARAMETERS_V1_2
  633. {
  634. ASIC_INIT_CLOCK_PARAMETERS asSclkClock; //In 10Khz unit
  635. ASIC_INIT_CLOCK_PARAMETERS asMemClock; //In 10Khz unit
  636. }ASIC_INIT_PARAMETERS_V1_2;
  637. typedef struct _ASIC_INIT_PS_ALLOCATION_V1_2
  638. {
  639. ASIC_INIT_PARAMETERS_V1_2 sASICInitClocks;
  640. ULONG ulReserved[8];
  641. }ASIC_INIT_PS_ALLOCATION_V1_2;
  642. /****************************************************************************/
  643. // Structure used by DynamicClockGatingTable.ctb
  644. /****************************************************************************/
  645. typedef struct _DYNAMIC_CLOCK_GATING_PARAMETERS
  646. {
  647. UCHAR ucEnable; // ATOM_ENABLE or ATOM_DISABLE
  648. UCHAR ucPadding[3];
  649. }DYNAMIC_CLOCK_GATING_PARAMETERS;
  650. #define DYNAMIC_CLOCK_GATING_PS_ALLOCATION DYNAMIC_CLOCK_GATING_PARAMETERS
  651. /****************************************************************************/
  652. // Structure used by EnableDispPowerGatingTable.ctb
  653. /****************************************************************************/
  654. typedef struct _ENABLE_DISP_POWER_GATING_PARAMETERS_V2_1
  655. {
  656. UCHAR ucDispPipeId; // ATOM_CRTC1, ATOM_CRTC2, ...
  657. UCHAR ucEnable; // ATOM_ENABLE or ATOM_DISABLE
  658. UCHAR ucPadding[2];
  659. }ENABLE_DISP_POWER_GATING_PARAMETERS_V2_1;
  660. typedef struct _ENABLE_DISP_POWER_GATING_PS_ALLOCATION
  661. {
  662. UCHAR ucDispPipeId; // ATOM_CRTC1, ATOM_CRTC2, ...
  663. UCHAR ucEnable; // ATOM_ENABLE/ATOM_DISABLE/ATOM_INIT
  664. UCHAR ucPadding[2];
  665. ULONG ulReserved[4];
  666. }ENABLE_DISP_POWER_GATING_PS_ALLOCATION;
  667. /****************************************************************************/
  668. // Structure used by EnableASIC_StaticPwrMgtTable.ctb
  669. /****************************************************************************/
  670. typedef struct _ENABLE_ASIC_STATIC_PWR_MGT_PARAMETERS
  671. {
  672. UCHAR ucEnable; // ATOM_ENABLE or ATOM_DISABLE
  673. UCHAR ucPadding[3];
  674. }ENABLE_ASIC_STATIC_PWR_MGT_PARAMETERS;
  675. #define ENABLE_ASIC_STATIC_PWR_MGT_PS_ALLOCATION ENABLE_ASIC_STATIC_PWR_MGT_PARAMETERS
  676. /****************************************************************************/
  677. // Structures used by DAC_LoadDetectionTable.ctb
  678. /****************************************************************************/
  679. typedef struct _DAC_LOAD_DETECTION_PARAMETERS
  680. {
  681. USHORT usDeviceID; //{ATOM_DEVICE_CRTx_SUPPORT,ATOM_DEVICE_TVx_SUPPORT,ATOM_DEVICE_CVx_SUPPORT}
  682. UCHAR ucDacType; //{ATOM_DAC_A,ATOM_DAC_B, ATOM_EXT_DAC}
  683. UCHAR ucMisc; //Valid only when table revision =1.3 and above
  684. }DAC_LOAD_DETECTION_PARAMETERS;
  685. // DAC_LOAD_DETECTION_PARAMETERS.ucMisc
  686. #define DAC_LOAD_MISC_YPrPb 0x01
  687. typedef struct _DAC_LOAD_DETECTION_PS_ALLOCATION
  688. {
  689. DAC_LOAD_DETECTION_PARAMETERS sDacload;
  690. ULONG Reserved[2];// Don't set this one, allocation for EXT DAC
  691. }DAC_LOAD_DETECTION_PS_ALLOCATION;
  692. /****************************************************************************/
  693. // Structures used by DAC1EncoderControlTable.ctb and DAC2EncoderControlTable.ctb
  694. /****************************************************************************/
  695. typedef struct _DAC_ENCODER_CONTROL_PARAMETERS
  696. {
  697. USHORT usPixelClock; // in 10KHz; for bios convenient
  698. UCHAR ucDacStandard; // See definition of ATOM_DACx_xxx, For DEC3.0, bit 7 used as internal flag to indicate DAC2 (==1) or DAC1 (==0)
  699. UCHAR ucAction; // 0: turn off encoder
  700. // 1: setup and turn on encoder
  701. // 7: ATOM_ENCODER_INIT Initialize DAC
  702. }DAC_ENCODER_CONTROL_PARAMETERS;
  703. #define DAC_ENCODER_CONTROL_PS_ALLOCATION DAC_ENCODER_CONTROL_PARAMETERS
  704. /****************************************************************************/
  705. // Structures used by DIG1EncoderControlTable
  706. // DIG2EncoderControlTable
  707. // ExternalEncoderControlTable
  708. /****************************************************************************/
  709. typedef struct _DIG_ENCODER_CONTROL_PARAMETERS
  710. {
  711. USHORT usPixelClock; // in 10KHz; for bios convenient
  712. UCHAR ucConfig;
  713. // [2] Link Select:
  714. // =0: PHY linkA if bfLane<3
  715. // =1: PHY linkB if bfLanes<3
  716. // =0: PHY linkA+B if bfLanes=3
  717. // [3] Transmitter Sel
  718. // =0: UNIPHY or PCIEPHY
  719. // =1: LVTMA
  720. UCHAR ucAction; // =0: turn off encoder
  721. // =1: turn on encoder
  722. UCHAR ucEncoderMode;
  723. // =0: DP encoder
  724. // =1: LVDS encoder
  725. // =2: DVI encoder
  726. // =3: HDMI encoder
  727. // =4: SDVO encoder
  728. UCHAR ucLaneNum; // how many lanes to enable
  729. UCHAR ucReserved[2];
  730. }DIG_ENCODER_CONTROL_PARAMETERS;
  731. #define DIG_ENCODER_CONTROL_PS_ALLOCATION DIG_ENCODER_CONTROL_PARAMETERS
  732. #define EXTERNAL_ENCODER_CONTROL_PARAMETER DIG_ENCODER_CONTROL_PARAMETERS
  733. //ucConfig
  734. #define ATOM_ENCODER_CONFIG_DPLINKRATE_MASK 0x01
  735. #define ATOM_ENCODER_CONFIG_DPLINKRATE_1_62GHZ 0x00
  736. #define ATOM_ENCODER_CONFIG_DPLINKRATE_2_70GHZ 0x01
  737. #define ATOM_ENCODER_CONFIG_DPLINKRATE_5_40GHZ 0x02
  738. #define ATOM_ENCODER_CONFIG_LINK_SEL_MASK 0x04
  739. #define ATOM_ENCODER_CONFIG_LINKA 0x00
  740. #define ATOM_ENCODER_CONFIG_LINKB 0x04
  741. #define ATOM_ENCODER_CONFIG_LINKA_B ATOM_TRANSMITTER_CONFIG_LINKA
  742. #define ATOM_ENCODER_CONFIG_LINKB_A ATOM_ENCODER_CONFIG_LINKB
  743. #define ATOM_ENCODER_CONFIG_TRANSMITTER_SEL_MASK 0x08
  744. #define ATOM_ENCODER_CONFIG_UNIPHY 0x00
  745. #define ATOM_ENCODER_CONFIG_LVTMA 0x08
  746. #define ATOM_ENCODER_CONFIG_TRANSMITTER1 0x00
  747. #define ATOM_ENCODER_CONFIG_TRANSMITTER2 0x08
  748. #define ATOM_ENCODER_CONFIG_DIGB 0x80 // VBIOS Internal use, outside SW should set this bit=0
  749. // ucAction
  750. // ATOM_ENABLE: Enable Encoder
  751. // ATOM_DISABLE: Disable Encoder
  752. //ucEncoderMode
  753. #define ATOM_ENCODER_MODE_DP 0
  754. #define ATOM_ENCODER_MODE_LVDS 1
  755. #define ATOM_ENCODER_MODE_DVI 2
  756. #define ATOM_ENCODER_MODE_HDMI 3
  757. #define ATOM_ENCODER_MODE_SDVO 4
  758. #define ATOM_ENCODER_MODE_DP_AUDIO 5
  759. #define ATOM_ENCODER_MODE_TV 13
  760. #define ATOM_ENCODER_MODE_CV 14
  761. #define ATOM_ENCODER_MODE_CRT 15
  762. #define ATOM_ENCODER_MODE_DVO 16
  763. #define ATOM_ENCODER_MODE_DP_SST ATOM_ENCODER_MODE_DP // For DP1.2
  764. #define ATOM_ENCODER_MODE_DP_MST 5 // For DP1.2
  765. typedef struct _ATOM_DIG_ENCODER_CONFIG_V2
  766. {
  767. #if ATOM_BIG_ENDIAN
  768. UCHAR ucReserved1:2;
  769. UCHAR ucTransmitterSel:2; // =0: UniphyAB, =1: UniphyCD =2: UniphyEF
  770. UCHAR ucLinkSel:1; // =0: linkA/C/E =1: linkB/D/F
  771. UCHAR ucReserved:1;
  772. UCHAR ucDPLinkRate:1; // =0: 1.62Ghz, =1: 2.7Ghz
  773. #else
  774. UCHAR ucDPLinkRate:1; // =0: 1.62Ghz, =1: 2.7Ghz
  775. UCHAR ucReserved:1;
  776. UCHAR ucLinkSel:1; // =0: linkA/C/E =1: linkB/D/F
  777. UCHAR ucTransmitterSel:2; // =0: UniphyAB, =1: UniphyCD =2: UniphyEF
  778. UCHAR ucReserved1:2;
  779. #endif
  780. }ATOM_DIG_ENCODER_CONFIG_V2;
  781. typedef struct _DIG_ENCODER_CONTROL_PARAMETERS_V2
  782. {
  783. USHORT usPixelClock; // in 10KHz; for bios convenient
  784. ATOM_DIG_ENCODER_CONFIG_V2 acConfig;
  785. UCHAR ucAction;
  786. UCHAR ucEncoderMode;
  787. // =0: DP encoder
  788. // =1: LVDS encoder
  789. // =2: DVI encoder
  790. // =3: HDMI encoder
  791. // =4: SDVO encoder
  792. UCHAR ucLaneNum; // how many lanes to enable
  793. 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
  794. UCHAR ucReserved;
  795. }DIG_ENCODER_CONTROL_PARAMETERS_V2;
  796. //ucConfig
  797. #define ATOM_ENCODER_CONFIG_V2_DPLINKRATE_MASK 0x01
  798. #define ATOM_ENCODER_CONFIG_V2_DPLINKRATE_1_62GHZ 0x00
  799. #define ATOM_ENCODER_CONFIG_V2_DPLINKRATE_2_70GHZ 0x01
  800. #define ATOM_ENCODER_CONFIG_V2_LINK_SEL_MASK 0x04
  801. #define ATOM_ENCODER_CONFIG_V2_LINKA 0x00
  802. #define ATOM_ENCODER_CONFIG_V2_LINKB 0x04
  803. #define ATOM_ENCODER_CONFIG_V2_TRANSMITTER_SEL_MASK 0x18
  804. #define ATOM_ENCODER_CONFIG_V2_TRANSMITTER1 0x00
  805. #define ATOM_ENCODER_CONFIG_V2_TRANSMITTER2 0x08
  806. #define ATOM_ENCODER_CONFIG_V2_TRANSMITTER3 0x10
  807. // ucAction:
  808. // ATOM_DISABLE
  809. // ATOM_ENABLE
  810. #define ATOM_ENCODER_CMD_DP_LINK_TRAINING_START 0x08
  811. #define ATOM_ENCODER_CMD_DP_LINK_TRAINING_PATTERN1 0x09
  812. #define ATOM_ENCODER_CMD_DP_LINK_TRAINING_PATTERN2 0x0a
  813. #define ATOM_ENCODER_CMD_DP_LINK_TRAINING_PATTERN3 0x13
  814. #define ATOM_ENCODER_CMD_DP_LINK_TRAINING_COMPLETE 0x0b
  815. #define ATOM_ENCODER_CMD_DP_VIDEO_OFF 0x0c
  816. #define ATOM_ENCODER_CMD_DP_VIDEO_ON 0x0d
  817. #define ATOM_ENCODER_CMD_QUERY_DP_LINK_TRAINING_STATUS 0x0e
  818. #define ATOM_ENCODER_CMD_SETUP 0x0f
  819. #define ATOM_ENCODER_CMD_SETUP_PANEL_MODE 0x10
  820. // New Command for DIGxEncoderControlTable v1.5
  821. #define ATOM_ENCODER_CMD_DP_LINK_TRAINING_PATTERN4 0x14
  822. #define ATOM_ENCODER_CMD_STREAM_SETUP 0x0F //change name ATOM_ENCODER_CMD_SETUP
  823. #define ATOM_ENCODER_CMD_LINK_SETUP 0x11 //internal use, called by other Command Table
  824. #define ATOM_ENCODER_CMD_ENCODER_BLANK 0x12 //internal use, called by other Command Table
  825. // ucStatus
  826. #define ATOM_ENCODER_STATUS_LINK_TRAINING_COMPLETE 0x10
  827. #define ATOM_ENCODER_STATUS_LINK_TRAINING_INCOMPLETE 0x00
  828. //ucTableFormatRevision=1
  829. //ucTableContentRevision=3
  830. // Following function ENABLE sub-function will be used by driver when TMDS/HDMI/LVDS is used, disable function will be used by driver
  831. typedef struct _ATOM_DIG_ENCODER_CONFIG_V3
  832. {
  833. #if ATOM_BIG_ENDIAN
  834. UCHAR ucReserved1:1;
  835. 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)
  836. UCHAR ucReserved:3;
  837. UCHAR ucDPLinkRate:1; // =0: 1.62Ghz, =1: 2.7Ghz
  838. #else
  839. UCHAR ucDPLinkRate:1; // =0: 1.62Ghz, =1: 2.7Ghz
  840. UCHAR ucReserved:3;
  841. 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)
  842. UCHAR ucReserved1:1;
  843. #endif
  844. }ATOM_DIG_ENCODER_CONFIG_V3;
  845. #define ATOM_ENCODER_CONFIG_V3_DPLINKRATE_MASK 0x03
  846. #define ATOM_ENCODER_CONFIG_V3_DPLINKRATE_1_62GHZ 0x00
  847. #define ATOM_ENCODER_CONFIG_V3_DPLINKRATE_2_70GHZ 0x01
  848. #define ATOM_ENCODER_CONFIG_V3_ENCODER_SEL 0x70
  849. #define ATOM_ENCODER_CONFIG_V3_DIG0_ENCODER 0x00
  850. #define ATOM_ENCODER_CONFIG_V3_DIG1_ENCODER 0x10
  851. #define ATOM_ENCODER_CONFIG_V3_DIG2_ENCODER 0x20
  852. #define ATOM_ENCODER_CONFIG_V3_DIG3_ENCODER 0x30
  853. #define ATOM_ENCODER_CONFIG_V3_DIG4_ENCODER 0x40
  854. #define ATOM_ENCODER_CONFIG_V3_DIG5_ENCODER 0x50
  855. typedef struct _DIG_ENCODER_CONTROL_PARAMETERS_V3
  856. {
  857. USHORT usPixelClock; // in 10KHz; for bios convenient
  858. ATOM_DIG_ENCODER_CONFIG_V3 acConfig;
  859. UCHAR ucAction;
  860. union{
  861. UCHAR ucEncoderMode;
  862. // =0: DP encoder
  863. // =1: LVDS encoder
  864. // =2: DVI encoder
  865. // =3: HDMI encoder
  866. // =4: SDVO encoder
  867. // =5: DP audio
  868. UCHAR ucPanelMode; // only valid when ucAction == ATOM_ENCODER_CMD_SETUP_PANEL_MODE
  869. // =0: external DP
  870. // =0x1: internal DP2
  871. // =0x11: internal DP1 for NutMeg/Travis DP translator
  872. };
  873. UCHAR ucLaneNum; // how many lanes to enable
  874. UCHAR ucBitPerColor; // only valid for DP mode when ucAction = ATOM_ENCODER_CMD_SETUP
  875. UCHAR ucReserved;
  876. }DIG_ENCODER_CONTROL_PARAMETERS_V3;
  877. //ucTableFormatRevision=1
  878. //ucTableContentRevision=4
  879. // start from NI
  880. // Following function ENABLE sub-function will be used by driver when TMDS/HDMI/LVDS is used, disable function will be used by driver
  881. typedef struct _ATOM_DIG_ENCODER_CONFIG_V4
  882. {
  883. #if ATOM_BIG_ENDIAN
  884. UCHAR ucReserved1:1;
  885. 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)
  886. UCHAR ucReserved:2;
  887. UCHAR ucDPLinkRate:2; // =0: 1.62Ghz, =1: 2.7Ghz, 2=5.4Ghz <= Changed comparing to previous version
  888. #else
  889. UCHAR ucDPLinkRate:2; // =0: 1.62Ghz, =1: 2.7Ghz, 2=5.4Ghz <= Changed comparing to previous version
  890. UCHAR ucReserved:2;
  891. 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)
  892. UCHAR ucReserved1:1;
  893. #endif
  894. }ATOM_DIG_ENCODER_CONFIG_V4;
  895. #define ATOM_ENCODER_CONFIG_V4_DPLINKRATE_MASK 0x03
  896. #define ATOM_ENCODER_CONFIG_V4_DPLINKRATE_1_62GHZ 0x00
  897. #define ATOM_ENCODER_CONFIG_V4_DPLINKRATE_2_70GHZ 0x01
  898. #define ATOM_ENCODER_CONFIG_V4_DPLINKRATE_5_40GHZ 0x02
  899. #define ATOM_ENCODER_CONFIG_V4_DPLINKRATE_3_24GHZ 0x03
  900. #define ATOM_ENCODER_CONFIG_V4_ENCODER_SEL 0x70
  901. #define ATOM_ENCODER_CONFIG_V4_DIG0_ENCODER 0x00
  902. #define ATOM_ENCODER_CONFIG_V4_DIG1_ENCODER 0x10
  903. #define ATOM_ENCODER_CONFIG_V4_DIG2_ENCODER 0x20
  904. #define ATOM_ENCODER_CONFIG_V4_DIG3_ENCODER 0x30
  905. #define ATOM_ENCODER_CONFIG_V4_DIG4_ENCODER 0x40
  906. #define ATOM_ENCODER_CONFIG_V4_DIG5_ENCODER 0x50
  907. #define ATOM_ENCODER_CONFIG_V4_DIG6_ENCODER 0x60
  908. typedef struct _DIG_ENCODER_CONTROL_PARAMETERS_V4
  909. {
  910. USHORT usPixelClock; // in 10KHz; for bios convenient
  911. union{
  912. ATOM_DIG_ENCODER_CONFIG_V4 acConfig;
  913. UCHAR ucConfig;
  914. };
  915. UCHAR ucAction;
  916. union{
  917. UCHAR ucEncoderMode;
  918. // =0: DP encoder
  919. // =1: LVDS encoder
  920. // =2: DVI encoder
  921. // =3: HDMI encoder
  922. // =4: SDVO encoder
  923. // =5: DP audio
  924. UCHAR ucPanelMode; // only valid when ucAction == ATOM_ENCODER_CMD_SETUP_PANEL_MODE
  925. // =0: external DP
  926. // =0x1: internal DP2
  927. // =0x11: internal DP1 for NutMeg/Travis DP translator
  928. };
  929. UCHAR ucLaneNum; // how many lanes to enable
  930. UCHAR ucBitPerColor; // only valid for DP mode when ucAction = ATOM_ENCODER_CMD_SETUP
  931. UCHAR ucHPD_ID; // HPD ID (1-6). =0 means to skip HDP programming. New comparing to previous version
  932. }DIG_ENCODER_CONTROL_PARAMETERS_V4;
  933. // define ucBitPerColor:
  934. #define PANEL_BPC_UNDEFINE 0x00
  935. #define PANEL_6BIT_PER_COLOR 0x01
  936. #define PANEL_8BIT_PER_COLOR 0x02
  937. #define PANEL_10BIT_PER_COLOR 0x03
  938. #define PANEL_12BIT_PER_COLOR 0x04
  939. #define PANEL_16BIT_PER_COLOR 0x05
  940. //define ucPanelMode
  941. #define DP_PANEL_MODE_EXTERNAL_DP_MODE 0x00
  942. #define DP_PANEL_MODE_INTERNAL_DP2_MODE 0x01
  943. #define DP_PANEL_MODE_INTERNAL_DP1_MODE 0x11
  944. typedef struct _ENCODER_STREAM_SETUP_PARAMETERS_V5
  945. {
  946. UCHAR ucDigId; // 0~6 map to DIG0~DIG6
  947. UCHAR ucAction; // = ATOM_ENOCODER_CMD_STREAM_SETUP
  948. UCHAR ucDigMode; // ATOM_ENCODER_MODE_DP/ATOM_ENCODER_MODE_DVI/ATOM_ENCODER_MODE_HDMI
  949. UCHAR ucLaneNum; // Lane number
  950. ULONG ulPixelClock; // Pixel Clock in 10Khz
  951. UCHAR ucBitPerColor;
  952. UCHAR ucLinkRateIn270Mhz;//= DP link rate/270Mhz, =6: 1.62G = 10: 2.7G, =20: 5.4Ghz, =30: 8.1Ghz etc
  953. UCHAR ucReserved[2];
  954. }ENCODER_STREAM_SETUP_PARAMETERS_V5;
  955. typedef struct _ENCODER_LINK_SETUP_PARAMETERS_V5
  956. {
  957. UCHAR ucDigId; // 0~6 map to DIG0~DIG6
  958. UCHAR ucAction; // = ATOM_ENOCODER_CMD_LINK_SETUP
  959. UCHAR ucDigMode; // ATOM_ENCODER_MODE_DP/ATOM_ENCODER_MODE_DVI/ATOM_ENCODER_MODE_HDMI
  960. UCHAR ucLaneNum; // Lane number
  961. ULONG ulSymClock; // Symbol Clock in 10Khz
  962. UCHAR ucHPDSel;
  963. UCHAR ucDigEncoderSel; // DIG stream( front-end ) selection, bit0 means DIG0 FE is enable,
  964. UCHAR ucReserved[2];
  965. }ENCODER_LINK_SETUP_PARAMETERS_V5;
  966. typedef struct _DP_PANEL_MODE_SETUP_PARAMETERS_V5
  967. {
  968. UCHAR ucDigId; // 0~6 map to DIG0~DIG6
  969. UCHAR ucAction; // = ATOM_ENCODER_CMD_DPLINK_SETUP
  970. UCHAR ucPanelMode; // =0: external DP
  971. // =0x1: internal DP2
  972. // =0x11: internal DP1 NutMeg/Travis DP Translator
  973. UCHAR ucReserved;
  974. ULONG ulReserved[2];
  975. }DP_PANEL_MODE_SETUP_PARAMETERS_V5;
  976. typedef struct _ENCODER_GENERIC_CMD_PARAMETERS_V5
  977. {
  978. UCHAR ucDigId; // 0~6 map to DIG0~DIG6
  979. UCHAR ucAction; // = rest of generic encoder command which does not carry any parameters
  980. UCHAR ucReserved[2];
  981. ULONG ulReserved[2];
  982. }ENCODER_GENERIC_CMD_PARAMETERS_V5;
  983. //ucDigId
  984. #define ATOM_ENCODER_CONFIG_V5_DIG0_ENCODER 0x00
  985. #define ATOM_ENCODER_CONFIG_V5_DIG1_ENCODER 0x01
  986. #define ATOM_ENCODER_CONFIG_V5_DIG2_ENCODER 0x02
  987. #define ATOM_ENCODER_CONFIG_V5_DIG3_ENCODER 0x03
  988. #define ATOM_ENCODER_CONFIG_V5_DIG4_ENCODER 0x04
  989. #define ATOM_ENCODER_CONFIG_V5_DIG5_ENCODER 0x05
  990. #define ATOM_ENCODER_CONFIG_V5_DIG6_ENCODER 0x06
  991. typedef union _DIG_ENCODER_CONTROL_PARAMETERS_V5
  992. {
  993. ENCODER_GENERIC_CMD_PARAMETERS_V5 asCmdParam;
  994. ENCODER_STREAM_SETUP_PARAMETERS_V5 asStreamParam;
  995. ENCODER_LINK_SETUP_PARAMETERS_V5 asLinkParam;
  996. DP_PANEL_MODE_SETUP_PARAMETERS_V5 asDPPanelModeParam;
  997. }DIG_ENCODER_CONTROL_PARAMETERS_V5;
  998. /****************************************************************************/
  999. // Structures used by UNIPHYTransmitterControlTable
  1000. // LVTMATransmitterControlTable
  1001. // DVOOutputControlTable
  1002. /****************************************************************************/
  1003. typedef struct _ATOM_DP_VS_MODE
  1004. {
  1005. UCHAR ucLaneSel;
  1006. UCHAR ucLaneSet;
  1007. }ATOM_DP_VS_MODE;
  1008. typedef struct _DIG_TRANSMITTER_CONTROL_PARAMETERS
  1009. {
  1010. union
  1011. {
  1012. USHORT usPixelClock; // in 10KHz; for bios convenient
  1013. USHORT usInitInfo; // when init uniphy,lower 8bit is used for connector type defined in objectid.h
  1014. ATOM_DP_VS_MODE asMode; // DP Voltage swing mode
  1015. };
  1016. UCHAR ucConfig;
  1017. // [0]=0: 4 lane Link,
  1018. // =1: 8 lane Link ( Dual Links TMDS )
  1019. // [1]=0: InCoherent mode
  1020. // =1: Coherent Mode
  1021. // [2] Link Select:
  1022. // =0: PHY linkA if bfLane<3
  1023. // =1: PHY linkB if bfLanes<3
  1024. // =0: PHY linkA+B if bfLanes=3
  1025. // [5:4]PCIE lane Sel
  1026. // =0: lane 0~3 or 0~7
  1027. // =1: lane 4~7
  1028. // =2: lane 8~11 or 8~15
  1029. // =3: lane 12~15
  1030. UCHAR ucAction; // =0: turn off encoder
  1031. // =1: turn on encoder
  1032. UCHAR ucReserved[4];
  1033. }DIG_TRANSMITTER_CONTROL_PARAMETERS;
  1034. #define DIG_TRANSMITTER_CONTROL_PS_ALLOCATION DIG_TRANSMITTER_CONTROL_PARAMETERS
  1035. //ucInitInfo
  1036. #define ATOM_TRAMITTER_INITINFO_CONNECTOR_MASK 0x00ff
  1037. //ucConfig
  1038. #define ATOM_TRANSMITTER_CONFIG_8LANE_LINK 0x01
  1039. #define ATOM_TRANSMITTER_CONFIG_COHERENT 0x02
  1040. #define ATOM_TRANSMITTER_CONFIG_LINK_SEL_MASK 0x04
  1041. #define ATOM_TRANSMITTER_CONFIG_LINKA 0x00
  1042. #define ATOM_TRANSMITTER_CONFIG_LINKB 0x04
  1043. #define ATOM_TRANSMITTER_CONFIG_LINKA_B 0x00
  1044. #define ATOM_TRANSMITTER_CONFIG_LINKB_A 0x04
  1045. #define ATOM_TRANSMITTER_CONFIG_ENCODER_SEL_MASK 0x08 // only used when ATOM_TRANSMITTER_ACTION_ENABLE
  1046. #define ATOM_TRANSMITTER_CONFIG_DIG1_ENCODER 0x00 // only used when ATOM_TRANSMITTER_ACTION_ENABLE
  1047. #define ATOM_TRANSMITTER_CONFIG_DIG2_ENCODER 0x08 // only used when ATOM_TRANSMITTER_ACTION_ENABLE
  1048. #define ATOM_TRANSMITTER_CONFIG_CLKSRC_MASK 0x30
  1049. #define ATOM_TRANSMITTER_CONFIG_CLKSRC_PPLL 0x00
  1050. #define ATOM_TRANSMITTER_CONFIG_CLKSRC_PCIE 0x20
  1051. #define ATOM_TRANSMITTER_CONFIG_CLKSRC_XTALIN 0x30
  1052. #define ATOM_TRANSMITTER_CONFIG_LANE_SEL_MASK 0xc0
  1053. #define ATOM_TRANSMITTER_CONFIG_LANE_0_3 0x00
  1054. #define ATOM_TRANSMITTER_CONFIG_LANE_0_7 0x00
  1055. #define ATOM_TRANSMITTER_CONFIG_LANE_4_7 0x40
  1056. #define ATOM_TRANSMITTER_CONFIG_LANE_8_11 0x80
  1057. #define ATOM_TRANSMITTER_CONFIG_LANE_8_15 0x80
  1058. #define ATOM_TRANSMITTER_CONFIG_LANE_12_15 0xc0
  1059. //ucAction
  1060. #define ATOM_TRANSMITTER_ACTION_DISABLE 0
  1061. #define ATOM_TRANSMITTER_ACTION_ENABLE 1
  1062. #define ATOM_TRANSMITTER_ACTION_LCD_BLOFF 2
  1063. #define ATOM_TRANSMITTER_ACTION_LCD_BLON 3
  1064. #define ATOM_TRANSMITTER_ACTION_BL_BRIGHTNESS_CONTROL 4
  1065. #define ATOM_TRANSMITTER_ACTION_LCD_SELFTEST_START 5
  1066. #define ATOM_TRANSMITTER_ACTION_LCD_SELFTEST_STOP 6
  1067. #define ATOM_TRANSMITTER_ACTION_INIT 7
  1068. #define ATOM_TRANSMITTER_ACTION_DISABLE_OUTPUT 8
  1069. #define ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT 9
  1070. #define ATOM_TRANSMITTER_ACTION_SETUP 10
  1071. #define ATOM_TRANSMITTER_ACTION_SETUP_VSEMPH 11
  1072. #define ATOM_TRANSMITTER_ACTION_POWER_ON 12
  1073. #define ATOM_TRANSMITTER_ACTION_POWER_OFF 13
  1074. // Following are used for DigTransmitterControlTable ver1.2
  1075. typedef struct _ATOM_DIG_TRANSMITTER_CONFIG_V2
  1076. {
  1077. #if ATOM_BIG_ENDIAN
  1078. UCHAR ucTransmitterSel:2; //bit7:6: =0 Dig Transmitter 1 ( Uniphy AB )
  1079. // =1 Dig Transmitter 2 ( Uniphy CD )
  1080. // =2 Dig Transmitter 3 ( Uniphy EF )
  1081. UCHAR ucReserved:1;
  1082. UCHAR fDPConnector:1; //bit4=0: DP connector =1: None DP connector
  1083. UCHAR ucEncoderSel:1; //bit3=0: Data/Clk path source from DIGA( DIG inst0 ). =1: Data/clk path source from DIGB ( DIG inst1 )
  1084. 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
  1085. // =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
  1086. UCHAR fCoherentMode:1; //bit1=1: Coherent Mode ( for DVI/HDMI mode )
  1087. UCHAR fDualLinkConnector:1; //bit0=1: Dual Link DVI connector
  1088. #else
  1089. UCHAR fDualLinkConnector:1; //bit0=1: Dual Link DVI connector
  1090. UCHAR fCoherentMode:1; //bit1=1: Coherent Mode ( for DVI/HDMI mode )
  1091. 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
  1092. // =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
  1093. UCHAR ucEncoderSel:1; //bit3=0: Data/Clk path source from DIGA( DIG inst0 ). =1: Data/clk path source from DIGB ( DIG inst1 )
  1094. UCHAR fDPConnector:1; //bit4=0: DP connector =1: None DP connector
  1095. UCHAR ucReserved:1;
  1096. UCHAR ucTransmitterSel:2; //bit7:6: =0 Dig Transmitter 1 ( Uniphy AB )
  1097. // =1 Dig Transmitter 2 ( Uniphy CD )
  1098. // =2 Dig Transmitter 3 ( Uniphy EF )
  1099. #endif
  1100. }ATOM_DIG_TRANSMITTER_CONFIG_V2;
  1101. //ucConfig
  1102. //Bit0
  1103. #define ATOM_TRANSMITTER_CONFIG_V2_DUAL_LINK_CONNECTOR 0x01
  1104. //Bit1
  1105. #define ATOM_TRANSMITTER_CONFIG_V2_COHERENT 0x02
  1106. //Bit2
  1107. #define ATOM_TRANSMITTER_CONFIG_V2_LINK_SEL_MASK 0x04
  1108. #define ATOM_TRANSMITTER_CONFIG_V2_LINKA 0x00
  1109. #define ATOM_TRANSMITTER_CONFIG_V2_LINKB 0x04
  1110. // Bit3
  1111. #define ATOM_TRANSMITTER_CONFIG_V2_ENCODER_SEL_MASK 0x08
  1112. #define ATOM_TRANSMITTER_CONFIG_V2_DIG1_ENCODER 0x00 // only used when ucAction == ATOM_TRANSMITTER_ACTION_ENABLE or ATOM_TRANSMITTER_ACTION_SETUP
  1113. #define ATOM_TRANSMITTER_CONFIG_V2_DIG2_ENCODER 0x08 // only used when ucAction == ATOM_TRANSMITTER_ACTION_ENABLE or ATOM_TRANSMITTER_ACTION_SETUP
  1114. // Bit4
  1115. #define ATOM_TRASMITTER_CONFIG_V2_DP_CONNECTOR 0x10
  1116. // Bit7:6
  1117. #define ATOM_TRANSMITTER_CONFIG_V2_TRANSMITTER_SEL_MASK 0xC0
  1118. #define ATOM_TRANSMITTER_CONFIG_V2_TRANSMITTER1 0x00 //AB
  1119. #define ATOM_TRANSMITTER_CONFIG_V2_TRANSMITTER2 0x40 //CD
  1120. #define ATOM_TRANSMITTER_CONFIG_V2_TRANSMITTER3 0x80 //EF
  1121. typedef struct _DIG_TRANSMITTER_CONTROL_PARAMETERS_V2
  1122. {
  1123. union
  1124. {
  1125. USHORT usPixelClock; // in 10KHz; for bios convenient
  1126. USHORT usInitInfo; // when init uniphy,lower 8bit is used for connector type defined in objectid.h
  1127. ATOM_DP_VS_MODE asMode; // DP Voltage swing mode
  1128. };
  1129. ATOM_DIG_TRANSMITTER_CONFIG_V2 acConfig;
  1130. UCHAR ucAction; // define as ATOM_TRANSMITER_ACTION_XXX
  1131. UCHAR ucReserved[4];
  1132. }DIG_TRANSMITTER_CONTROL_PARAMETERS_V2;
  1133. typedef struct _ATOM_DIG_TRANSMITTER_CONFIG_V3
  1134. {
  1135. #if ATOM_BIG_ENDIAN
  1136. UCHAR ucTransmitterSel:2; //bit7:6: =0 Dig Transmitter 1 ( Uniphy AB )
  1137. // =1 Dig Transmitter 2 ( Uniphy CD )
  1138. // =2 Dig Transmitter 3 ( Uniphy EF )
  1139. UCHAR ucRefClkSource:2; //bit5:4: PPLL1 =0, PPLL2=1, EXT_CLK=2
  1140. UCHAR ucEncoderSel:1; //bit3=0: Data/Clk path source from DIGA/C/E. =1: Data/clk path source from DIGB/D/F
  1141. 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
  1142. // =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
  1143. UCHAR fCoherentMode:1; //bit1=1: Coherent Mode ( for DVI/HDMI mode )
  1144. UCHAR fDualLinkConnector:1; //bit0=1: Dual Link DVI connector
  1145. #else
  1146. UCHAR fDualLinkConnector:1; //bit0=1: Dual Link DVI connector
  1147. UCHAR fCoherentMode:1; //bit1=1: Coherent Mode ( for DVI/HDMI mode )
  1148. 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
  1149. // =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
  1150. UCHAR ucEncoderSel:1; //bit3=0: Data/Clk path source from DIGA/C/E. =1: Data/clk path source from DIGB/D/F
  1151. UCHAR ucRefClkSource:2; //bit5:4: PPLL1 =0, PPLL2=1, EXT_CLK=2
  1152. UCHAR ucTransmitterSel:2; //bit7:6: =0 Dig Transmitter 1 ( Uniphy AB )
  1153. // =1 Dig Transmitter 2 ( Uniphy CD )
  1154. // =2 Dig Transmitter 3 ( Uniphy EF )
  1155. #endif
  1156. }ATOM_DIG_TRANSMITTER_CONFIG_V3;
  1157. typedef struct _DIG_TRANSMITTER_CONTROL_PARAMETERS_V3
  1158. {
  1159. union
  1160. {
  1161. USHORT usPixelClock; // in 10KHz; for bios convenient
  1162. USHORT usInitInfo; // when init uniphy,lower 8bit is used for connector type defined in objectid.h
  1163. ATOM_DP_VS_MODE asMode; // DP Voltage swing mode
  1164. };
  1165. ATOM_DIG_TRANSMITTER_CONFIG_V3 acConfig;
  1166. UCHAR ucAction; // define as ATOM_TRANSMITER_ACTION_XXX
  1167. UCHAR ucLaneNum;
  1168. UCHAR ucReserved[3];
  1169. }DIG_TRANSMITTER_CONTROL_PARAMETERS_V3;
  1170. //ucConfig
  1171. //Bit0
  1172. #define ATOM_TRANSMITTER_CONFIG_V3_DUAL_LINK_CONNECTOR 0x01
  1173. //Bit1
  1174. #define ATOM_TRANSMITTER_CONFIG_V3_COHERENT 0x02
  1175. //Bit2
  1176. #define ATOM_TRANSMITTER_CONFIG_V3_LINK_SEL_MASK 0x04
  1177. #define ATOM_TRANSMITTER_CONFIG_V3_LINKA 0x00
  1178. #define ATOM_TRANSMITTER_CONFIG_V3_LINKB 0x04
  1179. // Bit3
  1180. #define ATOM_TRANSMITTER_CONFIG_V3_ENCODER_SEL_MASK 0x08
  1181. #define ATOM_TRANSMITTER_CONFIG_V3_DIG1_ENCODER 0x00
  1182. #define ATOM_TRANSMITTER_CONFIG_V3_DIG2_ENCODER 0x08
  1183. // Bit5:4
  1184. #define ATOM_TRASMITTER_CONFIG_V3_REFCLK_SEL_MASK 0x30
  1185. #define ATOM_TRASMITTER_CONFIG_V3_P1PLL 0x00
  1186. #define ATOM_TRASMITTER_CONFIG_V3_P2PLL 0x10
  1187. #define ATOM_TRASMITTER_CONFIG_V3_REFCLK_SRC_EXT 0x20
  1188. // Bit7:6
  1189. #define ATOM_TRANSMITTER_CONFIG_V3_TRANSMITTER_SEL_MASK 0xC0
  1190. #define ATOM_TRANSMITTER_CONFIG_V3_TRANSMITTER1 0x00 //AB
  1191. #define ATOM_TRANSMITTER_CONFIG_V3_TRANSMITTER2 0x40 //CD
  1192. #define ATOM_TRANSMITTER_CONFIG_V3_TRANSMITTER3 0x80 //EF
  1193. /****************************************************************************/
  1194. // Structures used by UNIPHYTransmitterControlTable V1.4
  1195. // ASIC Families: NI
  1196. // ucTableFormatRevision=1
  1197. // ucTableContentRevision=4
  1198. /****************************************************************************/
  1199. typedef struct _ATOM_DP_VS_MODE_V4
  1200. {
  1201. UCHAR ucLaneSel;
  1202. union
  1203. {
  1204. UCHAR ucLaneSet;
  1205. struct {
  1206. #if ATOM_BIG_ENDIAN
  1207. UCHAR ucPOST_CURSOR2:2; //Bit[7:6] Post Cursor2 Level <= New in V4
  1208. UCHAR ucPRE_EMPHASIS:3; //Bit[5:3] Pre-emphasis Level
  1209. UCHAR ucVOLTAGE_SWING:3; //Bit[2:0] Voltage Swing Level
  1210. #else
  1211. UCHAR ucVOLTAGE_SWING:3; //Bit[2:0] Voltage Swing Level
  1212. UCHAR ucPRE_EMPHASIS:3; //Bit[5:3] Pre-emphasis Level
  1213. UCHAR ucPOST_CURSOR2:2; //Bit[7:6] Post Cursor2 Level <= New in V4
  1214. #endif
  1215. };
  1216. };
  1217. }ATOM_DP_VS_MODE_V4;
  1218. typedef struct _ATOM_DIG_TRANSMITTER_CONFIG_V4
  1219. {
  1220. #if ATOM_BIG_ENDIAN
  1221. UCHAR ucTransmitterSel:2; //bit7:6: =0 Dig Transmitter 1 ( Uniphy AB )
  1222. // =1 Dig Transmitter 2 ( Uniphy CD )
  1223. // =2 Dig Transmitter 3 ( Uniphy EF )
  1224. UCHAR ucRefClkSource:2; //bit5:4: PPLL1 =0, PPLL2=1, DCPLL=2, EXT_CLK=3 <= New
  1225. UCHAR ucEncoderSel:1; //bit3=0: Data/Clk path source from DIGA/C/E. =1: Data/clk path source from DIGB/D/F
  1226. 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
  1227. // =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
  1228. UCHAR fCoherentMode:1; //bit1=1: Coherent Mode ( for DVI/HDMI mode )
  1229. UCHAR fDualLinkConnector:1; //bit0=1: Dual Link DVI connector
  1230. #else
  1231. UCHAR fDualLinkConnector:1; //bit0=1: Dual Link DVI connector
  1232. UCHAR fCoherentMode:1; //bit1=1: Coherent Mode ( for DVI/HDMI mode )
  1233. 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
  1234. // =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
  1235. UCHAR ucEncoderSel:1; //bit3=0: Data/Clk path source from DIGA/C/E. =1: Data/clk path source from DIGB/D/F
  1236. UCHAR ucRefClkSource:2; //bit5:4: PPLL1 =0, PPLL2=1, DCPLL=2, EXT_CLK=3 <= New
  1237. UCHAR ucTransmitterSel:2; //bit7:6: =0 Dig Transmitter 1 ( Uniphy AB )
  1238. // =1 Dig Transmitter 2 ( Uniphy CD )
  1239. // =2 Dig Transmitter 3 ( Uniphy EF )
  1240. #endif
  1241. }ATOM_DIG_TRANSMITTER_CONFIG_V4;
  1242. typedef struct _DIG_TRANSMITTER_CONTROL_PARAMETERS_V4
  1243. {
  1244. union
  1245. {
  1246. USHORT usPixelClock; // in 10KHz; for bios convenient
  1247. USHORT usInitInfo; // when init uniphy,lower 8bit is used for connector type defined in objectid.h
  1248. ATOM_DP_VS_MODE_V4 asMode; // DP Voltage swing mode Redefined comparing to previous version
  1249. };
  1250. union
  1251. {
  1252. ATOM_DIG_TRANSMITTER_CONFIG_V4 acConfig;
  1253. UCHAR ucConfig;
  1254. };
  1255. UCHAR ucAction; // define as ATOM_TRANSMITER_ACTION_XXX
  1256. UCHAR ucLaneNum;
  1257. UCHAR ucReserved[3];
  1258. }DIG_TRANSMITTER_CONTROL_PARAMETERS_V4;
  1259. //ucConfig
  1260. //Bit0
  1261. #define ATOM_TRANSMITTER_CONFIG_V4_DUAL_LINK_CONNECTOR 0x01
  1262. //Bit1
  1263. #define ATOM_TRANSMITTER_CONFIG_V4_COHERENT 0x02
  1264. //Bit2
  1265. #define ATOM_TRANSMITTER_CONFIG_V4_LINK_SEL_MASK 0x04
  1266. #define ATOM_TRANSMITTER_CONFIG_V4_LINKA 0x00
  1267. #define ATOM_TRANSMITTER_CONFIG_V4_LINKB 0x04
  1268. // Bit3
  1269. #define ATOM_TRANSMITTER_CONFIG_V4_ENCODER_SEL_MASK 0x08
  1270. #define ATOM_TRANSMITTER_CONFIG_V4_DIG1_ENCODER 0x00
  1271. #define ATOM_TRANSMITTER_CONFIG_V4_DIG2_ENCODER 0x08
  1272. // Bit5:4
  1273. #define ATOM_TRANSMITTER_CONFIG_V4_REFCLK_SEL_MASK 0x30
  1274. #define ATOM_TRANSMITTER_CONFIG_V4_P1PLL 0x00
  1275. #define ATOM_TRANSMITTER_CONFIG_V4_P2PLL 0x10
  1276. #define ATOM_TRANSMITTER_CONFIG_V4_DCPLL 0x20 // New in _V4
  1277. #define ATOM_TRANSMITTER_CONFIG_V4_REFCLK_SRC_EXT 0x30 // Changed comparing to V3
  1278. // Bit7:6
  1279. #define ATOM_TRANSMITTER_CONFIG_V4_TRANSMITTER_SEL_MASK 0xC0
  1280. #define ATOM_TRANSMITTER_CONFIG_V4_TRANSMITTER1 0x00 //AB
  1281. #define ATOM_TRANSMITTER_CONFIG_V4_TRANSMITTER2 0x40 //CD
  1282. #define ATOM_TRANSMITTER_CONFIG_V4_TRANSMITTER3 0x80 //EF
  1283. typedef struct _ATOM_DIG_TRANSMITTER_CONFIG_V5
  1284. {
  1285. #if ATOM_BIG_ENDIAN
  1286. UCHAR ucReservd1:1;
  1287. UCHAR ucHPDSel:3;
  1288. UCHAR ucPhyClkSrcId:2;
  1289. UCHAR ucCoherentMode:1;
  1290. UCHAR ucReserved:1;
  1291. #else
  1292. UCHAR ucReserved:1;
  1293. UCHAR ucCoherentMode:1;
  1294. UCHAR ucPhyClkSrcId:2;
  1295. UCHAR ucHPDSel:3;
  1296. UCHAR ucReservd1:1;
  1297. #endif
  1298. }ATOM_DIG_TRANSMITTER_CONFIG_V5;
  1299. typedef struct _DIG_TRANSMITTER_CONTROL_PARAMETERS_V1_5
  1300. {
  1301. USHORT usSymClock; // Encoder Clock in 10kHz,(DP mode)= linkclock/10, (TMDS/LVDS/HDMI)= pixel clock, (HDMI deep color), =pixel clock * deep_color_ratio
  1302. UCHAR ucPhyId; // 0=UNIPHYA, 1=UNIPHYB, 2=UNIPHYC, 3=UNIPHYD, 4= UNIPHYE 5=UNIPHYF
  1303. UCHAR ucAction; // define as ATOM_TRANSMITER_ACTION_xxx
  1304. UCHAR ucLaneNum; // indicate lane number 1-8
  1305. UCHAR ucConnObjId; // Connector Object Id defined in ObjectId.h
  1306. UCHAR ucDigMode; // indicate DIG mode
  1307. union{
  1308. ATOM_DIG_TRANSMITTER_CONFIG_V5 asConfig;
  1309. UCHAR ucConfig;
  1310. };
  1311. UCHAR ucDigEncoderSel; // indicate DIG front end encoder
  1312. UCHAR ucDPLaneSet;
  1313. UCHAR ucReserved;
  1314. UCHAR ucReserved1;
  1315. }DIG_TRANSMITTER_CONTROL_PARAMETERS_V1_5;
  1316. //ucPhyId
  1317. #define ATOM_PHY_ID_UNIPHYA 0
  1318. #define ATOM_PHY_ID_UNIPHYB 1
  1319. #define ATOM_PHY_ID_UNIPHYC 2
  1320. #define ATOM_PHY_ID_UNIPHYD 3
  1321. #define ATOM_PHY_ID_UNIPHYE 4
  1322. #define ATOM_PHY_ID_UNIPHYF 5
  1323. #define ATOM_PHY_ID_UNIPHYG 6
  1324. // ucDigEncoderSel
  1325. #define ATOM_TRANMSITTER_V5__DIGA_SEL 0x01
  1326. #define ATOM_TRANMSITTER_V5__DIGB_SEL 0x02
  1327. #define ATOM_TRANMSITTER_V5__DIGC_SEL 0x04
  1328. #define ATOM_TRANMSITTER_V5__DIGD_SEL 0x08
  1329. #define ATOM_TRANMSITTER_V5__DIGE_SEL 0x10
  1330. #define ATOM_TRANMSITTER_V5__DIGF_SEL 0x20
  1331. #define ATOM_TRANMSITTER_V5__DIGG_SEL 0x40
  1332. // ucDigMode
  1333. #define ATOM_TRANSMITTER_DIGMODE_V5_DP 0
  1334. #define ATOM_TRANSMITTER_DIGMODE_V5_LVDS 1
  1335. #define ATOM_TRANSMITTER_DIGMODE_V5_DVI 2
  1336. #define ATOM_TRANSMITTER_DIGMODE_V5_HDMI 3
  1337. #define ATOM_TRANSMITTER_DIGMODE_V5_SDVO 4
  1338. #define ATOM_TRANSMITTER_DIGMODE_V5_DP_MST 5
  1339. // ucDPLaneSet
  1340. #define DP_LANE_SET__0DB_0_4V 0x00
  1341. #define DP_LANE_SET__0DB_0_6V 0x01
  1342. #define DP_LANE_SET__0DB_0_8V 0x02
  1343. #define DP_LANE_SET__0DB_1_2V 0x03
  1344. #define DP_LANE_SET__3_5DB_0_4V 0x08
  1345. #define DP_LANE_SET__3_5DB_0_6V 0x09
  1346. #define DP_LANE_SET__3_5DB_0_8V 0x0a
  1347. #define DP_LANE_SET__6DB_0_4V 0x10
  1348. #define DP_LANE_SET__6DB_0_6V 0x11
  1349. #define DP_LANE_SET__9_5DB_0_4V 0x18
  1350. // ATOM_DIG_TRANSMITTER_CONFIG_V5 asConfig;
  1351. // Bit1
  1352. #define ATOM_TRANSMITTER_CONFIG_V5_COHERENT 0x02
  1353. // Bit3:2
  1354. #define ATOM_TRANSMITTER_CONFIG_V5_REFCLK_SEL_MASK 0x0c
  1355. #define ATOM_TRANSMITTER_CONFIG_V5_REFCLK_SEL_SHIFT 0x02
  1356. #define ATOM_TRANSMITTER_CONFIG_V5_P1PLL 0x00
  1357. #define ATOM_TRANSMITTER_CONFIG_V5_P2PLL 0x04
  1358. #define ATOM_TRANSMITTER_CONFIG_V5_P0PLL 0x08
  1359. #define ATOM_TRANSMITTER_CONFIG_V5_REFCLK_SRC_EXT 0x0c
  1360. // Bit6:4
  1361. #define ATOM_TRANSMITTER_CONFIG_V5_HPD_SEL_MASK 0x70
  1362. #define ATOM_TRANSMITTER_CONFIG_V5_HPD_SEL_SHIFT 0x04
  1363. #define ATOM_TRANSMITTER_CONFIG_V5_NO_HPD_SEL 0x00
  1364. #define ATOM_TRANSMITTER_CONFIG_V5_HPD1_SEL 0x10
  1365. #define ATOM_TRANSMITTER_CONFIG_V5_HPD2_SEL 0x20
  1366. #define ATOM_TRANSMITTER_CONFIG_V5_HPD3_SEL 0x30
  1367. #define ATOM_TRANSMITTER_CONFIG_V5_HPD4_SEL 0x40
  1368. #define ATOM_TRANSMITTER_CONFIG_V5_HPD5_SEL 0x50
  1369. #define ATOM_TRANSMITTER_CONFIG_V5_HPD6_SEL 0x60
  1370. #define DIG_TRANSMITTER_CONTROL_PS_ALLOCATION_V1_5 DIG_TRANSMITTER_CONTROL_PARAMETERS_V1_5
  1371. typedef struct _DIG_TRANSMITTER_CONTROL_PARAMETERS_V1_6
  1372. {
  1373. UCHAR ucPhyId; // 0=UNIPHYA, 1=UNIPHYB, 2=UNIPHYC, 3=UNIPHYD, 4= UNIPHYE 5=UNIPHYF
  1374. UCHAR ucAction; // define as ATOM_TRANSMITER_ACTION_xxx
  1375. union
  1376. {
  1377. UCHAR ucDigMode; // ATOM_ENCODER_MODE_DP/ATOM_ENCODER_MODE_DVI/ATOM_ENCODER_MODE_HDMI
  1378. UCHAR ucDPLaneSet; // DP voltage swing and pre-emphasis value defined in DPCD DP_LANE_SET, "DP_LANE_SET__xDB_y_zV"
  1379. };
  1380. UCHAR ucLaneNum; // Lane number
  1381. ULONG ulSymClock; // Symbol Clock in 10Khz
  1382. UCHAR ucHPDSel; // =1: HPD1, =2: HPD2, .... =6: HPD6, =0: HPD is not assigned
  1383. UCHAR ucDigEncoderSel; // DIG stream( front-end ) selection, bit0 means DIG0 FE is enable,
  1384. UCHAR ucConnObjId; // Connector Object Id defined in ObjectId.h
  1385. UCHAR ucReserved;
  1386. ULONG ulReserved;
  1387. }DIG_TRANSMITTER_CONTROL_PARAMETERS_V1_6;
  1388. // ucDigEncoderSel
  1389. #define ATOM_TRANMSITTER_V6__DIGA_SEL 0x01
  1390. #define ATOM_TRANMSITTER_V6__DIGB_SEL 0x02
  1391. #define ATOM_TRANMSITTER_V6__DIGC_SEL 0x04
  1392. #define ATOM_TRANMSITTER_V6__DIGD_SEL 0x08
  1393. #define ATOM_TRANMSITTER_V6__DIGE_SEL 0x10
  1394. #define ATOM_TRANMSITTER_V6__DIGF_SEL 0x20
  1395. #define ATOM_TRANMSITTER_V6__DIGG_SEL 0x40
  1396. // ucDigMode
  1397. #define ATOM_TRANSMITTER_DIGMODE_V6_DP 0
  1398. #define ATOM_TRANSMITTER_DIGMODE_V6_DVI 2
  1399. #define ATOM_TRANSMITTER_DIGMODE_V6_HDMI 3
  1400. #define ATOM_TRANSMITTER_DIGMODE_V6_DP_MST 5
  1401. //ucHPDSel
  1402. #define ATOM_TRANSMITTER_V6_NO_HPD_SEL 0x00
  1403. #define ATOM_TRANSMITTER_V6_HPD1_SEL 0x01
  1404. #define ATOM_TRANSMITTER_V6_HPD2_SEL 0x02
  1405. #define ATOM_TRANSMITTER_V6_HPD3_SEL 0x03
  1406. #define ATOM_TRANSMITTER_V6_HPD4_SEL 0x04
  1407. #define ATOM_TRANSMITTER_V6_HPD5_SEL 0x05
  1408. #define ATOM_TRANSMITTER_V6_HPD6_SEL 0x06
  1409. /****************************************************************************/
  1410. // Structures used by ExternalEncoderControlTable V1.3
  1411. // ASIC Families: Evergreen, Llano, NI
  1412. // ucTableFormatRevision=1
  1413. // ucTableContentRevision=3
  1414. /****************************************************************************/
  1415. typedef struct _EXTERNAL_ENCODER_CONTROL_PARAMETERS_V3
  1416. {
  1417. union{
  1418. USHORT usPixelClock; // pixel clock in 10Khz, valid when ucAction=SETUP/ENABLE_OUTPUT
  1419. USHORT usConnectorId; // connector id, valid when ucAction = INIT
  1420. };
  1421. UCHAR ucConfig; // indicate which encoder, and DP link rate when ucAction = SETUP/ENABLE_OUTPUT
  1422. UCHAR ucAction; //
  1423. UCHAR ucEncoderMode; // encoder mode, only used when ucAction = SETUP/ENABLE_OUTPUT
  1424. UCHAR ucLaneNum; // lane number, only used when ucAction = SETUP/ENABLE_OUTPUT
  1425. UCHAR ucBitPerColor; // output bit per color, only valid when ucAction = SETUP/ENABLE_OUTPUT and ucEncodeMode= DP
  1426. UCHAR ucReserved;
  1427. }EXTERNAL_ENCODER_CONTROL_PARAMETERS_V3;
  1428. // ucAction
  1429. #define EXTERANL_ENCODER_ACTION_V3_DISABLE_OUTPUT 0x00
  1430. #define EXTERANL_ENCODER_ACTION_V3_ENABLE_OUTPUT 0x01
  1431. #define EXTERNAL_ENCODER_ACTION_V3_ENCODER_INIT 0x07
  1432. #define EXTERNAL_ENCODER_ACTION_V3_ENCODER_SETUP 0x0f
  1433. #define EXTERNAL_ENCODER_ACTION_V3_ENCODER_BLANKING_OFF 0x10
  1434. #define EXTERNAL_ENCODER_ACTION_V3_ENCODER_BLANKING 0x11
  1435. #define EXTERNAL_ENCODER_ACTION_V3_DACLOAD_DETECTION 0x12
  1436. #define EXTERNAL_ENCODER_ACTION_V3_DDC_SETUP 0x14
  1437. // ucConfig
  1438. #define EXTERNAL_ENCODER_CONFIG_V3_DPLINKRATE_MASK 0x03
  1439. #define EXTERNAL_ENCODER_CONFIG_V3_DPLINKRATE_1_62GHZ 0x00
  1440. #define EXTERNAL_ENCODER_CONFIG_V3_DPLINKRATE_2_70GHZ 0x01
  1441. #define EXTERNAL_ENCODER_CONFIG_V3_DPLINKRATE_5_40GHZ 0x02
  1442. #define EXTERNAL_ENCODER_CONFIG_V3_ENCODER_SEL_MAKS 0x70
  1443. #define EXTERNAL_ENCODER_CONFIG_V3_ENCODER1 0x00
  1444. #define EXTERNAL_ENCODER_CONFIG_V3_ENCODER2 0x10
  1445. #define EXTERNAL_ENCODER_CONFIG_V3_ENCODER3 0x20
  1446. typedef struct _EXTERNAL_ENCODER_CONTROL_PS_ALLOCATION_V3
  1447. {
  1448. EXTERNAL_ENCODER_CONTROL_PARAMETERS_V3 sExtEncoder;
  1449. ULONG ulReserved[2];
  1450. }EXTERNAL_ENCODER_CONTROL_PS_ALLOCATION_V3;
  1451. /****************************************************************************/
  1452. // Structures used by DAC1OuputControlTable
  1453. // DAC2OuputControlTable
  1454. // LVTMAOutputControlTable (Before DEC30)
  1455. // TMDSAOutputControlTable (Before DEC30)
  1456. /****************************************************************************/
  1457. typedef struct _DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
  1458. {
  1459. UCHAR ucAction; // Possible input:ATOM_ENABLE||ATOMDISABLE
  1460. // When the display is LCD, in addition to above:
  1461. // ATOM_LCD_BLOFF|| ATOM_LCD_BLON ||ATOM_LCD_BL_BRIGHTNESS_CONTROL||ATOM_LCD_SELFTEST_START||
  1462. // ATOM_LCD_SELFTEST_STOP
  1463. UCHAR aucPadding[3]; // padding to DWORD aligned
  1464. }DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS;
  1465. #define DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
  1466. #define CRT1_OUTPUT_CONTROL_PARAMETERS DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
  1467. #define CRT1_OUTPUT_CONTROL_PS_ALLOCATION DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION
  1468. #define CRT2_OUTPUT_CONTROL_PARAMETERS DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
  1469. #define CRT2_OUTPUT_CONTROL_PS_ALLOCATION DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION
  1470. #define CV1_OUTPUT_CONTROL_PARAMETERS DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
  1471. #define CV1_OUTPUT_CONTROL_PS_ALLOCATION DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION
  1472. #define TV1_OUTPUT_CONTROL_PARAMETERS DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
  1473. #define TV1_OUTPUT_CONTROL_PS_ALLOCATION DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION
  1474. #define DFP1_OUTPUT_CONTROL_PARAMETERS DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
  1475. #define DFP1_OUTPUT_CONTROL_PS_ALLOCATION DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION
  1476. #define DFP2_OUTPUT_CONTROL_PARAMETERS DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
  1477. #define DFP2_OUTPUT_CONTROL_PS_ALLOCATION DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION
  1478. #define LCD1_OUTPUT_CONTROL_PARAMETERS DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
  1479. #define LCD1_OUTPUT_CONTROL_PS_ALLOCATION DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION
  1480. #define DVO_OUTPUT_CONTROL_PARAMETERS DISPLAY_DEVICE_OUTPUT_CONTROL_PARAMETERS
  1481. #define DVO_OUTPUT_CONTROL_PS_ALLOCATION DIG_TRANSMITTER_CONTROL_PS_ALLOCATION
  1482. #define DVO_OUTPUT_CONTROL_PARAMETERS_V3 DIG_TRANSMITTER_CONTROL_PARAMETERS
  1483. typedef struct _LVTMA_OUTPUT_CONTROL_PARAMETERS_V2
  1484. {
  1485. // Possible value of ucAction
  1486. // ATOM_TRANSMITTER_ACTION_LCD_BLON
  1487. // ATOM_TRANSMITTER_ACTION_LCD_BLOFF
  1488. // ATOM_TRANSMITTER_ACTION_BL_BRIGHTNESS_CONTROL
  1489. // ATOM_TRANSMITTER_ACTION_POWER_ON
  1490. // ATOM_TRANSMITTER_ACTION_POWER_OFF
  1491. UCHAR ucAction;
  1492. UCHAR ucBriLevel;
  1493. USHORT usPwmFreq; // in unit of Hz, 200 means 200Hz
  1494. }LVTMA_OUTPUT_CONTROL_PARAMETERS_V2;
  1495. /****************************************************************************/
  1496. // Structures used by BlankCRTCTable
  1497. /****************************************************************************/
  1498. typedef struct _BLANK_CRTC_PARAMETERS
  1499. {
  1500. UCHAR ucCRTC; // ATOM_CRTC1 or ATOM_CRTC2
  1501. UCHAR ucBlanking; // ATOM_BLANKING or ATOM_BLANKINGOFF
  1502. USHORT usBlackColorRCr;
  1503. USHORT usBlackColorGY;
  1504. USHORT usBlackColorBCb;
  1505. }BLANK_CRTC_PARAMETERS;
  1506. #define BLANK_CRTC_PS_ALLOCATION BLANK_CRTC_PARAMETERS
  1507. /****************************************************************************/
  1508. // Structures used by EnableCRTCTable
  1509. // EnableCRTCMemReqTable
  1510. // UpdateCRTC_DoubleBufferRegistersTable
  1511. /****************************************************************************/
  1512. typedef struct _ENABLE_CRTC_PARAMETERS
  1513. {
  1514. UCHAR ucCRTC; // ATOM_CRTC1 or ATOM_CRTC2
  1515. UCHAR ucEnable; // ATOM_ENABLE or ATOM_DISABLE
  1516. UCHAR ucPadding[2];
  1517. }ENABLE_CRTC_PARAMETERS;
  1518. #define ENABLE_CRTC_PS_ALLOCATION ENABLE_CRTC_PARAMETERS
  1519. /****************************************************************************/
  1520. // Structures used by SetCRTC_OverScanTable
  1521. /****************************************************************************/
  1522. typedef struct _SET_CRTC_OVERSCAN_PARAMETERS
  1523. {
  1524. USHORT usOverscanRight; // right
  1525. USHORT usOverscanLeft; // left
  1526. USHORT usOverscanBottom; // bottom
  1527. USHORT usOverscanTop; // top
  1528. UCHAR ucCRTC; // ATOM_CRTC1 or ATOM_CRTC2
  1529. UCHAR ucPadding[3];
  1530. }SET_CRTC_OVERSCAN_PARAMETERS;
  1531. #define SET_CRTC_OVERSCAN_PS_ALLOCATION SET_CRTC_OVERSCAN_PARAMETERS
  1532. /****************************************************************************/
  1533. // Structures used by SetCRTC_ReplicationTable
  1534. /****************************************************************************/
  1535. typedef struct _SET_CRTC_REPLICATION_PARAMETERS
  1536. {
  1537. UCHAR ucH_Replication; // horizontal replication
  1538. UCHAR ucV_Replication; // vertical replication
  1539. UCHAR usCRTC; // ATOM_CRTC1 or ATOM_CRTC2
  1540. UCHAR ucPadding;
  1541. }SET_CRTC_REPLICATION_PARAMETERS;
  1542. #define SET_CRTC_REPLICATION_PS_ALLOCATION SET_CRTC_REPLICATION_PARAMETERS
  1543. /****************************************************************************/
  1544. // Structures used by SelectCRTC_SourceTable
  1545. /****************************************************************************/
  1546. typedef struct _SELECT_CRTC_SOURCE_PARAMETERS
  1547. {
  1548. UCHAR ucCRTC; // ATOM_CRTC1 or ATOM_CRTC2
  1549. UCHAR ucDevice; // ATOM_DEVICE_CRT1|ATOM_DEVICE_CRT2|....
  1550. UCHAR ucPadding[2];
  1551. }SELECT_CRTC_SOURCE_PARAMETERS;
  1552. #define SELECT_CRTC_SOURCE_PS_ALLOCATION SELECT_CRTC_SOURCE_PARAMETERS
  1553. typedef struct _SELECT_CRTC_SOURCE_PARAMETERS_V2
  1554. {
  1555. UCHAR ucCRTC; // ATOM_CRTC1 or ATOM_CRTC2
  1556. UCHAR ucEncoderID; // DAC1/DAC2/TVOUT/DIG1/DIG2/DVO
  1557. UCHAR ucEncodeMode; // Encoding mode, only valid when using DIG1/DIG2/DVO
  1558. UCHAR ucPadding;
  1559. }SELECT_CRTC_SOURCE_PARAMETERS_V2;
  1560. //ucEncoderID
  1561. //#define ASIC_INT_DAC1_ENCODER_ID 0x00
  1562. //#define ASIC_INT_TV_ENCODER_ID 0x02
  1563. //#define ASIC_INT_DIG1_ENCODER_ID 0x03
  1564. //#define ASIC_INT_DAC2_ENCODER_ID 0x04
  1565. //#define ASIC_EXT_TV_ENCODER_ID 0x06
  1566. //#define ASIC_INT_DVO_ENCODER_ID 0x07
  1567. //#define ASIC_INT_DIG2_ENCODER_ID 0x09
  1568. //#define ASIC_EXT_DIG_ENCODER_ID 0x05
  1569. //ucEncodeMode
  1570. //#define ATOM_ENCODER_MODE_DP 0
  1571. //#define ATOM_ENCODER_MODE_LVDS 1
  1572. //#define ATOM_ENCODER_MODE_DVI 2
  1573. //#define ATOM_ENCODER_MODE_HDMI 3
  1574. //#define ATOM_ENCODER_MODE_SDVO 4
  1575. //#define ATOM_ENCODER_MODE_TV 13
  1576. //#define ATOM_ENCODER_MODE_CV 14
  1577. //#define ATOM_ENCODER_MODE_CRT 15
  1578. typedef struct _SELECT_CRTC_SOURCE_PARAMETERS_V3
  1579. {
  1580. UCHAR ucCRTC; // ATOM_CRTC1 or ATOM_CRTC2
  1581. UCHAR ucEncoderID; // DAC1/DAC2/TVOUT/DIG1/DIG2/DVO
  1582. UCHAR ucEncodeMode; // Encoding mode, only valid when using DIG1/DIG2/DVO
  1583. UCHAR ucDstBpc; // PANEL_6/8/10/12BIT_PER_COLOR
  1584. }SELECT_CRTC_SOURCE_PARAMETERS_V3;
  1585. /****************************************************************************/
  1586. // Structures used by SetPixelClockTable
  1587. // GetPixelClockTable
  1588. /****************************************************************************/
  1589. //Major revision=1., Minor revision=1
  1590. typedef struct _PIXEL_CLOCK_PARAMETERS
  1591. {
  1592. USHORT usPixelClock; // in 10kHz unit; for bios convenient = (RefClk*FB_Div)/(Ref_Div*Post_Div)
  1593. // 0 means disable PPLL
  1594. USHORT usRefDiv; // Reference divider
  1595. USHORT usFbDiv; // feedback divider
  1596. UCHAR ucPostDiv; // post divider
  1597. UCHAR ucFracFbDiv; // fractional feedback divider
  1598. UCHAR ucPpll; // ATOM_PPLL1 or ATOM_PPL2
  1599. UCHAR ucRefDivSrc; // ATOM_PJITTER or ATO_NONPJITTER
  1600. UCHAR ucCRTC; // Which CRTC uses this Ppll
  1601. UCHAR ucPadding;
  1602. }PIXEL_CLOCK_PARAMETERS;
  1603. //Major revision=1., Minor revision=2, add ucMiscIfno
  1604. //ucMiscInfo:
  1605. #define MISC_FORCE_REPROG_PIXEL_CLOCK 0x1
  1606. #define MISC_DEVICE_INDEX_MASK 0xF0
  1607. #define MISC_DEVICE_INDEX_SHIFT 4
  1608. typedef struct _PIXEL_CLOCK_PARAMETERS_V2
  1609. {
  1610. USHORT usPixelClock; // in 10kHz unit; for bios convenient = (RefClk*FB_Div)/(Ref_Div*Post_Div)
  1611. // 0 means disable PPLL
  1612. USHORT usRefDiv; // Reference divider
  1613. USHORT usFbDiv; // feedback divider
  1614. UCHAR ucPostDiv; // post divider
  1615. UCHAR ucFracFbDiv; // fractional feedback divider
  1616. UCHAR ucPpll; // ATOM_PPLL1 or ATOM_PPL2
  1617. UCHAR ucRefDivSrc; // ATOM_PJITTER or ATO_NONPJITTER
  1618. UCHAR ucCRTC; // Which CRTC uses this Ppll
  1619. UCHAR ucMiscInfo; // Different bits for different purpose, bit [7:4] as device index, bit[0]=Force prog
  1620. }PIXEL_CLOCK_PARAMETERS_V2;
  1621. //Major revision=1., Minor revision=3, structure/definition change
  1622. //ucEncoderMode:
  1623. //ATOM_ENCODER_MODE_DP
  1624. //ATOM_ENOCDER_MODE_LVDS
  1625. //ATOM_ENOCDER_MODE_DVI
  1626. //ATOM_ENOCDER_MODE_HDMI
  1627. //ATOM_ENOCDER_MODE_SDVO
  1628. //ATOM_ENCODER_MODE_TV 13
  1629. //ATOM_ENCODER_MODE_CV 14
  1630. //ATOM_ENCODER_MODE_CRT 15
  1631. //ucDVOConfig
  1632. //#define DVO_ENCODER_CONFIG_RATE_SEL 0x01
  1633. //#define DVO_ENCODER_CONFIG_DDR_SPEED 0x00
  1634. //#define DVO_ENCODER_CONFIG_SDR_SPEED 0x01
  1635. //#define DVO_ENCODER_CONFIG_OUTPUT_SEL 0x0c
  1636. //#define DVO_ENCODER_CONFIG_LOW12BIT 0x00
  1637. //#define DVO_ENCODER_CONFIG_UPPER12BIT 0x04
  1638. //#define DVO_ENCODER_CONFIG_24BIT 0x08
  1639. //ucMiscInfo: also changed, see below
  1640. #define PIXEL_CLOCK_MISC_FORCE_PROG_PPLL 0x01
  1641. #define PIXEL_CLOCK_MISC_VGA_MODE 0x02
  1642. #define PIXEL_CLOCK_MISC_CRTC_SEL_MASK 0x04
  1643. #define PIXEL_CLOCK_MISC_CRTC_SEL_CRTC1 0x00
  1644. #define PIXEL_CLOCK_MISC_CRTC_SEL_CRTC2 0x04
  1645. #define PIXEL_CLOCK_MISC_USE_ENGINE_FOR_DISPCLK 0x08
  1646. #define PIXEL_CLOCK_MISC_REF_DIV_SRC 0x10
  1647. // V1.4 for RoadRunner
  1648. #define PIXEL_CLOCK_V4_MISC_SS_ENABLE 0x10
  1649. #define PIXEL_CLOCK_V4_MISC_COHERENT_MODE 0x20
  1650. typedef struct _PIXEL_CLOCK_PARAMETERS_V3
  1651. {
  1652. USHORT usPixelClock; // in 10kHz unit; for bios convenient = (RefClk*FB_Div)/(Ref_Div*Post_Div)
  1653. // 0 means disable PPLL. For VGA PPLL,make sure this value is not 0.
  1654. USHORT usRefDiv; // Reference divider
  1655. USHORT usFbDiv; // feedback divider
  1656. UCHAR ucPostDiv; // post divider
  1657. UCHAR ucFracFbDiv; // fractional feedback divider
  1658. UCHAR ucPpll; // ATOM_PPLL1 or ATOM_PPL2
  1659. UCHAR ucTransmitterId; // graphic encoder id defined in objectId.h
  1660. union
  1661. {
  1662. UCHAR ucEncoderMode; // encoder type defined as ATOM_ENCODER_MODE_DP/DVI/HDMI/
  1663. UCHAR ucDVOConfig; // when use DVO, need to know SDR/DDR, 12bit or 24bit
  1664. };
  1665. UCHAR ucMiscInfo; // bit[0]=Force program, bit[1]= set pclk for VGA, b[2]= CRTC sel
  1666. // bit[3]=0:use PPLL for dispclk source, =1: use engine clock for dispclock source
  1667. // bit[4]=0:use XTALIN as the source of reference divider,=1 use the pre-defined clock as the source of reference divider
  1668. }PIXEL_CLOCK_PARAMETERS_V3;
  1669. #define PIXEL_CLOCK_PARAMETERS_LAST PIXEL_CLOCK_PARAMETERS_V2
  1670. #define GET_PIXEL_CLOCK_PS_ALLOCATION PIXEL_CLOCK_PARAMETERS_LAST
  1671. typedef struct _PIXEL_CLOCK_PARAMETERS_V5
  1672. {
  1673. UCHAR ucCRTC; // ATOM_CRTC1~6, indicate the CRTC controller to
  1674. // drive the pixel clock. not used for DCPLL case.
  1675. union{
  1676. UCHAR ucReserved;
  1677. UCHAR ucFracFbDiv; // [gphan] temporary to prevent build problem. remove it after driver code is changed.
  1678. };
  1679. USHORT usPixelClock; // target the pixel clock to drive the CRTC timing
  1680. // 0 means disable PPLL/DCPLL.
  1681. USHORT usFbDiv; // feedback divider integer part.
  1682. UCHAR ucPostDiv; // post divider.
  1683. UCHAR ucRefDiv; // Reference divider
  1684. UCHAR ucPpll; // ATOM_PPLL1/ATOM_PPLL2/ATOM_DCPLL
  1685. UCHAR ucTransmitterID; // ASIC encoder id defined in objectId.h,
  1686. // indicate which graphic encoder will be used.
  1687. UCHAR ucEncoderMode; // Encoder mode:
  1688. UCHAR ucMiscInfo; // bit[0]= Force program PPLL
  1689. // bit[1]= when VGA timing is used.
  1690. // bit[3:2]= HDMI panel bit depth: =0: 24bpp =1:30bpp, =2:32bpp
  1691. // bit[4]= RefClock source for PPLL.
  1692. // =0: XTLAIN( default mode )
  1693. // =1: other external clock source, which is pre-defined
  1694. // by VBIOS depend on the feature required.
  1695. // bit[7:5]: reserved.
  1696. ULONG ulFbDivDecFrac; // 20 bit feedback divider decimal fraction part, range from 1~999999 ( 0.000001 to 0.999999 )
  1697. }PIXEL_CLOCK_PARAMETERS_V5;
  1698. #define PIXEL_CLOCK_V5_MISC_FORCE_PROG_PPLL 0x01
  1699. #define PIXEL_CLOCK_V5_MISC_VGA_MODE 0x02
  1700. #define PIXEL_CLOCK_V5_MISC_HDMI_BPP_MASK 0x0c
  1701. #define PIXEL_CLOCK_V5_MISC_HDMI_24BPP 0x00
  1702. #define PIXEL_CLOCK_V5_MISC_HDMI_30BPP 0x04
  1703. #define PIXEL_CLOCK_V5_MISC_HDMI_32BPP 0x08
  1704. #define PIXEL_CLOCK_V5_MISC_REF_DIV_SRC 0x10
  1705. typedef struct _CRTC_PIXEL_CLOCK_FREQ
  1706. {
  1707. #if ATOM_BIG_ENDIAN
  1708. ULONG ucCRTC:8; // ATOM_CRTC1~6, indicate the CRTC controller to
  1709. // drive the pixel clock. not used for DCPLL case.
  1710. ULONG ulPixelClock:24; // target the pixel clock to drive the CRTC timing.
  1711. // 0 means disable PPLL/DCPLL. Expanded to 24 bits comparing to previous version.
  1712. #else
  1713. ULONG ulPixelClock:24; // target the pixel clock to drive the CRTC timing.
  1714. // 0 means disable PPLL/DCPLL. Expanded to 24 bits comparing to previous version.
  1715. ULONG ucCRTC:8; // ATOM_CRTC1~6, indicate the CRTC controller to
  1716. // drive the pixel clock. not used for DCPLL case.
  1717. #endif
  1718. }CRTC_PIXEL_CLOCK_FREQ;
  1719. typedef struct _PIXEL_CLOCK_PARAMETERS_V6
  1720. {
  1721. union{
  1722. CRTC_PIXEL_CLOCK_FREQ ulCrtcPclkFreq; // pixel clock and CRTC id frequency
  1723. ULONG ulDispEngClkFreq; // dispclk frequency
  1724. };
  1725. USHORT usFbDiv; // feedback divider integer part.
  1726. UCHAR ucPostDiv; // post divider.
  1727. UCHAR ucRefDiv; // Reference divider
  1728. UCHAR ucPpll; // ATOM_PPLL1/ATOM_PPLL2/ATOM_DCPLL
  1729. UCHAR ucTransmitterID; // ASIC encoder id defined in objectId.h,
  1730. // indicate which graphic encoder will be used.
  1731. UCHAR ucEncoderMode; // Encoder mode:
  1732. UCHAR ucMiscInfo; // bit[0]= Force program PPLL
  1733. // bit[1]= when VGA timing is used.
  1734. // bit[3:2]= HDMI panel bit depth: =0: 24bpp =1:30bpp, =2:32bpp
  1735. // bit[4]= RefClock source for PPLL.
  1736. // =0: XTLAIN( default mode )
  1737. // =1: other external clock source, which is pre-defined
  1738. // by VBIOS depend on the feature required.
  1739. // bit[7:5]: reserved.
  1740. ULONG ulFbDivDecFrac; // 20 bit feedback divider decimal fraction part, range from 1~999999 ( 0.000001 to 0.999999 )
  1741. }PIXEL_CLOCK_PARAMETERS_V6;
  1742. #define PIXEL_CLOCK_V6_MISC_FORCE_PROG_PPLL 0x01
  1743. #define PIXEL_CLOCK_V6_MISC_VGA_MODE 0x02
  1744. #define PIXEL_CLOCK_V6_MISC_HDMI_BPP_MASK 0x0c
  1745. #define PIXEL_CLOCK_V6_MISC_HDMI_24BPP 0x00
  1746. #define PIXEL_CLOCK_V6_MISC_HDMI_36BPP 0x04
  1747. #define PIXEL_CLOCK_V6_MISC_HDMI_36BPP_V6 0x08 //for V6, the correct defintion for 36bpp should be 2 for 36bpp(2:1)
  1748. #define PIXEL_CLOCK_V6_MISC_HDMI_30BPP 0x08
  1749. #define PIXEL_CLOCK_V6_MISC_HDMI_30BPP_V6 0x04 //for V6, the correct defintion for 30bpp should be 1 for 36bpp(5:4)
  1750. #define PIXEL_CLOCK_V6_MISC_HDMI_48BPP 0x0c
  1751. #define PIXEL_CLOCK_V6_MISC_REF_DIV_SRC 0x10
  1752. #define PIXEL_CLOCK_V6_MISC_GEN_DPREFCLK 0x40
  1753. #define PIXEL_CLOCK_V6_MISC_DPREFCLK_BYPASS 0x40
  1754. typedef struct _GET_DISP_PLL_STATUS_INPUT_PARAMETERS_V2
  1755. {
  1756. PIXEL_CLOCK_PARAMETERS_V3 sDispClkInput;
  1757. }GET_DISP_PLL_STATUS_INPUT_PARAMETERS_V2;
  1758. typedef struct _GET_DISP_PLL_STATUS_OUTPUT_PARAMETERS_V2
  1759. {
  1760. UCHAR ucStatus;
  1761. UCHAR ucRefDivSrc; // =1: reference clock source from XTALIN, =0: source from PCIE ref clock
  1762. UCHAR ucReserved[2];
  1763. }GET_DISP_PLL_STATUS_OUTPUT_PARAMETERS_V2;
  1764. typedef struct _GET_DISP_PLL_STATUS_INPUT_PARAMETERS_V3
  1765. {
  1766. PIXEL_CLOCK_PARAMETERS_V5 sDispClkInput;
  1767. }GET_DISP_PLL_STATUS_INPUT_PARAMETERS_V3;
  1768. typedef struct _PIXEL_CLOCK_PARAMETERS_V7
  1769. {
  1770. ULONG ulPixelClock; // target the pixel clock to drive the CRTC timing in unit of 100Hz.
  1771. UCHAR ucPpll; // ATOM_PHY_PLL0/ATOM_PHY_PLL1/ATOM_PPLL0
  1772. UCHAR ucTransmitterID; // ASIC encoder id defined in objectId.h,
  1773. // indicate which graphic encoder will be used.
  1774. UCHAR ucEncoderMode; // Encoder mode:
  1775. UCHAR ucMiscInfo; // bit[0]= Force program PLL for pixclk
  1776. // bit[1]= Force program PHY PLL only ( internally used by VBIOS only in DP case which PHYPLL is programmed for SYMCLK, not Pixclk )
  1777. // bit[5:4]= RefClock source for PPLL.
  1778. // =0: XTLAIN( default mode )
  1779. // =1: pcie
  1780. // =2: GENLK
  1781. UCHAR ucCRTC; // ATOM_CRTC1~6, indicate the CRTC controller to
  1782. UCHAR ucDeepColorRatio; // HDMI panel bit depth: =0: 24bpp =1:30bpp, =2:36bpp
  1783. UCHAR ucReserved[2];
  1784. ULONG ulReserved;
  1785. }PIXEL_CLOCK_PARAMETERS_V7;
  1786. //ucMiscInfo
  1787. #define PIXEL_CLOCK_V7_MISC_FORCE_PROG_PPLL 0x01
  1788. #define PIXEL_CLOCK_V7_MISC_PROG_PHYPLL 0x02
  1789. #define PIXEL_CLOCK_V7_MISC_YUV420_MODE 0x04
  1790. #define PIXEL_CLOCK_V7_MISC_DVI_DUALLINK_EN 0x08
  1791. #define PIXEL_CLOCK_V7_MISC_REF_DIV_SRC 0x30
  1792. #define PIXEL_CLOCK_V7_MISC_REF_DIV_SRC_XTALIN 0x00
  1793. #define PIXEL_CLOCK_V7_MISC_REF_DIV_SRC_PCIE 0x10
  1794. #define PIXEL_CLOCK_V7_MISC_REF_DIV_SRC_GENLK 0x20
  1795. //ucDeepColorRatio
  1796. #define PIXEL_CLOCK_V7_DEEPCOLOR_RATIO_DIS 0x00 //00 - DCCG_DEEP_COLOR_DTO_DISABLE: Disable Deep Color DTO
  1797. #define PIXEL_CLOCK_V7_DEEPCOLOR_RATIO_5_4 0x01 //01 - DCCG_DEEP_COLOR_DTO_5_4_RATIO: Set Deep Color DTO to 5:4
  1798. #define PIXEL_CLOCK_V7_DEEPCOLOR_RATIO_3_2 0x02 //02 - DCCG_DEEP_COLOR_DTO_3_2_RATIO: Set Deep Color DTO to 3:2
  1799. #define PIXEL_CLOCK_V7_DEEPCOLOR_RATIO_2_1 0x03 //03 - DCCG_DEEP_COLOR_DTO_2_1_RATIO: Set Deep Color DTO to 2:1
  1800. // SetDCEClockTable input parameter for DCE11.1
  1801. typedef struct _SET_DCE_CLOCK_PARAMETERS_V1_1
  1802. {
  1803. ULONG ulDISPClkFreq; // target DISPCLK frquency in unit of 10kHz, return real DISPCLK frequency. when ucFlag[1]=1, in unit of 100Hz.
  1804. UCHAR ucFlag; // bit0=1: DPREFCLK bypass DFS bit0=0: DPREFCLK not bypass DFS
  1805. UCHAR ucCrtc; // use when enable DCCG pixel clock ucFlag[1]=1
  1806. UCHAR ucPpllId; // use when enable DCCG pixel clock ucFlag[1]=1
  1807. UCHAR ucDeepColorRatio; // use when enable DCCG pixel clock ucFlag[1]=1
  1808. }SET_DCE_CLOCK_PARAMETERS_V1_1;
  1809. typedef struct _SET_DCE_CLOCK_PS_ALLOCATION_V1_1
  1810. {
  1811. SET_DCE_CLOCK_PARAMETERS_V1_1 asParam;
  1812. ULONG ulReserved[2];
  1813. }SET_DCE_CLOCK_PS_ALLOCATION_V1_1;
  1814. //SET_DCE_CLOCK_PARAMETERS_V1_1.ucFlag
  1815. #define SET_DCE_CLOCK_FLAG_GEN_DPREFCLK 0x01
  1816. #define SET_DCE_CLOCK_FLAG_DPREFCLK_BYPASS 0x01
  1817. #define SET_DCE_CLOCK_FLAG_ENABLE_PIXCLK 0x02
  1818. // SetDCEClockTable input parameter for DCE11.2( POLARIS10 and POLARIS11 ) and above
  1819. typedef struct _SET_DCE_CLOCK_PARAMETERS_V2_1
  1820. {
  1821. ULONG ulDCEClkFreq; // target DCE frequency in unit of 10KHZ, return real DISPCLK/DPREFCLK frequency.
  1822. UCHAR ucDCEClkType; // =0: DISPCLK =1: DPREFCLK =2: PIXCLK
  1823. UCHAR ucDCEClkSrc; // ATOM_PLL0 or ATOM_GCK_DFS or ATOM_FCH_CLK or ATOM_COMBOPHY_PLLx
  1824. UCHAR ucDCEClkFlag; // Bit [1:0] = PPLL ref clock source ( when ucDCEClkSrc= ATOM_PPLL0 )
  1825. UCHAR ucCRTC; // ucDisp Pipe Id, ATOM_CRTC0/1/2/..., use only when ucDCEClkType = PIXCLK
  1826. }SET_DCE_CLOCK_PARAMETERS_V2_1;
  1827. //ucDCEClkType
  1828. #define DCE_CLOCK_TYPE_DISPCLK 0
  1829. #define DCE_CLOCK_TYPE_DPREFCLK 1
  1830. #define DCE_CLOCK_TYPE_PIXELCLK 2 // used by VBIOS internally, called by SetPixelClockTable
  1831. //ucDCEClkFlag when ucDCEClkType == DPREFCLK
  1832. #define DCE_CLOCK_FLAG_PLL_REFCLK_SRC_MASK 0x03
  1833. #define DCE_CLOCK_FLAG_PLL_REFCLK_SRC_GENERICA 0x00
  1834. #define DCE_CLOCK_FLAG_PLL_REFCLK_SRC_GENLK 0x01
  1835. #define DCE_CLOCK_FLAG_PLL_REFCLK_SRC_PCIE 0x02
  1836. #define DCE_CLOCK_FLAG_PLL_REFCLK_SRC_XTALIN 0x03
  1837. //ucDCEClkFlag when ucDCEClkType == PIXCLK
  1838. #define DCE_CLOCK_FLAG_PCLK_DEEPCOLOR_RATIO_MASK 0x03
  1839. #define DCE_CLOCK_FLAG_PCLK_DEEPCOLOR_RATIO_DIS 0x00 //00 - DCCG_DEEP_COLOR_DTO_DISABLE: Disable Deep Color DTO
  1840. #define DCE_CLOCK_FLAG_PCLK_DEEPCOLOR_RATIO_5_4 0x01 //01 - DCCG_DEEP_COLOR_DTO_5_4_RATIO: Set Deep Color DTO to 5:4
  1841. #define DCE_CLOCK_FLAG_PCLK_DEEPCOLOR_RATIO_3_2 0x02 //02 - DCCG_DEEP_COLOR_DTO_3_2_RATIO: Set Deep Color DTO to 3:2
  1842. #define DCE_CLOCK_FLAG_PCLK_DEEPCOLOR_RATIO_2_1 0x03 //03 - DCCG_DEEP_COLOR_DTO_2_1_RATIO: Set Deep Color DTO to 2:1
  1843. #define DCE_CLOCK_FLAG_PIXCLK_YUV420_MODE 0x04
  1844. typedef struct _SET_DCE_CLOCK_PS_ALLOCATION_V2_1
  1845. {
  1846. SET_DCE_CLOCK_PARAMETERS_V2_1 asParam;
  1847. ULONG ulReserved[2];
  1848. }SET_DCE_CLOCK_PS_ALLOCATION_V2_1;
  1849. /****************************************************************************/
  1850. // Structures used by AdjustDisplayPllTable
  1851. /****************************************************************************/
  1852. typedef struct _ADJUST_DISPLAY_PLL_PARAMETERS
  1853. {
  1854. USHORT usPixelClock;
  1855. UCHAR ucTransmitterID;
  1856. UCHAR ucEncodeMode;
  1857. union
  1858. {
  1859. UCHAR ucDVOConfig; //if DVO, need passing link rate and output 12bitlow or 24bit
  1860. UCHAR ucConfig; //if none DVO, not defined yet
  1861. };
  1862. UCHAR ucReserved[3];
  1863. }ADJUST_DISPLAY_PLL_PARAMETERS;
  1864. #define ADJUST_DISPLAY_CONFIG_SS_ENABLE 0x10
  1865. #define ADJUST_DISPLAY_PLL_PS_ALLOCATION ADJUST_DISPLAY_PLL_PARAMETERS
  1866. typedef struct _ADJUST_DISPLAY_PLL_INPUT_PARAMETERS_V3
  1867. {
  1868. USHORT usPixelClock; // target pixel clock
  1869. UCHAR ucTransmitterID; // GPU transmitter id defined in objectid.h
  1870. UCHAR ucEncodeMode; // encoder mode: CRT, LVDS, DP, TMDS or HDMI
  1871. UCHAR ucDispPllConfig; // display pll configure parameter defined as following DISPPLL_CONFIG_XXXX
  1872. UCHAR ucExtTransmitterID; // external encoder id.
  1873. UCHAR ucReserved[2];
  1874. }ADJUST_DISPLAY_PLL_INPUT_PARAMETERS_V3;
  1875. // usDispPllConfig v1.2 for RoadRunner
  1876. #define DISPPLL_CONFIG_DVO_RATE_SEL 0x0001 // need only when ucTransmitterID = DVO
  1877. #define DISPPLL_CONFIG_DVO_DDR_SPEED 0x0000 // need only when ucTransmitterID = DVO
  1878. #define DISPPLL_CONFIG_DVO_SDR_SPEED 0x0001 // need only when ucTransmitterID = DVO
  1879. #define DISPPLL_CONFIG_DVO_OUTPUT_SEL 0x000c // need only when ucTransmitterID = DVO
  1880. #define DISPPLL_CONFIG_DVO_LOW12BIT 0x0000 // need only when ucTransmitterID = DVO
  1881. #define DISPPLL_CONFIG_DVO_UPPER12BIT 0x0004 // need only when ucTransmitterID = DVO
  1882. #define DISPPLL_CONFIG_DVO_24BIT 0x0008 // need only when ucTransmitterID = DVO
  1883. #define DISPPLL_CONFIG_SS_ENABLE 0x0010 // Only used when ucEncoderMode = DP or LVDS
  1884. #define DISPPLL_CONFIG_COHERENT_MODE 0x0020 // Only used when ucEncoderMode = TMDS or HDMI
  1885. #define DISPPLL_CONFIG_DUAL_LINK 0x0040 // Only used when ucEncoderMode = TMDS or LVDS
  1886. typedef struct _ADJUST_DISPLAY_PLL_OUTPUT_PARAMETERS_V3
  1887. {
  1888. ULONG ulDispPllFreq; // return display PPLL freq which is used to generate the pixclock, and related idclk, symclk etc
  1889. 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 )
  1890. UCHAR ucPostDiv; // if it is none-zero, it is used to be calculated the other ppll parameter fb_divider
  1891. UCHAR ucReserved[2];
  1892. }ADJUST_DISPLAY_PLL_OUTPUT_PARAMETERS_V3;
  1893. typedef struct _ADJUST_DISPLAY_PLL_PS_ALLOCATION_V3
  1894. {
  1895. union
  1896. {
  1897. ADJUST_DISPLAY_PLL_INPUT_PARAMETERS_V3 sInput;
  1898. ADJUST_DISPLAY_PLL_OUTPUT_PARAMETERS_V3 sOutput;
  1899. };
  1900. } ADJUST_DISPLAY_PLL_PS_ALLOCATION_V3;
  1901. /****************************************************************************/
  1902. // Structures used by EnableYUVTable
  1903. /****************************************************************************/
  1904. typedef struct _ENABLE_YUV_PARAMETERS
  1905. {
  1906. UCHAR ucEnable; // ATOM_ENABLE:Enable YUV or ATOM_DISABLE:Disable YUV (RGB)
  1907. UCHAR ucCRTC; // Which CRTC needs this YUV or RGB format
  1908. UCHAR ucPadding[2];
  1909. }ENABLE_YUV_PARAMETERS;
  1910. #define ENABLE_YUV_PS_ALLOCATION ENABLE_YUV_PARAMETERS
  1911. /****************************************************************************/
  1912. // Structures used by GetMemoryClockTable
  1913. /****************************************************************************/
  1914. typedef struct _GET_MEMORY_CLOCK_PARAMETERS
  1915. {
  1916. ULONG ulReturnMemoryClock; // current memory speed in 10KHz unit
  1917. } GET_MEMORY_CLOCK_PARAMETERS;
  1918. #define GET_MEMORY_CLOCK_PS_ALLOCATION GET_MEMORY_CLOCK_PARAMETERS
  1919. /****************************************************************************/
  1920. // Structures used by GetEngineClockTable
  1921. /****************************************************************************/
  1922. typedef struct _GET_ENGINE_CLOCK_PARAMETERS
  1923. {
  1924. ULONG ulReturnEngineClock; // current engine speed in 10KHz unit
  1925. } GET_ENGINE_CLOCK_PARAMETERS;
  1926. #define GET_ENGINE_CLOCK_PS_ALLOCATION GET_ENGINE_CLOCK_PARAMETERS
  1927. /****************************************************************************/
  1928. // Following Structures and constant may be obsolete
  1929. /****************************************************************************/
  1930. //Maxium 8 bytes,the data read in will be placed in the parameter space.
  1931. //Read operaion successeful when the paramter space is non-zero, otherwise read operation failed
  1932. typedef struct _READ_EDID_FROM_HW_I2C_DATA_PARAMETERS
  1933. {
  1934. USHORT usPrescale; //Ratio between Engine clock and I2C clock
  1935. USHORT usVRAMAddress; //Adress in Frame Buffer where to pace raw EDID
  1936. USHORT usStatus; //When use output: lower byte EDID checksum, high byte hardware status
  1937. //WHen use input: lower byte as 'byte to read':currently limited to 128byte or 1byte
  1938. UCHAR ucSlaveAddr; //Read from which slave
  1939. UCHAR ucLineNumber; //Read from which HW assisted line
  1940. }READ_EDID_FROM_HW_I2C_DATA_PARAMETERS;
  1941. #define READ_EDID_FROM_HW_I2C_DATA_PS_ALLOCATION READ_EDID_FROM_HW_I2C_DATA_PARAMETERS
  1942. #define ATOM_WRITE_I2C_FORMAT_PSOFFSET_PSDATABYTE 0
  1943. #define ATOM_WRITE_I2C_FORMAT_PSOFFSET_PSTWODATABYTES 1
  1944. #define ATOM_WRITE_I2C_FORMAT_PSCOUNTER_PSOFFSET_IDDATABLOCK 2
  1945. #define ATOM_WRITE_I2C_FORMAT_PSCOUNTER_IDOFFSET_PLUS_IDDATABLOCK 3
  1946. #define ATOM_WRITE_I2C_FORMAT_IDCOUNTER_IDOFFSET_IDDATABLOCK 4
  1947. typedef struct _WRITE_ONE_BYTE_HW_I2C_DATA_PARAMETERS
  1948. {
  1949. USHORT usPrescale; //Ratio between Engine clock and I2C clock
  1950. USHORT usByteOffset; //Write to which byte
  1951. //Upper portion of usByteOffset is Format of data
  1952. //1bytePS+offsetPS
  1953. //2bytesPS+offsetPS
  1954. //blockID+offsetPS
  1955. //blockID+offsetID
  1956. //blockID+counterID+offsetID
  1957. UCHAR ucData; //PS data1
  1958. UCHAR ucStatus; //Status byte 1=success, 2=failure, Also is used as PS data2
  1959. UCHAR ucSlaveAddr; //Write to which slave
  1960. UCHAR ucLineNumber; //Write from which HW assisted line
  1961. }WRITE_ONE_BYTE_HW_I2C_DATA_PARAMETERS;
  1962. #define WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION WRITE_ONE_BYTE_HW_I2C_DATA_PARAMETERS
  1963. typedef struct _SET_UP_HW_I2C_DATA_PARAMETERS
  1964. {
  1965. USHORT usPrescale; //Ratio between Engine clock and I2C clock
  1966. UCHAR ucSlaveAddr; //Write to which slave
  1967. UCHAR ucLineNumber; //Write from which HW assisted line
  1968. }SET_UP_HW_I2C_DATA_PARAMETERS;
  1969. /**************************************************************************/
  1970. #define SPEED_FAN_CONTROL_PS_ALLOCATION WRITE_ONE_BYTE_HW_I2C_DATA_PARAMETERS
  1971. /****************************************************************************/
  1972. // Structures used by PowerConnectorDetectionTable
  1973. /****************************************************************************/
  1974. typedef struct _POWER_CONNECTOR_DETECTION_PARAMETERS
  1975. {
  1976. UCHAR ucPowerConnectorStatus; //Used for return value 0: detected, 1:not detected
  1977. UCHAR ucPwrBehaviorId;
  1978. USHORT usPwrBudget; //how much power currently boot to in unit of watt
  1979. }POWER_CONNECTOR_DETECTION_PARAMETERS;
  1980. typedef struct POWER_CONNECTOR_DETECTION_PS_ALLOCATION
  1981. {
  1982. UCHAR ucPowerConnectorStatus; //Used for return value 0: detected, 1:not detected
  1983. UCHAR ucReserved;
  1984. USHORT usPwrBudget; //how much power currently boot to in unit of watt
  1985. WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION sReserved;
  1986. }POWER_CONNECTOR_DETECTION_PS_ALLOCATION;
  1987. /****************************LVDS SS Command Table Definitions**********************/
  1988. /****************************************************************************/
  1989. // Structures used by EnableSpreadSpectrumOnPPLLTable
  1990. /****************************************************************************/
  1991. typedef struct _ENABLE_LVDS_SS_PARAMETERS
  1992. {
  1993. USHORT usSpreadSpectrumPercentage;
  1994. UCHAR ucSpreadSpectrumType; //Bit1=0 Down Spread,=1 Center Spread. Bit1=1 Ext. =0 Int. Others:TBD
  1995. UCHAR ucSpreadSpectrumStepSize_Delay; //bits3:2 SS_STEP_SIZE; bit 6:4 SS_DELAY
  1996. UCHAR ucEnable; //ATOM_ENABLE or ATOM_DISABLE
  1997. UCHAR ucPadding[3];
  1998. }ENABLE_LVDS_SS_PARAMETERS;
  1999. //ucTableFormatRevision=1,ucTableContentRevision=2
  2000. typedef struct _ENABLE_LVDS_SS_PARAMETERS_V2
  2001. {
  2002. USHORT usSpreadSpectrumPercentage;
  2003. UCHAR ucSpreadSpectrumType; //Bit1=0 Down Spread,=1 Center Spread. Bit1=1 Ext. =0 Int. Others:TBD
  2004. UCHAR ucSpreadSpectrumStep; //
  2005. UCHAR ucEnable; //ATOM_ENABLE or ATOM_DISABLE
  2006. UCHAR ucSpreadSpectrumDelay;
  2007. UCHAR ucSpreadSpectrumRange;
  2008. UCHAR ucPadding;
  2009. }ENABLE_LVDS_SS_PARAMETERS_V2;
  2010. //This new structure is based on ENABLE_LVDS_SS_PARAMETERS but expands to SS on PPLL, so other devices can use SS.
  2011. typedef struct _ENABLE_SPREAD_SPECTRUM_ON_PPLL
  2012. {
  2013. USHORT usSpreadSpectrumPercentage;
  2014. UCHAR ucSpreadSpectrumType; // Bit1=0 Down Spread,=1 Center Spread. Bit1=1 Ext. =0 Int. Others:TBD
  2015. UCHAR ucSpreadSpectrumStep; //
  2016. UCHAR ucEnable; // ATOM_ENABLE or ATOM_DISABLE
  2017. UCHAR ucSpreadSpectrumDelay;
  2018. UCHAR ucSpreadSpectrumRange;
  2019. UCHAR ucPpll; // ATOM_PPLL1/ATOM_PPLL2
  2020. }ENABLE_SPREAD_SPECTRUM_ON_PPLL;
  2021. typedef struct _ENABLE_SPREAD_SPECTRUM_ON_PPLL_V2
  2022. {
  2023. USHORT usSpreadSpectrumPercentage;
  2024. UCHAR ucSpreadSpectrumType; // Bit[0]: 0-Down Spread,1-Center Spread.
  2025. // Bit[1]: 1-Ext. 0-Int.
  2026. // Bit[3:2]: =0 P1PLL =1 P2PLL =2 DCPLL
  2027. // Bits[7:4] reserved
  2028. UCHAR ucEnable; // ATOM_ENABLE or ATOM_DISABLE
  2029. USHORT usSpreadSpectrumAmount; // Includes SS_AMOUNT_FBDIV[7:0] and SS_AMOUNT_NFRAC_SLIP[11:8]
  2030. USHORT usSpreadSpectrumStep; // SS_STEP_SIZE_DSFRAC
  2031. }ENABLE_SPREAD_SPECTRUM_ON_PPLL_V2;
  2032. #define ATOM_PPLL_SS_TYPE_V2_DOWN_SPREAD 0x00
  2033. #define ATOM_PPLL_SS_TYPE_V2_CENTRE_SPREAD 0x01
  2034. #define ATOM_PPLL_SS_TYPE_V2_EXT_SPREAD 0x02
  2035. #define ATOM_PPLL_SS_TYPE_V2_PPLL_SEL_MASK 0x0c
  2036. #define ATOM_PPLL_SS_TYPE_V2_P1PLL 0x00
  2037. #define ATOM_PPLL_SS_TYPE_V2_P2PLL 0x04
  2038. #define ATOM_PPLL_SS_TYPE_V2_DCPLL 0x08
  2039. #define ATOM_PPLL_SS_AMOUNT_V2_FBDIV_MASK 0x00FF
  2040. #define ATOM_PPLL_SS_AMOUNT_V2_FBDIV_SHIFT 0
  2041. #define ATOM_PPLL_SS_AMOUNT_V2_NFRAC_MASK 0x0F00
  2042. #define ATOM_PPLL_SS_AMOUNT_V2_NFRAC_SHIFT 8
  2043. // Used by DCE5.0
  2044. typedef struct _ENABLE_SPREAD_SPECTRUM_ON_PPLL_V3
  2045. {
  2046. USHORT usSpreadSpectrumAmountFrac; // SS_AMOUNT_DSFRAC New in DCE5.0
  2047. UCHAR ucSpreadSpectrumType; // Bit[0]: 0-Down Spread,1-Center Spread.
  2048. // Bit[1]: 1-Ext. 0-Int.
  2049. // Bit[3:2]: =0 P1PLL =1 P2PLL =2 DCPLL
  2050. // Bits[7:4] reserved
  2051. UCHAR ucEnable; // ATOM_ENABLE or ATOM_DISABLE
  2052. USHORT usSpreadSpectrumAmount; // Includes SS_AMOUNT_FBDIV[7:0] and SS_AMOUNT_NFRAC_SLIP[11:8]
  2053. USHORT usSpreadSpectrumStep; // SS_STEP_SIZE_DSFRAC
  2054. }ENABLE_SPREAD_SPECTRUM_ON_PPLL_V3;
  2055. #define ATOM_PPLL_SS_TYPE_V3_DOWN_SPREAD 0x00
  2056. #define ATOM_PPLL_SS_TYPE_V3_CENTRE_SPREAD 0x01
  2057. #define ATOM_PPLL_SS_TYPE_V3_EXT_SPREAD 0x02
  2058. #define ATOM_PPLL_SS_TYPE_V3_PPLL_SEL_MASK 0x0c
  2059. #define ATOM_PPLL_SS_TYPE_V3_P1PLL 0x00
  2060. #define ATOM_PPLL_SS_TYPE_V3_P2PLL 0x04
  2061. #define ATOM_PPLL_SS_TYPE_V3_DCPLL 0x08
  2062. #define ATOM_PPLL_SS_TYPE_V3_P0PLL ATOM_PPLL_SS_TYPE_V3_DCPLL
  2063. #define ATOM_PPLL_SS_AMOUNT_V3_FBDIV_MASK 0x00FF
  2064. #define ATOM_PPLL_SS_AMOUNT_V3_FBDIV_SHIFT 0
  2065. #define ATOM_PPLL_SS_AMOUNT_V3_NFRAC_MASK 0x0F00
  2066. #define ATOM_PPLL_SS_AMOUNT_V3_NFRAC_SHIFT 8
  2067. #define ENABLE_SPREAD_SPECTRUM_ON_PPLL_PS_ALLOCATION ENABLE_SPREAD_SPECTRUM_ON_PPLL
  2068. typedef struct _SET_PIXEL_CLOCK_PS_ALLOCATION
  2069. {
  2070. PIXEL_CLOCK_PARAMETERS sPCLKInput;
  2071. ENABLE_SPREAD_SPECTRUM_ON_PPLL sReserved;//Caller doesn't need to init this portion
  2072. }SET_PIXEL_CLOCK_PS_ALLOCATION;
  2073. #define ENABLE_VGA_RENDER_PS_ALLOCATION SET_PIXEL_CLOCK_PS_ALLOCATION
  2074. /****************************************************************************/
  2075. // Structures used by ###
  2076. /****************************************************************************/
  2077. typedef struct _MEMORY_TRAINING_PARAMETERS
  2078. {
  2079. ULONG ulTargetMemoryClock; //In 10Khz unit
  2080. }MEMORY_TRAINING_PARAMETERS;
  2081. #define MEMORY_TRAINING_PS_ALLOCATION MEMORY_TRAINING_PARAMETERS
  2082. typedef struct _MEMORY_TRAINING_PARAMETERS_V1_2
  2083. {
  2084. USHORT usMemTrainingMode;
  2085. USHORT usReserved;
  2086. }MEMORY_TRAINING_PARAMETERS_V1_2;
  2087. //usMemTrainingMode
  2088. #define NORMAL_MEMORY_TRAINING_MODE 0
  2089. #define ENTER_DRAM_SELFREFRESH_MODE 1
  2090. #define EXIT_DRAM_SELFRESH_MODE 2
  2091. /****************************LVDS and other encoder command table definitions **********************/
  2092. /****************************************************************************/
  2093. // Structures used by LVDSEncoderControlTable (Before DEC30)
  2094. // LVTMAEncoderControlTable (Before DEC30)
  2095. // TMDSAEncoderControlTable (Before DEC30)
  2096. /****************************************************************************/
  2097. typedef struct _LVDS_ENCODER_CONTROL_PARAMETERS
  2098. {
  2099. USHORT usPixelClock; // in 10KHz; for bios convenient
  2100. UCHAR ucMisc; // bit0=0: Enable single link
  2101. // =1: Enable dual link
  2102. // Bit1=0: 666RGB
  2103. // =1: 888RGB
  2104. UCHAR ucAction; // 0: turn off encoder
  2105. // 1: setup and turn on encoder
  2106. }LVDS_ENCODER_CONTROL_PARAMETERS;
  2107. #define LVDS_ENCODER_CONTROL_PS_ALLOCATION LVDS_ENCODER_CONTROL_PARAMETERS
  2108. #define TMDS1_ENCODER_CONTROL_PARAMETERS LVDS_ENCODER_CONTROL_PARAMETERS
  2109. #define TMDS1_ENCODER_CONTROL_PS_ALLOCATION TMDS1_ENCODER_CONTROL_PARAMETERS
  2110. #define TMDS2_ENCODER_CONTROL_PARAMETERS TMDS1_ENCODER_CONTROL_PARAMETERS
  2111. #define TMDS2_ENCODER_CONTROL_PS_ALLOCATION TMDS2_ENCODER_CONTROL_PARAMETERS
  2112. //ucTableFormatRevision=1,ucTableContentRevision=2
  2113. typedef struct _LVDS_ENCODER_CONTROL_PARAMETERS_V2
  2114. {
  2115. USHORT usPixelClock; // in 10KHz; for bios convenient
  2116. UCHAR ucMisc; // see PANEL_ENCODER_MISC_xx defintions below
  2117. UCHAR ucAction; // 0: turn off encoder
  2118. // 1: setup and turn on encoder
  2119. UCHAR ucTruncate; // bit0=0: Disable truncate
  2120. // =1: Enable truncate
  2121. // bit4=0: 666RGB
  2122. // =1: 888RGB
  2123. UCHAR ucSpatial; // bit0=0: Disable spatial dithering
  2124. // =1: Enable spatial dithering
  2125. // bit4=0: 666RGB
  2126. // =1: 888RGB
  2127. UCHAR ucTemporal; // bit0=0: Disable temporal dithering
  2128. // =1: Enable temporal dithering
  2129. // bit4=0: 666RGB
  2130. // =1: 888RGB
  2131. // bit5=0: Gray level 2
  2132. // =1: Gray level 4
  2133. UCHAR ucFRC; // bit4=0: 25FRC_SEL pattern E
  2134. // =1: 25FRC_SEL pattern F
  2135. // bit6:5=0: 50FRC_SEL pattern A
  2136. // =1: 50FRC_SEL pattern B
  2137. // =2: 50FRC_SEL pattern C
  2138. // =3: 50FRC_SEL pattern D
  2139. // bit7=0: 75FRC_SEL pattern E
  2140. // =1: 75FRC_SEL pattern F
  2141. }LVDS_ENCODER_CONTROL_PARAMETERS_V2;
  2142. #define LVDS_ENCODER_CONTROL_PS_ALLOCATION_V2 LVDS_ENCODER_CONTROL_PARAMETERS_V2
  2143. #define TMDS1_ENCODER_CONTROL_PARAMETERS_V2 LVDS_ENCODER_CONTROL_PARAMETERS_V2
  2144. #define TMDS1_ENCODER_CONTROL_PS_ALLOCATION_V2 TMDS1_ENCODER_CONTROL_PARAMETERS_V2
  2145. #define TMDS2_ENCODER_CONTROL_PARAMETERS_V2 TMDS1_ENCODER_CONTROL_PARAMETERS_V2
  2146. #define TMDS2_ENCODER_CONTROL_PS_ALLOCATION_V2 TMDS2_ENCODER_CONTROL_PARAMETERS_V2
  2147. #define LVDS_ENCODER_CONTROL_PARAMETERS_V3 LVDS_ENCODER_CONTROL_PARAMETERS_V2
  2148. #define LVDS_ENCODER_CONTROL_PS_ALLOCATION_V3 LVDS_ENCODER_CONTROL_PARAMETERS_V3
  2149. #define TMDS1_ENCODER_CONTROL_PARAMETERS_V3 LVDS_ENCODER_CONTROL_PARAMETERS_V3
  2150. #define TMDS1_ENCODER_CONTROL_PS_ALLOCATION_V3 TMDS1_ENCODER_CONTROL_PARAMETERS_V3
  2151. #define TMDS2_ENCODER_CONTROL_PARAMETERS_V3 LVDS_ENCODER_CONTROL_PARAMETERS_V3
  2152. #define TMDS2_ENCODER_CONTROL_PS_ALLOCATION_V3 TMDS2_ENCODER_CONTROL_PARAMETERS_V3
  2153. /****************************************************************************/
  2154. // Structures used by ###
  2155. /****************************************************************************/
  2156. typedef struct _ENABLE_EXTERNAL_TMDS_ENCODER_PARAMETERS
  2157. {
  2158. UCHAR ucEnable; // Enable or Disable External TMDS encoder
  2159. UCHAR ucMisc; // Bit0=0:Enable Single link;=1:Enable Dual link;Bit1 {=0:666RGB, =1:888RGB}
  2160. UCHAR ucPadding[2];
  2161. }ENABLE_EXTERNAL_TMDS_ENCODER_PARAMETERS;
  2162. typedef struct _ENABLE_EXTERNAL_TMDS_ENCODER_PS_ALLOCATION
  2163. {
  2164. ENABLE_EXTERNAL_TMDS_ENCODER_PARAMETERS sXTmdsEncoder;
  2165. WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION sReserved; //Caller doesn't need to init this portion
  2166. }ENABLE_EXTERNAL_TMDS_ENCODER_PS_ALLOCATION;
  2167. #define ENABLE_EXTERNAL_TMDS_ENCODER_PARAMETERS_V2 LVDS_ENCODER_CONTROL_PARAMETERS_V2
  2168. typedef struct _ENABLE_EXTERNAL_TMDS_ENCODER_PS_ALLOCATION_V2
  2169. {
  2170. ENABLE_EXTERNAL_TMDS_ENCODER_PARAMETERS_V2 sXTmdsEncoder;
  2171. WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION sReserved; //Caller doesn't need to init this portion
  2172. }ENABLE_EXTERNAL_TMDS_ENCODER_PS_ALLOCATION_V2;
  2173. typedef struct _EXTERNAL_ENCODER_CONTROL_PS_ALLOCATION
  2174. {
  2175. DIG_ENCODER_CONTROL_PARAMETERS sDigEncoder;
  2176. WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION sReserved;
  2177. }EXTERNAL_ENCODER_CONTROL_PS_ALLOCATION;
  2178. /****************************************************************************/
  2179. // Structures used by DVOEncoderControlTable
  2180. /****************************************************************************/
  2181. //ucTableFormatRevision=1,ucTableContentRevision=3
  2182. //ucDVOConfig:
  2183. #define DVO_ENCODER_CONFIG_RATE_SEL 0x01
  2184. #define DVO_ENCODER_CONFIG_DDR_SPEED 0x00
  2185. #define DVO_ENCODER_CONFIG_SDR_SPEED 0x01
  2186. #define DVO_ENCODER_CONFIG_OUTPUT_SEL 0x0c
  2187. #define DVO_ENCODER_CONFIG_LOW12BIT 0x00
  2188. #define DVO_ENCODER_CONFIG_UPPER12BIT 0x04
  2189. #define DVO_ENCODER_CONFIG_24BIT 0x08
  2190. typedef struct _DVO_ENCODER_CONTROL_PARAMETERS_V3
  2191. {
  2192. USHORT usPixelClock;
  2193. UCHAR ucDVOConfig;
  2194. UCHAR ucAction; //ATOM_ENABLE/ATOM_DISABLE/ATOM_HPD_INIT
  2195. UCHAR ucReseved[4];
  2196. }DVO_ENCODER_CONTROL_PARAMETERS_V3;
  2197. #define DVO_ENCODER_CONTROL_PS_ALLOCATION_V3 DVO_ENCODER_CONTROL_PARAMETERS_V3
  2198. typedef struct _DVO_ENCODER_CONTROL_PARAMETERS_V1_4
  2199. {
  2200. USHORT usPixelClock;
  2201. UCHAR ucDVOConfig;
  2202. UCHAR ucAction; //ATOM_ENABLE/ATOM_DISABLE/ATOM_HPD_INIT
  2203. UCHAR ucBitPerColor; //please refer to definition of PANEL_xBIT_PER_COLOR
  2204. UCHAR ucReseved[3];
  2205. }DVO_ENCODER_CONTROL_PARAMETERS_V1_4;
  2206. #define DVO_ENCODER_CONTROL_PS_ALLOCATION_V1_4 DVO_ENCODER_CONTROL_PARAMETERS_V1_4
  2207. //ucTableFormatRevision=1
  2208. //ucTableContentRevision=3 structure is not changed but usMisc add bit 1 as another input for
  2209. // bit1=0: non-coherent mode
  2210. // =1: coherent mode
  2211. //==========================================================================================
  2212. //Only change is here next time when changing encoder parameter definitions again!
  2213. #define LVDS_ENCODER_CONTROL_PARAMETERS_LAST LVDS_ENCODER_CONTROL_PARAMETERS_V3
  2214. #define LVDS_ENCODER_CONTROL_PS_ALLOCATION_LAST LVDS_ENCODER_CONTROL_PARAMETERS_LAST
  2215. #define TMDS1_ENCODER_CONTROL_PARAMETERS_LAST LVDS_ENCODER_CONTROL_PARAMETERS_V3
  2216. #define TMDS1_ENCODER_CONTROL_PS_ALLOCATION_LAST TMDS1_ENCODER_CONTROL_PARAMETERS_LAST
  2217. #define TMDS2_ENCODER_CONTROL_PARAMETERS_LAST LVDS_ENCODER_CONTROL_PARAMETERS_V3
  2218. #define TMDS2_ENCODER_CONTROL_PS_ALLOCATION_LAST TMDS2_ENCODER_CONTROL_PARAMETERS_LAST
  2219. #define DVO_ENCODER_CONTROL_PARAMETERS_LAST DVO_ENCODER_CONTROL_PARAMETERS
  2220. #define DVO_ENCODER_CONTROL_PS_ALLOCATION_LAST DVO_ENCODER_CONTROL_PS_ALLOCATION
  2221. //==========================================================================================
  2222. #define PANEL_ENCODER_MISC_DUAL 0x01
  2223. #define PANEL_ENCODER_MISC_COHERENT 0x02
  2224. #define PANEL_ENCODER_MISC_TMDS_LINKB 0x04
  2225. #define PANEL_ENCODER_MISC_HDMI_TYPE 0x08
  2226. #define PANEL_ENCODER_ACTION_DISABLE ATOM_DISABLE
  2227. #define PANEL_ENCODER_ACTION_ENABLE ATOM_ENABLE
  2228. #define PANEL_ENCODER_ACTION_COHERENTSEQ (ATOM_ENABLE+1)
  2229. #define PANEL_ENCODER_TRUNCATE_EN 0x01
  2230. #define PANEL_ENCODER_TRUNCATE_DEPTH 0x10
  2231. #define PANEL_ENCODER_SPATIAL_DITHER_EN 0x01
  2232. #define PANEL_ENCODER_SPATIAL_DITHER_DEPTH 0x10
  2233. #define PANEL_ENCODER_TEMPORAL_DITHER_EN 0x01
  2234. #define PANEL_ENCODER_TEMPORAL_DITHER_DEPTH 0x10
  2235. #define PANEL_ENCODER_TEMPORAL_LEVEL_4 0x20
  2236. #define PANEL_ENCODER_25FRC_MASK 0x10
  2237. #define PANEL_ENCODER_25FRC_E 0x00
  2238. #define PANEL_ENCODER_25FRC_F 0x10
  2239. #define PANEL_ENCODER_50FRC_MASK 0x60
  2240. #define PANEL_ENCODER_50FRC_A 0x00
  2241. #define PANEL_ENCODER_50FRC_B 0x20
  2242. #define PANEL_ENCODER_50FRC_C 0x40
  2243. #define PANEL_ENCODER_50FRC_D 0x60
  2244. #define PANEL_ENCODER_75FRC_MASK 0x80
  2245. #define PANEL_ENCODER_75FRC_E 0x00
  2246. #define PANEL_ENCODER_75FRC_F 0x80
  2247. /****************************************************************************/
  2248. // Structures used by SetVoltageTable
  2249. /****************************************************************************/
  2250. #define SET_VOLTAGE_TYPE_ASIC_VDDC 1
  2251. #define SET_VOLTAGE_TYPE_ASIC_MVDDC 2
  2252. #define SET_VOLTAGE_TYPE_ASIC_MVDDQ 3
  2253. #define SET_VOLTAGE_TYPE_ASIC_VDDCI 4
  2254. #define SET_VOLTAGE_INIT_MODE 5
  2255. #define SET_VOLTAGE_GET_MAX_VOLTAGE 6 //Gets the Max. voltage for the soldered Asic
  2256. #define SET_ASIC_VOLTAGE_MODE_ALL_SOURCE 0x1
  2257. #define SET_ASIC_VOLTAGE_MODE_SOURCE_A 0x2
  2258. #define SET_ASIC_VOLTAGE_MODE_SOURCE_B 0x4
  2259. #define SET_ASIC_VOLTAGE_MODE_SET_VOLTAGE 0x0
  2260. #define SET_ASIC_VOLTAGE_MODE_GET_GPIOVAL 0x1
  2261. #define SET_ASIC_VOLTAGE_MODE_GET_GPIOMASK 0x2
  2262. typedef struct _SET_VOLTAGE_PARAMETERS
  2263. {
  2264. UCHAR ucVoltageType; // To tell which voltage to set up, VDDC/MVDDC/MVDDQ
  2265. UCHAR ucVoltageMode; // To set all, to set source A or source B or ...
  2266. UCHAR ucVoltageIndex; // An index to tell which voltage level
  2267. UCHAR ucReserved;
  2268. }SET_VOLTAGE_PARAMETERS;
  2269. typedef struct _SET_VOLTAGE_PARAMETERS_V2
  2270. {
  2271. UCHAR ucVoltageType; // To tell which voltage to set up, VDDC/MVDDC/MVDDQ
  2272. UCHAR ucVoltageMode; // Not used, maybe use for state machine for differen power mode
  2273. USHORT usVoltageLevel; // real voltage level
  2274. }SET_VOLTAGE_PARAMETERS_V2;
  2275. // used by both SetVoltageTable v1.3 and v1.4
  2276. typedef struct _SET_VOLTAGE_PARAMETERS_V1_3
  2277. {
  2278. UCHAR ucVoltageType; // To tell which voltage to set up, VDDC/MVDDC/MVDDQ/VDDCI
  2279. UCHAR ucVoltageMode; // Indicate action: Set voltage level
  2280. USHORT usVoltageLevel; // real voltage level in unit of mv or Voltage Phase (0, 1, 2, .. )
  2281. }SET_VOLTAGE_PARAMETERS_V1_3;
  2282. //ucVoltageType
  2283. #define VOLTAGE_TYPE_VDDC 1
  2284. #define VOLTAGE_TYPE_MVDDC 2
  2285. #define VOLTAGE_TYPE_MVDDQ 3
  2286. #define VOLTAGE_TYPE_VDDCI 4
  2287. #define VOLTAGE_TYPE_VDDGFX 5
  2288. #define VOLTAGE_TYPE_PCC 6
  2289. #define VOLTAGE_TYPE_MVPP 7
  2290. #define VOLTAGE_TYPE_LEDDPM 8
  2291. #define VOLTAGE_TYPE_PCC_MVDD 9
  2292. #define VOLTAGE_TYPE_PCIE_VDDC 10
  2293. #define VOLTAGE_TYPE_PCIE_VDDR 11
  2294. #define VOLTAGE_TYPE_GENERIC_I2C_1 0x11
  2295. #define VOLTAGE_TYPE_GENERIC_I2C_2 0x12
  2296. #define VOLTAGE_TYPE_GENERIC_I2C_3 0x13
  2297. #define VOLTAGE_TYPE_GENERIC_I2C_4 0x14
  2298. #define VOLTAGE_TYPE_GENERIC_I2C_5 0x15
  2299. #define VOLTAGE_TYPE_GENERIC_I2C_6 0x16
  2300. #define VOLTAGE_TYPE_GENERIC_I2C_7 0x17
  2301. #define VOLTAGE_TYPE_GENERIC_I2C_8 0x18
  2302. #define VOLTAGE_TYPE_GENERIC_I2C_9 0x19
  2303. #define VOLTAGE_TYPE_GENERIC_I2C_10 0x1A
  2304. //SET_VOLTAGE_PARAMETERS_V3.ucVoltageMode
  2305. #define ATOM_SET_VOLTAGE 0 //Set voltage Level
  2306. #define ATOM_INIT_VOLTAGE_REGULATOR 3 //Init Regulator
  2307. #define ATOM_SET_VOLTAGE_PHASE 4 //Set Vregulator Phase, only for SVID/PVID regulator
  2308. #define ATOM_GET_MAX_VOLTAGE 6 //Get Max Voltage, not used from SetVoltageTable v1.3
  2309. #define ATOM_GET_VOLTAGE_LEVEL 6 //Get Voltage level from vitual voltage ID, not used for SetVoltage v1.4
  2310. #define ATOM_GET_LEAKAGE_ID 8 //Get Leakage Voltage Id ( starting from SMU7x IP ), SetVoltage v1.4
  2311. // define vitual voltage id in usVoltageLevel
  2312. #define ATOM_VIRTUAL_VOLTAGE_ID0 0xff01
  2313. #define ATOM_VIRTUAL_VOLTAGE_ID1 0xff02
  2314. #define ATOM_VIRTUAL_VOLTAGE_ID2 0xff03
  2315. #define ATOM_VIRTUAL_VOLTAGE_ID3 0xff04
  2316. #define ATOM_VIRTUAL_VOLTAGE_ID4 0xff05
  2317. #define ATOM_VIRTUAL_VOLTAGE_ID5 0xff06
  2318. #define ATOM_VIRTUAL_VOLTAGE_ID6 0xff07
  2319. #define ATOM_VIRTUAL_VOLTAGE_ID7 0xff08
  2320. typedef struct _SET_VOLTAGE_PS_ALLOCATION
  2321. {
  2322. SET_VOLTAGE_PARAMETERS sASICSetVoltage;
  2323. WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION sReserved;
  2324. }SET_VOLTAGE_PS_ALLOCATION;
  2325. // New Added from SI for GetVoltageInfoTable, input parameter structure
  2326. typedef struct _GET_VOLTAGE_INFO_INPUT_PARAMETER_V1_1
  2327. {
  2328. UCHAR ucVoltageType; // Input: To tell which voltage to set up, VDDC/MVDDC/MVDDQ/VDDCI
  2329. UCHAR ucVoltageMode; // Input: Indicate action: Get voltage info
  2330. USHORT usVoltageLevel; // Input: real voltage level in unit of mv or Voltage Phase (0, 1, 2, .. ) or Leakage Id
  2331. ULONG ulReserved;
  2332. }GET_VOLTAGE_INFO_INPUT_PARAMETER_V1_1;
  2333. // New Added from SI for GetVoltageInfoTable, output parameter structure when ucVotlageMode == ATOM_GET_VOLTAGE_VID
  2334. typedef struct _GET_VOLTAGE_INFO_OUTPUT_PARAMETER_V1_1
  2335. {
  2336. ULONG ulVotlageGpioState;
  2337. ULONG ulVoltageGPioMask;
  2338. }GET_VOLTAGE_INFO_OUTPUT_PARAMETER_V1_1;
  2339. // New Added from SI for GetVoltageInfoTable, output parameter structure when ucVotlageMode == ATOM_GET_VOLTAGE_STATEx_LEAKAGE_VID
  2340. typedef struct _GET_LEAKAGE_VOLTAGE_INFO_OUTPUT_PARAMETER_V1_1
  2341. {
  2342. USHORT usVoltageLevel;
  2343. USHORT usVoltageId; // Voltage Id programmed in Voltage Regulator
  2344. ULONG ulReseved;
  2345. }GET_LEAKAGE_VOLTAGE_INFO_OUTPUT_PARAMETER_V1_1;
  2346. // GetVoltageInfo v1.1 ucVoltageMode
  2347. #define ATOM_GET_VOLTAGE_VID 0x00
  2348. #define ATOM_GET_VOTLAGE_INIT_SEQ 0x03
  2349. #define ATOM_GET_VOLTTAGE_PHASE_PHASE_VID 0x04
  2350. #define ATOM_GET_VOLTAGE_SVID2 0x07 //Get SVI2 Regulator Info
  2351. // for SI, this state map to 0xff02 voltage state in Power Play table, which is power boost state
  2352. #define ATOM_GET_VOLTAGE_STATE0_LEAKAGE_VID 0x10
  2353. // for SI, this state map to 0xff01 voltage state in Power Play table, which is performance state
  2354. #define ATOM_GET_VOLTAGE_STATE1_LEAKAGE_VID 0x11
  2355. #define ATOM_GET_VOLTAGE_STATE2_LEAKAGE_VID 0x12
  2356. #define ATOM_GET_VOLTAGE_STATE3_LEAKAGE_VID 0x13
  2357. // New Added from CI Hawaii for GetVoltageInfoTable, input parameter structure
  2358. typedef struct _GET_VOLTAGE_INFO_INPUT_PARAMETER_V1_2
  2359. {
  2360. UCHAR ucVoltageType; // Input: To tell which voltage to set up, VDDC/MVDDC/MVDDQ/VDDCI
  2361. UCHAR ucVoltageMode; // Input: Indicate action: Get voltage info
  2362. USHORT usVoltageLevel; // Input: real voltage level in unit of mv or Voltage Phase (0, 1, 2, .. ) or Leakage Id
  2363. ULONG ulSCLKFreq; // Input: when ucVoltageMode= ATOM_GET_VOLTAGE_EVV_VOLTAGE, DPM state SCLK frequency, Define in PPTable SCLK/Voltage dependence table
  2364. }GET_VOLTAGE_INFO_INPUT_PARAMETER_V1_2;
  2365. // New in GetVoltageInfo v1.2 ucVoltageMode
  2366. #define ATOM_GET_VOLTAGE_EVV_VOLTAGE 0x09
  2367. // New Added from CI Hawaii for EVV feature
  2368. typedef struct _GET_EVV_VOLTAGE_INFO_OUTPUT_PARAMETER_V1_2
  2369. {
  2370. USHORT usVoltageLevel; // real voltage level in unit of mv
  2371. USHORT usVoltageId; // Voltage Id programmed in Voltage Regulator
  2372. USHORT usTDP_Current; // TDP_Current in unit of 0.01A
  2373. USHORT usTDP_Power; // TDP_Current in unit of 0.1W
  2374. }GET_EVV_VOLTAGE_INFO_OUTPUT_PARAMETER_V1_2;
  2375. // New Added from CI Hawaii for GetVoltageInfoTable, input parameter structure
  2376. typedef struct _GET_VOLTAGE_INFO_INPUT_PARAMETER_V1_3
  2377. {
  2378. UCHAR ucVoltageType; // Input: To tell which voltage to set up, VDDC/MVDDC/MVDDQ/VDDCI
  2379. UCHAR ucVoltageMode; // Input: Indicate action: Get voltage info
  2380. USHORT usVoltageLevel; // Input: real voltage level in unit of mv or Voltage Phase (0, 1, 2, .. ) or Leakage Id
  2381. ULONG ulSCLKFreq; // Input: when ucVoltageMode= ATOM_GET_VOLTAGE_EVV_VOLTAGE, DPM state SCLK frequency, Define in PPTable SCLK/Voltage dependence table
  2382. ULONG ulReserved[3];
  2383. }GET_VOLTAGE_INFO_INPUT_PARAMETER_V1_3;
  2384. // New Added from CI Hawaii for EVV feature
  2385. typedef struct _GET_EVV_VOLTAGE_INFO_OUTPUT_PARAMETER_V1_3
  2386. {
  2387. ULONG ulVoltageLevel; // real voltage level in unit of 0.01mv
  2388. ULONG ulReserved[4];
  2389. }GET_EVV_VOLTAGE_INFO_OUTPUT_PARAMETER_V1_3;
  2390. /****************************************************************************/
  2391. // Structures used by GetSMUClockInfo
  2392. /****************************************************************************/
  2393. typedef struct _GET_SMU_CLOCK_INFO_INPUT_PARAMETER_V2_1
  2394. {
  2395. ULONG ulDfsPllOutputFreq:24;
  2396. ULONG ucDfsDivider:8;
  2397. }GET_SMU_CLOCK_INFO_INPUT_PARAMETER_V2_1;
  2398. typedef struct _GET_SMU_CLOCK_INFO_OUTPUT_PARAMETER_V2_1
  2399. {
  2400. ULONG ulDfsOutputFreq;
  2401. }GET_SMU_CLOCK_INFO_OUTPUT_PARAMETER_V2_1;
  2402. /****************************************************************************/
  2403. // Structures used by TVEncoderControlTable
  2404. /****************************************************************************/
  2405. typedef struct _TV_ENCODER_CONTROL_PARAMETERS
  2406. {
  2407. USHORT usPixelClock; // in 10KHz; for bios convenient
  2408. UCHAR ucTvStandard; // See definition "ATOM_TV_NTSC ..."
  2409. UCHAR ucAction; // 0: turn off encoder
  2410. // 1: setup and turn on encoder
  2411. }TV_ENCODER_CONTROL_PARAMETERS;
  2412. typedef struct _TV_ENCODER_CONTROL_PS_ALLOCATION
  2413. {
  2414. TV_ENCODER_CONTROL_PARAMETERS sTVEncoder;
  2415. WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION sReserved; // Don't set this one
  2416. }TV_ENCODER_CONTROL_PS_ALLOCATION;
  2417. //==============================Data Table Portion====================================
  2418. /****************************************************************************/
  2419. // Structure used in Data.mtb
  2420. /****************************************************************************/
  2421. typedef struct _ATOM_MASTER_LIST_OF_DATA_TABLES
  2422. {
  2423. USHORT UtilityPipeLine; // Offest for the utility to get parser info,Don't change this position!
  2424. USHORT MultimediaCapabilityInfo; // Only used by MM Lib,latest version 1.1, not configuable from Bios, need to include the table to build Bios
  2425. USHORT MultimediaConfigInfo; // Only used by MM Lib,latest version 2.1, not configuable from Bios, need to include the table to build Bios
  2426. USHORT StandardVESA_Timing; // Only used by Bios
  2427. USHORT FirmwareInfo; // Shared by various SW components,latest version 1.4
  2428. USHORT PaletteData; // Only used by BIOS
  2429. USHORT LCD_Info; // Shared by various SW components,latest version 1.3, was called LVDS_Info
  2430. USHORT DIGTransmitterInfo; // Internal used by VBIOS only version 3.1
  2431. USHORT SMU_Info; // Shared by various SW components,latest version 1.1
  2432. USHORT SupportedDevicesInfo; // Will be obsolete from R600
  2433. USHORT GPIO_I2C_Info; // Shared by various SW components,latest version 1.2 will be used from R600
  2434. USHORT VRAM_UsageByFirmware; // Shared by various SW components,latest version 1.3 will be used from R600
  2435. USHORT GPIO_Pin_LUT; // Shared by various SW components,latest version 1.1
  2436. USHORT VESA_ToInternalModeLUT; // Only used by Bios
  2437. USHORT GFX_Info; // Shared by various SW components,latest version 2.1 will be used from R600
  2438. USHORT PowerPlayInfo; // Shared by various SW components,latest version 2.1,new design from R600
  2439. USHORT GPUVirtualizationInfo; // Will be obsolete from R600
  2440. USHORT SaveRestoreInfo; // Only used by Bios
  2441. 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
  2442. USHORT OemInfo; // Defined and used by external SW, should be obsolete soon
  2443. USHORT XTMDS_Info; // Will be obsolete from R600
  2444. USHORT MclkSS_Info; // Shared by various SW components,latest version 1.1, only enabled when ext SS chip is used
  2445. USHORT Object_Header; // Shared by various SW components,latest version 1.1
  2446. USHORT IndirectIOAccess; // Only used by Bios,this table position can't change at all!!
  2447. USHORT MC_InitParameter; // Only used by command table
  2448. USHORT ASIC_VDDC_Info; // Will be obsolete from R600
  2449. USHORT ASIC_InternalSS_Info; // New tabel name from R600, used to be called "ASIC_MVDDC_Info"
  2450. USHORT TV_VideoMode; // Only used by command table
  2451. USHORT VRAM_Info; // Only used by command table, latest version 1.3
  2452. USHORT MemoryTrainingInfo; // Used for VBIOS and Diag utility for memory training purpose since R600. the new table rev start from 2.1
  2453. USHORT IntegratedSystemInfo; // Shared by various SW components
  2454. USHORT ASIC_ProfilingInfo; // New table name from R600, used to be called "ASIC_VDDCI_Info" for pre-R600
  2455. USHORT VoltageObjectInfo; // Shared by various SW components, latest version 1.1
  2456. USHORT PowerSourceInfo; // Shared by various SW components, latest versoin 1.1
  2457. USHORT ServiceInfo;
  2458. }ATOM_MASTER_LIST_OF_DATA_TABLES;
  2459. typedef struct _ATOM_MASTER_DATA_TABLE
  2460. {
  2461. ATOM_COMMON_TABLE_HEADER sHeader;
  2462. ATOM_MASTER_LIST_OF_DATA_TABLES ListOfDataTables;
  2463. }ATOM_MASTER_DATA_TABLE;
  2464. // For backward compatible
  2465. #define LVDS_Info LCD_Info
  2466. #define DAC_Info PaletteData
  2467. #define TMDS_Info DIGTransmitterInfo
  2468. #define CompassionateData GPUVirtualizationInfo
  2469. #define AnalogTV_Info SMU_Info
  2470. #define ComponentVideoInfo GFX_Info
  2471. /****************************************************************************/
  2472. // Structure used in MultimediaCapabilityInfoTable
  2473. /****************************************************************************/
  2474. typedef struct _ATOM_MULTIMEDIA_CAPABILITY_INFO
  2475. {
  2476. ATOM_COMMON_TABLE_HEADER sHeader;
  2477. ULONG ulSignature; // HW info table signature string "$ATI"
  2478. UCHAR ucI2C_Type; // I2C type (normal GP_IO, ImpactTV GP_IO, Dedicated I2C pin, etc)
  2479. UCHAR ucTV_OutInfo; // Type of TV out supported (3:0) and video out crystal frequency (6:4) and TV data port (7)
  2480. UCHAR ucVideoPortInfo; // Provides the video port capabilities
  2481. UCHAR ucHostPortInfo; // Provides host port configuration information
  2482. }ATOM_MULTIMEDIA_CAPABILITY_INFO;
  2483. /****************************************************************************/
  2484. // Structure used in MultimediaConfigInfoTable
  2485. /****************************************************************************/
  2486. typedef struct _ATOM_MULTIMEDIA_CONFIG_INFO
  2487. {
  2488. ATOM_COMMON_TABLE_HEADER sHeader;
  2489. ULONG ulSignature; // MM info table signature sting "$MMT"
  2490. UCHAR ucTunerInfo; // Type of tuner installed on the adapter (4:0) and video input for tuner (7:5)
  2491. UCHAR ucAudioChipInfo; // List the audio chip type (3:0) product type (4) and OEM revision (7:5)
  2492. UCHAR ucProductID; // Defines as OEM ID or ATI board ID dependent on product type setting
  2493. UCHAR ucMiscInfo1; // Tuner voltage (1:0) HW teletext support (3:2) FM audio decoder (5:4) reserved (6) audio scrambling (7)
  2494. UCHAR ucMiscInfo2; // I2S input config (0) I2S output config (1) I2S Audio Chip (4:2) SPDIF Output Config (5) reserved (7:6)
  2495. UCHAR ucMiscInfo3; // Video Decoder Type (3:0) Video In Standard/Crystal (7:4)
  2496. UCHAR ucMiscInfo4; // Video Decoder Host Config (2:0) reserved (7:3)
  2497. UCHAR ucVideoInput0Info;// Video Input 0 Type (1:0) F/B setting (2) physical connector ID (5:3) reserved (7:6)
  2498. UCHAR ucVideoInput1Info;// Video Input 1 Type (1:0) F/B setting (2) physical connector ID (5:3) reserved (7:6)
  2499. UCHAR ucVideoInput2Info;// Video Input 2 Type (1:0) F/B setting (2) physical connector ID (5:3) reserved (7:6)
  2500. UCHAR ucVideoInput3Info;// Video Input 3 Type (1:0) F/B setting (2) physical connector ID (5:3) reserved (7:6)
  2501. UCHAR ucVideoInput4Info;// Video Input 4 Type (1:0) F/B setting (2) physical connector ID (5:3) reserved (7:6)
  2502. }ATOM_MULTIMEDIA_CONFIG_INFO;
  2503. /****************************************************************************/
  2504. // Structures used in FirmwareInfoTable
  2505. /****************************************************************************/
  2506. // usBIOSCapability Defintion:
  2507. // Bit 0 = 0: Bios image is not Posted, =1:Bios image is Posted;
  2508. // Bit 1 = 0: Dual CRTC is not supported, =1: Dual CRTC is supported;
  2509. // Bit 2 = 0: Extended Desktop is not supported, =1: Extended Desktop is supported;
  2510. // Others: Reserved
  2511. #define ATOM_BIOS_INFO_ATOM_FIRMWARE_POSTED 0x0001
  2512. #define ATOM_BIOS_INFO_DUAL_CRTC_SUPPORT 0x0002
  2513. #define ATOM_BIOS_INFO_EXTENDED_DESKTOP_SUPPORT 0x0004
  2514. #define ATOM_BIOS_INFO_MEMORY_CLOCK_SS_SUPPORT 0x0008 // (valid from v1.1 ~v1.4):=1: memclk SS enable, =0 memclk SS disable.
  2515. #define ATOM_BIOS_INFO_ENGINE_CLOCK_SS_SUPPORT 0x0010 // (valid from v1.1 ~v1.4):=1: engclk SS enable, =0 engclk SS disable.
  2516. #define ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU 0x0020
  2517. #define ATOM_BIOS_INFO_WMI_SUPPORT 0x0040
  2518. #define ATOM_BIOS_INFO_PPMODE_ASSIGNGED_BY_SYSTEM 0x0080
  2519. #define ATOM_BIOS_INFO_HYPERMEMORY_SUPPORT 0x0100
  2520. #define ATOM_BIOS_INFO_HYPERMEMORY_SIZE_MASK 0x1E00
  2521. #define ATOM_BIOS_INFO_VPOST_WITHOUT_FIRST_MODE_SET 0x2000
  2522. #define ATOM_BIOS_INFO_BIOS_SCRATCH6_SCL2_REDEFINE 0x4000
  2523. #define ATOM_BIOS_INFO_MEMORY_CLOCK_EXT_SS_SUPPORT 0x0008 // (valid from v2.1 ): =1: memclk ss enable with external ss chip
  2524. #define ATOM_BIOS_INFO_ENGINE_CLOCK_EXT_SS_SUPPORT 0x0010 // (valid from v2.1 ): =1: engclk ss enable with external ss chip
  2525. #ifndef _H2INC
  2526. //Please don't add or expand this bitfield structure below, this one will retire soon.!
  2527. typedef struct _ATOM_FIRMWARE_CAPABILITY
  2528. {
  2529. #if ATOM_BIG_ENDIAN
  2530. USHORT Reserved:1;
  2531. USHORT SCL2Redefined:1;
  2532. USHORT PostWithoutModeSet:1;
  2533. USHORT HyperMemory_Size:4;
  2534. USHORT HyperMemory_Support:1;
  2535. USHORT PPMode_Assigned:1;
  2536. USHORT WMI_SUPPORT:1;
  2537. USHORT GPUControlsBL:1;
  2538. USHORT EngineClockSS_Support:1;
  2539. USHORT MemoryClockSS_Support:1;
  2540. USHORT ExtendedDesktopSupport:1;
  2541. USHORT DualCRTC_Support:1;
  2542. USHORT FirmwarePosted:1;
  2543. #else
  2544. USHORT FirmwarePosted:1;
  2545. USHORT DualCRTC_Support:1;
  2546. USHORT ExtendedDesktopSupport:1;
  2547. USHORT MemoryClockSS_Support:1;
  2548. USHORT EngineClockSS_Support:1;
  2549. USHORT GPUControlsBL:1;
  2550. USHORT WMI_SUPPORT:1;
  2551. USHORT PPMode_Assigned:1;
  2552. USHORT HyperMemory_Support:1;
  2553. USHORT HyperMemory_Size:4;
  2554. USHORT PostWithoutModeSet:1;
  2555. USHORT SCL2Redefined:1;
  2556. USHORT Reserved:1;
  2557. #endif
  2558. }ATOM_FIRMWARE_CAPABILITY;
  2559. typedef union _ATOM_FIRMWARE_CAPABILITY_ACCESS
  2560. {
  2561. ATOM_FIRMWARE_CAPABILITY sbfAccess;
  2562. USHORT susAccess;
  2563. }ATOM_FIRMWARE_CAPABILITY_ACCESS;
  2564. #else
  2565. typedef union _ATOM_FIRMWARE_CAPABILITY_ACCESS
  2566. {
  2567. USHORT susAccess;
  2568. }ATOM_FIRMWARE_CAPABILITY_ACCESS;
  2569. #endif
  2570. typedef struct _ATOM_FIRMWARE_INFO
  2571. {
  2572. ATOM_COMMON_TABLE_HEADER sHeader;
  2573. ULONG ulFirmwareRevision;
  2574. ULONG ulDefaultEngineClock; //In 10Khz unit
  2575. ULONG ulDefaultMemoryClock; //In 10Khz unit
  2576. ULONG ulDriverTargetEngineClock; //In 10Khz unit
  2577. ULONG ulDriverTargetMemoryClock; //In 10Khz unit
  2578. ULONG ulMaxEngineClockPLL_Output; //In 10Khz unit
  2579. ULONG ulMaxMemoryClockPLL_Output; //In 10Khz unit
  2580. ULONG ulMaxPixelClockPLL_Output; //In 10Khz unit
  2581. ULONG ulASICMaxEngineClock; //In 10Khz unit
  2582. ULONG ulASICMaxMemoryClock; //In 10Khz unit
  2583. UCHAR ucASICMaxTemperature;
  2584. UCHAR ucPadding[3]; //Don't use them
  2585. ULONG aulReservedForBIOS[3]; //Don't use them
  2586. USHORT usMinEngineClockPLL_Input; //In 10Khz unit
  2587. USHORT usMaxEngineClockPLL_Input; //In 10Khz unit
  2588. USHORT usMinEngineClockPLL_Output; //In 10Khz unit
  2589. USHORT usMinMemoryClockPLL_Input; //In 10Khz unit
  2590. USHORT usMaxMemoryClockPLL_Input; //In 10Khz unit
  2591. USHORT usMinMemoryClockPLL_Output; //In 10Khz unit
  2592. USHORT usMaxPixelClock; //In 10Khz unit, Max. Pclk
  2593. USHORT usMinPixelClockPLL_Input; //In 10Khz unit
  2594. USHORT usMaxPixelClockPLL_Input; //In 10Khz unit
  2595. USHORT usMinPixelClockPLL_Output; //In 10Khz unit, the definitions above can't change!!!
  2596. ATOM_FIRMWARE_CAPABILITY_ACCESS usFirmwareCapability;
  2597. USHORT usReferenceClock; //In 10Khz unit
  2598. USHORT usPM_RTS_Location; //RTS PM4 starting location in ROM in 1Kb unit
  2599. UCHAR ucPM_RTS_StreamSize; //RTS PM4 packets in Kb unit
  2600. UCHAR ucDesign_ID; //Indicate what is the board design
  2601. UCHAR ucMemoryModule_ID; //Indicate what is the board design
  2602. }ATOM_FIRMWARE_INFO;
  2603. typedef struct _ATOM_FIRMWARE_INFO_V1_2
  2604. {
  2605. ATOM_COMMON_TABLE_HEADER sHeader;
  2606. ULONG ulFirmwareRevision;
  2607. ULONG ulDefaultEngineClock; //In 10Khz unit
  2608. ULONG ulDefaultMemoryClock; //In 10Khz unit
  2609. ULONG ulDriverTargetEngineClock; //In 10Khz unit
  2610. ULONG ulDriverTargetMemoryClock; //In 10Khz unit
  2611. ULONG ulMaxEngineClockPLL_Output; //In 10Khz unit
  2612. ULONG ulMaxMemoryClockPLL_Output; //In 10Khz unit
  2613. ULONG ulMaxPixelClockPLL_Output; //In 10Khz unit
  2614. ULONG ulASICMaxEngineClock; //In 10Khz unit
  2615. ULONG ulASICMaxMemoryClock; //In 10Khz unit
  2616. UCHAR ucASICMaxTemperature;
  2617. UCHAR ucMinAllowedBL_Level;
  2618. UCHAR ucPadding[2]; //Don't use them
  2619. ULONG aulReservedForBIOS[2]; //Don't use them
  2620. ULONG ulMinPixelClockPLL_Output; //In 10Khz unit
  2621. USHORT usMinEngineClockPLL_Input; //In 10Khz unit
  2622. USHORT usMaxEngineClockPLL_Input; //In 10Khz unit
  2623. USHORT usMinEngineClockPLL_Output; //In 10Khz unit
  2624. USHORT usMinMemoryClockPLL_Input; //In 10Khz unit
  2625. USHORT usMaxMemoryClockPLL_Input; //In 10Khz unit
  2626. USHORT usMinMemoryClockPLL_Output; //In 10Khz unit
  2627. USHORT usMaxPixelClock; //In 10Khz unit, Max. Pclk
  2628. USHORT usMinPixelClockPLL_Input; //In 10Khz unit
  2629. USHORT usMaxPixelClockPLL_Input; //In 10Khz unit
  2630. USHORT usMinPixelClockPLL_Output; //In 10Khz unit - lower 16bit of ulMinPixelClockPLL_Output
  2631. ATOM_FIRMWARE_CAPABILITY_ACCESS usFirmwareCapability;
  2632. USHORT usReferenceClock; //In 10Khz unit
  2633. USHORT usPM_RTS_Location; //RTS PM4 starting location in ROM in 1Kb unit
  2634. UCHAR ucPM_RTS_StreamSize; //RTS PM4 packets in Kb unit
  2635. UCHAR ucDesign_ID; //Indicate what is the board design
  2636. UCHAR ucMemoryModule_ID; //Indicate what is the board design
  2637. }ATOM_FIRMWARE_INFO_V1_2;
  2638. typedef struct _ATOM_FIRMWARE_INFO_V1_3
  2639. {
  2640. ATOM_COMMON_TABLE_HEADER sHeader;
  2641. ULONG ulFirmwareRevision;
  2642. ULONG ulDefaultEngineClock; //In 10Khz unit
  2643. ULONG ulDefaultMemoryClock; //In 10Khz unit
  2644. ULONG ulDriverTargetEngineClock; //In 10Khz unit
  2645. ULONG ulDriverTargetMemoryClock; //In 10Khz unit
  2646. ULONG ulMaxEngineClockPLL_Output; //In 10Khz unit
  2647. ULONG ulMaxMemoryClockPLL_Output; //In 10Khz unit
  2648. ULONG ulMaxPixelClockPLL_Output; //In 10Khz unit
  2649. ULONG ulASICMaxEngineClock; //In 10Khz unit
  2650. ULONG ulASICMaxMemoryClock; //In 10Khz unit
  2651. UCHAR ucASICMaxTemperature;
  2652. UCHAR ucMinAllowedBL_Level;
  2653. UCHAR ucPadding[2]; //Don't use them
  2654. ULONG aulReservedForBIOS; //Don't use them
  2655. ULONG ul3DAccelerationEngineClock;//In 10Khz unit
  2656. ULONG ulMinPixelClockPLL_Output; //In 10Khz unit
  2657. USHORT usMinEngineClockPLL_Input; //In 10Khz unit
  2658. USHORT usMaxEngineClockPLL_Input; //In 10Khz unit
  2659. USHORT usMinEngineClockPLL_Output; //In 10Khz unit
  2660. USHORT usMinMemoryClockPLL_Input; //In 10Khz unit
  2661. USHORT usMaxMemoryClockPLL_Input; //In 10Khz unit
  2662. USHORT usMinMemoryClockPLL_Output; //In 10Khz unit
  2663. USHORT usMaxPixelClock; //In 10Khz unit, Max. Pclk
  2664. USHORT usMinPixelClockPLL_Input; //In 10Khz unit
  2665. USHORT usMaxPixelClockPLL_Input; //In 10Khz unit
  2666. USHORT usMinPixelClockPLL_Output; //In 10Khz unit - lower 16bit of ulMinPixelClockPLL_Output
  2667. ATOM_FIRMWARE_CAPABILITY_ACCESS usFirmwareCapability;
  2668. USHORT usReferenceClock; //In 10Khz unit
  2669. USHORT usPM_RTS_Location; //RTS PM4 starting location in ROM in 1Kb unit
  2670. UCHAR ucPM_RTS_StreamSize; //RTS PM4 packets in Kb unit
  2671. UCHAR ucDesign_ID; //Indicate what is the board design
  2672. UCHAR ucMemoryModule_ID; //Indicate what is the board design
  2673. }ATOM_FIRMWARE_INFO_V1_3;
  2674. typedef struct _ATOM_FIRMWARE_INFO_V1_4
  2675. {
  2676. ATOM_COMMON_TABLE_HEADER sHeader;
  2677. ULONG ulFirmwareRevision;
  2678. ULONG ulDefaultEngineClock; //In 10Khz unit
  2679. ULONG ulDefaultMemoryClock; //In 10Khz unit
  2680. ULONG ulDriverTargetEngineClock; //In 10Khz unit
  2681. ULONG ulDriverTargetMemoryClock; //In 10Khz unit
  2682. ULONG ulMaxEngineClockPLL_Output; //In 10Khz unit
  2683. ULONG ulMaxMemoryClockPLL_Output; //In 10Khz unit
  2684. ULONG ulMaxPixelClockPLL_Output; //In 10Khz unit
  2685. ULONG ulASICMaxEngineClock; //In 10Khz unit
  2686. ULONG ulASICMaxMemoryClock; //In 10Khz unit
  2687. UCHAR ucASICMaxTemperature;
  2688. UCHAR ucMinAllowedBL_Level;
  2689. USHORT usBootUpVDDCVoltage; //In MV unit
  2690. USHORT usLcdMinPixelClockPLL_Output; // In MHz unit
  2691. USHORT usLcdMaxPixelClockPLL_Output; // In MHz unit
  2692. ULONG ul3DAccelerationEngineClock;//In 10Khz unit
  2693. ULONG ulMinPixelClockPLL_Output; //In 10Khz unit
  2694. USHORT usMinEngineClockPLL_Input; //In 10Khz unit
  2695. USHORT usMaxEngineClockPLL_Input; //In 10Khz unit
  2696. USHORT usMinEngineClockPLL_Output; //In 10Khz unit
  2697. USHORT usMinMemoryClockPLL_Input; //In 10Khz unit
  2698. USHORT usMaxMemoryClockPLL_Input; //In 10Khz unit
  2699. USHORT usMinMemoryClockPLL_Output; //In 10Khz unit
  2700. USHORT usMaxPixelClock; //In 10Khz unit, Max. Pclk
  2701. USHORT usMinPixelClockPLL_Input; //In 10Khz unit
  2702. USHORT usMaxPixelClockPLL_Input; //In 10Khz unit
  2703. USHORT usMinPixelClockPLL_Output; //In 10Khz unit - lower 16bit of ulMinPixelClockPLL_Output
  2704. ATOM_FIRMWARE_CAPABILITY_ACCESS usFirmwareCapability;
  2705. USHORT usReferenceClock; //In 10Khz unit
  2706. USHORT usPM_RTS_Location; //RTS PM4 starting location in ROM in 1Kb unit
  2707. UCHAR ucPM_RTS_StreamSize; //RTS PM4 packets in Kb unit
  2708. UCHAR ucDesign_ID; //Indicate what is the board design
  2709. UCHAR ucMemoryModule_ID; //Indicate what is the board design
  2710. }ATOM_FIRMWARE_INFO_V1_4;
  2711. //the structure below to be used from Cypress
  2712. typedef struct _ATOM_FIRMWARE_INFO_V2_1
  2713. {
  2714. ATOM_COMMON_TABLE_HEADER sHeader;
  2715. ULONG ulFirmwareRevision;
  2716. ULONG ulDefaultEngineClock; //In 10Khz unit
  2717. ULONG ulDefaultMemoryClock; //In 10Khz unit
  2718. ULONG ulReserved1;
  2719. ULONG ulReserved2;
  2720. ULONG ulMaxEngineClockPLL_Output; //In 10Khz unit
  2721. ULONG ulMaxMemoryClockPLL_Output; //In 10Khz unit
  2722. ULONG ulMaxPixelClockPLL_Output; //In 10Khz unit
  2723. ULONG ulBinaryAlteredInfo; //Was ulASICMaxEngineClock
  2724. ULONG ulDefaultDispEngineClkFreq; //In 10Khz unit
  2725. UCHAR ucReserved1; //Was ucASICMaxTemperature;
  2726. UCHAR ucMinAllowedBL_Level;
  2727. USHORT usBootUpVDDCVoltage; //In MV unit
  2728. USHORT usLcdMinPixelClockPLL_Output; // In MHz unit
  2729. USHORT usLcdMaxPixelClockPLL_Output; // In MHz unit
  2730. ULONG ulReserved4; //Was ulAsicMaximumVoltage
  2731. ULONG ulMinPixelClockPLL_Output; //In 10Khz unit
  2732. USHORT usMinEngineClockPLL_Input; //In 10Khz unit
  2733. USHORT usMaxEngineClockPLL_Input; //In 10Khz unit
  2734. USHORT usMinEngineClockPLL_Output; //In 10Khz unit
  2735. USHORT usMinMemoryClockPLL_Input; //In 10Khz unit
  2736. USHORT usMaxMemoryClockPLL_Input; //In 10Khz unit
  2737. USHORT usMinMemoryClockPLL_Output; //In 10Khz unit
  2738. USHORT usMaxPixelClock; //In 10Khz unit, Max. Pclk
  2739. USHORT usMinPixelClockPLL_Input; //In 10Khz unit
  2740. USHORT usMaxPixelClockPLL_Input; //In 10Khz unit
  2741. USHORT usMinPixelClockPLL_Output; //In 10Khz unit - lower 16bit of ulMinPixelClockPLL_Output
  2742. ATOM_FIRMWARE_CAPABILITY_ACCESS usFirmwareCapability;
  2743. USHORT usCoreReferenceClock; //In 10Khz unit
  2744. USHORT usMemoryReferenceClock; //In 10Khz unit
  2745. 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
  2746. UCHAR ucMemoryModule_ID; //Indicate what is the board design
  2747. UCHAR ucReserved4[3];
  2748. }ATOM_FIRMWARE_INFO_V2_1;
  2749. //the structure below to be used from NI
  2750. //ucTableFormatRevision=2
  2751. //ucTableContentRevision=2
  2752. typedef struct _PRODUCT_BRANDING
  2753. {
  2754. UCHAR ucEMBEDDED_CAP:2; // Bit[1:0] Embedded feature level
  2755. UCHAR ucReserved:2; // Bit[3:2] Reserved
  2756. UCHAR ucBRANDING_ID:4; // Bit[7:4] Branding ID
  2757. }PRODUCT_BRANDING;
  2758. typedef struct _ATOM_FIRMWARE_INFO_V2_2
  2759. {
  2760. ATOM_COMMON_TABLE_HEADER sHeader;
  2761. ULONG ulFirmwareRevision;
  2762. ULONG ulDefaultEngineClock; //In 10Khz unit
  2763. ULONG ulDefaultMemoryClock; //In 10Khz unit
  2764. ULONG ulSPLL_OutputFreq; //In 10Khz unit
  2765. ULONG ulGPUPLL_OutputFreq; //In 10Khz unit
  2766. ULONG ulReserved1; //Was ulMaxEngineClockPLL_Output; //In 10Khz unit*
  2767. ULONG ulReserved2; //Was ulMaxMemoryClockPLL_Output; //In 10Khz unit*
  2768. ULONG ulMaxPixelClockPLL_Output; //In 10Khz unit
  2769. ULONG ulBinaryAlteredInfo; //Was ulASICMaxEngineClock ?
  2770. ULONG ulDefaultDispEngineClkFreq; //In 10Khz unit. This is the frequency before DCDTO, corresponding to usBootUpVDDCVoltage.
  2771. UCHAR ucReserved3; //Was ucASICMaxTemperature;
  2772. UCHAR ucMinAllowedBL_Level;
  2773. USHORT usBootUpVDDCVoltage; //In MV unit
  2774. USHORT usLcdMinPixelClockPLL_Output; // In MHz unit
  2775. USHORT usLcdMaxPixelClockPLL_Output; // In MHz unit
  2776. ULONG ulReserved4; //Was ulAsicMaximumVoltage
  2777. ULONG ulMinPixelClockPLL_Output; //In 10Khz unit
  2778. UCHAR ucRemoteDisplayConfig;
  2779. UCHAR ucReserved5[3]; //Was usMinEngineClockPLL_Input and usMaxEngineClockPLL_Input
  2780. ULONG ulReserved6; //Was usMinEngineClockPLL_Output and usMinMemoryClockPLL_Input
  2781. ULONG ulReserved7; //Was usMaxMemoryClockPLL_Input and usMinMemoryClockPLL_Output
  2782. USHORT usReserved11; //Was usMaxPixelClock; //In 10Khz unit, Max. Pclk used only for DAC
  2783. USHORT usMinPixelClockPLL_Input; //In 10Khz unit
  2784. USHORT usMaxPixelClockPLL_Input; //In 10Khz unit
  2785. USHORT usBootUpVDDCIVoltage; //In unit of mv; Was usMinPixelClockPLL_Output;
  2786. ATOM_FIRMWARE_CAPABILITY_ACCESS usFirmwareCapability;
  2787. USHORT usCoreReferenceClock; //In 10Khz unit
  2788. USHORT usMemoryReferenceClock; //In 10Khz unit
  2789. 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
  2790. UCHAR ucMemoryModule_ID; //Indicate what is the board design
  2791. UCHAR ucCoolingSolution_ID; //0: Air cooling; 1: Liquid cooling ... [COOLING_SOLUTION]
  2792. PRODUCT_BRANDING ucProductBranding; // Bit[7:4]ucBRANDING_ID: Branding ID, Bit[3:2]ucReserved: Reserved, Bit[1:0]ucEMBEDDED_CAP: Embedded feature level.
  2793. UCHAR ucReserved9;
  2794. USHORT usBootUpMVDDCVoltage; //In unit of mv; Was usMinPixelClockPLL_Output;
  2795. USHORT usBootUpVDDGFXVoltage; //In unit of mv;
  2796. ULONG ulReserved10[3]; // New added comparing to previous version
  2797. }ATOM_FIRMWARE_INFO_V2_2;
  2798. #define ATOM_FIRMWARE_INFO_LAST ATOM_FIRMWARE_INFO_V2_2
  2799. // definition of ucRemoteDisplayConfig
  2800. #define REMOTE_DISPLAY_DISABLE 0x00
  2801. #define REMOTE_DISPLAY_ENABLE 0x01
  2802. /****************************************************************************/
  2803. // Structures used in IntegratedSystemInfoTable
  2804. /****************************************************************************/
  2805. #define IGP_CAP_FLAG_DYNAMIC_CLOCK_EN 0x2
  2806. #define IGP_CAP_FLAG_AC_CARD 0x4
  2807. #define IGP_CAP_FLAG_SDVO_CARD 0x8
  2808. #define IGP_CAP_FLAG_POSTDIV_BY_2_MODE 0x10
  2809. typedef struct _ATOM_INTEGRATED_SYSTEM_INFO
  2810. {
  2811. ATOM_COMMON_TABLE_HEADER sHeader;
  2812. ULONG ulBootUpEngineClock; //in 10kHz unit
  2813. ULONG ulBootUpMemoryClock; //in 10kHz unit
  2814. ULONG ulMaxSystemMemoryClock; //in 10kHz unit
  2815. ULONG ulMinSystemMemoryClock; //in 10kHz unit
  2816. UCHAR ucNumberOfCyclesInPeriodHi;
  2817. UCHAR ucLCDTimingSel; //=0:not valid.!=0 sel this timing descriptor from LCD EDID.
  2818. USHORT usReserved1;
  2819. USHORT usInterNBVoltageLow; //An intermidiate PMW value to set the voltage
  2820. USHORT usInterNBVoltageHigh; //Another intermidiate PMW value to set the voltage
  2821. ULONG ulReserved[2];
  2822. USHORT usFSBClock; //In MHz unit
  2823. USHORT usCapabilityFlag; //Bit0=1 indicates the fake HDMI support,Bit1=0/1 for Dynamic clocking dis/enable
  2824. //Bit[3:2]== 0:No PCIE card, 1:AC card, 2:SDVO card
  2825. //Bit[4]==1: P/2 mode, ==0: P/1 mode
  2826. USHORT usPCIENBCfgReg7; //bit[7:0]=MUX_Sel, bit[9:8]=MUX_SEL_LEVEL2, bit[10]=Lane_Reversal
  2827. USHORT usK8MemoryClock; //in MHz unit
  2828. USHORT usK8SyncStartDelay; //in 0.01 us unit
  2829. USHORT usK8DataReturnTime; //in 0.01 us unit
  2830. UCHAR ucMaxNBVoltage;
  2831. UCHAR ucMinNBVoltage;
  2832. UCHAR ucMemoryType; //[7:4]=1:DDR1;=2:DDR2;=3:DDR3.[3:0] is reserved
  2833. UCHAR ucNumberOfCyclesInPeriod; //CG.FVTHROT_PWM_CTRL_REG0.NumberOfCyclesInPeriod
  2834. UCHAR ucStartingPWM_HighTime; //CG.FVTHROT_PWM_CTRL_REG0.StartingPWM_HighTime
  2835. UCHAR ucHTLinkWidth; //16 bit vs. 8 bit
  2836. UCHAR ucMaxNBVoltageHigh;
  2837. UCHAR ucMinNBVoltageHigh;
  2838. }ATOM_INTEGRATED_SYSTEM_INFO;
  2839. /* Explanation on entries in ATOM_INTEGRATED_SYSTEM_INFO
  2840. ulBootUpMemoryClock: For Intel IGP,it's the UMA system memory clock
  2841. For AMD IGP,it's 0 if no SidePort memory installed or it's the boot-up SidePort memory clock
  2842. 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
  2843. For AMD IGP,for now this can be 0
  2844. ulMinSystemMemoryClock: For Intel IGP,it's 133MHz if memory runs in ASYNC mode or otherwise (SYNC mode) it's 0
  2845. For AMD IGP,for now this can be 0
  2846. usFSBClock: For Intel IGP,it's FSB Freq
  2847. For AMD IGP,it's HT Link Speed
  2848. usK8MemoryClock: For AMD IGP only. For RevF CPU, set it to 200
  2849. usK8SyncStartDelay: For AMD IGP only. Memory access latency in K8, required for watermark calculation
  2850. usK8DataReturnTime: For AMD IGP only. Memory access latency in K8, required for watermark calculation
  2851. VC:Voltage Control
  2852. 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.
  2853. 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.
  2854. ucNumberOfCyclesInPeriod: Indicate how many cycles when PWM duty is 100%. low 8 bits of the value.
  2855. 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
  2856. 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.
  2857. 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.
  2858. 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.
  2859. 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.
  2860. */
  2861. /*
  2862. The following IGP table is introduced from RS780, which is supposed to be put by SBIOS in FB before IGP VBIOS starts VPOST;
  2863. 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.
  2864. 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.
  2865. SW components can access the IGP system infor structure in the same way as before
  2866. */
  2867. typedef struct _ATOM_INTEGRATED_SYSTEM_INFO_V2
  2868. {
  2869. ATOM_COMMON_TABLE_HEADER sHeader;
  2870. ULONG ulBootUpEngineClock; //in 10kHz unit
  2871. ULONG ulReserved1[2]; //must be 0x0 for the reserved
  2872. ULONG ulBootUpUMAClock; //in 10kHz unit
  2873. ULONG ulBootUpSidePortClock; //in 10kHz unit
  2874. ULONG ulMinSidePortClock; //in 10kHz unit
  2875. ULONG ulReserved2[6]; //must be 0x0 for the reserved
  2876. ULONG ulSystemConfig; //see explanation below
  2877. ULONG ulBootUpReqDisplayVector;
  2878. ULONG ulOtherDisplayMisc;
  2879. ULONG ulDDISlot1Config;
  2880. ULONG ulDDISlot2Config;
  2881. UCHAR ucMemoryType; //[3:0]=1:DDR1;=2:DDR2;=3:DDR3.[7:4] is reserved
  2882. UCHAR ucUMAChannelNumber;
  2883. UCHAR ucDockingPinBit;
  2884. UCHAR ucDockingPinPolarity;
  2885. ULONG ulDockingPinCFGInfo;
  2886. ULONG ulCPUCapInfo;
  2887. USHORT usNumberOfCyclesInPeriod;
  2888. USHORT usMaxNBVoltage;
  2889. USHORT usMinNBVoltage;
  2890. USHORT usBootUpNBVoltage;
  2891. ULONG ulHTLinkFreq; //in 10Khz
  2892. USHORT usMinHTLinkWidth;
  2893. USHORT usMaxHTLinkWidth;
  2894. USHORT usUMASyncStartDelay;
  2895. USHORT usUMADataReturnTime;
  2896. USHORT usLinkStatusZeroTime;
  2897. USHORT usDACEfuse; //for storing badgap value (for RS880 only)
  2898. ULONG ulHighVoltageHTLinkFreq; // in 10Khz
  2899. ULONG ulLowVoltageHTLinkFreq; // in 10Khz
  2900. USHORT usMaxUpStreamHTLinkWidth;
  2901. USHORT usMaxDownStreamHTLinkWidth;
  2902. USHORT usMinUpStreamHTLinkWidth;
  2903. USHORT usMinDownStreamHTLinkWidth;
  2904. USHORT usFirmwareVersion; //0 means FW is not supported. Otherwise it's the FW version loaded by SBIOS and driver should enable FW.
  2905. USHORT usFullT0Time; // Input to calculate minimum HT link change time required by NB P-State. Unit is 0.01us.
  2906. ULONG ulReserved3[96]; //must be 0x0
  2907. }ATOM_INTEGRATED_SYSTEM_INFO_V2;
  2908. /*
  2909. ulBootUpEngineClock: Boot-up Engine Clock in 10Khz;
  2910. ulBootUpUMAClock: Boot-up UMA Clock in 10Khz; it must be 0x0 when UMA is not present
  2911. 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
  2912. ulSystemConfig:
  2913. Bit[0]=1: PowerExpress mode =0 Non-PowerExpress mode;
  2914. 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
  2915. =0: system boots up at driver control state. Power state depends on PowerPlay table.
  2916. Bit[2]=1: PWM method is used on NB voltage control. =0: GPIO method is used.
  2917. Bit[3]=1: Only one power state(Performance) will be supported.
  2918. =0: Multiple power states supported from PowerPlay table.
  2919. Bit[4]=1: CLMC is supported and enabled on current system.
  2920. =0: CLMC is not supported or enabled on current system. SBIOS need to support HT link/freq change through ATIF interface.
  2921. 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.
  2922. =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.
  2923. 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.
  2924. =0: Voltage settings is determined by powerplay table.
  2925. 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.
  2926. =0: Enable CLMC as regular mode, CDLD and CILR will be enabled.
  2927. Bit[8]=1: CDLF is supported and enabled on current system.
  2928. =0: CDLF is not supported or enabled on current system.
  2929. Bit[9]=1: DLL Shut Down feature is enabled on current system.
  2930. =0: DLL Shut Down feature is not enabled or supported on current system.
  2931. 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.
  2932. ulOtherDisplayMisc: [15:8]- Bootup LCD Expansion selection; 0-center, 1-full panel size expansion;
  2933. [7:0] - BootupTV standard selection; This is a bit vector to indicate what TV standards are supported by the system. Refer to ucTVSuppportedStd definition;
  2934. ulDDISlot1Config: Describes the PCIE lane configuration on this DDI PCIE slot (ADD2 card) or connector (Mobile design).
  2935. [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)
  2936. [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)
  2937. 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.
  2938. in both chassis and docking, SBIOS has to duplicate the same PCIE lane info from chassis to docking or vice versa. For example:
  2939. 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.
  2940. [15:8] - Lane configuration attribute;
  2941. [23:16]- Connector type, possible value:
  2942. CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D
  2943. CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D
  2944. CONNECTOR_OBJECT_ID_HDMI_TYPE_A
  2945. CONNECTOR_OBJECT_ID_DISPLAYPORT
  2946. CONNECTOR_OBJECT_ID_eDP
  2947. [31:24]- Reserved
  2948. ulDDISlot2Config: Same as Slot1.
  2949. 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.
  2950. For IGP, Hypermemory is the only memory type showed in CCC.
  2951. ucUMAChannelNumber: how many channels for the UMA;
  2952. ulDockingPinCFGInfo: [15:0]-Bus/Device/Function # to CFG to read this Docking Pin; [31:16]-reg offset in CFG to read this pin
  2953. ucDockingPinBit: which bit in this register to read the pin status;
  2954. ucDockingPinPolarity:Polarity of the pin when docked;
  2955. 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
  2956. usNumberOfCyclesInPeriod:Indicate how many cycles when PWM duty is 100%.
  2957. usMaxNBVoltage:Max. voltage control value in either PWM or GPIO mode.
  2958. usMinNBVoltage:Min. voltage control value in either PWM or GPIO mode.
  2959. GPIO mode: both usMaxNBVoltage & usMinNBVoltage have a valid value ulSystemConfig.SYSTEM_CONFIG_USE_PWM_ON_VOLTAGE=0
  2960. PWM mode: both usMaxNBVoltage & usMinNBVoltage have a valid value ulSystemConfig.SYSTEM_CONFIG_USE_PWM_ON_VOLTAGE=1
  2961. GPU SW don't control mode: usMaxNBVoltage & usMinNBVoltage=0 and no care about ulSystemConfig.SYSTEM_CONFIG_USE_PWM_ON_VOLTAGE
  2962. usBootUpNBVoltage:Boot-up voltage regulator dependent PWM value.
  2963. ulHTLinkFreq: Bootup HT link Frequency in 10Khz.
  2964. usMinHTLinkWidth: Bootup minimum HT link width. If CDLW disabled, this is equal to usMaxHTLinkWidth.
  2965. If CDLW enabled, both upstream and downstream width should be the same during bootup.
  2966. usMaxHTLinkWidth: Bootup maximum HT link width. If CDLW disabled, this is equal to usMinHTLinkWidth.
  2967. If CDLW enabled, both upstream and downstream width should be the same during bootup.
  2968. usUMASyncStartDelay: Memory access latency, required for watermark calculation
  2969. usUMADataReturnTime: Memory access latency, required for watermark calculation
  2970. 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
  2971. for Griffin or Greyhound. SBIOS needs to convert to actual time by:
  2972. if T0Ttime [5:4]=00b, then usLinkStatusZeroTime=T0Ttime [3:0]*0.1us (0.0 to 1.5us)
  2973. if T0Ttime [5:4]=01b, then usLinkStatusZeroTime=T0Ttime [3:0]*0.5us (0.0 to 7.5us)
  2974. if T0Ttime [5:4]=10b, then usLinkStatusZeroTime=T0Ttime [3:0]*2.0us (0.0 to 30us)
  2975. if T0Ttime [5:4]=11b, and T0Ttime [3:0]=0x0 to 0xa, then usLinkStatusZeroTime=T0Ttime [3:0]*20us (0.0 to 200us)
  2976. ulHighVoltageHTLinkFreq: HT link frequency for power state with low voltage. If boot up runs in HT1, this must be 0.
  2977. This must be less than or equal to ulHTLinkFreq(bootup frequency).
  2978. 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.
  2979. This must be less than or equal to ulHighVoltageHTLinkFreq.
  2980. usMaxUpStreamHTLinkWidth: Asymmetric link width support in the future, to replace usMaxHTLinkWidth. Not used for now.
  2981. usMaxDownStreamHTLinkWidth: same as above.
  2982. usMinUpStreamHTLinkWidth: Asymmetric link width support in the future, to replace usMinHTLinkWidth. Not used for now.
  2983. usMinDownStreamHTLinkWidth: same as above.
  2984. */
  2985. // ATOM_INTEGRATED_SYSTEM_INFO::ulCPUCapInfo - CPU type definition
  2986. #define INTEGRATED_SYSTEM_INFO__UNKNOWN_CPU 0
  2987. #define INTEGRATED_SYSTEM_INFO__AMD_CPU__GRIFFIN 1
  2988. #define INTEGRATED_SYSTEM_INFO__AMD_CPU__GREYHOUND 2
  2989. #define INTEGRATED_SYSTEM_INFO__AMD_CPU__K8 3
  2990. #define INTEGRATED_SYSTEM_INFO__AMD_CPU__PHARAOH 4
  2991. #define INTEGRATED_SYSTEM_INFO__AMD_CPU__OROCHI 5
  2992. #define INTEGRATED_SYSTEM_INFO__AMD_CPU__MAX_CODE INTEGRATED_SYSTEM_INFO__AMD_CPU__OROCHI // this deff reflects max defined CPU code
  2993. #define SYSTEM_CONFIG_POWEREXPRESS_ENABLE 0x00000001
  2994. #define SYSTEM_CONFIG_RUN_AT_OVERDRIVE_ENGINE 0x00000002
  2995. #define SYSTEM_CONFIG_USE_PWM_ON_VOLTAGE 0x00000004
  2996. #define SYSTEM_CONFIG_PERFORMANCE_POWERSTATE_ONLY 0x00000008
  2997. #define SYSTEM_CONFIG_CLMC_ENABLED 0x00000010
  2998. #define SYSTEM_CONFIG_CDLW_ENABLED 0x00000020
  2999. #define SYSTEM_CONFIG_HIGH_VOLTAGE_REQUESTED 0x00000040
  3000. #define SYSTEM_CONFIG_CLMC_HYBRID_MODE_ENABLED 0x00000080
  3001. #define SYSTEM_CONFIG_CDLF_ENABLED 0x00000100
  3002. #define SYSTEM_CONFIG_DLL_SHUTDOWN_ENABLED 0x00000200
  3003. #define IGP_DDI_SLOT_LANE_CONFIG_MASK 0x000000FF
  3004. #define b0IGP_DDI_SLOT_LANE_MAP_MASK 0x0F
  3005. #define b0IGP_DDI_SLOT_DOCKING_LANE_MAP_MASK 0xF0
  3006. #define b0IGP_DDI_SLOT_CONFIG_LANE_0_3 0x01
  3007. #define b0IGP_DDI_SLOT_CONFIG_LANE_4_7 0x02
  3008. #define b0IGP_DDI_SLOT_CONFIG_LANE_8_11 0x04
  3009. #define b0IGP_DDI_SLOT_CONFIG_LANE_12_15 0x08
  3010. #define IGP_DDI_SLOT_ATTRIBUTE_MASK 0x0000FF00
  3011. #define IGP_DDI_SLOT_CONFIG_REVERSED 0x00000100
  3012. #define b1IGP_DDI_SLOT_CONFIG_REVERSED 0x01
  3013. #define IGP_DDI_SLOT_CONNECTOR_TYPE_MASK 0x00FF0000
  3014. // IntegratedSystemInfoTable new Rev is V5 after V2, because of the real rev of V2 is v1.4. This rev is used for RR
  3015. typedef struct _ATOM_INTEGRATED_SYSTEM_INFO_V5
  3016. {
  3017. ATOM_COMMON_TABLE_HEADER sHeader;
  3018. ULONG ulBootUpEngineClock; //in 10kHz unit
  3019. ULONG ulDentistVCOFreq; //Dentist VCO clock in 10kHz unit, the source of GPU SCLK, LCLK, UCLK and VCLK.
  3020. ULONG ulLClockFreq; //GPU Lclk freq in 10kHz unit, have relationship with NCLK in NorthBridge
  3021. ULONG ulBootUpUMAClock; //in 10kHz unit
  3022. ULONG ulReserved1[8]; //must be 0x0 for the reserved
  3023. ULONG ulBootUpReqDisplayVector;
  3024. ULONG ulOtherDisplayMisc;
  3025. ULONG ulReserved2[4]; //must be 0x0 for the reserved
  3026. ULONG ulSystemConfig; //TBD
  3027. ULONG ulCPUCapInfo; //TBD
  3028. USHORT usMaxNBVoltage; //high NB voltage, calculated using current VDDNB (D24F2xDC) and VDDNB offset fuse;
  3029. USHORT usMinNBVoltage; //low NB voltage, calculated using current VDDNB (D24F2xDC) and VDDNB offset fuse;
  3030. USHORT usBootUpNBVoltage; //boot up NB voltage
  3031. UCHAR ucHtcTmpLmt; //bit [22:16] of D24F3x64 Hardware Thermal Control (HTC) Register, may not be needed, TBD
  3032. UCHAR ucTjOffset; //bit [28:22] of D24F3xE4 Thermtrip Status Register,may not be needed, TBD
  3033. ULONG ulReserved3[4]; //must be 0x0 for the reserved
  3034. ULONG ulDDISlot1Config; //see above ulDDISlot1Config definition
  3035. ULONG ulDDISlot2Config;
  3036. ULONG ulDDISlot3Config;
  3037. ULONG ulDDISlot4Config;
  3038. ULONG ulReserved4[4]; //must be 0x0 for the reserved
  3039. UCHAR ucMemoryType; //[3:0]=1:DDR1;=2:DDR2;=3:DDR3.[7:4] is reserved
  3040. UCHAR ucUMAChannelNumber;
  3041. USHORT usReserved;
  3042. ULONG ulReserved5[4]; //must be 0x0 for the reserved
  3043. ULONG ulCSR_M3_ARB_CNTL_DEFAULT[10];//arrays with values for CSR M3 arbiter for default
  3044. ULONG ulCSR_M3_ARB_CNTL_UVD[10]; //arrays with values for CSR M3 arbiter for UVD playback
  3045. ULONG ulCSR_M3_ARB_CNTL_FS3D[10];//arrays with values for CSR M3 arbiter for Full Screen 3D applications
  3046. ULONG ulReserved6[61]; //must be 0x0
  3047. }ATOM_INTEGRATED_SYSTEM_INFO_V5;
  3048. /****************************************************************************/
  3049. // Structure used in GPUVirtualizationInfoTable
  3050. /****************************************************************************/
  3051. typedef struct _ATOM_GPU_VIRTUALIZATION_INFO_V2_1
  3052. {
  3053. ATOM_COMMON_TABLE_HEADER sHeader;
  3054. ULONG ulMCUcodeRomStartAddr;
  3055. ULONG ulMCUcodeLength;
  3056. ULONG ulSMCUcodeRomStartAddr;
  3057. ULONG ulSMCUcodeLength;
  3058. ULONG ulRLCVUcodeRomStartAddr;
  3059. ULONG ulRLCVUcodeLength;
  3060. ULONG ulTOCUcodeStartAddr;
  3061. ULONG ulTOCUcodeLength;
  3062. ULONG ulSMCPatchTableStartAddr;
  3063. ULONG ulSmcPatchTableLength;
  3064. ULONG ulSystemFlag;
  3065. }ATOM_GPU_VIRTUALIZATION_INFO_V2_1;
  3066. #define ATOM_CRT_INT_ENCODER1_INDEX 0x00000000
  3067. #define ATOM_LCD_INT_ENCODER1_INDEX 0x00000001
  3068. #define ATOM_TV_INT_ENCODER1_INDEX 0x00000002
  3069. #define ATOM_DFP_INT_ENCODER1_INDEX 0x00000003
  3070. #define ATOM_CRT_INT_ENCODER2_INDEX 0x00000004
  3071. #define ATOM_LCD_EXT_ENCODER1_INDEX 0x00000005
  3072. #define ATOM_TV_EXT_ENCODER1_INDEX 0x00000006
  3073. #define ATOM_DFP_EXT_ENCODER1_INDEX 0x00000007
  3074. #define ATOM_CV_INT_ENCODER1_INDEX 0x00000008
  3075. #define ATOM_DFP_INT_ENCODER2_INDEX 0x00000009
  3076. #define ATOM_CRT_EXT_ENCODER1_INDEX 0x0000000A
  3077. #define ATOM_CV_EXT_ENCODER1_INDEX 0x0000000B
  3078. #define ATOM_DFP_INT_ENCODER3_INDEX 0x0000000C
  3079. #define ATOM_DFP_INT_ENCODER4_INDEX 0x0000000D
  3080. // define ASIC internal encoder id ( bit vector ), used for CRTC_SourceSelTable
  3081. #define ASIC_INT_DAC1_ENCODER_ID 0x00
  3082. #define ASIC_INT_TV_ENCODER_ID 0x02
  3083. #define ASIC_INT_DIG1_ENCODER_ID 0x03
  3084. #define ASIC_INT_DAC2_ENCODER_ID 0x04
  3085. #define ASIC_EXT_TV_ENCODER_ID 0x06
  3086. #define ASIC_INT_DVO_ENCODER_ID 0x07
  3087. #define ASIC_INT_DIG2_ENCODER_ID 0x09
  3088. #define ASIC_EXT_DIG_ENCODER_ID 0x05
  3089. #define ASIC_EXT_DIG2_ENCODER_ID 0x08
  3090. #define ASIC_INT_DIG3_ENCODER_ID 0x0a
  3091. #define ASIC_INT_DIG4_ENCODER_ID 0x0b
  3092. #define ASIC_INT_DIG5_ENCODER_ID 0x0c
  3093. #define ASIC_INT_DIG6_ENCODER_ID 0x0d
  3094. #define ASIC_INT_DIG7_ENCODER_ID 0x0e
  3095. //define Encoder attribute
  3096. #define ATOM_ANALOG_ENCODER 0
  3097. #define ATOM_DIGITAL_ENCODER 1
  3098. #define ATOM_DP_ENCODER 2
  3099. #define ATOM_ENCODER_ENUM_MASK 0x70
  3100. #define ATOM_ENCODER_ENUM_ID1 0x00
  3101. #define ATOM_ENCODER_ENUM_ID2 0x10
  3102. #define ATOM_ENCODER_ENUM_ID3 0x20
  3103. #define ATOM_ENCODER_ENUM_ID4 0x30
  3104. #define ATOM_ENCODER_ENUM_ID5 0x40
  3105. #define ATOM_ENCODER_ENUM_ID6 0x50
  3106. #define ATOM_DEVICE_CRT1_INDEX 0x00000000
  3107. #define ATOM_DEVICE_LCD1_INDEX 0x00000001
  3108. #define ATOM_DEVICE_TV1_INDEX 0x00000002
  3109. #define ATOM_DEVICE_DFP1_INDEX 0x00000003
  3110. #define ATOM_DEVICE_CRT2_INDEX 0x00000004
  3111. #define ATOM_DEVICE_LCD2_INDEX 0x00000005
  3112. #define ATOM_DEVICE_DFP6_INDEX 0x00000006
  3113. #define ATOM_DEVICE_DFP2_INDEX 0x00000007
  3114. #define ATOM_DEVICE_CV_INDEX 0x00000008
  3115. #define ATOM_DEVICE_DFP3_INDEX 0x00000009
  3116. #define ATOM_DEVICE_DFP4_INDEX 0x0000000A
  3117. #define ATOM_DEVICE_DFP5_INDEX 0x0000000B
  3118. #define ATOM_DEVICE_RESERVEDC_INDEX 0x0000000C
  3119. #define ATOM_DEVICE_RESERVEDD_INDEX 0x0000000D
  3120. #define ATOM_DEVICE_RESERVEDE_INDEX 0x0000000E
  3121. #define ATOM_DEVICE_RESERVEDF_INDEX 0x0000000F
  3122. #define ATOM_MAX_SUPPORTED_DEVICE_INFO (ATOM_DEVICE_DFP3_INDEX+1)
  3123. #define ATOM_MAX_SUPPORTED_DEVICE_INFO_2 ATOM_MAX_SUPPORTED_DEVICE_INFO
  3124. #define ATOM_MAX_SUPPORTED_DEVICE_INFO_3 (ATOM_DEVICE_DFP5_INDEX + 1 )
  3125. #define ATOM_MAX_SUPPORTED_DEVICE (ATOM_DEVICE_RESERVEDF_INDEX+1)
  3126. #define ATOM_DEVICE_CRT1_SUPPORT (0x1L << ATOM_DEVICE_CRT1_INDEX )
  3127. #define ATOM_DEVICE_LCD1_SUPPORT (0x1L << ATOM_DEVICE_LCD1_INDEX )
  3128. #define ATOM_DEVICE_TV1_SUPPORT (0x1L << ATOM_DEVICE_TV1_INDEX )
  3129. #define ATOM_DEVICE_DFP1_SUPPORT (0x1L << ATOM_DEVICE_DFP1_INDEX )
  3130. #define ATOM_DEVICE_CRT2_SUPPORT (0x1L << ATOM_DEVICE_CRT2_INDEX )
  3131. #define ATOM_DEVICE_LCD2_SUPPORT (0x1L << ATOM_DEVICE_LCD2_INDEX )
  3132. #define ATOM_DEVICE_DFP6_SUPPORT (0x1L << ATOM_DEVICE_DFP6_INDEX )
  3133. #define ATOM_DEVICE_DFP2_SUPPORT (0x1L << ATOM_DEVICE_DFP2_INDEX )
  3134. #define ATOM_DEVICE_CV_SUPPORT (0x1L << ATOM_DEVICE_CV_INDEX )
  3135. #define ATOM_DEVICE_DFP3_SUPPORT (0x1L << ATOM_DEVICE_DFP3_INDEX )
  3136. #define ATOM_DEVICE_DFP4_SUPPORT (0x1L << ATOM_DEVICE_DFP4_INDEX )
  3137. #define ATOM_DEVICE_DFP5_SUPPORT (0x1L << ATOM_DEVICE_DFP5_INDEX )
  3138. #define ATOM_DEVICE_CRT_SUPPORT (ATOM_DEVICE_CRT1_SUPPORT | ATOM_DEVICE_CRT2_SUPPORT)
  3139. #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)
  3140. #define ATOM_DEVICE_TV_SUPPORT ATOM_DEVICE_TV1_SUPPORT
  3141. #define ATOM_DEVICE_LCD_SUPPORT (ATOM_DEVICE_LCD1_SUPPORT | ATOM_DEVICE_LCD2_SUPPORT)
  3142. #define ATOM_DEVICE_CONNECTOR_TYPE_MASK 0x000000F0
  3143. #define ATOM_DEVICE_CONNECTOR_TYPE_SHIFT 0x00000004
  3144. #define ATOM_DEVICE_CONNECTOR_VGA 0x00000001
  3145. #define ATOM_DEVICE_CONNECTOR_DVI_I 0x00000002
  3146. #define ATOM_DEVICE_CONNECTOR_DVI_D 0x00000003
  3147. #define ATOM_DEVICE_CONNECTOR_DVI_A 0x00000004
  3148. #define ATOM_DEVICE_CONNECTOR_SVIDEO 0x00000005
  3149. #define ATOM_DEVICE_CONNECTOR_COMPOSITE 0x00000006
  3150. #define ATOM_DEVICE_CONNECTOR_LVDS 0x00000007
  3151. #define ATOM_DEVICE_CONNECTOR_DIGI_LINK 0x00000008
  3152. #define ATOM_DEVICE_CONNECTOR_SCART 0x00000009
  3153. #define ATOM_DEVICE_CONNECTOR_HDMI_TYPE_A 0x0000000A
  3154. #define ATOM_DEVICE_CONNECTOR_HDMI_TYPE_B 0x0000000B
  3155. #define ATOM_DEVICE_CONNECTOR_CASE_1 0x0000000E
  3156. #define ATOM_DEVICE_CONNECTOR_DISPLAYPORT 0x0000000F
  3157. #define ATOM_DEVICE_DAC_INFO_MASK 0x0000000F
  3158. #define ATOM_DEVICE_DAC_INFO_SHIFT 0x00000000
  3159. #define ATOM_DEVICE_DAC_INFO_NODAC 0x00000000
  3160. #define ATOM_DEVICE_DAC_INFO_DACA 0x00000001
  3161. #define ATOM_DEVICE_DAC_INFO_DACB 0x00000002
  3162. #define ATOM_DEVICE_DAC_INFO_EXDAC 0x00000003
  3163. #define ATOM_DEVICE_I2C_ID_NOI2C 0x00000000
  3164. #define ATOM_DEVICE_I2C_LINEMUX_MASK 0x0000000F
  3165. #define ATOM_DEVICE_I2C_LINEMUX_SHIFT 0x00000000
  3166. #define ATOM_DEVICE_I2C_ID_MASK 0x00000070
  3167. #define ATOM_DEVICE_I2C_ID_SHIFT 0x00000004
  3168. #define ATOM_DEVICE_I2C_ID_IS_FOR_NON_MM_USE 0x00000001
  3169. #define ATOM_DEVICE_I2C_ID_IS_FOR_MM_USE 0x00000002
  3170. #define ATOM_DEVICE_I2C_ID_IS_FOR_SDVO_USE 0x00000003 //For IGP RS600
  3171. #define ATOM_DEVICE_I2C_ID_IS_FOR_DAC_SCL 0x00000004 //For IGP RS690
  3172. #define ATOM_DEVICE_I2C_HARDWARE_CAP_MASK 0x00000080
  3173. #define ATOM_DEVICE_I2C_HARDWARE_CAP_SHIFT 0x00000007
  3174. #define ATOM_DEVICE_USES_SOFTWARE_ASSISTED_I2C 0x00000000
  3175. #define ATOM_DEVICE_USES_HARDWARE_ASSISTED_I2C 0x00000001
  3176. // usDeviceSupport:
  3177. // Bits0 = 0 - no CRT1 support= 1- CRT1 is supported
  3178. // Bit 1 = 0 - no LCD1 support= 1- LCD1 is supported
  3179. // Bit 2 = 0 - no TV1 support= 1- TV1 is supported
  3180. // Bit 3 = 0 - no DFP1 support= 1- DFP1 is supported
  3181. // Bit 4 = 0 - no CRT2 support= 1- CRT2 is supported
  3182. // Bit 5 = 0 - no LCD2 support= 1- LCD2 is supported
  3183. // Bit 6 = 0 - no DFP6 support= 1- DFP6 is supported
  3184. // Bit 7 = 0 - no DFP2 support= 1- DFP2 is supported
  3185. // Bit 8 = 0 - no CV support= 1- CV is supported
  3186. // Bit 9 = 0 - no DFP3 support= 1- DFP3 is supported
  3187. // Bit 10= 0 - no DFP4 support= 1- DFP4 is supported
  3188. // Bit 11= 0 - no DFP5 support= 1- DFP5 is supported
  3189. //
  3190. //
  3191. /****************************************************************************/
  3192. // Structure used in MclkSS_InfoTable
  3193. /****************************************************************************/
  3194. // ucI2C_ConfigID
  3195. // [7:0] - I2C LINE Associate ID
  3196. // = 0 - no I2C
  3197. // [7] - HW_Cap = 1, [6:0]=HW assisted I2C ID(HW line selection)
  3198. // = 0, [6:0]=SW assisted I2C ID
  3199. // [6-4] - HW_ENGINE_ID = 1, HW engine for NON multimedia use
  3200. // = 2, HW engine for Multimedia use
  3201. // = 3-7 Reserved for future I2C engines
  3202. // [3-0] - I2C_LINE_MUX = A Mux number when it's HW assisted I2C or GPIO ID when it's SW I2C
  3203. typedef struct _ATOM_I2C_ID_CONFIG
  3204. {
  3205. #if ATOM_BIG_ENDIAN
  3206. UCHAR bfHW_Capable:1;
  3207. UCHAR bfHW_EngineID:3;
  3208. UCHAR bfI2C_LineMux:4;
  3209. #else
  3210. UCHAR bfI2C_LineMux:4;
  3211. UCHAR bfHW_EngineID:3;
  3212. UCHAR bfHW_Capable:1;
  3213. #endif
  3214. }ATOM_I2C_ID_CONFIG;
  3215. typedef union _ATOM_I2C_ID_CONFIG_ACCESS
  3216. {
  3217. ATOM_I2C_ID_CONFIG sbfAccess;
  3218. UCHAR ucAccess;
  3219. }ATOM_I2C_ID_CONFIG_ACCESS;
  3220. /****************************************************************************/
  3221. // Structure used in GPIO_I2C_InfoTable
  3222. /****************************************************************************/
  3223. typedef struct _ATOM_GPIO_I2C_ASSIGMENT
  3224. {
  3225. USHORT usClkMaskRegisterIndex;
  3226. USHORT usClkEnRegisterIndex;
  3227. USHORT usClkY_RegisterIndex;
  3228. USHORT usClkA_RegisterIndex;
  3229. USHORT usDataMaskRegisterIndex;
  3230. USHORT usDataEnRegisterIndex;
  3231. USHORT usDataY_RegisterIndex;
  3232. USHORT usDataA_RegisterIndex;
  3233. ATOM_I2C_ID_CONFIG_ACCESS sucI2cId;
  3234. UCHAR ucClkMaskShift;
  3235. UCHAR ucClkEnShift;
  3236. UCHAR ucClkY_Shift;
  3237. UCHAR ucClkA_Shift;
  3238. UCHAR ucDataMaskShift;
  3239. UCHAR ucDataEnShift;
  3240. UCHAR ucDataY_Shift;
  3241. UCHAR ucDataA_Shift;
  3242. UCHAR ucReserved1;
  3243. UCHAR ucReserved2;
  3244. }ATOM_GPIO_I2C_ASSIGMENT;
  3245. typedef struct _ATOM_GPIO_I2C_INFO
  3246. {
  3247. ATOM_COMMON_TABLE_HEADER sHeader;
  3248. ATOM_GPIO_I2C_ASSIGMENT asGPIO_Info[ATOM_MAX_SUPPORTED_DEVICE];
  3249. }ATOM_GPIO_I2C_INFO;
  3250. /****************************************************************************/
  3251. // Common Structure used in other structures
  3252. /****************************************************************************/
  3253. #ifndef _H2INC
  3254. //Please don't add or expand this bitfield structure below, this one will retire soon.!
  3255. typedef struct _ATOM_MODE_MISC_INFO
  3256. {
  3257. #if ATOM_BIG_ENDIAN
  3258. USHORT Reserved:6;
  3259. USHORT RGB888:1;
  3260. USHORT DoubleClock:1;
  3261. USHORT Interlace:1;
  3262. USHORT CompositeSync:1;
  3263. USHORT V_ReplicationBy2:1;
  3264. USHORT H_ReplicationBy2:1;
  3265. USHORT VerticalCutOff:1;
  3266. USHORT VSyncPolarity:1; //0=Active High, 1=Active Low
  3267. USHORT HSyncPolarity:1; //0=Active High, 1=Active Low
  3268. USHORT HorizontalCutOff:1;
  3269. #else
  3270. USHORT HorizontalCutOff:1;
  3271. USHORT HSyncPolarity:1; //0=Active High, 1=Active Low
  3272. USHORT VSyncPolarity:1; //0=Active High, 1=Active Low
  3273. USHORT VerticalCutOff:1;
  3274. USHORT H_ReplicationBy2:1;
  3275. USHORT V_ReplicationBy2:1;
  3276. USHORT CompositeSync:1;
  3277. USHORT Interlace:1;
  3278. USHORT DoubleClock:1;
  3279. USHORT RGB888:1;
  3280. USHORT Reserved:6;
  3281. #endif
  3282. }ATOM_MODE_MISC_INFO;
  3283. typedef union _ATOM_MODE_MISC_INFO_ACCESS
  3284. {
  3285. ATOM_MODE_MISC_INFO sbfAccess;
  3286. USHORT usAccess;
  3287. }ATOM_MODE_MISC_INFO_ACCESS;
  3288. #else
  3289. typedef union _ATOM_MODE_MISC_INFO_ACCESS
  3290. {
  3291. USHORT usAccess;
  3292. }ATOM_MODE_MISC_INFO_ACCESS;
  3293. #endif
  3294. // usModeMiscInfo-
  3295. #define ATOM_H_CUTOFF 0x01
  3296. #define ATOM_HSYNC_POLARITY 0x02 //0=Active High, 1=Active Low
  3297. #define ATOM_VSYNC_POLARITY 0x04 //0=Active High, 1=Active Low
  3298. #define ATOM_V_CUTOFF 0x08
  3299. #define ATOM_H_REPLICATIONBY2 0x10
  3300. #define ATOM_V_REPLICATIONBY2 0x20
  3301. #define ATOM_COMPOSITESYNC 0x40
  3302. #define ATOM_INTERLACE 0x80
  3303. #define ATOM_DOUBLE_CLOCK_MODE 0x100
  3304. #define ATOM_RGB888_MODE 0x200
  3305. //usRefreshRate-
  3306. #define ATOM_REFRESH_43 43
  3307. #define ATOM_REFRESH_47 47
  3308. #define ATOM_REFRESH_56 56
  3309. #define ATOM_REFRESH_60 60
  3310. #define ATOM_REFRESH_65 65
  3311. #define ATOM_REFRESH_70 70
  3312. #define ATOM_REFRESH_72 72
  3313. #define ATOM_REFRESH_75 75
  3314. #define ATOM_REFRESH_85 85
  3315. // ATOM_MODE_TIMING data are exactly the same as VESA timing data.
  3316. // Translation from EDID to ATOM_MODE_TIMING, use the following formula.
  3317. //
  3318. // VESA_HTOTAL = VESA_ACTIVE + 2* VESA_BORDER + VESA_BLANK
  3319. // = EDID_HA + EDID_HBL
  3320. // VESA_HDISP = VESA_ACTIVE = EDID_HA
  3321. // VESA_HSYNC_START = VESA_ACTIVE + VESA_BORDER + VESA_FRONT_PORCH
  3322. // = EDID_HA + EDID_HSO
  3323. // VESA_HSYNC_WIDTH = VESA_HSYNC_TIME = EDID_HSPW
  3324. // VESA_BORDER = EDID_BORDER
  3325. /****************************************************************************/
  3326. // Structure used in SetCRTC_UsingDTDTimingTable
  3327. /****************************************************************************/
  3328. typedef struct _SET_CRTC_USING_DTD_TIMING_PARAMETERS
  3329. {
  3330. USHORT usH_Size;
  3331. USHORT usH_Blanking_Time;
  3332. USHORT usV_Size;
  3333. USHORT usV_Blanking_Time;
  3334. USHORT usH_SyncOffset;
  3335. USHORT usH_SyncWidth;
  3336. USHORT usV_SyncOffset;
  3337. USHORT usV_SyncWidth;
  3338. ATOM_MODE_MISC_INFO_ACCESS susModeMiscInfo;
  3339. UCHAR ucH_Border; // From DFP EDID
  3340. UCHAR ucV_Border;
  3341. UCHAR ucCRTC; // ATOM_CRTC1 or ATOM_CRTC2
  3342. UCHAR ucPadding[3];
  3343. }SET_CRTC_USING_DTD_TIMING_PARAMETERS;
  3344. /****************************************************************************/
  3345. // Structure used in SetCRTC_TimingTable
  3346. /****************************************************************************/
  3347. typedef struct _SET_CRTC_TIMING_PARAMETERS
  3348. {
  3349. USHORT usH_Total; // horizontal total
  3350. USHORT usH_Disp; // horizontal display
  3351. USHORT usH_SyncStart; // horozontal Sync start
  3352. USHORT usH_SyncWidth; // horizontal Sync width
  3353. USHORT usV_Total; // vertical total
  3354. USHORT usV_Disp; // vertical display
  3355. USHORT usV_SyncStart; // vertical Sync start
  3356. USHORT usV_SyncWidth; // vertical Sync width
  3357. ATOM_MODE_MISC_INFO_ACCESS susModeMiscInfo;
  3358. UCHAR ucCRTC; // ATOM_CRTC1 or ATOM_CRTC2
  3359. UCHAR ucOverscanRight; // right
  3360. UCHAR ucOverscanLeft; // left
  3361. UCHAR ucOverscanBottom; // bottom
  3362. UCHAR ucOverscanTop; // top
  3363. UCHAR ucReserved;
  3364. }SET_CRTC_TIMING_PARAMETERS;
  3365. #define SET_CRTC_TIMING_PARAMETERS_PS_ALLOCATION SET_CRTC_TIMING_PARAMETERS
  3366. /****************************************************************************/
  3367. // Structure used in StandardVESA_TimingTable
  3368. // AnalogTV_InfoTable
  3369. // ComponentVideoInfoTable
  3370. /****************************************************************************/
  3371. typedef struct _ATOM_MODE_TIMING
  3372. {
  3373. USHORT usCRTC_H_Total;
  3374. USHORT usCRTC_H_Disp;
  3375. USHORT usCRTC_H_SyncStart;
  3376. USHORT usCRTC_H_SyncWidth;
  3377. USHORT usCRTC_V_Total;
  3378. USHORT usCRTC_V_Disp;
  3379. USHORT usCRTC_V_SyncStart;
  3380. USHORT usCRTC_V_SyncWidth;
  3381. USHORT usPixelClock; //in 10Khz unit
  3382. ATOM_MODE_MISC_INFO_ACCESS susModeMiscInfo;
  3383. USHORT usCRTC_OverscanRight;
  3384. USHORT usCRTC_OverscanLeft;
  3385. USHORT usCRTC_OverscanBottom;
  3386. USHORT usCRTC_OverscanTop;
  3387. USHORT usReserve;
  3388. UCHAR ucInternalModeNumber;
  3389. UCHAR ucRefreshRate;
  3390. }ATOM_MODE_TIMING;
  3391. typedef struct _ATOM_DTD_FORMAT
  3392. {
  3393. USHORT usPixClk;
  3394. USHORT usHActive;
  3395. USHORT usHBlanking_Time;
  3396. USHORT usVActive;
  3397. USHORT usVBlanking_Time;
  3398. USHORT usHSyncOffset;
  3399. USHORT usHSyncWidth;
  3400. USHORT usVSyncOffset;
  3401. USHORT usVSyncWidth;
  3402. USHORT usImageHSize;
  3403. USHORT usImageVSize;
  3404. UCHAR ucHBorder;
  3405. UCHAR ucVBorder;
  3406. ATOM_MODE_MISC_INFO_ACCESS susModeMiscInfo;
  3407. UCHAR ucInternalModeNumber;
  3408. UCHAR ucRefreshRate;
  3409. }ATOM_DTD_FORMAT;
  3410. /****************************************************************************/
  3411. // Structure used in LVDS_InfoTable
  3412. // * Need a document to describe this table
  3413. /****************************************************************************/
  3414. #define SUPPORTED_LCD_REFRESHRATE_30Hz 0x0004
  3415. #define SUPPORTED_LCD_REFRESHRATE_40Hz 0x0008
  3416. #define SUPPORTED_LCD_REFRESHRATE_50Hz 0x0010
  3417. #define SUPPORTED_LCD_REFRESHRATE_60Hz 0x0020
  3418. #define SUPPORTED_LCD_REFRESHRATE_48Hz 0x0040
  3419. //ucTableFormatRevision=1
  3420. //ucTableContentRevision=1
  3421. typedef struct _ATOM_LVDS_INFO
  3422. {
  3423. ATOM_COMMON_TABLE_HEADER sHeader;
  3424. ATOM_DTD_FORMAT sLCDTiming;
  3425. USHORT usModePatchTableOffset;
  3426. USHORT usSupportedRefreshRate; //Refer to panel info table in ATOMBIOS extension Spec.
  3427. USHORT usOffDelayInMs;
  3428. UCHAR ucPowerSequenceDigOntoDEin10Ms;
  3429. UCHAR ucPowerSequenceDEtoBLOnin10Ms;
  3430. UCHAR ucLVDS_Misc; // Bit0:{=0:single, =1:dual},Bit1 {=0:666RGB, =1:888RGB},Bit2:3:{Grey level}
  3431. // Bit4:{=0:LDI format for RGB888, =1 FPDI format for RGB888}
  3432. // Bit5:{=0:Spatial Dithering disabled;1 Spatial Dithering enabled}
  3433. // Bit6:{=0:Temporal Dithering disabled;1 Temporal Dithering enabled}
  3434. UCHAR ucPanelDefaultRefreshRate;
  3435. UCHAR ucPanelIdentification;
  3436. UCHAR ucSS_Id;
  3437. }ATOM_LVDS_INFO;
  3438. //ucTableFormatRevision=1
  3439. //ucTableContentRevision=2
  3440. typedef struct _ATOM_LVDS_INFO_V12
  3441. {
  3442. ATOM_COMMON_TABLE_HEADER sHeader;
  3443. ATOM_DTD_FORMAT sLCDTiming;
  3444. USHORT usExtInfoTableOffset;
  3445. USHORT usSupportedRefreshRate; //Refer to panel info table in ATOMBIOS extension Spec.
  3446. USHORT usOffDelayInMs;
  3447. UCHAR ucPowerSequenceDigOntoDEin10Ms;
  3448. UCHAR ucPowerSequenceDEtoBLOnin10Ms;
  3449. UCHAR ucLVDS_Misc; // Bit0:{=0:single, =1:dual},Bit1 {=0:666RGB, =1:888RGB},Bit2:3:{Grey level}
  3450. // Bit4:{=0:LDI format for RGB888, =1 FPDI format for RGB888}
  3451. // Bit5:{=0:Spatial Dithering disabled;1 Spatial Dithering enabled}
  3452. // Bit6:{=0:Temporal Dithering disabled;1 Temporal Dithering enabled}
  3453. UCHAR ucPanelDefaultRefreshRate;
  3454. UCHAR ucPanelIdentification;
  3455. UCHAR ucSS_Id;
  3456. USHORT usLCDVenderID;
  3457. USHORT usLCDProductID;
  3458. UCHAR ucLCDPanel_SpecialHandlingCap;
  3459. UCHAR ucPanelInfoSize; // start from ATOM_DTD_FORMAT to end of panel info, include ExtInfoTable
  3460. UCHAR ucReserved[2];
  3461. }ATOM_LVDS_INFO_V12;
  3462. //Definitions for ucLCDPanel_SpecialHandlingCap:
  3463. //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.
  3464. //Other entries in ATOM_LVDS_INFO_V12 are still valid/useful to DAL
  3465. #define LCDPANEL_CAP_READ_EDID 0x1
  3466. //If a design supports DRR (dynamic refresh rate) on internal panels (LVDS or EDP), this cap is set in ucLCDPanel_SpecialHandlingCap together
  3467. //with multiple supported refresh rates@usSupportedRefreshRate. This cap should not be set when only slow refresh rate is supported (static
  3468. //refresh rate switch by SW. This is only valid from ATOM_LVDS_INFO_V12
  3469. #define LCDPANEL_CAP_DRR_SUPPORTED 0x2
  3470. //Use this cap bit for a quick reference whether an embadded panel (LCD1 ) is LVDS or eDP.
  3471. #define LCDPANEL_CAP_eDP 0x4
  3472. //Color Bit Depth definition in EDID V1.4 @BYTE 14h
  3473. //Bit 6 5 4
  3474. // 0 0 0 - Color bit depth is undefined
  3475. // 0 0 1 - 6 Bits per Primary Color
  3476. // 0 1 0 - 8 Bits per Primary Color
  3477. // 0 1 1 - 10 Bits per Primary Color
  3478. // 1 0 0 - 12 Bits per Primary Color
  3479. // 1 0 1 - 14 Bits per Primary Color
  3480. // 1 1 0 - 16 Bits per Primary Color
  3481. // 1 1 1 - Reserved
  3482. #define PANEL_COLOR_BIT_DEPTH_MASK 0x70
  3483. // Bit7:{=0:Random Dithering disabled;1 Random Dithering enabled}
  3484. #define PANEL_RANDOM_DITHER 0x80
  3485. #define PANEL_RANDOM_DITHER_MASK 0x80
  3486. #define ATOM_LVDS_INFO_LAST ATOM_LVDS_INFO_V12 // no need to change this
  3487. typedef struct _ATOM_LCD_REFRESH_RATE_SUPPORT
  3488. {
  3489. UCHAR ucSupportedRefreshRate;
  3490. UCHAR ucMinRefreshRateForDRR;
  3491. }ATOM_LCD_REFRESH_RATE_SUPPORT;
  3492. /****************************************************************************/
  3493. // Structures used by LCD_InfoTable V1.3 Note: previous version was called ATOM_LVDS_INFO_V12
  3494. // ASIC Families: NI
  3495. // ucTableFormatRevision=1
  3496. // ucTableContentRevision=3
  3497. /****************************************************************************/
  3498. typedef struct _ATOM_LCD_INFO_V13
  3499. {
  3500. ATOM_COMMON_TABLE_HEADER sHeader;
  3501. ATOM_DTD_FORMAT sLCDTiming;
  3502. USHORT usExtInfoTableOffset;
  3503. union
  3504. {
  3505. USHORT usSupportedRefreshRate;
  3506. ATOM_LCD_REFRESH_RATE_SUPPORT sRefreshRateSupport;
  3507. };
  3508. ULONG ulReserved0;
  3509. UCHAR ucLCD_Misc; // Reorganized in V13
  3510. // Bit0: {=0:single, =1:dual},
  3511. // Bit1: {=0:LDI format for RGB888, =1 FPDI format for RGB888} // was {=0:666RGB, =1:888RGB},
  3512. // Bit3:2: {Grey level}
  3513. // Bit6:4 Color Bit Depth definition (see below definition in EDID V1.4 @BYTE 14h)
  3514. // Bit7 Reserved. was for ATOM_PANEL_MISC_API_ENABLED, still need it?
  3515. UCHAR ucPanelDefaultRefreshRate;
  3516. UCHAR ucPanelIdentification;
  3517. UCHAR ucSS_Id;
  3518. USHORT usLCDVenderID;
  3519. USHORT usLCDProductID;
  3520. UCHAR ucLCDPanel_SpecialHandlingCap; // Reorganized in V13
  3521. // Bit0: Once DAL sees this CAP is set, it will read EDID from LCD on its own
  3522. // Bit1: See LCDPANEL_CAP_DRR_SUPPORTED
  3523. // Bit2: a quick reference whether an embadded panel (LCD1 ) is LVDS (0) or eDP (1)
  3524. // Bit7-3: Reserved
  3525. UCHAR ucPanelInfoSize; // start from ATOM_DTD_FORMAT to end of panel info, include ExtInfoTable
  3526. USHORT usBacklightPWM; // Backlight PWM in Hz. New in _V13
  3527. UCHAR ucPowerSequenceDIGONtoDE_in4Ms;
  3528. UCHAR ucPowerSequenceDEtoVARY_BL_in4Ms;
  3529. UCHAR ucPowerSequenceVARY_BLtoDE_in4Ms;
  3530. UCHAR ucPowerSequenceDEtoDIGON_in4Ms;
  3531. UCHAR ucOffDelay_in4Ms;
  3532. UCHAR ucPowerSequenceVARY_BLtoBLON_in4Ms;
  3533. UCHAR ucPowerSequenceBLONtoVARY_BL_in4Ms;
  3534. UCHAR ucReserved1;
  3535. UCHAR ucDPCD_eDP_CONFIGURATION_CAP; // dpcd 0dh
  3536. UCHAR ucDPCD_MAX_LINK_RATE; // dpcd 01h
  3537. UCHAR ucDPCD_MAX_LANE_COUNT; // dpcd 02h
  3538. UCHAR ucDPCD_MAX_DOWNSPREAD; // dpcd 03h
  3539. USHORT usMaxPclkFreqInSingleLink; // Max PixelClock frequency in single link mode.
  3540. UCHAR uceDPToLVDSRxId;
  3541. UCHAR ucLcdReservd;
  3542. ULONG ulReserved[2];
  3543. }ATOM_LCD_INFO_V13;
  3544. #define ATOM_LCD_INFO_LAST ATOM_LCD_INFO_V13
  3545. //Definitions for ucLCD_Misc
  3546. #define ATOM_PANEL_MISC_V13_DUAL 0x00000001
  3547. #define ATOM_PANEL_MISC_V13_FPDI 0x00000002
  3548. #define ATOM_PANEL_MISC_V13_GREY_LEVEL 0x0000000C
  3549. #define ATOM_PANEL_MISC_V13_GREY_LEVEL_SHIFT 2
  3550. #define ATOM_PANEL_MISC_V13_COLOR_BIT_DEPTH_MASK 0x70
  3551. #define ATOM_PANEL_MISC_V13_6BIT_PER_COLOR 0x10
  3552. #define ATOM_PANEL_MISC_V13_8BIT_PER_COLOR 0x20
  3553. //Color Bit Depth definition in EDID V1.4 @BYTE 14h
  3554. //Bit 6 5 4
  3555. // 0 0 0 - Color bit depth is undefined
  3556. // 0 0 1 - 6 Bits per Primary Color
  3557. // 0 1 0 - 8 Bits per Primary Color
  3558. // 0 1 1 - 10 Bits per Primary Color
  3559. // 1 0 0 - 12 Bits per Primary Color
  3560. // 1 0 1 - 14 Bits per Primary Color
  3561. // 1 1 0 - 16 Bits per Primary Color
  3562. // 1 1 1 - Reserved
  3563. //Definitions for ucLCDPanel_SpecialHandlingCap:
  3564. //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.
  3565. //Other entries in ATOM_LVDS_INFO_V12 are still valid/useful to DAL
  3566. #define LCDPANEL_CAP_V13_READ_EDID 0x1 // = LCDPANEL_CAP_READ_EDID no change comparing to previous version
  3567. //If a design supports DRR (dynamic refresh rate) on internal panels (LVDS or EDP), this cap is set in ucLCDPanel_SpecialHandlingCap together
  3568. //with multiple supported refresh rates@usSupportedRefreshRate. This cap should not be set when only slow refresh rate is supported (static
  3569. //refresh rate switch by SW. This is only valid from ATOM_LVDS_INFO_V12
  3570. #define LCDPANEL_CAP_V13_DRR_SUPPORTED 0x2 // = LCDPANEL_CAP_DRR_SUPPORTED no change comparing to previous version
  3571. //Use this cap bit for a quick reference whether an embadded panel (LCD1 ) is LVDS or eDP.
  3572. #define LCDPANEL_CAP_V13_eDP 0x4 // = LCDPANEL_CAP_eDP no change comparing to previous version
  3573. //uceDPToLVDSRxId
  3574. #define eDP_TO_LVDS_RX_DISABLE 0x00 // no eDP->LVDS translator chip
  3575. #define eDP_TO_LVDS_COMMON_ID 0x01 // common eDP->LVDS translator chip without AMD SW init
  3576. #define eDP_TO_LVDS_RT_ID 0x02 // RT tansaltor which require AMD SW init
  3577. typedef struct _ATOM_PATCH_RECORD_MODE
  3578. {
  3579. UCHAR ucRecordType;
  3580. USHORT usHDisp;
  3581. USHORT usVDisp;
  3582. }ATOM_PATCH_RECORD_MODE;
  3583. typedef struct _ATOM_LCD_RTS_RECORD
  3584. {
  3585. UCHAR ucRecordType;
  3586. UCHAR ucRTSValue;
  3587. }ATOM_LCD_RTS_RECORD;
  3588. //!! If the record below exits, it shoud always be the first record for easy use in command table!!!
  3589. // The record below is only used when LVDS_Info is present. From ATOM_LVDS_INFO_V12, use ucLCDPanel_SpecialHandlingCap instead.
  3590. typedef struct _ATOM_LCD_MODE_CONTROL_CAP
  3591. {
  3592. UCHAR ucRecordType;
  3593. USHORT usLCDCap;
  3594. }ATOM_LCD_MODE_CONTROL_CAP;
  3595. #define LCD_MODE_CAP_BL_OFF 1
  3596. #define LCD_MODE_CAP_CRTC_OFF 2
  3597. #define LCD_MODE_CAP_PANEL_OFF 4
  3598. typedef struct _ATOM_FAKE_EDID_PATCH_RECORD
  3599. {
  3600. UCHAR ucRecordType;
  3601. UCHAR ucFakeEDIDLength; // = 128 means EDID lenght is 128 bytes, otherwise the EDID length = ucFakeEDIDLength*128
  3602. UCHAR ucFakeEDIDString[1]; // This actually has ucFakeEdidLength elements.
  3603. } ATOM_FAKE_EDID_PATCH_RECORD;
  3604. typedef struct _ATOM_PANEL_RESOLUTION_PATCH_RECORD
  3605. {
  3606. UCHAR ucRecordType;
  3607. USHORT usHSize;
  3608. USHORT usVSize;
  3609. }ATOM_PANEL_RESOLUTION_PATCH_RECORD;
  3610. #define LCD_MODE_PATCH_RECORD_MODE_TYPE 1
  3611. #define LCD_RTS_RECORD_TYPE 2
  3612. #define LCD_CAP_RECORD_TYPE 3
  3613. #define LCD_FAKE_EDID_PATCH_RECORD_TYPE 4
  3614. #define LCD_PANEL_RESOLUTION_RECORD_TYPE 5
  3615. #define LCD_EDID_OFFSET_PATCH_RECORD_TYPE 6
  3616. #define ATOM_RECORD_END_TYPE 0xFF
  3617. /****************************Spread Spectrum Info Table Definitions **********************/
  3618. //ucTableFormatRevision=1
  3619. //ucTableContentRevision=2
  3620. typedef struct _ATOM_SPREAD_SPECTRUM_ASSIGNMENT
  3621. {
  3622. USHORT usSpreadSpectrumPercentage;
  3623. 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
  3624. UCHAR ucSS_Step;
  3625. UCHAR ucSS_Delay;
  3626. UCHAR ucSS_Id;
  3627. UCHAR ucRecommendedRef_Div;
  3628. UCHAR ucSS_Range; //it was reserved for V11
  3629. }ATOM_SPREAD_SPECTRUM_ASSIGNMENT;
  3630. #define ATOM_MAX_SS_ENTRY 16
  3631. #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.
  3632. #define ATOM_DP_SS_ID2 0x0f2 // SS ID for internal DP stream at 1.62Ghz, if it exists in SS_InfoTable.
  3633. #define ATOM_LVLINK_2700MHz_SS_ID 0x0f3 // SS ID for LV link translator chip at 2.7Ghz
  3634. #define ATOM_LVLINK_1620MHz_SS_ID 0x0f4 // SS ID for LV link translator chip at 1.62Ghz
  3635. #define ATOM_SS_DOWN_SPREAD_MODE_MASK 0x00000000
  3636. #define ATOM_SS_DOWN_SPREAD_MODE 0x00000000
  3637. #define ATOM_SS_CENTRE_SPREAD_MODE_MASK 0x00000001
  3638. #define ATOM_SS_CENTRE_SPREAD_MODE 0x00000001
  3639. #define ATOM_INTERNAL_SS_MASK 0x00000000
  3640. #define ATOM_EXTERNAL_SS_MASK 0x00000002
  3641. #define EXEC_SS_STEP_SIZE_SHIFT 2
  3642. #define EXEC_SS_DELAY_SHIFT 4
  3643. #define ACTIVEDATA_TO_BLON_DELAY_SHIFT 4
  3644. typedef struct _ATOM_SPREAD_SPECTRUM_INFO
  3645. {
  3646. ATOM_COMMON_TABLE_HEADER sHeader;
  3647. ATOM_SPREAD_SPECTRUM_ASSIGNMENT asSS_Info[ATOM_MAX_SS_ENTRY];
  3648. }ATOM_SPREAD_SPECTRUM_INFO;
  3649. /****************************************************************************/
  3650. // Structure used in AnalogTV_InfoTable (Top level)
  3651. /****************************************************************************/
  3652. //ucTVBootUpDefaultStd definiton:
  3653. //ATOM_TV_NTSC 1
  3654. //ATOM_TV_NTSCJ 2
  3655. //ATOM_TV_PAL 3
  3656. //ATOM_TV_PALM 4
  3657. //ATOM_TV_PALCN 5
  3658. //ATOM_TV_PALN 6
  3659. //ATOM_TV_PAL60 7
  3660. //ATOM_TV_SECAM 8
  3661. //ucTVSuppportedStd definition:
  3662. #define NTSC_SUPPORT 0x1
  3663. #define NTSCJ_SUPPORT 0x2
  3664. #define PAL_SUPPORT 0x4
  3665. #define PALM_SUPPORT 0x8
  3666. #define PALCN_SUPPORT 0x10
  3667. #define PALN_SUPPORT 0x20
  3668. #define PAL60_SUPPORT 0x40
  3669. #define SECAM_SUPPORT 0x80
  3670. #define MAX_SUPPORTED_TV_TIMING 2
  3671. typedef struct _ATOM_ANALOG_TV_INFO
  3672. {
  3673. ATOM_COMMON_TABLE_HEADER sHeader;
  3674. UCHAR ucTV_SuppportedStandard;
  3675. UCHAR ucTV_BootUpDefaultStandard;
  3676. UCHAR ucExt_TV_ASIC_ID;
  3677. UCHAR ucExt_TV_ASIC_SlaveAddr;
  3678. ATOM_DTD_FORMAT aModeTimings[MAX_SUPPORTED_TV_TIMING];
  3679. }ATOM_ANALOG_TV_INFO;
  3680. typedef struct _ATOM_DPCD_INFO
  3681. {
  3682. UCHAR ucRevisionNumber; //10h : Revision 1.0; 11h : Revision 1.1
  3683. UCHAR ucMaxLinkRate; //06h : 1.62Gbps per lane; 0Ah = 2.7Gbps per lane
  3684. UCHAR ucMaxLane; //Bits 4:0 = MAX_LANE_COUNT (1/2/4). Bit 7 = ENHANCED_FRAME_CAP
  3685. UCHAR ucMaxDownSpread; //Bit0 = 0: No Down spread; Bit0 = 1: 0.5% (Subject to change according to DP spec)
  3686. }ATOM_DPCD_INFO;
  3687. #define ATOM_DPCD_MAX_LANE_MASK 0x1F
  3688. /**************************************************************************/
  3689. // VRAM usage and their defintions
  3690. // One chunk of VRAM used by Bios are for HWICON surfaces,EDID data.
  3691. // Current Mode timing and Dail Timing and/or STD timing data EACH device. They can be broken down as below.
  3692. // All the addresses below are the offsets from the frame buffer start.They all MUST be Dword aligned!
  3693. // To driver: The physical address of this memory portion=mmFB_START(4K aligned)+ATOMBIOS_VRAM_USAGE_START_ADDR+ATOM_x_ADDR
  3694. // To Bios: ATOMBIOS_VRAM_USAGE_START_ADDR+ATOM_x_ADDR->MM_INDEX
  3695. // Moved VESA_MEMORY_IN_64K_BLOCK definition to "AtomConfig.h" so that it can be redefined in design (SKU).
  3696. //#ifndef VESA_MEMORY_IN_64K_BLOCK
  3697. //#define VESA_MEMORY_IN_64K_BLOCK 0x100 //256*64K=16Mb (Max. VESA memory is 16Mb!)
  3698. //#endif
  3699. #define ATOM_EDID_RAW_DATASIZE 256 //In Bytes
  3700. #define ATOM_HWICON_SURFACE_SIZE 4096 //In Bytes
  3701. #define ATOM_HWICON_INFOTABLE_SIZE 32
  3702. #define MAX_DTD_MODE_IN_VRAM 6
  3703. #define ATOM_DTD_MODE_SUPPORT_TBL_SIZE (MAX_DTD_MODE_IN_VRAM*28) //28= (SIZEOF ATOM_DTD_FORMAT)
  3704. #define ATOM_STD_MODE_SUPPORT_TBL_SIZE 32*8 //32 is a predefined number,8= (SIZEOF ATOM_STD_FORMAT)
  3705. //20 bytes for Encoder Type and DPCD in STD EDID area
  3706. #define DFP_ENCODER_TYPE_OFFSET (ATOM_EDID_RAW_DATASIZE + ATOM_DTD_MODE_SUPPORT_TBL_SIZE + ATOM_STD_MODE_SUPPORT_TBL_SIZE - 20)
  3707. #define ATOM_DP_DPCD_OFFSET (DFP_ENCODER_TYPE_OFFSET + 4 )
  3708. #define ATOM_HWICON1_SURFACE_ADDR 0
  3709. #define ATOM_HWICON2_SURFACE_ADDR (ATOM_HWICON1_SURFACE_ADDR + ATOM_HWICON_SURFACE_SIZE)
  3710. #define ATOM_HWICON_INFOTABLE_ADDR (ATOM_HWICON2_SURFACE_ADDR + ATOM_HWICON_SURFACE_SIZE)
  3711. #define ATOM_CRT1_EDID_ADDR (ATOM_HWICON_INFOTABLE_ADDR + ATOM_HWICON_INFOTABLE_SIZE)
  3712. #define ATOM_CRT1_DTD_MODE_TBL_ADDR (ATOM_CRT1_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3713. #define ATOM_CRT1_STD_MODE_TBL_ADDR (ATOM_CRT1_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3714. #define ATOM_LCD1_EDID_ADDR (ATOM_CRT1_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3715. #define ATOM_LCD1_DTD_MODE_TBL_ADDR (ATOM_LCD1_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3716. #define ATOM_LCD1_STD_MODE_TBL_ADDR (ATOM_LCD1_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3717. #define ATOM_TV1_DTD_MODE_TBL_ADDR (ATOM_LCD1_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3718. #define ATOM_DFP1_EDID_ADDR (ATOM_TV1_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3719. #define ATOM_DFP1_DTD_MODE_TBL_ADDR (ATOM_DFP1_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3720. #define ATOM_DFP1_STD_MODE_TBL_ADDR (ATOM_DFP1_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3721. #define ATOM_CRT2_EDID_ADDR (ATOM_DFP1_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3722. #define ATOM_CRT2_DTD_MODE_TBL_ADDR (ATOM_CRT2_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3723. #define ATOM_CRT2_STD_MODE_TBL_ADDR (ATOM_CRT2_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3724. #define ATOM_LCD2_EDID_ADDR (ATOM_CRT2_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3725. #define ATOM_LCD2_DTD_MODE_TBL_ADDR (ATOM_LCD2_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3726. #define ATOM_LCD2_STD_MODE_TBL_ADDR (ATOM_LCD2_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3727. #define ATOM_DFP6_EDID_ADDR (ATOM_LCD2_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3728. #define ATOM_DFP6_DTD_MODE_TBL_ADDR (ATOM_DFP6_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3729. #define ATOM_DFP6_STD_MODE_TBL_ADDR (ATOM_DFP6_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3730. #define ATOM_DFP2_EDID_ADDR (ATOM_DFP6_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3731. #define ATOM_DFP2_DTD_MODE_TBL_ADDR (ATOM_DFP2_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3732. #define ATOM_DFP2_STD_MODE_TBL_ADDR (ATOM_DFP2_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3733. #define ATOM_CV_EDID_ADDR (ATOM_DFP2_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3734. #define ATOM_CV_DTD_MODE_TBL_ADDR (ATOM_CV_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3735. #define ATOM_CV_STD_MODE_TBL_ADDR (ATOM_CV_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3736. #define ATOM_DFP3_EDID_ADDR (ATOM_CV_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3737. #define ATOM_DFP3_DTD_MODE_TBL_ADDR (ATOM_DFP3_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3738. #define ATOM_DFP3_STD_MODE_TBL_ADDR (ATOM_DFP3_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3739. #define ATOM_DFP4_EDID_ADDR (ATOM_DFP3_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3740. #define ATOM_DFP4_DTD_MODE_TBL_ADDR (ATOM_DFP4_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3741. #define ATOM_DFP4_STD_MODE_TBL_ADDR (ATOM_DFP4_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3742. #define ATOM_DFP5_EDID_ADDR (ATOM_DFP4_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3743. #define ATOM_DFP5_DTD_MODE_TBL_ADDR (ATOM_DFP5_EDID_ADDR + ATOM_EDID_RAW_DATASIZE)
  3744. #define ATOM_DFP5_STD_MODE_TBL_ADDR (ATOM_DFP5_DTD_MODE_TBL_ADDR + ATOM_DTD_MODE_SUPPORT_TBL_SIZE)
  3745. #define ATOM_DP_TRAINING_TBL_ADDR (ATOM_DFP5_STD_MODE_TBL_ADDR + ATOM_STD_MODE_SUPPORT_TBL_SIZE)
  3746. #define ATOM_STACK_STORAGE_START (ATOM_DP_TRAINING_TBL_ADDR + 1024)
  3747. #define ATOM_STACK_STORAGE_END ATOM_STACK_STORAGE_START + 512
  3748. //The size below is in Kb!
  3749. #define ATOM_VRAM_RESERVE_SIZE ((((ATOM_STACK_STORAGE_END - ATOM_HWICON1_SURFACE_ADDR)>>10)+4)&0xFFFC)
  3750. #define ATOM_VRAM_RESERVE_V2_SIZE 32
  3751. #define ATOM_VRAM_OPERATION_FLAGS_MASK 0xC0000000L
  3752. #define ATOM_VRAM_OPERATION_FLAGS_SHIFT 30
  3753. #define ATOM_VRAM_BLOCK_NEEDS_NO_RESERVATION 0x1
  3754. #define ATOM_VRAM_BLOCK_NEEDS_RESERVATION 0x0
  3755. /***********************************************************************************/
  3756. // Structure used in VRAM_UsageByFirmwareTable
  3757. // Note1: This table is filled by SetBiosReservationStartInFB in CoreCommSubs.asm
  3758. // at running time.
  3759. // note2: From RV770, the memory is more than 32bit addressable, so we will change
  3760. // ucTableFormatRevision=1,ucTableContentRevision=4, the strcuture remains
  3761. // exactly same as 1.1 and 1.2 (1.3 is never in use), but ulStartAddrUsedByFirmware
  3762. // (in offset to start of memory address) is KB aligned instead of byte aligend.
  3763. // Note3:
  3764. /* If we change usReserved to "usFBUsedbyDrvInKB", then to VBIOS this usFBUsedbyDrvInKB is a predefined, unchanged
  3765. constant across VGA or non VGA adapter,
  3766. for CAIL, The size of FB access area is known, only thing missing is the Offset of FB Access area, so we can have:
  3767. If (ulStartAddrUsedByFirmware!=0)
  3768. FBAccessAreaOffset= ulStartAddrUsedByFirmware - usFBUsedbyDrvInKB;
  3769. Reserved area has been claimed by VBIOS including this FB access area; CAIL doesn't need to reserve any extra area for this purpose
  3770. else //Non VGA case
  3771. if (FB_Size<=2Gb)
  3772. FBAccessAreaOffset= FB_Size - usFBUsedbyDrvInKB;
  3773. else
  3774. FBAccessAreaOffset= Aper_Size - usFBUsedbyDrvInKB
  3775. CAIL needs to claim an reserved area defined by FBAccessAreaOffset and usFBUsedbyDrvInKB in non VGA case.*/
  3776. /***********************************************************************************/
  3777. #define ATOM_MAX_FIRMWARE_VRAM_USAGE_INFO 1
  3778. typedef struct _ATOM_FIRMWARE_VRAM_RESERVE_INFO
  3779. {
  3780. ULONG ulStartAddrUsedByFirmware;
  3781. USHORT usFirmwareUseInKb;
  3782. USHORT usReserved;
  3783. }ATOM_FIRMWARE_VRAM_RESERVE_INFO;
  3784. typedef struct _ATOM_VRAM_USAGE_BY_FIRMWARE
  3785. {
  3786. ATOM_COMMON_TABLE_HEADER sHeader;
  3787. ATOM_FIRMWARE_VRAM_RESERVE_INFO asFirmwareVramReserveInfo[ATOM_MAX_FIRMWARE_VRAM_USAGE_INFO];
  3788. }ATOM_VRAM_USAGE_BY_FIRMWARE;
  3789. // change verion to 1.5, when allow driver to allocate the vram area for command table access.
  3790. typedef struct _ATOM_FIRMWARE_VRAM_RESERVE_INFO_V1_5
  3791. {
  3792. ULONG ulStartAddrUsedByFirmware;
  3793. USHORT usFirmwareUseInKb;
  3794. USHORT usFBUsedByDrvInKb;
  3795. }ATOM_FIRMWARE_VRAM_RESERVE_INFO_V1_5;
  3796. typedef struct _ATOM_VRAM_USAGE_BY_FIRMWARE_V1_5
  3797. {
  3798. ATOM_COMMON_TABLE_HEADER sHeader;
  3799. ATOM_FIRMWARE_VRAM_RESERVE_INFO_V1_5 asFirmwareVramReserveInfo[ATOM_MAX_FIRMWARE_VRAM_USAGE_INFO];
  3800. }ATOM_VRAM_USAGE_BY_FIRMWARE_V1_5;
  3801. /****************************************************************************/
  3802. // Structure used in GPIO_Pin_LUTTable
  3803. /****************************************************************************/
  3804. typedef struct _ATOM_GPIO_PIN_ASSIGNMENT
  3805. {
  3806. USHORT usGpioPin_AIndex;
  3807. UCHAR ucGpioPinBitShift;
  3808. UCHAR ucGPIO_ID;
  3809. }ATOM_GPIO_PIN_ASSIGNMENT;
  3810. //ucGPIO_ID pre-define id for multiple usage
  3811. // GPIO use to control PCIE_VDDC in certain SLT board
  3812. #define PCIE_VDDC_CONTROL_GPIO_PINID 56
  3813. //from SMU7.x, if ucGPIO_ID=PP_AC_DC_SWITCH_GPIO_PINID in GPIO_LUTTable, AC/DC switching feature is enable
  3814. #define PP_AC_DC_SWITCH_GPIO_PINID 60
  3815. //from SMU7.x, if ucGPIO_ID=VDDC_REGULATOR_VRHOT_GPIO_PINID in GPIO_LUTable, VRHot feature is enable
  3816. #define VDDC_VRHOT_GPIO_PINID 61
  3817. //if ucGPIO_ID=VDDC_PCC_GPIO_PINID in GPIO_LUTable, Peak Current Control feature is enabled
  3818. #define VDDC_PCC_GPIO_PINID 62
  3819. // Only used on certain SLT/PA board to allow utility to cut Efuse.
  3820. #define EFUSE_CUT_ENABLE_GPIO_PINID 63
  3821. // ucGPIO=DRAM_SELF_REFRESH_GPIO_PIND uses for memory self refresh (ucGPIO=0, DRAM self-refresh; ucGPIO=
  3822. #define DRAM_SELF_REFRESH_GPIO_PINID 64
  3823. // Thermal interrupt output->system thermal chip GPIO pin
  3824. #define THERMAL_INT_OUTPUT_GPIO_PINID 65
  3825. typedef struct _ATOM_GPIO_PIN_LUT
  3826. {
  3827. ATOM_COMMON_TABLE_HEADER sHeader;
  3828. ATOM_GPIO_PIN_ASSIGNMENT asGPIO_Pin[1];
  3829. }ATOM_GPIO_PIN_LUT;
  3830. /****************************************************************************/
  3831. // Structure used in ComponentVideoInfoTable
  3832. /****************************************************************************/
  3833. #define GPIO_PIN_ACTIVE_HIGH 0x1
  3834. #define MAX_SUPPORTED_CV_STANDARDS 5
  3835. // definitions for ATOM_D_INFO.ucSettings
  3836. #define ATOM_GPIO_SETTINGS_BITSHIFT_MASK 0x1F // [4:0]
  3837. #define ATOM_GPIO_SETTINGS_RESERVED_MASK 0x60 // [6:5] = must be zeroed out
  3838. #define ATOM_GPIO_SETTINGS_ACTIVE_MASK 0x80 // [7]
  3839. typedef struct _ATOM_GPIO_INFO
  3840. {
  3841. USHORT usAOffset;
  3842. UCHAR ucSettings;
  3843. UCHAR ucReserved;
  3844. }ATOM_GPIO_INFO;
  3845. // definitions for ATOM_COMPONENT_VIDEO_INFO.ucMiscInfo (bit vector)
  3846. #define ATOM_CV_RESTRICT_FORMAT_SELECTION 0x2
  3847. // definitions for ATOM_COMPONENT_VIDEO_INFO.uc480i/uc480p/uc720p/uc1080i
  3848. #define ATOM_GPIO_DEFAULT_MODE_EN 0x80 //[7];
  3849. #define ATOM_GPIO_SETTING_PERMODE_MASK 0x7F //[6:0]
  3850. // definitions for ATOM_COMPONENT_VIDEO_INFO.ucLetterBoxMode
  3851. //Line 3 out put 5V.
  3852. #define ATOM_CV_LINE3_ASPECTRATIO_16_9_GPIO_A 0x01 //represent gpio 3 state for 16:9
  3853. #define ATOM_CV_LINE3_ASPECTRATIO_16_9_GPIO_B 0x02 //represent gpio 4 state for 16:9
  3854. #define ATOM_CV_LINE3_ASPECTRATIO_16_9_GPIO_SHIFT 0x0
  3855. //Line 3 out put 2.2V
  3856. #define ATOM_CV_LINE3_ASPECTRATIO_4_3_LETBOX_GPIO_A 0x04 //represent gpio 3 state for 4:3 Letter box
  3857. #define ATOM_CV_LINE3_ASPECTRATIO_4_3_LETBOX_GPIO_B 0x08 //represent gpio 4 state for 4:3 Letter box
  3858. #define ATOM_CV_LINE3_ASPECTRATIO_4_3_LETBOX_GPIO_SHIFT 0x2
  3859. //Line 3 out put 0V
  3860. #define ATOM_CV_LINE3_ASPECTRATIO_4_3_GPIO_A 0x10 //represent gpio 3 state for 4:3
  3861. #define ATOM_CV_LINE3_ASPECTRATIO_4_3_GPIO_B 0x20 //represent gpio 4 state for 4:3
  3862. #define ATOM_CV_LINE3_ASPECTRATIO_4_3_GPIO_SHIFT 0x4
  3863. #define ATOM_CV_LINE3_ASPECTRATIO_MASK 0x3F // bit [5:0]
  3864. #define ATOM_CV_LINE3_ASPECTRATIO_EXIST 0x80 //bit 7
  3865. //GPIO bit index in gpio setting per mode value, also represend the block no. in gpio blocks.
  3866. #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.
  3867. #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.
  3868. typedef struct _ATOM_COMPONENT_VIDEO_INFO
  3869. {
  3870. ATOM_COMMON_TABLE_HEADER sHeader;
  3871. USHORT usMask_PinRegisterIndex;
  3872. USHORT usEN_PinRegisterIndex;
  3873. USHORT usY_PinRegisterIndex;
  3874. USHORT usA_PinRegisterIndex;
  3875. UCHAR ucBitShift;
  3876. UCHAR ucPinActiveState; //ucPinActiveState: Bit0=1 active high, =0 active low
  3877. ATOM_DTD_FORMAT sReserved; // must be zeroed out
  3878. UCHAR ucMiscInfo;
  3879. UCHAR uc480i;
  3880. UCHAR uc480p;
  3881. UCHAR uc720p;
  3882. UCHAR uc1080i;
  3883. UCHAR ucLetterBoxMode;
  3884. UCHAR ucReserved[3];
  3885. UCHAR ucNumOfWbGpioBlocks; //For Component video D-Connector support. If zere, NTSC type connector
  3886. ATOM_GPIO_INFO aWbGpioStateBlock[MAX_SUPPORTED_CV_STANDARDS];
  3887. ATOM_DTD_FORMAT aModeTimings[MAX_SUPPORTED_CV_STANDARDS];
  3888. }ATOM_COMPONENT_VIDEO_INFO;
  3889. //ucTableFormatRevision=2
  3890. //ucTableContentRevision=1
  3891. typedef struct _ATOM_COMPONENT_VIDEO_INFO_V21
  3892. {
  3893. ATOM_COMMON_TABLE_HEADER sHeader;
  3894. UCHAR ucMiscInfo;
  3895. UCHAR uc480i;
  3896. UCHAR uc480p;
  3897. UCHAR uc720p;
  3898. UCHAR uc1080i;
  3899. UCHAR ucReserved;
  3900. UCHAR ucLetterBoxMode;
  3901. UCHAR ucNumOfWbGpioBlocks; //For Component video D-Connector support. If zere, NTSC type connector
  3902. ATOM_GPIO_INFO aWbGpioStateBlock[MAX_SUPPORTED_CV_STANDARDS];
  3903. ATOM_DTD_FORMAT aModeTimings[MAX_SUPPORTED_CV_STANDARDS];
  3904. }ATOM_COMPONENT_VIDEO_INFO_V21;
  3905. #define ATOM_COMPONENT_VIDEO_INFO_LAST ATOM_COMPONENT_VIDEO_INFO_V21
  3906. /****************************************************************************/
  3907. // Structure used in object_InfoTable
  3908. /****************************************************************************/
  3909. typedef struct _ATOM_OBJECT_HEADER
  3910. {
  3911. ATOM_COMMON_TABLE_HEADER sHeader;
  3912. USHORT usDeviceSupport;
  3913. USHORT usConnectorObjectTableOffset;
  3914. USHORT usRouterObjectTableOffset;
  3915. USHORT usEncoderObjectTableOffset;
  3916. USHORT usProtectionObjectTableOffset; //only available when Protection block is independent.
  3917. USHORT usDisplayPathTableOffset;
  3918. }ATOM_OBJECT_HEADER;
  3919. typedef struct _ATOM_OBJECT_HEADER_V3
  3920. {
  3921. ATOM_COMMON_TABLE_HEADER sHeader;
  3922. USHORT usDeviceSupport;
  3923. USHORT usConnectorObjectTableOffset;
  3924. USHORT usRouterObjectTableOffset;
  3925. USHORT usEncoderObjectTableOffset;
  3926. USHORT usProtectionObjectTableOffset; //only available when Protection block is independent.
  3927. USHORT usDisplayPathTableOffset;
  3928. USHORT usMiscObjectTableOffset;
  3929. }ATOM_OBJECT_HEADER_V3;
  3930. typedef struct _ATOM_DISPLAY_OBJECT_PATH
  3931. {
  3932. USHORT usDeviceTag; //supported device
  3933. USHORT usSize; //the size of ATOM_DISPLAY_OBJECT_PATH
  3934. USHORT usConnObjectId; //Connector Object ID
  3935. USHORT usGPUObjectId; //GPU ID
  3936. USHORT usGraphicObjIds[1]; //1st Encoder Obj source from GPU to last Graphic Obj destinate to connector.
  3937. }ATOM_DISPLAY_OBJECT_PATH;
  3938. typedef struct _ATOM_DISPLAY_EXTERNAL_OBJECT_PATH
  3939. {
  3940. USHORT usDeviceTag; //supported device
  3941. USHORT usSize; //the size of ATOM_DISPLAY_OBJECT_PATH
  3942. USHORT usConnObjectId; //Connector Object ID
  3943. USHORT usGPUObjectId; //GPU ID
  3944. USHORT usGraphicObjIds[2]; //usGraphicObjIds[0]= GPU internal encoder, usGraphicObjIds[1]= external encoder
  3945. }ATOM_DISPLAY_EXTERNAL_OBJECT_PATH;
  3946. typedef struct _ATOM_DISPLAY_OBJECT_PATH_TABLE
  3947. {
  3948. UCHAR ucNumOfDispPath;
  3949. UCHAR ucVersion;
  3950. UCHAR ucPadding[2];
  3951. ATOM_DISPLAY_OBJECT_PATH asDispPath[1];
  3952. }ATOM_DISPLAY_OBJECT_PATH_TABLE;
  3953. typedef struct _ATOM_OBJECT //each object has this structure
  3954. {
  3955. USHORT usObjectID;
  3956. USHORT usSrcDstTableOffset;
  3957. USHORT usRecordOffset; //this pointing to a bunch of records defined below
  3958. USHORT usReserved;
  3959. }ATOM_OBJECT;
  3960. typedef struct _ATOM_OBJECT_TABLE //Above 4 object table offset pointing to a bunch of objects all have this structure
  3961. {
  3962. UCHAR ucNumberOfObjects;
  3963. UCHAR ucPadding[3];
  3964. ATOM_OBJECT asObjects[1];
  3965. }ATOM_OBJECT_TABLE;
  3966. typedef struct _ATOM_SRC_DST_TABLE_FOR_ONE_OBJECT //usSrcDstTableOffset pointing to this structure
  3967. {
  3968. UCHAR ucNumberOfSrc;
  3969. USHORT usSrcObjectID[1];
  3970. UCHAR ucNumberOfDst;
  3971. USHORT usDstObjectID[1];
  3972. }ATOM_SRC_DST_TABLE_FOR_ONE_OBJECT;
  3973. //Two definitions below are for OPM on MXM module designs
  3974. #define EXT_HPDPIN_LUTINDEX_0 0
  3975. #define EXT_HPDPIN_LUTINDEX_1 1
  3976. #define EXT_HPDPIN_LUTINDEX_2 2
  3977. #define EXT_HPDPIN_LUTINDEX_3 3
  3978. #define EXT_HPDPIN_LUTINDEX_4 4
  3979. #define EXT_HPDPIN_LUTINDEX_5 5
  3980. #define EXT_HPDPIN_LUTINDEX_6 6
  3981. #define EXT_HPDPIN_LUTINDEX_7 7
  3982. #define MAX_NUMBER_OF_EXT_HPDPIN_LUT_ENTRIES (EXT_HPDPIN_LUTINDEX_7+1)
  3983. #define EXT_AUXDDC_LUTINDEX_0 0
  3984. #define EXT_AUXDDC_LUTINDEX_1 1
  3985. #define EXT_AUXDDC_LUTINDEX_2 2
  3986. #define EXT_AUXDDC_LUTINDEX_3 3
  3987. #define EXT_AUXDDC_LUTINDEX_4 4
  3988. #define EXT_AUXDDC_LUTINDEX_5 5
  3989. #define EXT_AUXDDC_LUTINDEX_6 6
  3990. #define EXT_AUXDDC_LUTINDEX_7 7
  3991. #define MAX_NUMBER_OF_EXT_AUXDDC_LUT_ENTRIES (EXT_AUXDDC_LUTINDEX_7+1)
  3992. //ucChannelMapping are defined as following
  3993. //for DP connector, eDP, DP to VGA/LVDS
  3994. //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
  3995. //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
  3996. //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
  3997. //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
  3998. typedef struct _ATOM_DP_CONN_CHANNEL_MAPPING
  3999. {
  4000. #if ATOM_BIG_ENDIAN
  4001. UCHAR ucDP_Lane3_Source:2;
  4002. UCHAR ucDP_Lane2_Source:2;
  4003. UCHAR ucDP_Lane1_Source:2;
  4004. UCHAR ucDP_Lane0_Source:2;
  4005. #else
  4006. UCHAR ucDP_Lane0_Source:2;
  4007. UCHAR ucDP_Lane1_Source:2;
  4008. UCHAR ucDP_Lane2_Source:2;
  4009. UCHAR ucDP_Lane3_Source:2;
  4010. #endif
  4011. }ATOM_DP_CONN_CHANNEL_MAPPING;
  4012. //for DVI/HDMI, in dual link case, both links have to have same mapping.
  4013. //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
  4014. //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
  4015. //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
  4016. //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
  4017. typedef struct _ATOM_DVI_CONN_CHANNEL_MAPPING
  4018. {
  4019. #if ATOM_BIG_ENDIAN
  4020. UCHAR ucDVI_CLK_Source:2;
  4021. UCHAR ucDVI_DATA0_Source:2;
  4022. UCHAR ucDVI_DATA1_Source:2;
  4023. UCHAR ucDVI_DATA2_Source:2;
  4024. #else
  4025. UCHAR ucDVI_DATA2_Source:2;
  4026. UCHAR ucDVI_DATA1_Source:2;
  4027. UCHAR ucDVI_DATA0_Source:2;
  4028. UCHAR ucDVI_CLK_Source:2;
  4029. #endif
  4030. }ATOM_DVI_CONN_CHANNEL_MAPPING;
  4031. typedef struct _EXT_DISPLAY_PATH
  4032. {
  4033. USHORT usDeviceTag; //A bit vector to show what devices are supported
  4034. USHORT usDeviceACPIEnum; //16bit device ACPI id.
  4035. USHORT usDeviceConnector; //A physical connector for displays to plug in, using object connector definitions
  4036. UCHAR ucExtAUXDDCLutIndex; //An index into external AUX/DDC channel LUT
  4037. UCHAR ucExtHPDPINLutIndex; //An index into external HPD pin LUT
  4038. USHORT usExtEncoderObjId; //external encoder object id
  4039. union{
  4040. UCHAR ucChannelMapping; // if ucChannelMapping=0, using default one to one mapping
  4041. ATOM_DP_CONN_CHANNEL_MAPPING asDPMapping;
  4042. ATOM_DVI_CONN_CHANNEL_MAPPING asDVIMapping;
  4043. };
  4044. UCHAR ucChPNInvert; // bit vector for up to 8 lanes, =0: P and N is not invert, =1 P and N is inverted
  4045. USHORT usCaps;
  4046. USHORT usReserved;
  4047. }EXT_DISPLAY_PATH;
  4048. #define NUMBER_OF_UCHAR_FOR_GUID 16
  4049. #define MAX_NUMBER_OF_EXT_DISPLAY_PATH 7
  4050. //usCaps
  4051. #define EXT_DISPLAY_PATH_CAPS__HBR2_DISABLE 0x0001
  4052. #define EXT_DISPLAY_PATH_CAPS__DP_FIXED_VS_EN 0x0002
  4053. #define EXT_DISPLAY_PATH_CAPS__EXT_CHIP_MASK 0x007C
  4054. #define EXT_DISPLAY_PATH_CAPS__HDMI20_PI3EQX1204 (0x01 << 2 ) //PI redriver chip
  4055. #define EXT_DISPLAY_PATH_CAPS__HDMI20_TISN65DP159RSBT (0x02 << 2 ) //TI retimer chip
  4056. #define EXT_DISPLAY_PATH_CAPS__HDMI20_PARADE_PS175 (0x03 << 2 ) //Parade DP->HDMI recoverter chip
  4057. typedef struct _ATOM_EXTERNAL_DISPLAY_CONNECTION_INFO
  4058. {
  4059. ATOM_COMMON_TABLE_HEADER sHeader;
  4060. UCHAR ucGuid [NUMBER_OF_UCHAR_FOR_GUID]; // a GUID is a 16 byte long string
  4061. EXT_DISPLAY_PATH sPath[MAX_NUMBER_OF_EXT_DISPLAY_PATH]; // total of fixed 7 entries.
  4062. UCHAR ucChecksum; // a simple Checksum of the sum of whole structure equal to 0x0.
  4063. UCHAR uc3DStereoPinId; // use for eDP panel
  4064. UCHAR ucRemoteDisplayConfig;
  4065. UCHAR uceDPToLVDSRxId;
  4066. UCHAR ucFixDPVoltageSwing; // usCaps[1]=1, this indicate DP_LANE_SET value
  4067. UCHAR Reserved[3]; // for potential expansion
  4068. }ATOM_EXTERNAL_DISPLAY_CONNECTION_INFO;
  4069. //Related definitions, all records are differnt but they have a commond header
  4070. typedef struct _ATOM_COMMON_RECORD_HEADER
  4071. {
  4072. UCHAR ucRecordType; //An emun to indicate the record type
  4073. UCHAR ucRecordSize; //The size of the whole record in byte
  4074. }ATOM_COMMON_RECORD_HEADER;
  4075. #define ATOM_I2C_RECORD_TYPE 1
  4076. #define ATOM_HPD_INT_RECORD_TYPE 2
  4077. #define ATOM_OUTPUT_PROTECTION_RECORD_TYPE 3
  4078. #define ATOM_CONNECTOR_DEVICE_TAG_RECORD_TYPE 4
  4079. #define ATOM_CONNECTOR_DVI_EXT_INPUT_RECORD_TYPE 5 //Obsolete, switch to use GPIO_CNTL_RECORD_TYPE
  4080. #define ATOM_ENCODER_FPGA_CONTROL_RECORD_TYPE 6 //Obsolete, switch to use GPIO_CNTL_RECORD_TYPE
  4081. #define ATOM_CONNECTOR_CVTV_SHARE_DIN_RECORD_TYPE 7
  4082. #define ATOM_JTAG_RECORD_TYPE 8 //Obsolete, switch to use GPIO_CNTL_RECORD_TYPE
  4083. #define ATOM_OBJECT_GPIO_CNTL_RECORD_TYPE 9
  4084. #define ATOM_ENCODER_DVO_CF_RECORD_TYPE 10
  4085. #define ATOM_CONNECTOR_CF_RECORD_TYPE 11
  4086. #define ATOM_CONNECTOR_HARDCODE_DTD_RECORD_TYPE 12
  4087. #define ATOM_CONNECTOR_PCIE_SUBCONNECTOR_RECORD_TYPE 13
  4088. #define ATOM_ROUTER_DDC_PATH_SELECT_RECORD_TYPE 14
  4089. #define ATOM_ROUTER_DATA_CLOCK_PATH_SELECT_RECORD_TYPE 15
  4090. #define ATOM_CONNECTOR_HPDPIN_LUT_RECORD_TYPE 16 //This is for the case when connectors are not known to object table
  4091. #define ATOM_CONNECTOR_AUXDDC_LUT_RECORD_TYPE 17 //This is for the case when connectors are not known to object table
  4092. #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
  4093. #define ATOM_CONNECTOR_REMOTE_CAP_RECORD_TYPE 19
  4094. #define ATOM_ENCODER_CAP_RECORD_TYPE 20
  4095. #define ATOM_BRACKET_LAYOUT_RECORD_TYPE 21
  4096. #define ATOM_CONNECTOR_FORCED_TMDS_CAP_RECORD_TYPE 22
  4097. //Must be updated when new record type is added,equal to that record definition!
  4098. #define ATOM_MAX_OBJECT_RECORD_NUMBER ATOM_CONNECTOR_FORCED_TMDS_CAP_RECORD_TYPE
  4099. typedef struct _ATOM_I2C_RECORD
  4100. {
  4101. ATOM_COMMON_RECORD_HEADER sheader;
  4102. ATOM_I2C_ID_CONFIG sucI2cId;
  4103. UCHAR ucI2CAddr; //The slave address, it's 0 when the record is attached to connector for DDC
  4104. }ATOM_I2C_RECORD;
  4105. typedef struct _ATOM_HPD_INT_RECORD
  4106. {
  4107. ATOM_COMMON_RECORD_HEADER sheader;
  4108. UCHAR ucHPDIntGPIOID; //Corresponding block in GPIO_PIN_INFO table gives the pin info
  4109. UCHAR ucPlugged_PinState;
  4110. }ATOM_HPD_INT_RECORD;
  4111. typedef struct _ATOM_OUTPUT_PROTECTION_RECORD
  4112. {
  4113. ATOM_COMMON_RECORD_HEADER sheader;
  4114. UCHAR ucProtectionFlag;
  4115. UCHAR ucReserved;
  4116. }ATOM_OUTPUT_PROTECTION_RECORD;
  4117. typedef struct _ATOM_CONNECTOR_DEVICE_TAG
  4118. {
  4119. ULONG ulACPIDeviceEnum; //Reserved for now
  4120. USHORT usDeviceID; //This Id is same as "ATOM_DEVICE_XXX_SUPPORT"
  4121. USHORT usPadding;
  4122. }ATOM_CONNECTOR_DEVICE_TAG;
  4123. typedef struct _ATOM_CONNECTOR_DEVICE_TAG_RECORD
  4124. {
  4125. ATOM_COMMON_RECORD_HEADER sheader;
  4126. UCHAR ucNumberOfDevice;
  4127. UCHAR ucReserved;
  4128. ATOM_CONNECTOR_DEVICE_TAG asDeviceTag[1]; //This Id is same as "ATOM_DEVICE_XXX_SUPPORT", 1 is only for allocation
  4129. }ATOM_CONNECTOR_DEVICE_TAG_RECORD;
  4130. typedef struct _ATOM_CONNECTOR_DVI_EXT_INPUT_RECORD
  4131. {
  4132. ATOM_COMMON_RECORD_HEADER sheader;
  4133. UCHAR ucConfigGPIOID;
  4134. UCHAR ucConfigGPIOState; //Set to 1 when it's active high to enable external flow in
  4135. UCHAR ucFlowinGPIPID;
  4136. UCHAR ucExtInGPIPID;
  4137. }ATOM_CONNECTOR_DVI_EXT_INPUT_RECORD;
  4138. typedef struct _ATOM_ENCODER_FPGA_CONTROL_RECORD
  4139. {
  4140. ATOM_COMMON_RECORD_HEADER sheader;
  4141. UCHAR ucCTL1GPIO_ID;
  4142. UCHAR ucCTL1GPIOState; //Set to 1 when it's active high
  4143. UCHAR ucCTL2GPIO_ID;
  4144. UCHAR ucCTL2GPIOState; //Set to 1 when it's active high
  4145. UCHAR ucCTL3GPIO_ID;
  4146. UCHAR ucCTL3GPIOState; //Set to 1 when it's active high
  4147. UCHAR ucCTLFPGA_IN_ID;
  4148. UCHAR ucPadding[3];
  4149. }ATOM_ENCODER_FPGA_CONTROL_RECORD;
  4150. typedef struct _ATOM_CONNECTOR_CVTV_SHARE_DIN_RECORD
  4151. {
  4152. ATOM_COMMON_RECORD_HEADER sheader;
  4153. UCHAR ucGPIOID; //Corresponding block in GPIO_PIN_INFO table gives the pin info
  4154. UCHAR ucTVActiveState; //Indicating when the pin==0 or 1 when TV is connected
  4155. }ATOM_CONNECTOR_CVTV_SHARE_DIN_RECORD;
  4156. typedef struct _ATOM_JTAG_RECORD
  4157. {
  4158. ATOM_COMMON_RECORD_HEADER sheader;
  4159. UCHAR ucTMSGPIO_ID;
  4160. UCHAR ucTMSGPIOState; //Set to 1 when it's active high
  4161. UCHAR ucTCKGPIO_ID;
  4162. UCHAR ucTCKGPIOState; //Set to 1 when it's active high
  4163. UCHAR ucTDOGPIO_ID;
  4164. UCHAR ucTDOGPIOState; //Set to 1 when it's active high
  4165. UCHAR ucTDIGPIO_ID;
  4166. UCHAR ucTDIGPIOState; //Set to 1 when it's active high
  4167. UCHAR ucPadding[2];
  4168. }ATOM_JTAG_RECORD;
  4169. //The following generic object gpio pin control record type will replace JTAG_RECORD/FPGA_CONTROL_RECORD/DVI_EXT_INPUT_RECORD above gradually
  4170. typedef struct _ATOM_GPIO_PIN_CONTROL_PAIR
  4171. {
  4172. UCHAR ucGPIOID; // GPIO_ID, find the corresponding ID in GPIO_LUT table
  4173. UCHAR ucGPIO_PinState; // Pin state showing how to set-up the pin
  4174. }ATOM_GPIO_PIN_CONTROL_PAIR;
  4175. typedef struct _ATOM_OBJECT_GPIO_CNTL_RECORD
  4176. {
  4177. ATOM_COMMON_RECORD_HEADER sheader;
  4178. UCHAR ucFlags; // Future expnadibility
  4179. UCHAR ucNumberOfPins; // Number of GPIO pins used to control the object
  4180. ATOM_GPIO_PIN_CONTROL_PAIR asGpio[1]; // the real gpio pin pair determined by number of pins ucNumberOfPins
  4181. }ATOM_OBJECT_GPIO_CNTL_RECORD;
  4182. //Definitions for GPIO pin state
  4183. #define GPIO_PIN_TYPE_INPUT 0x00
  4184. #define GPIO_PIN_TYPE_OUTPUT 0x10
  4185. #define GPIO_PIN_TYPE_HW_CONTROL 0x20
  4186. //For GPIO_PIN_TYPE_OUTPUT the following is defined
  4187. #define GPIO_PIN_OUTPUT_STATE_MASK 0x01
  4188. #define GPIO_PIN_OUTPUT_STATE_SHIFT 0
  4189. #define GPIO_PIN_STATE_ACTIVE_LOW 0x0
  4190. #define GPIO_PIN_STATE_ACTIVE_HIGH 0x1
  4191. // Indexes to GPIO array in GLSync record
  4192. // GLSync record is for Frame Lock/Gen Lock feature.
  4193. #define ATOM_GPIO_INDEX_GLSYNC_REFCLK 0
  4194. #define ATOM_GPIO_INDEX_GLSYNC_HSYNC 1
  4195. #define ATOM_GPIO_INDEX_GLSYNC_VSYNC 2
  4196. #define ATOM_GPIO_INDEX_GLSYNC_SWAP_REQ 3
  4197. #define ATOM_GPIO_INDEX_GLSYNC_SWAP_GNT 4
  4198. #define ATOM_GPIO_INDEX_GLSYNC_INTERRUPT 5
  4199. #define ATOM_GPIO_INDEX_GLSYNC_V_RESET 6
  4200. #define ATOM_GPIO_INDEX_GLSYNC_SWAP_CNTL 7
  4201. #define ATOM_GPIO_INDEX_GLSYNC_SWAP_SEL 8
  4202. #define ATOM_GPIO_INDEX_GLSYNC_MAX 9
  4203. typedef struct _ATOM_ENCODER_DVO_CF_RECORD
  4204. {
  4205. ATOM_COMMON_RECORD_HEADER sheader;
  4206. ULONG ulStrengthControl; // DVOA strength control for CF
  4207. UCHAR ucPadding[2];
  4208. }ATOM_ENCODER_DVO_CF_RECORD;
  4209. // Bit maps for ATOM_ENCODER_CAP_RECORD.usEncoderCap
  4210. #define ATOM_ENCODER_CAP_RECORD_HBR2 0x01 // DP1.2 HBR2 is supported by HW encoder, it is retired in NI. the real meaning from SI is MST_EN
  4211. #define ATOM_ENCODER_CAP_RECORD_MST_EN 0x01 // from SI, this bit means DP MST is enable or not.
  4212. #define ATOM_ENCODER_CAP_RECORD_HBR2_EN 0x02 // DP1.2 HBR2 setting is qualified and HBR2 can be enabled
  4213. #define ATOM_ENCODER_CAP_RECORD_HDMI6Gbps_EN 0x04 // HDMI2.0 6Gbps enable or not.
  4214. #define ATOM_ENCODER_CAP_RECORD_HBR3_EN 0x08 // DP1.3 HBR3 is supported by board.
  4215. typedef struct _ATOM_ENCODER_CAP_RECORD
  4216. {
  4217. ATOM_COMMON_RECORD_HEADER sheader;
  4218. union {
  4219. USHORT usEncoderCap;
  4220. struct {
  4221. #if ATOM_BIG_ENDIAN
  4222. USHORT usReserved:14; // Bit1-15 may be defined for other capability in future
  4223. USHORT usHBR2En:1; // Bit1 is for DP1.2 HBR2 enable
  4224. USHORT usHBR2Cap:1; // Bit0 is for DP1.2 HBR2 capability.
  4225. #else
  4226. USHORT usHBR2Cap:1; // Bit0 is for DP1.2 HBR2 capability.
  4227. USHORT usHBR2En:1; // Bit1 is for DP1.2 HBR2 enable
  4228. USHORT usReserved:14; // Bit1-15 may be defined for other capability in future
  4229. #endif
  4230. };
  4231. };
  4232. }ATOM_ENCODER_CAP_RECORD;
  4233. // Used after SI
  4234. typedef struct _ATOM_ENCODER_CAP_RECORD_V2
  4235. {
  4236. ATOM_COMMON_RECORD_HEADER sheader;
  4237. union {
  4238. USHORT usEncoderCap;
  4239. struct {
  4240. #if ATOM_BIG_ENDIAN
  4241. USHORT usReserved:12; // Bit4-15 may be defined for other capability in future
  4242. USHORT usHBR3En:1; // bit3 is for DP1.3 HBR3 enable
  4243. USHORT usHDMI6GEn:1; // Bit2 is for HDMI6Gbps enable, this bit is used starting from CZ( APU) Ellemere (dGPU)
  4244. USHORT usHBR2En:1; // Bit1 is for DP1.2 HBR2 enable
  4245. USHORT usMSTEn:1; // Bit0 is for DP1.2 MST enable
  4246. #else
  4247. USHORT usMSTEn:1; // Bit0 is for DP1.2 MST enable
  4248. USHORT usHBR2En:1; // Bit1 is for DP1.2 HBR2 enable
  4249. USHORT usHDMI6GEn:1; // Bit2 is for HDMI6Gbps enable, this bit is used starting from CZ( APU) Ellemere (dGPU)
  4250. USHORT usHBR3En:1; // bit3 is for DP1.3 HBR3 enable
  4251. USHORT usReserved:12; // Bit4-15 may be defined for other capability in future
  4252. #endif
  4253. };
  4254. };
  4255. }ATOM_ENCODER_CAP_RECORD_V2;
  4256. // value for ATOM_CONNECTOR_CF_RECORD.ucConnectedDvoBundle
  4257. #define ATOM_CONNECTOR_CF_RECORD_CONNECTED_UPPER12BITBUNDLEA 1
  4258. #define ATOM_CONNECTOR_CF_RECORD_CONNECTED_LOWER12BITBUNDLEB 2
  4259. typedef struct _ATOM_CONNECTOR_CF_RECORD
  4260. {
  4261. ATOM_COMMON_RECORD_HEADER sheader;
  4262. USHORT usMaxPixClk;
  4263. UCHAR ucFlowCntlGpioId;
  4264. UCHAR ucSwapCntlGpioId;
  4265. UCHAR ucConnectedDvoBundle;
  4266. UCHAR ucPadding;
  4267. }ATOM_CONNECTOR_CF_RECORD;
  4268. typedef struct _ATOM_CONNECTOR_HARDCODE_DTD_RECORD
  4269. {
  4270. ATOM_COMMON_RECORD_HEADER sheader;
  4271. ATOM_DTD_FORMAT asTiming;
  4272. }ATOM_CONNECTOR_HARDCODE_DTD_RECORD;
  4273. typedef struct _ATOM_CONNECTOR_PCIE_SUBCONNECTOR_RECORD
  4274. {
  4275. ATOM_COMMON_RECORD_HEADER sheader; //ATOM_CONNECTOR_PCIE_SUBCONNECTOR_RECORD_TYPE
  4276. UCHAR ucSubConnectorType; //CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D|X_ID_DUAL_LINK_DVI_D|HDMI_TYPE_A
  4277. UCHAR ucReserved;
  4278. }ATOM_CONNECTOR_PCIE_SUBCONNECTOR_RECORD;
  4279. typedef struct _ATOM_ROUTER_DDC_PATH_SELECT_RECORD
  4280. {
  4281. ATOM_COMMON_RECORD_HEADER sheader;
  4282. UCHAR ucMuxType; //decide the number of ucMuxState, =0, no pin state, =1: single state with complement, >1: multiple state
  4283. UCHAR ucMuxControlPin;
  4284. UCHAR ucMuxState[2]; //for alligment purpose
  4285. }ATOM_ROUTER_DDC_PATH_SELECT_RECORD;
  4286. typedef struct _ATOM_ROUTER_DATA_CLOCK_PATH_SELECT_RECORD
  4287. {
  4288. ATOM_COMMON_RECORD_HEADER sheader;
  4289. UCHAR ucMuxType;
  4290. UCHAR ucMuxControlPin;
  4291. UCHAR ucMuxState[2]; //for alligment purpose
  4292. }ATOM_ROUTER_DATA_CLOCK_PATH_SELECT_RECORD;
  4293. // define ucMuxType
  4294. #define ATOM_ROUTER_MUX_PIN_STATE_MASK 0x0f
  4295. #define ATOM_ROUTER_MUX_PIN_SINGLE_STATE_COMPLEMENT 0x01
  4296. typedef struct _ATOM_CONNECTOR_HPDPIN_LUT_RECORD //record for ATOM_CONNECTOR_HPDPIN_LUT_RECORD_TYPE
  4297. {
  4298. ATOM_COMMON_RECORD_HEADER sheader;
  4299. UCHAR ucHPDPINMap[MAX_NUMBER_OF_EXT_HPDPIN_LUT_ENTRIES]; //An fixed size array which maps external pins to internal GPIO_PIN_INFO table
  4300. }ATOM_CONNECTOR_HPDPIN_LUT_RECORD;
  4301. typedef struct _ATOM_CONNECTOR_AUXDDC_LUT_RECORD //record for ATOM_CONNECTOR_AUXDDC_LUT_RECORD_TYPE
  4302. {
  4303. ATOM_COMMON_RECORD_HEADER sheader;
  4304. ATOM_I2C_ID_CONFIG ucAUXDDCMap[MAX_NUMBER_OF_EXT_AUXDDC_LUT_ENTRIES]; //An fixed size array which maps external pins to internal DDC ID
  4305. }ATOM_CONNECTOR_AUXDDC_LUT_RECORD;
  4306. typedef struct _ATOM_OBJECT_LINK_RECORD
  4307. {
  4308. ATOM_COMMON_RECORD_HEADER sheader;
  4309. USHORT usObjectID; //could be connector, encorder or other object in object.h
  4310. }ATOM_OBJECT_LINK_RECORD;
  4311. typedef struct _ATOM_CONNECTOR_REMOTE_CAP_RECORD
  4312. {
  4313. ATOM_COMMON_RECORD_HEADER sheader;
  4314. USHORT usReserved;
  4315. }ATOM_CONNECTOR_REMOTE_CAP_RECORD;
  4316. typedef struct _ATOM_CONNECTOR_FORCED_TMDS_CAP_RECORD
  4317. {
  4318. ATOM_COMMON_RECORD_HEADER sheader;
  4319. // override TMDS capability on this connector when it operate in TMDS mode. usMaxTmdsClkRate = max TMDS Clock in Mhz/2.5
  4320. UCHAR ucMaxTmdsClkRateIn2_5Mhz;
  4321. UCHAR ucReserved;
  4322. } ATOM_CONNECTOR_FORCED_TMDS_CAP_RECORD;
  4323. typedef struct _ATOM_CONNECTOR_LAYOUT_INFO
  4324. {
  4325. USHORT usConnectorObjectId;
  4326. UCHAR ucConnectorType;
  4327. UCHAR ucPosition;
  4328. }ATOM_CONNECTOR_LAYOUT_INFO;
  4329. // define ATOM_CONNECTOR_LAYOUT_INFO.ucConnectorType to describe the display connector size
  4330. #define CONNECTOR_TYPE_DVI_D 1
  4331. #define CONNECTOR_TYPE_DVI_I 2
  4332. #define CONNECTOR_TYPE_VGA 3
  4333. #define CONNECTOR_TYPE_HDMI 4
  4334. #define CONNECTOR_TYPE_DISPLAY_PORT 5
  4335. #define CONNECTOR_TYPE_MINI_DISPLAY_PORT 6
  4336. typedef struct _ATOM_BRACKET_LAYOUT_RECORD
  4337. {
  4338. ATOM_COMMON_RECORD_HEADER sheader;
  4339. UCHAR ucLength;
  4340. UCHAR ucWidth;
  4341. UCHAR ucConnNum;
  4342. UCHAR ucReserved;
  4343. ATOM_CONNECTOR_LAYOUT_INFO asConnInfo[1];
  4344. }ATOM_BRACKET_LAYOUT_RECORD;
  4345. /****************************************************************************/
  4346. // Structure used in XXXX
  4347. /****************************************************************************/
  4348. typedef struct _ATOM_VOLTAGE_INFO_HEADER
  4349. {
  4350. USHORT usVDDCBaseLevel; //In number of 50mv unit
  4351. USHORT usReserved; //For possible extension table offset
  4352. UCHAR ucNumOfVoltageEntries;
  4353. UCHAR ucBytesPerVoltageEntry;
  4354. UCHAR ucVoltageStep; //Indicating in how many mv increament is one step, 0.5mv unit
  4355. UCHAR ucDefaultVoltageEntry;
  4356. UCHAR ucVoltageControlI2cLine;
  4357. UCHAR ucVoltageControlAddress;
  4358. UCHAR ucVoltageControlOffset;
  4359. }ATOM_VOLTAGE_INFO_HEADER;
  4360. typedef struct _ATOM_VOLTAGE_INFO
  4361. {
  4362. ATOM_COMMON_TABLE_HEADER sHeader;
  4363. ATOM_VOLTAGE_INFO_HEADER viHeader;
  4364. UCHAR ucVoltageEntries[64]; //64 is for allocation, the actual number of entry is present at ucNumOfVoltageEntries*ucBytesPerVoltageEntry
  4365. }ATOM_VOLTAGE_INFO;
  4366. typedef struct _ATOM_VOLTAGE_FORMULA
  4367. {
  4368. USHORT usVoltageBaseLevel; // In number of 1mv unit
  4369. USHORT usVoltageStep; // Indicating in how many mv increament is one step, 1mv unit
  4370. UCHAR ucNumOfVoltageEntries; // Number of Voltage Entry, which indicate max Voltage
  4371. UCHAR ucFlag; // bit0=0 :step is 1mv =1 0.5mv
  4372. UCHAR ucBaseVID; // if there is no lookup table, VID= BaseVID + ( Vol - BaseLevle ) /VoltageStep
  4373. UCHAR ucReserved;
  4374. UCHAR ucVIDAdjustEntries[32]; // 32 is for allocation, the actual number of entry is present at ucNumOfVoltageEntries
  4375. }ATOM_VOLTAGE_FORMULA;
  4376. typedef struct _VOLTAGE_LUT_ENTRY
  4377. {
  4378. USHORT usVoltageCode; // The Voltage ID, either GPIO or I2C code
  4379. USHORT usVoltageValue; // The corresponding Voltage Value, in mV
  4380. }VOLTAGE_LUT_ENTRY;
  4381. typedef struct _ATOM_VOLTAGE_FORMULA_V2
  4382. {
  4383. UCHAR ucNumOfVoltageEntries; // Number of Voltage Entry, which indicate max Voltage
  4384. UCHAR ucReserved[3];
  4385. VOLTAGE_LUT_ENTRY asVIDAdjustEntries[32];// 32 is for allocation, the actual number of entries is in ucNumOfVoltageEntries
  4386. }ATOM_VOLTAGE_FORMULA_V2;
  4387. typedef struct _ATOM_VOLTAGE_CONTROL
  4388. {
  4389. UCHAR ucVoltageControlId; //Indicate it is controlled by I2C or GPIO or HW state machine
  4390. UCHAR ucVoltageControlI2cLine;
  4391. UCHAR ucVoltageControlAddress;
  4392. UCHAR ucVoltageControlOffset;
  4393. USHORT usGpioPin_AIndex; //GPIO_PAD register index
  4394. UCHAR ucGpioPinBitShift[9]; //at most 8 pin support 255 VIDs, termintate with 0xff
  4395. UCHAR ucReserved;
  4396. }ATOM_VOLTAGE_CONTROL;
  4397. // Define ucVoltageControlId
  4398. #define VOLTAGE_CONTROLLED_BY_HW 0x00
  4399. #define VOLTAGE_CONTROLLED_BY_I2C_MASK 0x7F
  4400. #define VOLTAGE_CONTROLLED_BY_GPIO 0x80
  4401. #define VOLTAGE_CONTROL_ID_LM64 0x01 //I2C control, used for R5xx Core Voltage
  4402. #define VOLTAGE_CONTROL_ID_DAC 0x02 //I2C control, used for R5xx/R6xx MVDDC,MVDDQ or VDDCI
  4403. #define VOLTAGE_CONTROL_ID_VT116xM 0x03 //I2C control, used for R6xx Core Voltage
  4404. #define VOLTAGE_CONTROL_ID_DS4402 0x04
  4405. #define VOLTAGE_CONTROL_ID_UP6266 0x05
  4406. #define VOLTAGE_CONTROL_ID_SCORPIO 0x06
  4407. #define VOLTAGE_CONTROL_ID_VT1556M 0x07
  4408. #define VOLTAGE_CONTROL_ID_CHL822x 0x08
  4409. #define VOLTAGE_CONTROL_ID_VT1586M 0x09
  4410. #define VOLTAGE_CONTROL_ID_UP1637 0x0A
  4411. #define VOLTAGE_CONTROL_ID_CHL8214 0x0B
  4412. #define VOLTAGE_CONTROL_ID_UP1801 0x0C
  4413. #define VOLTAGE_CONTROL_ID_ST6788A 0x0D
  4414. #define VOLTAGE_CONTROL_ID_CHLIR3564SVI2 0x0E
  4415. #define VOLTAGE_CONTROL_ID_AD527x 0x0F
  4416. #define VOLTAGE_CONTROL_ID_NCP81022 0x10
  4417. #define VOLTAGE_CONTROL_ID_LTC2635 0x11
  4418. #define VOLTAGE_CONTROL_ID_NCP4208 0x12
  4419. #define VOLTAGE_CONTROL_ID_IR35xx 0x13
  4420. #define VOLTAGE_CONTROL_ID_RT9403 0x14
  4421. #define VOLTAGE_CONTROL_ID_GENERIC_I2C 0x40
  4422. typedef struct _ATOM_VOLTAGE_OBJECT
  4423. {
  4424. UCHAR ucVoltageType; //Indicate Voltage Source: VDDC, MVDDC, MVDDQ or MVDDCI
  4425. UCHAR ucSize; //Size of Object
  4426. ATOM_VOLTAGE_CONTROL asControl; //describ how to control
  4427. ATOM_VOLTAGE_FORMULA asFormula; //Indicate How to convert real Voltage to VID
  4428. }ATOM_VOLTAGE_OBJECT;
  4429. typedef struct _ATOM_VOLTAGE_OBJECT_V2
  4430. {
  4431. UCHAR ucVoltageType; //Indicate Voltage Source: VDDC, MVDDC, MVDDQ or MVDDCI
  4432. UCHAR ucSize; //Size of Object
  4433. ATOM_VOLTAGE_CONTROL asControl; //describ how to control
  4434. ATOM_VOLTAGE_FORMULA_V2 asFormula; //Indicate How to convert real Voltage to VID
  4435. }ATOM_VOLTAGE_OBJECT_V2;
  4436. typedef struct _ATOM_VOLTAGE_OBJECT_INFO
  4437. {
  4438. ATOM_COMMON_TABLE_HEADER sHeader;
  4439. ATOM_VOLTAGE_OBJECT asVoltageObj[3]; //Info for Voltage control
  4440. }ATOM_VOLTAGE_OBJECT_INFO;
  4441. typedef struct _ATOM_VOLTAGE_OBJECT_INFO_V2
  4442. {
  4443. ATOM_COMMON_TABLE_HEADER sHeader;
  4444. ATOM_VOLTAGE_OBJECT_V2 asVoltageObj[3]; //Info for Voltage control
  4445. }ATOM_VOLTAGE_OBJECT_INFO_V2;
  4446. typedef struct _ATOM_LEAKID_VOLTAGE
  4447. {
  4448. UCHAR ucLeakageId;
  4449. UCHAR ucReserved;
  4450. USHORT usVoltage;
  4451. }ATOM_LEAKID_VOLTAGE;
  4452. typedef struct _ATOM_VOLTAGE_OBJECT_HEADER_V3{
  4453. UCHAR ucVoltageType; //Indicate Voltage Source: VDDC, MVDDC, MVDDQ or MVDDCI
  4454. UCHAR ucVoltageMode; //Indicate voltage control mode: Init/Set/Leakage/Set phase
  4455. USHORT usSize; //Size of Object
  4456. }ATOM_VOLTAGE_OBJECT_HEADER_V3;
  4457. // ATOM_VOLTAGE_OBJECT_HEADER_V3.ucVoltageMode
  4458. #define VOLTAGE_OBJ_GPIO_LUT 0 //VOLTAGE and GPIO Lookup table ->ATOM_GPIO_VOLTAGE_OBJECT_V3
  4459. #define VOLTAGE_OBJ_VR_I2C_INIT_SEQ 3 //VOLTAGE REGULATOR INIT sequece through I2C -> ATOM_I2C_VOLTAGE_OBJECT_V3
  4460. #define VOLTAGE_OBJ_PHASE_LUT 4 //Set Vregulator Phase lookup table ->ATOM_GPIO_VOLTAGE_OBJECT_V3
  4461. #define VOLTAGE_OBJ_SVID2 7 //Indicate voltage control by SVID2 ->ATOM_SVID2_VOLTAGE_OBJECT_V3
  4462. #define VOLTAGE_OBJ_EVV 8
  4463. #define VOLTAGE_OBJ_PWRBOOST_LEAKAGE_LUT 0x10 //Powerboost Voltage and LeakageId lookup table->ATOM_LEAKAGE_VOLTAGE_OBJECT_V3
  4464. #define VOLTAGE_OBJ_HIGH_STATE_LEAKAGE_LUT 0x11 //High voltage state Voltage and LeakageId lookup table->ATOM_LEAKAGE_VOLTAGE_OBJECT_V3
  4465. #define VOLTAGE_OBJ_HIGH1_STATE_LEAKAGE_LUT 0x12 //High1 voltage state Voltage and LeakageId lookup table->ATOM_LEAKAGE_VOLTAGE_OBJECT_V3
  4466. typedef struct _VOLTAGE_LUT_ENTRY_V2
  4467. {
  4468. ULONG ulVoltageId; // The Voltage ID which is used to program GPIO register
  4469. USHORT usVoltageValue; // The corresponding Voltage Value, in mV
  4470. }VOLTAGE_LUT_ENTRY_V2;
  4471. typedef struct _LEAKAGE_VOLTAGE_LUT_ENTRY_V2
  4472. {
  4473. USHORT usVoltageLevel; // The Voltage ID which is used to program GPIO register
  4474. USHORT usVoltageId;
  4475. USHORT usLeakageId; // The corresponding Voltage Value, in mV
  4476. }LEAKAGE_VOLTAGE_LUT_ENTRY_V2;
  4477. typedef struct _ATOM_I2C_VOLTAGE_OBJECT_V3
  4478. {
  4479. ATOM_VOLTAGE_OBJECT_HEADER_V3 sHeader; // voltage mode = VOLTAGE_OBJ_VR_I2C_INIT_SEQ
  4480. UCHAR ucVoltageRegulatorId; //Indicate Voltage Regulator Id
  4481. UCHAR ucVoltageControlI2cLine;
  4482. UCHAR ucVoltageControlAddress;
  4483. UCHAR ucVoltageControlOffset;
  4484. UCHAR ucVoltageControlFlag; // Bit0: 0 - One byte data; 1 - Two byte data
  4485. UCHAR ulReserved[3];
  4486. VOLTAGE_LUT_ENTRY asVolI2cLut[1]; // end with 0xff
  4487. }ATOM_I2C_VOLTAGE_OBJECT_V3;
  4488. // ATOM_I2C_VOLTAGE_OBJECT_V3.ucVoltageControlFlag
  4489. #define VOLTAGE_DATA_ONE_BYTE 0
  4490. #define VOLTAGE_DATA_TWO_BYTE 1
  4491. typedef struct _ATOM_GPIO_VOLTAGE_OBJECT_V3
  4492. {
  4493. ATOM_VOLTAGE_OBJECT_HEADER_V3 sHeader; // voltage mode = VOLTAGE_OBJ_GPIO_LUT or VOLTAGE_OBJ_PHASE_LUT
  4494. UCHAR ucVoltageGpioCntlId; // default is 0 which indicate control through CG VID mode
  4495. UCHAR ucGpioEntryNum; // indiate the entry numbers of Votlage/Gpio value Look up table
  4496. UCHAR ucPhaseDelay; // phase delay in unit of micro second
  4497. UCHAR ucReserved;
  4498. ULONG ulGpioMaskVal; // GPIO Mask value
  4499. VOLTAGE_LUT_ENTRY_V2 asVolGpioLut[1];
  4500. }ATOM_GPIO_VOLTAGE_OBJECT_V3;
  4501. typedef struct _ATOM_LEAKAGE_VOLTAGE_OBJECT_V3
  4502. {
  4503. ATOM_VOLTAGE_OBJECT_HEADER_V3 sHeader; // voltage mode = 0x10/0x11/0x12
  4504. UCHAR ucLeakageCntlId; // default is 0
  4505. UCHAR ucLeakageEntryNum; // indicate the entry number of LeakageId/Voltage Lut table
  4506. UCHAR ucReserved[2];
  4507. ULONG ulMaxVoltageLevel;
  4508. LEAKAGE_VOLTAGE_LUT_ENTRY_V2 asLeakageIdLut[1];
  4509. }ATOM_LEAKAGE_VOLTAGE_OBJECT_V3;
  4510. typedef struct _ATOM_SVID2_VOLTAGE_OBJECT_V3
  4511. {
  4512. ATOM_VOLTAGE_OBJECT_HEADER_V3 sHeader; // voltage mode = VOLTAGE_OBJ_SVID2
  4513. // 14:7 � PSI0_VID
  4514. // 6 � PSI0_EN
  4515. // 5 � PSI1
  4516. // 4:2 � load line slope trim.
  4517. // 1:0 � offset trim,
  4518. USHORT usLoadLine_PSI;
  4519. // GPU GPIO pin Id to SVID2 regulator VRHot pin. possible value 0~31. 0 means GPIO0, 31 means GPIO31
  4520. UCHAR ucSVDGpioId; //0~31 indicate GPIO0~31
  4521. UCHAR ucSVCGpioId; //0~31 indicate GPIO0~31
  4522. ULONG ulReserved;
  4523. }ATOM_SVID2_VOLTAGE_OBJECT_V3;
  4524. typedef struct _ATOM_MERGED_VOLTAGE_OBJECT_V3
  4525. {
  4526. ATOM_VOLTAGE_OBJECT_HEADER_V3 sHeader; // voltage mode = VOLTAGE_OBJ_MERGED_POWER
  4527. UCHAR ucMergedVType; // VDDC/VDCCI/....
  4528. UCHAR ucReserved[3];
  4529. }ATOM_MERGED_VOLTAGE_OBJECT_V3;
  4530. typedef struct _ATOM_EVV_DPM_INFO
  4531. {
  4532. ULONG ulDPMSclk; // DPM state SCLK
  4533. USHORT usVAdjOffset; // Adjust Voltage offset in unit of mv
  4534. UCHAR ucDPMTblVIndex; // Voltage Index in SMC_DPM_Table structure VddcTable/VddGfxTable
  4535. UCHAR ucDPMState; // DPMState0~7
  4536. } ATOM_EVV_DPM_INFO;
  4537. // ucVoltageMode = VOLTAGE_OBJ_EVV
  4538. typedef struct _ATOM_EVV_VOLTAGE_OBJECT_V3
  4539. {
  4540. ATOM_VOLTAGE_OBJECT_HEADER_V3 sHeader; // voltage mode = VOLTAGE_OBJ_SVID2
  4541. ATOM_EVV_DPM_INFO asEvvDpmList[8];
  4542. }ATOM_EVV_VOLTAGE_OBJECT_V3;
  4543. typedef union _ATOM_VOLTAGE_OBJECT_V3{
  4544. ATOM_GPIO_VOLTAGE_OBJECT_V3 asGpioVoltageObj;
  4545. ATOM_I2C_VOLTAGE_OBJECT_V3 asI2cVoltageObj;
  4546. ATOM_LEAKAGE_VOLTAGE_OBJECT_V3 asLeakageObj;
  4547. ATOM_SVID2_VOLTAGE_OBJECT_V3 asSVID2Obj;
  4548. ATOM_EVV_VOLTAGE_OBJECT_V3 asEvvObj;
  4549. }ATOM_VOLTAGE_OBJECT_V3;
  4550. typedef struct _ATOM_VOLTAGE_OBJECT_INFO_V3_1
  4551. {
  4552. ATOM_COMMON_TABLE_HEADER sHeader;
  4553. ATOM_VOLTAGE_OBJECT_V3 asVoltageObj[3]; //Info for Voltage control
  4554. }ATOM_VOLTAGE_OBJECT_INFO_V3_1;
  4555. typedef struct _ATOM_ASIC_PROFILE_VOLTAGE
  4556. {
  4557. UCHAR ucProfileId;
  4558. UCHAR ucReserved;
  4559. USHORT usSize;
  4560. USHORT usEfuseSpareStartAddr;
  4561. USHORT usFuseIndex[8]; //from LSB to MSB, Max 8bit,end of 0xffff if less than 8 efuse id,
  4562. ATOM_LEAKID_VOLTAGE asLeakVol[2]; //Leakid and relatd voltage
  4563. }ATOM_ASIC_PROFILE_VOLTAGE;
  4564. //ucProfileId
  4565. #define ATOM_ASIC_PROFILE_ID_EFUSE_VOLTAGE 1
  4566. #define ATOM_ASIC_PROFILE_ID_EFUSE_PERFORMANCE_VOLTAGE 1
  4567. #define ATOM_ASIC_PROFILE_ID_EFUSE_THERMAL_VOLTAGE 2
  4568. typedef struct _ATOM_ASIC_PROFILING_INFO
  4569. {
  4570. ATOM_COMMON_TABLE_HEADER asHeader;
  4571. ATOM_ASIC_PROFILE_VOLTAGE asVoltage;
  4572. }ATOM_ASIC_PROFILING_INFO;
  4573. typedef struct _ATOM_ASIC_PROFILING_INFO_V2_1
  4574. {
  4575. ATOM_COMMON_TABLE_HEADER asHeader;
  4576. UCHAR ucLeakageBinNum; // indicate the entry number of LeakageId/Voltage Lut table
  4577. USHORT usLeakageBinArrayOffset; // offset of USHORT Leakage Bin list array ( from lower LeakageId to higher)
  4578. UCHAR ucElbVDDC_Num;
  4579. USHORT usElbVDDC_IdArrayOffset; // offset of USHORT virtual VDDC voltage id ( 0xff01~0xff08 )
  4580. USHORT usElbVDDC_LevelArrayOffset; // offset of 2 dimension voltage level USHORT array
  4581. UCHAR ucElbVDDCI_Num;
  4582. USHORT usElbVDDCI_IdArrayOffset; // offset of USHORT virtual VDDCI voltage id ( 0xff01~0xff08 )
  4583. USHORT usElbVDDCI_LevelArrayOffset; // offset of 2 dimension voltage level USHORT array
  4584. }ATOM_ASIC_PROFILING_INFO_V2_1;
  4585. //Here is parameter to convert Efuse value to Measure value
  4586. //Measured = LN((2^Bitsize-1)/EFUSE-1)*(Range)/(-alpha)+(Max+Min)/2
  4587. typedef struct _EFUSE_LOGISTIC_FUNC_PARAM
  4588. {
  4589. USHORT usEfuseIndex; // Efuse Index in DWORD address, for example Index 911, usEuseIndex=112
  4590. UCHAR ucEfuseBitLSB; // Efuse bit LSB in DWORD address, for example Index 911, usEfuseBitLSB= 911-112*8=15
  4591. UCHAR ucEfuseLength; // Efuse bits length,
  4592. ULONG ulEfuseEncodeRange; // Range = Max - Min, bit31 indicate the efuse is negative number
  4593. ULONG ulEfuseEncodeAverage; // Average = ( Max + Min )/2
  4594. }EFUSE_LOGISTIC_FUNC_PARAM;
  4595. //Linear Function: Measured = Round ( Efuse * ( Max-Min )/(2^BitSize -1 ) + Min )
  4596. typedef struct _EFUSE_LINEAR_FUNC_PARAM
  4597. {
  4598. USHORT usEfuseIndex; // Efuse Index in DWORD address, for example Index 911, usEuseIndex=112
  4599. UCHAR ucEfuseBitLSB; // Efuse bit LSB in DWORD address, for example Index 911, usEfuseBitLSB= 911-112*8=15
  4600. UCHAR ucEfuseLength; // Efuse bits length,
  4601. ULONG ulEfuseEncodeRange; // Range = Max - Min, bit31 indicate the efuse is negative number
  4602. ULONG ulEfuseMin; // Min
  4603. }EFUSE_LINEAR_FUNC_PARAM;
  4604. typedef struct _ATOM_ASIC_PROFILING_INFO_V3_1
  4605. {
  4606. ATOM_COMMON_TABLE_HEADER asHeader;
  4607. ULONG ulEvvDerateTdp;
  4608. ULONG ulEvvDerateTdc;
  4609. ULONG ulBoardCoreTemp;
  4610. ULONG ulMaxVddc;
  4611. ULONG ulMinVddc;
  4612. ULONG ulLoadLineSlop;
  4613. ULONG ulLeakageTemp;
  4614. ULONG ulLeakageVoltage;
  4615. EFUSE_LINEAR_FUNC_PARAM sCACm;
  4616. EFUSE_LINEAR_FUNC_PARAM sCACb;
  4617. EFUSE_LOGISTIC_FUNC_PARAM sKt_b;
  4618. EFUSE_LOGISTIC_FUNC_PARAM sKv_m;
  4619. EFUSE_LOGISTIC_FUNC_PARAM sKv_b;
  4620. USHORT usLkgEuseIndex;
  4621. UCHAR ucLkgEfuseBitLSB;
  4622. UCHAR ucLkgEfuseLength;
  4623. ULONG ulLkgEncodeLn_MaxDivMin;
  4624. ULONG ulLkgEncodeMax;
  4625. ULONG ulLkgEncodeMin;
  4626. ULONG ulEfuseLogisticAlpha;
  4627. USHORT usPowerDpm0;
  4628. USHORT usCurrentDpm0;
  4629. USHORT usPowerDpm1;
  4630. USHORT usCurrentDpm1;
  4631. USHORT usPowerDpm2;
  4632. USHORT usCurrentDpm2;
  4633. USHORT usPowerDpm3;
  4634. USHORT usCurrentDpm3;
  4635. USHORT usPowerDpm4;
  4636. USHORT usCurrentDpm4;
  4637. USHORT usPowerDpm5;
  4638. USHORT usCurrentDpm5;
  4639. USHORT usPowerDpm6;
  4640. USHORT usCurrentDpm6;
  4641. USHORT usPowerDpm7;
  4642. USHORT usCurrentDpm7;
  4643. }ATOM_ASIC_PROFILING_INFO_V3_1;
  4644. typedef struct _ATOM_ASIC_PROFILING_INFO_V3_2
  4645. {
  4646. ATOM_COMMON_TABLE_HEADER asHeader;
  4647. ULONG ulEvvLkgFactor;
  4648. ULONG ulBoardCoreTemp;
  4649. ULONG ulMaxVddc;
  4650. ULONG ulMinVddc;
  4651. ULONG ulLoadLineSlop;
  4652. ULONG ulLeakageTemp;
  4653. ULONG ulLeakageVoltage;
  4654. EFUSE_LINEAR_FUNC_PARAM sCACm;
  4655. EFUSE_LINEAR_FUNC_PARAM sCACb;
  4656. EFUSE_LOGISTIC_FUNC_PARAM sKt_b;
  4657. EFUSE_LOGISTIC_FUNC_PARAM sKv_m;
  4658. EFUSE_LOGISTIC_FUNC_PARAM sKv_b;
  4659. USHORT usLkgEuseIndex;
  4660. UCHAR ucLkgEfuseBitLSB;
  4661. UCHAR ucLkgEfuseLength;
  4662. ULONG ulLkgEncodeLn_MaxDivMin;
  4663. ULONG ulLkgEncodeMax;
  4664. ULONG ulLkgEncodeMin;
  4665. ULONG ulEfuseLogisticAlpha;
  4666. USHORT usPowerDpm0;
  4667. USHORT usPowerDpm1;
  4668. USHORT usPowerDpm2;
  4669. USHORT usPowerDpm3;
  4670. USHORT usPowerDpm4;
  4671. USHORT usPowerDpm5;
  4672. USHORT usPowerDpm6;
  4673. USHORT usPowerDpm7;
  4674. ULONG ulTdpDerateDPM0;
  4675. ULONG ulTdpDerateDPM1;
  4676. ULONG ulTdpDerateDPM2;
  4677. ULONG ulTdpDerateDPM3;
  4678. ULONG ulTdpDerateDPM4;
  4679. ULONG ulTdpDerateDPM5;
  4680. ULONG ulTdpDerateDPM6;
  4681. ULONG ulTdpDerateDPM7;
  4682. }ATOM_ASIC_PROFILING_INFO_V3_2;
  4683. // for Tonga/Fiji speed EVV algorithm
  4684. typedef struct _ATOM_ASIC_PROFILING_INFO_V3_3
  4685. {
  4686. ATOM_COMMON_TABLE_HEADER asHeader;
  4687. ULONG ulEvvLkgFactor;
  4688. ULONG ulBoardCoreTemp;
  4689. ULONG ulMaxVddc;
  4690. ULONG ulMinVddc;
  4691. ULONG ulLoadLineSlop;
  4692. ULONG ulLeakageTemp;
  4693. ULONG ulLeakageVoltage;
  4694. EFUSE_LINEAR_FUNC_PARAM sCACm;
  4695. EFUSE_LINEAR_FUNC_PARAM sCACb;
  4696. EFUSE_LOGISTIC_FUNC_PARAM sKt_b;
  4697. EFUSE_LOGISTIC_FUNC_PARAM sKv_m;
  4698. EFUSE_LOGISTIC_FUNC_PARAM sKv_b;
  4699. USHORT usLkgEuseIndex;
  4700. UCHAR ucLkgEfuseBitLSB;
  4701. UCHAR ucLkgEfuseLength;
  4702. ULONG ulLkgEncodeLn_MaxDivMin;
  4703. ULONG ulLkgEncodeMax;
  4704. ULONG ulLkgEncodeMin;
  4705. ULONG ulEfuseLogisticAlpha;
  4706. union{
  4707. USHORT usPowerDpm0;
  4708. USHORT usParamNegFlag; //bit0 =1 :indicate ulRoBeta is Negative, bit1=1 indicate Kv_m max is postive
  4709. };
  4710. USHORT usPowerDpm1;
  4711. USHORT usPowerDpm2;
  4712. USHORT usPowerDpm3;
  4713. USHORT usPowerDpm4;
  4714. USHORT usPowerDpm5;
  4715. USHORT usPowerDpm6;
  4716. USHORT usPowerDpm7;
  4717. ULONG ulTdpDerateDPM0;
  4718. ULONG ulTdpDerateDPM1;
  4719. ULONG ulTdpDerateDPM2;
  4720. ULONG ulTdpDerateDPM3;
  4721. ULONG ulTdpDerateDPM4;
  4722. ULONG ulTdpDerateDPM5;
  4723. ULONG ulTdpDerateDPM6;
  4724. ULONG ulTdpDerateDPM7;
  4725. EFUSE_LINEAR_FUNC_PARAM sRoFuse;
  4726. ULONG ulRoAlpha;
  4727. ULONG ulRoBeta;
  4728. ULONG ulRoGamma;
  4729. ULONG ulRoEpsilon;
  4730. ULONG ulATermRo;
  4731. ULONG ulBTermRo;
  4732. ULONG ulCTermRo;
  4733. ULONG ulSclkMargin;
  4734. ULONG ulFmaxPercent;
  4735. ULONG ulCRPercent;
  4736. ULONG ulSFmaxPercent;
  4737. ULONG ulSCRPercent;
  4738. ULONG ulSDCMargine;
  4739. }ATOM_ASIC_PROFILING_INFO_V3_3;
  4740. // for Fiji speed EVV algorithm
  4741. typedef struct _ATOM_ASIC_PROFILING_INFO_V3_4
  4742. {
  4743. ATOM_COMMON_TABLE_HEADER asHeader;
  4744. ULONG ulEvvLkgFactor;
  4745. ULONG ulBoardCoreTemp;
  4746. ULONG ulMaxVddc;
  4747. ULONG ulMinVddc;
  4748. ULONG ulLoadLineSlop;
  4749. ULONG ulLeakageTemp;
  4750. ULONG ulLeakageVoltage;
  4751. EFUSE_LINEAR_FUNC_PARAM sCACm;
  4752. EFUSE_LINEAR_FUNC_PARAM sCACb;
  4753. EFUSE_LOGISTIC_FUNC_PARAM sKt_b;
  4754. EFUSE_LOGISTIC_FUNC_PARAM sKv_m;
  4755. EFUSE_LOGISTIC_FUNC_PARAM sKv_b;
  4756. USHORT usLkgEuseIndex;
  4757. UCHAR ucLkgEfuseBitLSB;
  4758. UCHAR ucLkgEfuseLength;
  4759. ULONG ulLkgEncodeLn_MaxDivMin;
  4760. ULONG ulLkgEncodeMax;
  4761. ULONG ulLkgEncodeMin;
  4762. ULONG ulEfuseLogisticAlpha;
  4763. USHORT usPowerDpm0;
  4764. USHORT usPowerDpm1;
  4765. USHORT usPowerDpm2;
  4766. USHORT usPowerDpm3;
  4767. USHORT usPowerDpm4;
  4768. USHORT usPowerDpm5;
  4769. USHORT usPowerDpm6;
  4770. USHORT usPowerDpm7;
  4771. ULONG ulTdpDerateDPM0;
  4772. ULONG ulTdpDerateDPM1;
  4773. ULONG ulTdpDerateDPM2;
  4774. ULONG ulTdpDerateDPM3;
  4775. ULONG ulTdpDerateDPM4;
  4776. ULONG ulTdpDerateDPM5;
  4777. ULONG ulTdpDerateDPM6;
  4778. ULONG ulTdpDerateDPM7;
  4779. EFUSE_LINEAR_FUNC_PARAM sRoFuse;
  4780. ULONG ulEvvDefaultVddc;
  4781. ULONG ulEvvNoCalcVddc;
  4782. USHORT usParamNegFlag;
  4783. USHORT usSpeed_Model;
  4784. ULONG ulSM_A0;
  4785. ULONG ulSM_A1;
  4786. ULONG ulSM_A2;
  4787. ULONG ulSM_A3;
  4788. ULONG ulSM_A4;
  4789. ULONG ulSM_A5;
  4790. ULONG ulSM_A6;
  4791. ULONG ulSM_A7;
  4792. UCHAR ucSM_A0_sign;
  4793. UCHAR ucSM_A1_sign;
  4794. UCHAR ucSM_A2_sign;
  4795. UCHAR ucSM_A3_sign;
  4796. UCHAR ucSM_A4_sign;
  4797. UCHAR ucSM_A5_sign;
  4798. UCHAR ucSM_A6_sign;
  4799. UCHAR ucSM_A7_sign;
  4800. ULONG ulMargin_RO_a;
  4801. ULONG ulMargin_RO_b;
  4802. ULONG ulMargin_RO_c;
  4803. ULONG ulMargin_fixed;
  4804. ULONG ulMargin_Fmax_mean;
  4805. ULONG ulMargin_plat_mean;
  4806. ULONG ulMargin_Fmax_sigma;
  4807. ULONG ulMargin_plat_sigma;
  4808. ULONG ulMargin_DC_sigma;
  4809. ULONG ulReserved[8]; // Reserved for future ASIC
  4810. }ATOM_ASIC_PROFILING_INFO_V3_4;
  4811. // for Polaris10/Polaris11 speed EVV algorithm
  4812. typedef struct _ATOM_ASIC_PROFILING_INFO_V3_5
  4813. {
  4814. ATOM_COMMON_TABLE_HEADER asHeader;
  4815. ULONG ulMaxVddc; //Maximum voltage for all parts, in unit of 0.01mv
  4816. ULONG ulMinVddc; //Minimum voltage for all parts, in unit of 0.01mv
  4817. USHORT usLkgEuseIndex; //Efuse Lkg_FT address ( BYTE address )
  4818. UCHAR ucLkgEfuseBitLSB; //Efuse Lkg_FT bit shift in 32bit DWORD
  4819. UCHAR ucLkgEfuseLength; //Efuse Lkg_FT length
  4820. ULONG ulLkgEncodeLn_MaxDivMin; //value of ln(Max_Lkg_Ft/Min_Lkg_Ft ) in unit of 0.00001 ( unit=100000 )
  4821. ULONG ulLkgEncodeMax; //Maximum Lkg_Ft measured value ( or efuse decode value ), in unit of 0.00001 ( unit=100000 )
  4822. ULONG ulLkgEncodeMin; //Minimum Lkg_Ft measured value ( or efuse decode value ), in unit of 0.00001 ( unit=100000 )
  4823. EFUSE_LINEAR_FUNC_PARAM sRoFuse;//Efuse RO info: DWORD address, bit shift, length, max/min measure value. in unit of 1.
  4824. ULONG ulEvvDefaultVddc; //def="EVV_DEFAULT_VDDC" descr="return default VDDC(v) when Efuse not cut" unit="100000"/>
  4825. ULONG ulEvvNoCalcVddc; //def="EVV_NOCALC_VDDC" descr="return VDDC(v) when Calculation is bad" unit="100000"/>
  4826. ULONG ulSpeed_Model; //def="EVV_SPEED_MODEL" descr="0 = Greek model, 1 = multivariate model" unit="1"/>
  4827. ULONG ulSM_A0; //def="EVV_SM_A0" descr="Leakage coeff(Multivariant Mode)." unit="100000"/>
  4828. ULONG ulSM_A1; //def="EVV_SM_A1" descr="Leakage/SCLK coeff(Multivariant Mode)." unit="1000000"/>
  4829. ULONG ulSM_A2; //def="EVV_SM_A2" descr="Alpha( Greek Mode ) or VDDC/SCLK coeff(Multivariant Mode)." unit="100000"/>
  4830. ULONG ulSM_A3; //def="EVV_SM_A3" descr="Beta( Greek Mode ) or SCLK coeff(Multivariant Mode)." unit="100000"/>
  4831. ULONG ulSM_A4; //def="EVV_SM_A4" descr="VDDC^2/SCLK coeff(Multivariant Mode)." unit="100000"/>
  4832. ULONG ulSM_A5; //def="EVV_SM_A5" descr="VDDC^2 coeff(Multivariant Mode)." unit="100000"/>
  4833. ULONG ulSM_A6; //def="EVV_SM_A6" descr="Gamma( Greek Mode ) or VDDC coeff(Multivariant Mode)." unit="100000"/>
  4834. ULONG ulSM_A7; //def="EVV_SM_A7" descr="Epsilon( Greek Mode ) or constant(Multivariant Mode)." unit="100000"/>
  4835. UCHAR ucSM_A0_sign; //def="EVV_SM_A0_SIGN" descr="=0 SM_A0 is postive. =1: SM_A0 is negative" unit="1"/>
  4836. UCHAR ucSM_A1_sign; //def="EVV_SM_A1_SIGN" descr="=0 SM_A1 is postive. =1: SM_A1 is negative" unit="1"/>
  4837. UCHAR ucSM_A2_sign; //def="EVV_SM_A2_SIGN" descr="=0 SM_A2 is postive. =1: SM_A2 is negative" unit="1"/>
  4838. UCHAR ucSM_A3_sign; //def="EVV_SM_A3_SIGN" descr="=0 SM_A3 is postive. =1: SM_A3 is negative" unit="1"/>
  4839. UCHAR ucSM_A4_sign; //def="EVV_SM_A4_SIGN" descr="=0 SM_A4 is postive. =1: SM_A4 is negative" unit="1"/>
  4840. UCHAR ucSM_A5_sign; //def="EVV_SM_A5_SIGN" descr="=0 SM_A5 is postive. =1: SM_A5 is negative" unit="1"/>
  4841. UCHAR ucSM_A6_sign; //def="EVV_SM_A6_SIGN" descr="=0 SM_A6 is postive. =1: SM_A6 is negative" unit="1"/>
  4842. UCHAR ucSM_A7_sign; //def="EVV_SM_A7_SIGN" descr="=0 SM_A7 is postive. =1: SM_A7 is negative" unit="1"/>
  4843. ULONG ulMargin_RO_a; //def="EVV_MARGIN_RO_A" descr="A Term to represent RO equation in Ax2+Bx+C, unit=1"
  4844. ULONG ulMargin_RO_b; //def="EVV_MARGIN_RO_B" descr="B Term to represent RO equation in Ax2+Bx+C, unit=1"
  4845. ULONG ulMargin_RO_c; //def="EVV_MARGIN_RO_C" descr="C Term to represent RO equation in Ax2+Bx+C, unit=1"
  4846. ULONG ulMargin_fixed; //def="EVV_MARGIN_FIXED" descr="Fixed MHz to add to SCLK margin, unit=1" unit="1"/>
  4847. ULONG ulMargin_Fmax_mean; //def="EVV_MARGIN_FMAX_MEAN" descr="Percentage to add for Fmas mean margin unit=10000" unit="10000"/>
  4848. ULONG ulMargin_plat_mean; //def="EVV_MARGIN_PLAT_MEAN" descr="Percentage to add for platform mean margin unit=10000" unit="10000"/>
  4849. ULONG ulMargin_Fmax_sigma; //def="EVV_MARGIN_FMAX_SIGMA" descr="Percentage to add for Fmax sigma margin unit=10000" unit="10000"/>
  4850. ULONG ulMargin_plat_sigma; //def="EVV_MARGIN_PLAT_SIGMA" descr="Percentage to add for platform sigma margin unit=10000" unit="10000"/>
  4851. ULONG ulMargin_DC_sigma; //def="EVV_MARGIN_DC_SIGMA" descr="Regulator DC tolerance margin (mV) unit=100" unit="100"/>
  4852. ULONG ulReserved[12];
  4853. }ATOM_ASIC_PROFILING_INFO_V3_5;
  4854. /* for Polars10/11 AVFS parameters */
  4855. typedef struct _ATOM_ASIC_PROFILING_INFO_V3_6
  4856. {
  4857. ATOM_COMMON_TABLE_HEADER asHeader;
  4858. ULONG ulMaxVddc;
  4859. ULONG ulMinVddc;
  4860. USHORT usLkgEuseIndex;
  4861. UCHAR ucLkgEfuseBitLSB;
  4862. UCHAR ucLkgEfuseLength;
  4863. ULONG ulLkgEncodeLn_MaxDivMin;
  4864. ULONG ulLkgEncodeMax;
  4865. ULONG ulLkgEncodeMin;
  4866. EFUSE_LINEAR_FUNC_PARAM sRoFuse;
  4867. ULONG ulEvvDefaultVddc;
  4868. ULONG ulEvvNoCalcVddc;
  4869. ULONG ulSpeed_Model;
  4870. ULONG ulSM_A0;
  4871. ULONG ulSM_A1;
  4872. ULONG ulSM_A2;
  4873. ULONG ulSM_A3;
  4874. ULONG ulSM_A4;
  4875. ULONG ulSM_A5;
  4876. ULONG ulSM_A6;
  4877. ULONG ulSM_A7;
  4878. UCHAR ucSM_A0_sign;
  4879. UCHAR ucSM_A1_sign;
  4880. UCHAR ucSM_A2_sign;
  4881. UCHAR ucSM_A3_sign;
  4882. UCHAR ucSM_A4_sign;
  4883. UCHAR ucSM_A5_sign;
  4884. UCHAR ucSM_A6_sign;
  4885. UCHAR ucSM_A7_sign;
  4886. ULONG ulMargin_RO_a;
  4887. ULONG ulMargin_RO_b;
  4888. ULONG ulMargin_RO_c;
  4889. ULONG ulMargin_fixed;
  4890. ULONG ulMargin_Fmax_mean;
  4891. ULONG ulMargin_plat_mean;
  4892. ULONG ulMargin_Fmax_sigma;
  4893. ULONG ulMargin_plat_sigma;
  4894. ULONG ulMargin_DC_sigma;
  4895. ULONG ulLoadLineSlop;
  4896. ULONG ulaTDClimitPerDPM[8];
  4897. ULONG ulaNoCalcVddcPerDPM[8];
  4898. ULONG ulAVFS_meanNsigma_Acontant0;
  4899. ULONG ulAVFS_meanNsigma_Acontant1;
  4900. ULONG ulAVFS_meanNsigma_Acontant2;
  4901. USHORT usAVFS_meanNsigma_DC_tol_sigma;
  4902. USHORT usAVFS_meanNsigma_Platform_mean;
  4903. USHORT usAVFS_meanNsigma_Platform_sigma;
  4904. ULONG ulGB_VDROOP_TABLE_CKSOFF_a0;
  4905. ULONG ulGB_VDROOP_TABLE_CKSOFF_a1;
  4906. ULONG ulGB_VDROOP_TABLE_CKSOFF_a2;
  4907. ULONG ulGB_VDROOP_TABLE_CKSON_a0;
  4908. ULONG ulGB_VDROOP_TABLE_CKSON_a1;
  4909. ULONG ulGB_VDROOP_TABLE_CKSON_a2;
  4910. ULONG ulAVFSGB_FUSE_TABLE_CKSOFF_m1;
  4911. USHORT usAVFSGB_FUSE_TABLE_CKSOFF_m2;
  4912. ULONG ulAVFSGB_FUSE_TABLE_CKSOFF_b;
  4913. ULONG ulAVFSGB_FUSE_TABLE_CKSON_m1;
  4914. USHORT usAVFSGB_FUSE_TABLE_CKSON_m2;
  4915. ULONG ulAVFSGB_FUSE_TABLE_CKSON_b;
  4916. USHORT usMaxVoltage_0_25mv;
  4917. UCHAR ucEnableGB_VDROOP_TABLE_CKSOFF;
  4918. UCHAR ucEnableGB_VDROOP_TABLE_CKSON;
  4919. UCHAR ucEnableGB_FUSE_TABLE_CKSOFF;
  4920. UCHAR ucEnableGB_FUSE_TABLE_CKSON;
  4921. USHORT usPSM_Age_ComFactor;
  4922. UCHAR ucEnableApplyAVFS_CKS_OFF_Voltage;
  4923. UCHAR ucReserved;
  4924. }ATOM_ASIC_PROFILING_INFO_V3_6;
  4925. typedef struct _ATOM_SCLK_FCW_RANGE_ENTRY_V1{
  4926. ULONG ulMaxSclkFreq;
  4927. UCHAR ucVco_setting; // 1: 3-6GHz, 3: 2-4GHz
  4928. UCHAR ucPostdiv; // divide by 2^n
  4929. USHORT ucFcw_pcc;
  4930. USHORT ucFcw_trans_upper;
  4931. USHORT ucRcw_trans_lower;
  4932. }ATOM_SCLK_FCW_RANGE_ENTRY_V1;
  4933. // SMU_InfoTable for Polaris10/Polaris11
  4934. typedef struct _ATOM_SMU_INFO_V2_1
  4935. {
  4936. ATOM_COMMON_TABLE_HEADER asHeader;
  4937. UCHAR ucSclkEntryNum; // for potential future extend, indicate the number of ATOM_SCLK_FCW_RANGE_ENTRY_V1
  4938. UCHAR ucReserved[3];
  4939. ATOM_SCLK_FCW_RANGE_ENTRY_V1 asSclkFcwRangeEntry[8];
  4940. }ATOM_SMU_INFO_V2_1;
  4941. // GFX_InfoTable for Polaris10/Polaris11
  4942. typedef struct _ATOM_GFX_INFO_V2_1
  4943. {
  4944. ATOM_COMMON_TABLE_HEADER asHeader;
  4945. UCHAR GfxIpMinVer;
  4946. UCHAR GfxIpMajVer;
  4947. UCHAR max_shader_engines;
  4948. UCHAR max_tile_pipes;
  4949. UCHAR max_cu_per_sh;
  4950. UCHAR max_sh_per_se;
  4951. UCHAR max_backends_per_se;
  4952. UCHAR max_texture_channel_caches;
  4953. }ATOM_GFX_INFO_V2_1;
  4954. typedef struct _ATOM_POWER_SOURCE_OBJECT
  4955. {
  4956. UCHAR ucPwrSrcId; // Power source
  4957. UCHAR ucPwrSensorType; // GPIO, I2C or none
  4958. UCHAR ucPwrSensId; // if GPIO detect, it is GPIO id, if I2C detect, it is I2C id
  4959. UCHAR ucPwrSensSlaveAddr; // Slave address if I2C detect
  4960. UCHAR ucPwrSensRegIndex; // I2C register Index if I2C detect
  4961. UCHAR ucPwrSensRegBitMask; // detect which bit is used if I2C detect
  4962. UCHAR ucPwrSensActiveState; // high active or low active
  4963. UCHAR ucReserve[3]; // reserve
  4964. USHORT usSensPwr; // in unit of watt
  4965. }ATOM_POWER_SOURCE_OBJECT;
  4966. typedef struct _ATOM_POWER_SOURCE_INFO
  4967. {
  4968. ATOM_COMMON_TABLE_HEADER asHeader;
  4969. UCHAR asPwrbehave[16];
  4970. ATOM_POWER_SOURCE_OBJECT asPwrObj[1];
  4971. }ATOM_POWER_SOURCE_INFO;
  4972. //Define ucPwrSrcId
  4973. #define POWERSOURCE_PCIE_ID1 0x00
  4974. #define POWERSOURCE_6PIN_CONNECTOR_ID1 0x01
  4975. #define POWERSOURCE_8PIN_CONNECTOR_ID1 0x02
  4976. #define POWERSOURCE_6PIN_CONNECTOR_ID2 0x04
  4977. #define POWERSOURCE_8PIN_CONNECTOR_ID2 0x08
  4978. //define ucPwrSensorId
  4979. #define POWER_SENSOR_ALWAYS 0x00
  4980. #define POWER_SENSOR_GPIO 0x01
  4981. #define POWER_SENSOR_I2C 0x02
  4982. typedef struct _ATOM_CLK_VOLT_CAPABILITY
  4983. {
  4984. ULONG ulVoltageIndex; // The Voltage Index indicated by FUSE, same voltage index shared with SCLK DPM fuse table
  4985. ULONG ulMaximumSupportedCLK; // Maximum clock supported with specified voltage index, unit in 10kHz
  4986. }ATOM_CLK_VOLT_CAPABILITY;
  4987. typedef struct _ATOM_CLK_VOLT_CAPABILITY_V2
  4988. {
  4989. USHORT usVoltageLevel; // The real Voltage Level round up value in unit of mv,
  4990. ULONG ulMaximumSupportedCLK; // Maximum clock supported with specified voltage index, unit in 10kHz
  4991. }ATOM_CLK_VOLT_CAPABILITY_V2;
  4992. typedef struct _ATOM_AVAILABLE_SCLK_LIST
  4993. {
  4994. ULONG ulSupportedSCLK; // Maximum clock supported with specified voltage index, unit in 10kHz
  4995. USHORT usVoltageIndex; // The Voltage Index indicated by FUSE for specified SCLK
  4996. USHORT usVoltageID; // The Voltage ID indicated by FUSE for specified SCLK
  4997. }ATOM_AVAILABLE_SCLK_LIST;
  4998. // ATOM_INTEGRATED_SYSTEM_INFO_V6 ulSystemConfig cap definition
  4999. #define ATOM_IGP_INFO_V6_SYSTEM_CONFIG__PCIE_POWER_GATING_ENABLE 1 // refer to ulSystemConfig bit[0]
  5000. // this IntegrateSystemInfoTable is used for Liano/Ontario APU
  5001. typedef struct _ATOM_INTEGRATED_SYSTEM_INFO_V6
  5002. {
  5003. ATOM_COMMON_TABLE_HEADER sHeader;
  5004. ULONG ulBootUpEngineClock;
  5005. ULONG ulDentistVCOFreq;
  5006. ULONG ulBootUpUMAClock;
  5007. ATOM_CLK_VOLT_CAPABILITY sDISPCLK_Voltage[4];
  5008. ULONG ulBootUpReqDisplayVector;
  5009. ULONG ulOtherDisplayMisc;
  5010. ULONG ulGPUCapInfo;
  5011. ULONG ulSB_MMIO_Base_Addr;
  5012. USHORT usRequestedPWMFreqInHz;
  5013. UCHAR ucHtcTmpLmt;
  5014. UCHAR ucHtcHystLmt;
  5015. ULONG ulMinEngineClock;
  5016. ULONG ulSystemConfig;
  5017. ULONG ulCPUCapInfo;
  5018. USHORT usNBP0Voltage;
  5019. USHORT usNBP1Voltage;
  5020. USHORT usBootUpNBVoltage;
  5021. USHORT usExtDispConnInfoOffset;
  5022. USHORT usPanelRefreshRateRange;
  5023. UCHAR ucMemoryType;
  5024. UCHAR ucUMAChannelNumber;
  5025. ULONG ulCSR_M3_ARB_CNTL_DEFAULT[10];
  5026. ULONG ulCSR_M3_ARB_CNTL_UVD[10];
  5027. ULONG ulCSR_M3_ARB_CNTL_FS3D[10];
  5028. ATOM_AVAILABLE_SCLK_LIST sAvail_SCLK[5];
  5029. ULONG ulGMCRestoreResetTime;
  5030. ULONG ulMinimumNClk;
  5031. ULONG ulIdleNClk;
  5032. ULONG ulDDR_DLL_PowerUpTime;
  5033. ULONG ulDDR_PLL_PowerUpTime;
  5034. USHORT usPCIEClkSSPercentage;
  5035. USHORT usPCIEClkSSType;
  5036. USHORT usLvdsSSPercentage;
  5037. USHORT usLvdsSSpreadRateIn10Hz;
  5038. USHORT usHDMISSPercentage;
  5039. USHORT usHDMISSpreadRateIn10Hz;
  5040. USHORT usDVISSPercentage;
  5041. USHORT usDVISSpreadRateIn10Hz;
  5042. ULONG SclkDpmBoostMargin;
  5043. ULONG SclkDpmThrottleMargin;
  5044. USHORT SclkDpmTdpLimitPG;
  5045. USHORT SclkDpmTdpLimitBoost;
  5046. ULONG ulBoostEngineCLock;
  5047. UCHAR ulBoostVid_2bit;
  5048. UCHAR EnableBoost;
  5049. USHORT GnbTdpLimit;
  5050. USHORT usMaxLVDSPclkFreqInSingleLink;
  5051. UCHAR ucLvdsMisc;
  5052. UCHAR ucLVDSReserved;
  5053. ULONG ulReserved3[15];
  5054. ATOM_EXTERNAL_DISPLAY_CONNECTION_INFO sExtDispConnInfo;
  5055. }ATOM_INTEGRATED_SYSTEM_INFO_V6;
  5056. // ulGPUCapInfo
  5057. #define INTEGRATED_SYSTEM_INFO_V6_GPUCAPINFO__TMDSHDMI_COHERENT_SINGLEPLL_MODE 0x01
  5058. #define INTEGRATED_SYSTEM_INFO_V6_GPUCAPINFO__DISABLE_AUX_HW_MODE_DETECTION 0x08
  5059. //ucLVDSMisc:
  5060. #define SYS_INFO_LVDSMISC__888_FPDI_MODE 0x01
  5061. #define SYS_INFO_LVDSMISC__DL_CH_SWAP 0x02
  5062. #define SYS_INFO_LVDSMISC__888_BPC 0x04
  5063. #define SYS_INFO_LVDSMISC__OVERRIDE_EN 0x08
  5064. #define SYS_INFO_LVDSMISC__BLON_ACTIVE_LOW 0x10
  5065. // new since Trinity
  5066. #define SYS_INFO_LVDSMISC__TRAVIS_LVDS_VOL_OVERRIDE_EN 0x20
  5067. // not used any more
  5068. #define SYS_INFO_LVDSMISC__VSYNC_ACTIVE_LOW 0x04
  5069. #define SYS_INFO_LVDSMISC__HSYNC_ACTIVE_LOW 0x08
  5070. /**********************************************************************************************************************
  5071. ATOM_INTEGRATED_SYSTEM_INFO_V6 Description
  5072. ulBootUpEngineClock: VBIOS bootup Engine clock frequency, in 10kHz unit. if it is equal 0, then VBIOS use pre-defined bootup engine clock
  5073. ulDentistVCOFreq: Dentist VCO clock in 10kHz unit.
  5074. ulBootUpUMAClock: System memory boot up clock frequency in 10Khz unit.
  5075. sDISPCLK_Voltage: Report Display clock voltage requirement.
  5076. ulBootUpReqDisplayVector: VBIOS boot up display IDs, following are supported devices in Liano/Ontaio projects:
  5077. ATOM_DEVICE_CRT1_SUPPORT 0x0001
  5078. ATOM_DEVICE_CRT2_SUPPORT 0x0010
  5079. ATOM_DEVICE_DFP1_SUPPORT 0x0008
  5080. ATOM_DEVICE_DFP6_SUPPORT 0x0040
  5081. ATOM_DEVICE_DFP2_SUPPORT 0x0080
  5082. ATOM_DEVICE_DFP3_SUPPORT 0x0200
  5083. ATOM_DEVICE_DFP4_SUPPORT 0x0400
  5084. ATOM_DEVICE_DFP5_SUPPORT 0x0800
  5085. ATOM_DEVICE_LCD1_SUPPORT 0x0002
  5086. ulOtherDisplayMisc: Other display related flags, not defined yet.
  5087. ulGPUCapInfo: bit[0]=0: TMDS/HDMI Coherent Mode use cascade PLL mode.
  5088. =1: TMDS/HDMI Coherent Mode use signel PLL mode.
  5089. bit[3]=0: Enable HW AUX mode detection logic
  5090. =1: Disable HW AUX mode dettion logic
  5091. ulSB_MMIO_Base_Addr: Physical Base address to SB MMIO space. Driver needs to initialize it for SMU usage.
  5092. usRequestedPWMFreqInHz: When it's set to 0x0 by SBIOS: the LCD BackLight is not controlled by GPU(SW).
  5093. 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;
  5094. When it's set to a non-zero frequency, the BackLight is controlled by GPU (SW) in one of two ways below:
  5095. 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;
  5096. VBIOS will set up proper PWM frequency and ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU==1,as the result,
  5097. Changing BL using VBIOS function is functional in both driver and non-driver present environment;
  5098. and enabling VariBri under the driver environment from PP table is optional.
  5099. 2. SW uses other means to control BL (like DPCD),this non-zero frequency serves as a flag only indicating
  5100. that BL control from GPU is expected.
  5101. VBIOS will NOT set up PWM frequency but make ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU==1
  5102. Changing BL using VBIOS function could be functional in both driver and non-driver present environment,but
  5103. it's per platform
  5104. and enabling VariBri under the driver environment from PP table is optional.
  5105. ucHtcTmpLmt: Refer to D18F3x64 bit[22:16], HtcTmpLmt.
  5106. Threshold on value to enter HTC_active state.
  5107. ucHtcHystLmt: Refer to D18F3x64 bit[27:24], HtcHystLmt.
  5108. To calculate threshold off value to exit HTC_active state, which is Threshold on vlaue minus ucHtcHystLmt.
  5109. ulMinEngineClock: Minimum SCLK allowed in 10kHz unit. This is calculated based on WRCK Fuse settings.
  5110. ulSystemConfig: Bit[0]=0: PCIE Power Gating Disabled
  5111. =1: PCIE Power Gating Enabled
  5112. Bit[1]=0: DDR-DLL shut-down feature disabled.
  5113. 1: DDR-DLL shut-down feature enabled.
  5114. Bit[2]=0: DDR-PLL Power down feature disabled.
  5115. 1: DDR-PLL Power down feature enabled.
  5116. ulCPUCapInfo: TBD
  5117. usNBP0Voltage: VID for voltage on NB P0 State
  5118. usNBP1Voltage: VID for voltage on NB P1 State
  5119. usBootUpNBVoltage: Voltage Index of GNB voltage configured by SBIOS, which is suffcient to support VBIOS DISPCLK requirement.
  5120. usExtDispConnInfoOffset: Offset to sExtDispConnInfo inside the structure
  5121. usPanelRefreshRateRange: Bit vector for LCD supported refresh rate range. If DRR is requestd by the platform, at least two bits need to be set
  5122. to indicate a range.
  5123. SUPPORTED_LCD_REFRESHRATE_30Hz 0x0004
  5124. SUPPORTED_LCD_REFRESHRATE_40Hz 0x0008
  5125. SUPPORTED_LCD_REFRESHRATE_50Hz 0x0010
  5126. SUPPORTED_LCD_REFRESHRATE_60Hz 0x0020
  5127. ucMemoryType: [3:0]=1:DDR1;=2:DDR2;=3:DDR3.[7:4] is reserved.
  5128. ucUMAChannelNumber: System memory channel numbers.
  5129. ulCSR_M3_ARB_CNTL_DEFAULT[10]: Arrays with values for CSR M3 arbiter for default
  5130. ulCSR_M3_ARB_CNTL_UVD[10]: Arrays with values for CSR M3 arbiter for UVD playback.
  5131. ulCSR_M3_ARB_CNTL_FS3D[10]: Arrays with values for CSR M3 arbiter for Full Screen 3D applications.
  5132. sAvail_SCLK[5]: Arrays to provide availabe list of SLCK and corresponding voltage, order from low to high
  5133. ulGMCRestoreResetTime: GMC power restore and GMC reset time to calculate data reconnection latency. Unit in ns.
  5134. ulMinimumNClk: Minimum NCLK speed among all NB-Pstates to calcualte data reconnection latency. Unit in 10kHz.
  5135. ulIdleNClk: NCLK speed while memory runs in self-refresh state. Unit in 10kHz.
  5136. ulDDR_DLL_PowerUpTime: DDR PHY DLL power up time. Unit in ns.
  5137. ulDDR_PLL_PowerUpTime: DDR PHY PLL power up time. Unit in ns.
  5138. usPCIEClkSSPercentage: PCIE Clock Spred Spectrum Percentage in unit 0.01%; 100 mean 1%.
  5139. usPCIEClkSSType: PCIE Clock Spred Spectrum Type. 0 for Down spread(default); 1 for Center spread.
  5140. usLvdsSSPercentage: LVDS panel ( not include eDP ) Spread Spectrum Percentage in unit of 0.01%, =0, use VBIOS default setting.
  5141. usLvdsSSpreadRateIn10Hz: LVDS panel ( not include eDP ) Spread Spectrum frequency in unit of 10Hz, =0, use VBIOS default setting.
  5142. usHDMISSPercentage: HDMI Spread Spectrum Percentage in unit 0.01%; 100 mean 1%, =0, use VBIOS default setting.
  5143. usHDMISSpreadRateIn10Hz: HDMI Spread Spectrum frequency in unit of 10Hz, =0, use VBIOS default setting.
  5144. usDVISSPercentage: DVI Spread Spectrum Percentage in unit 0.01%; 100 mean 1%, =0, use VBIOS default setting.
  5145. usDVISSpreadRateIn10Hz: DVI Spread Spectrum frequency in unit of 10Hz, =0, use VBIOS default setting.
  5146. usMaxLVDSPclkFreqInSingleLink: Max pixel clock LVDS panel single link, if=0 means VBIOS use default threhold, right now it is 85Mhz
  5147. ucLVDSMisc: [bit0] LVDS 888bit panel mode =0: LVDS 888 panel in LDI mode, =1: LVDS 888 panel in FPDI mode
  5148. [bit1] LVDS panel lower and upper link mapping =0: lower link and upper link not swap, =1: lower link and upper link are swapped
  5149. [bit2] LVDS 888bit per color mode =0: 666 bit per color =1:888 bit per color
  5150. [bit3] LVDS parameter override enable =0: ucLvdsMisc parameter are not used =1: ucLvdsMisc parameter should be used
  5151. [bit4] Polarity of signal sent to digital BLON output pin. =0: not inverted(active high) =1: inverted ( active low )
  5152. **********************************************************************************************************************/
  5153. // this Table is used for Liano/Ontario APU
  5154. typedef struct _ATOM_FUSION_SYSTEM_INFO_V1
  5155. {
  5156. ATOM_INTEGRATED_SYSTEM_INFO_V6 sIntegratedSysInfo;
  5157. ULONG ulPowerplayTable[128];
  5158. }ATOM_FUSION_SYSTEM_INFO_V1;
  5159. typedef struct _ATOM_TDP_CONFIG_BITS
  5160. {
  5161. #if ATOM_BIG_ENDIAN
  5162. ULONG uReserved:2;
  5163. ULONG uTDP_Value:14; // Original TDP value in tens of milli watts
  5164. ULONG uCTDP_Value:14; // Override value in tens of milli watts
  5165. ULONG uCTDP_Enable:2; // = (uCTDP_Value > uTDP_Value? 2: (uCTDP_Value < uTDP_Value))
  5166. #else
  5167. ULONG uCTDP_Enable:2; // = (uCTDP_Value > uTDP_Value? 2: (uCTDP_Value < uTDP_Value))
  5168. ULONG uCTDP_Value:14; // Override value in tens of milli watts
  5169. ULONG uTDP_Value:14; // Original TDP value in tens of milli watts
  5170. ULONG uReserved:2;
  5171. #endif
  5172. }ATOM_TDP_CONFIG_BITS;
  5173. typedef union _ATOM_TDP_CONFIG
  5174. {
  5175. ATOM_TDP_CONFIG_BITS TDP_config;
  5176. ULONG TDP_config_all;
  5177. }ATOM_TDP_CONFIG;
  5178. /**********************************************************************************************************************
  5179. ATOM_FUSION_SYSTEM_INFO_V1 Description
  5180. sIntegratedSysInfo: refer to ATOM_INTEGRATED_SYSTEM_INFO_V6 definition.
  5181. ulPowerplayTable[128]: This 512 bytes memory is used to save ATOM_PPLIB_POWERPLAYTABLE3, starting form ulPowerplayTable[0]
  5182. **********************************************************************************************************************/
  5183. // this IntegrateSystemInfoTable is used for Trinity APU
  5184. typedef struct _ATOM_INTEGRATED_SYSTEM_INFO_V1_7
  5185. {
  5186. ATOM_COMMON_TABLE_HEADER sHeader;
  5187. ULONG ulBootUpEngineClock;
  5188. ULONG ulDentistVCOFreq;
  5189. ULONG ulBootUpUMAClock;
  5190. ATOM_CLK_VOLT_CAPABILITY sDISPCLK_Voltage[4];
  5191. ULONG ulBootUpReqDisplayVector;
  5192. ULONG ulOtherDisplayMisc;
  5193. ULONG ulGPUCapInfo;
  5194. ULONG ulSB_MMIO_Base_Addr;
  5195. USHORT usRequestedPWMFreqInHz;
  5196. UCHAR ucHtcTmpLmt;
  5197. UCHAR ucHtcHystLmt;
  5198. ULONG ulMinEngineClock;
  5199. ULONG ulSystemConfig;
  5200. ULONG ulCPUCapInfo;
  5201. USHORT usNBP0Voltage;
  5202. USHORT usNBP1Voltage;
  5203. USHORT usBootUpNBVoltage;
  5204. USHORT usExtDispConnInfoOffset;
  5205. USHORT usPanelRefreshRateRange;
  5206. UCHAR ucMemoryType;
  5207. UCHAR ucUMAChannelNumber;
  5208. UCHAR strVBIOSMsg[40];
  5209. ATOM_TDP_CONFIG asTdpConfig;
  5210. ULONG ulReserved[19];
  5211. ATOM_AVAILABLE_SCLK_LIST sAvail_SCLK[5];
  5212. ULONG ulGMCRestoreResetTime;
  5213. ULONG ulMinimumNClk;
  5214. ULONG ulIdleNClk;
  5215. ULONG ulDDR_DLL_PowerUpTime;
  5216. ULONG ulDDR_PLL_PowerUpTime;
  5217. USHORT usPCIEClkSSPercentage;
  5218. USHORT usPCIEClkSSType;
  5219. USHORT usLvdsSSPercentage;
  5220. USHORT usLvdsSSpreadRateIn10Hz;
  5221. USHORT usHDMISSPercentage;
  5222. USHORT usHDMISSpreadRateIn10Hz;
  5223. USHORT usDVISSPercentage;
  5224. USHORT usDVISSpreadRateIn10Hz;
  5225. ULONG SclkDpmBoostMargin;
  5226. ULONG SclkDpmThrottleMargin;
  5227. USHORT SclkDpmTdpLimitPG;
  5228. USHORT SclkDpmTdpLimitBoost;
  5229. ULONG ulBoostEngineCLock;
  5230. UCHAR ulBoostVid_2bit;
  5231. UCHAR EnableBoost;
  5232. USHORT GnbTdpLimit;
  5233. USHORT usMaxLVDSPclkFreqInSingleLink;
  5234. UCHAR ucLvdsMisc;
  5235. UCHAR ucTravisLVDSVolAdjust;
  5236. UCHAR ucLVDSPwrOnSeqDIGONtoDE_in4Ms;
  5237. UCHAR ucLVDSPwrOnSeqDEtoVARY_BL_in4Ms;
  5238. UCHAR ucLVDSPwrOffSeqVARY_BLtoDE_in4Ms;
  5239. UCHAR ucLVDSPwrOffSeqDEtoDIGON_in4Ms;
  5240. UCHAR ucLVDSOffToOnDelay_in4Ms;
  5241. UCHAR ucLVDSPwrOnSeqVARY_BLtoBLON_in4Ms;
  5242. UCHAR ucLVDSPwrOffSeqBLONtoVARY_BL_in4Ms;
  5243. UCHAR ucMinAllowedBL_Level;
  5244. ULONG ulLCDBitDepthControlVal;
  5245. ULONG ulNbpStateMemclkFreq[4];
  5246. USHORT usNBP2Voltage;
  5247. USHORT usNBP3Voltage;
  5248. ULONG ulNbpStateNClkFreq[4];
  5249. UCHAR ucNBDPMEnable;
  5250. UCHAR ucReserved[3];
  5251. UCHAR ucDPMState0VclkFid;
  5252. UCHAR ucDPMState0DclkFid;
  5253. UCHAR ucDPMState1VclkFid;
  5254. UCHAR ucDPMState1DclkFid;
  5255. UCHAR ucDPMState2VclkFid;
  5256. UCHAR ucDPMState2DclkFid;
  5257. UCHAR ucDPMState3VclkFid;
  5258. UCHAR ucDPMState3DclkFid;
  5259. ATOM_EXTERNAL_DISPLAY_CONNECTION_INFO sExtDispConnInfo;
  5260. }ATOM_INTEGRATED_SYSTEM_INFO_V1_7;
  5261. // ulOtherDisplayMisc
  5262. #define INTEGRATED_SYSTEM_INFO__GET_EDID_CALLBACK_FUNC_SUPPORT 0x01
  5263. #define INTEGRATED_SYSTEM_INFO__GET_BOOTUP_DISPLAY_CALLBACK_FUNC_SUPPORT 0x02
  5264. #define INTEGRATED_SYSTEM_INFO__GET_EXPANSION_CALLBACK_FUNC_SUPPORT 0x04
  5265. #define INTEGRATED_SYSTEM_INFO__FAST_BOOT_SUPPORT 0x08
  5266. // ulGPUCapInfo
  5267. #define SYS_INFO_GPUCAPS__TMDSHDMI_COHERENT_SINGLEPLL_MODE 0x01
  5268. #define SYS_INFO_GPUCAPS__DP_SINGLEPLL_MODE 0x02
  5269. #define SYS_INFO_GPUCAPS__DISABLE_AUX_MODE_DETECT 0x08
  5270. #define SYS_INFO_GPUCAPS__ENABEL_DFS_BYPASS 0x10
  5271. //ulGPUCapInfo[16]=1 indicate SMC firmware is able to support GNB fast resume function, so that driver can call SMC to program most of GNB register during resuming, from ML
  5272. #define SYS_INFO_GPUCAPS__GNB_FAST_RESUME_CAPABLE 0x00010000
  5273. //ulGPUCapInfo[17]=1 indicate battery boost feature is enable, from ML
  5274. #define SYS_INFO_GPUCAPS__BATTERY_BOOST_ENABLE 0x00020000
  5275. /**********************************************************************************************************************
  5276. ATOM_INTEGRATED_SYSTEM_INFO_V1_7 Description
  5277. ulBootUpEngineClock: VBIOS bootup Engine clock frequency, in 10kHz unit. if it is equal 0, then VBIOS use pre-defined bootup engine clock
  5278. ulDentistVCOFreq: Dentist VCO clock in 10kHz unit.
  5279. ulBootUpUMAClock: System memory boot up clock frequency in 10Khz unit.
  5280. sDISPCLK_Voltage: Report Display clock voltage requirement.
  5281. ulBootUpReqDisplayVector: VBIOS boot up display IDs, following are supported devices in Trinity projects:
  5282. ATOM_DEVICE_CRT1_SUPPORT 0x0001
  5283. ATOM_DEVICE_DFP1_SUPPORT 0x0008
  5284. ATOM_DEVICE_DFP6_SUPPORT 0x0040
  5285. ATOM_DEVICE_DFP2_SUPPORT 0x0080
  5286. ATOM_DEVICE_DFP3_SUPPORT 0x0200
  5287. ATOM_DEVICE_DFP4_SUPPORT 0x0400
  5288. ATOM_DEVICE_DFP5_SUPPORT 0x0800
  5289. ATOM_DEVICE_LCD1_SUPPORT 0x0002
  5290. ulOtherDisplayMisc: bit[0]=0: INT15 callback function Get LCD EDID ( ax=4e08, bl=1b ) is not supported by SBIOS.
  5291. =1: INT15 callback function Get LCD EDID ( ax=4e08, bl=1b ) is supported by SBIOS.
  5292. bit[1]=0: INT15 callback function Get boot display( ax=4e08, bl=01h) is not supported by SBIOS
  5293. =1: INT15 callback function Get boot display( ax=4e08, bl=01h) is supported by SBIOS
  5294. bit[2]=0: INT15 callback function Get panel Expansion ( ax=4e08, bl=02h) is not supported by SBIOS
  5295. =1: INT15 callback function Get panel Expansion ( ax=4e08, bl=02h) is supported by SBIOS
  5296. bit[3]=0: VBIOS fast boot is disable
  5297. =1: VBIOS fast boot is enable. ( VBIOS skip display device detection in every set mode if LCD panel is connect and LID is open)
  5298. ulGPUCapInfo: bit[0]=0: TMDS/HDMI Coherent Mode use cascade PLL mode.
  5299. =1: TMDS/HDMI Coherent Mode use signel PLL mode.
  5300. bit[1]=0: DP mode use cascade PLL mode ( New for Trinity )
  5301. =1: DP mode use single PLL mode
  5302. bit[3]=0: Enable AUX HW mode detection logic
  5303. =1: Disable AUX HW mode detection logic
  5304. ulSB_MMIO_Base_Addr: Physical Base address to SB MMIO space. Driver needs to initialize it for SMU usage.
  5305. usRequestedPWMFreqInHz: When it's set to 0x0 by SBIOS: the LCD BackLight is not controlled by GPU(SW).
  5306. 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;
  5307. When it's set to a non-zero frequency, the BackLight is controlled by GPU (SW) in one of two ways below:
  5308. 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;
  5309. VBIOS will set up proper PWM frequency and ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU==1,as the result,
  5310. Changing BL using VBIOS function is functional in both driver and non-driver present environment;
  5311. and enabling VariBri under the driver environment from PP table is optional.
  5312. 2. SW uses other means to control BL (like DPCD),this non-zero frequency serves as a flag only indicating
  5313. that BL control from GPU is expected.
  5314. VBIOS will NOT set up PWM frequency but make ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU==1
  5315. Changing BL using VBIOS function could be functional in both driver and non-driver present environment,but
  5316. it's per platform
  5317. and enabling VariBri under the driver environment from PP table is optional.
  5318. ucHtcTmpLmt: Refer to D18F3x64 bit[22:16], HtcTmpLmt.
  5319. Threshold on value to enter HTC_active state.
  5320. ucHtcHystLmt: Refer to D18F3x64 bit[27:24], HtcHystLmt.
  5321. To calculate threshold off value to exit HTC_active state, which is Threshold on vlaue minus ucHtcHystLmt.
  5322. ulMinEngineClock: Minimum SCLK allowed in 10kHz unit. This is calculated based on WRCK Fuse settings.
  5323. ulSystemConfig: Bit[0]=0: PCIE Power Gating Disabled
  5324. =1: PCIE Power Gating Enabled
  5325. Bit[1]=0: DDR-DLL shut-down feature disabled.
  5326. 1: DDR-DLL shut-down feature enabled.
  5327. Bit[2]=0: DDR-PLL Power down feature disabled.
  5328. 1: DDR-PLL Power down feature enabled.
  5329. ulCPUCapInfo: TBD
  5330. usNBP0Voltage: VID for voltage on NB P0 State
  5331. usNBP1Voltage: VID for voltage on NB P1 State
  5332. usNBP2Voltage: VID for voltage on NB P2 State
  5333. usNBP3Voltage: VID for voltage on NB P3 State
  5334. usBootUpNBVoltage: Voltage Index of GNB voltage configured by SBIOS, which is suffcient to support VBIOS DISPCLK requirement.
  5335. usExtDispConnInfoOffset: Offset to sExtDispConnInfo inside the structure
  5336. usPanelRefreshRateRange: Bit vector for LCD supported refresh rate range. If DRR is requestd by the platform, at least two bits need to be set
  5337. to indicate a range.
  5338. SUPPORTED_LCD_REFRESHRATE_30Hz 0x0004
  5339. SUPPORTED_LCD_REFRESHRATE_40Hz 0x0008
  5340. SUPPORTED_LCD_REFRESHRATE_50Hz 0x0010
  5341. SUPPORTED_LCD_REFRESHRATE_60Hz 0x0020
  5342. ucMemoryType: [3:0]=1:DDR1;=2:DDR2;=3:DDR3.[7:4] is reserved.
  5343. ucUMAChannelNumber: System memory channel numbers.
  5344. ulCSR_M3_ARB_CNTL_DEFAULT[10]: Arrays with values for CSR M3 arbiter for default
  5345. ulCSR_M3_ARB_CNTL_UVD[10]: Arrays with values for CSR M3 arbiter for UVD playback.
  5346. ulCSR_M3_ARB_CNTL_FS3D[10]: Arrays with values for CSR M3 arbiter for Full Screen 3D applications.
  5347. sAvail_SCLK[5]: Arrays to provide availabe list of SLCK and corresponding voltage, order from low to high
  5348. ulGMCRestoreResetTime: GMC power restore and GMC reset time to calculate data reconnection latency. Unit in ns.
  5349. ulMinimumNClk: Minimum NCLK speed among all NB-Pstates to calcualte data reconnection latency. Unit in 10kHz.
  5350. ulIdleNClk: NCLK speed while memory runs in self-refresh state. Unit in 10kHz.
  5351. ulDDR_DLL_PowerUpTime: DDR PHY DLL power up time. Unit in ns.
  5352. ulDDR_PLL_PowerUpTime: DDR PHY PLL power up time. Unit in ns.
  5353. usPCIEClkSSPercentage: PCIE Clock Spread Spectrum Percentage in unit 0.01%; 100 mean 1%.
  5354. usPCIEClkSSType: PCIE Clock Spread Spectrum Type. 0 for Down spread(default); 1 for Center spread.
  5355. usLvdsSSPercentage: LVDS panel ( not include eDP ) Spread Spectrum Percentage in unit of 0.01%, =0, use VBIOS default setting.
  5356. usLvdsSSpreadRateIn10Hz: LVDS panel ( not include eDP ) Spread Spectrum frequency in unit of 10Hz, =0, use VBIOS default setting.
  5357. usHDMISSPercentage: HDMI Spread Spectrum Percentage in unit 0.01%; 100 mean 1%, =0, use VBIOS default setting.
  5358. usHDMISSpreadRateIn10Hz: HDMI Spread Spectrum frequency in unit of 10Hz, =0, use VBIOS default setting.
  5359. usDVISSPercentage: DVI Spread Spectrum Percentage in unit 0.01%; 100 mean 1%, =0, use VBIOS default setting.
  5360. usDVISSpreadRateIn10Hz: DVI Spread Spectrum frequency in unit of 10Hz, =0, use VBIOS default setting.
  5361. usMaxLVDSPclkFreqInSingleLink: Max pixel clock LVDS panel single link, if=0 means VBIOS use default threhold, right now it is 85Mhz
  5362. ucLVDSMisc: [bit0] LVDS 888bit panel mode =0: LVDS 888 panel in LDI mode, =1: LVDS 888 panel in FPDI mode
  5363. [bit1] LVDS panel lower and upper link mapping =0: lower link and upper link not swap, =1: lower link and upper link are swapped
  5364. [bit2] LVDS 888bit per color mode =0: 666 bit per color =1:888 bit per color
  5365. [bit3] LVDS parameter override enable =0: ucLvdsMisc parameter are not used =1: ucLvdsMisc parameter should be used
  5366. [bit4] Polarity of signal sent to digital BLON output pin. =0: not inverted(active high) =1: inverted ( active low )
  5367. [bit5] Travid LVDS output voltage override enable, when =1, use ucTravisLVDSVolAdjust value to overwrite Traivs register LVDS_CTRL_4
  5368. ucTravisLVDSVolAdjust When ucLVDSMisc[5]=1,it means platform SBIOS want to overwrite TravisLVDSVoltage. Then VBIOS will use ucTravisLVDSVolAdjust
  5369. value to program Travis register LVDS_CTRL_4
  5370. ucLVDSPwrOnSeqDIGONtoDE_in4Ms: LVDS power up sequence time in unit of 4ms, time delay from DIGON signal active to data enable signal active( DE ).
  5371. =0 mean use VBIOS default which is 8 ( 32ms ). The LVDS power up sequence is as following: DIGON->DE->VARY_BL->BLON.
  5372. This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
  5373. ucLVDSPwrOnDEtoVARY_BL_in4Ms: LVDS power up sequence time in unit of 4ms., time delay from DE( data enable ) active to Vary Brightness enable signal active( VARY_BL ).
  5374. =0 mean use VBIOS default which is 90 ( 360ms ). The LVDS power up sequence is as following: DIGON->DE->VARY_BL->BLON.
  5375. This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
  5376. ucLVDSPwrOffVARY_BLtoDE_in4Ms: LVDS power down sequence time in unit of 4ms, time delay from data enable ( DE ) signal off to LCDVCC (DIGON) off.
  5377. =0 mean use VBIOS default delay which is 8 ( 32ms ). The LVDS power down sequence is as following: BLON->VARY_BL->DE->DIGON
  5378. This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
  5379. ucLVDSPwrOffDEtoDIGON_in4Ms: LVDS power down sequence time in unit of 4ms, time delay from vary brightness enable signal( VARY_BL) off to data enable ( DE ) signal off.
  5380. =0 mean use VBIOS default which is 90 ( 360ms ). The LVDS power down sequence is as following: BLON->VARY_BL->DE->DIGON
  5381. This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
  5382. ucLVDSOffToOnDelay_in4Ms: LVDS power down sequence time in unit of 4ms. Time delay from DIGON signal off to DIGON signal active.
  5383. =0 means to use VBIOS default delay which is 125 ( 500ms ).
  5384. This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
  5385. ucLVDSPwrOnSeqVARY_BLtoBLON_in4Ms:
  5386. LVDS power up sequence time in unit of 4ms. Time delay from VARY_BL signal on to DLON signal active.
  5387. =0 means to use VBIOS default delay which is 0 ( 0ms ).
  5388. This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
  5389. ucLVDSPwrOffSeqBLONtoVARY_BL_in4Ms:
  5390. LVDS power down sequence time in unit of 4ms. Time delay from BLON signal off to VARY_BL signal off.
  5391. =0 means to use VBIOS default delay which is 0 ( 0ms ).
  5392. This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
  5393. ucMinAllowedBL_Level: Lowest LCD backlight PWM level. This is customer platform specific parameters. By default it is 0.
  5394. ulNbpStateMemclkFreq[4]: system memory clock frequncey in unit of 10Khz in different NB pstate.
  5395. **********************************************************************************************************************/
  5396. // this IntegrateSystemInfoTable is used for Kaveri & Kabini APU
  5397. typedef struct _ATOM_INTEGRATED_SYSTEM_INFO_V1_8
  5398. {
  5399. ATOM_COMMON_TABLE_HEADER sHeader;
  5400. ULONG ulBootUpEngineClock;
  5401. ULONG ulDentistVCOFreq;
  5402. ULONG ulBootUpUMAClock;
  5403. ATOM_CLK_VOLT_CAPABILITY sDISPCLK_Voltage[4];
  5404. ULONG ulBootUpReqDisplayVector;
  5405. ULONG ulVBIOSMisc;
  5406. ULONG ulGPUCapInfo;
  5407. ULONG ulDISP_CLK2Freq;
  5408. USHORT usRequestedPWMFreqInHz;
  5409. UCHAR ucHtcTmpLmt;
  5410. UCHAR ucHtcHystLmt;
  5411. ULONG ulReserved2;
  5412. ULONG ulSystemConfig;
  5413. ULONG ulCPUCapInfo;
  5414. ULONG ulReserved3;
  5415. USHORT usGPUReservedSysMemSize;
  5416. USHORT usExtDispConnInfoOffset;
  5417. USHORT usPanelRefreshRateRange;
  5418. UCHAR ucMemoryType;
  5419. UCHAR ucUMAChannelNumber;
  5420. UCHAR strVBIOSMsg[40];
  5421. ATOM_TDP_CONFIG asTdpConfig;
  5422. ULONG ulReserved[19];
  5423. ATOM_AVAILABLE_SCLK_LIST sAvail_SCLK[5];
  5424. ULONG ulGMCRestoreResetTime;
  5425. ULONG ulReserved4;
  5426. ULONG ulIdleNClk;
  5427. ULONG ulDDR_DLL_PowerUpTime;
  5428. ULONG ulDDR_PLL_PowerUpTime;
  5429. USHORT usPCIEClkSSPercentage;
  5430. USHORT usPCIEClkSSType;
  5431. USHORT usLvdsSSPercentage;
  5432. USHORT usLvdsSSpreadRateIn10Hz;
  5433. USHORT usHDMISSPercentage;
  5434. USHORT usHDMISSpreadRateIn10Hz;
  5435. USHORT usDVISSPercentage;
  5436. USHORT usDVISSpreadRateIn10Hz;
  5437. ULONG ulGPUReservedSysMemBaseAddrLo;
  5438. ULONG ulGPUReservedSysMemBaseAddrHi;
  5439. ATOM_CLK_VOLT_CAPABILITY s5thDISPCLK_Voltage;
  5440. ULONG ulReserved5;
  5441. USHORT usMaxLVDSPclkFreqInSingleLink;
  5442. UCHAR ucLvdsMisc;
  5443. UCHAR ucTravisLVDSVolAdjust;
  5444. UCHAR ucLVDSPwrOnSeqDIGONtoDE_in4Ms;
  5445. UCHAR ucLVDSPwrOnSeqDEtoVARY_BL_in4Ms;
  5446. UCHAR ucLVDSPwrOffSeqVARY_BLtoDE_in4Ms;
  5447. UCHAR ucLVDSPwrOffSeqDEtoDIGON_in4Ms;
  5448. UCHAR ucLVDSOffToOnDelay_in4Ms;
  5449. UCHAR ucLVDSPwrOnSeqVARY_BLtoBLON_in4Ms;
  5450. UCHAR ucLVDSPwrOffSeqBLONtoVARY_BL_in4Ms;
  5451. UCHAR ucMinAllowedBL_Level;
  5452. ULONG ulLCDBitDepthControlVal;
  5453. ULONG ulNbpStateMemclkFreq[4];
  5454. ULONG ulPSPVersion;
  5455. ULONG ulNbpStateNClkFreq[4];
  5456. USHORT usNBPStateVoltage[4];
  5457. USHORT usBootUpNBVoltage;
  5458. USHORT usReserved2;
  5459. ATOM_EXTERNAL_DISPLAY_CONNECTION_INFO sExtDispConnInfo;
  5460. }ATOM_INTEGRATED_SYSTEM_INFO_V1_8;
  5461. /**********************************************************************************************************************
  5462. ATOM_INTEGRATED_SYSTEM_INFO_V1_8 Description
  5463. ulBootUpEngineClock: VBIOS bootup Engine clock frequency, in 10kHz unit. if it is equal 0, then VBIOS use pre-defined bootup engine clock
  5464. ulDentistVCOFreq: Dentist VCO clock in 10kHz unit.
  5465. ulBootUpUMAClock: System memory boot up clock frequency in 10Khz unit.
  5466. sDISPCLK_Voltage: Report Display clock frequency requirement on GNB voltage(up to 4 voltage levels).
  5467. ulBootUpReqDisplayVector: VBIOS boot up display IDs, following are supported devices in Trinity projects:
  5468. ATOM_DEVICE_CRT1_SUPPORT 0x0001
  5469. ATOM_DEVICE_DFP1_SUPPORT 0x0008
  5470. ATOM_DEVICE_DFP6_SUPPORT 0x0040
  5471. ATOM_DEVICE_DFP2_SUPPORT 0x0080
  5472. ATOM_DEVICE_DFP3_SUPPORT 0x0200
  5473. ATOM_DEVICE_DFP4_SUPPORT 0x0400
  5474. ATOM_DEVICE_DFP5_SUPPORT 0x0800
  5475. ATOM_DEVICE_LCD1_SUPPORT 0x0002
  5476. ulVBIOSMisc: Miscellenous flags for VBIOS requirement and interface
  5477. bit[0]=0: INT15 callback function Get LCD EDID ( ax=4e08, bl=1b ) is not supported by SBIOS.
  5478. =1: INT15 callback function Get LCD EDID ( ax=4e08, bl=1b ) is supported by SBIOS.
  5479. bit[1]=0: INT15 callback function Get boot display( ax=4e08, bl=01h) is not supported by SBIOS
  5480. =1: INT15 callback function Get boot display( ax=4e08, bl=01h) is supported by SBIOS
  5481. bit[2]=0: INT15 callback function Get panel Expansion ( ax=4e08, bl=02h) is not supported by SBIOS
  5482. =1: INT15 callback function Get panel Expansion ( ax=4e08, bl=02h) is supported by SBIOS
  5483. bit[3]=0: VBIOS fast boot is disable
  5484. =1: VBIOS fast boot is enable. ( VBIOS skip display device detection in every set mode if LCD panel is connect and LID is open)
  5485. ulGPUCapInfo: bit[0~2]= Reserved
  5486. bit[3]=0: Enable AUX HW mode detection logic
  5487. =1: Disable AUX HW mode detection logic
  5488. bit[4]=0: Disable DFS bypass feature
  5489. =1: Enable DFS bypass feature
  5490. usRequestedPWMFreqInHz: When it's set to 0x0 by SBIOS: the LCD BackLight is not controlled by GPU(SW).
  5491. 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;
  5492. When it's set to a non-zero frequency, the BackLight is controlled by GPU (SW) in one of two ways below:
  5493. 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;
  5494. VBIOS will set up proper PWM frequency and ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU==1,as the result,
  5495. Changing BL using VBIOS function is functional in both driver and non-driver present environment;
  5496. and enabling VariBri under the driver environment from PP table is optional.
  5497. 2. SW uses other means to control BL (like DPCD),this non-zero frequency serves as a flag only indicating
  5498. that BL control from GPU is expected.
  5499. VBIOS will NOT set up PWM frequency but make ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU==1
  5500. Changing BL using VBIOS function could be functional in both driver and non-driver present environment,but
  5501. it's per platform
  5502. and enabling VariBri under the driver environment from PP table is optional.
  5503. ucHtcTmpLmt: Refer to D18F3x64 bit[22:16], HtcTmpLmt. Threshold on value to enter HTC_active state.
  5504. ucHtcHystLmt: Refer to D18F3x64 bit[27:24], HtcHystLmt.
  5505. To calculate threshold off value to exit HTC_active state, which is Threshold on vlaue minus ucHtcHystLmt.
  5506. ulSystemConfig: Bit[0]=0: PCIE Power Gating Disabled
  5507. =1: PCIE Power Gating Enabled
  5508. Bit[1]=0: DDR-DLL shut-down feature disabled.
  5509. 1: DDR-DLL shut-down feature enabled.
  5510. Bit[2]=0: DDR-PLL Power down feature disabled.
  5511. 1: DDR-PLL Power down feature enabled.
  5512. Bit[3]=0: GNB DPM is disabled
  5513. =1: GNB DPM is enabled
  5514. ulCPUCapInfo: TBD
  5515. usExtDispConnInfoOffset: Offset to sExtDispConnInfo inside the structure
  5516. usPanelRefreshRateRange: Bit vector for LCD supported refresh rate range. If DRR is requestd by the platform, at least two bits need to be set
  5517. to indicate a range.
  5518. SUPPORTED_LCD_REFRESHRATE_30Hz 0x0004
  5519. SUPPORTED_LCD_REFRESHRATE_40Hz 0x0008
  5520. SUPPORTED_LCD_REFRESHRATE_50Hz 0x0010
  5521. SUPPORTED_LCD_REFRESHRATE_60Hz 0x0020
  5522. ucMemoryType: [3:0]=1:DDR1;=2:DDR2;=3:DDR3;=5:GDDR5; [7:4] is reserved.
  5523. ucUMAChannelNumber: System memory channel numbers.
  5524. strVBIOSMsg[40]: VBIOS boot up customized message string
  5525. sAvail_SCLK[5]: Arrays to provide availabe list of SLCK and corresponding voltage, order from low to high
  5526. ulGMCRestoreResetTime: GMC power restore and GMC reset time to calculate data reconnection latency. Unit in ns.
  5527. ulIdleNClk: NCLK speed while memory runs in self-refresh state, used to calculate self-refresh latency. Unit in 10kHz.
  5528. ulDDR_DLL_PowerUpTime: DDR PHY DLL power up time. Unit in ns.
  5529. ulDDR_PLL_PowerUpTime: DDR PHY PLL power up time. Unit in ns.
  5530. usPCIEClkSSPercentage: PCIE Clock Spread Spectrum Percentage in unit 0.01%; 100 mean 1%.
  5531. usPCIEClkSSType: PCIE Clock Spread Spectrum Type. 0 for Down spread(default); 1 for Center spread.
  5532. usLvdsSSPercentage: LVDS panel ( not include eDP ) Spread Spectrum Percentage in unit of 0.01%, =0, use VBIOS default setting.
  5533. usLvdsSSpreadRateIn10Hz: LVDS panel ( not include eDP ) Spread Spectrum frequency in unit of 10Hz, =0, use VBIOS default setting.
  5534. usHDMISSPercentage: HDMI Spread Spectrum Percentage in unit 0.01%; 100 mean 1%, =0, use VBIOS default setting.
  5535. usHDMISSpreadRateIn10Hz: HDMI Spread Spectrum frequency in unit of 10Hz, =0, use VBIOS default setting.
  5536. usDVISSPercentage: DVI Spread Spectrum Percentage in unit 0.01%; 100 mean 1%, =0, use VBIOS default setting.
  5537. usDVISSpreadRateIn10Hz: DVI Spread Spectrum frequency in unit of 10Hz, =0, use VBIOS default setting.
  5538. usGPUReservedSysMemSize: Reserved system memory size for ACP engine in APU GNB, units in MB. 0/2/4MB based on CMOS options, current default could be 0MB. KV only, not on KB.
  5539. ulGPUReservedSysMemBaseAddrLo: Low 32 bits base address to the reserved system memory.
  5540. ulGPUReservedSysMemBaseAddrHi: High 32 bits base address to the reserved system memory.
  5541. usMaxLVDSPclkFreqInSingleLink: Max pixel clock LVDS panel single link, if=0 means VBIOS use default threhold, right now it is 85Mhz
  5542. ucLVDSMisc: [bit0] LVDS 888bit panel mode =0: LVDS 888 panel in LDI mode, =1: LVDS 888 panel in FPDI mode
  5543. [bit1] LVDS panel lower and upper link mapping =0: lower link and upper link not swap, =1: lower link and upper link are swapped
  5544. [bit2] LVDS 888bit per color mode =0: 666 bit per color =1:888 bit per color
  5545. [bit3] LVDS parameter override enable =0: ucLvdsMisc parameter are not used =1: ucLvdsMisc parameter should be used
  5546. [bit4] Polarity of signal sent to digital BLON output pin. =0: not inverted(active high) =1: inverted ( active low )
  5547. [bit5] Travid LVDS output voltage override enable, when =1, use ucTravisLVDSVolAdjust value to overwrite Traivs register LVDS_CTRL_4
  5548. ucTravisLVDSVolAdjust When ucLVDSMisc[5]=1,it means platform SBIOS want to overwrite TravisLVDSVoltage. Then VBIOS will use ucTravisLVDSVolAdjust
  5549. value to program Travis register LVDS_CTRL_4
  5550. ucLVDSPwrOnSeqDIGONtoDE_in4Ms:
  5551. LVDS power up sequence time in unit of 4ms, time delay from DIGON signal active to data enable signal active( DE ).
  5552. =0 mean use VBIOS default which is 8 ( 32ms ). The LVDS power up sequence is as following: DIGON->DE->VARY_BL->BLON.
  5553. This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
  5554. ucLVDSPwrOnDEtoVARY_BL_in4Ms:
  5555. LVDS power up sequence time in unit of 4ms., time delay from DE( data enable ) active to Vary Brightness enable signal active( VARY_BL ).
  5556. =0 mean use VBIOS default which is 90 ( 360ms ). The LVDS power up sequence is as following: DIGON->DE->VARY_BL->BLON.
  5557. This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
  5558. ucLVDSPwrOffVARY_BLtoDE_in4Ms:
  5559. LVDS power down sequence time in unit of 4ms, time delay from data enable ( DE ) signal off to LCDVCC (DIGON) off.
  5560. =0 mean use VBIOS default delay which is 8 ( 32ms ). The LVDS power down sequence is as following: BLON->VARY_BL->DE->DIGON
  5561. This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
  5562. ucLVDSPwrOffDEtoDIGON_in4Ms:
  5563. LVDS power down sequence time in unit of 4ms, time delay from vary brightness enable signal( VARY_BL) off to data enable ( DE ) signal off.
  5564. =0 mean use VBIOS default which is 90 ( 360ms ). The LVDS power down sequence is as following: BLON->VARY_BL->DE->DIGON
  5565. This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
  5566. ucLVDSOffToOnDelay_in4Ms:
  5567. LVDS power down sequence time in unit of 4ms. Time delay from DIGON signal off to DIGON signal active.
  5568. =0 means to use VBIOS default delay which is 125 ( 500ms ).
  5569. This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
  5570. ucLVDSPwrOnSeqVARY_BLtoBLON_in4Ms:
  5571. LVDS power up sequence time in unit of 4ms. Time delay from VARY_BL signal on to DLON signal active.
  5572. =0 means to use VBIOS default delay which is 0 ( 0ms ).
  5573. This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
  5574. ucLVDSPwrOffSeqBLONtoVARY_BL_in4Ms:
  5575. LVDS power down sequence time in unit of 4ms. Time delay from BLON signal off to VARY_BL signal off.
  5576. =0 means to use VBIOS default delay which is 0 ( 0ms ).
  5577. This parameter is used by VBIOS only. VBIOS will patch LVDS_InfoTable.
  5578. ucMinAllowedBL_Level: Lowest LCD backlight PWM level. This is customer platform specific parameters. By default it is 0.
  5579. ulLCDBitDepthControlVal: GPU display control encoder bit dither control setting, used to program register mmFMT_BIT_DEPTH_CONTROL
  5580. ulNbpStateMemclkFreq[4]: system memory clock frequncey in unit of 10Khz in different NB P-State(P0, P1, P2 & P3).
  5581. ulNbpStateNClkFreq[4]: NB P-State NClk frequency in different NB P-State
  5582. usNBPStateVoltage[4]: NB P-State (P0/P1 & P2/P3) voltage; NBP3 refers to lowes voltage
  5583. usBootUpNBVoltage: NB P-State voltage during boot up before driver loaded
  5584. sExtDispConnInfo: Display connector information table provided to VBIOS
  5585. **********************************************************************************************************************/
  5586. typedef struct _ATOM_I2C_REG_INFO
  5587. {
  5588. UCHAR ucI2cRegIndex;
  5589. UCHAR ucI2cRegVal;
  5590. }ATOM_I2C_REG_INFO;
  5591. // this IntegrateSystemInfoTable is used for Carrizo
  5592. typedef struct _ATOM_INTEGRATED_SYSTEM_INFO_V1_9
  5593. {
  5594. ATOM_COMMON_TABLE_HEADER sHeader;
  5595. ULONG ulBootUpEngineClock;
  5596. ULONG ulDentistVCOFreq;
  5597. ULONG ulBootUpUMAClock;
  5598. ATOM_CLK_VOLT_CAPABILITY sDISPCLK_Voltage[4]; // no longer used, keep it as is to avoid driver compiling error
  5599. ULONG ulBootUpReqDisplayVector;
  5600. ULONG ulVBIOSMisc;
  5601. ULONG ulGPUCapInfo;
  5602. ULONG ulDISP_CLK2Freq;
  5603. USHORT usRequestedPWMFreqInHz;
  5604. UCHAR ucHtcTmpLmt;
  5605. UCHAR ucHtcHystLmt;
  5606. ULONG ulReserved2;
  5607. ULONG ulSystemConfig;
  5608. ULONG ulCPUCapInfo;
  5609. ULONG ulReserved3;
  5610. USHORT usGPUReservedSysMemSize;
  5611. USHORT usExtDispConnInfoOffset;
  5612. USHORT usPanelRefreshRateRange;
  5613. UCHAR ucMemoryType;
  5614. UCHAR ucUMAChannelNumber;
  5615. UCHAR strVBIOSMsg[40];
  5616. ATOM_TDP_CONFIG asTdpConfig;
  5617. UCHAR ucExtHDMIReDrvSlvAddr;
  5618. UCHAR ucExtHDMIReDrvRegNum;
  5619. ATOM_I2C_REG_INFO asExtHDMIRegSetting[9];
  5620. ULONG ulReserved[2];
  5621. ATOM_CLK_VOLT_CAPABILITY_V2 sDispClkVoltageMapping[8];
  5622. ATOM_AVAILABLE_SCLK_LIST sAvail_SCLK[5]; // no longer used, keep it as is to avoid driver compiling error
  5623. ULONG ulGMCRestoreResetTime;
  5624. ULONG ulReserved4;
  5625. ULONG ulIdleNClk;
  5626. ULONG ulDDR_DLL_PowerUpTime;
  5627. ULONG ulDDR_PLL_PowerUpTime;
  5628. USHORT usPCIEClkSSPercentage;
  5629. USHORT usPCIEClkSSType;
  5630. USHORT usLvdsSSPercentage;
  5631. USHORT usLvdsSSpreadRateIn10Hz;
  5632. USHORT usHDMISSPercentage;
  5633. USHORT usHDMISSpreadRateIn10Hz;
  5634. USHORT usDVISSPercentage;
  5635. USHORT usDVISSpreadRateIn10Hz;
  5636. ULONG ulGPUReservedSysMemBaseAddrLo;
  5637. ULONG ulGPUReservedSysMemBaseAddrHi;
  5638. ULONG ulReserved5[3];
  5639. USHORT usMaxLVDSPclkFreqInSingleLink;
  5640. UCHAR ucLvdsMisc;
  5641. UCHAR ucTravisLVDSVolAdjust;
  5642. UCHAR ucLVDSPwrOnSeqDIGONtoDE_in4Ms;
  5643. UCHAR ucLVDSPwrOnSeqDEtoVARY_BL_in4Ms;
  5644. UCHAR ucLVDSPwrOffSeqVARY_BLtoDE_in4Ms;
  5645. UCHAR ucLVDSPwrOffSeqDEtoDIGON_in4Ms;
  5646. UCHAR ucLVDSOffToOnDelay_in4Ms;
  5647. UCHAR ucLVDSPwrOnSeqVARY_BLtoBLON_in4Ms;
  5648. UCHAR ucLVDSPwrOffSeqBLONtoVARY_BL_in4Ms;
  5649. UCHAR ucMinAllowedBL_Level;
  5650. ULONG ulLCDBitDepthControlVal;
  5651. ULONG ulNbpStateMemclkFreq[4]; // only 2 level is changed.
  5652. ULONG ulPSPVersion;
  5653. ULONG ulNbpStateNClkFreq[4];
  5654. USHORT usNBPStateVoltage[4];
  5655. USHORT usBootUpNBVoltage;
  5656. UCHAR ucEDPv1_4VSMode;
  5657. UCHAR ucReserved2;
  5658. ATOM_EXTERNAL_DISPLAY_CONNECTION_INFO sExtDispConnInfo;
  5659. }ATOM_INTEGRATED_SYSTEM_INFO_V1_9;
  5660. // definition for ucEDPv1_4VSMode
  5661. #define EDP_VS_LEGACY_MODE 0
  5662. #define EDP_VS_LOW_VDIFF_MODE 1
  5663. #define EDP_VS_HIGH_VDIFF_MODE 2
  5664. #define EDP_VS_STRETCH_MODE 3
  5665. #define EDP_VS_SINGLE_VDIFF_MODE 4
  5666. #define EDP_VS_VARIABLE_PREM_MODE 5
  5667. // ulGPUCapInfo
  5668. #define SYS_INFO_V1_9_GPUCAPSINFO_DISABLE_AUX_MODE_DETECT 0x08
  5669. #define SYS_INFO_V1_9_GPUCAPSINFO_ENABEL_DFS_BYPASS 0x10
  5670. //ulGPUCapInfo[16]=1 indicate SMC firmware is able to support GNB fast resume function, so that driver can call SMC to program most of GNB register during resuming, from ML
  5671. #define SYS_INFO_V1_9_GPUCAPSINFO_GNB_FAST_RESUME_CAPABLE 0x00010000
  5672. //ulGPUCapInfo[18]=1 indicate the IOMMU is not available
  5673. #define SYS_INFO_V1_9_GPUCAPINFO_IOMMU_DISABLE 0x00040000
  5674. //ulGPUCapInfo[19]=1 indicate the MARC Aperture is opened.
  5675. #define SYS_INFO_V1_9_GPUCAPINFO_MARC_APERTURE_ENABLE 0x00080000
  5676. typedef struct _DPHY_TIMING_PARA
  5677. {
  5678. UCHAR ucProfileID; // SENSOR_PROFILES
  5679. ULONG ucPara;
  5680. } DPHY_TIMING_PARA;
  5681. typedef struct _DPHY_ELEC_PARA
  5682. {
  5683. USHORT usPara[3];
  5684. } DPHY_ELEC_PARA;
  5685. typedef struct _CAMERA_MODULE_INFO
  5686. {
  5687. UCHAR ucID; // 0: Rear, 1: Front right of user, 2: Front left of user
  5688. UCHAR strModuleName[8];
  5689. DPHY_TIMING_PARA asTimingPara[6]; // Exact number is under estimation and confirmation from sensor vendor
  5690. } CAMERA_MODULE_INFO;
  5691. typedef struct _FLASHLIGHT_INFO
  5692. {
  5693. UCHAR ucID; // 0: Rear, 1: Front
  5694. UCHAR strName[8];
  5695. } FLASHLIGHT_INFO;
  5696. typedef struct _CAMERA_DATA
  5697. {
  5698. ULONG ulVersionCode;
  5699. CAMERA_MODULE_INFO asCameraInfo[3]; // Assuming 3 camera sensors max
  5700. FLASHLIGHT_INFO asFlashInfo; // Assuming 1 flashlight max
  5701. DPHY_ELEC_PARA asDphyElecPara;
  5702. ULONG ulCrcVal; // CRC
  5703. }CAMERA_DATA;
  5704. typedef struct _ATOM_INTEGRATED_SYSTEM_INFO_V1_10
  5705. {
  5706. ATOM_COMMON_TABLE_HEADER sHeader;
  5707. ULONG ulBootUpEngineClock;
  5708. ULONG ulDentistVCOFreq;
  5709. ULONG ulBootUpUMAClock;
  5710. ULONG ulReserved0[8];
  5711. ULONG ulBootUpReqDisplayVector;
  5712. ULONG ulVBIOSMisc;
  5713. ULONG ulGPUCapInfo;
  5714. ULONG ulReserved1;
  5715. USHORT usRequestedPWMFreqInHz;
  5716. UCHAR ucHtcTmpLmt;
  5717. UCHAR ucHtcHystLmt;
  5718. ULONG ulReserved2;
  5719. ULONG ulSystemConfig;
  5720. ULONG ulCPUCapInfo;
  5721. ULONG ulReserved3;
  5722. USHORT usGPUReservedSysMemSize;
  5723. USHORT usExtDispConnInfoOffset;
  5724. USHORT usPanelRefreshRateRange;
  5725. UCHAR ucMemoryType;
  5726. UCHAR ucUMAChannelNumber;
  5727. ULONG ulMsgReserved[10];
  5728. ATOM_TDP_CONFIG asTdpConfig;
  5729. ULONG ulReserved[7];
  5730. ATOM_CLK_VOLT_CAPABILITY_V2 sDispClkVoltageMapping[8];
  5731. ULONG ulReserved6[10];
  5732. ULONG ulGMCRestoreResetTime;
  5733. ULONG ulReserved4;
  5734. ULONG ulIdleNClk;
  5735. ULONG ulDDR_DLL_PowerUpTime;
  5736. ULONG ulDDR_PLL_PowerUpTime;
  5737. USHORT usPCIEClkSSPercentage;
  5738. USHORT usPCIEClkSSType;
  5739. USHORT usLvdsSSPercentage;
  5740. USHORT usLvdsSSpreadRateIn10Hz;
  5741. USHORT usHDMISSPercentage;
  5742. USHORT usHDMISSpreadRateIn10Hz;
  5743. USHORT usDVISSPercentage;
  5744. USHORT usDVISSpreadRateIn10Hz;
  5745. ULONG ulGPUReservedSysMemBaseAddrLo;
  5746. ULONG ulGPUReservedSysMemBaseAddrHi;
  5747. ULONG ulReserved5[3];
  5748. USHORT usMaxLVDSPclkFreqInSingleLink;
  5749. UCHAR ucLvdsMisc;
  5750. UCHAR ucTravisLVDSVolAdjust;
  5751. UCHAR ucLVDSPwrOnSeqDIGONtoDE_in4Ms;
  5752. UCHAR ucLVDSPwrOnSeqDEtoVARY_BL_in4Ms;
  5753. UCHAR ucLVDSPwrOffSeqVARY_BLtoDE_in4Ms;
  5754. UCHAR ucLVDSPwrOffSeqDEtoDIGON_in4Ms;
  5755. UCHAR ucLVDSOffToOnDelay_in4Ms;
  5756. UCHAR ucLVDSPwrOnSeqVARY_BLtoBLON_in4Ms;
  5757. UCHAR ucLVDSPwrOffSeqBLONtoVARY_BL_in4Ms;
  5758. UCHAR ucMinAllowedBL_Level;
  5759. ULONG ulLCDBitDepthControlVal;
  5760. ULONG ulNbpStateMemclkFreq[2];
  5761. ULONG ulReserved7[2];
  5762. ULONG ulPSPVersion;
  5763. ULONG ulNbpStateNClkFreq[4];
  5764. USHORT usNBPStateVoltage[4];
  5765. USHORT usBootUpNBVoltage;
  5766. UCHAR ucEDPv1_4VSMode;
  5767. UCHAR ucReserved2;
  5768. ATOM_EXTERNAL_DISPLAY_CONNECTION_INFO sExtDispConnInfo;
  5769. CAMERA_DATA asCameraInfo;
  5770. ULONG ulReserved8[29];
  5771. }ATOM_INTEGRATED_SYSTEM_INFO_V1_10;
  5772. // this Table is used for Kaveri/Kabini APU
  5773. typedef struct _ATOM_FUSION_SYSTEM_INFO_V2
  5774. {
  5775. ATOM_INTEGRATED_SYSTEM_INFO_V1_8 sIntegratedSysInfo; // refer to ATOM_INTEGRATED_SYSTEM_INFO_V1_8 definition
  5776. ULONG ulPowerplayTable[128]; // Update comments here to link new powerplay table definition structure
  5777. }ATOM_FUSION_SYSTEM_INFO_V2;
  5778. typedef struct _ATOM_FUSION_SYSTEM_INFO_V3
  5779. {
  5780. ATOM_INTEGRATED_SYSTEM_INFO_V1_10 sIntegratedSysInfo; // refer to ATOM_INTEGRATED_SYSTEM_INFO_V1_8 definition
  5781. ULONG ulPowerplayTable[192]; // Reserve 768 bytes space for PowerPlayInfoTable
  5782. }ATOM_FUSION_SYSTEM_INFO_V3;
  5783. #define FUSION_V3_OFFSET_FROM_TOP_OF_FB 0x800
  5784. /**************************************************************************/
  5785. // This portion is only used when ext thermal chip or engine/memory clock SS chip is populated on a design
  5786. //Memory SS Info Table
  5787. //Define Memory Clock SS chip ID
  5788. #define ICS91719 1
  5789. #define ICS91720 2
  5790. //Define one structure to inform SW a "block of data" writing to external SS chip via I2C protocol
  5791. typedef struct _ATOM_I2C_DATA_RECORD
  5792. {
  5793. UCHAR ucNunberOfBytes; //Indicates how many bytes SW needs to write to the external ASIC for one block, besides to "Start" and "Stop"
  5794. UCHAR ucI2CData[1]; //I2C data in bytes, should be less than 16 bytes usually
  5795. }ATOM_I2C_DATA_RECORD;
  5796. //Define one structure to inform SW how many blocks of data writing to external SS chip via I2C protocol, in addition to other information
  5797. typedef struct _ATOM_I2C_DEVICE_SETUP_INFO
  5798. {
  5799. ATOM_I2C_ID_CONFIG_ACCESS sucI2cId; //I2C line and HW/SW assisted cap.
  5800. UCHAR ucSSChipID; //SS chip being used
  5801. UCHAR ucSSChipSlaveAddr; //Slave Address to set up this SS chip
  5802. UCHAR ucNumOfI2CDataRecords; //number of data block
  5803. ATOM_I2C_DATA_RECORD asI2CData[1];
  5804. }ATOM_I2C_DEVICE_SETUP_INFO;
  5805. //==========================================================================================
  5806. typedef struct _ATOM_ASIC_MVDD_INFO
  5807. {
  5808. ATOM_COMMON_TABLE_HEADER sHeader;
  5809. ATOM_I2C_DEVICE_SETUP_INFO asI2CSetup[1];
  5810. }ATOM_ASIC_MVDD_INFO;
  5811. //==========================================================================================
  5812. #define ATOM_MCLK_SS_INFO ATOM_ASIC_MVDD_INFO
  5813. //==========================================================================================
  5814. /**************************************************************************/
  5815. typedef struct _ATOM_ASIC_SS_ASSIGNMENT
  5816. {
  5817. ULONG ulTargetClockRange; //Clock Out frequence (VCO ), in unit of 10Khz
  5818. USHORT usSpreadSpectrumPercentage; //in unit of 0.01%
  5819. USHORT usSpreadRateInKhz; //in unit of kHz, modulation freq
  5820. UCHAR ucClockIndication; //Indicate which clock source needs SS
  5821. UCHAR ucSpreadSpectrumMode; //Bit1=0 Down Spread,=1 Center Spread.
  5822. UCHAR ucReserved[2];
  5823. }ATOM_ASIC_SS_ASSIGNMENT;
  5824. //Define ucClockIndication, SW uses the IDs below to search if the SS is requried/enabled on a clock branch/signal type.
  5825. //SS is not required or enabled if a match is not found.
  5826. #define ASIC_INTERNAL_MEMORY_SS 1
  5827. #define ASIC_INTERNAL_ENGINE_SS 2
  5828. #define ASIC_INTERNAL_UVD_SS 3
  5829. #define ASIC_INTERNAL_SS_ON_TMDS 4
  5830. #define ASIC_INTERNAL_SS_ON_HDMI 5
  5831. #define ASIC_INTERNAL_SS_ON_LVDS 6
  5832. #define ASIC_INTERNAL_SS_ON_DP 7
  5833. #define ASIC_INTERNAL_SS_ON_DCPLL 8
  5834. #define ASIC_EXTERNAL_SS_ON_DP_CLOCK 9
  5835. #define ASIC_INTERNAL_VCE_SS 10
  5836. #define ASIC_INTERNAL_GPUPLL_SS 11
  5837. typedef struct _ATOM_ASIC_SS_ASSIGNMENT_V2
  5838. {
  5839. ULONG ulTargetClockRange; //For mem/engine/uvd, Clock Out frequence (VCO ), in unit of 10Khz
  5840. //For TMDS/HDMI/LVDS, it is pixel clock , for DP, it is link clock ( 27000 or 16200 )
  5841. USHORT usSpreadSpectrumPercentage; //in unit of 0.01%
  5842. USHORT usSpreadRateIn10Hz; //in unit of 10Hz, modulation freq
  5843. UCHAR ucClockIndication; //Indicate which clock source needs SS
  5844. UCHAR ucSpreadSpectrumMode; //Bit0=0 Down Spread,=1 Center Spread, bit1=0: internal SS bit1=1: external SS
  5845. UCHAR ucReserved[2];
  5846. }ATOM_ASIC_SS_ASSIGNMENT_V2;
  5847. //ucSpreadSpectrumMode
  5848. //#define ATOM_SS_DOWN_SPREAD_MODE_MASK 0x00000000
  5849. //#define ATOM_SS_DOWN_SPREAD_MODE 0x00000000
  5850. //#define ATOM_SS_CENTRE_SPREAD_MODE_MASK 0x00000001
  5851. //#define ATOM_SS_CENTRE_SPREAD_MODE 0x00000001
  5852. //#define ATOM_INTERNAL_SS_MASK 0x00000000
  5853. //#define ATOM_EXTERNAL_SS_MASK 0x00000002
  5854. typedef struct _ATOM_ASIC_INTERNAL_SS_INFO
  5855. {
  5856. ATOM_COMMON_TABLE_HEADER sHeader;
  5857. ATOM_ASIC_SS_ASSIGNMENT asSpreadSpectrum[4];
  5858. }ATOM_ASIC_INTERNAL_SS_INFO;
  5859. typedef struct _ATOM_ASIC_INTERNAL_SS_INFO_V2
  5860. {
  5861. ATOM_COMMON_TABLE_HEADER sHeader;
  5862. ATOM_ASIC_SS_ASSIGNMENT_V2 asSpreadSpectrum[1]; //this is point only.
  5863. }ATOM_ASIC_INTERNAL_SS_INFO_V2;
  5864. typedef struct _ATOM_ASIC_SS_ASSIGNMENT_V3
  5865. {
  5866. ULONG ulTargetClockRange; //For mem/engine/uvd, Clock Out frequence (VCO ), in unit of 10Khz
  5867. //For TMDS/HDMI/LVDS, it is pixel clock , for DP, it is link clock ( 27000 or 16200 )
  5868. USHORT usSpreadSpectrumPercentage; //in unit of 0.01% or 0.001%, decided by ucSpreadSpectrumMode bit4
  5869. USHORT usSpreadRateIn10Hz; //in unit of 10Hz, modulation freq
  5870. UCHAR ucClockIndication; //Indicate which clock source needs SS
  5871. UCHAR ucSpreadSpectrumMode; //Bit0=0 Down Spread,=1 Center Spread, bit1=0: internal SS bit1=1: external SS
  5872. UCHAR ucReserved[2];
  5873. }ATOM_ASIC_SS_ASSIGNMENT_V3;
  5874. //ATOM_ASIC_SS_ASSIGNMENT_V3.ucSpreadSpectrumMode
  5875. #define SS_MODE_V3_CENTRE_SPREAD_MASK 0x01
  5876. #define SS_MODE_V3_EXTERNAL_SS_MASK 0x02
  5877. #define SS_MODE_V3_PERCENTAGE_DIV_BY_1000_MASK 0x10
  5878. typedef struct _ATOM_ASIC_INTERNAL_SS_INFO_V3
  5879. {
  5880. ATOM_COMMON_TABLE_HEADER sHeader;
  5881. ATOM_ASIC_SS_ASSIGNMENT_V3 asSpreadSpectrum[1]; //this is pointer only.
  5882. }ATOM_ASIC_INTERNAL_SS_INFO_V3;
  5883. //==============================Scratch Pad Definition Portion===============================
  5884. #define ATOM_DEVICE_CONNECT_INFO_DEF 0
  5885. #define ATOM_ROM_LOCATION_DEF 1
  5886. #define ATOM_TV_STANDARD_DEF 2
  5887. #define ATOM_ACTIVE_INFO_DEF 3
  5888. #define ATOM_LCD_INFO_DEF 4
  5889. #define ATOM_DOS_REQ_INFO_DEF 5
  5890. #define ATOM_ACC_CHANGE_INFO_DEF 6
  5891. #define ATOM_DOS_MODE_INFO_DEF 7
  5892. #define ATOM_I2C_CHANNEL_STATUS_DEF 8
  5893. #define ATOM_I2C_CHANNEL_STATUS1_DEF 9
  5894. #define ATOM_INTERNAL_TIMER_DEF 10
  5895. // BIOS_0_SCRATCH Definition
  5896. #define ATOM_S0_CRT1_MONO 0x00000001L
  5897. #define ATOM_S0_CRT1_COLOR 0x00000002L
  5898. #define ATOM_S0_CRT1_MASK (ATOM_S0_CRT1_MONO+ATOM_S0_CRT1_COLOR)
  5899. #define ATOM_S0_TV1_COMPOSITE_A 0x00000004L
  5900. #define ATOM_S0_TV1_SVIDEO_A 0x00000008L
  5901. #define ATOM_S0_TV1_MASK_A (ATOM_S0_TV1_COMPOSITE_A+ATOM_S0_TV1_SVIDEO_A)
  5902. #define ATOM_S0_CV_A 0x00000010L
  5903. #define ATOM_S0_CV_DIN_A 0x00000020L
  5904. #define ATOM_S0_CV_MASK_A (ATOM_S0_CV_A+ATOM_S0_CV_DIN_A)
  5905. #define ATOM_S0_CRT2_MONO 0x00000100L
  5906. #define ATOM_S0_CRT2_COLOR 0x00000200L
  5907. #define ATOM_S0_CRT2_MASK (ATOM_S0_CRT2_MONO+ATOM_S0_CRT2_COLOR)
  5908. #define ATOM_S0_TV1_COMPOSITE 0x00000400L
  5909. #define ATOM_S0_TV1_SVIDEO 0x00000800L
  5910. #define ATOM_S0_TV1_SCART 0x00004000L
  5911. #define ATOM_S0_TV1_MASK (ATOM_S0_TV1_COMPOSITE+ATOM_S0_TV1_SVIDEO+ATOM_S0_TV1_SCART)
  5912. #define ATOM_S0_CV 0x00001000L
  5913. #define ATOM_S0_CV_DIN 0x00002000L
  5914. #define ATOM_S0_CV_MASK (ATOM_S0_CV+ATOM_S0_CV_DIN)
  5915. #define ATOM_S0_DFP1 0x00010000L
  5916. #define ATOM_S0_DFP2 0x00020000L
  5917. #define ATOM_S0_LCD1 0x00040000L
  5918. #define ATOM_S0_LCD2 0x00080000L
  5919. #define ATOM_S0_DFP6 0x00100000L
  5920. #define ATOM_S0_DFP3 0x00200000L
  5921. #define ATOM_S0_DFP4 0x00400000L
  5922. #define ATOM_S0_DFP5 0x00800000L
  5923. #define ATOM_S0_DFP_MASK ATOM_S0_DFP1 | ATOM_S0_DFP2 | ATOM_S0_DFP3 | ATOM_S0_DFP4 | ATOM_S0_DFP5 | ATOM_S0_DFP6
  5924. #define ATOM_S0_FAD_REGISTER_BUG 0x02000000L // If set, indicates we are running a PCIE asic with
  5925. // the FAD/HDP reg access bug. Bit is read by DAL, this is obsolete from RV5xx
  5926. #define ATOM_S0_THERMAL_STATE_MASK 0x1C000000L
  5927. #define ATOM_S0_THERMAL_STATE_SHIFT 26
  5928. #define ATOM_S0_SYSTEM_POWER_STATE_MASK 0xE0000000L
  5929. #define ATOM_S0_SYSTEM_POWER_STATE_SHIFT 29
  5930. #define ATOM_S0_SYSTEM_POWER_STATE_VALUE_AC 1
  5931. #define ATOM_S0_SYSTEM_POWER_STATE_VALUE_DC 2
  5932. #define ATOM_S0_SYSTEM_POWER_STATE_VALUE_LITEAC 3
  5933. #define ATOM_S0_SYSTEM_POWER_STATE_VALUE_LIT2AC 4
  5934. //Byte aligned defintion for BIOS usage
  5935. #define ATOM_S0_CRT1_MONOb0 0x01
  5936. #define ATOM_S0_CRT1_COLORb0 0x02
  5937. #define ATOM_S0_CRT1_MASKb0 (ATOM_S0_CRT1_MONOb0+ATOM_S0_CRT1_COLORb0)
  5938. #define ATOM_S0_TV1_COMPOSITEb0 0x04
  5939. #define ATOM_S0_TV1_SVIDEOb0 0x08
  5940. #define ATOM_S0_TV1_MASKb0 (ATOM_S0_TV1_COMPOSITEb0+ATOM_S0_TV1_SVIDEOb0)
  5941. #define ATOM_S0_CVb0 0x10
  5942. #define ATOM_S0_CV_DINb0 0x20
  5943. #define ATOM_S0_CV_MASKb0 (ATOM_S0_CVb0+ATOM_S0_CV_DINb0)
  5944. #define ATOM_S0_CRT2_MONOb1 0x01
  5945. #define ATOM_S0_CRT2_COLORb1 0x02
  5946. #define ATOM_S0_CRT2_MASKb1 (ATOM_S0_CRT2_MONOb1+ATOM_S0_CRT2_COLORb1)
  5947. #define ATOM_S0_TV1_COMPOSITEb1 0x04
  5948. #define ATOM_S0_TV1_SVIDEOb1 0x08
  5949. #define ATOM_S0_TV1_SCARTb1 0x40
  5950. #define ATOM_S0_TV1_MASKb1 (ATOM_S0_TV1_COMPOSITEb1+ATOM_S0_TV1_SVIDEOb1+ATOM_S0_TV1_SCARTb1)
  5951. #define ATOM_S0_CVb1 0x10
  5952. #define ATOM_S0_CV_DINb1 0x20
  5953. #define ATOM_S0_CV_MASKb1 (ATOM_S0_CVb1+ATOM_S0_CV_DINb1)
  5954. #define ATOM_S0_DFP1b2 0x01
  5955. #define ATOM_S0_DFP2b2 0x02
  5956. #define ATOM_S0_LCD1b2 0x04
  5957. #define ATOM_S0_LCD2b2 0x08
  5958. #define ATOM_S0_DFP6b2 0x10
  5959. #define ATOM_S0_DFP3b2 0x20
  5960. #define ATOM_S0_DFP4b2 0x40
  5961. #define ATOM_S0_DFP5b2 0x80
  5962. #define ATOM_S0_THERMAL_STATE_MASKb3 0x1C
  5963. #define ATOM_S0_THERMAL_STATE_SHIFTb3 2
  5964. #define ATOM_S0_SYSTEM_POWER_STATE_MASKb3 0xE0
  5965. #define ATOM_S0_LCD1_SHIFT 18
  5966. // BIOS_1_SCRATCH Definition
  5967. #define ATOM_S1_ROM_LOCATION_MASK 0x0000FFFFL
  5968. #define ATOM_S1_PCI_BUS_DEV_MASK 0xFFFF0000L
  5969. // BIOS_2_SCRATCH Definition
  5970. #define ATOM_S2_TV1_STANDARD_MASK 0x0000000FL
  5971. #define ATOM_S2_CURRENT_BL_LEVEL_MASK 0x0000FF00L
  5972. #define ATOM_S2_CURRENT_BL_LEVEL_SHIFT 8
  5973. #define ATOM_S2_FORCEDLOWPWRMODE_STATE_MASK 0x0C000000L
  5974. #define ATOM_S2_FORCEDLOWPWRMODE_STATE_MASK_SHIFT 26
  5975. #define ATOM_S2_FORCEDLOWPWRMODE_STATE_CHANGE 0x10000000L
  5976. #define ATOM_S2_DEVICE_DPMS_STATE 0x00010000L
  5977. #define ATOM_S2_VRI_BRIGHT_ENABLE 0x20000000L
  5978. #define ATOM_S2_DISPLAY_ROTATION_0_DEGREE 0x0
  5979. #define ATOM_S2_DISPLAY_ROTATION_90_DEGREE 0x1
  5980. #define ATOM_S2_DISPLAY_ROTATION_180_DEGREE 0x2
  5981. #define ATOM_S2_DISPLAY_ROTATION_270_DEGREE 0x3
  5982. #define ATOM_S2_DISPLAY_ROTATION_DEGREE_SHIFT 30
  5983. #define ATOM_S2_DISPLAY_ROTATION_ANGLE_MASK 0xC0000000L
  5984. //Byte aligned defintion for BIOS usage
  5985. #define ATOM_S2_TV1_STANDARD_MASKb0 0x0F
  5986. #define ATOM_S2_CURRENT_BL_LEVEL_MASKb1 0xFF
  5987. #define ATOM_S2_DEVICE_DPMS_STATEb2 0x01
  5988. #define ATOM_S2_TMDS_COHERENT_MODEb3 0x10 // used by VBIOS code only, use coherent mode for TMDS/HDMI mode
  5989. #define ATOM_S2_VRI_BRIGHT_ENABLEb3 0x20
  5990. #define ATOM_S2_ROTATION_STATE_MASKb3 0xC0
  5991. // BIOS_3_SCRATCH Definition
  5992. #define ATOM_S3_CRT1_ACTIVE 0x00000001L
  5993. #define ATOM_S3_LCD1_ACTIVE 0x00000002L
  5994. #define ATOM_S3_TV1_ACTIVE 0x00000004L
  5995. #define ATOM_S3_DFP1_ACTIVE 0x00000008L
  5996. #define ATOM_S3_CRT2_ACTIVE 0x00000010L
  5997. #define ATOM_S3_LCD2_ACTIVE 0x00000020L
  5998. #define ATOM_S3_DFP6_ACTIVE 0x00000040L
  5999. #define ATOM_S3_DFP2_ACTIVE 0x00000080L
  6000. #define ATOM_S3_CV_ACTIVE 0x00000100L
  6001. #define ATOM_S3_DFP3_ACTIVE 0x00000200L
  6002. #define ATOM_S3_DFP4_ACTIVE 0x00000400L
  6003. #define ATOM_S3_DFP5_ACTIVE 0x00000800L
  6004. #define ATOM_S3_DEVICE_ACTIVE_MASK 0x00000FFFL
  6005. #define ATOM_S3_LCD_FULLEXPANSION_ACTIVE 0x00001000L
  6006. #define ATOM_S3_LCD_EXPANSION_ASPEC_RATIO_ACTIVE 0x00002000L
  6007. #define ATOM_S3_CRT1_CRTC_ACTIVE 0x00010000L
  6008. #define ATOM_S3_LCD1_CRTC_ACTIVE 0x00020000L
  6009. #define ATOM_S3_TV1_CRTC_ACTIVE 0x00040000L
  6010. #define ATOM_S3_DFP1_CRTC_ACTIVE 0x00080000L
  6011. #define ATOM_S3_CRT2_CRTC_ACTIVE 0x00100000L
  6012. #define ATOM_S3_LCD2_CRTC_ACTIVE 0x00200000L
  6013. #define ATOM_S3_DFP6_CRTC_ACTIVE 0x00400000L
  6014. #define ATOM_S3_DFP2_CRTC_ACTIVE 0x00800000L
  6015. #define ATOM_S3_CV_CRTC_ACTIVE 0x01000000L
  6016. #define ATOM_S3_DFP3_CRTC_ACTIVE 0x02000000L
  6017. #define ATOM_S3_DFP4_CRTC_ACTIVE 0x04000000L
  6018. #define ATOM_S3_DFP5_CRTC_ACTIVE 0x08000000L
  6019. #define ATOM_S3_DEVICE_CRTC_ACTIVE_MASK 0x0FFF0000L
  6020. #define ATOM_S3_ASIC_GUI_ENGINE_HUNG 0x20000000L
  6021. //Below two definitions are not supported in pplib, but in the old powerplay in DAL
  6022. #define ATOM_S3_ALLOW_FAST_PWR_SWITCH 0x40000000L
  6023. #define ATOM_S3_RQST_GPU_USE_MIN_PWR 0x80000000L
  6024. //Byte aligned defintion for BIOS usage
  6025. #define ATOM_S3_CRT1_ACTIVEb0 0x01
  6026. #define ATOM_S3_LCD1_ACTIVEb0 0x02
  6027. #define ATOM_S3_TV1_ACTIVEb0 0x04
  6028. #define ATOM_S3_DFP1_ACTIVEb0 0x08
  6029. #define ATOM_S3_CRT2_ACTIVEb0 0x10
  6030. #define ATOM_S3_LCD2_ACTIVEb0 0x20
  6031. #define ATOM_S3_DFP6_ACTIVEb0 0x40
  6032. #define ATOM_S3_DFP2_ACTIVEb0 0x80
  6033. #define ATOM_S3_CV_ACTIVEb1 0x01
  6034. #define ATOM_S3_DFP3_ACTIVEb1 0x02
  6035. #define ATOM_S3_DFP4_ACTIVEb1 0x04
  6036. #define ATOM_S3_DFP5_ACTIVEb1 0x08
  6037. #define ATOM_S3_ACTIVE_CRTC1w0 0xFFF
  6038. #define ATOM_S3_CRT1_CRTC_ACTIVEb2 0x01
  6039. #define ATOM_S3_LCD1_CRTC_ACTIVEb2 0x02
  6040. #define ATOM_S3_TV1_CRTC_ACTIVEb2 0x04
  6041. #define ATOM_S3_DFP1_CRTC_ACTIVEb2 0x08
  6042. #define ATOM_S3_CRT2_CRTC_ACTIVEb2 0x10
  6043. #define ATOM_S3_LCD2_CRTC_ACTIVEb2 0x20
  6044. #define ATOM_S3_DFP6_CRTC_ACTIVEb2 0x40
  6045. #define ATOM_S3_DFP2_CRTC_ACTIVEb2 0x80
  6046. #define ATOM_S3_CV_CRTC_ACTIVEb3 0x01
  6047. #define ATOM_S3_DFP3_CRTC_ACTIVEb3 0x02
  6048. #define ATOM_S3_DFP4_CRTC_ACTIVEb3 0x04
  6049. #define ATOM_S3_DFP5_CRTC_ACTIVEb3 0x08
  6050. #define ATOM_S3_ACTIVE_CRTC2w1 0xFFF
  6051. // BIOS_4_SCRATCH Definition
  6052. #define ATOM_S4_LCD1_PANEL_ID_MASK 0x000000FFL
  6053. #define ATOM_S4_LCD1_REFRESH_MASK 0x0000FF00L
  6054. #define ATOM_S4_LCD1_REFRESH_SHIFT 8
  6055. //Byte aligned defintion for BIOS usage
  6056. #define ATOM_S4_LCD1_PANEL_ID_MASKb0 0x0FF
  6057. #define ATOM_S4_LCD1_REFRESH_MASKb1 ATOM_S4_LCD1_PANEL_ID_MASKb0
  6058. #define ATOM_S4_VRAM_INFO_MASKb2 ATOM_S4_LCD1_PANEL_ID_MASKb0
  6059. // BIOS_5_SCRATCH Definition, BIOS_5_SCRATCH is used by Firmware only !!!!
  6060. #define ATOM_S5_DOS_REQ_CRT1b0 0x01
  6061. #define ATOM_S5_DOS_REQ_LCD1b0 0x02
  6062. #define ATOM_S5_DOS_REQ_TV1b0 0x04
  6063. #define ATOM_S5_DOS_REQ_DFP1b0 0x08
  6064. #define ATOM_S5_DOS_REQ_CRT2b0 0x10
  6065. #define ATOM_S5_DOS_REQ_LCD2b0 0x20
  6066. #define ATOM_S5_DOS_REQ_DFP6b0 0x40
  6067. #define ATOM_S5_DOS_REQ_DFP2b0 0x80
  6068. #define ATOM_S5_DOS_REQ_CVb1 0x01
  6069. #define ATOM_S5_DOS_REQ_DFP3b1 0x02
  6070. #define ATOM_S5_DOS_REQ_DFP4b1 0x04
  6071. #define ATOM_S5_DOS_REQ_DFP5b1 0x08
  6072. #define ATOM_S5_DOS_REQ_DEVICEw0 0x0FFF
  6073. #define ATOM_S5_DOS_REQ_CRT1 0x0001
  6074. #define ATOM_S5_DOS_REQ_LCD1 0x0002
  6075. #define ATOM_S5_DOS_REQ_TV1 0x0004
  6076. #define ATOM_S5_DOS_REQ_DFP1 0x0008
  6077. #define ATOM_S5_DOS_REQ_CRT2 0x0010
  6078. #define ATOM_S5_DOS_REQ_LCD2 0x0020
  6079. #define ATOM_S5_DOS_REQ_DFP6 0x0040
  6080. #define ATOM_S5_DOS_REQ_DFP2 0x0080
  6081. #define ATOM_S5_DOS_REQ_CV 0x0100
  6082. #define ATOM_S5_DOS_REQ_DFP3 0x0200
  6083. #define ATOM_S5_DOS_REQ_DFP4 0x0400
  6084. #define ATOM_S5_DOS_REQ_DFP5 0x0800
  6085. #define ATOM_S5_DOS_FORCE_CRT1b2 ATOM_S5_DOS_REQ_CRT1b0
  6086. #define ATOM_S5_DOS_FORCE_TV1b2 ATOM_S5_DOS_REQ_TV1b0
  6087. #define ATOM_S5_DOS_FORCE_CRT2b2 ATOM_S5_DOS_REQ_CRT2b0
  6088. #define ATOM_S5_DOS_FORCE_CVb3 ATOM_S5_DOS_REQ_CVb1
  6089. #define ATOM_S5_DOS_FORCE_DEVICEw1 (ATOM_S5_DOS_FORCE_CRT1b2+ATOM_S5_DOS_FORCE_TV1b2+ATOM_S5_DOS_FORCE_CRT2b2+\
  6090. (ATOM_S5_DOS_FORCE_CVb3<<8))
  6091. // BIOS_6_SCRATCH Definition
  6092. #define ATOM_S6_DEVICE_CHANGE 0x00000001L
  6093. #define ATOM_S6_SCALER_CHANGE 0x00000002L
  6094. #define ATOM_S6_LID_CHANGE 0x00000004L
  6095. #define ATOM_S6_DOCKING_CHANGE 0x00000008L
  6096. #define ATOM_S6_ACC_MODE 0x00000010L
  6097. #define ATOM_S6_EXT_DESKTOP_MODE 0x00000020L
  6098. #define ATOM_S6_LID_STATE 0x00000040L
  6099. #define ATOM_S6_DOCK_STATE 0x00000080L
  6100. #define ATOM_S6_CRITICAL_STATE 0x00000100L
  6101. #define ATOM_S6_HW_I2C_BUSY_STATE 0x00000200L
  6102. #define ATOM_S6_THERMAL_STATE_CHANGE 0x00000400L
  6103. #define ATOM_S6_INTERRUPT_SET_BY_BIOS 0x00000800L
  6104. #define ATOM_S6_REQ_LCD_EXPANSION_FULL 0x00001000L //Normal expansion Request bit for LCD
  6105. #define ATOM_S6_REQ_LCD_EXPANSION_ASPEC_RATIO 0x00002000L //Aspect ratio expansion Request bit for LCD
  6106. #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
  6107. #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
  6108. #define ATOM_S6_ACC_REQ_CRT1 0x00010000L
  6109. #define ATOM_S6_ACC_REQ_LCD1 0x00020000L
  6110. #define ATOM_S6_ACC_REQ_TV1 0x00040000L
  6111. #define ATOM_S6_ACC_REQ_DFP1 0x00080000L
  6112. #define ATOM_S6_ACC_REQ_CRT2 0x00100000L
  6113. #define ATOM_S6_ACC_REQ_LCD2 0x00200000L
  6114. #define ATOM_S6_ACC_REQ_DFP6 0x00400000L
  6115. #define ATOM_S6_ACC_REQ_DFP2 0x00800000L
  6116. #define ATOM_S6_ACC_REQ_CV 0x01000000L
  6117. #define ATOM_S6_ACC_REQ_DFP3 0x02000000L
  6118. #define ATOM_S6_ACC_REQ_DFP4 0x04000000L
  6119. #define ATOM_S6_ACC_REQ_DFP5 0x08000000L
  6120. #define ATOM_S6_ACC_REQ_MASK 0x0FFF0000L
  6121. #define ATOM_S6_SYSTEM_POWER_MODE_CHANGE 0x10000000L
  6122. #define ATOM_S6_ACC_BLOCK_DISPLAY_SWITCH 0x20000000L
  6123. #define ATOM_S6_VRI_BRIGHTNESS_CHANGE 0x40000000L
  6124. #define ATOM_S6_CONFIG_DISPLAY_CHANGE_MASK 0x80000000L
  6125. //Byte aligned defintion for BIOS usage
  6126. #define ATOM_S6_DEVICE_CHANGEb0 0x01
  6127. #define ATOM_S6_SCALER_CHANGEb0 0x02
  6128. #define ATOM_S6_LID_CHANGEb0 0x04
  6129. #define ATOM_S6_DOCKING_CHANGEb0 0x08
  6130. #define ATOM_S6_ACC_MODEb0 0x10
  6131. #define ATOM_S6_EXT_DESKTOP_MODEb0 0x20
  6132. #define ATOM_S6_LID_STATEb0 0x40
  6133. #define ATOM_S6_DOCK_STATEb0 0x80
  6134. #define ATOM_S6_CRITICAL_STATEb1 0x01
  6135. #define ATOM_S6_HW_I2C_BUSY_STATEb1 0x02
  6136. #define ATOM_S6_THERMAL_STATE_CHANGEb1 0x04
  6137. #define ATOM_S6_INTERRUPT_SET_BY_BIOSb1 0x08
  6138. #define ATOM_S6_REQ_LCD_EXPANSION_FULLb1 0x10
  6139. #define ATOM_S6_REQ_LCD_EXPANSION_ASPEC_RATIOb1 0x20
  6140. #define ATOM_S6_ACC_REQ_CRT1b2 0x01
  6141. #define ATOM_S6_ACC_REQ_LCD1b2 0x02
  6142. #define ATOM_S6_ACC_REQ_TV1b2 0x04
  6143. #define ATOM_S6_ACC_REQ_DFP1b2 0x08
  6144. #define ATOM_S6_ACC_REQ_CRT2b2 0x10
  6145. #define ATOM_S6_ACC_REQ_LCD2b2 0x20
  6146. #define ATOM_S6_ACC_REQ_DFP6b2 0x40
  6147. #define ATOM_S6_ACC_REQ_DFP2b2 0x80
  6148. #define ATOM_S6_ACC_REQ_CVb3 0x01
  6149. #define ATOM_S6_ACC_REQ_DFP3b3 0x02
  6150. #define ATOM_S6_ACC_REQ_DFP4b3 0x04
  6151. #define ATOM_S6_ACC_REQ_DFP5b3 0x08
  6152. #define ATOM_S6_ACC_REQ_DEVICEw1 ATOM_S5_DOS_REQ_DEVICEw0
  6153. #define ATOM_S6_SYSTEM_POWER_MODE_CHANGEb3 0x10
  6154. #define ATOM_S6_ACC_BLOCK_DISPLAY_SWITCHb3 0x20
  6155. #define ATOM_S6_VRI_BRIGHTNESS_CHANGEb3 0x40
  6156. #define ATOM_S6_CONFIG_DISPLAY_CHANGEb3 0x80
  6157. #define ATOM_S6_DEVICE_CHANGE_SHIFT 0
  6158. #define ATOM_S6_SCALER_CHANGE_SHIFT 1
  6159. #define ATOM_S6_LID_CHANGE_SHIFT 2
  6160. #define ATOM_S6_DOCKING_CHANGE_SHIFT 3
  6161. #define ATOM_S6_ACC_MODE_SHIFT 4
  6162. #define ATOM_S6_EXT_DESKTOP_MODE_SHIFT 5
  6163. #define ATOM_S6_LID_STATE_SHIFT 6
  6164. #define ATOM_S6_DOCK_STATE_SHIFT 7
  6165. #define ATOM_S6_CRITICAL_STATE_SHIFT 8
  6166. #define ATOM_S6_HW_I2C_BUSY_STATE_SHIFT 9
  6167. #define ATOM_S6_THERMAL_STATE_CHANGE_SHIFT 10
  6168. #define ATOM_S6_INTERRUPT_SET_BY_BIOS_SHIFT 11
  6169. #define ATOM_S6_REQ_SCALER_SHIFT 12
  6170. #define ATOM_S6_REQ_SCALER_ARATIO_SHIFT 13
  6171. #define ATOM_S6_DISPLAY_STATE_CHANGE_SHIFT 14
  6172. #define ATOM_S6_I2C_STATE_CHANGE_SHIFT 15
  6173. #define ATOM_S6_SYSTEM_POWER_MODE_CHANGE_SHIFT 28
  6174. #define ATOM_S6_ACC_BLOCK_DISPLAY_SWITCH_SHIFT 29
  6175. #define ATOM_S6_VRI_BRIGHTNESS_CHANGE_SHIFT 30
  6176. #define ATOM_S6_CONFIG_DISPLAY_CHANGE_SHIFT 31
  6177. // BIOS_7_SCRATCH Definition, BIOS_7_SCRATCH is used by Firmware only !!!!
  6178. #define ATOM_S7_DOS_MODE_TYPEb0 0x03
  6179. #define ATOM_S7_DOS_MODE_VGAb0 0x00
  6180. #define ATOM_S7_DOS_MODE_VESAb0 0x01
  6181. #define ATOM_S7_DOS_MODE_EXTb0 0x02
  6182. #define ATOM_S7_DOS_MODE_PIXEL_DEPTHb0 0x0C
  6183. #define ATOM_S7_DOS_MODE_PIXEL_FORMATb0 0xF0
  6184. #define ATOM_S7_DOS_8BIT_DAC_ENb1 0x01
  6185. #define ATOM_S7_ASIC_INIT_COMPLETEb1 0x02
  6186. #define ATOM_S7_ASIC_INIT_COMPLETE_MASK 0x00000200
  6187. #define ATOM_S7_DOS_MODE_NUMBERw1 0x0FFFF
  6188. #define ATOM_S7_DOS_8BIT_DAC_EN_SHIFT 8
  6189. // BIOS_8_SCRATCH Definition
  6190. #define ATOM_S8_I2C_CHANNEL_BUSY_MASK 0x00000FFFF
  6191. #define ATOM_S8_I2C_HW_ENGINE_BUSY_MASK 0x0FFFF0000
  6192. #define ATOM_S8_I2C_CHANNEL_BUSY_SHIFT 0
  6193. #define ATOM_S8_I2C_ENGINE_BUSY_SHIFT 16
  6194. // BIOS_9_SCRATCH Definition
  6195. #ifndef ATOM_S9_I2C_CHANNEL_COMPLETED_MASK
  6196. #define ATOM_S9_I2C_CHANNEL_COMPLETED_MASK 0x0000FFFF
  6197. #endif
  6198. #ifndef ATOM_S9_I2C_CHANNEL_ABORTED_MASK
  6199. #define ATOM_S9_I2C_CHANNEL_ABORTED_MASK 0xFFFF0000
  6200. #endif
  6201. #ifndef ATOM_S9_I2C_CHANNEL_COMPLETED_SHIFT
  6202. #define ATOM_S9_I2C_CHANNEL_COMPLETED_SHIFT 0
  6203. #endif
  6204. #ifndef ATOM_S9_I2C_CHANNEL_ABORTED_SHIFT
  6205. #define ATOM_S9_I2C_CHANNEL_ABORTED_SHIFT 16
  6206. #endif
  6207. #define ATOM_FLAG_SET 0x20
  6208. #define ATOM_FLAG_CLEAR 0
  6209. #define CLEAR_ATOM_S6_ACC_MODE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_ACC_MODE_SHIFT | ATOM_FLAG_CLEAR)
  6210. #define SET_ATOM_S6_DEVICE_CHANGE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_DEVICE_CHANGE_SHIFT | ATOM_FLAG_SET)
  6211. #define SET_ATOM_S6_VRI_BRIGHTNESS_CHANGE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_VRI_BRIGHTNESS_CHANGE_SHIFT | ATOM_FLAG_SET)
  6212. #define SET_ATOM_S6_SCALER_CHANGE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_SCALER_CHANGE_SHIFT | ATOM_FLAG_SET)
  6213. #define SET_ATOM_S6_LID_CHANGE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_LID_CHANGE_SHIFT | ATOM_FLAG_SET)
  6214. #define SET_ATOM_S6_LID_STATE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_LID_STATE_SHIFT | ATOM_FLAG_SET)
  6215. #define CLEAR_ATOM_S6_LID_STATE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_LID_STATE_SHIFT | ATOM_FLAG_CLEAR)
  6216. #define SET_ATOM_S6_DOCK_CHANGE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_DOCKING_CHANGE_SHIFT | ATOM_FLAG_SET)
  6217. #define SET_ATOM_S6_DOCK_STATE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_DOCK_STATE_SHIFT | ATOM_FLAG_SET)
  6218. #define CLEAR_ATOM_S6_DOCK_STATE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_DOCK_STATE_SHIFT | ATOM_FLAG_CLEAR)
  6219. #define SET_ATOM_S6_THERMAL_STATE_CHANGE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_THERMAL_STATE_CHANGE_SHIFT | ATOM_FLAG_SET)
  6220. #define SET_ATOM_S6_SYSTEM_POWER_MODE_CHANGE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_SYSTEM_POWER_MODE_CHANGE_SHIFT | ATOM_FLAG_SET)
  6221. #define SET_ATOM_S6_INTERRUPT_SET_BY_BIOS ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_INTERRUPT_SET_BY_BIOS_SHIFT | ATOM_FLAG_SET)
  6222. #define SET_ATOM_S6_CRITICAL_STATE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_CRITICAL_STATE_SHIFT | ATOM_FLAG_SET)
  6223. #define CLEAR_ATOM_S6_CRITICAL_STATE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_CRITICAL_STATE_SHIFT | ATOM_FLAG_CLEAR)
  6224. #define SET_ATOM_S6_REQ_SCALER ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_REQ_SCALER_SHIFT | ATOM_FLAG_SET)
  6225. #define CLEAR_ATOM_S6_REQ_SCALER ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_REQ_SCALER_SHIFT | ATOM_FLAG_CLEAR )
  6226. #define SET_ATOM_S6_REQ_SCALER_ARATIO ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_REQ_SCALER_ARATIO_SHIFT | ATOM_FLAG_SET )
  6227. #define CLEAR_ATOM_S6_REQ_SCALER_ARATIO ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_REQ_SCALER_ARATIO_SHIFT | ATOM_FLAG_CLEAR )
  6228. #define SET_ATOM_S6_I2C_STATE_CHANGE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_I2C_STATE_CHANGE_SHIFT | ATOM_FLAG_SET )
  6229. #define SET_ATOM_S6_DISPLAY_STATE_CHANGE ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_DISPLAY_STATE_CHANGE_SHIFT | ATOM_FLAG_SET )
  6230. #define SET_ATOM_S6_DEVICE_RECONFIG ((ATOM_ACC_CHANGE_INFO_DEF << 8 )|ATOM_S6_CONFIG_DISPLAY_CHANGE_SHIFT | ATOM_FLAG_SET)
  6231. #define CLEAR_ATOM_S0_LCD1 ((ATOM_DEVICE_CONNECT_INFO_DEF << 8 )| ATOM_S0_LCD1_SHIFT | ATOM_FLAG_CLEAR )
  6232. #define SET_ATOM_S7_DOS_8BIT_DAC_EN ((ATOM_DOS_MODE_INFO_DEF << 8 )|ATOM_S7_DOS_8BIT_DAC_EN_SHIFT | ATOM_FLAG_SET )
  6233. #define CLEAR_ATOM_S7_DOS_8BIT_DAC_EN ((ATOM_DOS_MODE_INFO_DEF << 8 )|ATOM_S7_DOS_8BIT_DAC_EN_SHIFT | ATOM_FLAG_CLEAR )
  6234. /****************************************************************************/
  6235. //Portion II: Definitinos only used in Driver
  6236. /****************************************************************************/
  6237. // Macros used by driver
  6238. #ifdef __cplusplus
  6239. #define GetIndexIntoMasterTable(MasterOrData, FieldName) ((reinterpret_cast<char*>(&(static_cast<ATOM_MASTER_LIST_OF_##MasterOrData##_TABLES*>(0))->FieldName)-static_cast<char*>(0))/sizeof(USHORT))
  6240. #define GET_COMMAND_TABLE_COMMANDSET_REVISION(TABLE_HEADER_OFFSET) (((static_cast<ATOM_COMMON_TABLE_HEADER*>(TABLE_HEADER_OFFSET))->ucTableFormatRevision )&0x3F)
  6241. #define GET_COMMAND_TABLE_PARAMETER_REVISION(TABLE_HEADER_OFFSET) (((static_cast<ATOM_COMMON_TABLE_HEADER*>(TABLE_HEADER_OFFSET))->ucTableContentRevision)&0x3F)
  6242. #else // not __cplusplus
  6243. #define GetIndexIntoMasterTable(MasterOrData, FieldName) (((char*)(&((ATOM_MASTER_LIST_OF_##MasterOrData##_TABLES*)0)->FieldName)-(char*)0)/sizeof(USHORT))
  6244. #define GET_COMMAND_TABLE_COMMANDSET_REVISION(TABLE_HEADER_OFFSET) ((((ATOM_COMMON_TABLE_HEADER*)TABLE_HEADER_OFFSET)->ucTableFormatRevision)&0x3F)
  6245. #define GET_COMMAND_TABLE_PARAMETER_REVISION(TABLE_HEADER_OFFSET) ((((ATOM_COMMON_TABLE_HEADER*)TABLE_HEADER_OFFSET)->ucTableContentRevision)&0x3F)
  6246. #endif // __cplusplus
  6247. #define GET_DATA_TABLE_MAJOR_REVISION GET_COMMAND_TABLE_COMMANDSET_REVISION
  6248. #define GET_DATA_TABLE_MINOR_REVISION GET_COMMAND_TABLE_PARAMETER_REVISION
  6249. /****************************************************************************/
  6250. //Portion III: Definitinos only used in VBIOS
  6251. /****************************************************************************/
  6252. #define ATOM_DAC_SRC 0x80
  6253. #define ATOM_SRC_DAC1 0
  6254. #define ATOM_SRC_DAC2 0x80
  6255. typedef struct _MEMORY_PLLINIT_PARAMETERS
  6256. {
  6257. ULONG ulTargetMemoryClock; //In 10Khz unit
  6258. UCHAR ucAction; //not define yet
  6259. UCHAR ucFbDiv_Hi; //Fbdiv Hi byte
  6260. UCHAR ucFbDiv; //FB value
  6261. UCHAR ucPostDiv; //Post div
  6262. }MEMORY_PLLINIT_PARAMETERS;
  6263. #define MEMORY_PLLINIT_PS_ALLOCATION MEMORY_PLLINIT_PARAMETERS
  6264. #define GPIO_PIN_WRITE 0x01
  6265. #define GPIO_PIN_READ 0x00
  6266. typedef struct _GPIO_PIN_CONTROL_PARAMETERS
  6267. {
  6268. UCHAR ucGPIO_ID; //return value, read from GPIO pins
  6269. UCHAR ucGPIOBitShift; //define which bit in uGPIOBitVal need to be update
  6270. UCHAR ucGPIOBitVal; //Set/Reset corresponding bit defined in ucGPIOBitMask
  6271. UCHAR ucAction; //=GPIO_PIN_WRITE: Read; =GPIO_PIN_READ: Write
  6272. }GPIO_PIN_CONTROL_PARAMETERS;
  6273. typedef struct _ENABLE_SCALER_PARAMETERS
  6274. {
  6275. UCHAR ucScaler; // ATOM_SCALER1, ATOM_SCALER2
  6276. UCHAR ucEnable; // ATOM_SCALER_DISABLE or ATOM_SCALER_CENTER or ATOM_SCALER_EXPANSION
  6277. UCHAR ucTVStandard; //
  6278. UCHAR ucPadding[1];
  6279. }ENABLE_SCALER_PARAMETERS;
  6280. #define ENABLE_SCALER_PS_ALLOCATION ENABLE_SCALER_PARAMETERS
  6281. //ucEnable:
  6282. #define SCALER_BYPASS_AUTO_CENTER_NO_REPLICATION 0
  6283. #define SCALER_BYPASS_AUTO_CENTER_AUTO_REPLICATION 1
  6284. #define SCALER_ENABLE_2TAP_ALPHA_MODE 2
  6285. #define SCALER_ENABLE_MULTITAP_MODE 3
  6286. typedef struct _ENABLE_HARDWARE_ICON_CURSOR_PARAMETERS
  6287. {
  6288. ULONG usHWIconHorzVertPosn; // Hardware Icon Vertical position
  6289. UCHAR ucHWIconVertOffset; // Hardware Icon Vertical offset
  6290. UCHAR ucHWIconHorzOffset; // Hardware Icon Horizontal offset
  6291. UCHAR ucSelection; // ATOM_CURSOR1 or ATOM_ICON1 or ATOM_CURSOR2 or ATOM_ICON2
  6292. UCHAR ucEnable; // ATOM_ENABLE or ATOM_DISABLE
  6293. }ENABLE_HARDWARE_ICON_CURSOR_PARAMETERS;
  6294. typedef struct _ENABLE_HARDWARE_ICON_CURSOR_PS_ALLOCATION
  6295. {
  6296. ENABLE_HARDWARE_ICON_CURSOR_PARAMETERS sEnableIcon;
  6297. ENABLE_CRTC_PARAMETERS sReserved;
  6298. }ENABLE_HARDWARE_ICON_CURSOR_PS_ALLOCATION;
  6299. typedef struct _ENABLE_GRAPH_SURFACE_PARAMETERS
  6300. {
  6301. USHORT usHight; // Image Hight
  6302. USHORT usWidth; // Image Width
  6303. UCHAR ucSurface; // Surface 1 or 2
  6304. UCHAR ucPadding[3];
  6305. }ENABLE_GRAPH_SURFACE_PARAMETERS;
  6306. typedef struct _ENABLE_GRAPH_SURFACE_PARAMETERS_V1_2
  6307. {
  6308. USHORT usHight; // Image Hight
  6309. USHORT usWidth; // Image Width
  6310. UCHAR ucSurface; // Surface 1 or 2
  6311. UCHAR ucEnable; // ATOM_ENABLE or ATOM_DISABLE
  6312. UCHAR ucPadding[2];
  6313. }ENABLE_GRAPH_SURFACE_PARAMETERS_V1_2;
  6314. typedef struct _ENABLE_GRAPH_SURFACE_PARAMETERS_V1_3
  6315. {
  6316. USHORT usHight; // Image Hight
  6317. USHORT usWidth; // Image Width
  6318. UCHAR ucSurface; // Surface 1 or 2
  6319. UCHAR ucEnable; // ATOM_ENABLE or ATOM_DISABLE
  6320. USHORT usDeviceId; // Active Device Id for this surface. If no device, set to 0.
  6321. }ENABLE_GRAPH_SURFACE_PARAMETERS_V1_3;
  6322. typedef struct _ENABLE_GRAPH_SURFACE_PARAMETERS_V1_4
  6323. {
  6324. USHORT usHight; // Image Hight
  6325. USHORT usWidth; // Image Width
  6326. USHORT usGraphPitch;
  6327. UCHAR ucColorDepth;
  6328. UCHAR ucPixelFormat;
  6329. UCHAR ucSurface; // Surface 1 or 2
  6330. UCHAR ucEnable; // ATOM_ENABLE or ATOM_DISABLE
  6331. UCHAR ucModeType;
  6332. UCHAR ucReserved;
  6333. }ENABLE_GRAPH_SURFACE_PARAMETERS_V1_4;
  6334. // ucEnable
  6335. #define ATOM_GRAPH_CONTROL_SET_PITCH 0x0f
  6336. #define ATOM_GRAPH_CONTROL_SET_DISP_START 0x10
  6337. typedef struct _ENABLE_GRAPH_SURFACE_PS_ALLOCATION
  6338. {
  6339. ENABLE_GRAPH_SURFACE_PARAMETERS sSetSurface;
  6340. ENABLE_YUV_PS_ALLOCATION sReserved; // Don't set this one
  6341. }ENABLE_GRAPH_SURFACE_PS_ALLOCATION;
  6342. typedef struct _MEMORY_CLEAN_UP_PARAMETERS
  6343. {
  6344. USHORT usMemoryStart; //in 8Kb boundry, offset from memory base address
  6345. USHORT usMemorySize; //8Kb blocks aligned
  6346. }MEMORY_CLEAN_UP_PARAMETERS;
  6347. #define MEMORY_CLEAN_UP_PS_ALLOCATION MEMORY_CLEAN_UP_PARAMETERS
  6348. typedef struct _GET_DISPLAY_SURFACE_SIZE_PARAMETERS
  6349. {
  6350. USHORT usX_Size; //When use as input parameter, usX_Size indicates which CRTC
  6351. USHORT usY_Size;
  6352. }GET_DISPLAY_SURFACE_SIZE_PARAMETERS;
  6353. typedef struct _GET_DISPLAY_SURFACE_SIZE_PARAMETERS_V2
  6354. {
  6355. union{
  6356. USHORT usX_Size; //When use as input parameter, usX_Size indicates which CRTC
  6357. USHORT usSurface;
  6358. };
  6359. USHORT usY_Size;
  6360. USHORT usDispXStart;
  6361. USHORT usDispYStart;
  6362. }GET_DISPLAY_SURFACE_SIZE_PARAMETERS_V2;
  6363. typedef struct _PALETTE_DATA_CONTROL_PARAMETERS_V3
  6364. {
  6365. UCHAR ucLutId;
  6366. UCHAR ucAction;
  6367. USHORT usLutStartIndex;
  6368. USHORT usLutLength;
  6369. USHORT usLutOffsetInVram;
  6370. }PALETTE_DATA_CONTROL_PARAMETERS_V3;
  6371. // ucAction:
  6372. #define PALETTE_DATA_AUTO_FILL 1
  6373. #define PALETTE_DATA_READ 2
  6374. #define PALETTE_DATA_WRITE 3
  6375. typedef struct _INTERRUPT_SERVICE_PARAMETERS_V2
  6376. {
  6377. UCHAR ucInterruptId;
  6378. UCHAR ucServiceId;
  6379. UCHAR ucStatus;
  6380. UCHAR ucReserved;
  6381. }INTERRUPT_SERVICE_PARAMETER_V2;
  6382. // ucInterruptId
  6383. #define HDP1_INTERRUPT_ID 1
  6384. #define HDP2_INTERRUPT_ID 2
  6385. #define HDP3_INTERRUPT_ID 3
  6386. #define HDP4_INTERRUPT_ID 4
  6387. #define HDP5_INTERRUPT_ID 5
  6388. #define HDP6_INTERRUPT_ID 6
  6389. #define SW_INTERRUPT_ID 11
  6390. // ucAction
  6391. #define INTERRUPT_SERVICE_GEN_SW_INT 1
  6392. #define INTERRUPT_SERVICE_GET_STATUS 2
  6393. // ucStatus
  6394. #define INTERRUPT_STATUS__INT_TRIGGER 1
  6395. #define INTERRUPT_STATUS__HPD_HIGH 2
  6396. typedef struct _EFUSE_INPUT_PARAMETER
  6397. {
  6398. USHORT usEfuseIndex;
  6399. UCHAR ucBitShift;
  6400. UCHAR ucBitLength;
  6401. }EFUSE_INPUT_PARAMETER;
  6402. // ReadEfuseValue command table input/output parameter
  6403. typedef union _READ_EFUSE_VALUE_PARAMETER
  6404. {
  6405. EFUSE_INPUT_PARAMETER sEfuse;
  6406. ULONG ulEfuseValue;
  6407. }READ_EFUSE_VALUE_PARAMETER;
  6408. typedef struct _INDIRECT_IO_ACCESS
  6409. {
  6410. ATOM_COMMON_TABLE_HEADER sHeader;
  6411. UCHAR IOAccessSequence[256];
  6412. } INDIRECT_IO_ACCESS;
  6413. #define INDIRECT_READ 0x00
  6414. #define INDIRECT_WRITE 0x80
  6415. #define INDIRECT_IO_MM 0
  6416. #define INDIRECT_IO_PLL 1
  6417. #define INDIRECT_IO_MC 2
  6418. #define INDIRECT_IO_PCIE 3
  6419. #define INDIRECT_IO_PCIEP 4
  6420. #define INDIRECT_IO_NBMISC 5
  6421. #define INDIRECT_IO_SMU 5
  6422. #define INDIRECT_IO_PLL_READ INDIRECT_IO_PLL | INDIRECT_READ
  6423. #define INDIRECT_IO_PLL_WRITE INDIRECT_IO_PLL | INDIRECT_WRITE
  6424. #define INDIRECT_IO_MC_READ INDIRECT_IO_MC | INDIRECT_READ
  6425. #define INDIRECT_IO_MC_WRITE INDIRECT_IO_MC | INDIRECT_WRITE
  6426. #define INDIRECT_IO_PCIE_READ INDIRECT_IO_PCIE | INDIRECT_READ
  6427. #define INDIRECT_IO_PCIE_WRITE INDIRECT_IO_PCIE | INDIRECT_WRITE
  6428. #define INDIRECT_IO_PCIEP_READ INDIRECT_IO_PCIEP | INDIRECT_READ
  6429. #define INDIRECT_IO_PCIEP_WRITE INDIRECT_IO_PCIEP | INDIRECT_WRITE
  6430. #define INDIRECT_IO_NBMISC_READ INDIRECT_IO_NBMISC | INDIRECT_READ
  6431. #define INDIRECT_IO_NBMISC_WRITE INDIRECT_IO_NBMISC | INDIRECT_WRITE
  6432. #define INDIRECT_IO_SMU_READ INDIRECT_IO_SMU | INDIRECT_READ
  6433. #define INDIRECT_IO_SMU_WRITE INDIRECT_IO_SMU | INDIRECT_WRITE
  6434. typedef struct _ATOM_OEM_INFO
  6435. {
  6436. ATOM_COMMON_TABLE_HEADER sHeader;
  6437. ATOM_I2C_ID_CONFIG_ACCESS sucI2cId;
  6438. }ATOM_OEM_INFO;
  6439. typedef struct _ATOM_TV_MODE
  6440. {
  6441. UCHAR ucVMode_Num; //Video mode number
  6442. UCHAR ucTV_Mode_Num; //Internal TV mode number
  6443. }ATOM_TV_MODE;
  6444. typedef struct _ATOM_BIOS_INT_TVSTD_MODE
  6445. {
  6446. ATOM_COMMON_TABLE_HEADER sHeader;
  6447. USHORT usTV_Mode_LUT_Offset; // Pointer to standard to internal number conversion table
  6448. USHORT usTV_FIFO_Offset; // Pointer to FIFO entry table
  6449. USHORT usNTSC_Tbl_Offset; // Pointer to SDTV_Mode_NTSC table
  6450. USHORT usPAL_Tbl_Offset; // Pointer to SDTV_Mode_PAL table
  6451. USHORT usCV_Tbl_Offset; // Pointer to SDTV_Mode_PAL table
  6452. }ATOM_BIOS_INT_TVSTD_MODE;
  6453. typedef struct _ATOM_TV_MODE_SCALER_PTR
  6454. {
  6455. USHORT ucFilter0_Offset; //Pointer to filter format 0 coefficients
  6456. USHORT usFilter1_Offset; //Pointer to filter format 0 coefficients
  6457. UCHAR ucTV_Mode_Num;
  6458. }ATOM_TV_MODE_SCALER_PTR;
  6459. typedef struct _ATOM_STANDARD_VESA_TIMING
  6460. {
  6461. ATOM_COMMON_TABLE_HEADER sHeader;
  6462. ATOM_DTD_FORMAT aModeTimings[16]; // 16 is not the real array number, just for initial allocation
  6463. }ATOM_STANDARD_VESA_TIMING;
  6464. typedef struct _ATOM_STD_FORMAT
  6465. {
  6466. USHORT usSTD_HDisp;
  6467. USHORT usSTD_VDisp;
  6468. USHORT usSTD_RefreshRate;
  6469. USHORT usReserved;
  6470. }ATOM_STD_FORMAT;
  6471. typedef struct _ATOM_VESA_TO_EXTENDED_MODE
  6472. {
  6473. USHORT usVESA_ModeNumber;
  6474. USHORT usExtendedModeNumber;
  6475. }ATOM_VESA_TO_EXTENDED_MODE;
  6476. typedef struct _ATOM_VESA_TO_INTENAL_MODE_LUT
  6477. {
  6478. ATOM_COMMON_TABLE_HEADER sHeader;
  6479. ATOM_VESA_TO_EXTENDED_MODE asVESA_ToExtendedModeInfo[76];
  6480. }ATOM_VESA_TO_INTENAL_MODE_LUT;
  6481. /*************** ATOM Memory Related Data Structure ***********************/
  6482. typedef struct _ATOM_MEMORY_VENDOR_BLOCK{
  6483. UCHAR ucMemoryType;
  6484. UCHAR ucMemoryVendor;
  6485. UCHAR ucAdjMCId;
  6486. UCHAR ucDynClkId;
  6487. ULONG ulDllResetClkRange;
  6488. }ATOM_MEMORY_VENDOR_BLOCK;
  6489. typedef struct _ATOM_MEMORY_SETTING_ID_CONFIG{
  6490. #if ATOM_BIG_ENDIAN
  6491. ULONG ucMemBlkId:8;
  6492. ULONG ulMemClockRange:24;
  6493. #else
  6494. ULONG ulMemClockRange:24;
  6495. ULONG ucMemBlkId:8;
  6496. #endif
  6497. }ATOM_MEMORY_SETTING_ID_CONFIG;
  6498. typedef union _ATOM_MEMORY_SETTING_ID_CONFIG_ACCESS
  6499. {
  6500. ATOM_MEMORY_SETTING_ID_CONFIG slAccess;
  6501. ULONG ulAccess;
  6502. }ATOM_MEMORY_SETTING_ID_CONFIG_ACCESS;
  6503. typedef struct _ATOM_MEMORY_SETTING_DATA_BLOCK{
  6504. ATOM_MEMORY_SETTING_ID_CONFIG_ACCESS ulMemoryID;
  6505. ULONG aulMemData[1];
  6506. }ATOM_MEMORY_SETTING_DATA_BLOCK;
  6507. typedef struct _ATOM_INIT_REG_INDEX_FORMAT{
  6508. USHORT usRegIndex; // MC register index
  6509. UCHAR ucPreRegDataLength; // offset in ATOM_INIT_REG_DATA_BLOCK.saRegDataBuf
  6510. }ATOM_INIT_REG_INDEX_FORMAT;
  6511. typedef struct _ATOM_INIT_REG_BLOCK{
  6512. USHORT usRegIndexTblSize; //size of asRegIndexBuf
  6513. USHORT usRegDataBlkSize; //size of ATOM_MEMORY_SETTING_DATA_BLOCK
  6514. ATOM_INIT_REG_INDEX_FORMAT asRegIndexBuf[1];
  6515. ATOM_MEMORY_SETTING_DATA_BLOCK asRegDataBuf[1];
  6516. }ATOM_INIT_REG_BLOCK;
  6517. #define END_OF_REG_INDEX_BLOCK 0x0ffff
  6518. #define END_OF_REG_DATA_BLOCK 0x00000000
  6519. #define ATOM_INIT_REG_MASK_FLAG 0x80 //Not used in BIOS
  6520. #define CLOCK_RANGE_HIGHEST 0x00ffffff
  6521. #define VALUE_DWORD SIZEOF ULONG
  6522. #define VALUE_SAME_AS_ABOVE 0
  6523. #define VALUE_MASK_DWORD 0x84
  6524. #define INDEX_ACCESS_RANGE_BEGIN (VALUE_DWORD + 1)
  6525. #define INDEX_ACCESS_RANGE_END (INDEX_ACCESS_RANGE_BEGIN + 1)
  6526. #define VALUE_INDEX_ACCESS_SINGLE (INDEX_ACCESS_RANGE_END + 1)
  6527. //#define ACCESS_MCIODEBUGIND 0x40 //defined in BIOS code
  6528. #define ACCESS_PLACEHOLDER 0x80
  6529. typedef struct _ATOM_MC_INIT_PARAM_TABLE
  6530. {
  6531. ATOM_COMMON_TABLE_HEADER sHeader;
  6532. USHORT usAdjustARB_SEQDataOffset;
  6533. USHORT usMCInitMemTypeTblOffset;
  6534. USHORT usMCInitCommonTblOffset;
  6535. USHORT usMCInitPowerDownTblOffset;
  6536. ULONG ulARB_SEQDataBuf[32];
  6537. ATOM_INIT_REG_BLOCK asMCInitMemType;
  6538. ATOM_INIT_REG_BLOCK asMCInitCommon;
  6539. }ATOM_MC_INIT_PARAM_TABLE;
  6540. typedef struct _ATOM_REG_INIT_SETTING
  6541. {
  6542. USHORT usRegIndex;
  6543. ULONG ulRegValue;
  6544. }ATOM_REG_INIT_SETTING;
  6545. typedef struct _ATOM_MC_INIT_PARAM_TABLE_V2_1
  6546. {
  6547. ATOM_COMMON_TABLE_HEADER sHeader;
  6548. ULONG ulMCUcodeVersion;
  6549. ULONG ulMCUcodeRomStartAddr;
  6550. ULONG ulMCUcodeLength;
  6551. USHORT usMcRegInitTableOffset; // offset of ATOM_REG_INIT_SETTING array for MC core register settings.
  6552. USHORT usReserved; // offset of ATOM_INIT_REG_BLOCK for MC SEQ/PHY register setting
  6553. }ATOM_MC_INIT_PARAM_TABLE_V2_1;
  6554. #define _4Mx16 0x2
  6555. #define _4Mx32 0x3
  6556. #define _8Mx16 0x12
  6557. #define _8Mx32 0x13
  6558. #define _8Mx128 0x15
  6559. #define _16Mx16 0x22
  6560. #define _16Mx32 0x23
  6561. #define _16Mx128 0x25
  6562. #define _32Mx16 0x32
  6563. #define _32Mx32 0x33
  6564. #define _32Mx128 0x35
  6565. #define _64Mx8 0x41
  6566. #define _64Mx16 0x42
  6567. #define _64Mx32 0x43
  6568. #define _64Mx128 0x45
  6569. #define _128Mx8 0x51
  6570. #define _128Mx16 0x52
  6571. #define _128Mx32 0x53
  6572. #define _256Mx8 0x61
  6573. #define _256Mx16 0x62
  6574. #define _256Mx32 0x63
  6575. #define _512Mx8 0x71
  6576. #define _512Mx16 0x72
  6577. #define SAMSUNG 0x1
  6578. #define INFINEON 0x2
  6579. #define ELPIDA 0x3
  6580. #define ETRON 0x4
  6581. #define NANYA 0x5
  6582. #define HYNIX 0x6
  6583. #define MOSEL 0x7
  6584. #define WINBOND 0x8
  6585. #define ESMT 0x9
  6586. #define MICRON 0xF
  6587. #define QIMONDA INFINEON
  6588. #define PROMOS MOSEL
  6589. #define KRETON INFINEON
  6590. #define ELIXIR NANYA
  6591. #define MEZZA ELPIDA
  6592. /////////////Support for GDDR5 MC uCode to reside in upper 64K of ROM/////////////
  6593. #define UCODE_ROM_START_ADDRESS 0x1b800
  6594. #define UCODE_SIGNATURE 0x4375434d // 'MCuC' - MC uCode
  6595. //uCode block header for reference
  6596. typedef struct _MCuCodeHeader
  6597. {
  6598. ULONG ulSignature;
  6599. UCHAR ucRevision;
  6600. UCHAR ucChecksum;
  6601. UCHAR ucReserved1;
  6602. UCHAR ucReserved2;
  6603. USHORT usParametersLength;
  6604. USHORT usUCodeLength;
  6605. USHORT usReserved1;
  6606. USHORT usReserved2;
  6607. } MCuCodeHeader;
  6608. //////////////////////////////////////////////////////////////////////////////////
  6609. #define ATOM_MAX_NUMBER_OF_VRAM_MODULE 16
  6610. #define ATOM_VRAM_MODULE_MEMORY_VENDOR_ID_MASK 0xF
  6611. typedef struct _ATOM_VRAM_MODULE_V1
  6612. {
  6613. ULONG ulReserved;
  6614. USHORT usEMRSValue;
  6615. USHORT usMRSValue;
  6616. USHORT usReserved;
  6617. UCHAR ucExtMemoryID; // An external indicator (by hardcode, callback or pin) to tell what is the current memory module
  6618. UCHAR ucMemoryType; // [7:4]=0x1:DDR1;=0x2:DDR2;=0x3:DDR3;=0x4:DDR4;[3:0] reserved;
  6619. UCHAR ucMemoryVenderID; // Predefined,never change across designs or memory type/vender
  6620. UCHAR ucMemoryDeviceCfg; // [7:4]=0x0:4M;=0x1:8M;=0x2:16M;0x3:32M....[3:0]=0x0:x4;=0x1:x8;=0x2:x16;=0x3:x32...
  6621. UCHAR ucRow; // Number of Row,in power of 2;
  6622. UCHAR ucColumn; // Number of Column,in power of 2;
  6623. UCHAR ucBank; // Nunber of Bank;
  6624. UCHAR ucRank; // Number of Rank, in power of 2
  6625. UCHAR ucChannelNum; // Number of channel;
  6626. UCHAR ucChannelConfig; // [3:0]=Indication of what channel combination;[4:7]=Channel bit width, in number of 2
  6627. UCHAR ucDefaultMVDDQ_ID; // Default MVDDQ setting for this memory block, ID linking to MVDDQ info table to find real set-up data;
  6628. UCHAR ucDefaultMVDDC_ID; // Default MVDDC setting for this memory block, ID linking to MVDDC info table to find real set-up data;
  6629. UCHAR ucReserved[2];
  6630. }ATOM_VRAM_MODULE_V1;
  6631. typedef struct _ATOM_VRAM_MODULE_V2
  6632. {
  6633. ULONG ulReserved;
  6634. ULONG ulFlags; // To enable/disable functionalities based on memory type
  6635. ULONG ulEngineClock; // Override of default engine clock for particular memory type
  6636. ULONG ulMemoryClock; // Override of default memory clock for particular memory type
  6637. USHORT usEMRS2Value; // EMRS2 Value is used for GDDR2 and GDDR4 memory type
  6638. USHORT usEMRS3Value; // EMRS3 Value is used for GDDR2 and GDDR4 memory type
  6639. USHORT usEMRSValue;
  6640. USHORT usMRSValue;
  6641. USHORT usReserved;
  6642. UCHAR ucExtMemoryID; // An external indicator (by hardcode, callback or pin) to tell what is the current memory module
  6643. UCHAR ucMemoryType; // [7:4]=0x1:DDR1;=0x2:DDR2;=0x3:DDR3;=0x4:DDR4;[3:0] - must not be used for now;
  6644. UCHAR ucMemoryVenderID; // Predefined,never change across designs or memory type/vender. If not predefined, vendor detection table gets executed
  6645. UCHAR ucMemoryDeviceCfg; // [7:4]=0x0:4M;=0x1:8M;=0x2:16M;0x3:32M....[3:0]=0x0:x4;=0x1:x8;=0x2:x16;=0x3:x32...
  6646. UCHAR ucRow; // Number of Row,in power of 2;
  6647. UCHAR ucColumn; // Number of Column,in power of 2;
  6648. UCHAR ucBank; // Nunber of Bank;
  6649. UCHAR ucRank; // Number of Rank, in power of 2
  6650. UCHAR ucChannelNum; // Number of channel;
  6651. UCHAR ucChannelConfig; // [3:0]=Indication of what channel combination;[4:7]=Channel bit width, in number of 2
  6652. UCHAR ucDefaultMVDDQ_ID; // Default MVDDQ setting for this memory block, ID linking to MVDDQ info table to find real set-up data;
  6653. UCHAR ucDefaultMVDDC_ID; // Default MVDDC setting for this memory block, ID linking to MVDDC info table to find real set-up data;
  6654. UCHAR ucRefreshRateFactor;
  6655. UCHAR ucReserved[3];
  6656. }ATOM_VRAM_MODULE_V2;
  6657. typedef struct _ATOM_MEMORY_TIMING_FORMAT
  6658. {
  6659. ULONG ulClkRange; // memory clock in 10kHz unit, when target memory clock is below this clock, use this memory timing
  6660. union{
  6661. USHORT usMRS; // mode register
  6662. USHORT usDDR3_MR0;
  6663. };
  6664. union{
  6665. USHORT usEMRS; // extended mode register
  6666. USHORT usDDR3_MR1;
  6667. };
  6668. UCHAR ucCL; // CAS latency
  6669. UCHAR ucWL; // WRITE Latency
  6670. UCHAR uctRAS; // tRAS
  6671. UCHAR uctRC; // tRC
  6672. UCHAR uctRFC; // tRFC
  6673. UCHAR uctRCDR; // tRCDR
  6674. UCHAR uctRCDW; // tRCDW
  6675. UCHAR uctRP; // tRP
  6676. UCHAR uctRRD; // tRRD
  6677. UCHAR uctWR; // tWR
  6678. UCHAR uctWTR; // tWTR
  6679. UCHAR uctPDIX; // tPDIX
  6680. UCHAR uctFAW; // tFAW
  6681. UCHAR uctAOND; // tAOND
  6682. union
  6683. {
  6684. struct {
  6685. UCHAR ucflag; // flag to control memory timing calculation. bit0= control EMRS2 Infineon
  6686. UCHAR ucReserved;
  6687. };
  6688. USHORT usDDR3_MR2;
  6689. };
  6690. }ATOM_MEMORY_TIMING_FORMAT;
  6691. typedef struct _ATOM_MEMORY_TIMING_FORMAT_V1
  6692. {
  6693. ULONG ulClkRange; // memory clock in 10kHz unit, when target memory clock is below this clock, use this memory timing
  6694. USHORT usMRS; // mode register
  6695. USHORT usEMRS; // extended mode register
  6696. UCHAR ucCL; // CAS latency
  6697. UCHAR ucWL; // WRITE Latency
  6698. UCHAR uctRAS; // tRAS
  6699. UCHAR uctRC; // tRC
  6700. UCHAR uctRFC; // tRFC
  6701. UCHAR uctRCDR; // tRCDR
  6702. UCHAR uctRCDW; // tRCDW
  6703. UCHAR uctRP; // tRP
  6704. UCHAR uctRRD; // tRRD
  6705. UCHAR uctWR; // tWR
  6706. UCHAR uctWTR; // tWTR
  6707. UCHAR uctPDIX; // tPDIX
  6708. UCHAR uctFAW; // tFAW
  6709. UCHAR uctAOND; // tAOND
  6710. UCHAR ucflag; // flag to control memory timing calculation. bit0= control EMRS2 Infineon
  6711. ////////////////////////////////////GDDR parameters///////////////////////////////////
  6712. UCHAR uctCCDL; //
  6713. UCHAR uctCRCRL; //
  6714. UCHAR uctCRCWL; //
  6715. UCHAR uctCKE; //
  6716. UCHAR uctCKRSE; //
  6717. UCHAR uctCKRSX; //
  6718. UCHAR uctFAW32; //
  6719. UCHAR ucMR5lo; //
  6720. UCHAR ucMR5hi; //
  6721. UCHAR ucTerminator;
  6722. }ATOM_MEMORY_TIMING_FORMAT_V1;
  6723. typedef struct _ATOM_MEMORY_TIMING_FORMAT_V2
  6724. {
  6725. ULONG ulClkRange; // memory clock in 10kHz unit, when target memory clock is below this clock, use this memory timing
  6726. USHORT usMRS; // mode register
  6727. USHORT usEMRS; // extended mode register
  6728. UCHAR ucCL; // CAS latency
  6729. UCHAR ucWL; // WRITE Latency
  6730. UCHAR uctRAS; // tRAS
  6731. UCHAR uctRC; // tRC
  6732. UCHAR uctRFC; // tRFC
  6733. UCHAR uctRCDR; // tRCDR
  6734. UCHAR uctRCDW; // tRCDW
  6735. UCHAR uctRP; // tRP
  6736. UCHAR uctRRD; // tRRD
  6737. UCHAR uctWR; // tWR
  6738. UCHAR uctWTR; // tWTR
  6739. UCHAR uctPDIX; // tPDIX
  6740. UCHAR uctFAW; // tFAW
  6741. UCHAR uctAOND; // tAOND
  6742. UCHAR ucflag; // flag to control memory timing calculation. bit0= control EMRS2 Infineon
  6743. ////////////////////////////////////GDDR parameters///////////////////////////////////
  6744. UCHAR uctCCDL; //
  6745. UCHAR uctCRCRL; //
  6746. UCHAR uctCRCWL; //
  6747. UCHAR uctCKE; //
  6748. UCHAR uctCKRSE; //
  6749. UCHAR uctCKRSX; //
  6750. UCHAR uctFAW32; //
  6751. UCHAR ucMR4lo; //
  6752. UCHAR ucMR4hi; //
  6753. UCHAR ucMR5lo; //
  6754. UCHAR ucMR5hi; //
  6755. UCHAR ucTerminator;
  6756. UCHAR ucReserved;
  6757. }ATOM_MEMORY_TIMING_FORMAT_V2;
  6758. typedef struct _ATOM_MEMORY_FORMAT
  6759. {
  6760. ULONG ulDllDisClock; // memory DLL will be disable when target memory clock is below this clock
  6761. union{
  6762. USHORT usEMRS2Value; // EMRS2 Value is used for GDDR2 and GDDR4 memory type
  6763. USHORT usDDR3_Reserved; // Not used for DDR3 memory
  6764. };
  6765. union{
  6766. USHORT usEMRS3Value; // EMRS3 Value is used for GDDR2 and GDDR4 memory type
  6767. USHORT usDDR3_MR3; // Used for DDR3 memory
  6768. };
  6769. UCHAR ucMemoryType; // [7:4]=0x1:DDR1;=0x2:DDR2;=0x3:DDR3;=0x4:DDR4;[3:0] - must not be used for now;
  6770. UCHAR ucMemoryVenderID; // Predefined,never change across designs or memory type/vender. If not predefined, vendor detection table gets executed
  6771. UCHAR ucRow; // Number of Row,in power of 2;
  6772. UCHAR ucColumn; // Number of Column,in power of 2;
  6773. UCHAR ucBank; // Nunber of Bank;
  6774. UCHAR ucRank; // Number of Rank, in power of 2
  6775. UCHAR ucBurstSize; // burst size, 0= burst size=4 1= burst size=8
  6776. UCHAR ucDllDisBit; // position of DLL Enable/Disable bit in EMRS ( Extended Mode Register )
  6777. UCHAR ucRefreshRateFactor; // memory refresh rate in unit of ms
  6778. UCHAR ucDensity; // _8Mx32, _16Mx32, _16Mx16, _32Mx16
  6779. UCHAR ucPreamble; // [7:4] Write Preamble, [3:0] Read Preamble
  6780. UCHAR ucMemAttrib; // Memory Device Addribute, like RDBI/WDBI etc
  6781. ATOM_MEMORY_TIMING_FORMAT asMemTiming[5]; // Memory Timing block sort from lower clock to higher clock
  6782. }ATOM_MEMORY_FORMAT;
  6783. typedef struct _ATOM_VRAM_MODULE_V3
  6784. {
  6785. ULONG ulChannelMapCfg; // board dependent paramenter:Channel combination
  6786. USHORT usSize; // size of ATOM_VRAM_MODULE_V3
  6787. USHORT usDefaultMVDDQ; // board dependent parameter:Default Memory Core Voltage
  6788. USHORT usDefaultMVDDC; // board dependent parameter:Default Memory IO Voltage
  6789. UCHAR ucExtMemoryID; // An external indicator (by hardcode, callback or pin) to tell what is the current memory module
  6790. UCHAR ucChannelNum; // board dependent parameter:Number of channel;
  6791. UCHAR ucChannelSize; // board dependent parameter:32bit or 64bit
  6792. UCHAR ucVREFI; // board dependnt parameter: EXT or INT +160mv to -140mv
  6793. UCHAR ucNPL_RT; // board dependent parameter:NPL round trip delay, used for calculate memory timing parameters
  6794. UCHAR ucFlag; // To enable/disable functionalities based on memory type
  6795. ATOM_MEMORY_FORMAT asMemory; // describ all of video memory parameters from memory spec
  6796. }ATOM_VRAM_MODULE_V3;
  6797. //ATOM_VRAM_MODULE_V3.ucNPL_RT
  6798. #define NPL_RT_MASK 0x0f
  6799. #define BATTERY_ODT_MASK 0xc0
  6800. #define ATOM_VRAM_MODULE ATOM_VRAM_MODULE_V3
  6801. typedef struct _ATOM_VRAM_MODULE_V4
  6802. {
  6803. ULONG ulChannelMapCfg; // board dependent parameter: Channel combination
  6804. USHORT usModuleSize; // size of ATOM_VRAM_MODULE_V4, make it easy for VBIOS to look for next entry of VRAM_MODULE
  6805. USHORT usPrivateReserved; // BIOS internal reserved space to optimize code size, updated by the compiler, shouldn't be modified manually!!
  6806. // MC_ARB_RAMCFG (includes NOOFBANK,NOOFRANKS,NOOFROWS,NOOFCOLS)
  6807. USHORT usReserved;
  6808. UCHAR ucExtMemoryID; // An external indicator (by hardcode, callback or pin) to tell what is the current memory module
  6809. UCHAR ucMemoryType; // [7:4]=0x1:DDR1;=0x2:DDR2;=0x3:DDR3;=0x4:DDR4; 0x5:DDR5 [3:0] - Must be 0x0 for now;
  6810. UCHAR ucChannelNum; // Number of channels present in this module config
  6811. UCHAR ucChannelWidth; // 0 - 32 bits; 1 - 64 bits
  6812. UCHAR ucDensity; // _8Mx32, _16Mx32, _16Mx16, _32Mx16
  6813. UCHAR ucFlag; // To enable/disable functionalities based on memory type
  6814. UCHAR ucMisc; // bit0: 0 - single rank; 1 - dual rank; bit2: 0 - burstlength 4, 1 - burstlength 8
  6815. UCHAR ucVREFI; // board dependent parameter
  6816. UCHAR ucNPL_RT; // board dependent parameter:NPL round trip delay, used for calculate memory timing parameters
  6817. UCHAR ucPreamble; // [7:4] Write Preamble, [3:0] Read Preamble
  6818. UCHAR ucMemorySize; // BIOS internal reserved space to optimize code size, updated by the compiler, shouldn't be modified manually!!
  6819. // Total memory size in unit of 16MB for CONFIG_MEMSIZE - bit[23:0] zeros
  6820. UCHAR ucReserved[3];
  6821. //compare with V3, we flat the struct by merging ATOM_MEMORY_FORMAT (as is) into V4 as the same level
  6822. union{
  6823. USHORT usEMRS2Value; // EMRS2 Value is used for GDDR2 and GDDR4 memory type
  6824. USHORT usDDR3_Reserved;
  6825. };
  6826. union{
  6827. USHORT usEMRS3Value; // EMRS3 Value is used for GDDR2 and GDDR4 memory type
  6828. USHORT usDDR3_MR3; // Used for DDR3 memory
  6829. };
  6830. UCHAR ucMemoryVenderID; // Predefined, If not predefined, vendor detection table gets executed
  6831. UCHAR ucRefreshRateFactor; // [1:0]=RefreshFactor (00=8ms, 01=16ms, 10=32ms,11=64ms)
  6832. UCHAR ucReserved2[2];
  6833. ATOM_MEMORY_TIMING_FORMAT asMemTiming[5];//Memory Timing block sort from lower clock to higher clock
  6834. }ATOM_VRAM_MODULE_V4;
  6835. #define VRAM_MODULE_V4_MISC_RANK_MASK 0x3
  6836. #define VRAM_MODULE_V4_MISC_DUAL_RANK 0x1
  6837. #define VRAM_MODULE_V4_MISC_BL_MASK 0x4
  6838. #define VRAM_MODULE_V4_MISC_BL8 0x4
  6839. #define VRAM_MODULE_V4_MISC_DUAL_CS 0x10
  6840. typedef struct _ATOM_VRAM_MODULE_V5
  6841. {
  6842. ULONG ulChannelMapCfg; // board dependent parameter: Channel combination
  6843. USHORT usModuleSize; // size of ATOM_VRAM_MODULE_V4, make it easy for VBIOS to look for next entry of VRAM_MODULE
  6844. USHORT usPrivateReserved; // BIOS internal reserved space to optimize code size, updated by the compiler, shouldn't be modified manually!!
  6845. // MC_ARB_RAMCFG (includes NOOFBANK,NOOFRANKS,NOOFROWS,NOOFCOLS)
  6846. USHORT usReserved;
  6847. UCHAR ucExtMemoryID; // An external indicator (by hardcode, callback or pin) to tell what is the current memory module
  6848. UCHAR ucMemoryType; // [7:4]=0x1:DDR1;=0x2:DDR2;=0x3:DDR3;=0x4:DDR4; 0x5:DDR5 [3:0] - Must be 0x0 for now;
  6849. UCHAR ucChannelNum; // Number of channels present in this module config
  6850. UCHAR ucChannelWidth; // 0 - 32 bits; 1 - 64 bits
  6851. UCHAR ucDensity; // _8Mx32, _16Mx32, _16Mx16, _32Mx16
  6852. UCHAR ucFlag; // To enable/disable functionalities based on memory type
  6853. UCHAR ucMisc; // bit0: 0 - single rank; 1 - dual rank; bit2: 0 - burstlength 4, 1 - burstlength 8
  6854. UCHAR ucVREFI; // board dependent parameter
  6855. UCHAR ucNPL_RT; // board dependent parameter:NPL round trip delay, used for calculate memory timing parameters
  6856. UCHAR ucPreamble; // [7:4] Write Preamble, [3:0] Read Preamble
  6857. UCHAR ucMemorySize; // BIOS internal reserved space to optimize code size, updated by the compiler, shouldn't be modified manually!!
  6858. // Total memory size in unit of 16MB for CONFIG_MEMSIZE - bit[23:0] zeros
  6859. UCHAR ucReserved[3];
  6860. //compare with V3, we flat the struct by merging ATOM_MEMORY_FORMAT (as is) into V4 as the same level
  6861. USHORT usEMRS2Value; // EMRS2 Value is used for GDDR2 and GDDR4 memory type
  6862. USHORT usEMRS3Value; // EMRS3 Value is used for GDDR2 and GDDR4 memory type
  6863. UCHAR ucMemoryVenderID; // Predefined, If not predefined, vendor detection table gets executed
  6864. UCHAR ucRefreshRateFactor; // [1:0]=RefreshFactor (00=8ms, 01=16ms, 10=32ms,11=64ms)
  6865. UCHAR ucFIFODepth; // FIFO depth supposes to be detected during vendor detection, but if we dont do vendor detection we have to hardcode FIFO Depth
  6866. UCHAR ucCDR_Bandwidth; // [0:3]=Read CDR bandwidth, [4:7] - Write CDR Bandwidth
  6867. ATOM_MEMORY_TIMING_FORMAT_V1 asMemTiming[5];//Memory Timing block sort from lower clock to higher clock
  6868. }ATOM_VRAM_MODULE_V5;
  6869. typedef struct _ATOM_VRAM_MODULE_V6
  6870. {
  6871. ULONG ulChannelMapCfg; // board dependent parameter: Channel combination
  6872. USHORT usModuleSize; // size of ATOM_VRAM_MODULE_V4, make it easy for VBIOS to look for next entry of VRAM_MODULE
  6873. USHORT usPrivateReserved; // BIOS internal reserved space to optimize code size, updated by the compiler, shouldn't be modified manually!!
  6874. // MC_ARB_RAMCFG (includes NOOFBANK,NOOFRANKS,NOOFROWS,NOOFCOLS)
  6875. USHORT usReserved;
  6876. UCHAR ucExtMemoryID; // An external indicator (by hardcode, callback or pin) to tell what is the current memory module
  6877. UCHAR ucMemoryType; // [7:4]=0x1:DDR1;=0x2:DDR2;=0x3:DDR3;=0x4:DDR4; 0x5:DDR5 [3:0] - Must be 0x0 for now;
  6878. UCHAR ucChannelNum; // Number of channels present in this module config
  6879. UCHAR ucChannelWidth; // 0 - 32 bits; 1 - 64 bits
  6880. UCHAR ucDensity; // _8Mx32, _16Mx32, _16Mx16, _32Mx16
  6881. UCHAR ucFlag; // To enable/disable functionalities based on memory type
  6882. UCHAR ucMisc; // bit0: 0 - single rank; 1 - dual rank; bit2: 0 - burstlength 4, 1 - burstlength 8
  6883. UCHAR ucVREFI; // board dependent parameter
  6884. UCHAR ucNPL_RT; // board dependent parameter:NPL round trip delay, used for calculate memory timing parameters
  6885. UCHAR ucPreamble; // [7:4] Write Preamble, [3:0] Read Preamble
  6886. UCHAR ucMemorySize; // BIOS internal reserved space to optimize code size, updated by the compiler, shouldn't be modified manually!!
  6887. // Total memory size in unit of 16MB for CONFIG_MEMSIZE - bit[23:0] zeros
  6888. UCHAR ucReserved[3];
  6889. //compare with V3, we flat the struct by merging ATOM_MEMORY_FORMAT (as is) into V4 as the same level
  6890. USHORT usEMRS2Value; // EMRS2 Value is used for GDDR2 and GDDR4 memory type
  6891. USHORT usEMRS3Value; // EMRS3 Value is used for GDDR2 and GDDR4 memory type
  6892. UCHAR ucMemoryVenderID; // Predefined, If not predefined, vendor detection table gets executed
  6893. UCHAR ucRefreshRateFactor; // [1:0]=RefreshFactor (00=8ms, 01=16ms, 10=32ms,11=64ms)
  6894. UCHAR ucFIFODepth; // FIFO depth supposes to be detected during vendor detection, but if we dont do vendor detection we have to hardcode FIFO Depth
  6895. UCHAR ucCDR_Bandwidth; // [0:3]=Read CDR bandwidth, [4:7] - Write CDR Bandwidth
  6896. ATOM_MEMORY_TIMING_FORMAT_V2 asMemTiming[5];//Memory Timing block sort from lower clock to higher clock
  6897. }ATOM_VRAM_MODULE_V6;
  6898. typedef struct _ATOM_VRAM_MODULE_V7
  6899. {
  6900. // Design Specific Values
  6901. ULONG ulChannelMapCfg; // mmMC_SHARED_CHREMAP
  6902. USHORT usModuleSize; // Size of ATOM_VRAM_MODULE_V7
  6903. USHORT usPrivateReserved; // MC_ARB_RAMCFG (includes NOOFBANK,NOOFRANKS,NOOFROWS,NOOFCOLS)
  6904. USHORT usEnableChannels; // bit vector which indicate which channels are enabled
  6905. UCHAR ucExtMemoryID; // Current memory module ID
  6906. UCHAR ucMemoryType; // MEM_TYPE_DDR2/DDR3/GDDR3/GDDR5
  6907. UCHAR ucChannelNum; // Number of mem. channels supported in this module
  6908. UCHAR ucChannelWidth; // CHANNEL_16BIT/CHANNEL_32BIT/CHANNEL_64BIT
  6909. UCHAR ucDensity; // _8Mx32, _16Mx32, _16Mx16, _32Mx16
  6910. UCHAR ucReserve; // In MC7x, the lower 4 bits are used as bit8-11 of memory size. In other MC code, it's not used.
  6911. UCHAR ucMisc; // RANK_OF_THISMEMORY etc.
  6912. UCHAR ucVREFI; // Not used.
  6913. UCHAR ucNPL_RT; // Round trip delay (MC_SEQ_CAS_TIMING [28:24]:TCL=CL+NPL_RT-2). Always 2.
  6914. UCHAR ucPreamble; // [7:4] Write Preamble, [3:0] Read Preamble
  6915. UCHAR ucMemorySize; // Total memory size in unit of 16MB for CONFIG_MEMSIZE - bit[23:0] zeros
  6916. USHORT usSEQSettingOffset;
  6917. UCHAR ucReserved;
  6918. // Memory Module specific values
  6919. USHORT usEMRS2Value; // EMRS2/MR2 Value.
  6920. USHORT usEMRS3Value; // EMRS3/MR3 Value.
  6921. UCHAR ucMemoryVenderID; // [7:4] Revision, [3:0] Vendor code
  6922. UCHAR ucRefreshRateFactor; // [1:0]=RefreshFactor (00=8ms, 01=16ms, 10=32ms,11=64ms)
  6923. UCHAR ucFIFODepth; // FIFO depth can be detected during vendor detection, here is hardcoded per memory
  6924. UCHAR ucCDR_Bandwidth; // [0:3]=Read CDR bandwidth, [4:7] - Write CDR Bandwidth
  6925. char strMemPNString[20]; // part number end with '0'.
  6926. }ATOM_VRAM_MODULE_V7;
  6927. typedef struct _ATOM_VRAM_MODULE_V8
  6928. {
  6929. // Design Specific Values
  6930. ULONG ulChannelMapCfg; // mmMC_SHARED_CHREMAP
  6931. USHORT usModuleSize; // Size of ATOM_VRAM_MODULE_V7
  6932. USHORT usMcRamCfg; // MC_ARB_RAMCFG (includes NOOFBANK,NOOFRANKS,NOOFROWS,NOOFCOLS)
  6933. USHORT usEnableChannels; // bit vector which indicate which channels are enabled
  6934. UCHAR ucExtMemoryID; // Current memory module ID
  6935. UCHAR ucMemoryType; // MEM_TYPE_DDR2/DDR3/GDDR3/GDDR5
  6936. UCHAR ucChannelNum; // Number of mem. channels supported in this module
  6937. UCHAR ucChannelWidth; // CHANNEL_16BIT/CHANNEL_32BIT/CHANNEL_64BIT
  6938. UCHAR ucDensity; // _8Mx32, _16Mx32, _16Mx16, _32Mx16
  6939. UCHAR ucBankCol; // bit[3:2]= BANK ( =2:16bank, =1:8bank, =0:4bank ) bit[1:0]=Col ( =2: 10 bit, =1:9bit, =0:8bit )
  6940. UCHAR ucMisc; // RANK_OF_THISMEMORY etc.
  6941. UCHAR ucVREFI; // Not used.
  6942. USHORT usReserved; // Not used
  6943. USHORT usMemorySize; // Total memory size in unit of MB for CONFIG_MEMSIZE zeros
  6944. UCHAR ucMcTunningSetId; // MC phy registers set per.
  6945. UCHAR ucRowNum;
  6946. // Memory Module specific values
  6947. USHORT usEMRS2Value; // EMRS2/MR2 Value.
  6948. USHORT usEMRS3Value; // EMRS3/MR3 Value.
  6949. UCHAR ucMemoryVenderID; // [7:4] Revision, [3:0] Vendor code
  6950. UCHAR ucRefreshRateFactor; // [1:0]=RefreshFactor (00=8ms, 01=16ms, 10=32ms,11=64ms)
  6951. UCHAR ucFIFODepth; // FIFO depth can be detected during vendor detection, here is hardcoded per memory
  6952. UCHAR ucCDR_Bandwidth; // [0:3]=Read CDR bandwidth, [4:7] - Write CDR Bandwidth
  6953. ULONG ulChannelMapCfg1; // channel mapping for channel8~15
  6954. ULONG ulBankMapCfg;
  6955. ULONG ulReserved;
  6956. char strMemPNString[20]; // part number end with '0'.
  6957. }ATOM_VRAM_MODULE_V8;
  6958. typedef struct _ATOM_VRAM_INFO_V2
  6959. {
  6960. ATOM_COMMON_TABLE_HEADER sHeader;
  6961. UCHAR ucNumOfVRAMModule;
  6962. ATOM_VRAM_MODULE aVramInfo[ATOM_MAX_NUMBER_OF_VRAM_MODULE]; // just for allocation, real number of blocks is in ucNumOfVRAMModule;
  6963. }ATOM_VRAM_INFO_V2;
  6964. typedef struct _ATOM_VRAM_INFO_V3
  6965. {
  6966. ATOM_COMMON_TABLE_HEADER sHeader;
  6967. USHORT usMemAdjustTblOffset; // offset of ATOM_INIT_REG_BLOCK structure for memory vendor specific MC adjust setting
  6968. USHORT usMemClkPatchTblOffset; // offset of ATOM_INIT_REG_BLOCK structure for memory clock specific MC setting
  6969. USHORT usRerseved;
  6970. UCHAR aVID_PinsShift[9]; // 8 bit strap maximum+terminator
  6971. UCHAR ucNumOfVRAMModule;
  6972. ATOM_VRAM_MODULE aVramInfo[ATOM_MAX_NUMBER_OF_VRAM_MODULE]; // just for allocation, real number of blocks is in ucNumOfVRAMModule;
  6973. ATOM_INIT_REG_BLOCK asMemPatch; // for allocation
  6974. }ATOM_VRAM_INFO_V3;
  6975. #define ATOM_VRAM_INFO_LAST ATOM_VRAM_INFO_V3
  6976. typedef struct _ATOM_VRAM_INFO_V4
  6977. {
  6978. ATOM_COMMON_TABLE_HEADER sHeader;
  6979. USHORT usMemAdjustTblOffset; // offset of ATOM_INIT_REG_BLOCK structure for memory vendor specific MC adjust setting
  6980. USHORT usMemClkPatchTblOffset; // offset of ATOM_INIT_REG_BLOCK structure for memory clock specific MC setting
  6981. USHORT usRerseved;
  6982. UCHAR ucMemDQ7_0ByteRemap; // DQ line byte remap, =0: Memory Data line BYTE0, =1: BYTE1, =2: BYTE2, =3: BYTE3
  6983. ULONG ulMemDQ7_0BitRemap; // each DQ line ( 7~0) use 3bits, like: DQ0=Bit[2:0], DQ1:[5:3], ... DQ7:[23:21]
  6984. UCHAR ucReservde[4];
  6985. UCHAR ucNumOfVRAMModule;
  6986. ATOM_VRAM_MODULE_V4 aVramInfo[ATOM_MAX_NUMBER_OF_VRAM_MODULE]; // just for allocation, real number of blocks is in ucNumOfVRAMModule;
  6987. ATOM_INIT_REG_BLOCK asMemPatch; // for allocation
  6988. }ATOM_VRAM_INFO_V4;
  6989. typedef struct _ATOM_VRAM_INFO_HEADER_V2_1
  6990. {
  6991. ATOM_COMMON_TABLE_HEADER sHeader;
  6992. USHORT usMemAdjustTblOffset; // offset of ATOM_INIT_REG_BLOCK structure for memory vendor specific MC adjust setting
  6993. USHORT usMemClkPatchTblOffset; // offset of ATOM_INIT_REG_BLOCK structure for memory clock specific MC setting
  6994. USHORT usPerBytePresetOffset; // offset of ATOM_INIT_REG_BLOCK structure for Per Byte Offset Preset Settings
  6995. USHORT usReserved[3];
  6996. UCHAR ucNumOfVRAMModule; // indicate number of VRAM module
  6997. UCHAR ucMemoryClkPatchTblVer; // version of memory AC timing register list
  6998. UCHAR ucVramModuleVer; // indicate ATOM_VRAM_MODUE version
  6999. UCHAR ucReserved;
  7000. ATOM_VRAM_MODULE_V7 aVramInfo[ATOM_MAX_NUMBER_OF_VRAM_MODULE]; // just for allocation, real number of blocks is in ucNumOfVRAMModule;
  7001. }ATOM_VRAM_INFO_HEADER_V2_1;
  7002. typedef struct _ATOM_VRAM_INFO_HEADER_V2_2
  7003. {
  7004. ATOM_COMMON_TABLE_HEADER sHeader;
  7005. USHORT usMemAdjustTblOffset; // offset of ATOM_INIT_REG_BLOCK structure for memory vendor specific MC adjust setting
  7006. USHORT usMemClkPatchTblOffset; // offset of ATOM_INIT_REG_BLOCK structure for memory clock specific MC setting
  7007. USHORT usMcAdjustPerTileTblOffset; // offset of ATOM_INIT_REG_BLOCK structure for Per Byte Offset Preset Settings
  7008. USHORT usMcPhyInitTableOffset; // offset of ATOM_INIT_REG_BLOCK structure for MC phy init set
  7009. USHORT usDramDataRemapTblOffset; // offset of ATOM_DRAM_DATA_REMAP array to indicate DRAM data lane to GPU mapping
  7010. USHORT usReserved1;
  7011. UCHAR ucNumOfVRAMModule; // indicate number of VRAM module
  7012. UCHAR ucMemoryClkPatchTblVer; // version of memory AC timing register list
  7013. UCHAR ucVramModuleVer; // indicate ATOM_VRAM_MODUE version
  7014. UCHAR ucMcPhyTileNum; // indicate the MCD tile number which use in DramDataRemapTbl and usMcAdjustPerTileTblOffset
  7015. ATOM_VRAM_MODULE_V8 aVramInfo[ATOM_MAX_NUMBER_OF_VRAM_MODULE]; // just for allocation, real number of blocks is in ucNumOfVRAMModule;
  7016. }ATOM_VRAM_INFO_HEADER_V2_2;
  7017. typedef struct _ATOM_DRAM_DATA_REMAP
  7018. {
  7019. UCHAR ucByteRemapCh0;
  7020. UCHAR ucByteRemapCh1;
  7021. ULONG ulByte0BitRemapCh0;
  7022. ULONG ulByte1BitRemapCh0;
  7023. ULONG ulByte2BitRemapCh0;
  7024. ULONG ulByte3BitRemapCh0;
  7025. ULONG ulByte0BitRemapCh1;
  7026. ULONG ulByte1BitRemapCh1;
  7027. ULONG ulByte2BitRemapCh1;
  7028. ULONG ulByte3BitRemapCh1;
  7029. }ATOM_DRAM_DATA_REMAP;
  7030. typedef struct _ATOM_VRAM_GPIO_DETECTION_INFO
  7031. {
  7032. ATOM_COMMON_TABLE_HEADER sHeader;
  7033. UCHAR aVID_PinsShift[9]; // 8 bit strap maximum+terminator
  7034. }ATOM_VRAM_GPIO_DETECTION_INFO;
  7035. typedef struct _ATOM_MEMORY_TRAINING_INFO
  7036. {
  7037. ATOM_COMMON_TABLE_HEADER sHeader;
  7038. UCHAR ucTrainingLoop;
  7039. UCHAR ucReserved[3];
  7040. ATOM_INIT_REG_BLOCK asMemTrainingSetting;
  7041. }ATOM_MEMORY_TRAINING_INFO;
  7042. typedef struct _ATOM_MEMORY_TRAINING_INFO_V3_1
  7043. {
  7044. ATOM_COMMON_TABLE_HEADER sHeader;
  7045. ULONG ulMCUcodeVersion;
  7046. USHORT usMCIOInitLen; //len of ATOM_REG_INIT_SETTING array
  7047. USHORT usMCUcodeLen; //len of ATOM_MC_UCODE_DATA array
  7048. USHORT usMCIORegInitOffset; //point of offset of ATOM_REG_INIT_SETTING array
  7049. USHORT usMCUcodeOffset; //point of offset of MC uCode ULONG array.
  7050. }ATOM_MEMORY_TRAINING_INFO_V3_1;
  7051. typedef struct SW_I2C_CNTL_DATA_PARAMETERS
  7052. {
  7053. UCHAR ucControl;
  7054. UCHAR ucData;
  7055. UCHAR ucSatus;
  7056. UCHAR ucTemp;
  7057. } SW_I2C_CNTL_DATA_PARAMETERS;
  7058. #define SW_I2C_CNTL_DATA_PS_ALLOCATION SW_I2C_CNTL_DATA_PARAMETERS
  7059. typedef struct _SW_I2C_IO_DATA_PARAMETERS
  7060. {
  7061. USHORT GPIO_Info;
  7062. UCHAR ucAct;
  7063. UCHAR ucData;
  7064. } SW_I2C_IO_DATA_PARAMETERS;
  7065. #define SW_I2C_IO_DATA_PS_ALLOCATION SW_I2C_IO_DATA_PARAMETERS
  7066. /****************************SW I2C CNTL DEFINITIONS**********************/
  7067. #define SW_I2C_IO_RESET 0
  7068. #define SW_I2C_IO_GET 1
  7069. #define SW_I2C_IO_DRIVE 2
  7070. #define SW_I2C_IO_SET 3
  7071. #define SW_I2C_IO_START 4
  7072. #define SW_I2C_IO_CLOCK 0
  7073. #define SW_I2C_IO_DATA 0x80
  7074. #define SW_I2C_IO_ZERO 0
  7075. #define SW_I2C_IO_ONE 0x100
  7076. #define SW_I2C_CNTL_READ 0
  7077. #define SW_I2C_CNTL_WRITE 1
  7078. #define SW_I2C_CNTL_START 2
  7079. #define SW_I2C_CNTL_STOP 3
  7080. #define SW_I2C_CNTL_OPEN 4
  7081. #define SW_I2C_CNTL_CLOSE 5
  7082. #define SW_I2C_CNTL_WRITE1BIT 6
  7083. //==============================VESA definition Portion===============================
  7084. #define VESA_OEM_PRODUCT_REV '01.00'
  7085. #define VESA_MODE_ATTRIBUTE_MODE_SUPPORT 0xBB //refer to VBE spec p.32, no TTY support
  7086. #define VESA_MODE_WIN_ATTRIBUTE 7
  7087. #define VESA_WIN_SIZE 64
  7088. typedef struct _PTR_32_BIT_STRUCTURE
  7089. {
  7090. USHORT Offset16;
  7091. USHORT Segment16;
  7092. } PTR_32_BIT_STRUCTURE;
  7093. typedef union _PTR_32_BIT_UNION
  7094. {
  7095. PTR_32_BIT_STRUCTURE SegmentOffset;
  7096. ULONG Ptr32_Bit;
  7097. } PTR_32_BIT_UNION;
  7098. typedef struct _VBE_1_2_INFO_BLOCK_UPDATABLE
  7099. {
  7100. UCHAR VbeSignature[4];
  7101. USHORT VbeVersion;
  7102. PTR_32_BIT_UNION OemStringPtr;
  7103. UCHAR Capabilities[4];
  7104. PTR_32_BIT_UNION VideoModePtr;
  7105. USHORT TotalMemory;
  7106. } VBE_1_2_INFO_BLOCK_UPDATABLE;
  7107. typedef struct _VBE_2_0_INFO_BLOCK_UPDATABLE
  7108. {
  7109. VBE_1_2_INFO_BLOCK_UPDATABLE CommonBlock;
  7110. USHORT OemSoftRev;
  7111. PTR_32_BIT_UNION OemVendorNamePtr;
  7112. PTR_32_BIT_UNION OemProductNamePtr;
  7113. PTR_32_BIT_UNION OemProductRevPtr;
  7114. } VBE_2_0_INFO_BLOCK_UPDATABLE;
  7115. typedef union _VBE_VERSION_UNION
  7116. {
  7117. VBE_2_0_INFO_BLOCK_UPDATABLE VBE_2_0_InfoBlock;
  7118. VBE_1_2_INFO_BLOCK_UPDATABLE VBE_1_2_InfoBlock;
  7119. } VBE_VERSION_UNION;
  7120. typedef struct _VBE_INFO_BLOCK
  7121. {
  7122. VBE_VERSION_UNION UpdatableVBE_Info;
  7123. UCHAR Reserved[222];
  7124. UCHAR OemData[256];
  7125. } VBE_INFO_BLOCK;
  7126. typedef struct _VBE_FP_INFO
  7127. {
  7128. USHORT HSize;
  7129. USHORT VSize;
  7130. USHORT FPType;
  7131. UCHAR RedBPP;
  7132. UCHAR GreenBPP;
  7133. UCHAR BlueBPP;
  7134. UCHAR ReservedBPP;
  7135. ULONG RsvdOffScrnMemSize;
  7136. ULONG RsvdOffScrnMEmPtr;
  7137. UCHAR Reserved[14];
  7138. } VBE_FP_INFO;
  7139. typedef struct _VESA_MODE_INFO_BLOCK
  7140. {
  7141. // Mandatory information for all VBE revisions
  7142. USHORT ModeAttributes; // dw ? ; mode attributes
  7143. UCHAR WinAAttributes; // db ? ; window A attributes
  7144. UCHAR WinBAttributes; // db ? ; window B attributes
  7145. USHORT WinGranularity; // dw ? ; window granularity
  7146. USHORT WinSize; // dw ? ; window size
  7147. USHORT WinASegment; // dw ? ; window A start segment
  7148. USHORT WinBSegment; // dw ? ; window B start segment
  7149. ULONG WinFuncPtr; // dd ? ; real mode pointer to window function
  7150. USHORT BytesPerScanLine;// dw ? ; bytes per scan line
  7151. //; Mandatory information for VBE 1.2 and above
  7152. USHORT XResolution; // dw ? ; horizontal resolution in pixels or characters
  7153. USHORT YResolution; // dw ? ; vertical resolution in pixels or characters
  7154. UCHAR XCharSize; // db ? ; character cell width in pixels
  7155. UCHAR YCharSize; // db ? ; character cell height in pixels
  7156. UCHAR NumberOfPlanes; // db ? ; number of memory planes
  7157. UCHAR BitsPerPixel; // db ? ; bits per pixel
  7158. UCHAR NumberOfBanks; // db ? ; number of banks
  7159. UCHAR MemoryModel; // db ? ; memory model type
  7160. UCHAR BankSize; // db ? ; bank size in KB
  7161. UCHAR NumberOfImagePages;// db ? ; number of images
  7162. UCHAR ReservedForPageFunction;//db 1 ; reserved for page function
  7163. //; Direct Color fields(required for direct/6 and YUV/7 memory models)
  7164. UCHAR RedMaskSize; // db ? ; size of direct color red mask in bits
  7165. UCHAR RedFieldPosition; // db ? ; bit position of lsb of red mask
  7166. UCHAR GreenMaskSize; // db ? ; size of direct color green mask in bits
  7167. UCHAR GreenFieldPosition; // db ? ; bit position of lsb of green mask
  7168. UCHAR BlueMaskSize; // db ? ; size of direct color blue mask in bits
  7169. UCHAR BlueFieldPosition; // db ? ; bit position of lsb of blue mask
  7170. UCHAR RsvdMaskSize; // db ? ; size of direct color reserved mask in bits
  7171. UCHAR RsvdFieldPosition; // db ? ; bit position of lsb of reserved mask
  7172. UCHAR DirectColorModeInfo;// db ? ; direct color mode attributes
  7173. //; Mandatory information for VBE 2.0 and above
  7174. ULONG PhysBasePtr; // dd ? ; physical address for flat memory frame buffer
  7175. ULONG Reserved_1; // dd 0 ; reserved - always set to 0
  7176. USHORT Reserved_2; // dw 0 ; reserved - always set to 0
  7177. //; Mandatory information for VBE 3.0 and above
  7178. USHORT LinBytesPerScanLine; // dw ? ; bytes per scan line for linear modes
  7179. UCHAR BnkNumberOfImagePages;// db ? ; number of images for banked modes
  7180. UCHAR LinNumberOfImagPages; // db ? ; number of images for linear modes
  7181. UCHAR LinRedMaskSize; // db ? ; size of direct color red mask(linear modes)
  7182. UCHAR LinRedFieldPosition; // db ? ; bit position of lsb of red mask(linear modes)
  7183. UCHAR LinGreenMaskSize; // db ? ; size of direct color green mask(linear modes)
  7184. UCHAR LinGreenFieldPosition;// db ? ; bit position of lsb of green mask(linear modes)
  7185. UCHAR LinBlueMaskSize; // db ? ; size of direct color blue mask(linear modes)
  7186. UCHAR LinBlueFieldPosition; // db ? ; bit position of lsb of blue mask(linear modes)
  7187. UCHAR LinRsvdMaskSize; // db ? ; size of direct color reserved mask(linear modes)
  7188. UCHAR LinRsvdFieldPosition; // db ? ; bit position of lsb of reserved mask(linear modes)
  7189. ULONG MaxPixelClock; // dd ? ; maximum pixel clock(in Hz) for graphics mode
  7190. UCHAR Reserved; // db 190 dup (0)
  7191. } VESA_MODE_INFO_BLOCK;
  7192. // BIOS function CALLS
  7193. #define ATOM_BIOS_EXTENDED_FUNCTION_CODE 0xA0 // ATI Extended Function code
  7194. #define ATOM_BIOS_FUNCTION_COP_MODE 0x00
  7195. #define ATOM_BIOS_FUNCTION_SHORT_QUERY1 0x04
  7196. #define ATOM_BIOS_FUNCTION_SHORT_QUERY2 0x05
  7197. #define ATOM_BIOS_FUNCTION_SHORT_QUERY3 0x06
  7198. #define ATOM_BIOS_FUNCTION_GET_DDC 0x0B
  7199. #define ATOM_BIOS_FUNCTION_ASIC_DSTATE 0x0E
  7200. #define ATOM_BIOS_FUNCTION_DEBUG_PLAY 0x0F
  7201. #define ATOM_BIOS_FUNCTION_STV_STD 0x16
  7202. #define ATOM_BIOS_FUNCTION_DEVICE_DET 0x17
  7203. #define ATOM_BIOS_FUNCTION_DEVICE_SWITCH 0x18
  7204. #define ATOM_BIOS_FUNCTION_PANEL_CONTROL 0x82
  7205. #define ATOM_BIOS_FUNCTION_OLD_DEVICE_DET 0x83
  7206. #define ATOM_BIOS_FUNCTION_OLD_DEVICE_SWITCH 0x84
  7207. #define ATOM_BIOS_FUNCTION_HW_ICON 0x8A
  7208. #define ATOM_BIOS_FUNCTION_SET_CMOS 0x8B
  7209. #define SUB_FUNCTION_UPDATE_DISPLAY_INFO 0x8000 // Sub function 80
  7210. #define SUB_FUNCTION_UPDATE_EXPANSION_INFO 0x8100 // Sub function 80
  7211. #define ATOM_BIOS_FUNCTION_DISPLAY_INFO 0x8D
  7212. #define ATOM_BIOS_FUNCTION_DEVICE_ON_OFF 0x8E
  7213. #define ATOM_BIOS_FUNCTION_VIDEO_STATE 0x8F
  7214. #define ATOM_SUB_FUNCTION_GET_CRITICAL_STATE 0x0300 // Sub function 03
  7215. #define ATOM_SUB_FUNCTION_GET_LIDSTATE 0x0700 // Sub function 7
  7216. #define ATOM_SUB_FUNCTION_THERMAL_STATE_NOTICE 0x1400 // Notify caller the current thermal state
  7217. #define ATOM_SUB_FUNCTION_CRITICAL_STATE_NOTICE 0x8300 // Notify caller the current critical state
  7218. #define ATOM_SUB_FUNCTION_SET_LIDSTATE 0x8500 // Sub function 85
  7219. #define ATOM_SUB_FUNCTION_GET_REQ_DISPLAY_FROM_SBIOS_MODE 0x8900// Sub function 89
  7220. #define ATOM_SUB_FUNCTION_INFORM_ADC_SUPPORT 0x9400 // Notify caller that ADC is supported
  7221. #define ATOM_BIOS_FUNCTION_VESA_DPMS 0x4F10 // Set DPMS
  7222. #define ATOM_SUB_FUNCTION_SET_DPMS 0x0001 // BL: Sub function 01
  7223. #define ATOM_SUB_FUNCTION_GET_DPMS 0x0002 // BL: Sub function 02
  7224. #define ATOM_PARAMETER_VESA_DPMS_ON 0x0000 // BH Parameter for DPMS ON.
  7225. #define ATOM_PARAMETER_VESA_DPMS_STANDBY 0x0100 // BH Parameter for DPMS STANDBY
  7226. #define ATOM_PARAMETER_VESA_DPMS_SUSPEND 0x0200 // BH Parameter for DPMS SUSPEND
  7227. #define ATOM_PARAMETER_VESA_DPMS_OFF 0x0400 // BH Parameter for DPMS OFF
  7228. #define ATOM_PARAMETER_VESA_DPMS_REDUCE_ON 0x0800 // BH Parameter for DPMS REDUCE ON (NOT SUPPORTED)
  7229. #define ATOM_BIOS_RETURN_CODE_MASK 0x0000FF00L
  7230. #define ATOM_BIOS_REG_HIGH_MASK 0x0000FF00L
  7231. #define ATOM_BIOS_REG_LOW_MASK 0x000000FFL
  7232. // structure used for VBIOS only
  7233. //DispOutInfoTable
  7234. typedef struct _ASIC_TRANSMITTER_INFO
  7235. {
  7236. USHORT usTransmitterObjId;
  7237. USHORT usSupportDevice;
  7238. UCHAR ucTransmitterCmdTblId;
  7239. UCHAR ucConfig;
  7240. UCHAR ucEncoderID; //available 1st encoder ( default )
  7241. UCHAR ucOptionEncoderID; //available 2nd encoder ( optional )
  7242. UCHAR uc2ndEncoderID;
  7243. UCHAR ucReserved;
  7244. }ASIC_TRANSMITTER_INFO;
  7245. #define ASIC_TRANSMITTER_INFO_CONFIG__DVO_SDR_MODE 0x01
  7246. #define ASIC_TRANSMITTER_INFO_CONFIG__COHERENT_MODE 0x02
  7247. #define ASIC_TRANSMITTER_INFO_CONFIG__ENCODEROBJ_ID_MASK 0xc4
  7248. #define ASIC_TRANSMITTER_INFO_CONFIG__ENCODER_A 0x00
  7249. #define ASIC_TRANSMITTER_INFO_CONFIG__ENCODER_B 0x04
  7250. #define ASIC_TRANSMITTER_INFO_CONFIG__ENCODER_C 0x40
  7251. #define ASIC_TRANSMITTER_INFO_CONFIG__ENCODER_D 0x44
  7252. #define ASIC_TRANSMITTER_INFO_CONFIG__ENCODER_E 0x80
  7253. #define ASIC_TRANSMITTER_INFO_CONFIG__ENCODER_F 0x84
  7254. typedef struct _ASIC_ENCODER_INFO
  7255. {
  7256. UCHAR ucEncoderID;
  7257. UCHAR ucEncoderConfig;
  7258. USHORT usEncoderCmdTblId;
  7259. }ASIC_ENCODER_INFO;
  7260. typedef struct _ATOM_DISP_OUT_INFO
  7261. {
  7262. ATOM_COMMON_TABLE_HEADER sHeader;
  7263. USHORT ptrTransmitterInfo;
  7264. USHORT ptrEncoderInfo;
  7265. ASIC_TRANSMITTER_INFO asTransmitterInfo[1];
  7266. ASIC_ENCODER_INFO asEncoderInfo[1];
  7267. }ATOM_DISP_OUT_INFO;
  7268. typedef struct _ATOM_DISP_OUT_INFO_V2
  7269. {
  7270. ATOM_COMMON_TABLE_HEADER sHeader;
  7271. USHORT ptrTransmitterInfo;
  7272. USHORT ptrEncoderInfo;
  7273. USHORT ptrMainCallParserFar; // direct address of main parser call in VBIOS binary.
  7274. ASIC_TRANSMITTER_INFO asTransmitterInfo[1];
  7275. ASIC_ENCODER_INFO asEncoderInfo[1];
  7276. }ATOM_DISP_OUT_INFO_V2;
  7277. typedef struct _ATOM_DISP_CLOCK_ID {
  7278. UCHAR ucPpllId;
  7279. UCHAR ucPpllAttribute;
  7280. }ATOM_DISP_CLOCK_ID;
  7281. // ucPpllAttribute
  7282. #define CLOCK_SOURCE_SHAREABLE 0x01
  7283. #define CLOCK_SOURCE_DP_MODE 0x02
  7284. #define CLOCK_SOURCE_NONE_DP_MODE 0x04
  7285. //DispOutInfoTable
  7286. typedef struct _ASIC_TRANSMITTER_INFO_V2
  7287. {
  7288. USHORT usTransmitterObjId;
  7289. USHORT usDispClkIdOffset; // point to clock source id list supported by Encoder Object
  7290. UCHAR ucTransmitterCmdTblId;
  7291. UCHAR ucConfig;
  7292. UCHAR ucEncoderID; // available 1st encoder ( default )
  7293. UCHAR ucOptionEncoderID; // available 2nd encoder ( optional )
  7294. UCHAR uc2ndEncoderID;
  7295. UCHAR ucReserved;
  7296. }ASIC_TRANSMITTER_INFO_V2;
  7297. typedef struct _ATOM_DISP_OUT_INFO_V3
  7298. {
  7299. ATOM_COMMON_TABLE_HEADER sHeader;
  7300. USHORT ptrTransmitterInfo;
  7301. USHORT ptrEncoderInfo;
  7302. USHORT ptrMainCallParserFar; // direct address of main parser call in VBIOS binary.
  7303. USHORT usReserved;
  7304. UCHAR ucDCERevision;
  7305. UCHAR ucMaxDispEngineNum;
  7306. UCHAR ucMaxActiveDispEngineNum;
  7307. UCHAR ucMaxPPLLNum;
  7308. UCHAR ucCoreRefClkSource; // value of CORE_REF_CLK_SOURCE
  7309. UCHAR ucDispCaps;
  7310. UCHAR ucReserved[2];
  7311. ASIC_TRANSMITTER_INFO_V2 asTransmitterInfo[1]; // for alligment only
  7312. }ATOM_DISP_OUT_INFO_V3;
  7313. //ucDispCaps
  7314. #define DISPLAY_CAPS__DP_PCLK_FROM_PPLL 0x01
  7315. #define DISPLAY_CAPS__FORCE_DISPDEV_CONNECTED 0x02
  7316. typedef enum CORE_REF_CLK_SOURCE{
  7317. CLOCK_SRC_XTALIN=0,
  7318. CLOCK_SRC_XO_IN=1,
  7319. CLOCK_SRC_XO_IN2=2,
  7320. }CORE_REF_CLK_SOURCE;
  7321. // DispDevicePriorityInfo
  7322. typedef struct _ATOM_DISPLAY_DEVICE_PRIORITY_INFO
  7323. {
  7324. ATOM_COMMON_TABLE_HEADER sHeader;
  7325. USHORT asDevicePriority[16];
  7326. }ATOM_DISPLAY_DEVICE_PRIORITY_INFO;
  7327. //ProcessAuxChannelTransactionTable
  7328. typedef struct _PROCESS_AUX_CHANNEL_TRANSACTION_PARAMETERS
  7329. {
  7330. USHORT lpAuxRequest;
  7331. USHORT lpDataOut;
  7332. UCHAR ucChannelID;
  7333. union
  7334. {
  7335. UCHAR ucReplyStatus;
  7336. UCHAR ucDelay;
  7337. };
  7338. UCHAR ucDataOutLen;
  7339. UCHAR ucReserved;
  7340. }PROCESS_AUX_CHANNEL_TRANSACTION_PARAMETERS;
  7341. //ProcessAuxChannelTransactionTable
  7342. typedef struct _PROCESS_AUX_CHANNEL_TRANSACTION_PARAMETERS_V2
  7343. {
  7344. USHORT lpAuxRequest;
  7345. USHORT lpDataOut;
  7346. UCHAR ucChannelID;
  7347. union
  7348. {
  7349. UCHAR ucReplyStatus;
  7350. UCHAR ucDelay;
  7351. };
  7352. UCHAR ucDataOutLen;
  7353. UCHAR ucHPD_ID; //=0: HPD1, =1: HPD2, =2: HPD3, =3: HPD4, =4: HPD5, =5: HPD6
  7354. }PROCESS_AUX_CHANNEL_TRANSACTION_PARAMETERS_V2;
  7355. #define PROCESS_AUX_CHANNEL_TRANSACTION_PS_ALLOCATION PROCESS_AUX_CHANNEL_TRANSACTION_PARAMETERS
  7356. //GetSinkType
  7357. typedef struct _DP_ENCODER_SERVICE_PARAMETERS
  7358. {
  7359. USHORT ucLinkClock;
  7360. union
  7361. {
  7362. UCHAR ucConfig; // for DP training command
  7363. UCHAR ucI2cId; // use for GET_SINK_TYPE command
  7364. };
  7365. UCHAR ucAction;
  7366. UCHAR ucStatus;
  7367. UCHAR ucLaneNum;
  7368. UCHAR ucReserved[2];
  7369. }DP_ENCODER_SERVICE_PARAMETERS;
  7370. // ucAction
  7371. #define ATOM_DP_ACTION_GET_SINK_TYPE 0x01
  7372. #define DP_ENCODER_SERVICE_PS_ALLOCATION WRITE_ONE_BYTE_HW_I2C_DATA_PARAMETERS
  7373. typedef struct _DP_ENCODER_SERVICE_PARAMETERS_V2
  7374. {
  7375. USHORT usExtEncoderObjId; // External Encoder Object Id, output parameter only, use when ucAction = DP_SERVICE_V2_ACTION_DET_EXT_CONNECTION
  7376. UCHAR ucAuxId;
  7377. UCHAR ucAction;
  7378. UCHAR ucSinkType; // Iput and Output parameters.
  7379. UCHAR ucHPDId; // Input parameter, used when ucAction = DP_SERVICE_V2_ACTION_DET_EXT_CONNECTION
  7380. UCHAR ucReserved[2];
  7381. }DP_ENCODER_SERVICE_PARAMETERS_V2;
  7382. typedef struct _DP_ENCODER_SERVICE_PS_ALLOCATION_V2
  7383. {
  7384. DP_ENCODER_SERVICE_PARAMETERS_V2 asDPServiceParam;
  7385. PROCESS_AUX_CHANNEL_TRANSACTION_PARAMETERS_V2 asAuxParam;
  7386. }DP_ENCODER_SERVICE_PS_ALLOCATION_V2;
  7387. // ucAction
  7388. #define DP_SERVICE_V2_ACTION_GET_SINK_TYPE 0x01
  7389. #define DP_SERVICE_V2_ACTION_DET_LCD_CONNECTION 0x02
  7390. // DP_TRAINING_TABLE
  7391. #define DPCD_SET_LINKRATE_LANENUM_PATTERN1_TBL_ADDR ATOM_DP_TRAINING_TBL_ADDR
  7392. #define DPCD_SET_SS_CNTL_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 8 )
  7393. #define DPCD_SET_LANE_VSWING_PREEMP_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 16 )
  7394. #define DPCD_SET_TRAINING_PATTERN0_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 24 )
  7395. #define DPCD_SET_TRAINING_PATTERN2_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 32)
  7396. #define DPCD_GET_LINKRATE_LANENUM_SS_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 40)
  7397. #define DPCD_GET_LANE_STATUS_ADJUST_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 48)
  7398. #define DP_I2C_AUX_DDC_WRITE_START_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 60)
  7399. #define DP_I2C_AUX_DDC_WRITE_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 64)
  7400. #define DP_I2C_AUX_DDC_READ_START_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 72)
  7401. #define DP_I2C_AUX_DDC_READ_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 76)
  7402. #define DP_I2C_AUX_DDC_WRITE_END_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 80)
  7403. #define DP_I2C_AUX_DDC_READ_END_TBL_ADDR (ATOM_DP_TRAINING_TBL_ADDR + 84)
  7404. typedef struct _PROCESS_I2C_CHANNEL_TRANSACTION_PARAMETERS
  7405. {
  7406. UCHAR ucI2CSpeed;
  7407. union
  7408. {
  7409. UCHAR ucRegIndex;
  7410. UCHAR ucStatus;
  7411. };
  7412. USHORT lpI2CDataOut;
  7413. UCHAR ucFlag;
  7414. UCHAR ucTransBytes;
  7415. UCHAR ucSlaveAddr;
  7416. UCHAR ucLineNumber;
  7417. }PROCESS_I2C_CHANNEL_TRANSACTION_PARAMETERS;
  7418. #define PROCESS_I2C_CHANNEL_TRANSACTION_PS_ALLOCATION PROCESS_I2C_CHANNEL_TRANSACTION_PARAMETERS
  7419. //ucFlag
  7420. #define HW_I2C_WRITE 1
  7421. #define HW_I2C_READ 0
  7422. #define I2C_2BYTE_ADDR 0x02
  7423. /****************************************************************************/
  7424. // Structures used by HW_Misc_OperationTable
  7425. /****************************************************************************/
  7426. typedef struct _ATOM_HW_MISC_OPERATION_INPUT_PARAMETER_V1_1
  7427. {
  7428. UCHAR ucCmd; // Input: To tell which action to take
  7429. UCHAR ucReserved[3];
  7430. ULONG ulReserved;
  7431. }ATOM_HW_MISC_OPERATION_INPUT_PARAMETER_V1_1;
  7432. typedef struct _ATOM_HW_MISC_OPERATION_OUTPUT_PARAMETER_V1_1
  7433. {
  7434. UCHAR ucReturnCode; // Output: Return value base on action was taken
  7435. UCHAR ucReserved[3];
  7436. ULONG ulReserved;
  7437. }ATOM_HW_MISC_OPERATION_OUTPUT_PARAMETER_V1_1;
  7438. // Actions code
  7439. #define ATOM_GET_SDI_SUPPORT 0xF0
  7440. // Return code
  7441. #define ATOM_UNKNOWN_CMD 0
  7442. #define ATOM_FEATURE_NOT_SUPPORTED 1
  7443. #define ATOM_FEATURE_SUPPORTED 2
  7444. typedef struct _ATOM_HW_MISC_OPERATION_PS_ALLOCATION
  7445. {
  7446. ATOM_HW_MISC_OPERATION_INPUT_PARAMETER_V1_1 sInput_Output;
  7447. PROCESS_I2C_CHANNEL_TRANSACTION_PARAMETERS sReserved;
  7448. }ATOM_HW_MISC_OPERATION_PS_ALLOCATION;
  7449. /****************************************************************************/
  7450. typedef struct _SET_HWBLOCK_INSTANCE_PARAMETER_V2
  7451. {
  7452. UCHAR ucHWBlkInst; // HW block instance, 0, 1, 2, ...
  7453. UCHAR ucReserved[3];
  7454. }SET_HWBLOCK_INSTANCE_PARAMETER_V2;
  7455. #define HWBLKINST_INSTANCE_MASK 0x07
  7456. #define HWBLKINST_HWBLK_MASK 0xF0
  7457. #define HWBLKINST_HWBLK_SHIFT 0x04
  7458. //ucHWBlock
  7459. #define SELECT_DISP_ENGINE 0
  7460. #define SELECT_DISP_PLL 1
  7461. #define SELECT_DCIO_UNIPHY_LINK0 2
  7462. #define SELECT_DCIO_UNIPHY_LINK1 3
  7463. #define SELECT_DCIO_IMPCAL 4
  7464. #define SELECT_DCIO_DIG 6
  7465. #define SELECT_CRTC_PIXEL_RATE 7
  7466. #define SELECT_VGA_BLK 8
  7467. // DIGTransmitterInfoTable structure used to program UNIPHY settings
  7468. typedef struct _DIG_TRANSMITTER_INFO_HEADER_V3_1{
  7469. ATOM_COMMON_TABLE_HEADER sHeader;
  7470. USHORT usDPVsPreEmphSettingOffset; // offset of PHY_ANALOG_SETTING_INFO * with DP Voltage Swing and Pre-Emphasis for each Link clock
  7471. USHORT usPhyAnalogRegListOffset; // offset of CLOCK_CONDITION_REGESTER_INFO* with None-DP mode Analog Setting's register Info
  7472. USHORT usPhyAnalogSettingOffset; // offset of CLOCK_CONDITION_SETTING_ENTRY* with None-DP mode Analog Setting for each link clock range
  7473. USHORT usPhyPllRegListOffset; // offset of CLOCK_CONDITION_REGESTER_INFO* with Phy Pll register Info
  7474. USHORT usPhyPllSettingOffset; // offset of CLOCK_CONDITION_SETTING_ENTRY* with Phy Pll Settings
  7475. }DIG_TRANSMITTER_INFO_HEADER_V3_1;
  7476. typedef struct _DIG_TRANSMITTER_INFO_HEADER_V3_2{
  7477. ATOM_COMMON_TABLE_HEADER sHeader;
  7478. USHORT usDPVsPreEmphSettingOffset; // offset of PHY_ANALOG_SETTING_INFO * with DP Voltage Swing and Pre-Emphasis for each Link clock
  7479. USHORT usPhyAnalogRegListOffset; // offset of CLOCK_CONDITION_REGESTER_INFO* with None-DP mode Analog Setting's register Info
  7480. USHORT usPhyAnalogSettingOffset; // offset of CLOCK_CONDITION_SETTING_ENTRY* with None-DP mode Analog Setting for each link clock range
  7481. USHORT usPhyPllRegListOffset; // offset of CLOCK_CONDITION_REGESTER_INFO* with Phy Pll register Info
  7482. USHORT usPhyPllSettingOffset; // offset of CLOCK_CONDITION_SETTING_ENTRY* with Phy Pll Settings
  7483. USHORT usDPSSRegListOffset; // offset of CLOCK_CONDITION_REGESTER_INFO* with Phy SS Pll register Info
  7484. USHORT usDPSSSettingOffset; // offset of CLOCK_CONDITION_SETTING_ENTRY* with Phy SS Pll Settings
  7485. }DIG_TRANSMITTER_INFO_HEADER_V3_2;
  7486. typedef struct _DIG_TRANSMITTER_INFO_HEADER_V3_3{
  7487. ATOM_COMMON_TABLE_HEADER sHeader;
  7488. USHORT usDPVsPreEmphSettingOffset; // offset of PHY_ANALOG_SETTING_INFO * with DP Voltage Swing and Pre-Emphasis for each Link clock
  7489. USHORT usPhyAnalogRegListOffset; // offset of CLOCK_CONDITION_REGESTER_INFO* with None-DP mode Analog Setting's register Info
  7490. USHORT usPhyAnalogSettingOffset; // offset of CLOCK_CONDITION_SETTING_ENTRY* with None-DP mode Analog Setting for each link clock range
  7491. USHORT usPhyPllRegListOffset; // offset of CLOCK_CONDITION_REGESTER_INFO* with Phy Pll register Info
  7492. USHORT usPhyPllSettingOffset; // offset of CLOCK_CONDITION_SETTING_ENTRY* with Phy Pll Settings
  7493. USHORT usDPSSRegListOffset; // offset of CLOCK_CONDITION_REGESTER_INFO* with Phy SS Pll register Info
  7494. USHORT usDPSSSettingOffset; // offset of CLOCK_CONDITION_SETTING_ENTRY* with Phy SS Pll Settings
  7495. USHORT usEDPVsLegacyModeOffset; // offset of PHY_ANALOG_SETTING_INFO * with eDP Legacy Mode Voltage Swing and Pre-Emphasis for each Link clock
  7496. USHORT useDPVsLowVdiffModeOffset; // offset of PHY_ANALOG_SETTING_INFO * with eDP Low VDiff Mode Voltage Swing and Pre-Emphasis for each Link clock
  7497. USHORT useDPVsHighVdiffModeOffset; // offset of PHY_ANALOG_SETTING_INFO * with eDP High VDiff Mode Voltage Swing and Pre-Emphasis for each Link clock
  7498. USHORT useDPVsStretchModeOffset; // offset of PHY_ANALOG_SETTING_INFO * with eDP Stretch Mode Voltage Swing and Pre-Emphasis for each Link clock
  7499. USHORT useDPVsSingleVdiffModeOffset; // offset of PHY_ANALOG_SETTING_INFO * with eDP Single Vdiff Mode Voltage Swing and Pre-Emphasis for each Link clock
  7500. USHORT useDPVsVariablePremModeOffset; // offset of PHY_ANALOG_SETTING_INFO * with eDP Single Vidff+Variable PreEmphasis Voltage Swing and Pre-Emphasis for each Link clock
  7501. }DIG_TRANSMITTER_INFO_HEADER_V3_3;
  7502. typedef struct _CLOCK_CONDITION_REGESTER_INFO{
  7503. USHORT usRegisterIndex;
  7504. UCHAR ucStartBit;
  7505. UCHAR ucEndBit;
  7506. }CLOCK_CONDITION_REGESTER_INFO;
  7507. typedef struct _CLOCK_CONDITION_SETTING_ENTRY{
  7508. USHORT usMaxClockFreq;
  7509. UCHAR ucEncodeMode;
  7510. UCHAR ucPhySel;
  7511. ULONG ulAnalogSetting[1];
  7512. }CLOCK_CONDITION_SETTING_ENTRY;
  7513. typedef struct _CLOCK_CONDITION_SETTING_INFO{
  7514. USHORT usEntrySize;
  7515. CLOCK_CONDITION_SETTING_ENTRY asClkCondSettingEntry[1];
  7516. }CLOCK_CONDITION_SETTING_INFO;
  7517. typedef struct _PHY_CONDITION_REG_VAL{
  7518. ULONG ulCondition;
  7519. ULONG ulRegVal;
  7520. }PHY_CONDITION_REG_VAL;
  7521. typedef struct _PHY_CONDITION_REG_VAL_V2{
  7522. ULONG ulCondition;
  7523. UCHAR ucCondition2;
  7524. ULONG ulRegVal;
  7525. }PHY_CONDITION_REG_VAL_V2;
  7526. typedef struct _PHY_CONDITION_REG_INFO{
  7527. USHORT usRegIndex;
  7528. USHORT usSize;
  7529. PHY_CONDITION_REG_VAL asRegVal[1];
  7530. }PHY_CONDITION_REG_INFO;
  7531. typedef struct _PHY_CONDITION_REG_INFO_V2{
  7532. USHORT usRegIndex;
  7533. USHORT usSize;
  7534. PHY_CONDITION_REG_VAL_V2 asRegVal[1];
  7535. }PHY_CONDITION_REG_INFO_V2;
  7536. typedef struct _PHY_ANALOG_SETTING_INFO{
  7537. UCHAR ucEncodeMode;
  7538. UCHAR ucPhySel;
  7539. USHORT usSize;
  7540. PHY_CONDITION_REG_INFO asAnalogSetting[1];
  7541. }PHY_ANALOG_SETTING_INFO;
  7542. typedef struct _PHY_ANALOG_SETTING_INFO_V2{
  7543. UCHAR ucEncodeMode;
  7544. UCHAR ucPhySel;
  7545. USHORT usSize;
  7546. PHY_CONDITION_REG_INFO_V2 asAnalogSetting[1];
  7547. }PHY_ANALOG_SETTING_INFO_V2;
  7548. typedef struct _GFX_HAVESTING_PARAMETERS {
  7549. UCHAR ucGfxBlkId; //GFX blk id to be harvested, like CU, RB or PRIM
  7550. UCHAR ucReserved; //reserved
  7551. UCHAR ucActiveUnitNumPerSH; //requested active CU/RB/PRIM number per shader array
  7552. UCHAR ucMaxUnitNumPerSH; //max CU/RB/PRIM number per shader array
  7553. } GFX_HAVESTING_PARAMETERS;
  7554. //ucGfxBlkId
  7555. #define GFX_HARVESTING_CU_ID 0
  7556. #define GFX_HARVESTING_RB_ID 1
  7557. #define GFX_HARVESTING_PRIM_ID 2
  7558. typedef struct _VBIOS_ROM_HEADER{
  7559. UCHAR PciRomSignature[2];
  7560. UCHAR ucPciRomSizeIn512bytes;
  7561. UCHAR ucJumpCoreMainInitBIOS;
  7562. USHORT usLabelCoreMainInitBIOS;
  7563. UCHAR PciReservedSpace[18];
  7564. USHORT usPciDataStructureOffset;
  7565. UCHAR Rsvd1d_1a[4];
  7566. char strIbm[3];
  7567. UCHAR CheckSum[14];
  7568. UCHAR ucBiosMsgNumber;
  7569. char str761295520[16];
  7570. USHORT usLabelCoreVPOSTNoMode;
  7571. USHORT usSpecialPostOffset;
  7572. UCHAR ucSpeicalPostImageSizeIn512Bytes;
  7573. UCHAR Rsved47_45[3];
  7574. USHORT usROM_HeaderInformationTableOffset;
  7575. UCHAR Rsved4f_4a[6];
  7576. char strBuildTimeStamp[20];
  7577. UCHAR ucJumpCoreXFuncFarHandler;
  7578. USHORT usCoreXFuncFarHandlerOffset;
  7579. UCHAR ucRsved67;
  7580. UCHAR ucJumpCoreVFuncFarHandler;
  7581. USHORT usCoreVFuncFarHandlerOffset;
  7582. UCHAR Rsved6d_6b[3];
  7583. USHORT usATOM_BIOS_MESSAGE_Offset;
  7584. }VBIOS_ROM_HEADER;
  7585. /****************************************************************************/
  7586. //Portion VI: Definitinos for vbios MC scratch registers that driver used
  7587. /****************************************************************************/
  7588. #define MC_MISC0__MEMORY_TYPE_MASK 0xF0000000
  7589. #define MC_MISC0__MEMORY_TYPE__GDDR1 0x10000000
  7590. #define MC_MISC0__MEMORY_TYPE__DDR2 0x20000000
  7591. #define MC_MISC0__MEMORY_TYPE__GDDR3 0x30000000
  7592. #define MC_MISC0__MEMORY_TYPE__GDDR4 0x40000000
  7593. #define MC_MISC0__MEMORY_TYPE__GDDR5 0x50000000
  7594. #define MC_MISC0__MEMORY_TYPE__HBM 0x60000000
  7595. #define MC_MISC0__MEMORY_TYPE__DDR3 0xB0000000
  7596. #define ATOM_MEM_TYPE_DDR_STRING "DDR"
  7597. #define ATOM_MEM_TYPE_DDR2_STRING "DDR2"
  7598. #define ATOM_MEM_TYPE_GDDR3_STRING "GDDR3"
  7599. #define ATOM_MEM_TYPE_GDDR4_STRING "GDDR4"
  7600. #define ATOM_MEM_TYPE_GDDR5_STRING "GDDR5"
  7601. #define ATOM_MEM_TYPE_HBM_STRING "HBM"
  7602. #define ATOM_MEM_TYPE_DDR3_STRING "DDR3"
  7603. /****************************************************************************/
  7604. //Portion VII: Definitinos being oboselete
  7605. /****************************************************************************/
  7606. //==========================================================================================
  7607. //Remove the definitions below when driver is ready!
  7608. typedef struct _ATOM_DAC_INFO
  7609. {
  7610. ATOM_COMMON_TABLE_HEADER sHeader;
  7611. USHORT usMaxFrequency; // in 10kHz unit
  7612. USHORT usReserved;
  7613. }ATOM_DAC_INFO;
  7614. typedef struct _COMPASSIONATE_DATA
  7615. {
  7616. ATOM_COMMON_TABLE_HEADER sHeader;
  7617. //============================== DAC1 portion
  7618. UCHAR ucDAC1_BG_Adjustment;
  7619. UCHAR ucDAC1_DAC_Adjustment;
  7620. USHORT usDAC1_FORCE_Data;
  7621. //============================== DAC2 portion
  7622. UCHAR ucDAC2_CRT2_BG_Adjustment;
  7623. UCHAR ucDAC2_CRT2_DAC_Adjustment;
  7624. USHORT usDAC2_CRT2_FORCE_Data;
  7625. USHORT usDAC2_CRT2_MUX_RegisterIndex;
  7626. UCHAR ucDAC2_CRT2_MUX_RegisterInfo; //Bit[4:0]=Bit position,Bit[7]=1:Active High;=0 Active Low
  7627. UCHAR ucDAC2_NTSC_BG_Adjustment;
  7628. UCHAR ucDAC2_NTSC_DAC_Adjustment;
  7629. USHORT usDAC2_TV1_FORCE_Data;
  7630. USHORT usDAC2_TV1_MUX_RegisterIndex;
  7631. UCHAR ucDAC2_TV1_MUX_RegisterInfo; //Bit[4:0]=Bit position,Bit[7]=1:Active High;=0 Active Low
  7632. UCHAR ucDAC2_CV_BG_Adjustment;
  7633. UCHAR ucDAC2_CV_DAC_Adjustment;
  7634. USHORT usDAC2_CV_FORCE_Data;
  7635. USHORT usDAC2_CV_MUX_RegisterIndex;
  7636. UCHAR ucDAC2_CV_MUX_RegisterInfo; //Bit[4:0]=Bit position,Bit[7]=1:Active High;=0 Active Low
  7637. UCHAR ucDAC2_PAL_BG_Adjustment;
  7638. UCHAR ucDAC2_PAL_DAC_Adjustment;
  7639. USHORT usDAC2_TV2_FORCE_Data;
  7640. }COMPASSIONATE_DATA;
  7641. /****************************Supported Device Info Table Definitions**********************/
  7642. // ucConnectInfo:
  7643. // [7:4] - connector type
  7644. // = 1 - VGA connector
  7645. // = 2 - DVI-I
  7646. // = 3 - DVI-D
  7647. // = 4 - DVI-A
  7648. // = 5 - SVIDEO
  7649. // = 6 - COMPOSITE
  7650. // = 7 - LVDS
  7651. // = 8 - DIGITAL LINK
  7652. // = 9 - SCART
  7653. // = 0xA - HDMI_type A
  7654. // = 0xB - HDMI_type B
  7655. // = 0xE - Special case1 (DVI+DIN)
  7656. // Others=TBD
  7657. // [3:0] - DAC Associated
  7658. // = 0 - no DAC
  7659. // = 1 - DACA
  7660. // = 2 - DACB
  7661. // = 3 - External DAC
  7662. // Others=TBD
  7663. //
  7664. typedef struct _ATOM_CONNECTOR_INFO
  7665. {
  7666. #if ATOM_BIG_ENDIAN
  7667. UCHAR bfConnectorType:4;
  7668. UCHAR bfAssociatedDAC:4;
  7669. #else
  7670. UCHAR bfAssociatedDAC:4;
  7671. UCHAR bfConnectorType:4;
  7672. #endif
  7673. }ATOM_CONNECTOR_INFO;
  7674. typedef union _ATOM_CONNECTOR_INFO_ACCESS
  7675. {
  7676. ATOM_CONNECTOR_INFO sbfAccess;
  7677. UCHAR ucAccess;
  7678. }ATOM_CONNECTOR_INFO_ACCESS;
  7679. typedef struct _ATOM_CONNECTOR_INFO_I2C
  7680. {
  7681. ATOM_CONNECTOR_INFO_ACCESS sucConnectorInfo;
  7682. ATOM_I2C_ID_CONFIG_ACCESS sucI2cId;
  7683. }ATOM_CONNECTOR_INFO_I2C;
  7684. typedef struct _ATOM_SUPPORTED_DEVICES_INFO
  7685. {
  7686. ATOM_COMMON_TABLE_HEADER sHeader;
  7687. USHORT usDeviceSupport;
  7688. ATOM_CONNECTOR_INFO_I2C asConnInfo[ATOM_MAX_SUPPORTED_DEVICE_INFO];
  7689. }ATOM_SUPPORTED_DEVICES_INFO;
  7690. #define NO_INT_SRC_MAPPED 0xFF
  7691. typedef struct _ATOM_CONNECTOR_INC_SRC_BITMAP
  7692. {
  7693. UCHAR ucIntSrcBitmap;
  7694. }ATOM_CONNECTOR_INC_SRC_BITMAP;
  7695. typedef struct _ATOM_SUPPORTED_DEVICES_INFO_2
  7696. {
  7697. ATOM_COMMON_TABLE_HEADER sHeader;
  7698. USHORT usDeviceSupport;
  7699. ATOM_CONNECTOR_INFO_I2C asConnInfo[ATOM_MAX_SUPPORTED_DEVICE_INFO_2];
  7700. ATOM_CONNECTOR_INC_SRC_BITMAP asIntSrcInfo[ATOM_MAX_SUPPORTED_DEVICE_INFO_2];
  7701. }ATOM_SUPPORTED_DEVICES_INFO_2;
  7702. typedef struct _ATOM_SUPPORTED_DEVICES_INFO_2d1
  7703. {
  7704. ATOM_COMMON_TABLE_HEADER sHeader;
  7705. USHORT usDeviceSupport;
  7706. ATOM_CONNECTOR_INFO_I2C asConnInfo[ATOM_MAX_SUPPORTED_DEVICE];
  7707. ATOM_CONNECTOR_INC_SRC_BITMAP asIntSrcInfo[ATOM_MAX_SUPPORTED_DEVICE];
  7708. }ATOM_SUPPORTED_DEVICES_INFO_2d1;
  7709. #define ATOM_SUPPORTED_DEVICES_INFO_LAST ATOM_SUPPORTED_DEVICES_INFO_2d1
  7710. typedef struct _ATOM_MISC_CONTROL_INFO
  7711. {
  7712. USHORT usFrequency;
  7713. UCHAR ucPLL_ChargePump; // PLL charge-pump gain control
  7714. UCHAR ucPLL_DutyCycle; // PLL duty cycle control
  7715. UCHAR ucPLL_VCO_Gain; // PLL VCO gain control
  7716. UCHAR ucPLL_VoltageSwing; // PLL driver voltage swing control
  7717. }ATOM_MISC_CONTROL_INFO;
  7718. #define ATOM_MAX_MISC_INFO 4
  7719. typedef struct _ATOM_TMDS_INFO
  7720. {
  7721. ATOM_COMMON_TABLE_HEADER sHeader;
  7722. USHORT usMaxFrequency; // in 10Khz
  7723. ATOM_MISC_CONTROL_INFO asMiscInfo[ATOM_MAX_MISC_INFO];
  7724. }ATOM_TMDS_INFO;
  7725. typedef struct _ATOM_ENCODER_ANALOG_ATTRIBUTE
  7726. {
  7727. UCHAR ucTVStandard; //Same as TV standards defined above,
  7728. UCHAR ucPadding[1];
  7729. }ATOM_ENCODER_ANALOG_ATTRIBUTE;
  7730. typedef struct _ATOM_ENCODER_DIGITAL_ATTRIBUTE
  7731. {
  7732. UCHAR ucAttribute; //Same as other digital encoder attributes defined above
  7733. UCHAR ucPadding[1];
  7734. }ATOM_ENCODER_DIGITAL_ATTRIBUTE;
  7735. typedef union _ATOM_ENCODER_ATTRIBUTE
  7736. {
  7737. ATOM_ENCODER_ANALOG_ATTRIBUTE sAlgAttrib;
  7738. ATOM_ENCODER_DIGITAL_ATTRIBUTE sDigAttrib;
  7739. }ATOM_ENCODER_ATTRIBUTE;
  7740. typedef struct _DVO_ENCODER_CONTROL_PARAMETERS
  7741. {
  7742. USHORT usPixelClock;
  7743. USHORT usEncoderID;
  7744. UCHAR ucDeviceType; //Use ATOM_DEVICE_xxx1_Index to indicate device type only.
  7745. UCHAR ucAction; //ATOM_ENABLE/ATOM_DISABLE/ATOM_HPD_INIT
  7746. ATOM_ENCODER_ATTRIBUTE usDevAttr;
  7747. }DVO_ENCODER_CONTROL_PARAMETERS;
  7748. typedef struct _DVO_ENCODER_CONTROL_PS_ALLOCATION
  7749. {
  7750. DVO_ENCODER_CONTROL_PARAMETERS sDVOEncoder;
  7751. WRITE_ONE_BYTE_HW_I2C_DATA_PS_ALLOCATION sReserved; //Caller doesn't need to init this portion
  7752. }DVO_ENCODER_CONTROL_PS_ALLOCATION;
  7753. #define ATOM_XTMDS_ASIC_SI164_ID 1
  7754. #define ATOM_XTMDS_ASIC_SI178_ID 2
  7755. #define ATOM_XTMDS_ASIC_TFP513_ID 3
  7756. #define ATOM_XTMDS_SUPPORTED_SINGLELINK 0x00000001
  7757. #define ATOM_XTMDS_SUPPORTED_DUALLINK 0x00000002
  7758. #define ATOM_XTMDS_MVPU_FPGA 0x00000004
  7759. typedef struct _ATOM_XTMDS_INFO
  7760. {
  7761. ATOM_COMMON_TABLE_HEADER sHeader;
  7762. USHORT usSingleLinkMaxFrequency;
  7763. ATOM_I2C_ID_CONFIG_ACCESS sucI2cId; //Point the ID on which I2C is used to control external chip
  7764. UCHAR ucXtransimitterID;
  7765. UCHAR ucSupportedLink; // Bit field, bit0=1, single link supported;bit1=1,dual link supported
  7766. UCHAR ucSequnceAlterID; // Even with the same external TMDS asic, it's possible that the program seqence alters
  7767. // due to design. This ID is used to alert driver that the sequence is not "standard"!
  7768. UCHAR ucMasterAddress; // Address to control Master xTMDS Chip
  7769. UCHAR ucSlaveAddress; // Address to control Slave xTMDS Chip
  7770. }ATOM_XTMDS_INFO;
  7771. typedef struct _DFP_DPMS_STATUS_CHANGE_PARAMETERS
  7772. {
  7773. UCHAR ucEnable; // ATOM_ENABLE=On or ATOM_DISABLE=Off
  7774. UCHAR ucDevice; // ATOM_DEVICE_DFP1_INDEX....
  7775. UCHAR ucPadding[2];
  7776. }DFP_DPMS_STATUS_CHANGE_PARAMETERS;
  7777. /****************************Legacy Power Play Table Definitions **********************/
  7778. //Definitions for ulPowerPlayMiscInfo
  7779. #define ATOM_PM_MISCINFO_SPLIT_CLOCK 0x00000000L
  7780. #define ATOM_PM_MISCINFO_USING_MCLK_SRC 0x00000001L
  7781. #define ATOM_PM_MISCINFO_USING_SCLK_SRC 0x00000002L
  7782. #define ATOM_PM_MISCINFO_VOLTAGE_DROP_SUPPORT 0x00000004L
  7783. #define ATOM_PM_MISCINFO_VOLTAGE_DROP_ACTIVE_HIGH 0x00000008L
  7784. #define ATOM_PM_MISCINFO_LOAD_PERFORMANCE_EN 0x00000010L
  7785. #define ATOM_PM_MISCINFO_ENGINE_CLOCK_CONTRL_EN 0x00000020L
  7786. #define ATOM_PM_MISCINFO_MEMORY_CLOCK_CONTRL_EN 0x00000040L
  7787. #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
  7788. #define ATOM_PM_MISCINFO_ASIC_REDUCED_SPEED_SCLK_EN 0x00000100L
  7789. #define ATOM_PM_MISCINFO_ASIC_DYNAMIC_VOLTAGE_EN 0x00000200L
  7790. #define ATOM_PM_MISCINFO_ASIC_SLEEP_MODE_EN 0x00000400L
  7791. #define ATOM_PM_MISCINFO_LOAD_BALANCE_EN 0x00000800L
  7792. #define ATOM_PM_MISCINFO_DEFAULT_DC_STATE_ENTRY_TRUE 0x00001000L
  7793. #define ATOM_PM_MISCINFO_DEFAULT_LOW_DC_STATE_ENTRY_TRUE 0x00002000L
  7794. #define ATOM_PM_MISCINFO_LOW_LCD_REFRESH_RATE 0x00004000L
  7795. #define ATOM_PM_MISCINFO_DRIVER_DEFAULT_MODE 0x00008000L
  7796. #define ATOM_PM_MISCINFO_OVER_CLOCK_MODE 0x00010000L
  7797. #define ATOM_PM_MISCINFO_OVER_DRIVE_MODE 0x00020000L
  7798. #define ATOM_PM_MISCINFO_POWER_SAVING_MODE 0x00040000L
  7799. #define ATOM_PM_MISCINFO_THERMAL_DIODE_MODE 0x00080000L
  7800. #define ATOM_PM_MISCINFO_FRAME_MODULATION_MASK 0x00300000L //0-FM Disable, 1-2 level FM, 2-4 level FM, 3-Reserved
  7801. #define ATOM_PM_MISCINFO_FRAME_MODULATION_SHIFT 20
  7802. #define ATOM_PM_MISCINFO_DYN_CLK_3D_IDLE 0x00400000L
  7803. #define ATOM_PM_MISCINFO_DYNAMIC_CLOCK_DIVIDER_BY_2 0x00800000L
  7804. #define ATOM_PM_MISCINFO_DYNAMIC_CLOCK_DIVIDER_BY_4 0x01000000L
  7805. #define ATOM_PM_MISCINFO_DYNAMIC_HDP_BLOCK_EN 0x02000000L //When set, Dynamic
  7806. #define ATOM_PM_MISCINFO_DYNAMIC_MC_HOST_BLOCK_EN 0x04000000L //When set, Dynamic
  7807. #define ATOM_PM_MISCINFO_3D_ACCELERATION_EN 0x08000000L //When set, This mode is for acceleated 3D mode
  7808. #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)
  7809. #define ATOM_PM_MISCINFO_POWERPLAY_SETTINGS_GROUP_SHIFT 28
  7810. #define ATOM_PM_MISCINFO_ENABLE_BACK_BIAS 0x80000000L
  7811. #define ATOM_PM_MISCINFO2_SYSTEM_AC_LITE_MODE 0x00000001L
  7812. #define ATOM_PM_MISCINFO2_MULTI_DISPLAY_SUPPORT 0x00000002L
  7813. #define ATOM_PM_MISCINFO2_DYNAMIC_BACK_BIAS_EN 0x00000004L
  7814. #define ATOM_PM_MISCINFO2_FS3D_OVERDRIVE_INFO 0x00000008L
  7815. #define ATOM_PM_MISCINFO2_FORCEDLOWPWR_MODE 0x00000010L
  7816. #define ATOM_PM_MISCINFO2_VDDCI_DYNAMIC_VOLTAGE_EN 0x00000020L
  7817. #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.
  7818. //If it's not set in any pp mode, driver will use its default logic to pick a pp mode in video playback
  7819. #define ATOM_PM_MISCINFO2_NOT_VALID_ON_DC 0x00000080L
  7820. #define ATOM_PM_MISCINFO2_STUTTER_MODE_EN 0x00000100L
  7821. #define ATOM_PM_MISCINFO2_UVD_SUPPORT_MODE 0x00000200L
  7822. //ucTableFormatRevision=1
  7823. //ucTableContentRevision=1
  7824. typedef struct _ATOM_POWERMODE_INFO
  7825. {
  7826. ULONG ulMiscInfo; //The power level should be arranged in ascending order
  7827. ULONG ulReserved1; // must set to 0
  7828. ULONG ulReserved2; // must set to 0
  7829. USHORT usEngineClock;
  7830. USHORT usMemoryClock;
  7831. UCHAR ucVoltageDropIndex; // index to GPIO table
  7832. UCHAR ucSelectedPanel_RefreshRate;// panel refresh rate
  7833. UCHAR ucMinTemperature;
  7834. UCHAR ucMaxTemperature;
  7835. UCHAR ucNumPciELanes; // number of PCIE lanes
  7836. }ATOM_POWERMODE_INFO;
  7837. //ucTableFormatRevision=2
  7838. //ucTableContentRevision=1
  7839. typedef struct _ATOM_POWERMODE_INFO_V2
  7840. {
  7841. ULONG ulMiscInfo; //The power level should be arranged in ascending order
  7842. ULONG ulMiscInfo2;
  7843. ULONG ulEngineClock;
  7844. ULONG ulMemoryClock;
  7845. UCHAR ucVoltageDropIndex; // index to GPIO table
  7846. UCHAR ucSelectedPanel_RefreshRate;// panel refresh rate
  7847. UCHAR ucMinTemperature;
  7848. UCHAR ucMaxTemperature;
  7849. UCHAR ucNumPciELanes; // number of PCIE lanes
  7850. }ATOM_POWERMODE_INFO_V2;
  7851. //ucTableFormatRevision=2
  7852. //ucTableContentRevision=2
  7853. typedef struct _ATOM_POWERMODE_INFO_V3
  7854. {
  7855. ULONG ulMiscInfo; //The power level should be arranged in ascending order
  7856. ULONG ulMiscInfo2;
  7857. ULONG ulEngineClock;
  7858. ULONG ulMemoryClock;
  7859. UCHAR ucVoltageDropIndex; // index to Core (VDDC) votage table
  7860. UCHAR ucSelectedPanel_RefreshRate;// panel refresh rate
  7861. UCHAR ucMinTemperature;
  7862. UCHAR ucMaxTemperature;
  7863. UCHAR ucNumPciELanes; // number of PCIE lanes
  7864. UCHAR ucVDDCI_VoltageDropIndex; // index to VDDCI votage table
  7865. }ATOM_POWERMODE_INFO_V3;
  7866. #define ATOM_MAX_NUMBEROF_POWER_BLOCK 8
  7867. #define ATOM_PP_OVERDRIVE_INTBITMAP_AUXWIN 0x01
  7868. #define ATOM_PP_OVERDRIVE_INTBITMAP_OVERDRIVE 0x02
  7869. #define ATOM_PP_OVERDRIVE_THERMALCONTROLLER_LM63 0x01
  7870. #define ATOM_PP_OVERDRIVE_THERMALCONTROLLER_ADM1032 0x02
  7871. #define ATOM_PP_OVERDRIVE_THERMALCONTROLLER_ADM1030 0x03
  7872. #define ATOM_PP_OVERDRIVE_THERMALCONTROLLER_MUA6649 0x04
  7873. #define ATOM_PP_OVERDRIVE_THERMALCONTROLLER_LM64 0x05
  7874. #define ATOM_PP_OVERDRIVE_THERMALCONTROLLER_F75375 0x06
  7875. #define ATOM_PP_OVERDRIVE_THERMALCONTROLLER_ASC7512 0x07 // Andigilog
  7876. typedef struct _ATOM_POWERPLAY_INFO
  7877. {
  7878. ATOM_COMMON_TABLE_HEADER sHeader;
  7879. UCHAR ucOverdriveThermalController;
  7880. UCHAR ucOverdriveI2cLine;
  7881. UCHAR ucOverdriveIntBitmap;
  7882. UCHAR ucOverdriveControllerAddress;
  7883. UCHAR ucSizeOfPowerModeEntry;
  7884. UCHAR ucNumOfPowerModeEntries;
  7885. ATOM_POWERMODE_INFO asPowerPlayInfo[ATOM_MAX_NUMBEROF_POWER_BLOCK];
  7886. }ATOM_POWERPLAY_INFO;
  7887. typedef struct _ATOM_POWERPLAY_INFO_V2
  7888. {
  7889. ATOM_COMMON_TABLE_HEADER sHeader;
  7890. UCHAR ucOverdriveThermalController;
  7891. UCHAR ucOverdriveI2cLine;
  7892. UCHAR ucOverdriveIntBitmap;
  7893. UCHAR ucOverdriveControllerAddress;
  7894. UCHAR ucSizeOfPowerModeEntry;
  7895. UCHAR ucNumOfPowerModeEntries;
  7896. ATOM_POWERMODE_INFO_V2 asPowerPlayInfo[ATOM_MAX_NUMBEROF_POWER_BLOCK];
  7897. }ATOM_POWERPLAY_INFO_V2;
  7898. typedef struct _ATOM_POWERPLAY_INFO_V3
  7899. {
  7900. ATOM_COMMON_TABLE_HEADER sHeader;
  7901. UCHAR ucOverdriveThermalController;
  7902. UCHAR ucOverdriveI2cLine;
  7903. UCHAR ucOverdriveIntBitmap;
  7904. UCHAR ucOverdriveControllerAddress;
  7905. UCHAR ucSizeOfPowerModeEntry;
  7906. UCHAR ucNumOfPowerModeEntries;
  7907. ATOM_POWERMODE_INFO_V3 asPowerPlayInfo[ATOM_MAX_NUMBEROF_POWER_BLOCK];
  7908. }ATOM_POWERPLAY_INFO_V3;
  7909. /**************************************************************************/
  7910. // Following definitions are for compatiblity issue in different SW components.
  7911. #define ATOM_MASTER_DATA_TABLE_REVISION 0x01
  7912. #define Object_Info Object_Header
  7913. #define AdjustARB_SEQ MC_InitParameter
  7914. #define VRAM_GPIO_DetectionInfo VoltageObjectInfo
  7915. #define ASIC_VDDCI_Info ASIC_ProfilingInfo
  7916. #define ASIC_MVDDQ_Info MemoryTrainingInfo
  7917. #define SS_Info PPLL_SS_Info
  7918. #define ASIC_MVDDC_Info ASIC_InternalSS_Info
  7919. #define DispDevicePriorityInfo SaveRestoreInfo
  7920. #define DispOutInfo TV_VideoMode
  7921. #define ATOM_ENCODER_OBJECT_TABLE ATOM_OBJECT_TABLE
  7922. #define ATOM_CONNECTOR_OBJECT_TABLE ATOM_OBJECT_TABLE
  7923. //New device naming, remove them when both DAL/VBIOS is ready
  7924. #define DFP2I_OUTPUT_CONTROL_PARAMETERS CRT1_OUTPUT_CONTROL_PARAMETERS
  7925. #define DFP2I_OUTPUT_CONTROL_PS_ALLOCATION DFP2I_OUTPUT_CONTROL_PARAMETERS
  7926. #define DFP1X_OUTPUT_CONTROL_PARAMETERS CRT1_OUTPUT_CONTROL_PARAMETERS
  7927. #define DFP1X_OUTPUT_CONTROL_PS_ALLOCATION DFP1X_OUTPUT_CONTROL_PARAMETERS
  7928. #define DFP1I_OUTPUT_CONTROL_PARAMETERS DFP1_OUTPUT_CONTROL_PARAMETERS
  7929. #define DFP1I_OUTPUT_CONTROL_PS_ALLOCATION DFP1_OUTPUT_CONTROL_PS_ALLOCATION
  7930. #define ATOM_DEVICE_DFP1I_SUPPORT ATOM_DEVICE_DFP1_SUPPORT
  7931. #define ATOM_DEVICE_DFP1X_SUPPORT ATOM_DEVICE_DFP2_SUPPORT
  7932. #define ATOM_DEVICE_DFP1I_INDEX ATOM_DEVICE_DFP1_INDEX
  7933. #define ATOM_DEVICE_DFP1X_INDEX ATOM_DEVICE_DFP2_INDEX
  7934. #define ATOM_DEVICE_DFP2I_INDEX 0x00000009
  7935. #define ATOM_DEVICE_DFP2I_SUPPORT (0x1L << ATOM_DEVICE_DFP2I_INDEX)
  7936. #define ATOM_S0_DFP1I ATOM_S0_DFP1
  7937. #define ATOM_S0_DFP1X ATOM_S0_DFP2
  7938. #define ATOM_S0_DFP2I 0x00200000L
  7939. #define ATOM_S0_DFP2Ib2 0x20
  7940. #define ATOM_S2_DFP1I_DPMS_STATE ATOM_S2_DFP1_DPMS_STATE
  7941. #define ATOM_S2_DFP1X_DPMS_STATE ATOM_S2_DFP2_DPMS_STATE
  7942. #define ATOM_S2_DFP2I_DPMS_STATE 0x02000000L
  7943. #define ATOM_S2_DFP2I_DPMS_STATEb3 0x02
  7944. #define ATOM_S3_DFP2I_ACTIVEb1 0x02
  7945. #define ATOM_S3_DFP1I_ACTIVE ATOM_S3_DFP1_ACTIVE
  7946. #define ATOM_S3_DFP1X_ACTIVE ATOM_S3_DFP2_ACTIVE
  7947. #define ATOM_S3_DFP2I_ACTIVE 0x00000200L
  7948. #define ATOM_S3_DFP1I_CRTC_ACTIVE ATOM_S3_DFP1_CRTC_ACTIVE
  7949. #define ATOM_S3_DFP1X_CRTC_ACTIVE ATOM_S3_DFP2_CRTC_ACTIVE
  7950. #define ATOM_S3_DFP2I_CRTC_ACTIVE 0x02000000L
  7951. #define ATOM_S3_DFP2I_CRTC_ACTIVEb3 0x02
  7952. #define ATOM_S5_DOS_REQ_DFP2Ib1 0x02
  7953. #define ATOM_S5_DOS_REQ_DFP2I 0x0200
  7954. #define ATOM_S6_ACC_REQ_DFP1I ATOM_S6_ACC_REQ_DFP1
  7955. #define ATOM_S6_ACC_REQ_DFP1X ATOM_S6_ACC_REQ_DFP2
  7956. #define ATOM_S6_ACC_REQ_DFP2Ib3 0x02
  7957. #define ATOM_S6_ACC_REQ_DFP2I 0x02000000L
  7958. #define TMDS1XEncoderControl DVOEncoderControl
  7959. #define DFP1XOutputControl DVOOutputControl
  7960. #define ExternalDFPOutputControl DFP1XOutputControl
  7961. #define EnableExternalTMDS_Encoder TMDS1XEncoderControl
  7962. #define DFP1IOutputControl TMDSAOutputControl
  7963. #define DFP2IOutputControl LVTMAOutputControl
  7964. #define DAC1_ENCODER_CONTROL_PARAMETERS DAC_ENCODER_CONTROL_PARAMETERS
  7965. #define DAC1_ENCODER_CONTROL_PS_ALLOCATION DAC_ENCODER_CONTROL_PS_ALLOCATION
  7966. #define DAC2_ENCODER_CONTROL_PARAMETERS DAC_ENCODER_CONTROL_PARAMETERS
  7967. #define DAC2_ENCODER_CONTROL_PS_ALLOCATION DAC_ENCODER_CONTROL_PS_ALLOCATION
  7968. #define ucDac1Standard ucDacStandard
  7969. #define ucDac2Standard ucDacStandard
  7970. #define TMDS1EncoderControl TMDSAEncoderControl
  7971. #define TMDS2EncoderControl LVTMAEncoderControl
  7972. #define DFP1OutputControl TMDSAOutputControl
  7973. #define DFP2OutputControl LVTMAOutputControl
  7974. #define CRT1OutputControl DAC1OutputControl
  7975. #define CRT2OutputControl DAC2OutputControl
  7976. //These two lines will be removed for sure in a few days, will follow up with Michael V.
  7977. #define EnableLVDS_SS EnableSpreadSpectrumOnPPLL
  7978. #define ENABLE_LVDS_SS_PARAMETERS_V3 ENABLE_SPREAD_SPECTRUM_ON_PPLL
  7979. #define ATOM_S2_CRT1_DPMS_STATE 0x00010000L
  7980. #define ATOM_S2_LCD1_DPMS_STATE ATOM_S2_CRT1_DPMS_STATE
  7981. #define ATOM_S2_TV1_DPMS_STATE ATOM_S2_CRT1_DPMS_STATE
  7982. #define ATOM_S2_DFP1_DPMS_STATE ATOM_S2_CRT1_DPMS_STATE
  7983. #define ATOM_S2_CRT2_DPMS_STATE ATOM_S2_CRT1_DPMS_STATE
  7984. #define ATOM_S6_ACC_REQ_TV2 0x00400000L
  7985. #define ATOM_DEVICE_TV2_INDEX 0x00000006
  7986. #define ATOM_DEVICE_TV2_SUPPORT (0x1L << ATOM_DEVICE_TV2_INDEX)
  7987. #define ATOM_S0_TV2 0x00100000L
  7988. #define ATOM_S3_TV2_ACTIVE ATOM_S3_DFP6_ACTIVE
  7989. #define ATOM_S3_TV2_CRTC_ACTIVE ATOM_S3_DFP6_CRTC_ACTIVE
  7990. /*********************************************************************************/
  7991. #pragma pack() // BIOS data must use byte alignment
  7992. #pragma pack(1)
  7993. typedef struct _ATOM_HOLE_INFO
  7994. {
  7995. USHORT usOffset; // offset of the hole ( from the start of the binary )
  7996. USHORT usLength; // length of the hole ( in bytes )
  7997. }ATOM_HOLE_INFO;
  7998. typedef struct _ATOM_SERVICE_DESCRIPTION
  7999. {
  8000. UCHAR ucRevision; // Holes set revision
  8001. UCHAR ucAlgorithm; // Hash algorithm
  8002. UCHAR ucSignatureType; // Signature type ( 0 - no signature, 1 - test, 2 - production )
  8003. UCHAR ucReserved;
  8004. USHORT usSigOffset; // Signature offset ( from the start of the binary )
  8005. USHORT usSigLength; // Signature length
  8006. }ATOM_SERVICE_DESCRIPTION;
  8007. typedef struct _ATOM_SERVICE_INFO
  8008. {
  8009. ATOM_COMMON_TABLE_HEADER asHeader;
  8010. ATOM_SERVICE_DESCRIPTION asDescr;
  8011. UCHAR ucholesNo; // number of holes that follow
  8012. ATOM_HOLE_INFO holes[1]; // array of hole descriptions
  8013. }ATOM_SERVICE_INFO;
  8014. #pragma pack() // BIOS data must use byte alignment
  8015. //
  8016. // AMD ACPI Table
  8017. //
  8018. #pragma pack(1)
  8019. typedef struct {
  8020. ULONG Signature;
  8021. ULONG TableLength; //Length
  8022. UCHAR Revision;
  8023. UCHAR Checksum;
  8024. UCHAR OemId[6];
  8025. UCHAR OemTableId[8]; //UINT64 OemTableId;
  8026. ULONG OemRevision;
  8027. ULONG CreatorId;
  8028. ULONG CreatorRevision;
  8029. } AMD_ACPI_DESCRIPTION_HEADER;
  8030. /*
  8031. //EFI_ACPI_DESCRIPTION_HEADER from AcpiCommon.h
  8032. typedef struct {
  8033. UINT32 Signature; //0x0
  8034. UINT32 Length; //0x4
  8035. UINT8 Revision; //0x8
  8036. UINT8 Checksum; //0x9
  8037. UINT8 OemId[6]; //0xA
  8038. UINT64 OemTableId; //0x10
  8039. UINT32 OemRevision; //0x18
  8040. UINT32 CreatorId; //0x1C
  8041. UINT32 CreatorRevision; //0x20
  8042. }EFI_ACPI_DESCRIPTION_HEADER;
  8043. */
  8044. typedef struct {
  8045. AMD_ACPI_DESCRIPTION_HEADER SHeader;
  8046. UCHAR TableUUID[16]; //0x24
  8047. ULONG VBIOSImageOffset; //0x34. Offset to the first GOP_VBIOS_CONTENT block from the beginning of the stucture.
  8048. ULONG Lib1ImageOffset; //0x38. Offset to the first GOP_LIB1_CONTENT block from the beginning of the stucture.
  8049. ULONG Reserved[4]; //0x3C
  8050. }UEFI_ACPI_VFCT;
  8051. typedef struct {
  8052. ULONG PCIBus; //0x4C
  8053. ULONG PCIDevice; //0x50
  8054. ULONG PCIFunction; //0x54
  8055. USHORT VendorID; //0x58
  8056. USHORT DeviceID; //0x5A
  8057. USHORT SSVID; //0x5C
  8058. USHORT SSID; //0x5E
  8059. ULONG Revision; //0x60
  8060. ULONG ImageLength; //0x64
  8061. }VFCT_IMAGE_HEADER;
  8062. typedef struct {
  8063. VFCT_IMAGE_HEADER VbiosHeader;
  8064. UCHAR VbiosContent[1];
  8065. }GOP_VBIOS_CONTENT;
  8066. typedef struct {
  8067. VFCT_IMAGE_HEADER Lib1Header;
  8068. UCHAR Lib1Content[1];
  8069. }GOP_LIB1_CONTENT;
  8070. #pragma pack()
  8071. #endif /* _ATOMBIOS_H */
  8072. #include "pptable.h"