atombios.h 390 KB

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