atombios.h 381 KB

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