1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188 |
- /*
- * Copyright 2011 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors: Alex Deucher
- */
- #include "drmP.h"
- #include "radeon.h"
- #include "btcd.h"
- #include "r600_dpm.h"
- #include "cypress_dpm.h"
- #include "btc_dpm.h"
- #include "atom.h"
- #define MC_CG_ARB_FREQ_F0 0x0a
- #define MC_CG_ARB_FREQ_F1 0x0b
- #define MC_CG_ARB_FREQ_F2 0x0c
- #define MC_CG_ARB_FREQ_F3 0x0d
- #define MC_CG_SEQ_DRAMCONF_S0 0x05
- #define MC_CG_SEQ_DRAMCONF_S1 0x06
- #define MC_CG_SEQ_YCLK_SUSPEND 0x04
- #define MC_CG_SEQ_YCLK_RESUME 0x0a
- #define SMC_RAM_END 0x8000
- #ifndef BTC_MGCG_SEQUENCE
- #define BTC_MGCG_SEQUENCE 300
- struct rv7xx_ps *rv770_get_ps(struct radeon_ps *rps);
- struct rv7xx_power_info *rv770_get_pi(struct radeon_device *rdev);
- struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
- //********* BARTS **************//
- static const u32 barts_cgcg_cgls_default[] =
- {
- /* Register, Value, Mask bits */
- 0x000008f8, 0x00000010, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000011, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000012, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000013, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000014, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000015, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000016, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000017, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000018, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000019, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000001a, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000001b, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000020, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000021, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000022, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000023, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000024, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000025, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000026, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000027, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000028, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000029, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000002a, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000002b, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff
- };
- #define BARTS_CGCG_CGLS_DEFAULT_LENGTH sizeof(barts_cgcg_cgls_default) / (3 * sizeof(u32))
- static const u32 barts_cgcg_cgls_disable[] =
- {
- 0x000008f8, 0x00000010, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000011, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000012, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000013, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000014, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000015, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000016, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000017, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000018, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000019, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x0000001a, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x0000001b, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000020, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000021, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000022, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000023, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000024, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000025, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000026, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000027, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000028, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000029, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000002a, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000002b, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x00000644, 0x000f7912, 0x001f4180,
- 0x00000644, 0x000f3812, 0x001f4180
- };
- #define BARTS_CGCG_CGLS_DISABLE_LENGTH sizeof(barts_cgcg_cgls_disable) / (3 * sizeof(u32))
- static const u32 barts_cgcg_cgls_enable[] =
- {
- /* 0x0000c124, 0x84180000, 0x00180000, */
- 0x00000644, 0x000f7892, 0x001f4080,
- 0x000008f8, 0x00000010, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000011, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000012, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000013, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000014, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000015, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000016, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000017, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000018, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000019, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000001a, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000001b, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000020, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000021, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000022, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000023, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000024, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000025, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000026, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000027, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000028, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000029, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x0000002a, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x0000002b, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff
- };
- #define BARTS_CGCG_CGLS_ENABLE_LENGTH sizeof(barts_cgcg_cgls_enable) / (3 * sizeof(u32))
- static const u32 barts_mgcg_default[] =
- {
- 0x0000802c, 0xc0000000, 0xffffffff,
- 0x00005448, 0x00000100, 0xffffffff,
- 0x000055e4, 0x00600100, 0xffffffff,
- 0x0000160c, 0x00000100, 0xffffffff,
- 0x0000c164, 0x00000100, 0xffffffff,
- 0x00008a18, 0x00000100, 0xffffffff,
- 0x0000897c, 0x06000100, 0xffffffff,
- 0x00008b28, 0x00000100, 0xffffffff,
- 0x00009144, 0x00000100, 0xffffffff,
- 0x00009a60, 0x00000100, 0xffffffff,
- 0x00009868, 0x00000100, 0xffffffff,
- 0x00008d58, 0x00000100, 0xffffffff,
- 0x00009510, 0x00000100, 0xffffffff,
- 0x0000949c, 0x00000100, 0xffffffff,
- 0x00009654, 0x00000100, 0xffffffff,
- 0x00009030, 0x00000100, 0xffffffff,
- 0x00009034, 0x00000100, 0xffffffff,
- 0x00009038, 0x00000100, 0xffffffff,
- 0x0000903c, 0x00000100, 0xffffffff,
- 0x00009040, 0x00000100, 0xffffffff,
- 0x0000a200, 0x00000100, 0xffffffff,
- 0x0000a204, 0x00000100, 0xffffffff,
- 0x0000a208, 0x00000100, 0xffffffff,
- 0x0000a20c, 0x00000100, 0xffffffff,
- 0x0000977c, 0x00000100, 0xffffffff,
- 0x00003f80, 0x00000100, 0xffffffff,
- 0x0000a210, 0x00000100, 0xffffffff,
- 0x0000a214, 0x00000100, 0xffffffff,
- 0x000004d8, 0x00000100, 0xffffffff,
- 0x00009784, 0x00000100, 0xffffffff,
- 0x00009698, 0x00000100, 0xffffffff,
- 0x000004d4, 0x00000200, 0xffffffff,
- 0x000004d0, 0x00000000, 0xffffffff,
- 0x000030cc, 0x00000100, 0xffffffff,
- 0x0000d0c0, 0xff000100, 0xffffffff,
- 0x0000802c, 0x40000000, 0xffffffff,
- 0x0000915c, 0x00010000, 0xffffffff,
- 0x00009160, 0x00030002, 0xffffffff,
- 0x00009164, 0x00050004, 0xffffffff,
- 0x00009168, 0x00070006, 0xffffffff,
- 0x00009178, 0x00070000, 0xffffffff,
- 0x0000917c, 0x00030002, 0xffffffff,
- 0x00009180, 0x00050004, 0xffffffff,
- 0x0000918c, 0x00010006, 0xffffffff,
- 0x00009190, 0x00090008, 0xffffffff,
- 0x00009194, 0x00070000, 0xffffffff,
- 0x00009198, 0x00030002, 0xffffffff,
- 0x0000919c, 0x00050004, 0xffffffff,
- 0x000091a8, 0x00010006, 0xffffffff,
- 0x000091ac, 0x00090008, 0xffffffff,
- 0x000091b0, 0x00070000, 0xffffffff,
- 0x000091b4, 0x00030002, 0xffffffff,
- 0x000091b8, 0x00050004, 0xffffffff,
- 0x000091c4, 0x00010006, 0xffffffff,
- 0x000091c8, 0x00090008, 0xffffffff,
- 0x000091cc, 0x00070000, 0xffffffff,
- 0x000091d0, 0x00030002, 0xffffffff,
- 0x000091d4, 0x00050004, 0xffffffff,
- 0x000091e0, 0x00010006, 0xffffffff,
- 0x000091e4, 0x00090008, 0xffffffff,
- 0x000091e8, 0x00000000, 0xffffffff,
- 0x000091ec, 0x00070000, 0xffffffff,
- 0x000091f0, 0x00030002, 0xffffffff,
- 0x000091f4, 0x00050004, 0xffffffff,
- 0x00009200, 0x00010006, 0xffffffff,
- 0x00009204, 0x00090008, 0xffffffff,
- 0x00009208, 0x00070000, 0xffffffff,
- 0x0000920c, 0x00030002, 0xffffffff,
- 0x00009210, 0x00050004, 0xffffffff,
- 0x0000921c, 0x00010006, 0xffffffff,
- 0x00009220, 0x00090008, 0xffffffff,
- 0x00009224, 0x00070000, 0xffffffff,
- 0x00009228, 0x00030002, 0xffffffff,
- 0x0000922c, 0x00050004, 0xffffffff,
- 0x00009238, 0x00010006, 0xffffffff,
- 0x0000923c, 0x00090008, 0xffffffff,
- 0x00009294, 0x00000000, 0xffffffff,
- 0x0000802c, 0x40010000, 0xffffffff,
- 0x0000915c, 0x00010000, 0xffffffff,
- 0x00009160, 0x00030002, 0xffffffff,
- 0x00009164, 0x00050004, 0xffffffff,
- 0x00009168, 0x00070006, 0xffffffff,
- 0x00009178, 0x00070000, 0xffffffff,
- 0x0000917c, 0x00030002, 0xffffffff,
- 0x00009180, 0x00050004, 0xffffffff,
- 0x0000918c, 0x00010006, 0xffffffff,
- 0x00009190, 0x00090008, 0xffffffff,
- 0x00009194, 0x00070000, 0xffffffff,
- 0x00009198, 0x00030002, 0xffffffff,
- 0x0000919c, 0x00050004, 0xffffffff,
- 0x000091a8, 0x00010006, 0xffffffff,
- 0x000091ac, 0x00090008, 0xffffffff,
- 0x000091b0, 0x00070000, 0xffffffff,
- 0x000091b4, 0x00030002, 0xffffffff,
- 0x000091b8, 0x00050004, 0xffffffff,
- 0x000091c4, 0x00010006, 0xffffffff,
- 0x000091c8, 0x00090008, 0xffffffff,
- 0x000091cc, 0x00070000, 0xffffffff,
- 0x000091d0, 0x00030002, 0xffffffff,
- 0x000091d4, 0x00050004, 0xffffffff,
- 0x000091e0, 0x00010006, 0xffffffff,
- 0x000091e4, 0x00090008, 0xffffffff,
- 0x000091e8, 0x00000000, 0xffffffff,
- 0x000091ec, 0x00070000, 0xffffffff,
- 0x000091f0, 0x00030002, 0xffffffff,
- 0x000091f4, 0x00050004, 0xffffffff,
- 0x00009200, 0x00010006, 0xffffffff,
- 0x00009204, 0x00090008, 0xffffffff,
- 0x00009208, 0x00070000, 0xffffffff,
- 0x0000920c, 0x00030002, 0xffffffff,
- 0x00009210, 0x00050004, 0xffffffff,
- 0x0000921c, 0x00010006, 0xffffffff,
- 0x00009220, 0x00090008, 0xffffffff,
- 0x00009224, 0x00070000, 0xffffffff,
- 0x00009228, 0x00030002, 0xffffffff,
- 0x0000922c, 0x00050004, 0xffffffff,
- 0x00009238, 0x00010006, 0xffffffff,
- 0x0000923c, 0x00090008, 0xffffffff,
- 0x00009294, 0x00000000, 0xffffffff,
- 0x0000802c, 0xc0000000, 0xffffffff,
- 0x000008f8, 0x00000010, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000011, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000012, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000013, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000014, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000015, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000016, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000017, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000018, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000019, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000001a, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000001b, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff
- };
- #define BARTS_MGCG_DEFAULT_LENGTH sizeof(barts_mgcg_default) / (3 * sizeof(u32))
- static const u32 barts_mgcg_disable[] =
- {
- 0x0000802c, 0xc0000000, 0xffffffff,
- 0x000008f8, 0x00000000, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000001, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000002, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000003, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x00009150, 0x00600000, 0xffffffff
- };
- #define BARTS_MGCG_DISABLE_LENGTH sizeof(barts_mgcg_disable) / (3 * sizeof(u32))
- static const u32 barts_mgcg_enable[] =
- {
- 0x0000802c, 0xc0000000, 0xffffffff,
- 0x000008f8, 0x00000000, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000001, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000002, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000003, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x00009150, 0x81944000, 0xffffffff
- };
- #define BARTS_MGCG_ENABLE_LENGTH sizeof(barts_mgcg_enable) / (3 * sizeof(u32))
- //********* CAICOS **************//
- static const u32 caicos_cgcg_cgls_default[] =
- {
- 0x000008f8, 0x00000010, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000011, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000012, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000013, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000014, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000015, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000016, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000017, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000018, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000019, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000001a, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000001b, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000020, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000021, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000022, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000023, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000024, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000025, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000026, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000027, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000028, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000029, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000002a, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000002b, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff
- };
- #define CAICOS_CGCG_CGLS_DEFAULT_LENGTH sizeof(caicos_cgcg_cgls_default) / (3 * sizeof(u32))
- static const u32 caicos_cgcg_cgls_disable[] =
- {
- 0x000008f8, 0x00000010, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000011, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000012, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000013, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000014, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000015, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000016, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000017, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000018, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000019, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x0000001a, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x0000001b, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000020, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000021, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000022, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000023, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000024, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000025, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000026, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000027, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000028, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000029, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000002a, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000002b, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x00000644, 0x000f7912, 0x001f4180,
- 0x00000644, 0x000f3812, 0x001f4180
- };
- #define CAICOS_CGCG_CGLS_DISABLE_LENGTH sizeof(caicos_cgcg_cgls_disable) / (3 * sizeof(u32))
- static const u32 caicos_cgcg_cgls_enable[] =
- {
- /* 0x0000c124, 0x84180000, 0x00180000, */
- 0x00000644, 0x000f7892, 0x001f4080,
- 0x000008f8, 0x00000010, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000011, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000012, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000013, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000014, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000015, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000016, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000017, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000018, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000019, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000001a, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000001b, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000020, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000021, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000022, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000023, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000024, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000025, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000026, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000027, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000028, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000029, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x0000002a, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x0000002b, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff
- };
- #define CAICOS_CGCG_CGLS_ENABLE_LENGTH sizeof(caicos_cgcg_cgls_enable) / (3 * sizeof(u32))
- static const u32 caicos_mgcg_default[] =
- {
- 0x0000802c, 0xc0000000, 0xffffffff,
- 0x00005448, 0x00000100, 0xffffffff,
- 0x000055e4, 0x00600100, 0xffffffff,
- 0x0000160c, 0x00000100, 0xffffffff,
- 0x0000c164, 0x00000100, 0xffffffff,
- 0x00008a18, 0x00000100, 0xffffffff,
- 0x0000897c, 0x06000100, 0xffffffff,
- 0x00008b28, 0x00000100, 0xffffffff,
- 0x00009144, 0x00000100, 0xffffffff,
- 0x00009a60, 0x00000100, 0xffffffff,
- 0x00009868, 0x00000100, 0xffffffff,
- 0x00008d58, 0x00000100, 0xffffffff,
- 0x00009510, 0x00000100, 0xffffffff,
- 0x0000949c, 0x00000100, 0xffffffff,
- 0x00009654, 0x00000100, 0xffffffff,
- 0x00009030, 0x00000100, 0xffffffff,
- 0x00009034, 0x00000100, 0xffffffff,
- 0x00009038, 0x00000100, 0xffffffff,
- 0x0000903c, 0x00000100, 0xffffffff,
- 0x00009040, 0x00000100, 0xffffffff,
- 0x0000a200, 0x00000100, 0xffffffff,
- 0x0000a204, 0x00000100, 0xffffffff,
- 0x0000a208, 0x00000100, 0xffffffff,
- 0x0000a20c, 0x00000100, 0xffffffff,
- 0x0000977c, 0x00000100, 0xffffffff,
- 0x00003f80, 0x00000100, 0xffffffff,
- 0x0000a210, 0x00000100, 0xffffffff,
- 0x0000a214, 0x00000100, 0xffffffff,
- 0x000004d8, 0x00000100, 0xffffffff,
- 0x00009784, 0x00000100, 0xffffffff,
- 0x00009698, 0x00000100, 0xffffffff,
- 0x000004d4, 0x00000200, 0xffffffff,
- 0x000004d0, 0x00000000, 0xffffffff,
- 0x000030cc, 0x00000100, 0xffffffff,
- 0x0000d0c0, 0xff000100, 0xffffffff,
- 0x0000915c, 0x00010000, 0xffffffff,
- 0x00009160, 0x00030002, 0xffffffff,
- 0x00009164, 0x00050004, 0xffffffff,
- 0x00009168, 0x00070006, 0xffffffff,
- 0x00009178, 0x00070000, 0xffffffff,
- 0x0000917c, 0x00030002, 0xffffffff,
- 0x00009180, 0x00050004, 0xffffffff,
- 0x0000918c, 0x00010006, 0xffffffff,
- 0x00009190, 0x00090008, 0xffffffff,
- 0x00009194, 0x00070000, 0xffffffff,
- 0x00009198, 0x00030002, 0xffffffff,
- 0x0000919c, 0x00050004, 0xffffffff,
- 0x000091a8, 0x00010006, 0xffffffff,
- 0x000091ac, 0x00090008, 0xffffffff,
- 0x000091e8, 0x00000000, 0xffffffff,
- 0x00009294, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000010, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000011, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000012, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000013, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000014, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000015, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000016, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000017, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000018, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000019, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000001a, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000001b, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff
- };
- #define CAICOS_MGCG_DEFAULT_LENGTH sizeof(caicos_mgcg_default) / (3 * sizeof(u32))
- static const u32 caicos_mgcg_disable[] =
- {
- 0x0000802c, 0xc0000000, 0xffffffff,
- 0x000008f8, 0x00000000, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000001, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000002, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000003, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x00009150, 0x00600000, 0xffffffff
- };
- #define CAICOS_MGCG_DISABLE_LENGTH sizeof(caicos_mgcg_disable) / (3 * sizeof(u32))
- static const u32 caicos_mgcg_enable[] =
- {
- 0x0000802c, 0xc0000000, 0xffffffff,
- 0x000008f8, 0x00000000, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000001, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000002, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000003, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x00009150, 0x46944040, 0xffffffff
- };
- #define CAICOS_MGCG_ENABLE_LENGTH sizeof(caicos_mgcg_enable) / (3 * sizeof(u32))
- //********* TURKS **************//
- static const u32 turks_cgcg_cgls_default[] =
- {
- 0x000008f8, 0x00000010, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000011, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000012, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000013, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000014, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000015, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000016, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000017, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000018, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000019, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000001a, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000001b, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000020, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000021, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000022, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000023, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000024, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000025, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000026, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000027, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000028, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000029, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000002a, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000002b, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff
- };
- #define TURKS_CGCG_CGLS_DEFAULT_LENGTH sizeof(turks_cgcg_cgls_default) / (3 * sizeof(u32))
- static const u32 turks_cgcg_cgls_disable[] =
- {
- 0x000008f8, 0x00000010, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000011, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000012, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000013, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000014, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000015, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000016, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000017, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000018, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000019, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x0000001a, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x0000001b, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000020, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000021, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000022, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000023, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000024, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000025, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000026, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000027, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000028, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000029, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000002a, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000002b, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x00000644, 0x000f7912, 0x001f4180,
- 0x00000644, 0x000f3812, 0x001f4180
- };
- #define TURKS_CGCG_CGLS_DISABLE_LENGTH sizeof(turks_cgcg_cgls_disable) / (3 * sizeof(u32))
- static const u32 turks_cgcg_cgls_enable[] =
- {
- /* 0x0000c124, 0x84180000, 0x00180000, */
- 0x00000644, 0x000f7892, 0x001f4080,
- 0x000008f8, 0x00000010, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000011, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000012, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000013, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000014, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000015, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000016, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000017, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000018, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000019, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000001a, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000001b, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000020, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000021, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000022, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000023, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000024, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000025, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000026, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000027, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000028, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000029, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x0000002a, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x0000002b, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff
- };
- #define TURKS_CGCG_CGLS_ENABLE_LENGTH sizeof(turks_cgcg_cgls_enable) / (3 * sizeof(u32))
- // These are the sequences for turks_mgcg_shls
- static const u32 turks_mgcg_default[] =
- {
- 0x0000802c, 0xc0000000, 0xffffffff,
- 0x00005448, 0x00000100, 0xffffffff,
- 0x000055e4, 0x00600100, 0xffffffff,
- 0x0000160c, 0x00000100, 0xffffffff,
- 0x0000c164, 0x00000100, 0xffffffff,
- 0x00008a18, 0x00000100, 0xffffffff,
- 0x0000897c, 0x06000100, 0xffffffff,
- 0x00008b28, 0x00000100, 0xffffffff,
- 0x00009144, 0x00000100, 0xffffffff,
- 0x00009a60, 0x00000100, 0xffffffff,
- 0x00009868, 0x00000100, 0xffffffff,
- 0x00008d58, 0x00000100, 0xffffffff,
- 0x00009510, 0x00000100, 0xffffffff,
- 0x0000949c, 0x00000100, 0xffffffff,
- 0x00009654, 0x00000100, 0xffffffff,
- 0x00009030, 0x00000100, 0xffffffff,
- 0x00009034, 0x00000100, 0xffffffff,
- 0x00009038, 0x00000100, 0xffffffff,
- 0x0000903c, 0x00000100, 0xffffffff,
- 0x00009040, 0x00000100, 0xffffffff,
- 0x0000a200, 0x00000100, 0xffffffff,
- 0x0000a204, 0x00000100, 0xffffffff,
- 0x0000a208, 0x00000100, 0xffffffff,
- 0x0000a20c, 0x00000100, 0xffffffff,
- 0x0000977c, 0x00000100, 0xffffffff,
- 0x00003f80, 0x00000100, 0xffffffff,
- 0x0000a210, 0x00000100, 0xffffffff,
- 0x0000a214, 0x00000100, 0xffffffff,
- 0x000004d8, 0x00000100, 0xffffffff,
- 0x00009784, 0x00000100, 0xffffffff,
- 0x00009698, 0x00000100, 0xffffffff,
- 0x000004d4, 0x00000200, 0xffffffff,
- 0x000004d0, 0x00000000, 0xffffffff,
- 0x000030cc, 0x00000100, 0xffffffff,
- 0x0000d0c0, 0x00000100, 0xffffffff,
- 0x0000915c, 0x00010000, 0xffffffff,
- 0x00009160, 0x00030002, 0xffffffff,
- 0x00009164, 0x00050004, 0xffffffff,
- 0x00009168, 0x00070006, 0xffffffff,
- 0x00009178, 0x00070000, 0xffffffff,
- 0x0000917c, 0x00030002, 0xffffffff,
- 0x00009180, 0x00050004, 0xffffffff,
- 0x0000918c, 0x00010006, 0xffffffff,
- 0x00009190, 0x00090008, 0xffffffff,
- 0x00009194, 0x00070000, 0xffffffff,
- 0x00009198, 0x00030002, 0xffffffff,
- 0x0000919c, 0x00050004, 0xffffffff,
- 0x000091a8, 0x00010006, 0xffffffff,
- 0x000091ac, 0x00090008, 0xffffffff,
- 0x000091b0, 0x00070000, 0xffffffff,
- 0x000091b4, 0x00030002, 0xffffffff,
- 0x000091b8, 0x00050004, 0xffffffff,
- 0x000091c4, 0x00010006, 0xffffffff,
- 0x000091c8, 0x00090008, 0xffffffff,
- 0x000091cc, 0x00070000, 0xffffffff,
- 0x000091d0, 0x00030002, 0xffffffff,
- 0x000091d4, 0x00050004, 0xffffffff,
- 0x000091e0, 0x00010006, 0xffffffff,
- 0x000091e4, 0x00090008, 0xffffffff,
- 0x000091e8, 0x00000000, 0xffffffff,
- 0x000091ec, 0x00070000, 0xffffffff,
- 0x000091f0, 0x00030002, 0xffffffff,
- 0x000091f4, 0x00050004, 0xffffffff,
- 0x00009200, 0x00010006, 0xffffffff,
- 0x00009204, 0x00090008, 0xffffffff,
- 0x00009208, 0x00070000, 0xffffffff,
- 0x0000920c, 0x00030002, 0xffffffff,
- 0x00009210, 0x00050004, 0xffffffff,
- 0x0000921c, 0x00010006, 0xffffffff,
- 0x00009220, 0x00090008, 0xffffffff,
- 0x00009294, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000010, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000011, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000012, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000013, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000014, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000015, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000016, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000017, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000018, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000019, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000001a, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x0000001b, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff
- };
- #define TURKS_MGCG_DEFAULT_LENGTH sizeof(turks_mgcg_default) / (3 * sizeof(u32))
- static const u32 turks_mgcg_disable[] =
- {
- 0x0000802c, 0xc0000000, 0xffffffff,
- 0x000008f8, 0x00000000, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000001, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000002, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x000008f8, 0x00000003, 0xffffffff,
- 0x000008fc, 0xffffffff, 0xffffffff,
- 0x00009150, 0x00600000, 0xffffffff
- };
- #define TURKS_MGCG_DISABLE_LENGTH sizeof(turks_mgcg_disable) / (3 * sizeof(u32))
- static const u32 turks_mgcg_enable[] =
- {
- 0x0000802c, 0xc0000000, 0xffffffff,
- 0x000008f8, 0x00000000, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000001, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000002, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x000008f8, 0x00000003, 0xffffffff,
- 0x000008fc, 0x00000000, 0xffffffff,
- 0x00009150, 0x6e944000, 0xffffffff
- };
- #define TURKS_MGCG_ENABLE_LENGTH sizeof(turks_mgcg_enable) / (3 * sizeof(u32))
- #endif
- #ifndef BTC_SYSLS_SEQUENCE
- #define BTC_SYSLS_SEQUENCE 100
- //********* BARTS **************//
- static const u32 barts_sysls_default[] =
- {
- /* Register, Value, Mask bits */
- 0x000055e8, 0x00000000, 0xffffffff,
- 0x0000d0bc, 0x00000000, 0xffffffff,
- 0x000015c0, 0x000c1401, 0xffffffff,
- 0x0000264c, 0x000c0400, 0xffffffff,
- 0x00002648, 0x000c0400, 0xffffffff,
- 0x00002650, 0x000c0400, 0xffffffff,
- 0x000020b8, 0x000c0400, 0xffffffff,
- 0x000020bc, 0x000c0400, 0xffffffff,
- 0x000020c0, 0x000c0c80, 0xffffffff,
- 0x0000f4a0, 0x000000c0, 0xffffffff,
- 0x0000f4a4, 0x00680fff, 0xffffffff,
- 0x000004c8, 0x00000001, 0xffffffff,
- 0x000064ec, 0x00000000, 0xffffffff,
- 0x00000c7c, 0x00000000, 0xffffffff,
- 0x00006dfc, 0x00000000, 0xffffffff
- };
- #define BARTS_SYSLS_DEFAULT_LENGTH sizeof(barts_sysls_default) / (3 * sizeof(u32))
- static const u32 barts_sysls_disable[] =
- {
- 0x000055e8, 0x00000000, 0xffffffff,
- 0x0000d0bc, 0x00000000, 0xffffffff,
- 0x000015c0, 0x00041401, 0xffffffff,
- 0x0000264c, 0x00040400, 0xffffffff,
- 0x00002648, 0x00040400, 0xffffffff,
- 0x00002650, 0x00040400, 0xffffffff,
- 0x000020b8, 0x00040400, 0xffffffff,
- 0x000020bc, 0x00040400, 0xffffffff,
- 0x000020c0, 0x00040c80, 0xffffffff,
- 0x0000f4a0, 0x000000c0, 0xffffffff,
- 0x0000f4a4, 0x00680000, 0xffffffff,
- 0x000004c8, 0x00000001, 0xffffffff,
- 0x000064ec, 0x00007ffd, 0xffffffff,
- 0x00000c7c, 0x0000ff00, 0xffffffff,
- 0x00006dfc, 0x0000007f, 0xffffffff
- };
- #define BARTS_SYSLS_DISABLE_LENGTH sizeof(barts_sysls_disable) / (3 * sizeof(u32))
- static const u32 barts_sysls_enable[] =
- {
- 0x000055e8, 0x00000001, 0xffffffff,
- 0x0000d0bc, 0x00000100, 0xffffffff,
- 0x000015c0, 0x000c1401, 0xffffffff,
- 0x0000264c, 0x000c0400, 0xffffffff,
- 0x00002648, 0x000c0400, 0xffffffff,
- 0x00002650, 0x000c0400, 0xffffffff,
- 0x000020b8, 0x000c0400, 0xffffffff,
- 0x000020bc, 0x000c0400, 0xffffffff,
- 0x000020c0, 0x000c0c80, 0xffffffff,
- 0x0000f4a0, 0x000000c0, 0xffffffff,
- 0x0000f4a4, 0x00680fff, 0xffffffff,
- 0x000004c8, 0x00000000, 0xffffffff,
- 0x000064ec, 0x00000000, 0xffffffff,
- 0x00000c7c, 0x00000000, 0xffffffff,
- 0x00006dfc, 0x00000000, 0xffffffff
- };
- #define BARTS_SYSLS_ENABLE_LENGTH sizeof(barts_sysls_enable) / (3 * sizeof(u32))
- //********* CAICOS **************//
- static const u32 caicos_sysls_default[] =
- {
- 0x000055e8, 0x00000000, 0xffffffff,
- 0x0000d0bc, 0x00000000, 0xffffffff,
- 0x000015c0, 0x000c1401, 0xffffffff,
- 0x0000264c, 0x000c0400, 0xffffffff,
- 0x00002648, 0x000c0400, 0xffffffff,
- 0x00002650, 0x000c0400, 0xffffffff,
- 0x000020b8, 0x000c0400, 0xffffffff,
- 0x000020bc, 0x000c0400, 0xffffffff,
- 0x0000f4a0, 0x000000c0, 0xffffffff,
- 0x0000f4a4, 0x00680fff, 0xffffffff,
- 0x000004c8, 0x00000001, 0xffffffff,
- 0x000064ec, 0x00000000, 0xffffffff,
- 0x00000c7c, 0x00000000, 0xffffffff,
- 0x00006dfc, 0x00000000, 0xffffffff
- };
- #define CAICOS_SYSLS_DEFAULT_LENGTH sizeof(caicos_sysls_default) / (3 * sizeof(u32))
- static const u32 caicos_sysls_disable[] =
- {
- 0x000055e8, 0x00000000, 0xffffffff,
- 0x0000d0bc, 0x00000000, 0xffffffff,
- 0x000015c0, 0x00041401, 0xffffffff,
- 0x0000264c, 0x00040400, 0xffffffff,
- 0x00002648, 0x00040400, 0xffffffff,
- 0x00002650, 0x00040400, 0xffffffff,
- 0x000020b8, 0x00040400, 0xffffffff,
- 0x000020bc, 0x00040400, 0xffffffff,
- 0x0000f4a0, 0x000000c0, 0xffffffff,
- 0x0000f4a4, 0x00680000, 0xffffffff,
- 0x000004c8, 0x00000001, 0xffffffff,
- 0x000064ec, 0x00007ffd, 0xffffffff,
- 0x00000c7c, 0x0000ff00, 0xffffffff,
- 0x00006dfc, 0x0000007f, 0xffffffff
- };
- #define CAICOS_SYSLS_DISABLE_LENGTH sizeof(caicos_sysls_disable) / (3 * sizeof(u32))
- static const u32 caicos_sysls_enable[] =
- {
- 0x000055e8, 0x00000001, 0xffffffff,
- 0x0000d0bc, 0x00000100, 0xffffffff,
- 0x000015c0, 0x000c1401, 0xffffffff,
- 0x0000264c, 0x000c0400, 0xffffffff,
- 0x00002648, 0x000c0400, 0xffffffff,
- 0x00002650, 0x000c0400, 0xffffffff,
- 0x000020b8, 0x000c0400, 0xffffffff,
- 0x000020bc, 0x000c0400, 0xffffffff,
- 0x0000f4a0, 0x000000c0, 0xffffffff,
- 0x0000f4a4, 0x00680fff, 0xffffffff,
- 0x000064ec, 0x00000000, 0xffffffff,
- 0x00000c7c, 0x00000000, 0xffffffff,
- 0x00006dfc, 0x00000000, 0xffffffff,
- 0x000004c8, 0x00000000, 0xffffffff
- };
- #define CAICOS_SYSLS_ENABLE_LENGTH sizeof(caicos_sysls_enable) / (3 * sizeof(u32))
- //********* TURKS **************//
- static const u32 turks_sysls_default[] =
- {
- 0x000055e8, 0x00000000, 0xffffffff,
- 0x0000d0bc, 0x00000000, 0xffffffff,
- 0x000015c0, 0x000c1401, 0xffffffff,
- 0x0000264c, 0x000c0400, 0xffffffff,
- 0x00002648, 0x000c0400, 0xffffffff,
- 0x00002650, 0x000c0400, 0xffffffff,
- 0x000020b8, 0x000c0400, 0xffffffff,
- 0x000020bc, 0x000c0400, 0xffffffff,
- 0x000020c0, 0x000c0c80, 0xffffffff,
- 0x0000f4a0, 0x000000c0, 0xffffffff,
- 0x0000f4a4, 0x00680fff, 0xffffffff,
- 0x000004c8, 0x00000001, 0xffffffff,
- 0x000064ec, 0x00000000, 0xffffffff,
- 0x00000c7c, 0x00000000, 0xffffffff,
- 0x00006dfc, 0x00000000, 0xffffffff
- };
- #define TURKS_SYSLS_DEFAULT_LENGTH sizeof(turks_sysls_default) / (3 * sizeof(u32))
- static const u32 turks_sysls_disable[] =
- {
- 0x000055e8, 0x00000000, 0xffffffff,
- 0x0000d0bc, 0x00000000, 0xffffffff,
- 0x000015c0, 0x00041401, 0xffffffff,
- 0x0000264c, 0x00040400, 0xffffffff,
- 0x00002648, 0x00040400, 0xffffffff,
- 0x00002650, 0x00040400, 0xffffffff,
- 0x000020b8, 0x00040400, 0xffffffff,
- 0x000020bc, 0x00040400, 0xffffffff,
- 0x000020c0, 0x00040c80, 0xffffffff,
- 0x0000f4a0, 0x000000c0, 0xffffffff,
- 0x0000f4a4, 0x00680000, 0xffffffff,
- 0x000004c8, 0x00000001, 0xffffffff,
- 0x000064ec, 0x00007ffd, 0xffffffff,
- 0x00000c7c, 0x0000ff00, 0xffffffff,
- 0x00006dfc, 0x0000007f, 0xffffffff
- };
- #define TURKS_SYSLS_DISABLE_LENGTH sizeof(turks_sysls_disable) / (3 * sizeof(u32))
- static const u32 turks_sysls_enable[] =
- {
- 0x000055e8, 0x00000001, 0xffffffff,
- 0x0000d0bc, 0x00000100, 0xffffffff,
- 0x000015c0, 0x000c1401, 0xffffffff,
- 0x0000264c, 0x000c0400, 0xffffffff,
- 0x00002648, 0x000c0400, 0xffffffff,
- 0x00002650, 0x000c0400, 0xffffffff,
- 0x000020b8, 0x000c0400, 0xffffffff,
- 0x000020bc, 0x000c0400, 0xffffffff,
- 0x000020c0, 0x000c0c80, 0xffffffff,
- 0x0000f4a0, 0x000000c0, 0xffffffff,
- 0x0000f4a4, 0x00680fff, 0xffffffff,
- 0x000004c8, 0x00000000, 0xffffffff,
- 0x000064ec, 0x00000000, 0xffffffff,
- 0x00000c7c, 0x00000000, 0xffffffff,
- 0x00006dfc, 0x00000000, 0xffffffff
- };
- #define TURKS_SYSLS_ENABLE_LENGTH sizeof(turks_sysls_enable) / (3 * sizeof(u32))
- #endif
- static void btc_enable_bif_dynamic_pcie_gen2(struct radeon_device *rdev,
- bool enable)
- {
- struct rv7xx_power_info *pi = rv770_get_pi(rdev);
- u32 tmp, bif;
- tmp = RREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL);
- if (enable) {
- if ((tmp & LC_OTHER_SIDE_EVER_SENT_GEN2) &&
- (tmp & LC_OTHER_SIDE_SUPPORTS_GEN2)) {
- if (!pi->boot_in_gen2) {
- bif = RREG32(CG_BIF_REQ_AND_RSP) & ~CG_CLIENT_REQ_MASK;
- bif |= CG_CLIENT_REQ(0xd);
- WREG32(CG_BIF_REQ_AND_RSP, bif);
- tmp &= ~LC_HW_VOLTAGE_IF_CONTROL_MASK;
- tmp |= LC_HW_VOLTAGE_IF_CONTROL(1);
- tmp |= LC_GEN2_EN_STRAP;
- tmp |= LC_CLR_FAILED_SPD_CHANGE_CNT;
- WREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL, tmp);
- udelay(10);
- tmp &= ~LC_CLR_FAILED_SPD_CHANGE_CNT;
- WREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL, tmp);
- }
- }
- } else {
- if ((tmp & LC_OTHER_SIDE_EVER_SENT_GEN2) ||
- (tmp & LC_OTHER_SIDE_SUPPORTS_GEN2)) {
- if (!pi->boot_in_gen2) {
- bif = RREG32(CG_BIF_REQ_AND_RSP) & ~CG_CLIENT_REQ_MASK;
- bif |= CG_CLIENT_REQ(0xd);
- WREG32(CG_BIF_REQ_AND_RSP, bif);
- tmp &= ~LC_HW_VOLTAGE_IF_CONTROL_MASK;
- tmp &= ~LC_GEN2_EN_STRAP;
- }
- WREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL, tmp);
- }
- }
- }
- static void btc_enable_dynamic_pcie_gen2(struct radeon_device *rdev,
- bool enable)
- {
- btc_enable_bif_dynamic_pcie_gen2(rdev, enable);
- if (enable)
- WREG32_P(GENERAL_PWRMGT, ENABLE_GEN2PCIE, ~ENABLE_GEN2PCIE);
- else
- WREG32_P(GENERAL_PWRMGT, 0, ~ENABLE_GEN2PCIE);
- }
- static int btc_disable_ulv(struct radeon_device *rdev)
- {
- struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
- if (eg_pi->ulv.supported) {
- if (rv770_send_msg_to_smc(rdev, PPSMC_MSG_DisableULV) != PPSMC_Result_OK)
- return -EINVAL;
- }
- return 0;
- }
- static int btc_populate_ulv_state(struct radeon_device *rdev,
- RV770_SMC_STATETABLE *table)
- {
- int ret = -EINVAL;
- struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
- struct rv7xx_pl *ulv_pl = eg_pi->ulv.pl;
- if (ulv_pl->vddc) {
- ret = cypress_convert_power_level_to_smc(rdev,
- ulv_pl,
- &table->ULVState.levels[0],
- PPSMC_DISPLAY_WATERMARK_LOW);
- if (ret == 0) {
- table->ULVState.levels[0].arbValue = MC_CG_ARB_FREQ_F0;
- table->ULVState.levels[0].ACIndex = 1;
- table->ULVState.levels[1] = table->ULVState.levels[0];
- table->ULVState.levels[2] = table->ULVState.levels[0];
- table->ULVState.flags |= PPSMC_SWSTATE_FLAG_DC;
- WREG32(CG_ULV_CONTROL, BTC_CGULVCONTROL_DFLT);
- WREG32(CG_ULV_PARAMETER, BTC_CGULVPARAMETER_DFLT);
- }
- }
- return ret;
- }
- static int btc_populate_smc_acpi_state(struct radeon_device *rdev,
- RV770_SMC_STATETABLE *table)
- {
- int ret = cypress_populate_smc_acpi_state(rdev, table);
- if (ret == 0) {
- table->ACPIState.levels[0].ACIndex = 0;
- table->ACPIState.levels[1].ACIndex = 0;
- table->ACPIState.levels[2].ACIndex = 0;
- }
- return ret;
- }
- static void btc_program_mgcg_hw_sequence(struct radeon_device *rdev,
- const u32 *sequence, u32 count)
- {
- u32 i, length = count * 3;
- u32 tmp;
- for (i = 0; i < length; i+=3) {
- tmp = RREG32(sequence[i]);
- tmp &= ~sequence[i+2];
- tmp |= sequence[i+1] & sequence[i+2];
- WREG32(sequence[i], tmp);
- }
- }
- static void btc_cg_clock_gating_default(struct radeon_device *rdev)
- {
- u32 count;
- const u32 *p = NULL;
- if (rdev->family == CHIP_BARTS) {
- p = (const u32 *)&barts_cgcg_cgls_default;
- count = BARTS_CGCG_CGLS_DEFAULT_LENGTH;
- } else if (rdev->family == CHIP_TURKS) {
- p = (const u32 *)&turks_cgcg_cgls_default;
- count = TURKS_CGCG_CGLS_DEFAULT_LENGTH;
- } else if (rdev->family == CHIP_CAICOS) {
- p = (const u32 *)&caicos_cgcg_cgls_default;
- count = CAICOS_CGCG_CGLS_DEFAULT_LENGTH;
- } else
- return;
- btc_program_mgcg_hw_sequence(rdev, p, count);
- }
- static void btc_cg_clock_gating_enable(struct radeon_device *rdev,
- bool enable)
- {
- u32 count;
- const u32 *p = NULL;
- if (enable) {
- if (rdev->family == CHIP_BARTS) {
- p = (const u32 *)&barts_cgcg_cgls_enable;
- count = BARTS_CGCG_CGLS_ENABLE_LENGTH;
- } else if (rdev->family == CHIP_TURKS) {
- p = (const u32 *)&turks_cgcg_cgls_enable;
- count = TURKS_CGCG_CGLS_ENABLE_LENGTH;
- } else if (rdev->family == CHIP_CAICOS) {
- p = (const u32 *)&caicos_cgcg_cgls_enable;
- count = CAICOS_CGCG_CGLS_ENABLE_LENGTH;
- } else
- return;
- } else {
- if (rdev->family == CHIP_BARTS) {
- p = (const u32 *)&barts_cgcg_cgls_disable;
- count = BARTS_CGCG_CGLS_DISABLE_LENGTH;
- } else if (rdev->family == CHIP_TURKS) {
- p = (const u32 *)&turks_cgcg_cgls_disable;
- count = TURKS_CGCG_CGLS_DISABLE_LENGTH;
- } else if (rdev->family == CHIP_CAICOS) {
- p = (const u32 *)&caicos_cgcg_cgls_disable;
- count = CAICOS_CGCG_CGLS_DISABLE_LENGTH;
- } else
- return;
- }
- btc_program_mgcg_hw_sequence(rdev, p, count);
- }
- static void btc_mg_clock_gating_default(struct radeon_device *rdev)
- {
- u32 count;
- const u32 *p = NULL;
- if (rdev->family == CHIP_BARTS) {
- p = (const u32 *)&barts_mgcg_default;
- count = BARTS_MGCG_DEFAULT_LENGTH;
- } else if (rdev->family == CHIP_TURKS) {
- p = (const u32 *)&turks_mgcg_default;
- count = TURKS_MGCG_DEFAULT_LENGTH;
- } else if (rdev->family == CHIP_CAICOS) {
- p = (const u32 *)&caicos_mgcg_default;
- count = CAICOS_MGCG_DEFAULT_LENGTH;
- } else
- return;
- btc_program_mgcg_hw_sequence(rdev, p, count);
- }
- static void btc_mg_clock_gating_enable(struct radeon_device *rdev,
- bool enable)
- {
- u32 count;
- const u32 *p = NULL;
- if (enable) {
- if (rdev->family == CHIP_BARTS) {
- p = (const u32 *)&barts_mgcg_enable;
- count = BARTS_MGCG_ENABLE_LENGTH;
- } else if (rdev->family == CHIP_TURKS) {
- p = (const u32 *)&turks_mgcg_enable;
- count = TURKS_MGCG_ENABLE_LENGTH;
- } else if (rdev->family == CHIP_CAICOS) {
- p = (const u32 *)&caicos_mgcg_enable;
- count = CAICOS_MGCG_ENABLE_LENGTH;
- } else
- return;
- } else {
- if (rdev->family == CHIP_BARTS) {
- p = (const u32 *)&barts_mgcg_disable[0];
- count = BARTS_MGCG_DISABLE_LENGTH;
- } else if (rdev->family == CHIP_TURKS) {
- p = (const u32 *)&turks_mgcg_disable[0];
- count = TURKS_MGCG_DISABLE_LENGTH;
- } else if (rdev->family == CHIP_CAICOS) {
- p = (const u32 *)&caicos_mgcg_disable[0];
- count = CAICOS_MGCG_DISABLE_LENGTH;
- } else
- return;
- }
- btc_program_mgcg_hw_sequence(rdev, p, count);
- }
- static void btc_ls_clock_gating_default(struct radeon_device *rdev)
- {
- u32 count;
- const u32 *p = NULL;
- if (rdev->family == CHIP_BARTS) {
- p = (const u32 *)&barts_sysls_default;
- count = BARTS_SYSLS_DEFAULT_LENGTH;
- } else if (rdev->family == CHIP_TURKS) {
- p = (const u32 *)&turks_sysls_default;
- count = TURKS_SYSLS_DEFAULT_LENGTH;
- } else if (rdev->family == CHIP_CAICOS) {
- p = (const u32 *)&caicos_sysls_default;
- count = CAICOS_SYSLS_DEFAULT_LENGTH;
- } else
- return;
- btc_program_mgcg_hw_sequence(rdev, p, count);
- }
- static void btc_ls_clock_gating_enable(struct radeon_device *rdev,
- bool enable)
- {
- u32 count;
- const u32 *p = NULL;
- if (enable) {
- if (rdev->family == CHIP_BARTS) {
- p = (const u32 *)&barts_sysls_enable;
- count = BARTS_SYSLS_ENABLE_LENGTH;
- } else if (rdev->family == CHIP_TURKS) {
- p = (const u32 *)&turks_sysls_enable;
- count = TURKS_SYSLS_ENABLE_LENGTH;
- } else if (rdev->family == CHIP_CAICOS) {
- p = (const u32 *)&caicos_sysls_enable;
- count = CAICOS_SYSLS_ENABLE_LENGTH;
- } else
- return;
- } else {
- if (rdev->family == CHIP_BARTS) {
- p = (const u32 *)&barts_sysls_disable;
- count = BARTS_SYSLS_DISABLE_LENGTH;
- } else if (rdev->family == CHIP_TURKS) {
- p = (const u32 *)&turks_sysls_disable;
- count = TURKS_SYSLS_DISABLE_LENGTH;
- } else if (rdev->family == CHIP_CAICOS) {
- p = (const u32 *)&caicos_sysls_disable;
- count = CAICOS_SYSLS_DISABLE_LENGTH;
- } else
- return;
- }
- btc_program_mgcg_hw_sequence(rdev, p, count);
- }
- static bool btc_dpm_enabled(struct radeon_device *rdev)
- {
- if (rv770_is_smc_running(rdev))
- return true;
- else
- return false;
- }
- static int btc_init_smc_table(struct radeon_device *rdev)
- {
- struct rv7xx_power_info *pi = rv770_get_pi(rdev);
- struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
- struct radeon_ps *radeon_boot_state = rdev->pm.dpm.boot_ps;
- RV770_SMC_STATETABLE *table = &pi->smc_statetable;
- int ret;
- memset(table, 0, sizeof(RV770_SMC_STATETABLE));
- cypress_populate_smc_voltage_tables(rdev, table);
- switch (rdev->pm.int_thermal_type) {
- case THERMAL_TYPE_EVERGREEN:
- case THERMAL_TYPE_EMC2103_WITH_INTERNAL:
- table->thermalProtectType = PPSMC_THERMAL_PROTECT_TYPE_INTERNAL;
- break;
- case THERMAL_TYPE_NONE:
- table->thermalProtectType = PPSMC_THERMAL_PROTECT_TYPE_NONE;
- break;
- default:
- table->thermalProtectType = PPSMC_THERMAL_PROTECT_TYPE_EXTERNAL;
- break;
- }
- if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_HARDWAREDC)
- table->systemFlags |= PPSMC_SYSTEMFLAG_GPIO_DC;
- if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_REGULATOR_HOT)
- table->systemFlags |= PPSMC_SYSTEMFLAG_REGULATOR_HOT;
- if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_STEPVDDC)
- table->systemFlags |= PPSMC_SYSTEMFLAG_STEPVDDC;
- if (pi->mem_gddr5)
- table->systemFlags |= PPSMC_SYSTEMFLAG_GDDR5;
- ret = cypress_populate_smc_initial_state(rdev, radeon_boot_state, table);
- if (ret)
- return ret;
- if (eg_pi->sclk_deep_sleep)
- WREG32_P(SCLK_PSKIP_CNTL, PSKIP_ON_ALLOW_STOP_HI(32),
- ~PSKIP_ON_ALLOW_STOP_HI_MASK);
- ret = btc_populate_smc_acpi_state(rdev, table);
- if (ret)
- return ret;
- if (eg_pi->ulv.supported) {
- ret = btc_populate_ulv_state(rdev, table);
- if (ret)
- eg_pi->ulv.supported = false;
- }
- table->driverState = table->initialState;
- return rv770_copy_bytes_to_smc(rdev,
- pi->state_table_start,
- (u8 *)table,
- sizeof(RV770_SMC_STATETABLE),
- pi->sram_end);
- }
- static int btc_reset_to_default(struct radeon_device *rdev)
- {
- if (rv770_send_msg_to_smc(rdev, PPSMC_MSG_ResetToDefaults) != PPSMC_Result_OK)
- return -EINVAL;
- return 0;
- }
- static void btc_stop_smc(struct radeon_device *rdev)
- {
- int i;
- for (i = 0; i < rdev->usec_timeout; i++) {
- if (((RREG32(LB_SYNC_RESET_SEL) & LB_SYNC_RESET_SEL_MASK) >> LB_SYNC_RESET_SEL_SHIFT) != 1)
- break;
- udelay(1);
- }
- udelay(100);
- r7xx_stop_smc(rdev);
- }
- static void btc_read_arb_registers(struct radeon_device *rdev)
- {
- struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
- struct evergreen_arb_registers *arb_registers =
- &eg_pi->bootup_arb_registers;
- arb_registers->mc_arb_dram_timing = RREG32(MC_ARB_DRAM_TIMING);
- arb_registers->mc_arb_dram_timing2 = RREG32(MC_ARB_DRAM_TIMING2);
- arb_registers->mc_arb_rfsh_rate = RREG32(MC_ARB_RFSH_RATE);
- arb_registers->mc_arb_burst_time = RREG32(MC_ARB_BURST_TIME);
- }
- static void btc_set_arb0_registers(struct radeon_device *rdev,
- struct evergreen_arb_registers *arb_registers)
- {
- u32 val;
- WREG32(MC_ARB_DRAM_TIMING, arb_registers->mc_arb_dram_timing);
- WREG32(MC_ARB_DRAM_TIMING2, arb_registers->mc_arb_dram_timing2);
- val = (arb_registers->mc_arb_rfsh_rate & POWERMODE0_MASK) >>
- POWERMODE0_SHIFT;
- WREG32_P(MC_ARB_RFSH_RATE, POWERMODE0(val), ~POWERMODE0_MASK);
- val = (arb_registers->mc_arb_burst_time & STATE0_MASK) >>
- STATE0_SHIFT;
- WREG32_P(MC_ARB_BURST_TIME, STATE0(val), ~STATE0_MASK);
- }
- static void btc_set_boot_state_timing(struct radeon_device *rdev)
- {
- struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
- if (eg_pi->ulv.supported)
- btc_set_arb0_registers(rdev, &eg_pi->bootup_arb_registers);
- }
- static bool btc_is_state_ulv_compatible(struct radeon_device *rdev,
- struct radeon_ps *radeon_state)
- {
- struct rv7xx_ps *state = rv770_get_ps(radeon_state);
- struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
- struct rv7xx_pl *ulv_pl = eg_pi->ulv.pl;
- if (state->low.mclk != ulv_pl->mclk)
- return false;
- if (state->low.vddci != ulv_pl->vddci)
- return false;
- /* XXX check minclocks, etc. */
- return true;
- }
- static int btc_set_ulv_dram_timing(struct radeon_device *rdev)
- {
- u32 val;
- struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
- struct rv7xx_pl *ulv_pl = eg_pi->ulv.pl;
- radeon_atom_set_engine_dram_timings(rdev,
- ulv_pl->sclk,
- ulv_pl->mclk);
- val = rv770_calculate_memory_refresh_rate(rdev, ulv_pl->sclk);
- WREG32_P(MC_ARB_RFSH_RATE, POWERMODE0(val), ~POWERMODE0_MASK);
- val = cypress_calculate_burst_time(rdev, ulv_pl->sclk, ulv_pl->mclk);
- WREG32_P(MC_ARB_BURST_TIME, STATE0(val), ~STATE0_MASK);
- return 0;
- }
- static int btc_enable_ulv(struct radeon_device *rdev)
- {
- if (rv770_send_msg_to_smc(rdev, PPSMC_MSG_EnableULV) != PPSMC_Result_OK)
- return -EINVAL;
- return 0;
- }
- static int btc_set_power_state_conditionally_enable_ulv(struct radeon_device *rdev)
- {
- int ret = 0;
- struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
- struct radeon_ps *radeon_new_state = rdev->pm.dpm.requested_ps;
- if (eg_pi->ulv.supported) {
- if (btc_is_state_ulv_compatible(rdev, radeon_new_state)) {
- // Set ARB[0] to reflect the DRAM timing needed for ULV.
- ret = btc_set_ulv_dram_timing(rdev);
- if (ret == 0)
- ret = btc_enable_ulv(rdev);
- }
- }
- return ret;
- }
- static bool btc_check_s0_mc_reg_index(u16 in_reg, u16 *out_reg)
- {
- bool result = true;
- switch (in_reg) {
- case MC_SEQ_RAS_TIMING >> 2:
- *out_reg = MC_SEQ_RAS_TIMING_LP >> 2;
- break;
- case MC_SEQ_CAS_TIMING >> 2:
- *out_reg = MC_SEQ_CAS_TIMING_LP >> 2;
- break;
- case MC_SEQ_MISC_TIMING >> 2:
- *out_reg = MC_SEQ_MISC_TIMING_LP >> 2;
- break;
- case MC_SEQ_MISC_TIMING2 >> 2:
- *out_reg = MC_SEQ_MISC_TIMING2_LP >> 2;
- break;
- case MC_SEQ_RD_CTL_D0 >> 2:
- *out_reg = MC_SEQ_RD_CTL_D0_LP >> 2;
- break;
- case MC_SEQ_RD_CTL_D1 >> 2:
- *out_reg = MC_SEQ_RD_CTL_D1_LP >> 2;
- break;
- case MC_SEQ_WR_CTL_D0 >> 2:
- *out_reg = MC_SEQ_WR_CTL_D0_LP >> 2;
- break;
- case MC_SEQ_WR_CTL_D1 >> 2:
- *out_reg = MC_SEQ_WR_CTL_D1_LP >> 2;
- break;
- case MC_PMG_CMD_EMRS >> 2:
- *out_reg = MC_SEQ_PMG_CMD_EMRS_LP >> 2;
- break;
- case MC_PMG_CMD_MRS >> 2:
- *out_reg = MC_SEQ_PMG_CMD_MRS_LP >> 2;
- break;
- case MC_PMG_CMD_MRS1 >> 2:
- *out_reg = MC_SEQ_PMG_CMD_MRS1_LP >> 2;
- break;
- default:
- result = false;
- break;
- }
- return result;
- }
- static void btc_set_valid_flag(struct evergreen_mc_reg_table *table)
- {
- u8 i, j;
- for (i = 0; i < table->last; i++) {
- for (j = 1; j < table->num_entries; j++) {
- if (table->mc_reg_table_entry[j-1].mc_data[i] !=
- table->mc_reg_table_entry[j].mc_data[i]) {
- table->valid_flag |= (1 << i);
- break;
- }
- }
- }
- }
- static int btc_set_mc_special_registers(struct radeon_device *rdev,
- struct evergreen_mc_reg_table *table)
- {
- struct rv7xx_power_info *pi = rv770_get_pi(rdev);
- u8 i, j, k;
- u32 tmp;
- for (i = 0, j = table->last; i < table->last; i++) {
- switch (table->mc_reg_address[i].s1) {
- case MC_SEQ_MISC1 >> 2:
- tmp = RREG32(MC_PMG_CMD_EMRS);
- table->mc_reg_address[j].s1 = MC_PMG_CMD_EMRS >> 2;
- table->mc_reg_address[j].s0 = MC_SEQ_PMG_CMD_EMRS_LP >> 2;
- for (k = 0; k < table->num_entries; k++) {
- table->mc_reg_table_entry[k].mc_data[j] =
- ((tmp & 0xffff0000)) |
- ((table->mc_reg_table_entry[k].mc_data[i] & 0xffff0000) >> 16);
- }
- j++;
- if (j > SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
- return -EINVAL;
- tmp = RREG32(MC_PMG_CMD_MRS);
- table->mc_reg_address[j].s1 = MC_PMG_CMD_MRS >> 2;
- table->mc_reg_address[j].s0 = MC_SEQ_PMG_CMD_MRS_LP >> 2;
- for (k = 0; k < table->num_entries; k++) {
- table->mc_reg_table_entry[k].mc_data[j] =
- (tmp & 0xffff0000) |
- (table->mc_reg_table_entry[k].mc_data[i] & 0x0000ffff);
- if (!pi->mem_gddr5)
- table->mc_reg_table_entry[k].mc_data[j] |= 0x100;
- }
- j++;
- if (j > SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
- return -EINVAL;
- break;
- case MC_SEQ_RESERVE_M >> 2:
- tmp = RREG32(MC_PMG_CMD_MRS1);
- table->mc_reg_address[j].s1 = MC_PMG_CMD_MRS1 >> 2;
- table->mc_reg_address[j].s0 = MC_SEQ_PMG_CMD_MRS1_LP >> 2;
- for (k = 0; k < table->num_entries; k++) {
- table->mc_reg_table_entry[k].mc_data[j] =
- (tmp & 0xffff0000) |
- (table->mc_reg_table_entry[k].mc_data[i] & 0x0000ffff);
- }
- j++;
- if (j > SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
- return -EINVAL;
- break;
- default:
- break;
- }
- }
- table->last = j;
- return 0;
- }
- static void btc_set_s0_mc_reg_index(struct evergreen_mc_reg_table *table)
- {
- u32 i;
- u16 address;
- for (i = 0; i < table->last; i++) {
- table->mc_reg_address[i].s0 =
- btc_check_s0_mc_reg_index(table->mc_reg_address[i].s1, &address) ?
- address : table->mc_reg_address[i].s1;
- }
- }
- static int btc_copy_vbios_mc_reg_table(struct atom_mc_reg_table *table,
- struct evergreen_mc_reg_table *eg_table)
- {
- u8 i, j;
- if (table->last > SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
- return -EINVAL;
- if (table->num_entries > MAX_AC_TIMING_ENTRIES)
- return -EINVAL;
- for (i = 0; i < table->last; i++)
- eg_table->mc_reg_address[i].s1 = table->mc_reg_address[i].s1;
- eg_table->last = table->last;
- for (i = 0; i < table->num_entries; i++) {
- eg_table->mc_reg_table_entry[i].mclk_max =
- table->mc_reg_table_entry[i].mclk_max;
- for(j = 0; j < table->last; j++)
- eg_table->mc_reg_table_entry[i].mc_data[j] =
- table->mc_reg_table_entry[i].mc_data[j];
- }
- eg_table->num_entries = table->num_entries;
- return 0;
- }
- static int btc_initialize_mc_reg_table(struct radeon_device *rdev)
- {
- int ret;
- struct atom_mc_reg_table *table;
- struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
- struct evergreen_mc_reg_table *eg_table = &eg_pi->mc_reg_table;
- u8 module_index = rv770_get_memory_module_index(rdev);
- table = kzalloc(sizeof(struct atom_mc_reg_table), GFP_KERNEL);
- if (!table)
- return -ENOMEM;
- /* Program additional LP registers that are no longer programmed by VBIOS */
- WREG32(MC_SEQ_RAS_TIMING_LP, RREG32(MC_SEQ_RAS_TIMING));
- WREG32(MC_SEQ_CAS_TIMING_LP, RREG32(MC_SEQ_CAS_TIMING));
- WREG32(MC_SEQ_MISC_TIMING_LP, RREG32(MC_SEQ_MISC_TIMING));
- WREG32(MC_SEQ_MISC_TIMING2_LP, RREG32(MC_SEQ_MISC_TIMING2));
- WREG32(MC_SEQ_RD_CTL_D0_LP, RREG32(MC_SEQ_RD_CTL_D0));
- WREG32(MC_SEQ_RD_CTL_D1_LP, RREG32(MC_SEQ_RD_CTL_D1));
- WREG32(MC_SEQ_WR_CTL_D0_LP, RREG32(MC_SEQ_WR_CTL_D0));
- WREG32(MC_SEQ_WR_CTL_D1_LP, RREG32(MC_SEQ_WR_CTL_D1));
- WREG32(MC_SEQ_PMG_CMD_EMRS_LP, RREG32(MC_PMG_CMD_EMRS));
- WREG32(MC_SEQ_PMG_CMD_MRS_LP, RREG32(MC_PMG_CMD_MRS));
- WREG32(MC_SEQ_PMG_CMD_MRS1_LP, RREG32(MC_PMG_CMD_MRS1));
- ret = radeon_atom_init_mc_reg_table(rdev, module_index, table);
- if (ret)
- goto init_mc_done;
- ret = btc_copy_vbios_mc_reg_table(table, eg_table);
- if (ret)
- goto init_mc_done;
- btc_set_s0_mc_reg_index(eg_table);
- ret = btc_set_mc_special_registers(rdev, eg_table);
- if (ret)
- goto init_mc_done;
- btc_set_valid_flag(eg_table);
- init_mc_done:
- kfree(table);
- return ret;
- }
- static void btc_init_stutter_mode(struct radeon_device *rdev)
- {
- struct rv7xx_power_info *pi = rv770_get_pi(rdev);
- u32 tmp;
- if (pi->mclk_stutter_mode_threshold) {
- if (pi->mem_gddr5) {
- tmp = RREG32(MC_PMG_AUTO_CFG);
- if ((0x200 & tmp) == 0) {
- tmp = (tmp & 0xfffffc0b) | 0x204;
- WREG32(MC_PMG_AUTO_CFG, tmp);
- }
- }
- }
- }
- void btc_dpm_reset_asic(struct radeon_device *rdev)
- {
- rv770_restrict_performance_levels_before_switch(rdev);
- btc_disable_ulv(rdev);
- btc_set_boot_state_timing(rdev);
- rv770_set_boot_state(rdev);
- }
- int btc_dpm_set_power_state(struct radeon_device *rdev)
- {
- struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
- btc_disable_ulv(rdev);
- btc_set_boot_state_timing(rdev);
- rv770_restrict_performance_levels_before_switch(rdev);
- if (eg_pi->pcie_performance_request)
- cypress_notify_link_speed_change_before_state_change(rdev);
- rv770_halt_smc(rdev);
- cypress_upload_sw_state(rdev);
- if (eg_pi->dynamic_ac_timing)
- cypress_upload_mc_reg_table(rdev);
- cypress_program_memory_timing_parameters(rdev);
- rv770_resume_smc(rdev);
- rv770_set_sw_state(rdev);
- if (eg_pi->pcie_performance_request)
- cypress_notify_link_speed_change_after_state_change(rdev);
- btc_set_power_state_conditionally_enable_ulv(rdev);
- #if 0
- /* XXX */
- rv770_unrestrict_performance_levels_after_switch(rdev);
- #endif
- return 0;
- }
- int btc_dpm_enable(struct radeon_device *rdev)
- {
- struct rv7xx_power_info *pi = rv770_get_pi(rdev);
- struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
- if (pi->gfx_clock_gating)
- btc_cg_clock_gating_default(rdev);
- if (btc_dpm_enabled(rdev))
- return -EINVAL;
- if (pi->mg_clock_gating)
- btc_mg_clock_gating_default(rdev);
- if (eg_pi->ls_clock_gating)
- btc_ls_clock_gating_default(rdev);
- if (pi->voltage_control) {
- rv770_enable_voltage_control(rdev, true);
- cypress_construct_voltage_tables(rdev);
- }
- if (pi->mvdd_control)
- cypress_get_mvdd_configuration(rdev);
- if (eg_pi->dynamic_ac_timing)
- btc_initialize_mc_reg_table(rdev);
- if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_BACKBIAS)
- rv770_enable_backbias(rdev, true);
- if (pi->dynamic_ss)
- cypress_enable_spread_spectrum(rdev, true);
- if (pi->thermal_protection)
- rv770_enable_thermal_protection(rdev, true);
- rv770_setup_bsp(rdev);
- rv770_program_git(rdev);
- rv770_program_tp(rdev);
- rv770_program_tpp(rdev);
- rv770_program_sstp(rdev);
- rv770_program_engine_speed_parameters(rdev);
- cypress_enable_display_gap(rdev);
- rv770_program_vc(rdev);
- if (pi->dynamic_pcie_gen2)
- btc_enable_dynamic_pcie_gen2(rdev, true);
- if (rv770_upload_firmware(rdev))
- return -EINVAL;
- cypress_get_table_locations(rdev);
- btc_init_smc_table(rdev);
- if (eg_pi->dynamic_ac_timing)
- cypress_populate_mc_reg_table(rdev);
- cypress_program_response_times(rdev);
- r7xx_start_smc(rdev);
- cypress_notify_smc_display_change(rdev, false);
- cypress_enable_sclk_control(rdev, true);
- if (eg_pi->memory_transition)
- cypress_enable_mclk_control(rdev, true);
- cypress_start_dpm(rdev);
- if (pi->gfx_clock_gating)
- btc_cg_clock_gating_enable(rdev, true);
- if (pi->mg_clock_gating)
- btc_mg_clock_gating_enable(rdev, true);
- if (eg_pi->ls_clock_gating)
- btc_ls_clock_gating_enable(rdev, true);
- if (rdev->irq.installed &&
- r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {
- PPSMC_Result result;
- rv770_set_thermal_temperature_range(rdev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX);
- rdev->irq.dpm_thermal = true;
- radeon_irq_set(rdev);
- result = rv770_send_msg_to_smc(rdev, PPSMC_MSG_EnableThermalInterrupt);
- if (result != PPSMC_Result_OK)
- DRM_DEBUG_KMS("Could not enable thermal interrupts.\n");
- }
- rv770_enable_auto_throttle_source(rdev, RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL, true);
- btc_init_stutter_mode(rdev);
- return 0;
- };
- void btc_dpm_disable(struct radeon_device *rdev)
- {
- struct rv7xx_power_info *pi = rv770_get_pi(rdev);
- struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
- if (!btc_dpm_enabled(rdev))
- return;
- rv770_clear_vc(rdev);
- if (pi->thermal_protection)
- rv770_enable_thermal_protection(rdev, false);
- if (pi->dynamic_pcie_gen2)
- btc_enable_dynamic_pcie_gen2(rdev, false);
- if (rdev->irq.installed &&
- r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {
- rdev->irq.dpm_thermal = false;
- radeon_irq_set(rdev);
- }
- if (pi->gfx_clock_gating)
- btc_cg_clock_gating_enable(rdev, false);
- if (pi->mg_clock_gating)
- btc_mg_clock_gating_enable(rdev, false);
- if (eg_pi->ls_clock_gating)
- btc_ls_clock_gating_enable(rdev, false);
- rv770_stop_dpm(rdev);
- btc_reset_to_default(rdev);
- btc_stop_smc(rdev);
- cypress_enable_spread_spectrum(rdev, false);
- }
- void btc_dpm_setup_asic(struct radeon_device *rdev)
- {
- struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
- rv770_get_memory_type(rdev);
- rv740_read_clock_registers(rdev);
- btc_read_arb_registers(rdev);
- rv770_read_voltage_smio_registers(rdev);
- if (eg_pi->pcie_performance_request)
- cypress_advertise_gen2_capability(rdev);
- rv770_get_pcie_gen2_status(rdev);
- rv770_enable_acpi_pm(rdev);
- }
- int btc_dpm_init(struct radeon_device *rdev)
- {
- struct rv7xx_power_info *pi;
- struct evergreen_power_info *eg_pi;
- int index = GetIndexIntoMasterTable(DATA, ASIC_InternalSS_Info);
- u16 data_offset, size;
- u8 frev, crev;
- struct atom_clock_dividers dividers;
- int ret;
- eg_pi = kzalloc(sizeof(struct evergreen_power_info), GFP_KERNEL);
- if (eg_pi == NULL)
- return -ENOMEM;
- rdev->pm.dpm.priv = eg_pi;
- pi = &eg_pi->rv7xx;
- rv770_get_max_vddc(rdev);
- eg_pi->ulv.supported = false;
- pi->acpi_vddc = 0;
- eg_pi->acpi_vddci = 0;
- pi->min_vddc_in_table = 0;
- pi->max_vddc_in_table = 0;
- ret = rv7xx_parse_power_table(rdev);
- if (ret)
- return ret;
- if (rdev->pm.dpm.voltage_response_time == 0)
- rdev->pm.dpm.voltage_response_time = R600_VOLTAGERESPONSETIME_DFLT;
- if (rdev->pm.dpm.backbias_response_time == 0)
- rdev->pm.dpm.backbias_response_time = R600_BACKBIASRESPONSETIME_DFLT;
- ret = radeon_atom_get_clock_dividers(rdev, COMPUTE_ENGINE_PLL_PARAM,
- 0, false, ÷rs);
- if (ret)
- pi->ref_div = dividers.ref_div + 1;
- else
- pi->ref_div = R600_REFERENCEDIVIDER_DFLT;
- pi->mclk_strobe_mode_threshold = 40000;
- pi->mclk_edc_enable_threshold = 40000;
- eg_pi->mclk_edc_wr_enable_threshold = 40000;
- pi->voltage_control =
- radeon_atom_is_voltage_gpio(rdev, SET_VOLTAGE_TYPE_ASIC_VDDC);
- pi->mvdd_control =
- radeon_atom_is_voltage_gpio(rdev, SET_VOLTAGE_TYPE_ASIC_MVDDC);
- eg_pi->vddci_control =
- radeon_atom_is_voltage_gpio(rdev, SET_VOLTAGE_TYPE_ASIC_VDDCI);
- if (atom_parse_data_header(rdev->mode_info.atom_context, index, &size,
- &frev, &crev, &data_offset)) {
- pi->sclk_ss = true;
- pi->mclk_ss = true;
- pi->dynamic_ss = true;
- } else {
- pi->sclk_ss = false;
- pi->mclk_ss = false;
- pi->dynamic_ss = true;
- }
- pi->asi = RV770_ASI_DFLT;
- pi->pasi = CYPRESS_HASI_DFLT;
- pi->vrc = CYPRESS_VRC_DFLT;
- pi->power_gating = false;
- pi->gfx_clock_gating = true;
- pi->mg_clock_gating = true;
- pi->mgcgtssm = true;
- eg_pi->ls_clock_gating = false;
- eg_pi->sclk_deep_sleep = false;
- pi->dynamic_pcie_gen2 = true;
- if (pi->gfx_clock_gating &&
- (rdev->pm.int_thermal_type != THERMAL_TYPE_NONE))
- pi->thermal_protection = true;
- else
- pi->thermal_protection = false;
- pi->display_gap = true;
- if (rdev->flags & RADEON_IS_MOBILITY)
- pi->dcodt = true;
- else
- pi->dcodt = false;
- pi->ulps = true;
- eg_pi->dynamic_ac_timing = true;
- eg_pi->abm = true;
- eg_pi->mcls = true;
- eg_pi->light_sleep = true;
- eg_pi->memory_transition = true;
- #if defined(CONFIG_ACPI)
- eg_pi->pcie_performance_request =
- radeon_acpi_is_pcie_performance_request_supported(rdev);
- #else
- eg_pi->pcie_performance_request = false;
- #endif
- if (rdev->family == CHIP_BARTS)
- eg_pi->dll_default_on = true;
- else
- eg_pi->dll_default_on = false;
- eg_pi->sclk_deep_sleep = false;
- if (ASIC_IS_LOMBOK(rdev))
- pi->mclk_stutter_mode_threshold = 30000;
- else
- pi->mclk_stutter_mode_threshold = 0;
- pi->sram_end = SMC_RAM_END;
- return 0;
- }
- void btc_dpm_fini(struct radeon_device *rdev)
- {
- int i;
- for (i = 0; i < rdev->pm.dpm.num_ps; i++) {
- kfree(rdev->pm.dpm.ps[i].ps_priv);
- }
- kfree(rdev->pm.dpm.ps);
- kfree(rdev->pm.dpm.priv);
- }
|