000-linux_mips.patch 793 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214
  1. Index: linux-2.4.35.4/arch/mips/au1000/common/au1xxx_irqmap.c
  2. ===================================================================
  3. --- linux-2.4.35.4.orig/arch/mips/au1000/common/au1xxx_irqmap.c
  4. +++ linux-2.4.35.4/arch/mips/au1000/common/au1xxx_irqmap.c
  5. @@ -172,14 +172,14 @@ au1xxx_irq_map_t au1xxx_ic0_map[] = {
  6. { AU1550_PSC1_INT, INTC_INT_HIGH_LEVEL, 0},
  7. { AU1550_PSC2_INT, INTC_INT_HIGH_LEVEL, 0},
  8. { AU1550_PSC3_INT, INTC_INT_HIGH_LEVEL, 0},
  9. - { AU1550_TOY_INT, INTC_INT_RISE_EDGE, 0 },
  10. - { AU1550_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
  11. - { AU1550_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
  12. - { AU1550_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 },
  13. - { AU1550_RTC_INT, INTC_INT_RISE_EDGE, 0 },
  14. - { AU1550_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
  15. - { AU1550_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
  16. - { AU1550_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 },
  17. + { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 },
  18. + { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
  19. + { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
  20. + { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 },
  21. + { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 },
  22. + { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
  23. + { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
  24. + { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 },
  25. { AU1550_NAND_INT, INTC_INT_RISE_EDGE, 0},
  26. { AU1550_USB_DEV_REQ_INT, INTC_INT_HIGH_LEVEL, 0 },
  27. { AU1550_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 },
  28. @@ -200,14 +200,14 @@ au1xxx_irq_map_t au1xxx_ic0_map[] = {
  29. { AU1200_PSC1_INT, INTC_INT_HIGH_LEVEL, 0},
  30. { AU1200_AES_INT, INTC_INT_HIGH_LEVEL, 0},
  31. { AU1200_CAMERA_INT, INTC_INT_HIGH_LEVEL, 0},
  32. - { AU1200_TOY_INT, INTC_INT_RISE_EDGE, 0 },
  33. - { AU1200_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
  34. - { AU1200_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
  35. - { AU1200_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 },
  36. - { AU1200_RTC_INT, INTC_INT_RISE_EDGE, 0 },
  37. - { AU1200_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
  38. - { AU1200_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
  39. - { AU1200_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 },
  40. + { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 },
  41. + { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
  42. + { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
  43. + { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 },
  44. + { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 },
  45. + { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
  46. + { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
  47. + { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 },
  48. { AU1200_NAND_INT, INTC_INT_RISE_EDGE, 0},
  49. { AU1200_USB_INT, INTC_INT_HIGH_LEVEL, 0 },
  50. { AU1200_LCD_INT, INTC_INT_HIGH_LEVEL, 0},
  51. Index: linux-2.4.35.4/arch/mips/au1000/common/cputable.c
  52. ===================================================================
  53. --- linux-2.4.35.4.orig/arch/mips/au1000/common/cputable.c
  54. +++ linux-2.4.35.4/arch/mips/au1000/common/cputable.c
  55. @@ -39,7 +39,8 @@ struct cpu_spec cpu_specs[] = {
  56. { 0xffffffff, 0x02030203, "Au1100 BD", 0, 1 },
  57. { 0xffffffff, 0x02030204, "Au1100 BE", 0, 1 },
  58. { 0xffffffff, 0x03030200, "Au1550 AA", 0, 1 },
  59. - { 0xffffffff, 0x04030200, "Au1200 AA", 0, 1 },
  60. + { 0xffffffff, 0x04030200, "Au1200 AB", 0, 0 },
  61. + { 0xffffffff, 0x04030201, "Au1200 AC", 0, 0 },
  62. { 0x00000000, 0x00000000, "Unknown Au1xxx", 1, 0 },
  63. };
  64. Index: linux-2.4.35.4/arch/mips/au1000/common/dbdma.c
  65. ===================================================================
  66. --- linux-2.4.35.4.orig/arch/mips/au1000/common/dbdma.c
  67. +++ linux-2.4.35.4/arch/mips/au1000/common/dbdma.c
  68. @@ -41,6 +41,8 @@
  69. #include <asm/au1xxx_dbdma.h>
  70. #include <asm/system.h>
  71. +#include <linux/module.h>
  72. +
  73. #if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
  74. /*
  75. @@ -60,37 +62,10 @@ static spinlock_t au1xxx_dbdma_spin_lock
  76. */
  77. #define ALIGN_ADDR(x, a) ((((u32)(x)) + (a-1)) & ~(a-1))
  78. -static volatile dbdma_global_t *dbdma_gptr = (dbdma_global_t *)DDMA_GLOBAL_BASE;
  79. -static int dbdma_initialized;
  80. +static dbdma_global_t *dbdma_gptr = (dbdma_global_t *)DDMA_GLOBAL_BASE;
  81. +static int dbdma_initialized=0;
  82. static void au1xxx_dbdma_init(void);
  83. -typedef struct dbdma_device_table {
  84. - u32 dev_id;
  85. - u32 dev_flags;
  86. - u32 dev_tsize;
  87. - u32 dev_devwidth;
  88. - u32 dev_physaddr; /* If FIFO */
  89. - u32 dev_intlevel;
  90. - u32 dev_intpolarity;
  91. -} dbdev_tab_t;
  92. -
  93. -typedef struct dbdma_chan_config {
  94. - u32 chan_flags;
  95. - u32 chan_index;
  96. - dbdev_tab_t *chan_src;
  97. - dbdev_tab_t *chan_dest;
  98. - au1x_dma_chan_t *chan_ptr;
  99. - au1x_ddma_desc_t *chan_desc_base;
  100. - au1x_ddma_desc_t *get_ptr, *put_ptr, *cur_ptr;
  101. - void *chan_callparam;
  102. - void (*chan_callback)(int, void *, struct pt_regs *);
  103. -} chan_tab_t;
  104. -
  105. -#define DEV_FLAGS_INUSE (1 << 0)
  106. -#define DEV_FLAGS_ANYUSE (1 << 1)
  107. -#define DEV_FLAGS_OUT (1 << 2)
  108. -#define DEV_FLAGS_IN (1 << 3)
  109. -
  110. static dbdev_tab_t dbdev_tab[] = {
  111. #ifdef CONFIG_SOC_AU1550
  112. /* UARTS */
  113. @@ -156,13 +131,13 @@ static dbdev_tab_t dbdev_tab[] = {
  114. { DSCR_CMD0_MAE_BOTH, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
  115. { DSCR_CMD0_LCD, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
  116. - { DSCR_CMD0_SDMS_TX0, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 },
  117. - { DSCR_CMD0_SDMS_RX0, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
  118. - { DSCR_CMD0_SDMS_TX1, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 },
  119. - { DSCR_CMD0_SDMS_RX1, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
  120. + { DSCR_CMD0_SDMS_TX0, DEV_FLAGS_OUT, 4, 8, 0x10600000, 0, 0 },
  121. + { DSCR_CMD0_SDMS_RX0, DEV_FLAGS_IN, 4, 8, 0x10600004, 0, 0 },
  122. + { DSCR_CMD0_SDMS_TX1, DEV_FLAGS_OUT, 4, 8, 0x10680000, 0, 0 },
  123. + { DSCR_CMD0_SDMS_RX1, DEV_FLAGS_IN, 4, 8, 0x10680004, 0, 0 },
  124. - { DSCR_CMD0_AES_TX, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 },
  125. - { DSCR_CMD0_AES_RX, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
  126. + { DSCR_CMD0_AES_RX, DEV_FLAGS_IN , 4, 32, 0x10300008, 0, 0 },
  127. + { DSCR_CMD0_AES_TX, DEV_FLAGS_OUT, 4, 32, 0x10300004, 0, 0 },
  128. { DSCR_CMD0_PSC0_TX, DEV_FLAGS_OUT, 0, 0, 0x11a0001c, 0, 0 },
  129. { DSCR_CMD0_PSC0_RX, DEV_FLAGS_IN, 0, 0, 0x11a0001c, 0, 0 },
  130. @@ -172,9 +147,9 @@ static dbdev_tab_t dbdev_tab[] = {
  131. { DSCR_CMD0_PSC1_RX, DEV_FLAGS_IN, 0, 0, 0x11b0001c, 0, 0 },
  132. { DSCR_CMD0_PSC1_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
  133. - { DSCR_CMD0_CIM_RXA, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
  134. - { DSCR_CMD0_CIM_RXB, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
  135. - { DSCR_CMD0_CIM_RXC, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
  136. + { DSCR_CMD0_CIM_RXA, DEV_FLAGS_IN, 0, 32, 0x14004020, 0, 0 },
  137. + { DSCR_CMD0_CIM_RXB, DEV_FLAGS_IN, 0, 32, 0x14004040, 0, 0 },
  138. + { DSCR_CMD0_CIM_RXC, DEV_FLAGS_IN, 0, 32, 0x14004060, 0, 0 },
  139. { DSCR_CMD0_CIM_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
  140. { DSCR_CMD0_NAND_FLASH, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
  141. @@ -183,6 +158,24 @@ static dbdev_tab_t dbdev_tab[] = {
  142. { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
  143. { DSCR_CMD0_ALWAYS, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
  144. +
  145. + /* Provide 16 user definable device types */
  146. + { 0, 0, 0, 0, 0, 0, 0 },
  147. + { 0, 0, 0, 0, 0, 0, 0 },
  148. + { 0, 0, 0, 0, 0, 0, 0 },
  149. + { 0, 0, 0, 0, 0, 0, 0 },
  150. + { 0, 0, 0, 0, 0, 0, 0 },
  151. + { 0, 0, 0, 0, 0, 0, 0 },
  152. + { 0, 0, 0, 0, 0, 0, 0 },
  153. + { 0, 0, 0, 0, 0, 0, 0 },
  154. + { 0, 0, 0, 0, 0, 0, 0 },
  155. + { 0, 0, 0, 0, 0, 0, 0 },
  156. + { 0, 0, 0, 0, 0, 0, 0 },
  157. + { 0, 0, 0, 0, 0, 0, 0 },
  158. + { 0, 0, 0, 0, 0, 0, 0 },
  159. + { 0, 0, 0, 0, 0, 0, 0 },
  160. + { 0, 0, 0, 0, 0, 0, 0 },
  161. + { 0, 0, 0, 0, 0, 0, 0 },
  162. };
  163. #define DBDEV_TAB_SIZE (sizeof(dbdev_tab) / sizeof(dbdev_tab_t))
  164. @@ -202,6 +195,30 @@ find_dbdev_id (u32 id)
  165. return NULL;
  166. }
  167. +u32
  168. +au1xxx_ddma_add_device(dbdev_tab_t *dev)
  169. +{
  170. + u32 ret = 0;
  171. + dbdev_tab_t *p=NULL;
  172. + static u16 new_id=0x1000;
  173. +
  174. + p = find_dbdev_id(0);
  175. + if ( NULL != p )
  176. + {
  177. + memcpy(p, dev, sizeof(dbdev_tab_t));
  178. + p->dev_id = DSCR_DEV2CUSTOM_ID(new_id,dev->dev_id);
  179. + ret = p->dev_id;
  180. + new_id++;
  181. +#if 0
  182. + printk("add_device: id:%x flags:%x padd:%x\n",
  183. + p->dev_id, p->dev_flags, p->dev_physaddr );
  184. +#endif
  185. + }
  186. +
  187. + return ret;
  188. +}
  189. +EXPORT_SYMBOL(au1xxx_ddma_add_device);
  190. +
  191. /* Allocate a channel and return a non-zero descriptor if successful.
  192. */
  193. u32
  194. @@ -214,7 +231,7 @@ au1xxx_dbdma_chan_alloc(u32 srcid, u32 d
  195. int i;
  196. dbdev_tab_t *stp, *dtp;
  197. chan_tab_t *ctp;
  198. - volatile au1x_dma_chan_t *cp;
  199. + au1x_dma_chan_t *cp;
  200. /* We do the intialization on the first channel allocation.
  201. * We have to wait because of the interrupt handler initialization
  202. @@ -224,9 +241,6 @@ au1xxx_dbdma_chan_alloc(u32 srcid, u32 d
  203. au1xxx_dbdma_init();
  204. dbdma_initialized = 1;
  205. - if ((srcid > DSCR_NDEV_IDS) || (destid > DSCR_NDEV_IDS))
  206. - return 0;
  207. -
  208. if ((stp = find_dbdev_id(srcid)) == NULL) return 0;
  209. if ((dtp = find_dbdev_id(destid)) == NULL) return 0;
  210. @@ -268,9 +282,9 @@ au1xxx_dbdma_chan_alloc(u32 srcid, u32 d
  211. /* If kmalloc fails, it is caught below same
  212. * as a channel not available.
  213. */
  214. - ctp = (chan_tab_t *)kmalloc(sizeof(chan_tab_t), GFP_KERNEL);
  215. + ctp = (chan_tab_t *)
  216. + kmalloc(sizeof(chan_tab_t), GFP_KERNEL);
  217. chan_tab_ptr[i] = ctp;
  218. - ctp->chan_index = chan = i;
  219. break;
  220. }
  221. }
  222. @@ -278,10 +292,11 @@ au1xxx_dbdma_chan_alloc(u32 srcid, u32 d
  223. if (ctp != NULL) {
  224. memset(ctp, 0, sizeof(chan_tab_t));
  225. + ctp->chan_index = chan = i;
  226. dcp = DDMA_CHANNEL_BASE;
  227. dcp += (0x0100 * chan);
  228. ctp->chan_ptr = (au1x_dma_chan_t *)dcp;
  229. - cp = (volatile au1x_dma_chan_t *)dcp;
  230. + cp = (au1x_dma_chan_t *)dcp;
  231. ctp->chan_src = stp;
  232. ctp->chan_dest = dtp;
  233. ctp->chan_callback = callback;
  234. @@ -298,6 +313,9 @@ au1xxx_dbdma_chan_alloc(u32 srcid, u32 d
  235. i |= DDMA_CFG_DED;
  236. if (dtp->dev_intpolarity)
  237. i |= DDMA_CFG_DP;
  238. + if ((stp->dev_flags & DEV_FLAGS_SYNC) ||
  239. + (dtp->dev_flags & DEV_FLAGS_SYNC))
  240. + i |= DDMA_CFG_SYNC;
  241. cp->ddma_cfg = i;
  242. au_sync();
  243. @@ -308,14 +326,14 @@ au1xxx_dbdma_chan_alloc(u32 srcid, u32 d
  244. rv = (u32)(&chan_tab_ptr[chan]);
  245. }
  246. else {
  247. - /* Release devices.
  248. - */
  249. + /* Release devices */
  250. stp->dev_flags &= ~DEV_FLAGS_INUSE;
  251. dtp->dev_flags &= ~DEV_FLAGS_INUSE;
  252. }
  253. }
  254. return rv;
  255. }
  256. +EXPORT_SYMBOL(au1xxx_dbdma_chan_alloc);
  257. /* Set the device width if source or destination is a FIFO.
  258. * Should be 8, 16, or 32 bits.
  259. @@ -343,6 +361,7 @@ au1xxx_dbdma_set_devwidth(u32 chanid, in
  260. return rv;
  261. }
  262. +EXPORT_SYMBOL(au1xxx_dbdma_set_devwidth);
  263. /* Allocate a descriptor ring, initializing as much as possible.
  264. */
  265. @@ -369,7 +388,8 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int
  266. * and if we try that first we are likely to not waste larger
  267. * slabs of memory.
  268. */
  269. - desc_base = (u32)kmalloc(entries * sizeof(au1x_ddma_desc_t), GFP_KERNEL);
  270. + desc_base = (u32)kmalloc(entries * sizeof(au1x_ddma_desc_t),
  271. + GFP_KERNEL|GFP_DMA);
  272. if (desc_base == 0)
  273. return 0;
  274. @@ -380,7 +400,7 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int
  275. kfree((const void *)desc_base);
  276. i = entries * sizeof(au1x_ddma_desc_t);
  277. i += (sizeof(au1x_ddma_desc_t) - 1);
  278. - if ((desc_base = (u32)kmalloc(i, GFP_KERNEL)) == 0)
  279. + if ((desc_base = (u32)kmalloc(i, GFP_KERNEL|GFP_DMA)) == 0)
  280. return 0;
  281. desc_base = ALIGN_ADDR(desc_base, sizeof(au1x_ddma_desc_t));
  282. @@ -460,9 +480,14 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int
  283. /* If source input is fifo, set static address.
  284. */
  285. if (stp->dev_flags & DEV_FLAGS_IN) {
  286. - src0 = stp->dev_physaddr;
  287. - src1 |= DSCR_SRC1_SAM(DSCR_xAM_STATIC);
  288. + if ( stp->dev_flags & DEV_FLAGS_BURSTABLE )
  289. + src1 |= DSCR_SRC1_SAM(DSCR_xAM_BURST);
  290. + else
  291. + src1 |= DSCR_SRC1_SAM(DSCR_xAM_STATIC);
  292. +
  293. }
  294. + if (stp->dev_physaddr)
  295. + src0 = stp->dev_physaddr;
  296. /* Set up dest1. For now, assume no stride and increment.
  297. * A channel attribute update can change this later.
  298. @@ -486,10 +511,18 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int
  299. /* If destination output is fifo, set static address.
  300. */
  301. if (dtp->dev_flags & DEV_FLAGS_OUT) {
  302. - dest0 = dtp->dev_physaddr;
  303. + if ( dtp->dev_flags & DEV_FLAGS_BURSTABLE )
  304. + dest1 |= DSCR_DEST1_DAM(DSCR_xAM_BURST);
  305. + else
  306. dest1 |= DSCR_DEST1_DAM(DSCR_xAM_STATIC);
  307. }
  308. + if (dtp->dev_physaddr)
  309. + dest0 = dtp->dev_physaddr;
  310. +#if 0
  311. + printk("did:%x sid:%x cmd0:%x cmd1:%x source0:%x source1:%x dest0:%x dest1:%x\n",
  312. + dtp->dev_id, stp->dev_id, cmd0, cmd1, src0, src1, dest0, dest1 );
  313. +#endif
  314. for (i=0; i<entries; i++) {
  315. dp->dscr_cmd0 = cmd0;
  316. dp->dscr_cmd1 = cmd1;
  317. @@ -498,6 +531,7 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int
  318. dp->dscr_dest0 = dest0;
  319. dp->dscr_dest1 = dest1;
  320. dp->dscr_stat = 0;
  321. + dp->sw_context = dp->sw_status = 0;
  322. dp->dscr_nxtptr = DSCR_NXTPTR(virt_to_phys(dp + 1));
  323. dp++;
  324. }
  325. @@ -510,13 +544,14 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int
  326. return (u32)(ctp->chan_desc_base);
  327. }
  328. +EXPORT_SYMBOL(au1xxx_dbdma_ring_alloc);
  329. /* Put a source buffer into the DMA ring.
  330. * This updates the source pointer and byte count. Normally used
  331. * for memory to fifo transfers.
  332. */
  333. u32
  334. -au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes)
  335. +_au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags)
  336. {
  337. chan_tab_t *ctp;
  338. au1x_ddma_desc_t *dp;
  339. @@ -543,24 +578,40 @@ au1xxx_dbdma_put_source(u32 chanid, void
  340. */
  341. dp->dscr_source0 = virt_to_phys(buf);
  342. dp->dscr_cmd1 = nbytes;
  343. - dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */
  344. - ctp->chan_ptr->ddma_dbell = 0xffffffff; /* Make it go */
  345. -
  346. + /* Check flags */
  347. + if (flags & DDMA_FLAGS_IE)
  348. + dp->dscr_cmd0 |= DSCR_CMD0_IE;
  349. + if (flags & DDMA_FLAGS_NOIE)
  350. + dp->dscr_cmd0 &= ~DSCR_CMD0_IE;
  351. /* Get next descriptor pointer.
  352. */
  353. ctp->put_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
  354. + /*
  355. + * There is an errata on the Au1200/Au1550 parts that could result
  356. + * in "stale" data being DMA'd. It has to do with the snoop logic on
  357. + * the dache eviction buffer. NONCOHERENT_IO is on by default for
  358. + * these parts. If it is fixedin the future, these dma_cache_inv will
  359. + * just be nothing more than empty macros. See io.h.
  360. + * */
  361. + dma_cache_wback_inv(buf,nbytes);
  362. + dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */
  363. + au_sync();
  364. + dma_cache_wback_inv(dp, sizeof(dp));
  365. + ctp->chan_ptr->ddma_dbell = 0;
  366. +
  367. /* return something not zero.
  368. */
  369. return nbytes;
  370. }
  371. +EXPORT_SYMBOL(_au1xxx_dbdma_put_source);
  372. /* Put a destination buffer into the DMA ring.
  373. * This updates the destination pointer and byte count. Normally used
  374. * to place an empty buffer into the ring for fifo to memory transfers.
  375. */
  376. u32
  377. -au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes)
  378. +_au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags)
  379. {
  380. chan_tab_t *ctp;
  381. au1x_ddma_desc_t *dp;
  382. @@ -582,11 +633,33 @@ au1xxx_dbdma_put_dest(u32 chanid, void *
  383. if (dp->dscr_cmd0 & DSCR_CMD0_V)
  384. return 0;
  385. - /* Load up buffer address and byte count.
  386. - */
  387. + /* Load up buffer address and byte count */
  388. +
  389. + /* Check flags */
  390. + if (flags & DDMA_FLAGS_IE)
  391. + dp->dscr_cmd0 |= DSCR_CMD0_IE;
  392. + if (flags & DDMA_FLAGS_NOIE)
  393. + dp->dscr_cmd0 &= ~DSCR_CMD0_IE;
  394. +
  395. dp->dscr_dest0 = virt_to_phys(buf);
  396. dp->dscr_cmd1 = nbytes;
  397. +#if 0
  398. + printk("cmd0:%x cmd1:%x source0:%x source1:%x dest0:%x dest1:%x\n",
  399. + dp->dscr_cmd0, dp->dscr_cmd1, dp->dscr_source0,
  400. + dp->dscr_source1, dp->dscr_dest0, dp->dscr_dest1 );
  401. +#endif
  402. + /*
  403. + * There is an errata on the Au1200/Au1550 parts that could result in
  404. + * "stale" data being DMA'd. It has to do with the snoop logic on the
  405. + * dache eviction buffer. NONCOHERENT_IO is on by default for these
  406. + * parts. If it is fixedin the future, these dma_cache_inv will just
  407. + * be nothing more than empty macros. See io.h.
  408. + * */
  409. + dma_cache_inv(buf,nbytes);
  410. dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */
  411. + au_sync();
  412. + dma_cache_wback_inv(dp, sizeof(dp));
  413. + ctp->chan_ptr->ddma_dbell = 0;
  414. /* Get next descriptor pointer.
  415. */
  416. @@ -596,6 +669,7 @@ au1xxx_dbdma_put_dest(u32 chanid, void *
  417. */
  418. return nbytes;
  419. }
  420. +EXPORT_SYMBOL(_au1xxx_dbdma_put_dest);
  421. /* Get a destination buffer into the DMA ring.
  422. * Normally used to get a full buffer from the ring during fifo
  423. @@ -645,7 +719,7 @@ void
  424. au1xxx_dbdma_stop(u32 chanid)
  425. {
  426. chan_tab_t *ctp;
  427. - volatile au1x_dma_chan_t *cp;
  428. + au1x_dma_chan_t *cp;
  429. int halt_timeout = 0;
  430. ctp = *((chan_tab_t **)chanid);
  431. @@ -665,6 +739,7 @@ au1xxx_dbdma_stop(u32 chanid)
  432. cp->ddma_stat |= (DDMA_STAT_DB | DDMA_STAT_V);
  433. au_sync();
  434. }
  435. +EXPORT_SYMBOL(au1xxx_dbdma_stop);
  436. /* Start using the current descriptor pointer. If the dbdma encounters
  437. * a not valid descriptor, it will stop. In this case, we can just
  438. @@ -674,17 +749,17 @@ void
  439. au1xxx_dbdma_start(u32 chanid)
  440. {
  441. chan_tab_t *ctp;
  442. - volatile au1x_dma_chan_t *cp;
  443. + au1x_dma_chan_t *cp;
  444. ctp = *((chan_tab_t **)chanid);
  445. -
  446. cp = ctp->chan_ptr;
  447. cp->ddma_desptr = virt_to_phys(ctp->cur_ptr);
  448. cp->ddma_cfg |= DDMA_CFG_EN; /* Enable channel */
  449. au_sync();
  450. - cp->ddma_dbell = 0xffffffff; /* Make it go */
  451. + cp->ddma_dbell = 0;
  452. au_sync();
  453. }
  454. +EXPORT_SYMBOL(au1xxx_dbdma_start);
  455. void
  456. au1xxx_dbdma_reset(u32 chanid)
  457. @@ -703,15 +778,21 @@ au1xxx_dbdma_reset(u32 chanid)
  458. do {
  459. dp->dscr_cmd0 &= ~DSCR_CMD0_V;
  460. + /* reset our SW status -- this is used to determine
  461. + * if a descriptor is in use by upper level SW. Since
  462. + * posting can reset 'V' bit.
  463. + */
  464. + dp->sw_status = 0;
  465. dp = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
  466. } while (dp != ctp->chan_desc_base);
  467. }
  468. +EXPORT_SYMBOL(au1xxx_dbdma_reset);
  469. u32
  470. au1xxx_get_dma_residue(u32 chanid)
  471. {
  472. chan_tab_t *ctp;
  473. - volatile au1x_dma_chan_t *cp;
  474. + au1x_dma_chan_t *cp;
  475. u32 rv;
  476. ctp = *((chan_tab_t **)chanid);
  477. @@ -746,15 +827,16 @@ au1xxx_dbdma_chan_free(u32 chanid)
  478. kfree(ctp);
  479. }
  480. +EXPORT_SYMBOL(au1xxx_dbdma_chan_free);
  481. static void
  482. dbdma_interrupt(int irq, void *dev_id, struct pt_regs *regs)
  483. {
  484. - u32 intstat;
  485. + u32 intstat, flags;
  486. u32 chan_index;
  487. chan_tab_t *ctp;
  488. au1x_ddma_desc_t *dp;
  489. - volatile au1x_dma_chan_t *cp;
  490. + au1x_dma_chan_t *cp;
  491. intstat = dbdma_gptr->ddma_intstat;
  492. au_sync();
  493. @@ -773,18 +855,26 @@ dbdma_interrupt(int irq, void *dev_id, s
  494. (ctp->chan_callback)(irq, ctp->chan_callparam, regs);
  495. ctp->cur_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
  496. -
  497. }
  498. -static void
  499. -au1xxx_dbdma_init(void)
  500. +static void au1xxx_dbdma_init(void)
  501. {
  502. + int irq_nr;
  503. +
  504. dbdma_gptr->ddma_config = 0;
  505. dbdma_gptr->ddma_throttle = 0;
  506. dbdma_gptr->ddma_inten = 0xffff;
  507. au_sync();
  508. - if (request_irq(AU1550_DDMA_INT, dbdma_interrupt, SA_INTERRUPT,
  509. +#if defined(CONFIG_SOC_AU1550)
  510. + irq_nr = AU1550_DDMA_INT;
  511. +#elif defined(CONFIG_SOC_AU1200)
  512. + irq_nr = AU1200_DDMA_INT;
  513. +#else
  514. + #error Unknown Au1x00 SOC
  515. +#endif
  516. +
  517. + if (request_irq(irq_nr, dbdma_interrupt, SA_INTERRUPT,
  518. "Au1xxx dbdma", (void *)dbdma_gptr))
  519. printk("Can't get 1550 dbdma irq");
  520. }
  521. @@ -795,7 +885,8 @@ au1xxx_dbdma_dump(u32 chanid)
  522. chan_tab_t *ctp;
  523. au1x_ddma_desc_t *dp;
  524. dbdev_tab_t *stp, *dtp;
  525. - volatile au1x_dma_chan_t *cp;
  526. + au1x_dma_chan_t *cp;
  527. + u32 i = 0;
  528. ctp = *((chan_tab_t **)chanid);
  529. stp = ctp->chan_src;
  530. @@ -820,15 +911,64 @@ au1xxx_dbdma_dump(u32 chanid)
  531. dp = ctp->chan_desc_base;
  532. do {
  533. - printk("dp %08x, cmd0 %08x, cmd1 %08x\n",
  534. - (u32)dp, dp->dscr_cmd0, dp->dscr_cmd1);
  535. - printk("src0 %08x, src1 %08x, dest0 %08x\n",
  536. - dp->dscr_source0, dp->dscr_source1, dp->dscr_dest0);
  537. - printk("dest1 %08x, stat %08x, nxtptr %08x\n",
  538. - dp->dscr_dest1, dp->dscr_stat, dp->dscr_nxtptr);
  539. + printk("Dp[%d]= %08x, cmd0 %08x, cmd1 %08x\n",
  540. + i++, (u32)dp, dp->dscr_cmd0, dp->dscr_cmd1);
  541. + printk("src0 %08x, src1 %08x, dest0 %08x, dest1 %08x\n",
  542. + dp->dscr_source0, dp->dscr_source1, dp->dscr_dest0, dp->dscr_dest1);
  543. + printk("stat %08x, nxtptr %08x\n",
  544. + dp->dscr_stat, dp->dscr_nxtptr);
  545. dp = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
  546. } while (dp != ctp->chan_desc_base);
  547. }
  548. +/* Put a descriptor into the DMA ring.
  549. + * This updates the source/destination pointers and byte count.
  550. + */
  551. +u32
  552. +au1xxx_dbdma_put_dscr(u32 chanid, au1x_ddma_desc_t *dscr )
  553. +{
  554. + chan_tab_t *ctp;
  555. + au1x_ddma_desc_t *dp;
  556. + u32 nbytes=0;
  557. +
  558. + /* I guess we could check this to be within the
  559. + * range of the table......
  560. + */
  561. + ctp = *((chan_tab_t **)chanid);
  562. +
  563. + /* We should have multiple callers for a particular channel,
  564. + * an interrupt doesn't affect this pointer nor the descriptor,
  565. + * so no locking should be needed.
  566. + */
  567. + dp = ctp->put_ptr;
  568. +
  569. + /* If the descriptor is valid, we are way ahead of the DMA
  570. + * engine, so just return an error condition.
  571. + */
  572. + if (dp->dscr_cmd0 & DSCR_CMD0_V)
  573. + return 0;
  574. +
  575. + /* Load up buffer addresses and byte count.
  576. + */
  577. + dp->dscr_dest0 = dscr->dscr_dest0;
  578. + dp->dscr_source0 = dscr->dscr_source0;
  579. + dp->dscr_dest1 = dscr->dscr_dest1;
  580. + dp->dscr_source1 = dscr->dscr_source1;
  581. + dp->dscr_cmd1 = dscr->dscr_cmd1;
  582. + nbytes = dscr->dscr_cmd1;
  583. + /* Allow the caller to specifiy if an interrupt is generated */
  584. + dp->dscr_cmd0 &= ~DSCR_CMD0_IE;
  585. + dp->dscr_cmd0 |= dscr->dscr_cmd0 | DSCR_CMD0_V;
  586. + ctp->chan_ptr->ddma_dbell = 0;
  587. +
  588. + /* Get next descriptor pointer.
  589. + */
  590. + ctp->put_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
  591. +
  592. + /* return something not zero.
  593. + */
  594. + return nbytes;
  595. +}
  596. +
  597. #endif /* defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) */
  598. Index: linux-2.4.35.4/arch/mips/au1000/common/gpio.c
  599. ===================================================================
  600. --- /dev/null
  601. +++ linux-2.4.35.4/arch/mips/au1000/common/gpio.c
  602. @@ -0,0 +1,118 @@
  603. +/*
  604. + * This program is free software; you can redistribute it and/or modify it
  605. + * under the terms of the GNU General Public License as published by the
  606. + * Free Software Foundation; either version 2 of the License, or (at your
  607. + * option) any later version.
  608. + *
  609. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  610. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  611. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  612. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  613. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  614. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  615. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  616. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  617. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  618. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  619. + *
  620. + * You should have received a copy of the GNU General Public License along
  621. + * with this program; if not, write to the Free Software Foundation, Inc.,
  622. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  623. + */
  624. +
  625. +#include <asm/au1000.h>
  626. +#include <asm/au1xxx_gpio.h>
  627. +
  628. +#define gpio1 sys
  629. +#if !defined(CONFIG_SOC_AU1000)
  630. +static AU1X00_GPIO2 * const gpio2 = (AU1X00_GPIO2 *)GPIO2_BASE;
  631. +
  632. +#define GPIO2_OUTPUT_ENABLE_MASK 0x00010000
  633. +
  634. +int au1xxx_gpio2_read(int signal)
  635. +{
  636. + signal -= 200;
  637. +/* gpio2->dir &= ~(0x01 << signal); //Set GPIO to input */
  638. + return ((gpio2->pinstate >> signal) & 0x01);
  639. +}
  640. +
  641. +void au1xxx_gpio2_write(int signal, int value)
  642. +{
  643. + signal -= 200;
  644. +
  645. + gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << signal) |
  646. + (value << signal);
  647. +}
  648. +
  649. +void au1xxx_gpio2_tristate(int signal)
  650. +{
  651. + signal -= 200;
  652. + gpio2->dir &= ~(0x01 << signal); /* Set GPIO to input */
  653. +}
  654. +#endif
  655. +
  656. +int au1xxx_gpio1_read(int signal)
  657. +{
  658. +/* gpio1->trioutclr |= (0x01 << signal); */
  659. + return ((gpio1->pinstaterd >> signal) & 0x01);
  660. +}
  661. +
  662. +void au1xxx_gpio1_write(int signal, int value)
  663. +{
  664. + if(value)
  665. + gpio1->outputset = (0x01 << signal);
  666. + else
  667. + gpio1->outputclr = (0x01 << signal); /* Output a Zero */
  668. +}
  669. +
  670. +void au1xxx_gpio1_tristate(int signal)
  671. +{
  672. + gpio1->trioutclr = (0x01 << signal); /* Tristate signal */
  673. +}
  674. +
  675. +
  676. +int au1xxx_gpio_read(int signal)
  677. +{
  678. + if(signal >= 200)
  679. +#if defined(CONFIG_SOC_AU1000)
  680. + return 0;
  681. +#else
  682. + return au1xxx_gpio2_read(signal);
  683. +#endif
  684. + else
  685. + return au1xxx_gpio1_read(signal);
  686. +}
  687. +
  688. +void au1xxx_gpio_write(int signal, int value)
  689. +{
  690. + if(signal >= 200)
  691. +#if defined(CONFIG_SOC_AU1000)
  692. + ;
  693. +#else
  694. + au1xxx_gpio2_write(signal, value);
  695. +#endif
  696. + else
  697. + au1xxx_gpio1_write(signal, value);
  698. +}
  699. +
  700. +void au1xxx_gpio_tristate(int signal)
  701. +{
  702. + if(signal >= 200)
  703. +#if defined(CONFIG_SOC_AU1000)
  704. + ;
  705. +#else
  706. + au1xxx_gpio2_tristate(signal);
  707. +#endif
  708. + else
  709. + au1xxx_gpio1_tristate(signal);
  710. +}
  711. +
  712. +void au1xxx_gpio1_set_inputs(void)
  713. +{
  714. + gpio1->pininputen = 0;
  715. +}
  716. +
  717. +EXPORT_SYMBOL(au1xxx_gpio1_set_inputs);
  718. +EXPORT_SYMBOL(au1xxx_gpio_tristate);
  719. +EXPORT_SYMBOL(au1xxx_gpio_write);
  720. +EXPORT_SYMBOL(au1xxx_gpio_read);
  721. Index: linux-2.4.35.4/arch/mips/au1000/common/irq.c
  722. ===================================================================
  723. --- linux-2.4.35.4.orig/arch/mips/au1000/common/irq.c
  724. +++ linux-2.4.35.4/arch/mips/au1000/common/irq.c
  725. @@ -303,8 +303,30 @@ static struct hw_interrupt_type level_ir
  726. };
  727. #ifdef CONFIG_PM
  728. -void startup_match20_interrupt(void)
  729. +void startup_match20_interrupt(void (*handler)(int, void *, struct pt_regs *))
  730. {
  731. + static struct irqaction action;
  732. + /* This is a big problem.... since we didn't use request_irq
  733. + when kernel/irq.c calls probe_irq_xxx this interrupt will
  734. + be probed for usage. This will end up disabling the device :(
  735. +
  736. + Give it a bogus "action" pointer -- this will keep it from
  737. + getting auto-probed!
  738. +
  739. + By setting the status to match that of request_irq() we
  740. + can avoid it. --cgray
  741. + */
  742. + action.dev_id = handler;
  743. + action.flags = 0;
  744. + action.mask = 0;
  745. + action.name = "Au1xxx TOY";
  746. + action.handler = handler;
  747. + action.next = NULL;
  748. +
  749. + irq_desc[AU1000_TOY_MATCH2_INT].action = &action;
  750. + irq_desc[AU1000_TOY_MATCH2_INT].status
  751. + &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS);
  752. +
  753. local_enable_irq(AU1000_TOY_MATCH2_INT);
  754. }
  755. #endif
  756. @@ -508,6 +530,7 @@ void intc0_req0_irqdispatch(struct pt_re
  757. if (!intc0_req0) return;
  758. +#ifdef AU1000_USB_DEV_REQ_INT
  759. /*
  760. * Because of the tight timing of SETUP token to reply
  761. * transactions, the USB devices-side packet complete
  762. @@ -518,6 +541,7 @@ void intc0_req0_irqdispatch(struct pt_re
  763. do_IRQ(AU1000_USB_DEV_REQ_INT, regs);
  764. return;
  765. }
  766. +#endif
  767. irq = au_ffs(intc0_req0) - 1;
  768. intc0_req0 &= ~(1<<irq);
  769. @@ -536,17 +560,7 @@ void intc0_req1_irqdispatch(struct pt_re
  770. irq = au_ffs(intc0_req1) - 1;
  771. intc0_req1 &= ~(1<<irq);
  772. -#ifdef CONFIG_PM
  773. - if (irq == AU1000_TOY_MATCH2_INT) {
  774. - mask_and_ack_rise_edge_irq(irq);
  775. - counter0_irq(irq, NULL, regs);
  776. - local_enable_irq(irq);
  777. - }
  778. - else
  779. -#endif
  780. - {
  781. - do_IRQ(irq, regs);
  782. - }
  783. + do_IRQ(irq, regs);
  784. }
  785. Index: linux-2.4.35.4/arch/mips/au1000/common/Makefile
  786. ===================================================================
  787. --- linux-2.4.35.4.orig/arch/mips/au1000/common/Makefile
  788. +++ linux-2.4.35.4/arch/mips/au1000/common/Makefile
  789. @@ -19,9 +19,9 @@ O_TARGET := au1000.o
  790. export-objs = prom.o clocks.o power.o usbdev.o
  791. obj-y := prom.o int-handler.o irq.o puts.o time.o reset.o cputable.o \
  792. - au1xxx_irqmap.o clocks.o power.o setup.o sleeper.o dma.o dbdma.o
  793. + au1xxx_irqmap.o clocks.o power.o setup.o sleeper.o dma.o dbdma.o gpio.o
  794. -export-objs += dma.o dbdma.o
  795. +export-objs += dma.o dbdma.o gpio.o
  796. obj-$(CONFIG_AU1X00_USB_DEVICE) += usbdev.o
  797. obj-$(CONFIG_KGDB) += dbg_io.o
  798. Index: linux-2.4.35.4/arch/mips/au1000/common/pci_fixup.c
  799. ===================================================================
  800. --- linux-2.4.35.4.orig/arch/mips/au1000/common/pci_fixup.c
  801. +++ linux-2.4.35.4/arch/mips/au1000/common/pci_fixup.c
  802. @@ -75,9 +75,13 @@ void __init pcibios_fixup(void)
  803. #ifdef CONFIG_NONCOHERENT_IO
  804. /*
  805. - * Set the NC bit in controller for pre-AC silicon
  806. + * Set the NC bit in controller for Au1500 pre-AC silicon
  807. */
  808. - au_writel( 1<<16 | au_readl(Au1500_PCI_CFG), Au1500_PCI_CFG);
  809. + u32 prid = read_c0_prid();
  810. + if ( (prid & 0xFF000000) == 0x01000000 && prid < 0x01030202) {
  811. + au_writel( 1<<16 | au_readl(Au1500_PCI_CFG), Au1500_PCI_CFG);
  812. + printk("Non-coherent PCI accesses enabled\n");
  813. + }
  814. printk("Non-coherent PCI accesses enabled\n");
  815. #endif
  816. Index: linux-2.4.35.4/arch/mips/au1000/common/pci_ops.c
  817. ===================================================================
  818. --- linux-2.4.35.4.orig/arch/mips/au1000/common/pci_ops.c
  819. +++ linux-2.4.35.4/arch/mips/au1000/common/pci_ops.c
  820. @@ -162,6 +162,7 @@ unsigned long last_entryLo0, last_entryL
  821. static int config_access(unsigned char access_type, struct pci_dev *dev,
  822. unsigned char where, u32 * data)
  823. {
  824. + int error = PCIBIOS_SUCCESSFUL;
  825. #if defined( CONFIG_SOC_AU1500 ) || defined( CONFIG_SOC_AU1550 )
  826. unsigned char bus = dev->bus->number;
  827. unsigned int dev_fn = dev->devfn;
  828. @@ -170,7 +171,6 @@ static int config_access(unsigned char a
  829. unsigned long offset, status;
  830. unsigned long cfg_base;
  831. unsigned long flags;
  832. - int error = PCIBIOS_SUCCESSFUL;
  833. unsigned long entryLo0, entryLo1;
  834. if (device > 19) {
  835. @@ -205,9 +205,8 @@ static int config_access(unsigned char a
  836. last_entryLo0 = last_entryLo1 = 0xffffffff;
  837. }
  838. - /* Since the Au1xxx doesn't do the idsel timing exactly to spec,
  839. - * many board vendors implement their own off-chip idsel, so call
  840. - * it now. If it doesn't succeed, may as well bail out at this point.
  841. + /* Allow board vendors to implement their own off-chip idsel.
  842. + * If it doesn't succeed, may as well bail out at this point.
  843. */
  844. if (board_pci_idsel) {
  845. if (board_pci_idsel(device, 1) == 0) {
  846. @@ -271,8 +270,11 @@ static int config_access(unsigned char a
  847. }
  848. local_irq_restore(flags);
  849. - return error;
  850. +#else
  851. + /* Fake out Config space access with no responder */
  852. + *data = 0xFFFFFFFF;
  853. #endif
  854. + return error;
  855. }
  856. #endif
  857. Index: linux-2.4.35.4/arch/mips/au1000/common/power.c
  858. ===================================================================
  859. --- linux-2.4.35.4.orig/arch/mips/au1000/common/power.c
  860. +++ linux-2.4.35.4/arch/mips/au1000/common/power.c
  861. @@ -50,7 +50,6 @@
  862. static void calibrate_delay(void);
  863. -extern void set_au1x00_speed(unsigned int new_freq);
  864. extern unsigned int get_au1x00_speed(void);
  865. extern unsigned long get_au1x00_uart_baud_base(void);
  866. extern void set_au1x00_uart_baud_base(unsigned long new_baud_base);
  867. @@ -116,6 +115,7 @@ save_core_regs(void)
  868. sleep_uart0_clkdiv = au_readl(UART0_ADDR + UART_CLK);
  869. sleep_uart0_enable = au_readl(UART0_ADDR + UART_MOD_CNTRL);
  870. +#ifndef CONFIG_SOC_AU1200
  871. /* Shutdown USB host/device.
  872. */
  873. sleep_usbhost_enable = au_readl(USB_HOST_CONFIG);
  874. @@ -127,6 +127,7 @@ save_core_regs(void)
  875. sleep_usbdev_enable = au_readl(USBD_ENABLE);
  876. au_writel(0, USBD_ENABLE); au_sync();
  877. +#endif
  878. /* Save interrupt controller state.
  879. */
  880. @@ -212,14 +213,12 @@ void wakeup_from_suspend(void)
  881. int au_sleep(void)
  882. {
  883. unsigned long wakeup, flags;
  884. - extern void save_and_sleep(void);
  885. + extern unsigned int save_and_sleep(void);
  886. spin_lock_irqsave(&pm_lock,flags);
  887. save_core_regs();
  888. - flush_cache_all();
  889. -
  890. /** The code below is all system dependent and we should probably
  891. ** have a function call out of here to set this up. You need
  892. ** to configure the GPIO or timer interrupts that will bring
  893. @@ -227,27 +226,26 @@ int au_sleep(void)
  894. ** For testing, the TOY counter wakeup is useful.
  895. **/
  896. -#if 0
  897. +#if 1
  898. au_writel(au_readl(SYS_PINSTATERD) & ~(1 << 11), SYS_PINSTATERD);
  899. /* gpio 6 can cause a wake up event */
  900. wakeup = au_readl(SYS_WAKEMSK);
  901. wakeup &= ~(1 << 8); /* turn off match20 wakeup */
  902. - wakeup |= 1 << 6; /* turn on gpio 6 wakeup */
  903. + wakeup = 1 << 5; /* turn on gpio 6 wakeup */
  904. #else
  905. - /* For testing, allow match20 to wake us up.
  906. - */
  907. + /* For testing, allow match20 to wake us up. */
  908. #ifdef SLEEP_TEST_TIMEOUT
  909. wakeup_counter0_set(sleep_ticks);
  910. #endif
  911. wakeup = 1 << 8; /* turn on match20 wakeup */
  912. wakeup = 0;
  913. #endif
  914. - au_writel(1, SYS_WAKESRC); /* clear cause */
  915. + au_writel(0, SYS_WAKESRC); /* clear cause */
  916. au_sync();
  917. au_writel(wakeup, SYS_WAKEMSK);
  918. au_sync();
  919. -
  920. + DPRINTK("Entering sleep!\n");
  921. save_and_sleep();
  922. /* after a wakeup, the cpu vectors back to 0x1fc00000 so
  923. @@ -255,6 +253,7 @@ int au_sleep(void)
  924. */
  925. restore_core_regs();
  926. spin_unlock_irqrestore(&pm_lock, flags);
  927. + DPRINTK("Leaving sleep!\n");
  928. return 0;
  929. }
  930. @@ -285,7 +284,6 @@ static int pm_do_sleep(ctl_table * ctl,
  931. if (retval)
  932. return retval;
  933. -
  934. au_sleep();
  935. retval = pm_send_all(PM_RESUME, (void *) 0);
  936. }
  937. @@ -296,7 +294,6 @@ static int pm_do_suspend(ctl_table * ctl
  938. void *buffer, size_t * len)
  939. {
  940. int retval = 0;
  941. - void au1k_wait(void);
  942. if (!write) {
  943. *len = 0;
  944. @@ -305,119 +302,9 @@ static int pm_do_suspend(ctl_table * ctl
  945. if (retval)
  946. return retval;
  947. suspend_mode = 1;
  948. - au1k_wait();
  949. - retval = pm_send_all(PM_RESUME, (void *) 0);
  950. - }
  951. - return retval;
  952. -}
  953. -
  954. -static int pm_do_freq(ctl_table * ctl, int write, struct file *file,
  955. - void *buffer, size_t * len)
  956. -{
  957. - int retval = 0, i;
  958. - unsigned long val, pll;
  959. -#define TMPBUFLEN 64
  960. -#define MAX_CPU_FREQ 396
  961. - char buf[TMPBUFLEN], *p;
  962. - unsigned long flags, intc0_mask, intc1_mask;
  963. - unsigned long old_baud_base, old_cpu_freq, baud_rate, old_clk,
  964. - old_refresh;
  965. - unsigned long new_baud_base, new_cpu_freq, new_clk, new_refresh;
  966. -
  967. - spin_lock_irqsave(&pm_lock, flags);
  968. - if (!write) {
  969. - *len = 0;
  970. - } else {
  971. - /* Parse the new frequency */
  972. - if (*len > TMPBUFLEN - 1) {
  973. - spin_unlock_irqrestore(&pm_lock, flags);
  974. - return -EFAULT;
  975. - }
  976. - if (copy_from_user(buf, buffer, *len)) {
  977. - spin_unlock_irqrestore(&pm_lock, flags);
  978. - return -EFAULT;
  979. - }
  980. - buf[*len] = 0;
  981. - p = buf;
  982. - val = simple_strtoul(p, &p, 0);
  983. - if (val > MAX_CPU_FREQ) {
  984. - spin_unlock_irqrestore(&pm_lock, flags);
  985. - return -EFAULT;
  986. - }
  987. -
  988. - pll = val / 12;
  989. - if ((pll > 33) || (pll < 7)) { /* 396 MHz max, 84 MHz min */
  990. - /* revisit this for higher speed cpus */
  991. - spin_unlock_irqrestore(&pm_lock, flags);
  992. - return -EFAULT;
  993. - }
  994. -
  995. - old_baud_base = get_au1x00_uart_baud_base();
  996. - old_cpu_freq = get_au1x00_speed();
  997. -
  998. - new_cpu_freq = pll * 12 * 1000000;
  999. - new_baud_base = (new_cpu_freq / (2 * ((int)(au_readl(SYS_POWERCTRL)&0x03) + 2) * 16));
  1000. - set_au1x00_speed(new_cpu_freq);
  1001. - set_au1x00_uart_baud_base(new_baud_base);
  1002. -
  1003. - old_refresh = au_readl(MEM_SDREFCFG) & 0x1ffffff;
  1004. - new_refresh =
  1005. - ((old_refresh * new_cpu_freq) /
  1006. - old_cpu_freq) | (au_readl(MEM_SDREFCFG) & ~0x1ffffff);
  1007. -
  1008. - au_writel(pll, SYS_CPUPLL);
  1009. - au_sync_delay(1);
  1010. - au_writel(new_refresh, MEM_SDREFCFG);
  1011. - au_sync_delay(1);
  1012. -
  1013. - for (i = 0; i < 4; i++) {
  1014. - if (au_readl
  1015. - (UART_BASE + UART_MOD_CNTRL +
  1016. - i * 0x00100000) == 3) {
  1017. - old_clk =
  1018. - au_readl(UART_BASE + UART_CLK +
  1019. - i * 0x00100000);
  1020. - // baud_rate = baud_base/clk
  1021. - baud_rate = old_baud_base / old_clk;
  1022. - /* we won't get an exact baud rate and the error
  1023. - * could be significant enough that our new
  1024. - * calculation will result in a clock that will
  1025. - * give us a baud rate that's too far off from
  1026. - * what we really want.
  1027. - */
  1028. - if (baud_rate > 100000)
  1029. - baud_rate = 115200;
  1030. - else if (baud_rate > 50000)
  1031. - baud_rate = 57600;
  1032. - else if (baud_rate > 30000)
  1033. - baud_rate = 38400;
  1034. - else if (baud_rate > 17000)
  1035. - baud_rate = 19200;
  1036. - else
  1037. - (baud_rate = 9600);
  1038. - // new_clk = new_baud_base/baud_rate
  1039. - new_clk = new_baud_base / baud_rate;
  1040. - au_writel(new_clk,
  1041. - UART_BASE + UART_CLK +
  1042. - i * 0x00100000);
  1043. - au_sync_delay(10);
  1044. - }
  1045. - }
  1046. + retval = pm_send_all(PM_RESUME, (void *) 0);
  1047. }
  1048. -
  1049. -
  1050. - /* We don't want _any_ interrupts other than
  1051. - * match20. Otherwise our calibrate_delay()
  1052. - * calculation will be off, potentially a lot.
  1053. - */
  1054. - intc0_mask = save_local_and_disable(0);
  1055. - intc1_mask = save_local_and_disable(1);
  1056. - local_enable_irq(AU1000_TOY_MATCH2_INT);
  1057. - spin_unlock_irqrestore(&pm_lock, flags);
  1058. - calibrate_delay();
  1059. - restore_local_and_enable(0, intc0_mask);
  1060. - restore_local_and_enable(1, intc1_mask);
  1061. return retval;
  1062. }
  1063. @@ -425,7 +312,6 @@ static int pm_do_freq(ctl_table * ctl, i
  1064. static struct ctl_table pm_table[] = {
  1065. {ACPI_S1_SLP_TYP, "suspend", NULL, 0, 0600, NULL, &pm_do_suspend},
  1066. {ACPI_SLEEP, "sleep", NULL, 0, 0600, NULL, &pm_do_sleep},
  1067. - {CTL_ACPI, "freq", NULL, 0, 0600, NULL, &pm_do_freq},
  1068. {0}
  1069. };
  1070. Index: linux-2.4.35.4/arch/mips/au1000/common/reset.c
  1071. ===================================================================
  1072. --- linux-2.4.35.4.orig/arch/mips/au1000/common/reset.c
  1073. +++ linux-2.4.35.4/arch/mips/au1000/common/reset.c
  1074. @@ -37,8 +37,6 @@
  1075. #include <asm/system.h>
  1076. #include <asm/au1000.h>
  1077. -extern int au_sleep(void);
  1078. -
  1079. void au1000_restart(char *command)
  1080. {
  1081. /* Set all integrated peripherals to disabled states */
  1082. @@ -144,6 +142,26 @@ void au1000_restart(char *command)
  1083. au_writel(0x00, 0xb1900064); /* sys_auxpll */
  1084. au_writel(0x00, 0xb1900100); /* sys_pininputen */
  1085. break;
  1086. + case 0x04000000: /* Au1200 */
  1087. + au_writel(0x00, 0xb400300c); /* ddma */
  1088. + au_writel(0x00, 0xb1a00004); /* psc 0 */
  1089. + au_writel(0x00, 0xb1b00004); /* psc 1 */
  1090. + au_writel(0x00d02000, 0xb4020004); /* ehci, ohci, udc, otg */
  1091. + au_writel(0x00, 0xb5000004); /* lcd */
  1092. + au_writel(0x00, 0xb060000c); /* sd0 */
  1093. + au_writel(0x00, 0xb068000c); /* sd1 */
  1094. + au_writel(0x00, 0xb1100100); /* swcnt */
  1095. + au_writel(0x00, 0xb0300000); /* aes */
  1096. + au_writel(0x00, 0xb4004000); /* cim */
  1097. + au_writel(0x00, 0xb1100100); /* uart0_enable */
  1098. + au_writel(0x00, 0xb1200100); /* uart1_enable */
  1099. + au_writel(0x00, 0xb1900020); /* sys_freqctrl0 */
  1100. + au_writel(0x00, 0xb1900024); /* sys_freqctrl1 */
  1101. + au_writel(0x00, 0xb1900028); /* sys_clksrc */
  1102. + au_writel(0x10, 0xb1900060); /* sys_cpupll */
  1103. + au_writel(0x00, 0xb1900064); /* sys_auxpll */
  1104. + au_writel(0x00, 0xb1900100); /* sys_pininputen */
  1105. + break;
  1106. default:
  1107. break;
  1108. @@ -163,32 +181,23 @@ void au1000_restart(char *command)
  1109. void au1000_halt(void)
  1110. {
  1111. -#if defined(CONFIG_MIPS_PB1550)
  1112. - /* power off system */
  1113. - printk("\n** Powering off Pb1550\n");
  1114. - au_writew(au_readw(0xAF00001C) | (3<<14), 0xAF00001C);
  1115. - au_sync();
  1116. - while(1); /* should not get here */
  1117. -#endif
  1118. - printk(KERN_NOTICE "\n** You can safely turn off the power\n");
  1119. -#ifdef CONFIG_MIPS_MIRAGE
  1120. - au_writel((1 << 26) | (1 << 10), GPIO2_OUTPUT);
  1121. -#endif
  1122. -#ifdef CONFIG_PM
  1123. - au_sleep();
  1124. -
  1125. - /* should not get here */
  1126. - printk(KERN_ERR "Unable to put cpu in sleep mode\n");
  1127. - while(1);
  1128. -#else
  1129. - while (1)
  1130. + /* Use WAIT in a low-power infinite spin loop */
  1131. + while (1) {
  1132. __asm__(".set\tmips3\n\t"
  1133. "wait\n\t"
  1134. ".set\tmips0");
  1135. -#endif
  1136. + }
  1137. }
  1138. void au1000_power_off(void)
  1139. {
  1140. + extern void board_power_off (void);
  1141. +
  1142. + printk(KERN_NOTICE "\n** You can safely turn off the power\n");
  1143. +
  1144. + /* Give board a chance to power-off */
  1145. + board_power_off();
  1146. +
  1147. + /* If board can't power-off, spin forever */
  1148. au1000_halt();
  1149. }
  1150. Index: linux-2.4.35.4/arch/mips/au1000/common/setup.c
  1151. ===================================================================
  1152. --- linux-2.4.35.4.orig/arch/mips/au1000/common/setup.c
  1153. +++ linux-2.4.35.4/arch/mips/au1000/common/setup.c
  1154. @@ -174,6 +174,40 @@ void __init au1x00_setup(void)
  1155. initrd_end = (unsigned long)&__rd_end;
  1156. #endif
  1157. +#if defined(CONFIG_SOC_AU1200)
  1158. +#ifdef CONFIG_USB_EHCI_HCD
  1159. + if ((argptr = strstr(argptr, "usb_ehci=")) == NULL) {
  1160. + char usb_args[80];
  1161. + argptr = prom_getcmdline();
  1162. + memset(usb_args, 0, sizeof(usb_args));
  1163. + sprintf(usb_args, " usb_ehci=base:0x%x,len:0x%x,irq:%d",
  1164. + USB_EHCI_BASE, USB_EHCI_LEN, AU1000_USB_HOST_INT);
  1165. + strcat(argptr, usb_args);
  1166. + }
  1167. +#ifdef CONFIG_USB_AMD5536UDC
  1168. + /* enable EHC + OHC + UDC clocks, memory and bus mastering */
  1169. +/* au_writel( 0x00DF207F, USB_MSR_BASE + 4); */
  1170. + au_writel( 0xC0DF207F, USB_MSR_BASE + 4); // incl. prefetch
  1171. +#else
  1172. + /* enable EHC + OHC clocks, memory and bus mastering */
  1173. +/* au_writel( 0x00DB200F, USB_MSR_BASE + 4); */
  1174. + au_writel( 0xC0DB200F, USB_MSR_BASE + 4); /* incl. prefetch */
  1175. +#endif
  1176. + udelay(1000);
  1177. +
  1178. +#else /* CONFIG_USB_EHCI_HCD */
  1179. +
  1180. +#ifdef CONFIG_USB_AMD5536UDC
  1181. +#ifndef CONFIG_USB_OHCI
  1182. + /* enable UDC clocks, memory and bus mastering */
  1183. +/* au_writel( 0x00DC2070, USB_MSR_BASE + 4); */
  1184. + au_writel( 0xC0DC2070, USB_MSR_BASE + 4); // incl. prefetch
  1185. + udelay(1000);
  1186. +#endif
  1187. +#endif
  1188. +#endif /* CONFIG_USB_EHCI_HCD */
  1189. +#endif /* CONFIG_SOC_AU1200 */
  1190. +
  1191. #if defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE)
  1192. #ifdef CONFIG_USB_OHCI
  1193. if ((argptr = strstr(argptr, "usb_ohci=")) == NULL) {
  1194. @@ -187,19 +221,38 @@ void __init au1x00_setup(void)
  1195. #endif
  1196. #ifdef CONFIG_USB_OHCI
  1197. - // enable host controller and wait for reset done
  1198. +#if defined(CONFIG_SOC_AU1200)
  1199. +#ifndef CONFIG_USB_EHCI_HCD
  1200. +#ifdef CONFIG_USB_AMD5536UDC
  1201. + /* enable OHC + UDC clocks, memory and bus mastering */
  1202. +/* au_writel( 0x00DD2073, USB_MSR_BASE + 4); */
  1203. + au_writel( 0xC0DD2073, USB_MSR_BASE + 4); // incl. prefetch
  1204. +#else
  1205. + /* enable OHC clocks, memory and bus mastering */
  1206. + au_writel( 0x00D12003, USB_MSR_BASE + 4);
  1207. +#endif
  1208. + udelay(1000);
  1209. +printk("DEBUG: Reading Au1200 USB2 reg 0x%x\n", au_readl(USB_MSR_BASE + 4));
  1210. +#endif
  1211. +#else
  1212. + /* Au1000, Au1500, Au1100, Au1550 */
  1213. + /* enable host controller and wait for reset done */
  1214. au_writel(0x08, USB_HOST_CONFIG);
  1215. udelay(1000);
  1216. au_writel(0x0E, USB_HOST_CONFIG);
  1217. udelay(1000);
  1218. - au_readl(USB_HOST_CONFIG); // throw away first read
  1219. + au_readl(USB_HOST_CONFIG); /* throw away first read */
  1220. while (!(au_readl(USB_HOST_CONFIG) & 0x10))
  1221. au_readl(USB_HOST_CONFIG);
  1222. +#endif /* CONFIG_SOC_AU1200 */
  1223. #endif
  1224. -#endif // defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE)
  1225. +#else
  1226. +
  1227. +#endif /* defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE) */
  1228. +
  1229. #ifdef CONFIG_FB
  1230. - // Needed if PCI video card in use
  1231. + /* Needed if PCI video card in use */
  1232. conswitchp = &dummy_con;
  1233. #endif
  1234. @@ -209,8 +262,7 @@ void __init au1x00_setup(void)
  1235. #endif
  1236. #ifdef CONFIG_BLK_DEV_IDE
  1237. - /* Board setup takes precedence for unique devices.
  1238. - */
  1239. + /* Board setup takes precedence for unique devices. */
  1240. if ((ide_ops == NULL) || (ide_ops == &no_ide_ops))
  1241. ide_ops = &std_ide_ops;
  1242. #endif
  1243. Index: linux-2.4.35.4/arch/mips/au1000/common/sleeper.S
  1244. ===================================================================
  1245. --- linux-2.4.35.4.orig/arch/mips/au1000/common/sleeper.S
  1246. +++ linux-2.4.35.4/arch/mips/au1000/common/sleeper.S
  1247. @@ -15,17 +15,48 @@
  1248. #include <asm/addrspace.h>
  1249. #include <asm/regdef.h>
  1250. #include <asm/stackframe.h>
  1251. +#include <asm/au1000.h>
  1252. +
  1253. +/*
  1254. + * Note: This file is *not* conditional on CONFIG_PM since Alchemy sleep
  1255. + * need not be tied to any particular power management scheme.
  1256. + */
  1257. +
  1258. + .extern ___flush_cache_all
  1259. .text
  1260. - .set macro
  1261. - .set noat
  1262. .align 5
  1263. -/* Save all of the processor general registers and go to sleep.
  1264. - * A wakeup condition will get us back here to restore the registers.
  1265. +/*
  1266. + * Save the processor general registers and go to sleep. A wakeup
  1267. + * condition will get us back here to restore the registers.
  1268. */
  1269. -LEAF(save_and_sleep)
  1270. +/* still need to fix alignment issues here */
  1271. +save_and_sleep_frmsz = 48
  1272. +NESTED(save_and_sleep, save_and_sleep_frmsz, ra)
  1273. + .set noreorder
  1274. + .set nomacro
  1275. + .set noat
  1276. + subu sp, save_and_sleep_frmsz
  1277. + sw ra, save_and_sleep_frmsz-4(sp)
  1278. + sw s0, save_and_sleep_frmsz-8(sp)
  1279. + sw s1, save_and_sleep_frmsz-12(sp)
  1280. + sw s2, save_and_sleep_frmsz-16(sp)
  1281. + sw s3, save_and_sleep_frmsz-20(sp)
  1282. + sw s4, save_and_sleep_frmsz-24(sp)
  1283. + sw s5, save_and_sleep_frmsz-28(sp)
  1284. + sw s6, save_and_sleep_frmsz-32(sp)
  1285. + sw s7, save_and_sleep_frmsz-36(sp)
  1286. + sw s8, save_and_sleep_frmsz-40(sp)
  1287. + sw gp, save_and_sleep_frmsz-44(sp)
  1288. +
  1289. + /* We only need to save the registers that the calling function
  1290. + * hasn't saved for us. 0 is always zero. 8 - 15, 24 and 25 are
  1291. + * temporaries and can be used without saving. 26 and 27 are reserved
  1292. + * for interrupt/trap handling and expected to change. 29 is the
  1293. + * stack pointer which is handled as a special case here.
  1294. + */
  1295. subu sp, PT_SIZE
  1296. sw $1, PT_R1(sp)
  1297. sw $2, PT_R2(sp)
  1298. @@ -34,14 +65,6 @@ LEAF(save_and_sleep)
  1299. sw $5, PT_R5(sp)
  1300. sw $6, PT_R6(sp)
  1301. sw $7, PT_R7(sp)
  1302. - sw $8, PT_R8(sp)
  1303. - sw $9, PT_R9(sp)
  1304. - sw $10, PT_R10(sp)
  1305. - sw $11, PT_R11(sp)
  1306. - sw $12, PT_R12(sp)
  1307. - sw $13, PT_R13(sp)
  1308. - sw $14, PT_R14(sp)
  1309. - sw $15, PT_R15(sp)
  1310. sw $16, PT_R16(sp)
  1311. sw $17, PT_R17(sp)
  1312. sw $18, PT_R18(sp)
  1313. @@ -50,32 +73,47 @@ LEAF(save_and_sleep)
  1314. sw $21, PT_R21(sp)
  1315. sw $22, PT_R22(sp)
  1316. sw $23, PT_R23(sp)
  1317. - sw $24, PT_R24(sp)
  1318. - sw $25, PT_R25(sp)
  1319. - sw $26, PT_R26(sp)
  1320. - sw $27, PT_R27(sp)
  1321. sw $28, PT_R28(sp)
  1322. - sw $29, PT_R29(sp)
  1323. sw $30, PT_R30(sp)
  1324. sw $31, PT_R31(sp)
  1325. +#define PT_C0STATUS PT_LO
  1326. +#define PT_CONTEXT PT_HI
  1327. +#define PT_PAGEMASK PT_EPC
  1328. +#define PT_CONFIG PT_BVADDR
  1329. mfc0 k0, CP0_STATUS
  1330. - sw k0, 0x20(sp)
  1331. + sw k0, PT_C0STATUS(sp) // 0x20
  1332. mfc0 k0, CP0_CONTEXT
  1333. - sw k0, 0x1c(sp)
  1334. + sw k0, PT_CONTEXT(sp) // 0x1c
  1335. mfc0 k0, CP0_PAGEMASK
  1336. - sw k0, 0x18(sp)
  1337. + sw k0, PT_PAGEMASK(sp) // 0x18
  1338. mfc0 k0, CP0_CONFIG
  1339. - sw k0, 0x14(sp)
  1340. + sw k0, PT_CONFIG(sp) // 0x14
  1341. +
  1342. + .set macro
  1343. + .set at
  1344. +
  1345. + li t0, SYS_SLPPWR
  1346. + sw zero, 0(t0) /* Get the processor ready to sleep */
  1347. + sync
  1348. /* Now set up the scratch registers so the boot rom will
  1349. * return to this point upon wakeup.
  1350. + * sys_scratch0 : SP
  1351. + * sys_scratch1 : RA
  1352. + */
  1353. + li t0, SYS_SCRATCH0
  1354. + li t1, SYS_SCRATCH1
  1355. + sw sp, 0(t0)
  1356. + la k0, resume_from_sleep
  1357. + sw k0, 0(t1)
  1358. +
  1359. +/*
  1360. + * Flush DCACHE to make sure context is in memory
  1361. */
  1362. - la k0, 1f
  1363. - lui k1, 0xb190
  1364. - ori k1, 0x18
  1365. - sw sp, 0(k1)
  1366. - ori k1, 0x1c
  1367. - sw k0, 0(k1)
  1368. + la t1,___flush_cache_all /* _flush_cache_all is a function pointer */
  1369. + lw t0,0(t1)
  1370. + jal t0
  1371. + nop
  1372. /* Put SDRAM into self refresh. Preload instructions into cache,
  1373. * issue a precharge, then auto refresh, then sleep commands to it.
  1374. @@ -88,30 +126,65 @@ LEAF(save_and_sleep)
  1375. cache 0x14, 96(t0)
  1376. .set mips0
  1377. + /* Put SDRAM to sleep */
  1378. sdsleep:
  1379. - lui k0, 0xb400
  1380. - sw zero, 0x001c(k0) /* Precharge */
  1381. - sw zero, 0x0020(k0) /* Auto refresh */
  1382. - sw zero, 0x0030(k0) /* SDRAM sleep */
  1383. + li a0, MEM_PHYS_ADDR
  1384. + or a0, a0, 0xA0000000
  1385. +#if defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1100) || defined(CONFIG_SOC_AU1500)
  1386. + lw k0, MEM_SDMODE0(a0)
  1387. + sw zero, MEM_SDPRECMD(a0) /* Precharge */
  1388. + sw zero, MEM_SDAUTOREF(a0) /* Auto Refresh */
  1389. + sw zero, MEM_SDSLEEP(a0) /* Sleep */
  1390. sync
  1391. -
  1392. - lui k1, 0xb190
  1393. - sw zero, 0x0078(k1) /* get ready to sleep */
  1394. +#endif
  1395. +#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
  1396. + sw zero, MEM_SDPRECMD(a0) /* Precharge */
  1397. + sw zero, MEM_SDSREF(a0)
  1398. +
  1399. + #lw t0, MEM_SDSTAT(a0)
  1400. + #and t0, t0, 0x01000000
  1401. + li t0, 0x01000000
  1402. +refresh_not_set:
  1403. + lw t1, MEM_SDSTAT(a0)
  1404. + and t2, t1, t0
  1405. + beq zero, t2, refresh_not_set
  1406. + nop
  1407. +
  1408. + li t0, ~0x30000000
  1409. + lw t1, MEM_SDCONFIGA(a0)
  1410. + and t1, t0, t1
  1411. + sw t1, MEM_SDCONFIGA(a0)
  1412. sync
  1413. - sw zero, 0x007c(k1) /* Put processor to sleep */
  1414. +#endif
  1415. +
  1416. + li t0, SYS_SLEEP
  1417. + sw zero, 0(t0) /* Put processor to sleep */
  1418. sync
  1419. + nop
  1420. + nop
  1421. + nop
  1422. + nop
  1423. + nop
  1424. + nop
  1425. + nop
  1426. + nop
  1427. +
  1428. /* This is where we return upon wakeup.
  1429. * Reload all of the registers and return.
  1430. */
  1431. -1: nop
  1432. - lw k0, 0x20(sp)
  1433. +resume_from_sleep:
  1434. + nop
  1435. + .set nomacro
  1436. + .set noat
  1437. +
  1438. + lw k0, PT_C0STATUS(sp) // 0x20
  1439. mtc0 k0, CP0_STATUS
  1440. - lw k0, 0x1c(sp)
  1441. + lw k0, PT_CONTEXT(sp) // 0x1c
  1442. mtc0 k0, CP0_CONTEXT
  1443. - lw k0, 0x18(sp)
  1444. + lw k0, PT_PAGEMASK(sp) // 0x18
  1445. mtc0 k0, CP0_PAGEMASK
  1446. - lw k0, 0x14(sp)
  1447. + lw k0, PT_CONFIG(sp) // 0x14
  1448. mtc0 k0, CP0_CONFIG
  1449. lw $1, PT_R1(sp)
  1450. lw $2, PT_R2(sp)
  1451. @@ -120,14 +193,6 @@ sdsleep:
  1452. lw $5, PT_R5(sp)
  1453. lw $6, PT_R6(sp)
  1454. lw $7, PT_R7(sp)
  1455. - lw $8, PT_R8(sp)
  1456. - lw $9, PT_R9(sp)
  1457. - lw $10, PT_R10(sp)
  1458. - lw $11, PT_R11(sp)
  1459. - lw $12, PT_R12(sp)
  1460. - lw $13, PT_R13(sp)
  1461. - lw $14, PT_R14(sp)
  1462. - lw $15, PT_R15(sp)
  1463. lw $16, PT_R16(sp)
  1464. lw $17, PT_R17(sp)
  1465. lw $18, PT_R18(sp)
  1466. @@ -136,15 +201,36 @@ sdsleep:
  1467. lw $21, PT_R21(sp)
  1468. lw $22, PT_R22(sp)
  1469. lw $23, PT_R23(sp)
  1470. - lw $24, PT_R24(sp)
  1471. - lw $25, PT_R25(sp)
  1472. - lw $26, PT_R26(sp)
  1473. - lw $27, PT_R27(sp)
  1474. lw $28, PT_R28(sp)
  1475. - lw $29, PT_R29(sp)
  1476. lw $30, PT_R30(sp)
  1477. lw $31, PT_R31(sp)
  1478. +
  1479. + .set macro
  1480. + .set at
  1481. +
  1482. + /* clear the wake source, but save it as the return value of the function */
  1483. + li t0, SYS_WAKESRC
  1484. + lw v0, 0(t0)
  1485. + sw v0, PT_R2(sp)
  1486. + sw zero, 0(t0)
  1487. +
  1488. addiu sp, PT_SIZE
  1489. + lw gp, save_and_sleep_frmsz-44(sp)
  1490. + lw s8, save_and_sleep_frmsz-40(sp)
  1491. + lw s7, save_and_sleep_frmsz-36(sp)
  1492. + lw s6, save_and_sleep_frmsz-32(sp)
  1493. + lw s5, save_and_sleep_frmsz-28(sp)
  1494. + lw s4, save_and_sleep_frmsz-24(sp)
  1495. + lw s3, save_and_sleep_frmsz-20(sp)
  1496. + lw s2, save_and_sleep_frmsz-16(sp)
  1497. + lw s1, save_and_sleep_frmsz-12(sp)
  1498. + lw s0, save_and_sleep_frmsz-8(sp)
  1499. + lw ra, save_and_sleep_frmsz-4(sp)
  1500. +
  1501. + addu sp, save_and_sleep_frmsz
  1502. jr ra
  1503. + nop
  1504. + .set reorder
  1505. END(save_and_sleep)
  1506. +
  1507. Index: linux-2.4.35.4/arch/mips/au1000/common/time.c
  1508. ===================================================================
  1509. --- linux-2.4.35.4.orig/arch/mips/au1000/common/time.c
  1510. +++ linux-2.4.35.4/arch/mips/au1000/common/time.c
  1511. @@ -50,7 +50,6 @@
  1512. #include <linux/mc146818rtc.h>
  1513. #include <linux/timex.h>
  1514. -extern void startup_match20_interrupt(void);
  1515. extern void do_softirq(void);
  1516. extern volatile unsigned long wall_jiffies;
  1517. unsigned long missed_heart_beats = 0;
  1518. @@ -59,14 +58,14 @@ static unsigned long r4k_offset; /* Amou
  1519. static unsigned long r4k_cur; /* What counter should be at next timer irq */
  1520. extern rwlock_t xtime_lock;
  1521. int no_au1xxx_32khz;
  1522. -void (*au1k_wait_ptr)(void);
  1523. +extern int allow_au1k_wait; /* default off for CP0 Counter */
  1524. /* Cycle counter value at the previous timer interrupt.. */
  1525. static unsigned int timerhi = 0, timerlo = 0;
  1526. #ifdef CONFIG_PM
  1527. #define MATCH20_INC 328
  1528. -extern void startup_match20_interrupt(void);
  1529. +extern void startup_match20_interrupt(void (*handler)(int, void *, struct pt_regs *));
  1530. static unsigned long last_pc0, last_match20;
  1531. #endif
  1532. @@ -385,7 +384,6 @@ void __init au1xxx_timer_setup(void)
  1533. {
  1534. unsigned int est_freq;
  1535. extern unsigned long (*do_gettimeoffset)(void);
  1536. - extern void au1k_wait(void);
  1537. printk("calculating r4koff... ");
  1538. r4k_offset = cal_r4koff();
  1539. @@ -437,9 +435,6 @@ void __init au1xxx_timer_setup(void)
  1540. au_writel(0, SYS_TOYWRITE);
  1541. while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C0S);
  1542. - au_writel(au_readl(SYS_WAKEMSK) | (1<<8), SYS_WAKEMSK);
  1543. - au_writel(~0, SYS_WAKESRC);
  1544. - au_sync();
  1545. while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
  1546. /* setup match20 to interrupt once every 10ms */
  1547. @@ -447,13 +442,13 @@ void __init au1xxx_timer_setup(void)
  1548. au_writel(last_match20 + MATCH20_INC, SYS_TOYMATCH2);
  1549. au_sync();
  1550. while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
  1551. - startup_match20_interrupt();
  1552. + startup_match20_interrupt(counter0_irq);
  1553. do_gettimeoffset = do_fast_pm_gettimeoffset;
  1554. /* We can use the real 'wait' instruction.
  1555. */
  1556. - au1k_wait_ptr = au1k_wait;
  1557. + allow_au1k_wait = 1;
  1558. }
  1559. #else
  1560. Index: linux-2.4.35.4/arch/mips/au1000/db1x00/board_setup.c
  1561. ===================================================================
  1562. --- linux-2.4.35.4.orig/arch/mips/au1000/db1x00/board_setup.c
  1563. +++ linux-2.4.35.4/arch/mips/au1000/db1x00/board_setup.c
  1564. @@ -46,10 +46,22 @@
  1565. #include <asm/au1000.h>
  1566. #include <asm/db1x00.h>
  1567. -extern struct rtc_ops no_rtc_ops;
  1568. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX) && defined(CONFIG_MIPS_DB1550)
  1569. +#include <asm/au1xxx_dbdma.h>
  1570. +extern struct ide_ops *ide_ops;
  1571. +extern struct ide_ops au1xxx_ide_ops;
  1572. +extern u32 au1xxx_ide_virtbase;
  1573. +extern u64 au1xxx_ide_physbase;
  1574. +extern int au1xxx_ide_irq;
  1575. +
  1576. +/* Ddma */
  1577. +chan_tab_t *ide_read_ch, *ide_write_ch;
  1578. +u32 au1xxx_ide_ddma_enable = 0, switch4ddma = 1; // PIO+ddma
  1579. +
  1580. +dbdev_tab_t new_dbdev_tab_element = { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 };
  1581. +#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX */
  1582. -/* not correct for db1550 */
  1583. -static BCSR * const bcsr = (BCSR *)0xAE000000;
  1584. +extern struct rtc_ops no_rtc_ops;
  1585. void board_reset (void)
  1586. {
  1587. @@ -57,6 +69,13 @@ void board_reset (void)
  1588. au_writel(0x00000000, 0xAE00001C);
  1589. }
  1590. +void board_power_off (void)
  1591. +{
  1592. +#ifdef CONFIG_MIPS_MIRAGE
  1593. + au_writel((1 << 26) | (1 << 10), GPIO2_OUTPUT);
  1594. +#endif
  1595. +}
  1596. +
  1597. void __init board_setup(void)
  1598. {
  1599. u32 pin_func;
  1600. @@ -108,8 +127,42 @@ void __init board_setup(void)
  1601. au_writel(0x02000200, GPIO2_OUTPUT);
  1602. #endif
  1603. +#if defined(CONFIG_AU1XXX_SMC91111)
  1604. +#define CPLD_CONTROL (0xAF00000C)
  1605. + {
  1606. + extern uint32_t au1xxx_smc91111_base;
  1607. + extern unsigned int au1xxx_smc91111_irq;
  1608. + extern int au1xxx_smc91111_nowait;
  1609. +
  1610. + au1xxx_smc91111_base = 0xAC000300;
  1611. + au1xxx_smc91111_irq = AU1000_GPIO_8;
  1612. + au1xxx_smc91111_nowait = 1;
  1613. +
  1614. + /* set up the Static Bus timing - only 396Mhz */
  1615. + bcsr->resets |= 0x7;
  1616. + au_writel(0x00010003, MEM_STCFG0);
  1617. + au_writel(0x000c00c0, MEM_STCFG2);
  1618. + au_writel(0x85E1900D, MEM_STTIME2);
  1619. + }
  1620. +#endif /* end CONFIG_SMC91111 */
  1621. au_sync();
  1622. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX) && defined(CONFIG_MIPS_DB1550)
  1623. + /*
  1624. + * Iniz IDE parameters
  1625. + */
  1626. + ide_ops = &au1xxx_ide_ops;
  1627. + au1xxx_ide_irq = DAUGHTER_CARD_IRQ;
  1628. + au1xxx_ide_physbase = AU1XXX_ATA_PHYS_ADDR;
  1629. + au1xxx_ide_virtbase = KSEG1ADDR(AU1XXX_ATA_PHYS_ADDR);
  1630. +
  1631. + /*
  1632. + * change PIO or PIO+Ddma
  1633. + * check the GPIO-6 pin condition. db1550:s6_dot
  1634. + */
  1635. + switch4ddma = (au_readl(SYS_PINSTATERD) & (1 << 6)) ? 1 : 0;
  1636. +#endif
  1637. +
  1638. #ifdef CONFIG_MIPS_DB1000
  1639. printk("AMD Alchemy Au1000/Db1000 Board\n");
  1640. #endif
  1641. Index: linux-2.4.35.4/arch/mips/au1000/db1x00/irqmap.c
  1642. ===================================================================
  1643. --- linux-2.4.35.4.orig/arch/mips/au1000/db1x00/irqmap.c
  1644. +++ linux-2.4.35.4/arch/mips/au1000/db1x00/irqmap.c
  1645. @@ -53,6 +53,7 @@ au1xxx_irq_map_t au1xxx_irq_map[] = {
  1646. #ifdef CONFIG_MIPS_DB1550
  1647. { AU1000_GPIO_3, INTC_INT_LOW_LEVEL, 0 }, // PCMCIA Card 0 IRQ#
  1648. { AU1000_GPIO_5, INTC_INT_LOW_LEVEL, 0 }, // PCMCIA Card 1 IRQ#
  1649. + { AU1000_GPIO_8, INTC_INT_LOW_LEVEL, 0 }, // Daughtercard IRQ#
  1650. #else
  1651. { AU1000_GPIO_0, INTC_INT_LOW_LEVEL, 0 }, // PCMCIA Card 0 Fully_Interted#
  1652. { AU1000_GPIO_1, INTC_INT_LOW_LEVEL, 0 }, // PCMCIA Card 0 STSCHG#
  1653. Index: linux-2.4.35.4/arch/mips/au1000/db1x00/Makefile
  1654. ===================================================================
  1655. --- linux-2.4.35.4.orig/arch/mips/au1000/db1x00/Makefile
  1656. +++ linux-2.4.35.4/arch/mips/au1000/db1x00/Makefile
  1657. @@ -17,4 +17,11 @@ O_TARGET := db1x00.o
  1658. obj-y := init.o board_setup.o irqmap.o
  1659. obj-$(CONFIG_WM97XX_COMODULE) += mirage_ts.o
  1660. +ifdef CONFIG_MIPS_DB1100
  1661. +ifdef CONFIG_MMC
  1662. +obj-y += mmc_support.o
  1663. +export-objs += mmc_support.o
  1664. +endif
  1665. +endif
  1666. +
  1667. include $(TOPDIR)/Rules.make
  1668. Index: linux-2.4.35.4/arch/mips/au1000/db1x00/mmc_support.c
  1669. ===================================================================
  1670. --- /dev/null
  1671. +++ linux-2.4.35.4/arch/mips/au1000/db1x00/mmc_support.c
  1672. @@ -0,0 +1,126 @@
  1673. +/*
  1674. + * BRIEF MODULE DESCRIPTION
  1675. + *
  1676. + * MMC support routines for DB1100.
  1677. + *
  1678. + *
  1679. + * Copyright (c) 2003-2004 Embedded Edge, LLC.
  1680. + * Author: Embedded Edge, LLC.
  1681. + * Contact: [email protected]
  1682. + *
  1683. + * This program is free software; you can redistribute it and/or modify it
  1684. + * under the terms of the GNU General Public License as published by the
  1685. + * Free Software Foundation; either version 2 of the License, or (at your
  1686. + * option) any later version.
  1687. + *
  1688. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  1689. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  1690. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  1691. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  1692. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  1693. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  1694. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  1695. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  1696. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  1697. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  1698. + *
  1699. + * You should have received a copy of the GNU General Public License along
  1700. + * with this program; if not, write to the Free Software Foundation, Inc.,
  1701. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  1702. + *
  1703. + */
  1704. +
  1705. +
  1706. +#include <linux/config.h>
  1707. +#include <linux/kernel.h>
  1708. +#include <linux/module.h>
  1709. +#include <linux/init.h>
  1710. +
  1711. +#include <asm/irq.h>
  1712. +#include <asm/au1000.h>
  1713. +#include <asm/au1100_mmc.h>
  1714. +#include <asm/db1x00.h>
  1715. +
  1716. +
  1717. +/* SD/MMC controller support functions */
  1718. +
  1719. +/*
  1720. + * Detect card.
  1721. + */
  1722. +void mmc_card_inserted(int _n_, int *_res_)
  1723. +{
  1724. + u32 gpios = au_readl(SYS_PINSTATERD);
  1725. + u32 emptybit = (_n_) ? (1<<20) : (1<<19);
  1726. + *_res_ = ((gpios & emptybit) == 0);
  1727. +}
  1728. +
  1729. +/*
  1730. + * Check card write protection.
  1731. + */
  1732. +void mmc_card_writable(int _n_, int *_res_)
  1733. +{
  1734. + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  1735. + unsigned long mmc_wp, board_specific;
  1736. +
  1737. + if (_n_) {
  1738. + mmc_wp = BCSR_BOARD_SD1_WP;
  1739. + } else {
  1740. + mmc_wp = BCSR_BOARD_SD0_WP;
  1741. + }
  1742. +
  1743. + board_specific = au_readl((unsigned long)(&bcsr->specific));
  1744. +
  1745. + if (!(board_specific & mmc_wp)) {/* low means card writable */
  1746. + *_res_ = 1;
  1747. + } else {
  1748. + *_res_ = 0;
  1749. + }
  1750. +}
  1751. +
  1752. +/*
  1753. + * Apply power to card slot.
  1754. + */
  1755. +void mmc_power_on(int _n_)
  1756. +{
  1757. + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  1758. + unsigned long mmc_pwr, board_specific;
  1759. +
  1760. + if (_n_) {
  1761. + mmc_pwr = BCSR_BOARD_SD1_PWR;
  1762. + } else {
  1763. + mmc_pwr = BCSR_BOARD_SD0_PWR;
  1764. + }
  1765. +
  1766. + board_specific = au_readl((unsigned long)(&bcsr->specific));
  1767. + board_specific |= mmc_pwr;
  1768. +
  1769. + au_writel(board_specific, (int)(&bcsr->specific));
  1770. + au_sync_delay(1);
  1771. +}
  1772. +
  1773. +/*
  1774. + * Remove power from card slot.
  1775. + */
  1776. +void mmc_power_off(int _n_)
  1777. +{
  1778. + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  1779. + unsigned long mmc_pwr, board_specific;
  1780. +
  1781. + if (_n_) {
  1782. + mmc_pwr = BCSR_BOARD_SD1_PWR;
  1783. + } else {
  1784. + mmc_pwr = BCSR_BOARD_SD0_PWR;
  1785. + }
  1786. +
  1787. + board_specific = au_readl((unsigned long)(&bcsr->specific));
  1788. + board_specific &= ~mmc_pwr;
  1789. +
  1790. + au_writel(board_specific, (int)(&bcsr->specific));
  1791. + au_sync_delay(1);
  1792. +}
  1793. +
  1794. +EXPORT_SYMBOL(mmc_card_inserted);
  1795. +EXPORT_SYMBOL(mmc_card_writable);
  1796. +EXPORT_SYMBOL(mmc_power_on);
  1797. +EXPORT_SYMBOL(mmc_power_off);
  1798. +
  1799. Index: linux-2.4.35.4/arch/mips/au1000/ficmmp/au1200_ibutton.c
  1800. ===================================================================
  1801. --- /dev/null
  1802. +++ linux-2.4.35.4/arch/mips/au1000/ficmmp/au1200_ibutton.c
  1803. @@ -0,0 +1,270 @@
  1804. +/* ----------------------------------------------------------------------
  1805. + * mtwilson_keys.c
  1806. + *
  1807. + * Copyright (C) 2003 Intrinsyc Software Inc.
  1808. + *
  1809. + * Intel Personal Media Player buttons
  1810. + *
  1811. + * This program is free software; you can redistribute it and/or modify
  1812. + * it under the terms of the GNU General Public License version 2 as
  1813. + * published by the Free Software Foundation.
  1814. + *
  1815. + * May 02, 2003 : Initial version [FB]
  1816. + *
  1817. + ------------------------------------------------------------------------*/
  1818. +
  1819. +#include <linux/config.h>
  1820. +#include <linux/module.h>
  1821. +#include <linux/kernel.h>
  1822. +#include <linux/init.h>
  1823. +#include <linux/fs.h>
  1824. +#include <linux/sched.h>
  1825. +#include <linux/miscdevice.h>
  1826. +#include <linux/errno.h>
  1827. +#include <linux/poll.h>
  1828. +#include <linux/delay.h>
  1829. +#include <linux/input.h>
  1830. +
  1831. +#include <asm/au1000.h>
  1832. +#include <asm/uaccess.h>
  1833. +#include <asm/au1xxx_gpio.h>
  1834. +#include <asm/irq.h>
  1835. +#include <asm/keyboard.h>
  1836. +#include <linux/time.h>
  1837. +
  1838. +#define DRIVER_VERSION "V1.0"
  1839. +#define DRIVER_AUTHOR "FIC"
  1840. +#define DRIVER_DESC "FIC Travis Media Player Button Driver"
  1841. +#define DRIVER_NAME "Au1200Button"
  1842. +
  1843. +#define BUTTON_MAIN (1<<1)
  1844. +#define BUTTON_SELECT (1<<6)
  1845. +#define BUTTON_GUIDE (1<<12)
  1846. +#define BUTTON_DOWN (1<<17)
  1847. +#define BUTTON_LEFT (1<<19)
  1848. +#define BUTTON_RIGHT (1<<26)
  1849. +#define BUTTON_UP (1<<28)
  1850. +
  1851. +#define BUTTON_MASK (\
  1852. + BUTTON_MAIN \
  1853. + | BUTTON_SELECT \
  1854. + | BUTTON_GUIDE \
  1855. + | BUTTON_DOWN \
  1856. + | BUTTON_LEFT \
  1857. + | BUTTON_RIGHT \
  1858. + | BUTTON_UP \
  1859. + )
  1860. +
  1861. +#define BUTTON_INVERT (\
  1862. + BUTTON_MAIN \
  1863. + | 0 \
  1864. + | BUTTON_GUIDE \
  1865. + | 0 \
  1866. + | 0 \
  1867. + | 0 \
  1868. + | 0 \
  1869. + )
  1870. +
  1871. +char button_map[32]={0,KEY_S,0,0,0,0,KEY_ENTER,0,0,0,0,0,KEY_G,0,0,0,0,KEY_DOWN,0,KEY_LEFT,0,0,0,0,0,0,KEY_RIGHT,0,KEY_UP,0,0,0};
  1872. +//char button_map[32]={0,0,0,0,0,0,KEY_ENTER,0,0,0,0,0,KEY_G,0,0,0,0,KEY_DOWN,0,KEY_LEFT,0,0,0,0,0,0,KEY_RIGHT,0,KEY_UP,0,0,0};
  1873. +
  1874. +//char button_map[32]={0,KEY_TAB,0,0,0,0,KEY_M,0,0,0,0,0,KEY_S,0,0,0,0,KEY_DOWN,0,KEY_LEFT,0,0,0,0,0,0,KEY_RIGHT,0,KEY_UP,0,0,0};
  1875. +//char button_map[32]={0,0,0,0,0,0,KEY_M,0,0,0,0,0,KEY_S,0,0,0,0,KEY_DOWN,0,KEY_LEFT,0,0,0,0,0,0,KEY_RIGHT,0,KEY_UP,0,0,0};
  1876. +
  1877. +#define BUTTON_COUNT (sizeof (button_map) / sizeof (button_map[0]))
  1878. +
  1879. +struct input_dev dev;
  1880. +struct timeval cur_tv;
  1881. +
  1882. +static unsigned int old_tv_usec = 0;
  1883. +
  1884. +static unsigned int read_button_state(void)
  1885. +{
  1886. + unsigned int state;
  1887. +
  1888. + state = au_readl(SYS_PINSTATERD) & BUTTON_MASK; /* get gpio status */
  1889. +
  1890. + state ^= BUTTON_INVERT; /* invert main & guide button */
  1891. +
  1892. + /* printk("au1200_ibutton.c: button state [0x%X]\r\n",state); */
  1893. + return state;
  1894. +}
  1895. +
  1896. +//This function returns 0 if the allowed microseconds have elapsed since the last call to ths function, otherwise it returns 1 to indicate a bounce condition
  1897. +static unsigned int bounce()
  1898. +{
  1899. +
  1900. + unsigned int elapsed_time;
  1901. +
  1902. + do_gettimeofday (&cur_tv);
  1903. +
  1904. + if (!old_tv_usec) {
  1905. + old_tv_usec = cur_tv.tv_usec;
  1906. + return 0;
  1907. + }
  1908. +
  1909. + if(cur_tv.tv_usec > old_tv_usec) {
  1910. + /* If there hasn't been rollover */
  1911. + elapsed_time = ((cur_tv.tv_usec - old_tv_usec));
  1912. + }
  1913. + else {
  1914. + /* Accounting for rollover */
  1915. + elapsed_time = ((1000000 - old_tv_usec + cur_tv.tv_usec));
  1916. + }
  1917. +
  1918. + if (elapsed_time > 250000) {
  1919. + old_tv_usec = 0; /* reset the bounce time */
  1920. + return 0;
  1921. + }
  1922. +
  1923. + return 1;
  1924. +}
  1925. +
  1926. +/* button interrupt handler */
  1927. +static void button_interrupt(int irq, void *dev, struct pt_regs *regs)
  1928. +{
  1929. +
  1930. + unsigned int i,bit_mask, key_choice;
  1931. + u32 button_state;
  1932. +
  1933. + /* Report state to upper level */
  1934. +
  1935. + button_state = read_button_state() & BUTTON_MASK; /* get new gpio status */
  1936. +
  1937. + /* Return if this is a repeated (bouncing) event */
  1938. + if(bounce())
  1939. + return;
  1940. +
  1941. + /* we want to make keystrokes */
  1942. + for( i=0; i< BUTTON_COUNT; i++) {
  1943. + bit_mask = 1<<i;
  1944. + if (button_state & bit_mask) {
  1945. + key_choice = button_map[i];
  1946. + /* toggle key down */
  1947. + input_report_key(dev, key_choice, 1);
  1948. + /* toggle key up */
  1949. + input_report_key(dev, key_choice, 0);
  1950. + printk("ibutton gpio %d stat %x scan code %d\r\n",
  1951. + i, button_state, key_choice);
  1952. + /* Only report the first key event; it doesn't make
  1953. + * sense for two keys to be pressed at the same time,
  1954. + * and causes problems with the directional keys
  1955. + * return;
  1956. + */
  1957. + }
  1958. + }
  1959. +}
  1960. +
  1961. +static int
  1962. +button_translate(unsigned char scancode, unsigned char *keycode, char raw_mode)
  1963. +{
  1964. + static int prev_scancode;
  1965. +
  1966. + printk( "ibutton.c: translate: scancode=%x raw_mode=%x\n",
  1967. + scancode, raw_mode);
  1968. +
  1969. + if (scancode == 0xe0 || scancode == 0xe1) {
  1970. + prev_scancode = scancode;
  1971. + return 0;
  1972. + }
  1973. +
  1974. + if (scancode == 0x00 || scancode == 0xff) {
  1975. + prev_scancode = 0;
  1976. + return 0;
  1977. + }
  1978. +
  1979. + *keycode = scancode;
  1980. +
  1981. + return 1;
  1982. +}
  1983. +
  1984. +/* init button hardware */
  1985. +static int button_hw_init(void)
  1986. +{
  1987. + unsigned int ipinfunc=0;
  1988. +
  1989. + printk("au1200_ibutton.c: Initializing buttons hardware\n");
  1990. +
  1991. + // initialize GPIO pin function assignments
  1992. +
  1993. + ipinfunc = au_readl(SYS_PINFUNC);
  1994. +
  1995. + ipinfunc &= ~(SYS_PINFUNC_DMA | SYS_PINFUNC_S0A | SYS_PINFUNC_S0B);
  1996. + au_writel( ipinfunc ,SYS_PINFUNC);
  1997. +
  1998. + ipinfunc |= (SYS_PINFUNC_S0C);
  1999. + au_writel( ipinfunc ,SYS_PINFUNC);
  2000. +
  2001. + return 0;
  2002. +}
  2003. +
  2004. +/* button driver init */
  2005. +static int __init button_init(void)
  2006. +{
  2007. + int ret, i;
  2008. + unsigned int flag=0;
  2009. +
  2010. + printk("au1200_ibutton.c: button_init()\r\n");
  2011. +
  2012. + button_hw_init();
  2013. +
  2014. + /* register all button irq handler */
  2015. +
  2016. + for(i=0; i< sizeof(button_map)/sizeof(button_map[0]); i++)
  2017. + {
  2018. + /* register irq <-- gpio 1 ,6 ,12 , 17 ,19 , 26 ,28 */
  2019. + if(button_map[i] != 0)
  2020. + {
  2021. + ret = request_irq(AU1000_GPIO_0 + i ,
  2022. + &button_interrupt , SA_INTERRUPT ,
  2023. + DRIVER_NAME , &dev);
  2024. + if(ret) flag |= 1<<i;
  2025. + }
  2026. + }
  2027. +
  2028. + printk("au1200_ibutton.c: request_irq,ret:0x%x\r\n",ret);
  2029. +
  2030. + if (ret) {
  2031. + printk("au1200_ibutton.c: request_irq:%X failed\r\n",flag);
  2032. + return ret;
  2033. + }
  2034. +
  2035. + dev.name = DRIVER_NAME;
  2036. + dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
  2037. +
  2038. + for (i=0;i<sizeof(button_map)/sizeof(button_map[0]);i++)
  2039. + {
  2040. + dev.keybit[LONG(button_map[i])] |= BIT(button_map[i]);
  2041. + }
  2042. +
  2043. + input_register_device(&dev);
  2044. +
  2045. + /* ready to receive interrupts */
  2046. +
  2047. + return 0;
  2048. +}
  2049. +
  2050. +/* button driver exit */
  2051. +static void __exit button_exit(void)
  2052. +{
  2053. + int i;
  2054. +
  2055. + for(i=0;i<sizeof(button_map)/sizeof(button_map[0]);i++)
  2056. + {
  2057. + if(button_map[i] != 0)
  2058. + {
  2059. + free_irq( AU1000_GPIO_0 + i, &dev);
  2060. + }
  2061. + }
  2062. +
  2063. + input_unregister_device(&dev);
  2064. +
  2065. + printk("au1200_ibutton.c: button_exit()\r\n");
  2066. +}
  2067. +
  2068. +module_init(button_init);
  2069. +module_exit(button_exit);
  2070. +
  2071. +MODULE_AUTHOR( DRIVER_AUTHOR );
  2072. +MODULE_DESCRIPTION( DRIVER_DESC );
  2073. +MODULE_LICENSE("GPL");
  2074. Index: linux-2.4.35.4/arch/mips/au1000/ficmmp/au1xxx_dock.c
  2075. ===================================================================
  2076. --- /dev/null
  2077. +++ linux-2.4.35.4/arch/mips/au1000/ficmmp/au1xxx_dock.c
  2078. @@ -0,0 +1,261 @@
  2079. +/*
  2080. + * Copyright (C) 2003 Metrowerks, All Rights Reserved.
  2081. + *
  2082. + * This program is free software; you can redistribute it and/or modify
  2083. + * it under the terms of the GNU General Public License version 2 as
  2084. + * published by the Free Software Foundation.
  2085. + */
  2086. +
  2087. +#include <linux/config.h>
  2088. +#include <linux/module.h>
  2089. +#include <linux/init.h>
  2090. +#include <linux/fs.h>
  2091. +#include <linux/sched.h>
  2092. +#include <linux/miscdevice.h>
  2093. +#include <linux/errno.h>
  2094. +#include <linux/poll.h>
  2095. +#include <asm/au1000.h>
  2096. +#include <asm/uaccess.h>
  2097. +#include <asm/au1xxx_gpio.h>
  2098. +
  2099. +
  2100. +#if defined(CONFIG_MIPS_FICMMP)
  2101. + #define DOCK_GPIO 215
  2102. +#else
  2103. + #error Unsupported Au1xxx Platform
  2104. +#endif
  2105. +
  2106. +#define MAKE_FLAG 0x20
  2107. +
  2108. +#undef DEBUG
  2109. +
  2110. +#define DEBUG 0
  2111. +//#define DEBUG 1
  2112. +
  2113. +#if DEBUG
  2114. +#define DPRINTK(format, args...) printk(__FUNCTION__ ": " format, ## args)
  2115. +#else
  2116. +#define DPRINTK(format, args...) do { } while (0)
  2117. +#endif
  2118. +
  2119. +/* Please note that this driver is based on a timer and is not interrupt
  2120. + * driven. If you are going to make use of this driver, you will need to have
  2121. + * your application open the dock listing from the /dev directory first.
  2122. + */
  2123. +
  2124. +struct au1xxx_dock {
  2125. + struct fasync_struct *fasync;
  2126. + wait_queue_head_t read_wait;
  2127. + int open_count;
  2128. + unsigned int debounce;
  2129. + unsigned int current;
  2130. + unsigned int last;
  2131. +};
  2132. +
  2133. +static struct au1xxx_dock dock_info;
  2134. +
  2135. +
  2136. +static void dock_timer_periodic(void *data);
  2137. +
  2138. +static struct tq_struct dock_task = {
  2139. + routine: dock_timer_periodic,
  2140. + data: NULL
  2141. +};
  2142. +
  2143. +static int cleanup_flag = 0;
  2144. +static DECLARE_WAIT_QUEUE_HEAD(cleanup_wait_queue);
  2145. +
  2146. +
  2147. +static unsigned int read_dock_state(void)
  2148. +{
  2149. + u32 state;
  2150. +
  2151. + state = au1xxx_gpio_read(DOCK_GPIO);
  2152. +
  2153. + /* printk( "Current Dock State: %d\n", state ); */
  2154. +
  2155. + return state;
  2156. +}
  2157. +
  2158. +
  2159. +static void dock_timer_periodic(void *data)
  2160. +{
  2161. + struct au1xxx_dock *dock = (struct au1xxx_dock *)data;
  2162. + unsigned long dock_state;
  2163. +
  2164. + /* If cleanup wants us to die */
  2165. + if (cleanup_flag) {
  2166. + /* now cleanup_module can return */
  2167. + wake_up(&cleanup_wait_queue);
  2168. + } else {
  2169. + /* put ourselves back in the task queue */
  2170. + queue_task(&dock_task, &tq_timer);
  2171. + }
  2172. +
  2173. + /* read current dock */
  2174. + dock_state = read_dock_state();
  2175. +
  2176. + /* if dock states hasn't changed */
  2177. + /* save time and be done. */
  2178. + if (dock_state == dock->current) {
  2179. + return;
  2180. + }
  2181. +
  2182. + if (dock_state == dock->debounce) {
  2183. + dock->current = dock_state;
  2184. + } else {
  2185. + dock->debounce = dock_state;
  2186. + }
  2187. + if (dock->current != dock->last) {
  2188. + if (waitqueue_active(&dock->read_wait)) {
  2189. + wake_up_interruptible(&dock->read_wait);
  2190. + }
  2191. + }
  2192. +}
  2193. +
  2194. +
  2195. +static ssize_t au1xxx_dock_read(struct file *filp, char *buffer, size_t count, loff_t *ppos)
  2196. +{
  2197. + struct au1xxx_dock *dock = filp->private_data;
  2198. + char event[3];
  2199. + int last;
  2200. + int cur;
  2201. + int err;
  2202. +
  2203. +try_again:
  2204. +
  2205. + while (dock->current == dock->last) {
  2206. + if (filp->f_flags & O_NONBLOCK) {
  2207. + return -EAGAIN;
  2208. + }
  2209. + interruptible_sleep_on(&dock->read_wait);
  2210. + if (signal_pending(current)) {
  2211. + return -ERESTARTSYS;
  2212. + }
  2213. + }
  2214. +
  2215. + cur = dock->current;
  2216. + last = dock->last;
  2217. +
  2218. + if(cur != last)
  2219. + {
  2220. + event[0] = cur ? 'D' : 'U';
  2221. + event[1] = '\r';
  2222. + event[2] = '\n';
  2223. + }
  2224. + else
  2225. + goto try_again;
  2226. +
  2227. + dock->last = cur;
  2228. + err = copy_to_user(buffer, &event, 3);
  2229. + if (err) {
  2230. + return err;
  2231. + }
  2232. +
  2233. + return 3;
  2234. +}
  2235. +
  2236. +
  2237. +static int au1xxx_dock_open(struct inode *inode, struct file *filp)
  2238. +{
  2239. + struct au1xxx_dock *dock = &dock_info;
  2240. +
  2241. + MOD_INC_USE_COUNT;
  2242. +
  2243. + filp->private_data = dock;
  2244. +
  2245. + if (dock->open_count++ == 0) {
  2246. + dock_task.data = dock;
  2247. + cleanup_flag = 0;
  2248. + queue_task(&dock_task, &tq_timer);
  2249. + }
  2250. +
  2251. + return 0;
  2252. +}
  2253. +
  2254. +
  2255. +static unsigned int au1xxx_dock_poll(struct file *filp, poll_table *wait)
  2256. +{
  2257. + struct au1xxx_dock *dock = filp->private_data;
  2258. + int ret = 0;
  2259. +
  2260. + DPRINTK("start\n");
  2261. + poll_wait(filp, &dock->read_wait, wait);
  2262. + if (dock->current != dock->last) {
  2263. + ret = POLLIN | POLLRDNORM;
  2264. + }
  2265. + return ret;
  2266. +}
  2267. +
  2268. +
  2269. +static int au1xxx_dock_release(struct inode *inode, struct file *filp)
  2270. +{
  2271. + struct au1xxx_dock *dock = filp->private_data;
  2272. +
  2273. + DPRINTK("start\n");
  2274. +
  2275. + if (--dock->open_count == 0) {
  2276. + cleanup_flag = 1;
  2277. + sleep_on(&cleanup_wait_queue);
  2278. + }
  2279. + MOD_DEC_USE_COUNT;
  2280. +
  2281. + return 0;
  2282. +}
  2283. +
  2284. +
  2285. +
  2286. +static struct file_operations au1xxx_dock_fops = {
  2287. + owner: THIS_MODULE,
  2288. + read: au1xxx_dock_read,
  2289. + poll: au1xxx_dock_poll,
  2290. + open: au1xxx_dock_open,
  2291. + release: au1xxx_dock_release,
  2292. +};
  2293. +
  2294. +/*
  2295. + * The au1xxx dock is a misc device:
  2296. + * Major 10 char
  2297. + * Minor 22 /dev/dock
  2298. + *
  2299. + * This is /dev/misc/dock if devfs is used.
  2300. + */
  2301. +
  2302. +static struct miscdevice au1xxx_dock_dev = {
  2303. + minor: 23,
  2304. + name: "dock",
  2305. + fops: &au1xxx_dock_fops,
  2306. +};
  2307. +
  2308. +static int __init au1xxx_dock_init(void)
  2309. +{
  2310. + struct au1xxx_dock *dock = &dock_info;
  2311. + int ret;
  2312. +
  2313. + DPRINTK("Initializing dock driver\n");
  2314. + dock->open_count = 0;
  2315. + cleanup_flag = 0;
  2316. + init_waitqueue_head(&dock->read_wait);
  2317. +
  2318. +
  2319. + /* yamon configures GPIO pins for the dock
  2320. + * no initialization needed
  2321. + */
  2322. +
  2323. + ret = misc_register(&au1xxx_dock_dev);
  2324. +
  2325. + DPRINTK("dock driver fully initialized.\n");
  2326. +
  2327. + return ret;
  2328. +}
  2329. +
  2330. +
  2331. +static void __exit au1xxx_dock_exit(void)
  2332. +{
  2333. + DPRINTK("unloading dock driver\n");
  2334. + misc_deregister(&au1xxx_dock_dev);
  2335. +}
  2336. +
  2337. +
  2338. +module_init(au1xxx_dock_init);
  2339. +module_exit(au1xxx_dock_exit);
  2340. Index: linux-2.4.35.4/arch/mips/au1000/ficmmp/board_setup.c
  2341. ===================================================================
  2342. --- /dev/null
  2343. +++ linux-2.4.35.4/arch/mips/au1000/ficmmp/board_setup.c
  2344. @@ -0,0 +1,226 @@
  2345. +/*
  2346. + *
  2347. + * BRIEF MODULE DESCRIPTION
  2348. + * Alchemy Pb1200 board setup.
  2349. + *
  2350. + * This program is free software; you can redistribute it and/or modify it
  2351. + * under the terms of the GNU General Public License as published by the
  2352. + * Free Software Foundation; either version 2 of the License, or (at your
  2353. + * option) any later version.
  2354. + *
  2355. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  2356. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  2357. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  2358. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  2359. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  2360. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  2361. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  2362. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  2363. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  2364. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2365. + *
  2366. + * You should have received a copy of the GNU General Public License along
  2367. + * with this program; if not, write to the Free Software Foundation, Inc.,
  2368. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  2369. + */
  2370. +#include <linux/config.h>
  2371. +#include <linux/init.h>
  2372. +#include <linux/sched.h>
  2373. +#include <linux/ioport.h>
  2374. +#include <linux/mm.h>
  2375. +#include <linux/console.h>
  2376. +#include <linux/mc146818rtc.h>
  2377. +#include <linux/delay.h>
  2378. +#include <linux/ide.h>
  2379. +
  2380. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
  2381. +#include <linux/ide.h>
  2382. +#endif
  2383. +
  2384. +#include <asm/cpu.h>
  2385. +#include <asm/bootinfo.h>
  2386. +#include <asm/irq.h>
  2387. +#include <asm/keyboard.h>
  2388. +#include <asm/mipsregs.h>
  2389. +#include <asm/reboot.h>
  2390. +#include <asm/pgtable.h>
  2391. +#include <asm/au1000.h>
  2392. +#include <asm/ficmmp.h>
  2393. +#include <asm/au1xxx_dbdma.h>
  2394. +#include <asm/au1xxx_gpio.h>
  2395. +
  2396. +extern struct rtc_ops no_rtc_ops;
  2397. +
  2398. +/* value currently in the board configuration register */
  2399. +u16 ficmmp_config = 0;
  2400. +
  2401. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
  2402. +extern struct ide_ops *ide_ops;
  2403. +extern struct ide_ops au1xxx_ide_ops;
  2404. +extern u32 au1xxx_ide_virtbase;
  2405. +extern u64 au1xxx_ide_physbase;
  2406. +extern int au1xxx_ide_irq;
  2407. +
  2408. +u32 led_base_addr;
  2409. +/* Ddma */
  2410. +chan_tab_t *ide_read_ch, *ide_write_ch;
  2411. +u32 au1xxx_ide_ddma_enable = 0, switch4ddma = 1; // PIO+ddma
  2412. +
  2413. +dbdev_tab_t new_dbdev_tab_element = { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 };
  2414. +#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX */
  2415. +
  2416. +void board_reset (void)
  2417. +{
  2418. + au_writel(0, 0xAD80001C);
  2419. +}
  2420. +
  2421. +void board_power_off (void)
  2422. +{
  2423. +}
  2424. +
  2425. +void __init board_setup(void)
  2426. +{
  2427. + char *argptr = NULL;
  2428. + u32 pin_func;
  2429. + rtc_ops = &no_rtc_ops;
  2430. +
  2431. + ficmmp_config_init(); //Initialize FIC control register
  2432. +
  2433. +#if 0
  2434. + /* Enable PSC1 SYNC for AC97. Normaly done in audio driver,
  2435. + * but it is board specific code, so put it here.
  2436. + */
  2437. + pin_func = au_readl(SYS_PINFUNC);
  2438. + au_sync();
  2439. + pin_func |= SYS_PF_MUST_BE_SET | SYS_PF_PSC1_S1;
  2440. + au_writel(pin_func, SYS_PINFUNC);
  2441. +
  2442. + au_writel(0, (u32)bcsr|0x10); /* turn off pcmcia power */
  2443. + au_sync();
  2444. +#endif
  2445. +
  2446. +#if defined( CONFIG_I2C_ALGO_AU1550 )
  2447. + {
  2448. + u32 freq0, clksrc;
  2449. +
  2450. + /* Select SMBUS in CPLD */
  2451. + /* bcsr->resets &= ~(BCSR_RESETS_PCS0MUX); */
  2452. +
  2453. + pin_func = au_readl(SYS_PINFUNC);
  2454. + au_sync();
  2455. + pin_func &= ~(3<<17 | 1<<4);
  2456. + /* Set GPIOs correctly */
  2457. + pin_func |= 2<<17;
  2458. + au_writel(pin_func, SYS_PINFUNC);
  2459. + au_sync();
  2460. +
  2461. + /* The i2c driver depends on 50Mhz clock */
  2462. + freq0 = au_readl(SYS_FREQCTRL0);
  2463. + au_sync();
  2464. + freq0 &= ~(SYS_FC_FRDIV1_MASK | SYS_FC_FS1 | SYS_FC_FE1);
  2465. + freq0 |= (3<<SYS_FC_FRDIV1_BIT);
  2466. + /* 396Mhz / (3+1)*2 == 49.5Mhz */
  2467. + au_writel(freq0, SYS_FREQCTRL0);
  2468. + au_sync();
  2469. + freq0 |= SYS_FC_FE1;
  2470. + au_writel(freq0, SYS_FREQCTRL0);
  2471. + au_sync();
  2472. +
  2473. + clksrc = au_readl(SYS_CLKSRC);
  2474. + au_sync();
  2475. + clksrc &= ~0x01f00000;
  2476. + /* bit 22 is EXTCLK0 for PSC0 */
  2477. + clksrc |= (0x3 << 22);
  2478. + au_writel(clksrc, SYS_CLKSRC);
  2479. + au_sync();
  2480. + }
  2481. +#endif
  2482. +
  2483. +#ifdef CONFIG_FB_AU1200
  2484. + argptr = prom_getcmdline();
  2485. + strcat(argptr, " video=au1200fb:");
  2486. +#endif
  2487. +
  2488. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
  2489. + /*
  2490. + * Iniz IDE parameters
  2491. + */
  2492. + ide_ops = &au1xxx_ide_ops;
  2493. + au1xxx_ide_irq = FICMMP_IDE_INT;
  2494. + au1xxx_ide_physbase = AU1XXX_ATA_PHYS_ADDR;
  2495. + au1xxx_ide_virtbase = KSEG1ADDR(AU1XXX_ATA_PHYS_ADDR);
  2496. + switch4ddma = 0;
  2497. + /*
  2498. + ide_ops = &au1xxx_ide_ops;
  2499. + au1xxx_ide_irq = FICMMP_IDE_INT;
  2500. + au1xxx_ide_base = KSEG1ADDR(AU1XXX_ATA_BASE);
  2501. + */
  2502. + au1xxx_gpio_write(9, 1);
  2503. + printk("B4001010: %X\n", *((u32*)0xB4001010));
  2504. + printk("B4001014: %X\n", *((u32*)0xB4001014));
  2505. + printk("B4001018: %X\n", *((u32*)0xB4001018));
  2506. + printk("B1900100: %X\n", *((u32*)0xB1900100));
  2507. +
  2508. +#if 0
  2509. + ficmmp_config_clear(FICMMP_CONFIG_IDERST);
  2510. + mdelay(100);
  2511. + ficmmp_config_set(FICMMP_CONFIG_IDERST);
  2512. + mdelay(100);
  2513. +#endif
  2514. + /*
  2515. + * change PIO or PIO+Ddma
  2516. + * check the GPIO-5 pin condition. pb1200:s18_dot
  2517. + */
  2518. +/* switch4ddma = 0; //(au_readl(SYS_PINSTATERD) & (1 << 5)) ? 1 : 0; */
  2519. +#endif
  2520. +
  2521. + /* The Pb1200 development board uses external MUX for PSC0 to
  2522. + support SMB/SPI. bcsr->resets bit 12: 0=SMB 1=SPI
  2523. + */
  2524. +#if defined(CONFIG_AU1550_PSC_SPI) && defined(CONFIG_I2C_ALGO_AU1550)
  2525. + #error I2C and SPI are mutually exclusive. Both are physically connected to PSC0.\
  2526. + Refer to Pb1200 documentation.
  2527. +#elif defined( CONFIG_AU1550_PSC_SPI )
  2528. + //bcsr->resets |= BCSR_RESETS_PCS0MUX;
  2529. +#elif defined( CONFIG_I2C_ALGO_AU1550 )
  2530. + //bcsr->resets &= (~BCSR_RESETS_PCS0MUX);
  2531. +#endif
  2532. + au_sync();
  2533. +
  2534. + printk("FIC Multimedia Player Board\n");
  2535. + au1xxx_gpio_tristate(5);
  2536. + printk("B1900100: %X\n", *((volatile u32*)0xB1900100));
  2537. + printk("B190002C: %X\n", *((volatile u32*)0xB190002C));
  2538. +}
  2539. +
  2540. +int
  2541. +board_au1200fb_panel (void)
  2542. +{
  2543. + au1xxx_gpio_tristate(6);
  2544. +
  2545. + if (au1xxx_gpio_read(12) == 0)
  2546. + return 9; /* FS453_640x480 (Composite/S-Video) */
  2547. + else
  2548. + return 7; /* Sharp 320x240 TFT */
  2549. +}
  2550. +
  2551. +int
  2552. +board_au1200fb_panel_init (void)
  2553. +{
  2554. + /*Enable data buffers*/
  2555. + ficmmp_config_clear(FICMMP_CONFIG_LCMDATAOUT);
  2556. + /*Take LCD out of reset*/
  2557. + ficmmp_config_set(FICMMP_CONFIG_LCMPWREN | FICMMP_CONFIG_LCMEN);
  2558. + return 0;
  2559. +}
  2560. +
  2561. +int
  2562. +board_au1200fb_panel_shutdown (void)
  2563. +{
  2564. + /*Disable data buffers*/
  2565. + ficmmp_config_set(FICMMP_CONFIG_LCMDATAOUT);
  2566. + /*Put LCD in reset, remove power*/
  2567. + ficmmp_config_clear(FICMMP_CONFIG_LCMEN | FICMMP_CONFIG_LCMPWREN);
  2568. + return 0;
  2569. +}
  2570. +
  2571. Index: linux-2.4.35.4/arch/mips/au1000/ficmmp/init.c
  2572. ===================================================================
  2573. --- /dev/null
  2574. +++ linux-2.4.35.4/arch/mips/au1000/ficmmp/init.c
  2575. @@ -0,0 +1,76 @@
  2576. +/*
  2577. + *
  2578. + * BRIEF MODULE DESCRIPTION
  2579. + * PB1200 board setup
  2580. + *
  2581. + * This program is free software; you can redistribute it and/or modify it
  2582. + * under the terms of the GNU General Public License as published by the
  2583. + * Free Software Foundation; either version 2 of the License, or (at your
  2584. + * option) any later version.
  2585. + *
  2586. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  2587. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  2588. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  2589. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  2590. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  2591. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  2592. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  2593. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  2594. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  2595. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2596. + *
  2597. + * You should have received a copy of the GNU General Public License along
  2598. + * with this program; if not, write to the Free Software Foundation, Inc.,
  2599. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  2600. + */
  2601. +
  2602. +#include <linux/init.h>
  2603. +#include <linux/mm.h>
  2604. +#include <linux/sched.h>
  2605. +#include <linux/bootmem.h>
  2606. +#include <asm/addrspace.h>
  2607. +#include <asm/bootinfo.h>
  2608. +#include <linux/config.h>
  2609. +#include <linux/string.h>
  2610. +#include <linux/kernel.h>
  2611. +#include <linux/sched.h>
  2612. +
  2613. +int prom_argc;
  2614. +char **prom_argv, **prom_envp;
  2615. +extern void __init prom_init_cmdline(void);
  2616. +extern char *prom_getenv(char *envname);
  2617. +
  2618. +const char *get_system_type(void)
  2619. +{
  2620. + return "FIC Multimedia Player (Au1200)";
  2621. +}
  2622. +
  2623. +u32 mae_memsize = 0;
  2624. +
  2625. +int __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
  2626. +{
  2627. + unsigned char *memsize_str;
  2628. + unsigned long memsize;
  2629. +
  2630. + prom_argc = argc;
  2631. + prom_argv = argv;
  2632. + prom_envp = envp;
  2633. +
  2634. + mips_machgroup = MACH_GROUP_ALCHEMY;
  2635. + mips_machtype = MACH_PB1000; /* set the platform # */
  2636. + prom_init_cmdline();
  2637. +
  2638. + memsize_str = prom_getenv("memsize");
  2639. + if (!memsize_str) {
  2640. + memsize = 0x08000000;
  2641. + } else {
  2642. + memsize = simple_strtol(memsize_str, NULL, 0);
  2643. + }
  2644. +
  2645. + /* reserved 32MB for MAE driver */
  2646. + memsize -= (32 * 1024 * 1024);
  2647. + add_memory_region(0, memsize, BOOT_MEM_RAM);
  2648. + mae_memsize = memsize; /* for drivers/char/au1xxx_mae.c */
  2649. + return 0;
  2650. +}
  2651. +
  2652. Index: linux-2.4.35.4/arch/mips/au1000/ficmmp/irqmap.c
  2653. ===================================================================
  2654. --- /dev/null
  2655. +++ linux-2.4.35.4/arch/mips/au1000/ficmmp/irqmap.c
  2656. @@ -0,0 +1,61 @@
  2657. +/*
  2658. + * BRIEF MODULE DESCRIPTION
  2659. + * Au1xxx irq map table
  2660. + *
  2661. + * This program is free software; you can redistribute it and/or modify it
  2662. + * under the terms of the GNU General Public License as published by the
  2663. + * Free Software Foundation; either version 2 of the License, or (at your
  2664. + * option) any later version.
  2665. + *
  2666. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  2667. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  2668. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  2669. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  2670. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  2671. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  2672. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  2673. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  2674. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  2675. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2676. + *
  2677. + * You should have received a copy of the GNU General Public License along
  2678. + * with this program; if not, write to the Free Software Foundation, Inc.,
  2679. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  2680. + */
  2681. +#include <linux/errno.h>
  2682. +#include <linux/init.h>
  2683. +#include <linux/irq.h>
  2684. +#include <linux/kernel_stat.h>
  2685. +#include <linux/module.h>
  2686. +#include <linux/signal.h>
  2687. +#include <linux/sched.h>
  2688. +#include <linux/types.h>
  2689. +#include <linux/interrupt.h>
  2690. +#include <linux/ioport.h>
  2691. +#include <linux/timex.h>
  2692. +#include <linux/slab.h>
  2693. +#include <linux/random.h>
  2694. +#include <linux/delay.h>
  2695. +
  2696. +#include <asm/bitops.h>
  2697. +#include <asm/bootinfo.h>
  2698. +#include <asm/io.h>
  2699. +#include <asm/mipsregs.h>
  2700. +#include <asm/system.h>
  2701. +#include <asm/au1000.h>
  2702. +#include <asm/ficmmp.h>
  2703. +
  2704. +au1xxx_irq_map_t au1xxx_irq_map[] = {
  2705. + { FICMMP_IDE_INT, INTC_INT_HIGH_LEVEL, 0 },
  2706. + { AU1XXX_SMC91111_IRQ, INTC_INT_HIGH_LEVEL, 0 },
  2707. + { AU1000_GPIO_1 , INTC_INT_FALL_EDGE, 0 }, // main button
  2708. + { AU1000_GPIO_6 , INTC_INT_RISE_EDGE, 0 }, // select button
  2709. + { AU1000_GPIO_12, INTC_INT_FALL_EDGE, 0 }, // guide button
  2710. + { AU1000_GPIO_17, INTC_INT_RISE_EDGE, 0 }, // down button
  2711. + { AU1000_GPIO_19, INTC_INT_RISE_EDGE, 0 }, // left button
  2712. + { AU1000_GPIO_26, INTC_INT_RISE_EDGE, 0 }, // right button
  2713. + { AU1000_GPIO_28, INTC_INT_RISE_EDGE, 0 }, // up button
  2714. +};
  2715. +
  2716. +int au1xxx_nr_irqs = sizeof(au1xxx_irq_map)/sizeof(au1xxx_irq_map_t);
  2717. +
  2718. Index: linux-2.4.35.4/arch/mips/au1000/ficmmp/Makefile
  2719. ===================================================================
  2720. --- /dev/null
  2721. +++ linux-2.4.35.4/arch/mips/au1000/ficmmp/Makefile
  2722. @@ -0,0 +1,25 @@
  2723. +#
  2724. +# Copyright 2000 MontaVista Software Inc.
  2725. +# Author: MontaVista Software, Inc.
  2726. +# [email protected] or [email protected]
  2727. +#
  2728. +# Makefile for the Alchemy Semiconductor FIC board.
  2729. +#
  2730. +# Note! Dependencies are done automagically by 'make dep', which also
  2731. +# removes any old dependencies. DON'T put your own dependencies here
  2732. +# unless it's something special (ie not a .c file).
  2733. +#
  2734. +
  2735. +USE_STANDARD_AS_RULE := true
  2736. +
  2737. +O_TARGET := ficmmp.o
  2738. +
  2739. +obj-y := init.o board_setup.o irqmap.o au1200_ibutton.o au1xxx_dock.o
  2740. +
  2741. +ifdef CONFIG_MMC
  2742. +obj-y += mmc_support.o
  2743. +export-objs +=mmc_support.o
  2744. +endif
  2745. +
  2746. +
  2747. +include $(TOPDIR)/Rules.make
  2748. Index: linux-2.4.35.4/arch/mips/au1000/hydrogen3/board_setup.c
  2749. ===================================================================
  2750. --- linux-2.4.35.4.orig/arch/mips/au1000/hydrogen3/board_setup.c
  2751. +++ linux-2.4.35.4/arch/mips/au1000/hydrogen3/board_setup.c
  2752. @@ -51,12 +51,19 @@ void board_reset (void)
  2753. {
  2754. }
  2755. +void board_power_off (void)
  2756. +{
  2757. +}
  2758. +
  2759. void __init board_setup(void)
  2760. {
  2761. u32 pin_func;
  2762. rtc_ops = &no_rtc_ops;
  2763. + /* Set GPIO14 high to make CD/DAT1 high for MMC to work */
  2764. + au_writel(1<<14, SYS_OUTPUTSET);
  2765. +
  2766. #ifdef CONFIG_AU1X00_USB_DEVICE
  2767. // 2nd USB port is USB device
  2768. pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8000);
  2769. Index: linux-2.4.35.4/arch/mips/au1000/hydrogen3/buttons.c
  2770. ===================================================================
  2771. --- /dev/null
  2772. +++ linux-2.4.35.4/arch/mips/au1000/hydrogen3/buttons.c
  2773. @@ -0,0 +1,308 @@
  2774. +/*
  2775. + * Copyright (C) 2003 Metrowerks, All Rights Reserved.
  2776. + *
  2777. + * This program is free software; you can redistribute it and/or modify
  2778. + * it under the terms of the GNU General Public License version 2 as
  2779. + * published by the Free Software Foundation.
  2780. + */
  2781. +
  2782. +#include <linux/config.h>
  2783. +#include <linux/module.h>
  2784. +#include <linux/init.h>
  2785. +#include <linux/fs.h>
  2786. +#include <linux/sched.h>
  2787. +#include <linux/miscdevice.h>
  2788. +#include <linux/errno.h>
  2789. +#include <linux/poll.h>
  2790. +#include <asm/au1000.h>
  2791. +#include <asm/uaccess.h>
  2792. +
  2793. +#define BUTTON_SELECT (1<<1)
  2794. +#define BUTTON_1 (1<<2)
  2795. +#define BUTTON_2 (1<<3)
  2796. +#define BUTTON_ONOFF (1<<6)
  2797. +#define BUTTON_3 (1<<7)
  2798. +#define BUTTON_4 (1<<8)
  2799. +#define BUTTON_LEFT (1<<9)
  2800. +#define BUTTON_DOWN (1<<10)
  2801. +#define BUTTON_RIGHT (1<<11)
  2802. +#define BUTTON_UP (1<<12)
  2803. +
  2804. +#define BUTTON_MASK (\
  2805. + BUTTON_SELECT \
  2806. + | BUTTON_1 \
  2807. + | BUTTON_2 \
  2808. + | BUTTON_ONOFF \
  2809. + | BUTTON_3 \
  2810. + | BUTTON_4 \
  2811. + | BUTTON_LEFT \
  2812. + | BUTTON_DOWN \
  2813. + | BUTTON_RIGHT \
  2814. + | BUTTON_UP \
  2815. + )
  2816. +
  2817. +#define BUTTON_INVERT (\
  2818. + BUTTON_SELECT \
  2819. + | BUTTON_1 \
  2820. + | BUTTON_2 \
  2821. + | BUTTON_3 \
  2822. + | BUTTON_4 \
  2823. + | BUTTON_LEFT \
  2824. + | BUTTON_DOWN \
  2825. + | BUTTON_RIGHT \
  2826. + | BUTTON_UP \
  2827. + )
  2828. +
  2829. +
  2830. +
  2831. +#define MAKE_FLAG 0x20
  2832. +
  2833. +#undef DEBUG
  2834. +
  2835. +#define DEBUG 0
  2836. +//#define DEBUG 1
  2837. +
  2838. +#if DEBUG
  2839. +#define DPRINTK(format, args...) printk(__FUNCTION__ ": " format, ## args)
  2840. +#else
  2841. +#define DPRINTK(format, args...) do { } while (0)
  2842. +#endif
  2843. +
  2844. +/* Please note that this driver is based on a timer and is not interrupt
  2845. + * driven. If you are going to make use of this driver, you will need to have
  2846. + * your application open the buttons listing from the /dev directory first.
  2847. + */
  2848. +
  2849. +struct hydrogen3_buttons {
  2850. + struct fasync_struct *fasync;
  2851. + wait_queue_head_t read_wait;
  2852. + int open_count;
  2853. + unsigned int debounce;
  2854. + unsigned int current;
  2855. + unsigned int last;
  2856. +};
  2857. +
  2858. +static struct hydrogen3_buttons buttons_info;
  2859. +
  2860. +
  2861. +static void button_timer_periodic(void *data);
  2862. +
  2863. +static struct tq_struct button_task = {
  2864. + routine: button_timer_periodic,
  2865. + data: NULL
  2866. +};
  2867. +
  2868. +static int cleanup_flag = 0;
  2869. +static DECLARE_WAIT_QUEUE_HEAD(cleanup_wait_queue);
  2870. +
  2871. +
  2872. +static unsigned int read_button_state(void)
  2873. +{
  2874. + unsigned long state;
  2875. +
  2876. + state = inl(SYS_PINSTATERD) & BUTTON_MASK;
  2877. + state ^= BUTTON_INVERT;
  2878. +
  2879. + DPRINTK( "Current Button State: %d\n", state );
  2880. +
  2881. + return state;
  2882. +}
  2883. +
  2884. +
  2885. +static void button_timer_periodic(void *data)
  2886. +{
  2887. + struct hydrogen3_buttons *buttons = (struct hydrogen3_buttons *)data;
  2888. + unsigned long button_state;
  2889. +
  2890. + // If cleanup wants us to die
  2891. + if (cleanup_flag) {
  2892. + wake_up(&cleanup_wait_queue); // now cleanup_module can return
  2893. + } else {
  2894. + queue_task(&button_task, &tq_timer); // put ourselves back in the task queue
  2895. + }
  2896. +
  2897. + // read current buttons
  2898. + button_state = read_button_state();
  2899. +
  2900. + // if no buttons are down and nothing to do then
  2901. + // save time and be done.
  2902. + if ((button_state == 0) && (buttons->current == 0)) {
  2903. + return;
  2904. + }
  2905. +
  2906. + if (button_state == buttons->debounce) {
  2907. + buttons->current = button_state;
  2908. + } else {
  2909. + buttons->debounce = button_state;
  2910. + }
  2911. +// printk("0x%04x\n", button_state);
  2912. + if (buttons->current != buttons->last) {
  2913. + if (waitqueue_active(&buttons->read_wait)) {
  2914. + wake_up_interruptible(&buttons->read_wait);
  2915. + }
  2916. + }
  2917. +}
  2918. +
  2919. +
  2920. +static ssize_t hydrogen3_buttons_read(struct file *filp, char *buffer, size_t count, loff_t *ppos)
  2921. +{
  2922. + struct hydrogen3_buttons *buttons = filp->private_data;
  2923. + char events[16];
  2924. + int index;
  2925. + int last;
  2926. + int cur;
  2927. + int bit;
  2928. + int bit_mask;
  2929. + int err;
  2930. +
  2931. + DPRINTK("start\n");
  2932. +
  2933. +try_again:
  2934. +
  2935. + while (buttons->current == buttons->last) {
  2936. + if (filp->f_flags & O_NONBLOCK) {
  2937. + return -EAGAIN;
  2938. + }
  2939. + interruptible_sleep_on(&buttons->read_wait);
  2940. + if (signal_pending(current)) {
  2941. + return -ERESTARTSYS;
  2942. + }
  2943. + }
  2944. +
  2945. + cur = buttons->current;
  2946. + last = buttons->last;
  2947. +
  2948. + index = 0;
  2949. + bit_mask = 1;
  2950. + for (bit = 0; (bit < 16) && count; bit++) {
  2951. + if ((cur ^ last) & bit_mask) {
  2952. + if (cur & bit_mask) {
  2953. + events[index] = (bit | MAKE_FLAG) + 'A';
  2954. + last |= bit_mask;
  2955. + } else {
  2956. + events[index] = bit + 'A';
  2957. + last &= ~bit_mask;
  2958. + }
  2959. + index++;
  2960. + count--;
  2961. + }
  2962. + bit_mask <<= 1;
  2963. + }
  2964. + buttons->last = last;
  2965. +
  2966. + if (index == 0) {
  2967. + goto try_again;
  2968. + }
  2969. +
  2970. + err = copy_to_user(buffer, events, index);
  2971. + if (err) {
  2972. + return err;
  2973. + }
  2974. +
  2975. + return index;
  2976. +}
  2977. +
  2978. +
  2979. +static int hydrogen3_buttons_open(struct inode *inode, struct file *filp)
  2980. +{
  2981. + struct hydrogen3_buttons *buttons = &buttons_info;
  2982. +
  2983. + DPRINTK("start\n");
  2984. + MOD_INC_USE_COUNT;
  2985. +
  2986. + filp->private_data = buttons;
  2987. +
  2988. + if (buttons->open_count++ == 0) {
  2989. + button_task.data = buttons;
  2990. + cleanup_flag = 0;
  2991. + queue_task(&button_task, &tq_timer);
  2992. + }
  2993. +
  2994. + return 0;
  2995. +}
  2996. +
  2997. +
  2998. +static unsigned int hydrogen3_buttons_poll(struct file *filp, poll_table *wait)
  2999. +{
  3000. + struct hydrogen3_buttons *buttons = filp->private_data;
  3001. + int ret = 0;
  3002. +
  3003. + DPRINTK("start\n");
  3004. + poll_wait(filp, &buttons->read_wait, wait);
  3005. + if (buttons->current != buttons->last) {
  3006. + ret = POLLIN | POLLRDNORM;
  3007. + }
  3008. + return ret;
  3009. +}
  3010. +
  3011. +
  3012. +static int hydrogen3_buttons_release(struct inode *inode, struct file *filp)
  3013. +{
  3014. + struct hydrogen3_buttons *buttons = filp->private_data;
  3015. +
  3016. + DPRINTK("start\n");
  3017. +
  3018. + if (--buttons->open_count == 0) {
  3019. + cleanup_flag = 1;
  3020. + sleep_on(&cleanup_wait_queue);
  3021. + }
  3022. + MOD_DEC_USE_COUNT;
  3023. +
  3024. + return 0;
  3025. +}
  3026. +
  3027. +
  3028. +
  3029. +static struct file_operations hydrogen3_buttons_fops = {
  3030. + owner: THIS_MODULE,
  3031. + read: hydrogen3_buttons_read,
  3032. + poll: hydrogen3_buttons_poll,
  3033. + open: hydrogen3_buttons_open,
  3034. + release: hydrogen3_buttons_release,
  3035. +};
  3036. +
  3037. +/*
  3038. + * The hydrogen3 buttons is a misc device:
  3039. + * Major 10 char
  3040. + * Minor 22 /dev/buttons
  3041. + *
  3042. + * This is /dev/misc/buttons if devfs is used.
  3043. + */
  3044. +
  3045. +static struct miscdevice hydrogen3_buttons_dev = {
  3046. + minor: 22,
  3047. + name: "buttons",
  3048. + fops: &hydrogen3_buttons_fops,
  3049. +};
  3050. +
  3051. +static int __init hydrogen3_buttons_init(void)
  3052. +{
  3053. + struct hydrogen3_buttons *buttons = &buttons_info;
  3054. + int ret;
  3055. +
  3056. + DPRINTK("Initializing buttons driver\n");
  3057. + buttons->open_count = 0;
  3058. + cleanup_flag = 0;
  3059. + init_waitqueue_head(&buttons->read_wait);
  3060. +
  3061. +
  3062. + // yamon configures GPIO pins for the buttons
  3063. + // no initialization needed
  3064. +
  3065. + ret = misc_register(&hydrogen3_buttons_dev);
  3066. +
  3067. + DPRINTK("Buttons driver fully initialized.\n");
  3068. +
  3069. + return ret;
  3070. +}
  3071. +
  3072. +
  3073. +static void __exit hydrogen3_buttons_exit(void)
  3074. +{
  3075. + DPRINTK("unloading buttons driver\n");
  3076. + misc_deregister(&hydrogen3_buttons_dev);
  3077. +}
  3078. +
  3079. +
  3080. +module_init(hydrogen3_buttons_init);
  3081. +module_exit(hydrogen3_buttons_exit);
  3082. Index: linux-2.4.35.4/arch/mips/au1000/hydrogen3/Makefile
  3083. ===================================================================
  3084. --- linux-2.4.35.4.orig/arch/mips/au1000/hydrogen3/Makefile
  3085. +++ linux-2.4.35.4/arch/mips/au1000/hydrogen3/Makefile
  3086. @@ -14,6 +14,11 @@ USE_STANDARD_AS_RULE := true
  3087. O_TARGET := hydrogen3.o
  3088. -obj-y := init.o board_setup.o irqmap.o
  3089. +obj-y := init.o board_setup.o irqmap.o buttons.o
  3090. +
  3091. +ifdef CONFIG_MMC
  3092. +obj-y += mmc_support.o
  3093. +export-objs +=mmc_support.o
  3094. +endif
  3095. include $(TOPDIR)/Rules.make
  3096. Index: linux-2.4.35.4/arch/mips/au1000/hydrogen3/mmc_support.c
  3097. ===================================================================
  3098. --- /dev/null
  3099. +++ linux-2.4.35.4/arch/mips/au1000/hydrogen3/mmc_support.c
  3100. @@ -0,0 +1,89 @@
  3101. +/*
  3102. + * BRIEF MODULE DESCRIPTION
  3103. + *
  3104. + * MMC support routines for Hydrogen3.
  3105. + *
  3106. + *
  3107. + * Copyright (c) 2003-2004 Embedded Edge, LLC.
  3108. + * Author: Embedded Edge, LLC.
  3109. + * Contact: [email protected]
  3110. + *
  3111. + * This program is free software; you can redistribute it and/or modify it
  3112. + * under the terms of the GNU General Public License as published by the
  3113. + * Free Software Foundation; either version 2 of the License, or (at your
  3114. + * option) any later version.
  3115. + *
  3116. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  3117. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  3118. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  3119. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  3120. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  3121. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  3122. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  3123. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3124. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  3125. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3126. + *
  3127. + * You should have received a copy of the GNU General Public License along
  3128. + * with this program; if not, write to the Free Software Foundation, Inc.,
  3129. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  3130. + *
  3131. + */
  3132. +
  3133. +
  3134. +#include <linux/config.h>
  3135. +#include <linux/kernel.h>
  3136. +#include <linux/module.h>
  3137. +#include <linux/init.h>
  3138. +
  3139. +#include <asm/irq.h>
  3140. +#include <asm/au1000.h>
  3141. +#include <asm/au1100_mmc.h>
  3142. +
  3143. +#define GPIO_17_WP 0x20000
  3144. +
  3145. +/* SD/MMC controller support functions */
  3146. +
  3147. +/*
  3148. + * Detect card.
  3149. + */
  3150. +void mmc_card_inserted(int _n_, int *_res_)
  3151. +{
  3152. + u32 gpios = au_readl(SYS_PINSTATERD);
  3153. + u32 emptybit = (1<<16);
  3154. + *_res_ = ((gpios & emptybit) == 0);
  3155. +}
  3156. +
  3157. +/*
  3158. + * Check card write protection.
  3159. + */
  3160. +void mmc_card_writable(int _n_, int *_res_)
  3161. +{
  3162. + unsigned long mmc_wp, board_specific;
  3163. + board_specific = au_readl(SYS_OUTPUTSET);
  3164. + mmc_wp=GPIO_17_WP;
  3165. + if (!(board_specific & mmc_wp)) {/* low means card writable */
  3166. + *_res_ = 1;
  3167. + } else {
  3168. + *_res_ = 0;
  3169. + }
  3170. +}
  3171. +/*
  3172. + * Apply power to card slot.
  3173. + */
  3174. +void mmc_power_on(int _n_)
  3175. +{
  3176. +}
  3177. +
  3178. +/*
  3179. + * Remove power from card slot.
  3180. + */
  3181. +void mmc_power_off(int _n_)
  3182. +{
  3183. +}
  3184. +
  3185. +EXPORT_SYMBOL(mmc_card_inserted);
  3186. +EXPORT_SYMBOL(mmc_card_writable);
  3187. +EXPORT_SYMBOL(mmc_power_on);
  3188. +EXPORT_SYMBOL(mmc_power_off);
  3189. +
  3190. Index: linux-2.4.35.4/arch/mips/au1000/mtx-1/board_setup.c
  3191. ===================================================================
  3192. --- linux-2.4.35.4.orig/arch/mips/au1000/mtx-1/board_setup.c
  3193. +++ linux-2.4.35.4/arch/mips/au1000/mtx-1/board_setup.c
  3194. @@ -48,6 +48,12 @@
  3195. extern struct rtc_ops no_rtc_ops;
  3196. +void board_reset (void)
  3197. +{
  3198. + /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
  3199. + au_writel(0x00000000, 0xAE00001C);
  3200. +}
  3201. +
  3202. void __init board_setup(void)
  3203. {
  3204. rtc_ops = &no_rtc_ops;
  3205. Index: linux-2.4.35.4/arch/mips/au1000/mtx-1/irqmap.c
  3206. ===================================================================
  3207. --- linux-2.4.35.4.orig/arch/mips/au1000/mtx-1/irqmap.c
  3208. +++ linux-2.4.35.4/arch/mips/au1000/mtx-1/irqmap.c
  3209. @@ -72,10 +72,10 @@ au1xxx_pci_irqmap(struct pci_dev *dev, u
  3210. * A B C D
  3211. */
  3212. {
  3213. - {INTA, INTB, INTC, INTD}, /* IDSEL 0 */
  3214. - {INTA, INTB, INTC, INTD}, /* IDSEL 1 */
  3215. - {INTA, INTB, INTC, INTD}, /* IDSEL 2 */
  3216. - {INTA, INTB, INTC, INTD}, /* IDSEL 3 */
  3217. + {INTA, INTB, INTX, INTX}, /* IDSEL 0 */
  3218. + {INTB, INTA, INTX, INTX}, /* IDSEL 1 */
  3219. + {INTC, INTD, INTX, INTX}, /* IDSEL 2 */
  3220. + {INTD, INTC, INTX, INTX}, /* IDSEL 3 */
  3221. };
  3222. const long min_idsel = 0, max_idsel = 3, irqs_per_slot = 4;
  3223. return PCI_IRQ_TABLE_LOOKUP;
  3224. Index: linux-2.4.35.4/arch/mips/au1000/pb1000/board_setup.c
  3225. ===================================================================
  3226. --- linux-2.4.35.4.orig/arch/mips/au1000/pb1000/board_setup.c
  3227. +++ linux-2.4.35.4/arch/mips/au1000/pb1000/board_setup.c
  3228. @@ -58,6 +58,10 @@ void board_reset (void)
  3229. {
  3230. }
  3231. +void board_power_off (void)
  3232. +{
  3233. +}
  3234. +
  3235. void __init board_setup(void)
  3236. {
  3237. u32 pin_func, static_cfg0;
  3238. Index: linux-2.4.35.4/arch/mips/au1000/pb1100/board_setup.c
  3239. ===================================================================
  3240. --- linux-2.4.35.4.orig/arch/mips/au1000/pb1100/board_setup.c
  3241. +++ linux-2.4.35.4/arch/mips/au1000/pb1100/board_setup.c
  3242. @@ -62,6 +62,10 @@ void board_reset (void)
  3243. au_writel(0x00000000, 0xAE00001C);
  3244. }
  3245. +void board_power_off (void)
  3246. +{
  3247. +}
  3248. +
  3249. void __init board_setup(void)
  3250. {
  3251. u32 pin_func;
  3252. Index: linux-2.4.35.4/arch/mips/au1000/pb1100/Makefile
  3253. ===================================================================
  3254. --- linux-2.4.35.4.orig/arch/mips/au1000/pb1100/Makefile
  3255. +++ linux-2.4.35.4/arch/mips/au1000/pb1100/Makefile
  3256. @@ -16,4 +16,10 @@ O_TARGET := pb1100.o
  3257. obj-y := init.o board_setup.o irqmap.o
  3258. +
  3259. +ifdef CONFIG_MMC
  3260. +obj-y += mmc_support.o
  3261. +export-objs += mmc_support.o
  3262. +endif
  3263. +
  3264. include $(TOPDIR)/Rules.make
  3265. Index: linux-2.4.35.4/arch/mips/au1000/pb1100/mmc_support.c
  3266. ===================================================================
  3267. --- /dev/null
  3268. +++ linux-2.4.35.4/arch/mips/au1000/pb1100/mmc_support.c
  3269. @@ -0,0 +1,126 @@
  3270. +/*
  3271. + * BRIEF MODULE DESCRIPTION
  3272. + *
  3273. + * MMC support routines for PB1100.
  3274. + *
  3275. + *
  3276. + * Copyright (c) 2003-2004 Embedded Edge, LLC.
  3277. + * Author: Embedded Edge, LLC.
  3278. + * Contact: [email protected]
  3279. + *
  3280. + * This program is free software; you can redistribute it and/or modify it
  3281. + * under the terms of the GNU General Public License as published by the
  3282. + * Free Software Foundation; either version 2 of the License, or (at your
  3283. + * option) any later version.
  3284. + *
  3285. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  3286. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  3287. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  3288. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  3289. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  3290. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  3291. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  3292. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3293. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  3294. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3295. + *
  3296. + * You should have received a copy of the GNU General Public License along
  3297. + * with this program; if not, write to the Free Software Foundation, Inc.,
  3298. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  3299. + *
  3300. + */
  3301. +
  3302. +
  3303. +#include <linux/config.h>
  3304. +#include <linux/kernel.h>
  3305. +#include <linux/module.h>
  3306. +#include <linux/init.h>
  3307. +
  3308. +#include <asm/irq.h>
  3309. +#include <asm/au1000.h>
  3310. +#include <asm/au1100_mmc.h>
  3311. +#include <asm/pb1100.h>
  3312. +
  3313. +
  3314. +/* SD/MMC controller support functions */
  3315. +
  3316. +/*
  3317. + * Detect card.
  3318. + */
  3319. +void mmc_card_inserted(int _n_, int *_res_)
  3320. +{
  3321. + u32 gpios = au_readl(SYS_PINSTATERD);
  3322. + u32 emptybit = (_n_) ? (1<<15) : (1<<14);
  3323. + *_res_ = ((gpios & emptybit) == 0);
  3324. +}
  3325. +
  3326. +/*
  3327. + * Check card write protection.
  3328. + */
  3329. +void mmc_card_writable(int _n_, int *_res_)
  3330. +{
  3331. + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  3332. + unsigned long mmc_wp, board_specific;
  3333. +
  3334. + if (_n_) {
  3335. + mmc_wp = BCSR_PCMCIA_SD1_WP;
  3336. + } else {
  3337. + mmc_wp = BCSR_PCMCIA_SD0_WP;
  3338. + }
  3339. +
  3340. + board_specific = au_readl((unsigned long)(&bcsr->pcmcia));
  3341. +
  3342. + if (!(board_specific & mmc_wp)) {/* low means card writable */
  3343. + *_res_ = 1;
  3344. + } else {
  3345. + *_res_ = 0;
  3346. + }
  3347. +}
  3348. +
  3349. +/*
  3350. + * Apply power to card slot.
  3351. + */
  3352. +void mmc_power_on(int _n_)
  3353. +{
  3354. + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  3355. + unsigned long mmc_pwr, board_specific;
  3356. +
  3357. + if (_n_) {
  3358. + mmc_pwr = BCSR_PCMCIA_SD1_PWR;
  3359. + } else {
  3360. + mmc_pwr = BCSR_PCMCIA_SD0_PWR;
  3361. + }
  3362. +
  3363. + board_specific = au_readl((unsigned long)(&bcsr->pcmcia));
  3364. + board_specific |= mmc_pwr;
  3365. +
  3366. + au_writel(board_specific, (int)(&bcsr->pcmcia));
  3367. + au_sync_delay(1);
  3368. +}
  3369. +
  3370. +/*
  3371. + * Remove power from card slot.
  3372. + */
  3373. +void mmc_power_off(int _n_)
  3374. +{
  3375. + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  3376. + unsigned long mmc_pwr, board_specific;
  3377. +
  3378. + if (_n_) {
  3379. + mmc_pwr = BCSR_PCMCIA_SD1_PWR;
  3380. + } else {
  3381. + mmc_pwr = BCSR_PCMCIA_SD0_PWR;
  3382. + }
  3383. +
  3384. + board_specific = au_readl((unsigned long)(&bcsr->pcmcia));
  3385. + board_specific &= ~mmc_pwr;
  3386. +
  3387. + au_writel(board_specific, (int)(&bcsr->pcmcia));
  3388. + au_sync_delay(1);
  3389. +}
  3390. +
  3391. +EXPORT_SYMBOL(mmc_card_inserted);
  3392. +EXPORT_SYMBOL(mmc_card_writable);
  3393. +EXPORT_SYMBOL(mmc_power_on);
  3394. +EXPORT_SYMBOL(mmc_power_off);
  3395. +
  3396. Index: linux-2.4.35.4/arch/mips/au1000/pb1200/board_setup.c
  3397. ===================================================================
  3398. --- /dev/null
  3399. +++ linux-2.4.35.4/arch/mips/au1000/pb1200/board_setup.c
  3400. @@ -0,0 +1,221 @@
  3401. +/*
  3402. + *
  3403. + * BRIEF MODULE DESCRIPTION
  3404. + * Alchemy Pb1200 board setup.
  3405. + *
  3406. + * This program is free software; you can redistribute it and/or modify it
  3407. + * under the terms of the GNU General Public License as published by the
  3408. + * Free Software Foundation; either version 2 of the License, or (at your
  3409. + * option) any later version.
  3410. + *
  3411. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  3412. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  3413. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  3414. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  3415. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  3416. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  3417. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  3418. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3419. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  3420. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3421. + *
  3422. + * You should have received a copy of the GNU General Public License along
  3423. + * with this program; if not, write to the Free Software Foundation, Inc.,
  3424. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  3425. + */
  3426. +#include <linux/config.h>
  3427. +#include <linux/init.h>
  3428. +#include <linux/sched.h>
  3429. +#include <linux/ioport.h>
  3430. +#include <linux/mm.h>
  3431. +#include <linux/console.h>
  3432. +#include <linux/mc146818rtc.h>
  3433. +#include <linux/delay.h>
  3434. +
  3435. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
  3436. +#include <linux/ide.h>
  3437. +#endif
  3438. +
  3439. +#include <asm/cpu.h>
  3440. +#include <asm/bootinfo.h>
  3441. +#include <asm/irq.h>
  3442. +#include <asm/keyboard.h>
  3443. +#include <asm/mipsregs.h>
  3444. +#include <asm/reboot.h>
  3445. +#include <asm/pgtable.h>
  3446. +#include <asm/au1000.h>
  3447. +#include <asm/au1xxx_dbdma.h>
  3448. +
  3449. +#ifdef CONFIG_MIPS_PB1200
  3450. +#include <asm/pb1200.h>
  3451. +#endif
  3452. +
  3453. +#ifdef CONFIG_MIPS_DB1200
  3454. +#include <asm/db1200.h>
  3455. +#define PB1200_ETH_INT DB1200_ETH_INT
  3456. +#define PB1200_IDE_INT DB1200_IDE_INT
  3457. +#endif
  3458. +
  3459. +extern struct rtc_ops no_rtc_ops;
  3460. +
  3461. +extern void _board_init_irq(void);
  3462. +extern void (*board_init_irq)(void);
  3463. +
  3464. +#ifdef CONFIG_BLK_DEV_IDE_AU1XXX
  3465. +extern struct ide_ops *ide_ops;
  3466. +extern struct ide_ops au1xxx_ide_ops;
  3467. +extern u32 au1xxx_ide_virtbase;
  3468. +extern u64 au1xxx_ide_physbase;
  3469. +extern int au1xxx_ide_irq;
  3470. +
  3471. +u32 led_base_addr;
  3472. +/* Ddma */
  3473. +chan_tab_t *ide_read_ch, *ide_write_ch;
  3474. +u32 au1xxx_ide_ddma_enable = 0, switch4ddma = 1; // PIO+ddma
  3475. +
  3476. +dbdev_tab_t new_dbdev_tab_element = { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 };
  3477. +#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX */
  3478. +
  3479. +void board_reset (void)
  3480. +{
  3481. + bcsr->resets = 0;
  3482. +}
  3483. +
  3484. +void board_power_off (void)
  3485. +{
  3486. + bcsr->resets = 0xC000;
  3487. +}
  3488. +
  3489. +void __init board_setup(void)
  3490. +{
  3491. + char *argptr = NULL;
  3492. + u32 pin_func;
  3493. + rtc_ops = &no_rtc_ops;
  3494. +
  3495. +#if 0
  3496. + /* Enable PSC1 SYNC for AC97. Normaly done in audio driver,
  3497. + * but it is board specific code, so put it here.
  3498. + */
  3499. + pin_func = au_readl(SYS_PINFUNC);
  3500. + au_sync();
  3501. + pin_func |= SYS_PF_MUST_BE_SET | SYS_PF_PSC1_S1;
  3502. + au_writel(pin_func, SYS_PINFUNC);
  3503. +
  3504. + au_writel(0, (u32)bcsr|0x10); /* turn off pcmcia power */
  3505. + au_sync();
  3506. +#endif
  3507. +
  3508. +#if defined( CONFIG_I2C_ALGO_AU1550 )
  3509. + {
  3510. + u32 freq0, clksrc;
  3511. +
  3512. + /* Select SMBUS in CPLD */
  3513. + bcsr->resets &= ~(BCSR_RESETS_PCS0MUX);
  3514. +
  3515. + pin_func = au_readl(SYS_PINFUNC);
  3516. + au_sync();
  3517. + pin_func &= ~(3<<17 | 1<<4);
  3518. + /* Set GPIOs correctly */
  3519. + pin_func |= 2<<17;
  3520. + au_writel(pin_func, SYS_PINFUNC);
  3521. + au_sync();
  3522. +
  3523. + /* The i2c driver depends on 50Mhz clock */
  3524. + freq0 = au_readl(SYS_FREQCTRL0);
  3525. + au_sync();
  3526. + freq0 &= ~(SYS_FC_FRDIV1_MASK | SYS_FC_FS1 | SYS_FC_FE1);
  3527. + freq0 |= (3<<SYS_FC_FRDIV1_BIT);
  3528. + /* 396Mhz / (3+1)*2 == 49.5Mhz */
  3529. + au_writel(freq0, SYS_FREQCTRL0);
  3530. + au_sync();
  3531. + freq0 |= SYS_FC_FE1;
  3532. + au_writel(freq0, SYS_FREQCTRL0);
  3533. + au_sync();
  3534. +
  3535. + clksrc = au_readl(SYS_CLKSRC);
  3536. + au_sync();
  3537. + clksrc &= ~0x01f00000;
  3538. + /* bit 22 is EXTCLK0 for PSC0 */
  3539. + clksrc |= (0x3 << 22);
  3540. + au_writel(clksrc, SYS_CLKSRC);
  3541. + au_sync();
  3542. + }
  3543. +#endif
  3544. +
  3545. +#ifdef CONFIG_FB_AU1200
  3546. + argptr = prom_getcmdline();
  3547. + strcat(argptr, " video=au1200fb:");
  3548. +#endif
  3549. +
  3550. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
  3551. + /*
  3552. + * Iniz IDE parameters
  3553. + */
  3554. + ide_ops = &au1xxx_ide_ops;
  3555. + au1xxx_ide_irq = PB1200_IDE_INT;
  3556. + au1xxx_ide_physbase = AU1XXX_ATA_PHYS_ADDR;
  3557. + au1xxx_ide_virtbase = KSEG1ADDR(AU1XXX_ATA_PHYS_ADDR);
  3558. + /*
  3559. + * change PIO or PIO+Ddma
  3560. + * check the GPIO-5 pin condition. pb1200:s18_dot */
  3561. + switch4ddma = (au_readl(SYS_PINSTATERD) & (1 << 5)) ? 1 : 0;
  3562. +#endif
  3563. +
  3564. + /* The Pb1200 development board uses external MUX for PSC0 to
  3565. + support SMB/SPI. bcsr->resets bit 12: 0=SMB 1=SPI
  3566. + */
  3567. +#if defined(CONFIG_AU1550_PSC_SPI) && defined(CONFIG_I2C_ALGO_AU1550)
  3568. + #error I2C and SPI are mutually exclusive. Both are physically connected to PSC0.\
  3569. + Refer to Pb1200/Db1200 documentation.
  3570. +#elif defined( CONFIG_AU1550_PSC_SPI )
  3571. + bcsr->resets |= BCSR_RESETS_PCS0MUX;
  3572. +#elif defined( CONFIG_I2C_ALGO_AU1550 )
  3573. + bcsr->resets &= (~BCSR_RESETS_PCS0MUX);
  3574. +#endif
  3575. + au_sync();
  3576. +
  3577. +#ifdef CONFIG_MIPS_PB1200
  3578. + printk("AMD Alchemy Pb1200 Board\n");
  3579. +#endif
  3580. +#ifdef CONFIG_MIPS_DB1200
  3581. + printk("AMD Alchemy Db1200 Board\n");
  3582. +#endif
  3583. +
  3584. + /* Setup Pb1200 External Interrupt Controller */
  3585. + {
  3586. + extern void (*board_init_irq)(void);
  3587. + extern void _board_init_irq(void);
  3588. + board_init_irq = _board_init_irq;
  3589. + }
  3590. +}
  3591. +
  3592. +int
  3593. +board_au1200fb_panel (void)
  3594. +{
  3595. + BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  3596. + int p;
  3597. +
  3598. + p = bcsr->switches;
  3599. + p >>= 8;
  3600. + p &= 0x0F;
  3601. + return p;
  3602. +}
  3603. +
  3604. +int
  3605. +board_au1200fb_panel_init (void)
  3606. +{
  3607. + /* Apply power */
  3608. + BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  3609. + bcsr->board |= (BCSR_BOARD_LCDVEE | BCSR_BOARD_LCDVDD | BCSR_BOARD_LCDBL);
  3610. + return 0;
  3611. +}
  3612. +
  3613. +int
  3614. +board_au1200fb_panel_shutdown (void)
  3615. +{
  3616. + /* Remove power */
  3617. + BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  3618. + bcsr->board &= ~(BCSR_BOARD_LCDVEE | BCSR_BOARD_LCDVDD | BCSR_BOARD_LCDBL);
  3619. + return 0;
  3620. +}
  3621. +
  3622. Index: linux-2.4.35.4/arch/mips/au1000/pb1200/init.c
  3623. ===================================================================
  3624. --- /dev/null
  3625. +++ linux-2.4.35.4/arch/mips/au1000/pb1200/init.c
  3626. @@ -0,0 +1,72 @@
  3627. +/*
  3628. + *
  3629. + * BRIEF MODULE DESCRIPTION
  3630. + * PB1200 board setup
  3631. + *
  3632. + * This program is free software; you can redistribute it and/or modify it
  3633. + * under the terms of the GNU General Public License as published by the
  3634. + * Free Software Foundation; either version 2 of the License, or (at your
  3635. + * option) any later version.
  3636. + *
  3637. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  3638. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  3639. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  3640. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  3641. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  3642. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  3643. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  3644. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3645. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  3646. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3647. + *
  3648. + * You should have received a copy of the GNU General Public License along
  3649. + * with this program; if not, write to the Free Software Foundation, Inc.,
  3650. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  3651. + */
  3652. +
  3653. +#include <linux/init.h>
  3654. +#include <linux/mm.h>
  3655. +#include <linux/sched.h>
  3656. +#include <linux/bootmem.h>
  3657. +#include <asm/addrspace.h>
  3658. +#include <asm/bootinfo.h>
  3659. +#include <linux/config.h>
  3660. +#include <linux/string.h>
  3661. +#include <linux/kernel.h>
  3662. +#include <linux/sched.h>
  3663. +
  3664. +int prom_argc;
  3665. +char **prom_argv, **prom_envp;
  3666. +extern void __init prom_init_cmdline(void);
  3667. +extern char *prom_getenv(char *envname);
  3668. +
  3669. +const char *get_system_type(void)
  3670. +{
  3671. + return "AMD Alchemy Au1200/Pb1200";
  3672. +}
  3673. +
  3674. +u32 mae_memsize = 0;
  3675. +
  3676. +int __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
  3677. +{
  3678. + unsigned char *memsize_str;
  3679. + unsigned long memsize;
  3680. +
  3681. + prom_argc = argc;
  3682. + prom_argv = argv;
  3683. + prom_envp = envp;
  3684. +
  3685. + mips_machgroup = MACH_GROUP_ALCHEMY;
  3686. + mips_machtype = MACH_PB1000; /* set the platform # */
  3687. + prom_init_cmdline();
  3688. +
  3689. + memsize_str = prom_getenv("memsize");
  3690. + if (!memsize_str) {
  3691. + memsize = 0x08000000;
  3692. + } else {
  3693. + memsize = simple_strtol(memsize_str, NULL, 0);
  3694. + }
  3695. + add_memory_region(0, memsize, BOOT_MEM_RAM);
  3696. + return 0;
  3697. +}
  3698. +
  3699. Index: linux-2.4.35.4/arch/mips/au1000/pb1200/irqmap.c
  3700. ===================================================================
  3701. --- /dev/null
  3702. +++ linux-2.4.35.4/arch/mips/au1000/pb1200/irqmap.c
  3703. @@ -0,0 +1,180 @@
  3704. +/*
  3705. + * BRIEF MODULE DESCRIPTION
  3706. + * Au1xxx irq map table
  3707. + *
  3708. + * This program is free software; you can redistribute it and/or modify it
  3709. + * under the terms of the GNU General Public License as published by the
  3710. + * Free Software Foundation; either version 2 of the License, or (at your
  3711. + * option) any later version.
  3712. + *
  3713. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  3714. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  3715. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  3716. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  3717. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  3718. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  3719. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  3720. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3721. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  3722. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3723. + *
  3724. + * You should have received a copy of the GNU General Public License along
  3725. + * with this program; if not, write to the Free Software Foundation, Inc.,
  3726. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  3727. + */
  3728. +#include <linux/errno.h>
  3729. +#include <linux/init.h>
  3730. +#include <linux/irq.h>
  3731. +#include <linux/kernel_stat.h>
  3732. +#include <linux/module.h>
  3733. +#include <linux/signal.h>
  3734. +#include <linux/sched.h>
  3735. +#include <linux/types.h>
  3736. +#include <linux/interrupt.h>
  3737. +#include <linux/ioport.h>
  3738. +#include <linux/timex.h>
  3739. +#include <linux/slab.h>
  3740. +#include <linux/random.h>
  3741. +#include <linux/delay.h>
  3742. +
  3743. +#include <asm/bitops.h>
  3744. +#include <asm/bootinfo.h>
  3745. +#include <asm/io.h>
  3746. +#include <asm/mipsregs.h>
  3747. +#include <asm/system.h>
  3748. +#include <asm/au1000.h>
  3749. +
  3750. +#ifdef CONFIG_MIPS_PB1200
  3751. +#include <asm/pb1200.h>
  3752. +#endif
  3753. +
  3754. +#ifdef CONFIG_MIPS_DB1200
  3755. +#include <asm/db1200.h>
  3756. +#define PB1200_INT_BEGIN DB1200_INT_BEGIN
  3757. +#define PB1200_INT_END DB1200_INT_END
  3758. +#endif
  3759. +
  3760. +au1xxx_irq_map_t au1xxx_irq_map[] = {
  3761. + { AU1000_GPIO_7, INTC_INT_LOW_LEVEL, 0 }, // This is exteranl interrupt cascade
  3762. +};
  3763. +
  3764. +int au1xxx_nr_irqs = sizeof(au1xxx_irq_map)/sizeof(au1xxx_irq_map_t);
  3765. +
  3766. +/*
  3767. + * Support for External interrupts on the PbAu1200 Development platform.
  3768. + */
  3769. +static volatile int pb1200_cascade_en=0;
  3770. +
  3771. +void pb1200_cascade_handler( int irq, void *dev_id, struct pt_regs *regs)
  3772. +{
  3773. + unsigned short bisr = bcsr->int_status;
  3774. + int extirq_nr = 0;
  3775. +
  3776. + /* Clear all the edge interrupts. This has no effect on level */
  3777. + bcsr->int_status = bisr;
  3778. + for( ; bisr; bisr &= (bisr-1) )
  3779. + {
  3780. + extirq_nr = (PB1200_INT_BEGIN-1) + au_ffs(bisr);
  3781. + /* Ack and dispatch IRQ */
  3782. + do_IRQ(extirq_nr,regs);
  3783. + }
  3784. +}
  3785. +
  3786. +inline void pb1200_enable_irq(unsigned int irq_nr)
  3787. +{
  3788. + bcsr->intset_mask = 1<<(irq_nr - PB1200_INT_BEGIN);
  3789. + bcsr->intset = 1<<(irq_nr - PB1200_INT_BEGIN);
  3790. +}
  3791. +
  3792. +inline void pb1200_disable_irq(unsigned int irq_nr)
  3793. +{
  3794. + bcsr->intclr_mask = 1<<(irq_nr - PB1200_INT_BEGIN);
  3795. + bcsr->intclr = 1<<(irq_nr - PB1200_INT_BEGIN);
  3796. +}
  3797. +
  3798. +static unsigned int pb1200_startup_irq( unsigned int irq_nr )
  3799. +{
  3800. + if (++pb1200_cascade_en == 1)
  3801. + {
  3802. + request_irq(AU1000_GPIO_7, &pb1200_cascade_handler,
  3803. + 0, "Pb1200 Cascade", &pb1200_cascade_handler );
  3804. +#ifdef CONFIG_MIPS_PB1200
  3805. + /* We have a problem with CPLD rev3. Enable a workaround */
  3806. + if( ((bcsr->whoami & BCSR_WHOAMI_CPLD)>>4) <= 3)
  3807. + {
  3808. + printk("\nWARNING!!!\n");
  3809. + printk("\nWARNING!!!\n");
  3810. + printk("\nWARNING!!!\n");
  3811. + printk("\nWARNING!!!\n");
  3812. + printk("\nWARNING!!!\n");
  3813. + printk("\nWARNING!!!\n");
  3814. + printk("Pb1200 must be at CPLD rev4. Please have Pb1200\n");
  3815. + printk("updated to latest revision. This software will not\n");
  3816. + printk("work on anything less than CPLD rev4\n");
  3817. + printk("\nWARNING!!!\n");
  3818. + printk("\nWARNING!!!\n");
  3819. + printk("\nWARNING!!!\n");
  3820. + printk("\nWARNING!!!\n");
  3821. + printk("\nWARNING!!!\n");
  3822. + printk("\nWARNING!!!\n");
  3823. + while(1);
  3824. + }
  3825. +#endif
  3826. + }
  3827. + pb1200_enable_irq(irq_nr);
  3828. + return 0;
  3829. +}
  3830. +
  3831. +static void pb1200_shutdown_irq( unsigned int irq_nr )
  3832. +{
  3833. + pb1200_disable_irq(irq_nr);
  3834. + if (--pb1200_cascade_en == 0)
  3835. + {
  3836. + free_irq(AU1000_GPIO_7,&pb1200_cascade_handler );
  3837. + }
  3838. + return;
  3839. +}
  3840. +
  3841. +static inline void pb1200_mask_and_ack_irq(unsigned int irq_nr)
  3842. +{
  3843. + pb1200_disable_irq( irq_nr );
  3844. +}
  3845. +
  3846. +static void pb1200_end_irq(unsigned int irq_nr)
  3847. +{
  3848. + if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))) {
  3849. + pb1200_enable_irq(irq_nr);
  3850. + }
  3851. +}
  3852. +
  3853. +static struct hw_interrupt_type external_irq_type =
  3854. +{
  3855. +#ifdef CONFIG_MIPS_PB1200
  3856. + "Pb1200 Ext",
  3857. +#endif
  3858. +#ifdef CONFIG_MIPS_DB1200
  3859. + "Db1200 Ext",
  3860. +#endif
  3861. + pb1200_startup_irq,
  3862. + pb1200_shutdown_irq,
  3863. + pb1200_enable_irq,
  3864. + pb1200_disable_irq,
  3865. + pb1200_mask_and_ack_irq,
  3866. + pb1200_end_irq,
  3867. + NULL
  3868. +};
  3869. +
  3870. +void _board_init_irq(void)
  3871. +{
  3872. + int irq_nr;
  3873. +
  3874. + for (irq_nr = PB1200_INT_BEGIN; irq_nr <= PB1200_INT_END; irq_nr++)
  3875. + {
  3876. + irq_desc[irq_nr].handler = &external_irq_type;
  3877. + pb1200_disable_irq(irq_nr);
  3878. + }
  3879. +
  3880. + /* GPIO_7 can not be hooked here, so it is hooked upon first
  3881. + request of any source attached to the cascade */
  3882. +}
  3883. +
  3884. Index: linux-2.4.35.4/arch/mips/au1000/pb1200/Makefile
  3885. ===================================================================
  3886. --- /dev/null
  3887. +++ linux-2.4.35.4/arch/mips/au1000/pb1200/Makefile
  3888. @@ -0,0 +1,25 @@
  3889. +#
  3890. +# Copyright 2000 MontaVista Software Inc.
  3891. +# Author: MontaVista Software, Inc.
  3892. +# [email protected] or [email protected]
  3893. +#
  3894. +# Makefile for the Alchemy Semiconductor PB1000 board.
  3895. +#
  3896. +# Note! Dependencies are done automagically by 'make dep', which also
  3897. +# removes any old dependencies. DON'T put your own dependencies here
  3898. +# unless it's something special (ie not a .c file).
  3899. +#
  3900. +
  3901. +USE_STANDARD_AS_RULE := true
  3902. +
  3903. +O_TARGET := pb1200.o
  3904. +
  3905. +obj-y := init.o board_setup.o irqmap.o
  3906. +
  3907. +ifdef CONFIG_MMC
  3908. +obj-y += mmc_support.o
  3909. +export-objs +=mmc_support.o
  3910. +endif
  3911. +
  3912. +
  3913. +include $(TOPDIR)/Rules.make
  3914. Index: linux-2.4.35.4/arch/mips/au1000/pb1200/mmc_support.c
  3915. ===================================================================
  3916. --- /dev/null
  3917. +++ linux-2.4.35.4/arch/mips/au1000/pb1200/mmc_support.c
  3918. @@ -0,0 +1,141 @@
  3919. +/*
  3920. + * BRIEF MODULE DESCRIPTION
  3921. + *
  3922. + * MMC support routines for PB1200.
  3923. + *
  3924. + *
  3925. + * Copyright (c) 2003-2004 Embedded Edge, LLC.
  3926. + * Author: Embedded Edge, LLC.
  3927. + * Contact: [email protected]
  3928. + *
  3929. + * This program is free software; you can redistribute it and/or modify it
  3930. + * under the terms of the GNU General Public License as published by the
  3931. + * Free Software Foundation; either version 2 of the License, or (at your
  3932. + * option) any later version.
  3933. + *
  3934. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  3935. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  3936. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  3937. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  3938. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  3939. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  3940. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  3941. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3942. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  3943. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3944. + *
  3945. + * You should have received a copy of the GNU General Public License along
  3946. + * with this program; if not, write to the Free Software Foundation, Inc.,
  3947. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  3948. + *
  3949. + */
  3950. +
  3951. +
  3952. +#include <linux/config.h>
  3953. +#include <linux/kernel.h>
  3954. +#include <linux/module.h>
  3955. +#include <linux/init.h>
  3956. +
  3957. +#include <asm/irq.h>
  3958. +#include <asm/au1000.h>
  3959. +#include <asm/au1100_mmc.h>
  3960. +
  3961. +#ifdef CONFIG_MIPS_PB1200
  3962. +#include <asm/pb1200.h>
  3963. +#endif
  3964. +
  3965. +#ifdef CONFIG_MIPS_DB1200
  3966. +/* NOTE: DB1200 only has SD0 pinned out and usable */
  3967. +#include <asm/db1200.h>
  3968. +#endif
  3969. +
  3970. +/* SD/MMC controller support functions */
  3971. +
  3972. +/*
  3973. + * Detect card.
  3974. + */
  3975. +void mmc_card_inserted(int socket, int *result)
  3976. +{
  3977. + u16 mask;
  3978. +
  3979. + if (socket)
  3980. +#ifdef CONFIG_MIPS_DB1200
  3981. + mask = 0;
  3982. +#else
  3983. + mask = BCSR_INT_SD1INSERT;
  3984. +#endif
  3985. + else
  3986. + mask = BCSR_INT_SD0INSERT;
  3987. +
  3988. + *result = ((bcsr->sig_status & mask) != 0);
  3989. +}
  3990. +
  3991. +/*
  3992. + * Check card write protection.
  3993. + */
  3994. +void mmc_card_writable(int socket, int *result)
  3995. +{
  3996. + u16 mask;
  3997. +
  3998. + if (socket)
  3999. +#ifdef CONFIG_MIPS_DB1200
  4000. + mask = 0;
  4001. +#else
  4002. + mask = BCSR_STATUS_SD1WP;
  4003. +#endif
  4004. + else
  4005. + mask = BCSR_STATUS_SD0WP;
  4006. +
  4007. + /* low means card writable */
  4008. + if (!(bcsr->status & mask)) {
  4009. + *result = 1;
  4010. + } else {
  4011. + *result = 0;
  4012. + }
  4013. +}
  4014. +
  4015. +/*
  4016. + * Apply power to card slot.
  4017. + */
  4018. +void mmc_power_on(int socket)
  4019. +{
  4020. + u16 mask;
  4021. +
  4022. + if (socket)
  4023. +#ifdef CONFIG_MIPS_DB1200
  4024. + mask = 0;
  4025. +#else
  4026. + mask = BCSR_BOARD_SD1PWR;
  4027. +#endif
  4028. + else
  4029. + mask = BCSR_BOARD_SD0PWR;
  4030. +
  4031. + bcsr->board |= mask;
  4032. + au_sync_delay(1);
  4033. +}
  4034. +
  4035. +/*
  4036. + * Remove power from card slot.
  4037. + */
  4038. +void mmc_power_off(int socket)
  4039. +{
  4040. + u16 mask;
  4041. +
  4042. + if (socket)
  4043. +#ifdef CONFIG_MIPS_DB1200
  4044. + mask = 0;
  4045. +#else
  4046. + mask = BCSR_BOARD_SD1PWR;
  4047. +#endif
  4048. + else
  4049. + mask = BCSR_BOARD_SD0PWR;
  4050. +
  4051. + bcsr->board &= ~mask;
  4052. + au_sync_delay(1);
  4053. +}
  4054. +
  4055. +EXPORT_SYMBOL(mmc_card_inserted);
  4056. +EXPORT_SYMBOL(mmc_card_writable);
  4057. +EXPORT_SYMBOL(mmc_power_on);
  4058. +EXPORT_SYMBOL(mmc_power_off);
  4059. +
  4060. Index: linux-2.4.35.4/arch/mips/au1000/pb1500/board_setup.c
  4061. ===================================================================
  4062. --- linux-2.4.35.4.orig/arch/mips/au1000/pb1500/board_setup.c
  4063. +++ linux-2.4.35.4/arch/mips/au1000/pb1500/board_setup.c
  4064. @@ -62,6 +62,10 @@ void board_reset (void)
  4065. au_writel(0x00000000, 0xAE00001C);
  4066. }
  4067. +void board_power_off (void)
  4068. +{
  4069. +}
  4070. +
  4071. void __init board_setup(void)
  4072. {
  4073. u32 pin_func;
  4074. Index: linux-2.4.35.4/arch/mips/au1000/pb1550/board_setup.c
  4075. ===================================================================
  4076. --- linux-2.4.35.4.orig/arch/mips/au1000/pb1550/board_setup.c
  4077. +++ linux-2.4.35.4/arch/mips/au1000/pb1550/board_setup.c
  4078. @@ -48,12 +48,31 @@
  4079. extern struct rtc_ops no_rtc_ops;
  4080. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
  4081. +extern struct ide_ops *ide_ops;
  4082. +extern struct ide_ops au1xxx_ide_ops;
  4083. +extern u32 au1xxx_ide_virtbase;
  4084. +extern u64 au1xxx_ide_physbase;
  4085. +extern unsigned int au1xxx_ide_irq;
  4086. +
  4087. +u32 au1xxx_ide_ddma_enable = 0, switch4ddma = 1; // PIO+ddma
  4088. +#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX */
  4089. +
  4090. void board_reset (void)
  4091. {
  4092. /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
  4093. au_writew(au_readw(0xAF00001C) & ~(1<<15), 0xAF00001C);
  4094. }
  4095. +void board_power_off (void)
  4096. +{
  4097. + /* power off system */
  4098. + printk("\n** Powering off Pb1550\n");
  4099. + au_writew(au_readw(0xAF00001C) | (3<<14), 0xAF00001C);
  4100. + au_sync();
  4101. + while(1); /* should not get here */
  4102. +}
  4103. +
  4104. void __init board_setup(void)
  4105. {
  4106. u32 pin_func;
  4107. @@ -78,5 +97,36 @@ void __init board_setup(void)
  4108. au_writel(0, (u32)bcsr|0x10); /* turn off pcmcia power */
  4109. au_sync();
  4110. +#if defined(CONFIG_AU1XXX_SMC91111)
  4111. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
  4112. +#error "Resource conflict occured. Disable either Ethernet or IDE daughter card."
  4113. +#else
  4114. +#define CPLD_CONTROL (0xAF00000C)
  4115. + {
  4116. + /* set up the Static Bus timing */
  4117. + /* only 396Mhz */
  4118. + /* reset the DC */
  4119. + au_writew(au_readw(CPLD_CONTROL) | 0x0f, CPLD_CONTROL);
  4120. + au_writel(0x00010003, MEM_STCFG0);
  4121. + au_writel(0x000c00c0, MEM_STCFG2);
  4122. + au_writel(0x85E1900D, MEM_STTIME2);
  4123. + }
  4124. +#endif
  4125. +#endif /* end CONFIG_SMC91111 */
  4126. +
  4127. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
  4128. + /*
  4129. + * Iniz IDE parameters
  4130. + */
  4131. + ide_ops = &au1xxx_ide_ops;
  4132. + au1xxx_ide_irq = DAUGHTER_CARD_IRQ;;
  4133. + au1xxx_ide_physbase = AU1XXX_ATA_PHYS_ADDR;
  4134. + au1xxx_ide_virtbase = KSEG1ADDR(AU1XXX_ATA_PHYS_ADDR);
  4135. + /*
  4136. + * change PIO or PIO+Ddma
  4137. + * check the GPIO-6 pin condition. pb1550:s15_dot
  4138. + */
  4139. + switch4ddma = (au_readl(SYS_PINSTATERD) & (1 << 6)) ? 1 : 0;
  4140. +#endif
  4141. printk("AMD Alchemy Pb1550 Board\n");
  4142. }
  4143. Index: linux-2.4.35.4/arch/mips/au1000/pb1550/irqmap.c
  4144. ===================================================================
  4145. --- linux-2.4.35.4.orig/arch/mips/au1000/pb1550/irqmap.c
  4146. +++ linux-2.4.35.4/arch/mips/au1000/pb1550/irqmap.c
  4147. @@ -50,6 +50,9 @@
  4148. au1xxx_irq_map_t au1xxx_irq_map[] = {
  4149. { AU1000_GPIO_0, INTC_INT_LOW_LEVEL, 0 },
  4150. { AU1000_GPIO_1, INTC_INT_LOW_LEVEL, 0 },
  4151. +#ifdef CONFIG_AU1XXX_SMC91111
  4152. + { AU1000_GPIO_3, INTC_INT_LOW_LEVEL, 0 },
  4153. +#endif
  4154. };
  4155. int au1xxx_nr_irqs = sizeof(au1xxx_irq_map)/sizeof(au1xxx_irq_map_t);
  4156. Index: linux-2.4.35.4/arch/mips/config-shared.in
  4157. ===================================================================
  4158. --- linux-2.4.35.4.orig/arch/mips/config-shared.in
  4159. +++ linux-2.4.35.4/arch/mips/config-shared.in
  4160. @@ -21,16 +21,19 @@ mainmenu_option next_comment
  4161. comment 'Machine selection'
  4162. dep_bool 'Support for Acer PICA 1 chipset (EXPERIMENTAL)' CONFIG_ACER_PICA_61 $CONFIG_EXPERIMENTAL
  4163. dep_bool 'Support for Alchemy Bosporus board' CONFIG_MIPS_BOSPORUS $CONFIG_MIPS32
  4164. +dep_bool 'Support for FIC Multimedia Player board' CONFIG_MIPS_FICMMP $CONFIG_MIPS32
  4165. dep_bool 'Support for Alchemy Mirage board' CONFIG_MIPS_MIRAGE $CONFIG_MIPS32
  4166. dep_bool 'Support for Alchemy Db1000 board' CONFIG_MIPS_DB1000 $CONFIG_MIPS32
  4167. dep_bool 'Support for Alchemy Db1100 board' CONFIG_MIPS_DB1100 $CONFIG_MIPS32
  4168. dep_bool 'Support for Alchemy Db1500 board' CONFIG_MIPS_DB1500 $CONFIG_MIPS32
  4169. dep_bool 'Support for Alchemy Db1550 board' CONFIG_MIPS_DB1550 $CONFIG_MIPS32
  4170. +dep_bool 'Support for Alchemy Db1200 board' CONFIG_MIPS_DB1200 $CONFIG_MIPS32
  4171. dep_bool 'Support for Alchemy PB1000 board' CONFIG_MIPS_PB1000 $CONFIG_MIPS32
  4172. dep_bool 'Support for Alchemy PB1100 board' CONFIG_MIPS_PB1100 $CONFIG_MIPS32
  4173. dep_bool 'Support for Alchemy PB1500 board' CONFIG_MIPS_PB1500 $CONFIG_MIPS32
  4174. -dep_bool 'Support for Alchemy Hydrogen3 board' CONFIG_MIPS_HYDROGEN3 $CONFIG_MIPS32
  4175. dep_bool 'Support for Alchemy PB1550 board' CONFIG_MIPS_PB1550 $CONFIG_MIPS32
  4176. +dep_bool 'Support for Alchemy PB1200 board' CONFIG_MIPS_PB1200 $CONFIG_MIPS32
  4177. +dep_bool 'Support for Alchemy Hydrogen3 board' CONFIG_MIPS_HYDROGEN3 $CONFIG_MIPS32
  4178. dep_bool 'Support for MyCable XXS1500 board' CONFIG_MIPS_XXS1500 $CONFIG_MIPS32
  4179. dep_bool 'Support for 4G Systems MTX-1 board' CONFIG_MIPS_MTX1 $CONFIG_MIPS32
  4180. dep_bool 'Support for Cogent CSB250 board' CONFIG_COGENT_CSB250 $CONFIG_MIPS32
  4181. @@ -249,6 +252,12 @@ if [ "$CONFIG_MIPS_MIRAGE" = "y" ]; then
  4182. define_bool CONFIG_PC_KEYB y
  4183. define_bool CONFIG_NONCOHERENT_IO y
  4184. fi
  4185. +if [ "$CONFIG_MIPS_FICMMP" = "y" ]; then
  4186. + define_bool CONFIG_SOC_AU1X00 y
  4187. + define_bool CONFIG_SOC_AU1200 y
  4188. + define_bool CONFIG_NONCOHERENT_IO y
  4189. + define_bool CONFIG_PC_KEYB y
  4190. +fi
  4191. if [ "$CONFIG_MIPS_BOSPORUS" = "y" ]; then
  4192. define_bool CONFIG_SOC_AU1X00 y
  4193. define_bool CONFIG_SOC_AU1500 y
  4194. @@ -263,6 +272,12 @@ if [ "$CONFIG_MIPS_PB1000" = "y" ]; then
  4195. define_bool CONFIG_SWAP_IO_SPACE_W y
  4196. define_bool CONFIG_SWAP_IO_SPACE_L y
  4197. fi
  4198. +if [ "$CONFIG_MIPS_PB1500" = "y" ]; then
  4199. + define_bool CONFIG_SOC_AU1X00 y
  4200. + define_bool CONFIG_SOC_AU1500 y
  4201. + define_bool CONFIG_NONCOHERENT_IO y
  4202. + define_bool CONFIG_PC_KEYB y
  4203. +fi
  4204. if [ "$CONFIG_MIPS_PB1100" = "y" ]; then
  4205. define_bool CONFIG_SOC_AU1X00 y
  4206. define_bool CONFIG_SOC_AU1100 y
  4207. @@ -271,9 +286,15 @@ if [ "$CONFIG_MIPS_PB1100" = "y" ]; then
  4208. define_bool CONFIG_SWAP_IO_SPACE_W y
  4209. define_bool CONFIG_SWAP_IO_SPACE_L y
  4210. fi
  4211. -if [ "$CONFIG_MIPS_PB1500" = "y" ]; then
  4212. +if [ "$CONFIG_MIPS_PB1550" = "y" ]; then
  4213. define_bool CONFIG_SOC_AU1X00 y
  4214. - define_bool CONFIG_SOC_AU1500 y
  4215. + define_bool CONFIG_SOC_AU1550 y
  4216. + define_bool CONFIG_NONCOHERENT_IO n
  4217. + define_bool CONFIG_PC_KEYB y
  4218. +fi
  4219. +if [ "$CONFIG_MIPS_PB1200" = "y" ]; then
  4220. + define_bool CONFIG_SOC_AU1X00 y
  4221. + define_bool CONFIG_SOC_AU1200 y
  4222. define_bool CONFIG_NONCOHERENT_IO y
  4223. define_bool CONFIG_PC_KEYB y
  4224. fi
  4225. @@ -290,18 +311,24 @@ if [ "$CONFIG_MIPS_DB1500" = "y" ]; then
  4226. define_bool CONFIG_NONCOHERENT_IO y
  4227. define_bool CONFIG_PC_KEYB y
  4228. fi
  4229. +if [ "$CONFIG_MIPS_DB1100" = "y" ]; then
  4230. + define_bool CONFIG_SOC_AU1X00 y
  4231. + define_bool CONFIG_SOC_AU1100 y
  4232. + define_bool CONFIG_NONCOHERENT_IO y
  4233. + define_bool CONFIG_PC_KEYB y
  4234. + define_bool CONFIG_SWAP_IO_SPACE y
  4235. +fi
  4236. if [ "$CONFIG_MIPS_DB1550" = "y" ]; then
  4237. define_bool CONFIG_SOC_AU1X00 y
  4238. define_bool CONFIG_SOC_AU1550 y
  4239. define_bool CONFIG_NONCOHERENT_IO y
  4240. define_bool CONFIG_PC_KEYB y
  4241. fi
  4242. -if [ "$CONFIG_MIPS_DB1100" = "y" ]; then
  4243. +if [ "$CONFIG_MIPS_DB1200" = "y" ]; then
  4244. define_bool CONFIG_SOC_AU1X00 y
  4245. - define_bool CONFIG_SOC_AU1100 y
  4246. + define_bool CONFIG_SOC_AU1200 y
  4247. define_bool CONFIG_NONCOHERENT_IO y
  4248. define_bool CONFIG_PC_KEYB y
  4249. - define_bool CONFIG_SWAP_IO_SPACE y
  4250. fi
  4251. if [ "$CONFIG_MIPS_HYDROGEN3" = "y" ]; then
  4252. define_bool CONFIG_SOC_AU1X00 y
  4253. @@ -327,12 +354,6 @@ if [ "$CONFIG_COGENT_CSB250" = "y" ]; th
  4254. define_bool CONFIG_NONCOHERENT_IO y
  4255. define_bool CONFIG_PC_KEYB y
  4256. fi
  4257. -if [ "$CONFIG_MIPS_PB1550" = "y" ]; then
  4258. - define_bool CONFIG_SOC_AU1X00 y
  4259. - define_bool CONFIG_SOC_AU1550 y
  4260. - define_bool CONFIG_NONCOHERENT_IO n
  4261. - define_bool CONFIG_PC_KEYB y
  4262. -fi
  4263. if [ "$CONFIG_MIPS_COBALT" = "y" ]; then
  4264. define_bool CONFIG_BOOT_ELF32 y
  4265. define_bool CONFIG_COBALT_LCD y
  4266. @@ -729,6 +750,13 @@ if [ "$CONFIG_ACER_PICA_61" = "y" -o \
  4267. "$CONFIG_MIPS_PB1000" = "y" -o \
  4268. "$CONFIG_MIPS_PB1100" = "y" -o \
  4269. "$CONFIG_MIPS_PB1500" = "y" -o \
  4270. + "$CONFIG_MIPS_PB1550" = "y" -o \
  4271. + "$CONFIG_MIPS_PB1200" = "y" -o \
  4272. + "$CONFIG_MIPS_DB1000" = "y" -o \
  4273. + "$CONFIG_MIPS_DB1100" = "y" -o \
  4274. + "$CONFIG_MIPS_DB1500" = "y" -o \
  4275. + "$CONFIG_MIPS_DB1550" = "y" -o \
  4276. + "$CONFIG_MIPS_DB1200" = "y" -o \
  4277. "$CONFIG_NEC_OSPREY" = "y" -o \
  4278. "$CONFIG_NEC_EAGLE" = "y" -o \
  4279. "$CONFIG_NINO" = "y" -o \
  4280. Index: linux-2.4.35.4/arch/mips/defconfig
  4281. ===================================================================
  4282. --- linux-2.4.35.4.orig/arch/mips/defconfig
  4283. +++ linux-2.4.35.4/arch/mips/defconfig
  4284. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  4285. # CONFIG_MIPS_PB1000 is not set
  4286. # CONFIG_MIPS_PB1100 is not set
  4287. # CONFIG_MIPS_PB1500 is not set
  4288. -# CONFIG_MIPS_HYDROGEN3 is not set
  4289. # CONFIG_MIPS_PB1550 is not set
  4290. +# CONFIG_MIPS_HYDROGEN3 is not set
  4291. # CONFIG_MIPS_XXS1500 is not set
  4292. # CONFIG_MIPS_MTX1 is not set
  4293. # CONFIG_COGENT_CSB250 is not set
  4294. @@ -235,11 +235,6 @@ CONFIG_IP_PNP_BOOTP=y
  4295. #
  4296. # CONFIG_IPX is not set
  4297. # CONFIG_ATALK is not set
  4298. -
  4299. -#
  4300. -# Appletalk devices
  4301. -#
  4302. -# CONFIG_DEV_APPLETALK is not set
  4303. # CONFIG_DECNET is not set
  4304. # CONFIG_BRIDGE is not set
  4305. # CONFIG_X25 is not set
  4306. @@ -319,9 +314,11 @@ CONFIG_SGIWD93_SCSI=y
  4307. # CONFIG_SCSI_MEGARAID is not set
  4308. # CONFIG_SCSI_MEGARAID2 is not set
  4309. # CONFIG_SCSI_SATA is not set
  4310. +# CONFIG_SCSI_SATA_AHCI is not set
  4311. # CONFIG_SCSI_SATA_SVW is not set
  4312. # CONFIG_SCSI_ATA_PIIX is not set
  4313. # CONFIG_SCSI_SATA_NV is not set
  4314. +# CONFIG_SCSI_SATA_QSTOR is not set
  4315. # CONFIG_SCSI_SATA_PROMISE is not set
  4316. # CONFIG_SCSI_SATA_SX4 is not set
  4317. # CONFIG_SCSI_SATA_SIL is not set
  4318. @@ -465,7 +462,6 @@ CONFIG_VT_CONSOLE=y
  4319. # CONFIG_SERIAL is not set
  4320. # CONFIG_SERIAL_EXTENDED is not set
  4321. # CONFIG_SERIAL_NONSTANDARD is not set
  4322. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  4323. CONFIG_UNIX98_PTYS=y
  4324. CONFIG_UNIX98_PTY_COUNT=256
  4325. Index: linux-2.4.35.4/arch/mips/defconfig-atlas
  4326. ===================================================================
  4327. --- linux-2.4.35.4.orig/arch/mips/defconfig-atlas
  4328. +++ linux-2.4.35.4/arch/mips/defconfig-atlas
  4329. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  4330. # CONFIG_MIPS_PB1000 is not set
  4331. # CONFIG_MIPS_PB1100 is not set
  4332. # CONFIG_MIPS_PB1500 is not set
  4333. -# CONFIG_MIPS_HYDROGEN3 is not set
  4334. # CONFIG_MIPS_PB1550 is not set
  4335. +# CONFIG_MIPS_HYDROGEN3 is not set
  4336. # CONFIG_MIPS_XXS1500 is not set
  4337. # CONFIG_MIPS_MTX1 is not set
  4338. # CONFIG_COGENT_CSB250 is not set
  4339. @@ -235,11 +235,6 @@ CONFIG_IP_PNP=y
  4340. #
  4341. # CONFIG_IPX is not set
  4342. # CONFIG_ATALK is not set
  4343. -
  4344. -#
  4345. -# Appletalk devices
  4346. -#
  4347. -# CONFIG_DEV_APPLETALK is not set
  4348. # CONFIG_DECNET is not set
  4349. # CONFIG_BRIDGE is not set
  4350. # CONFIG_X25 is not set
  4351. @@ -317,9 +312,11 @@ CONFIG_SD_EXTRA_DEVS=40
  4352. # CONFIG_SCSI_MEGARAID is not set
  4353. # CONFIG_SCSI_MEGARAID2 is not set
  4354. # CONFIG_SCSI_SATA is not set
  4355. +# CONFIG_SCSI_SATA_AHCI is not set
  4356. # CONFIG_SCSI_SATA_SVW is not set
  4357. # CONFIG_SCSI_ATA_PIIX is not set
  4358. # CONFIG_SCSI_SATA_NV is not set
  4359. +# CONFIG_SCSI_SATA_QSTOR is not set
  4360. # CONFIG_SCSI_SATA_PROMISE is not set
  4361. # CONFIG_SCSI_SATA_SX4 is not set
  4362. # CONFIG_SCSI_SATA_SIL is not set
  4363. @@ -528,7 +525,6 @@ CONFIG_SERIAL=y
  4364. CONFIG_SERIAL_CONSOLE=y
  4365. # CONFIG_SERIAL_EXTENDED is not set
  4366. # CONFIG_SERIAL_NONSTANDARD is not set
  4367. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  4368. CONFIG_UNIX98_PTYS=y
  4369. CONFIG_UNIX98_PTY_COUNT=256
  4370. Index: linux-2.4.35.4/arch/mips/defconfig-bosporus
  4371. ===================================================================
  4372. --- linux-2.4.35.4.orig/arch/mips/defconfig-bosporus
  4373. +++ linux-2.4.35.4/arch/mips/defconfig-bosporus
  4374. @@ -30,8 +30,8 @@ CONFIG_MIPS_BOSPORUS=y
  4375. # CONFIG_MIPS_PB1000 is not set
  4376. # CONFIG_MIPS_PB1100 is not set
  4377. # CONFIG_MIPS_PB1500 is not set
  4378. -# CONFIG_MIPS_HYDROGEN3 is not set
  4379. # CONFIG_MIPS_PB1550 is not set
  4380. +# CONFIG_MIPS_HYDROGEN3 is not set
  4381. # CONFIG_MIPS_XXS1500 is not set
  4382. # CONFIG_MIPS_MTX1 is not set
  4383. # CONFIG_COGENT_CSB250 is not set
  4384. @@ -208,9 +208,7 @@ CONFIG_MTD_CFI_AMDSTD=y
  4385. CONFIG_MTD_BOSPORUS=y
  4386. # CONFIG_MTD_XXS1500 is not set
  4387. # CONFIG_MTD_MTX1 is not set
  4388. -# CONFIG_MTD_DB1X00 is not set
  4389. # CONFIG_MTD_PB1550 is not set
  4390. -# CONFIG_MTD_HYDROGEN3 is not set
  4391. # CONFIG_MTD_MIRAGE is not set
  4392. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  4393. # CONFIG_MTD_OCELOT is not set
  4394. @@ -229,7 +227,6 @@ CONFIG_MTD_BOSPORUS=y
  4395. #
  4396. # Disk-On-Chip Device Drivers
  4397. #
  4398. -# CONFIG_MTD_DOC1000 is not set
  4399. # CONFIG_MTD_DOC2000 is not set
  4400. # CONFIG_MTD_DOC2001 is not set
  4401. # CONFIG_MTD_DOCPROBE is not set
  4402. @@ -373,11 +370,6 @@ CONFIG_IP_NF_MANGLE=m
  4403. #
  4404. # CONFIG_IPX is not set
  4405. # CONFIG_ATALK is not set
  4406. -
  4407. -#
  4408. -# Appletalk devices
  4409. -#
  4410. -# CONFIG_DEV_APPLETALK is not set
  4411. # CONFIG_DECNET is not set
  4412. # CONFIG_BRIDGE is not set
  4413. # CONFIG_X25 is not set
  4414. @@ -457,9 +449,11 @@ CONFIG_SCSI_CONSTANTS=y
  4415. # CONFIG_SCSI_MEGARAID is not set
  4416. # CONFIG_SCSI_MEGARAID2 is not set
  4417. # CONFIG_SCSI_SATA is not set
  4418. +# CONFIG_SCSI_SATA_AHCI is not set
  4419. # CONFIG_SCSI_SATA_SVW is not set
  4420. # CONFIG_SCSI_ATA_PIIX is not set
  4421. # CONFIG_SCSI_SATA_NV is not set
  4422. +# CONFIG_SCSI_SATA_QSTOR is not set
  4423. # CONFIG_SCSI_SATA_PROMISE is not set
  4424. # CONFIG_SCSI_SATA_SX4 is not set
  4425. # CONFIG_SCSI_SATA_SIL is not set
  4426. @@ -681,7 +675,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  4427. # CONFIG_AU1X00_USB_TTY is not set
  4428. # CONFIG_AU1X00_USB_RAW is not set
  4429. # CONFIG_TXX927_SERIAL is not set
  4430. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  4431. CONFIG_UNIX98_PTYS=y
  4432. CONFIG_UNIX98_PTY_COUNT=256
  4433. Index: linux-2.4.35.4/arch/mips/defconfig-capcella
  4434. ===================================================================
  4435. --- linux-2.4.35.4.orig/arch/mips/defconfig-capcella
  4436. +++ linux-2.4.35.4/arch/mips/defconfig-capcella
  4437. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  4438. # CONFIG_MIPS_PB1000 is not set
  4439. # CONFIG_MIPS_PB1100 is not set
  4440. # CONFIG_MIPS_PB1500 is not set
  4441. -# CONFIG_MIPS_HYDROGEN3 is not set
  4442. # CONFIG_MIPS_PB1550 is not set
  4443. +# CONFIG_MIPS_HYDROGEN3 is not set
  4444. # CONFIG_MIPS_XXS1500 is not set
  4445. # CONFIG_MIPS_MTX1 is not set
  4446. # CONFIG_COGENT_CSB250 is not set
  4447. @@ -228,11 +228,6 @@ CONFIG_IP_PNP_BOOTP=y
  4448. #
  4449. # CONFIG_IPX is not set
  4450. # CONFIG_ATALK is not set
  4451. -
  4452. -#
  4453. -# Appletalk devices
  4454. -#
  4455. -# CONFIG_DEV_APPLETALK is not set
  4456. # CONFIG_DECNET is not set
  4457. # CONFIG_BRIDGE is not set
  4458. # CONFIG_X25 is not set
  4459. @@ -472,7 +467,6 @@ CONFIG_SERIAL=y
  4460. CONFIG_SERIAL_CONSOLE=y
  4461. # CONFIG_SERIAL_EXTENDED is not set
  4462. # CONFIG_SERIAL_NONSTANDARD is not set
  4463. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  4464. # CONFIG_VR41XX_KIU is not set
  4465. CONFIG_UNIX98_PTYS=y
  4466. CONFIG_UNIX98_PTY_COUNT=256
  4467. Index: linux-2.4.35.4/arch/mips/defconfig-cobalt
  4468. ===================================================================
  4469. --- linux-2.4.35.4.orig/arch/mips/defconfig-cobalt
  4470. +++ linux-2.4.35.4/arch/mips/defconfig-cobalt
  4471. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  4472. # CONFIG_MIPS_PB1000 is not set
  4473. # CONFIG_MIPS_PB1100 is not set
  4474. # CONFIG_MIPS_PB1500 is not set
  4475. -# CONFIG_MIPS_HYDROGEN3 is not set
  4476. # CONFIG_MIPS_PB1550 is not set
  4477. +# CONFIG_MIPS_HYDROGEN3 is not set
  4478. # CONFIG_MIPS_XXS1500 is not set
  4479. # CONFIG_MIPS_MTX1 is not set
  4480. # CONFIG_COGENT_CSB250 is not set
  4481. @@ -222,11 +222,6 @@ CONFIG_INET=y
  4482. #
  4483. # CONFIG_IPX is not set
  4484. # CONFIG_ATALK is not set
  4485. -
  4486. -#
  4487. -# Appletalk devices
  4488. -#
  4489. -# CONFIG_DEV_APPLETALK is not set
  4490. # CONFIG_DECNET is not set
  4491. # CONFIG_BRIDGE is not set
  4492. # CONFIG_X25 is not set
  4493. @@ -505,7 +500,6 @@ CONFIG_SERIAL=y
  4494. CONFIG_SERIAL_CONSOLE=y
  4495. # CONFIG_SERIAL_EXTENDED is not set
  4496. # CONFIG_SERIAL_NONSTANDARD is not set
  4497. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  4498. CONFIG_UNIX98_PTYS=y
  4499. CONFIG_UNIX98_PTY_COUNT=16
  4500. Index: linux-2.4.35.4/arch/mips/defconfig-csb250
  4501. ===================================================================
  4502. --- linux-2.4.35.4.orig/arch/mips/defconfig-csb250
  4503. +++ linux-2.4.35.4/arch/mips/defconfig-csb250
  4504. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  4505. # CONFIG_MIPS_PB1000 is not set
  4506. # CONFIG_MIPS_PB1100 is not set
  4507. # CONFIG_MIPS_PB1500 is not set
  4508. -# CONFIG_MIPS_HYDROGEN3 is not set
  4509. # CONFIG_MIPS_PB1550 is not set
  4510. +# CONFIG_MIPS_HYDROGEN3 is not set
  4511. # CONFIG_MIPS_XXS1500 is not set
  4512. # CONFIG_MIPS_MTX1 is not set
  4513. CONFIG_COGENT_CSB250=y
  4514. @@ -268,11 +268,6 @@ CONFIG_IP_PNP_BOOTP=y
  4515. #
  4516. # CONFIG_IPX is not set
  4517. # CONFIG_ATALK is not set
  4518. -
  4519. -#
  4520. -# Appletalk devices
  4521. -#
  4522. -# CONFIG_DEV_APPLETALK is not set
  4523. # CONFIG_DECNET is not set
  4524. # CONFIG_BRIDGE is not set
  4525. # CONFIG_X25 is not set
  4526. @@ -556,7 +551,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  4527. # CONFIG_AU1X00_USB_TTY is not set
  4528. # CONFIG_AU1X00_USB_RAW is not set
  4529. # CONFIG_TXX927_SERIAL is not set
  4530. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  4531. CONFIG_UNIX98_PTYS=y
  4532. CONFIG_UNIX98_PTY_COUNT=256
  4533. Index: linux-2.4.35.4/arch/mips/defconfig-db1000
  4534. ===================================================================
  4535. --- linux-2.4.35.4.orig/arch/mips/defconfig-db1000
  4536. +++ linux-2.4.35.4/arch/mips/defconfig-db1000
  4537. @@ -30,8 +30,8 @@ CONFIG_MIPS_DB1000=y
  4538. # CONFIG_MIPS_PB1000 is not set
  4539. # CONFIG_MIPS_PB1100 is not set
  4540. # CONFIG_MIPS_PB1500 is not set
  4541. -# CONFIG_MIPS_HYDROGEN3 is not set
  4542. # CONFIG_MIPS_PB1550 is not set
  4543. +# CONFIG_MIPS_HYDROGEN3 is not set
  4544. # CONFIG_MIPS_XXS1500 is not set
  4545. # CONFIG_MIPS_MTX1 is not set
  4546. # CONFIG_COGENT_CSB250 is not set
  4547. @@ -214,11 +214,7 @@ CONFIG_MTD_CFI_AMDSTD=y
  4548. # CONFIG_MTD_BOSPORUS is not set
  4549. # CONFIG_MTD_XXS1500 is not set
  4550. # CONFIG_MTD_MTX1 is not set
  4551. -CONFIG_MTD_DB1X00=y
  4552. -CONFIG_MTD_DB1X00_BOOT=y
  4553. -CONFIG_MTD_DB1X00_USER=y
  4554. # CONFIG_MTD_PB1550 is not set
  4555. -# CONFIG_MTD_HYDROGEN3 is not set
  4556. # CONFIG_MTD_MIRAGE is not set
  4557. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  4558. # CONFIG_MTD_OCELOT is not set
  4559. @@ -237,7 +233,6 @@ CONFIG_MTD_DB1X00_USER=y
  4560. #
  4561. # Disk-On-Chip Device Drivers
  4562. #
  4563. -# CONFIG_MTD_DOC1000 is not set
  4564. # CONFIG_MTD_DOC2000 is not set
  4565. # CONFIG_MTD_DOC2001 is not set
  4566. # CONFIG_MTD_DOCPROBE is not set
  4567. @@ -342,11 +337,6 @@ CONFIG_IP_PNP_BOOTP=y
  4568. #
  4569. # CONFIG_IPX is not set
  4570. # CONFIG_ATALK is not set
  4571. -
  4572. -#
  4573. -# Appletalk devices
  4574. -#
  4575. -# CONFIG_DEV_APPLETALK is not set
  4576. # CONFIG_DECNET is not set
  4577. # CONFIG_BRIDGE is not set
  4578. # CONFIG_X25 is not set
  4579. @@ -636,7 +626,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  4580. # CONFIG_AU1X00_USB_TTY is not set
  4581. # CONFIG_AU1X00_USB_RAW is not set
  4582. # CONFIG_TXX927_SERIAL is not set
  4583. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  4584. CONFIG_UNIX98_PTYS=y
  4585. CONFIG_UNIX98_PTY_COUNT=256
  4586. Index: linux-2.4.35.4/arch/mips/defconfig-db1100
  4587. ===================================================================
  4588. --- linux-2.4.35.4.orig/arch/mips/defconfig-db1100
  4589. +++ linux-2.4.35.4/arch/mips/defconfig-db1100
  4590. @@ -30,8 +30,8 @@ CONFIG_MIPS_DB1100=y
  4591. # CONFIG_MIPS_PB1000 is not set
  4592. # CONFIG_MIPS_PB1100 is not set
  4593. # CONFIG_MIPS_PB1500 is not set
  4594. -# CONFIG_MIPS_HYDROGEN3 is not set
  4595. # CONFIG_MIPS_PB1550 is not set
  4596. +# CONFIG_MIPS_HYDROGEN3 is not set
  4597. # CONFIG_MIPS_XXS1500 is not set
  4598. # CONFIG_MIPS_MTX1 is not set
  4599. # CONFIG_COGENT_CSB250 is not set
  4600. @@ -214,11 +214,7 @@ CONFIG_MTD_CFI_AMDSTD=y
  4601. # CONFIG_MTD_BOSPORUS is not set
  4602. # CONFIG_MTD_XXS1500 is not set
  4603. # CONFIG_MTD_MTX1 is not set
  4604. -CONFIG_MTD_DB1X00=y
  4605. -# CONFIG_MTD_DB1X00_BOOT is not set
  4606. -CONFIG_MTD_DB1X00_USER=y
  4607. # CONFIG_MTD_PB1550 is not set
  4608. -# CONFIG_MTD_HYDROGEN3 is not set
  4609. # CONFIG_MTD_MIRAGE is not set
  4610. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  4611. # CONFIG_MTD_OCELOT is not set
  4612. @@ -237,7 +233,6 @@ CONFIG_MTD_DB1X00_USER=y
  4613. #
  4614. # Disk-On-Chip Device Drivers
  4615. #
  4616. -# CONFIG_MTD_DOC1000 is not set
  4617. # CONFIG_MTD_DOC2000 is not set
  4618. # CONFIG_MTD_DOC2001 is not set
  4619. # CONFIG_MTD_DOCPROBE is not set
  4620. @@ -342,11 +337,6 @@ CONFIG_IP_PNP_BOOTP=y
  4621. #
  4622. # CONFIG_IPX is not set
  4623. # CONFIG_ATALK is not set
  4624. -
  4625. -#
  4626. -# Appletalk devices
  4627. -#
  4628. -# CONFIG_DEV_APPLETALK is not set
  4629. # CONFIG_DECNET is not set
  4630. # CONFIG_BRIDGE is not set
  4631. # CONFIG_X25 is not set
  4632. @@ -636,7 +626,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  4633. # CONFIG_AU1X00_USB_TTY is not set
  4634. # CONFIG_AU1X00_USB_RAW is not set
  4635. # CONFIG_TXX927_SERIAL is not set
  4636. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  4637. CONFIG_UNIX98_PTYS=y
  4638. CONFIG_UNIX98_PTY_COUNT=256
  4639. @@ -884,6 +873,7 @@ CONFIG_DUMMY_CONSOLE=y
  4640. # CONFIG_FB_PM2 is not set
  4641. # CONFIG_FB_PM3 is not set
  4642. # CONFIG_FB_CYBER2000 is not set
  4643. +CONFIG_FB_AU1100=y
  4644. # CONFIG_FB_MATROX is not set
  4645. # CONFIG_FB_ATY is not set
  4646. # CONFIG_FB_RADEON is not set
  4647. @@ -895,7 +885,6 @@ CONFIG_DUMMY_CONSOLE=y
  4648. # CONFIG_FB_VOODOO1 is not set
  4649. # CONFIG_FB_TRIDENT is not set
  4650. # CONFIG_FB_E1356 is not set
  4651. -CONFIG_FB_AU1100=y
  4652. # CONFIG_FB_IT8181 is not set
  4653. # CONFIG_FB_VIRTUAL is not set
  4654. CONFIG_FBCON_ADVANCED=y
  4655. Index: linux-2.4.35.4/arch/mips/defconfig-db1200
  4656. ===================================================================
  4657. --- /dev/null
  4658. +++ linux-2.4.35.4/arch/mips/defconfig-db1200
  4659. @@ -0,0 +1,1032 @@
  4660. +#
  4661. +# Automatically generated make config: don't edit
  4662. +#
  4663. +CONFIG_MIPS=y
  4664. +CONFIG_MIPS32=y
  4665. +# CONFIG_MIPS64 is not set
  4666. +
  4667. +#
  4668. +# Code maturity level options
  4669. +#
  4670. +CONFIG_EXPERIMENTAL=y
  4671. +
  4672. +#
  4673. +# Loadable module support
  4674. +#
  4675. +CONFIG_MODULES=y
  4676. +# CONFIG_MODVERSIONS is not set
  4677. +CONFIG_KMOD=y
  4678. +
  4679. +#
  4680. +# Machine selection
  4681. +#
  4682. +# CONFIG_ACER_PICA_61 is not set
  4683. +# CONFIG_MIPS_BOSPORUS is not set
  4684. +# CONFIG_MIPS_MIRAGE is not set
  4685. +# CONFIG_MIPS_DB1000 is not set
  4686. +# CONFIG_MIPS_DB1100 is not set
  4687. +# CONFIG_MIPS_DB1500 is not set
  4688. +# CONFIG_MIPS_DB1550 is not set
  4689. +# CONFIG_MIPS_PB1000 is not set
  4690. +# CONFIG_MIPS_PB1100 is not set
  4691. +# CONFIG_MIPS_PB1500 is not set
  4692. +# CONFIG_MIPS_PB1550 is not set
  4693. +# CONFIG_MIPS_HYDROGEN3 is not set
  4694. +# CONFIG_MIPS_XXS1500 is not set
  4695. +# CONFIG_MIPS_MTX1 is not set
  4696. +# CONFIG_COGENT_CSB250 is not set
  4697. +# CONFIG_BAGET_MIPS is not set
  4698. +# CONFIG_CASIO_E55 is not set
  4699. +# CONFIG_MIPS_COBALT is not set
  4700. +# CONFIG_DECSTATION is not set
  4701. +# CONFIG_MIPS_EV64120 is not set
  4702. +# CONFIG_MIPS_EV96100 is not set
  4703. +# CONFIG_MIPS_IVR is not set
  4704. +# CONFIG_HP_LASERJET is not set
  4705. +# CONFIG_IBM_WORKPAD is not set
  4706. +# CONFIG_LASAT is not set
  4707. +# CONFIG_MIPS_ITE8172 is not set
  4708. +# CONFIG_MIPS_ATLAS is not set
  4709. +# CONFIG_MIPS_MAGNUM_4000 is not set
  4710. +# CONFIG_MIPS_MALTA is not set
  4711. +# CONFIG_MIPS_SEAD is not set
  4712. +# CONFIG_MOMENCO_OCELOT is not set
  4713. +# CONFIG_MOMENCO_OCELOT_G is not set
  4714. +# CONFIG_MOMENCO_OCELOT_C is not set
  4715. +# CONFIG_MOMENCO_JAGUAR_ATX is not set
  4716. +# CONFIG_PMC_BIG_SUR is not set
  4717. +# CONFIG_PMC_STRETCH is not set
  4718. +# CONFIG_PMC_YOSEMITE is not set
  4719. +# CONFIG_DDB5074 is not set
  4720. +# CONFIG_DDB5476 is not set
  4721. +# CONFIG_DDB5477 is not set
  4722. +# CONFIG_NEC_OSPREY is not set
  4723. +# CONFIG_NEC_EAGLE is not set
  4724. +# CONFIG_OLIVETTI_M700 is not set
  4725. +# CONFIG_NINO is not set
  4726. +# CONFIG_SGI_IP22 is not set
  4727. +# CONFIG_SGI_IP27 is not set
  4728. +# CONFIG_SIBYTE_SB1xxx_SOC is not set
  4729. +# CONFIG_SNI_RM200_PCI is not set
  4730. +# CONFIG_TANBAC_TB0226 is not set
  4731. +# CONFIG_TANBAC_TB0229 is not set
  4732. +# CONFIG_TOSHIBA_JMR3927 is not set
  4733. +# CONFIG_TOSHIBA_RBTX4927 is not set
  4734. +# CONFIG_VICTOR_MPC30X is not set
  4735. +# CONFIG_ZAO_CAPCELLA is not set
  4736. +# CONFIG_HIGHMEM is not set
  4737. +CONFIG_RWSEM_GENERIC_SPINLOCK=y
  4738. +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
  4739. +# CONFIG_MIPS_AU1000 is not set
  4740. +
  4741. +#
  4742. +# CPU selection
  4743. +#
  4744. +CONFIG_CPU_MIPS32=y
  4745. +# CONFIG_CPU_MIPS64 is not set
  4746. +# CONFIG_CPU_R3000 is not set
  4747. +# CONFIG_CPU_TX39XX is not set
  4748. +# CONFIG_CPU_VR41XX is not set
  4749. +# CONFIG_CPU_R4300 is not set
  4750. +# CONFIG_CPU_R4X00 is not set
  4751. +# CONFIG_CPU_TX49XX is not set
  4752. +# CONFIG_CPU_R5000 is not set
  4753. +# CONFIG_CPU_R5432 is not set
  4754. +# CONFIG_CPU_R6000 is not set
  4755. +# CONFIG_CPU_NEVADA is not set
  4756. +# CONFIG_CPU_R8000 is not set
  4757. +# CONFIG_CPU_R10000 is not set
  4758. +# CONFIG_CPU_RM7000 is not set
  4759. +# CONFIG_CPU_RM9000 is not set
  4760. +# CONFIG_CPU_SB1 is not set
  4761. +CONFIG_PAGE_SIZE_4KB=y
  4762. +# CONFIG_PAGE_SIZE_16KB is not set
  4763. +# CONFIG_PAGE_SIZE_64KB is not set
  4764. +CONFIG_CPU_HAS_PREFETCH=y
  4765. +# CONFIG_VTAG_ICACHE is not set
  4766. +CONFIG_64BIT_PHYS_ADDR=y
  4767. +# CONFIG_CPU_ADVANCED is not set
  4768. +CONFIG_CPU_HAS_LLSC=y
  4769. +# CONFIG_CPU_HAS_LLDSCD is not set
  4770. +# CONFIG_CPU_HAS_WB is not set
  4771. +CONFIG_CPU_HAS_SYNC=y
  4772. +
  4773. +#
  4774. +# General setup
  4775. +#
  4776. +CONFIG_CPU_LITTLE_ENDIAN=y
  4777. +# CONFIG_BUILD_ELF64 is not set
  4778. +CONFIG_NET=y
  4779. +CONFIG_PCI=y
  4780. +CONFIG_PCI_NEW=y
  4781. +CONFIG_PCI_AUTO=y
  4782. +# CONFIG_PCI_NAMES is not set
  4783. +# CONFIG_ISA is not set
  4784. +# CONFIG_TC is not set
  4785. +# CONFIG_MCA is not set
  4786. +# CONFIG_SBUS is not set
  4787. +CONFIG_HOTPLUG=y
  4788. +
  4789. +#
  4790. +# PCMCIA/CardBus support
  4791. +#
  4792. +CONFIG_PCMCIA=m
  4793. +# CONFIG_CARDBUS is not set
  4794. +# CONFIG_TCIC is not set
  4795. +# CONFIG_I82092 is not set
  4796. +# CONFIG_I82365 is not set
  4797. +
  4798. +#
  4799. +# PCI Hotplug Support
  4800. +#
  4801. +# CONFIG_HOTPLUG_PCI is not set
  4802. +# CONFIG_HOTPLUG_PCI_COMPAQ is not set
  4803. +# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
  4804. +# CONFIG_HOTPLUG_PCI_SHPC is not set
  4805. +# CONFIG_HOTPLUG_PCI_SHPC_POLL_EVENT_MODE is not set
  4806. +# CONFIG_HOTPLUG_PCI_PCIE is not set
  4807. +# CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE is not set
  4808. +CONFIG_SYSVIPC=y
  4809. +# CONFIG_BSD_PROCESS_ACCT is not set
  4810. +CONFIG_SYSCTL=y
  4811. +CONFIG_KCORE_ELF=y
  4812. +# CONFIG_KCORE_AOUT is not set
  4813. +# CONFIG_BINFMT_AOUT is not set
  4814. +CONFIG_BINFMT_ELF=y
  4815. +# CONFIG_MIPS32_COMPAT is not set
  4816. +# CONFIG_MIPS32_O32 is not set
  4817. +# CONFIG_MIPS32_N32 is not set
  4818. +# CONFIG_BINFMT_ELF32 is not set
  4819. +# CONFIG_BINFMT_MISC is not set
  4820. +# CONFIG_OOM_KILLER is not set
  4821. +CONFIG_CMDLINE_BOOL=y
  4822. +CONFIG_CMDLINE="mem=96M"
  4823. +
  4824. +#
  4825. +# Memory Technology Devices (MTD)
  4826. +#
  4827. +# CONFIG_MTD is not set
  4828. +
  4829. +#
  4830. +# Parallel port support
  4831. +#
  4832. +# CONFIG_PARPORT is not set
  4833. +
  4834. +#
  4835. +# Plug and Play configuration
  4836. +#
  4837. +# CONFIG_PNP is not set
  4838. +# CONFIG_ISAPNP is not set
  4839. +
  4840. +#
  4841. +# Block devices
  4842. +#
  4843. +# CONFIG_BLK_DEV_FD is not set
  4844. +# CONFIG_BLK_DEV_XD is not set
  4845. +# CONFIG_PARIDE is not set
  4846. +# CONFIG_BLK_CPQ_DA is not set
  4847. +# CONFIG_BLK_CPQ_CISS_DA is not set
  4848. +# CONFIG_CISS_SCSI_TAPE is not set
  4849. +# CONFIG_CISS_MONITOR_THREAD is not set
  4850. +# CONFIG_BLK_DEV_DAC960 is not set
  4851. +# CONFIG_BLK_DEV_UMEM is not set
  4852. +# CONFIG_BLK_DEV_SX8 is not set
  4853. +CONFIG_BLK_DEV_LOOP=y
  4854. +# CONFIG_BLK_DEV_NBD is not set
  4855. +# CONFIG_BLK_DEV_RAM is not set
  4856. +# CONFIG_BLK_DEV_INITRD is not set
  4857. +# CONFIG_BLK_STATS is not set
  4858. +
  4859. +#
  4860. +# Multi-device support (RAID and LVM)
  4861. +#
  4862. +# CONFIG_MD is not set
  4863. +# CONFIG_BLK_DEV_MD is not set
  4864. +# CONFIG_MD_LINEAR is not set
  4865. +# CONFIG_MD_RAID0 is not set
  4866. +# CONFIG_MD_RAID1 is not set
  4867. +# CONFIG_MD_RAID5 is not set
  4868. +# CONFIG_MD_MULTIPATH is not set
  4869. +# CONFIG_BLK_DEV_LVM is not set
  4870. +
  4871. +#
  4872. +# Networking options
  4873. +#
  4874. +CONFIG_PACKET=y
  4875. +# CONFIG_PACKET_MMAP is not set
  4876. +# CONFIG_NETLINK_DEV is not set
  4877. +CONFIG_NETFILTER=y
  4878. +# CONFIG_NETFILTER_DEBUG is not set
  4879. +CONFIG_FILTER=y
  4880. +CONFIG_UNIX=y
  4881. +CONFIG_INET=y
  4882. +CONFIG_IP_MULTICAST=y
  4883. +# CONFIG_IP_ADVANCED_ROUTER is not set
  4884. +CONFIG_IP_PNP=y
  4885. +# CONFIG_IP_PNP_DHCP is not set
  4886. +CONFIG_IP_PNP_BOOTP=y
  4887. +# CONFIG_IP_PNP_RARP is not set
  4888. +# CONFIG_NET_IPIP is not set
  4889. +# CONFIG_NET_IPGRE is not set
  4890. +# CONFIG_IP_MROUTE is not set
  4891. +# CONFIG_ARPD is not set
  4892. +# CONFIG_INET_ECN is not set
  4893. +# CONFIG_SYN_COOKIES is not set
  4894. +
  4895. +#
  4896. +# IP: Netfilter Configuration
  4897. +#
  4898. +# CONFIG_IP_NF_CONNTRACK is not set
  4899. +# CONFIG_IP_NF_QUEUE is not set
  4900. +# CONFIG_IP_NF_IPTABLES is not set
  4901. +# CONFIG_IP_NF_ARPTABLES is not set
  4902. +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
  4903. +# CONFIG_IP_NF_COMPAT_IPFWADM is not set
  4904. +
  4905. +#
  4906. +# IP: Virtual Server Configuration
  4907. +#
  4908. +# CONFIG_IP_VS is not set
  4909. +# CONFIG_IPV6 is not set
  4910. +# CONFIG_KHTTPD is not set
  4911. +
  4912. +#
  4913. +# SCTP Configuration (EXPERIMENTAL)
  4914. +#
  4915. +# CONFIG_IP_SCTP is not set
  4916. +# CONFIG_ATM is not set
  4917. +# CONFIG_VLAN_8021Q is not set
  4918. +
  4919. +#
  4920. +#
  4921. +#
  4922. +# CONFIG_IPX is not set
  4923. +# CONFIG_ATALK is not set
  4924. +# CONFIG_DECNET is not set
  4925. +# CONFIG_BRIDGE is not set
  4926. +# CONFIG_X25 is not set
  4927. +# CONFIG_LAPB is not set
  4928. +# CONFIG_LLC is not set
  4929. +# CONFIG_NET_DIVERT is not set
  4930. +# CONFIG_ECONET is not set
  4931. +# CONFIG_WAN_ROUTER is not set
  4932. +# CONFIG_NET_FASTROUTE is not set
  4933. +# CONFIG_NET_HW_FLOWCONTROL is not set
  4934. +
  4935. +#
  4936. +# QoS and/or fair queueing
  4937. +#
  4938. +# CONFIG_NET_SCHED is not set
  4939. +
  4940. +#
  4941. +# Network testing
  4942. +#
  4943. +# CONFIG_NET_PKTGEN is not set
  4944. +
  4945. +#
  4946. +# Telephony Support
  4947. +#
  4948. +# CONFIG_PHONE is not set
  4949. +# CONFIG_PHONE_IXJ is not set
  4950. +# CONFIG_PHONE_IXJ_PCMCIA is not set
  4951. +
  4952. +#
  4953. +# ATA/IDE/MFM/RLL support
  4954. +#
  4955. +CONFIG_IDE=y
  4956. +
  4957. +#
  4958. +# IDE, ATA and ATAPI Block devices
  4959. +#
  4960. +CONFIG_BLK_DEV_IDE=y
  4961. +
  4962. +#
  4963. +# Please see Documentation/ide.txt for help/info on IDE drives
  4964. +#
  4965. +# CONFIG_BLK_DEV_HD_IDE is not set
  4966. +# CONFIG_BLK_DEV_HD is not set
  4967. +# CONFIG_BLK_DEV_IDE_SATA is not set
  4968. +CONFIG_BLK_DEV_IDEDISK=y
  4969. +CONFIG_IDEDISK_MULTI_MODE=y
  4970. +CONFIG_IDEDISK_STROKE=y
  4971. +CONFIG_BLK_DEV_IDECS=m
  4972. +# CONFIG_BLK_DEV_DELKIN is not set
  4973. +# CONFIG_BLK_DEV_IDECD is not set
  4974. +# CONFIG_BLK_DEV_IDETAPE is not set
  4975. +# CONFIG_BLK_DEV_IDEFLOPPY is not set
  4976. +# CONFIG_BLK_DEV_IDESCSI is not set
  4977. +# CONFIG_IDE_TASK_IOCTL is not set
  4978. +
  4979. +#
  4980. +# IDE chipset support/bugfixes
  4981. +#
  4982. +# CONFIG_BLK_DEV_CMD640 is not set
  4983. +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
  4984. +# CONFIG_BLK_DEV_ISAPNP is not set
  4985. +# CONFIG_BLK_DEV_IDEPCI is not set
  4986. +# CONFIG_IDE_CHIPSETS is not set
  4987. +# CONFIG_IDEDMA_AUTO is not set
  4988. +# CONFIG_DMA_NONPCI is not set
  4989. +# CONFIG_BLK_DEV_ATARAID is not set
  4990. +# CONFIG_BLK_DEV_ATARAID_PDC is not set
  4991. +# CONFIG_BLK_DEV_ATARAID_HPT is not set
  4992. +# CONFIG_BLK_DEV_ATARAID_MEDLEY is not set
  4993. +# CONFIG_BLK_DEV_ATARAID_SII is not set
  4994. +
  4995. +#
  4996. +# SCSI support
  4997. +#
  4998. +CONFIG_SCSI=y
  4999. +
  5000. +#
  5001. +# SCSI support type (disk, tape, CD-ROM)
  5002. +#
  5003. +CONFIG_BLK_DEV_SD=y
  5004. +CONFIG_SD_EXTRA_DEVS=40
  5005. +CONFIG_CHR_DEV_ST=y
  5006. +# CONFIG_CHR_DEV_OSST is not set
  5007. +CONFIG_BLK_DEV_SR=y
  5008. +# CONFIG_BLK_DEV_SR_VENDOR is not set
  5009. +CONFIG_SR_EXTRA_DEVS=2
  5010. +# CONFIG_CHR_DEV_SG is not set
  5011. +
  5012. +#
  5013. +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
  5014. +#
  5015. +# CONFIG_SCSI_DEBUG_QUEUES is not set
  5016. +# CONFIG_SCSI_MULTI_LUN is not set
  5017. +CONFIG_SCSI_CONSTANTS=y
  5018. +# CONFIG_SCSI_LOGGING is not set
  5019. +
  5020. +#
  5021. +# SCSI low-level drivers
  5022. +#
  5023. +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
  5024. +# CONFIG_SCSI_7000FASST is not set
  5025. +# CONFIG_SCSI_ACARD is not set
  5026. +# CONFIG_SCSI_AHA152X is not set
  5027. +# CONFIG_SCSI_AHA1542 is not set
  5028. +# CONFIG_SCSI_AHA1740 is not set
  5029. +# CONFIG_SCSI_AACRAID is not set
  5030. +# CONFIG_SCSI_AIC7XXX is not set
  5031. +# CONFIG_SCSI_AIC79XX is not set
  5032. +# CONFIG_SCSI_AIC7XXX_OLD is not set
  5033. +# CONFIG_SCSI_DPT_I2O is not set
  5034. +# CONFIG_SCSI_ADVANSYS is not set
  5035. +# CONFIG_SCSI_IN2000 is not set
  5036. +# CONFIG_SCSI_AM53C974 is not set
  5037. +# CONFIG_SCSI_MEGARAID is not set
  5038. +# CONFIG_SCSI_MEGARAID2 is not set
  5039. +# CONFIG_SCSI_SATA is not set
  5040. +# CONFIG_SCSI_SATA_AHCI is not set
  5041. +# CONFIG_SCSI_SATA_SVW is not set
  5042. +# CONFIG_SCSI_ATA_PIIX is not set
  5043. +# CONFIG_SCSI_SATA_NV is not set
  5044. +# CONFIG_SCSI_SATA_QSTOR is not set
  5045. +# CONFIG_SCSI_SATA_PROMISE is not set
  5046. +# CONFIG_SCSI_SATA_SX4 is not set
  5047. +# CONFIG_SCSI_SATA_SIL is not set
  5048. +# CONFIG_SCSI_SATA_SIS is not set
  5049. +# CONFIG_SCSI_SATA_ULI is not set
  5050. +# CONFIG_SCSI_SATA_VIA is not set
  5051. +# CONFIG_SCSI_SATA_VITESSE is not set
  5052. +# CONFIG_SCSI_BUSLOGIC is not set
  5053. +# CONFIG_SCSI_CPQFCTS is not set
  5054. +# CONFIG_SCSI_DMX3191D is not set
  5055. +# CONFIG_SCSI_DTC3280 is not set
  5056. +# CONFIG_SCSI_EATA is not set
  5057. +# CONFIG_SCSI_EATA_DMA is not set
  5058. +# CONFIG_SCSI_EATA_PIO is not set
  5059. +# CONFIG_SCSI_FUTURE_DOMAIN is not set
  5060. +# CONFIG_SCSI_GDTH is not set
  5061. +# CONFIG_SCSI_GENERIC_NCR5380 is not set
  5062. +# CONFIG_SCSI_INITIO is not set
  5063. +# CONFIG_SCSI_INIA100 is not set
  5064. +# CONFIG_SCSI_NCR53C406A is not set
  5065. +# CONFIG_SCSI_NCR53C7xx is not set
  5066. +# CONFIG_SCSI_SYM53C8XX_2 is not set
  5067. +# CONFIG_SCSI_NCR53C8XX is not set
  5068. +# CONFIG_SCSI_SYM53C8XX is not set
  5069. +# CONFIG_SCSI_PAS16 is not set
  5070. +# CONFIG_SCSI_PCI2000 is not set
  5071. +# CONFIG_SCSI_PCI2220I is not set
  5072. +# CONFIG_SCSI_PSI240I is not set
  5073. +# CONFIG_SCSI_QLOGIC_FAS is not set
  5074. +# CONFIG_SCSI_QLOGIC_ISP is not set
  5075. +# CONFIG_SCSI_QLOGIC_FC is not set
  5076. +# CONFIG_SCSI_QLOGIC_1280 is not set
  5077. +# CONFIG_SCSI_SIM710 is not set
  5078. +# CONFIG_SCSI_SYM53C416 is not set
  5079. +# CONFIG_SCSI_DC390T is not set
  5080. +# CONFIG_SCSI_T128 is not set
  5081. +# CONFIG_SCSI_U14_34F is not set
  5082. +# CONFIG_SCSI_NSP32 is not set
  5083. +# CONFIG_SCSI_DEBUG is not set
  5084. +
  5085. +#
  5086. +# PCMCIA SCSI adapter support
  5087. +#
  5088. +# CONFIG_SCSI_PCMCIA is not set
  5089. +
  5090. +#
  5091. +# Fusion MPT device support
  5092. +#
  5093. +# CONFIG_FUSION is not set
  5094. +# CONFIG_FUSION_BOOT is not set
  5095. +# CONFIG_FUSION_ISENSE is not set
  5096. +# CONFIG_FUSION_CTL is not set
  5097. +# CONFIG_FUSION_LAN is not set
  5098. +
  5099. +#
  5100. +# IEEE 1394 (FireWire) support (EXPERIMENTAL)
  5101. +#
  5102. +# CONFIG_IEEE1394 is not set
  5103. +
  5104. +#
  5105. +# I2O device support
  5106. +#
  5107. +# CONFIG_I2O is not set
  5108. +# CONFIG_I2O_PCI is not set
  5109. +# CONFIG_I2O_BLOCK is not set
  5110. +# CONFIG_I2O_LAN is not set
  5111. +# CONFIG_I2O_SCSI is not set
  5112. +# CONFIG_I2O_PROC is not set
  5113. +
  5114. +#
  5115. +# Network device support
  5116. +#
  5117. +CONFIG_NETDEVICES=y
  5118. +
  5119. +#
  5120. +# ARCnet devices
  5121. +#
  5122. +# CONFIG_ARCNET is not set
  5123. +# CONFIG_DUMMY is not set
  5124. +# CONFIG_BONDING is not set
  5125. +# CONFIG_EQUALIZER is not set
  5126. +# CONFIG_TUN is not set
  5127. +# CONFIG_ETHERTAP is not set
  5128. +
  5129. +#
  5130. +# Ethernet (10 or 100Mbit)
  5131. +#
  5132. +CONFIG_NET_ETHERNET=y
  5133. +# CONFIG_SUNLANCE is not set
  5134. +# CONFIG_HAPPYMEAL is not set
  5135. +# CONFIG_SUNBMAC is not set
  5136. +# CONFIG_SUNQE is not set
  5137. +# CONFIG_SUNGEM is not set
  5138. +# CONFIG_NET_VENDOR_3COM is not set
  5139. +# CONFIG_LANCE is not set
  5140. +# CONFIG_NET_VENDOR_SMC is not set
  5141. +# CONFIG_NET_VENDOR_RACAL is not set
  5142. +# CONFIG_HP100 is not set
  5143. +# CONFIG_NET_ISA is not set
  5144. +# CONFIG_NET_PCI is not set
  5145. +# CONFIG_NET_POCKET is not set
  5146. +
  5147. +#
  5148. +# Ethernet (1000 Mbit)
  5149. +#
  5150. +# CONFIG_ACENIC is not set
  5151. +# CONFIG_DL2K is not set
  5152. +# CONFIG_E1000 is not set
  5153. +# CONFIG_MYRI_SBUS is not set
  5154. +# CONFIG_NS83820 is not set
  5155. +# CONFIG_HAMACHI is not set
  5156. +# CONFIG_YELLOWFIN is not set
  5157. +# CONFIG_R8169 is not set
  5158. +# CONFIG_SK98LIN is not set
  5159. +# CONFIG_TIGON3 is not set
  5160. +# CONFIG_FDDI is not set
  5161. +# CONFIG_HIPPI is not set
  5162. +# CONFIG_PLIP is not set
  5163. +# CONFIG_PPP is not set
  5164. +# CONFIG_SLIP is not set
  5165. +
  5166. +#
  5167. +# Wireless LAN (non-hamradio)
  5168. +#
  5169. +# CONFIG_NET_RADIO is not set
  5170. +
  5171. +#
  5172. +# Token Ring devices
  5173. +#
  5174. +# CONFIG_TR is not set
  5175. +# CONFIG_NET_FC is not set
  5176. +# CONFIG_RCPCI is not set
  5177. +# CONFIG_SHAPER is not set
  5178. +
  5179. +#
  5180. +# Wan interfaces
  5181. +#
  5182. +# CONFIG_WAN is not set
  5183. +
  5184. +#
  5185. +# PCMCIA network device support
  5186. +#
  5187. +# CONFIG_NET_PCMCIA is not set
  5188. +
  5189. +#
  5190. +# Amateur Radio support
  5191. +#
  5192. +# CONFIG_HAMRADIO is not set
  5193. +
  5194. +#
  5195. +# IrDA (infrared) support
  5196. +#
  5197. +# CONFIG_IRDA is not set
  5198. +
  5199. +#
  5200. +# ISDN subsystem
  5201. +#
  5202. +# CONFIG_ISDN is not set
  5203. +
  5204. +#
  5205. +# Input core support
  5206. +#
  5207. +CONFIG_INPUT=y
  5208. +CONFIG_INPUT_KEYBDEV=y
  5209. +CONFIG_INPUT_MOUSEDEV=y
  5210. +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
  5211. +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
  5212. +# CONFIG_INPUT_JOYDEV is not set
  5213. +CONFIG_INPUT_EVDEV=y
  5214. +# CONFIG_INPUT_UINPUT is not set
  5215. +
  5216. +#
  5217. +# Character devices
  5218. +#
  5219. +CONFIG_VT=y
  5220. +# CONFIG_VT_CONSOLE is not set
  5221. +# CONFIG_SERIAL is not set
  5222. +# CONFIG_SERIAL_EXTENDED is not set
  5223. +CONFIG_SERIAL_NONSTANDARD=y
  5224. +# CONFIG_COMPUTONE is not set
  5225. +# CONFIG_ROCKETPORT is not set
  5226. +# CONFIG_CYCLADES is not set
  5227. +# CONFIG_DIGIEPCA is not set
  5228. +# CONFIG_DIGI is not set
  5229. +# CONFIG_ESPSERIAL is not set
  5230. +# CONFIG_MOXA_INTELLIO is not set
  5231. +# CONFIG_MOXA_SMARTIO is not set
  5232. +# CONFIG_ISI is not set
  5233. +# CONFIG_SYNCLINK is not set
  5234. +# CONFIG_SYNCLINKMP is not set
  5235. +# CONFIG_N_HDLC is not set
  5236. +# CONFIG_RISCOM8 is not set
  5237. +# CONFIG_SPECIALIX is not set
  5238. +# CONFIG_SX is not set
  5239. +# CONFIG_RIO is not set
  5240. +# CONFIG_STALDRV is not set
  5241. +# CONFIG_SERIAL_TX3912 is not set
  5242. +# CONFIG_SERIAL_TX3912_CONSOLE is not set
  5243. +# CONFIG_SERIAL_TXX9 is not set
  5244. +# CONFIG_SERIAL_TXX9_CONSOLE is not set
  5245. +# CONFIG_TXX927_SERIAL is not set
  5246. +CONFIG_UNIX98_PTYS=y
  5247. +CONFIG_UNIX98_PTY_COUNT=256
  5248. +
  5249. +#
  5250. +# I2C support
  5251. +#
  5252. +# CONFIG_I2C is not set
  5253. +
  5254. +#
  5255. +# Mice
  5256. +#
  5257. +# CONFIG_BUSMOUSE is not set
  5258. +# CONFIG_MOUSE is not set
  5259. +
  5260. +#
  5261. +# Joysticks
  5262. +#
  5263. +# CONFIG_INPUT_GAMEPORT is not set
  5264. +# CONFIG_INPUT_NS558 is not set
  5265. +# CONFIG_INPUT_LIGHTNING is not set
  5266. +# CONFIG_INPUT_PCIGAME is not set
  5267. +# CONFIG_INPUT_CS461X is not set
  5268. +# CONFIG_INPUT_EMU10K1 is not set
  5269. +# CONFIG_INPUT_SERIO is not set
  5270. +# CONFIG_INPUT_SERPORT is not set
  5271. +
  5272. +#
  5273. +# Joysticks
  5274. +#
  5275. +# CONFIG_INPUT_ANALOG is not set
  5276. +# CONFIG_INPUT_A3D is not set
  5277. +# CONFIG_INPUT_ADI is not set
  5278. +# CONFIG_INPUT_COBRA is not set
  5279. +# CONFIG_INPUT_GF2K is not set
  5280. +# CONFIG_INPUT_GRIP is not set
  5281. +# CONFIG_INPUT_INTERACT is not set
  5282. +# CONFIG_INPUT_TMDC is not set
  5283. +# CONFIG_INPUT_SIDEWINDER is not set
  5284. +# CONFIG_INPUT_IFORCE_USB is not set
  5285. +# CONFIG_INPUT_IFORCE_232 is not set
  5286. +# CONFIG_INPUT_WARRIOR is not set
  5287. +# CONFIG_INPUT_MAGELLAN is not set
  5288. +# CONFIG_INPUT_SPACEORB is not set
  5289. +# CONFIG_INPUT_SPACEBALL is not set
  5290. +# CONFIG_INPUT_STINGER is not set
  5291. +# CONFIG_INPUT_DB9 is not set
  5292. +# CONFIG_INPUT_GAMECON is not set
  5293. +# CONFIG_INPUT_TURBOGRAFX is not set
  5294. +# CONFIG_QIC02_TAPE is not set
  5295. +# CONFIG_IPMI_HANDLER is not set
  5296. +# CONFIG_IPMI_PANIC_EVENT is not set
  5297. +# CONFIG_IPMI_DEVICE_INTERFACE is not set
  5298. +# CONFIG_IPMI_KCS is not set
  5299. +# CONFIG_IPMI_WATCHDOG is not set
  5300. +
  5301. +#
  5302. +# Watchdog Cards
  5303. +#
  5304. +# CONFIG_WATCHDOG is not set
  5305. +# CONFIG_SCx200 is not set
  5306. +# CONFIG_SCx200_GPIO is not set
  5307. +# CONFIG_AMD_PM768 is not set
  5308. +# CONFIG_NVRAM is not set
  5309. +# CONFIG_RTC is not set
  5310. +# CONFIG_DTLK is not set
  5311. +# CONFIG_R3964 is not set
  5312. +# CONFIG_APPLICOM is not set
  5313. +
  5314. +#
  5315. +# Ftape, the floppy tape device driver
  5316. +#
  5317. +# CONFIG_FTAPE is not set
  5318. +# CONFIG_AGP is not set
  5319. +
  5320. +#
  5321. +# Direct Rendering Manager (XFree86 DRI support)
  5322. +#
  5323. +# CONFIG_DRM is not set
  5324. +
  5325. +#
  5326. +# PCMCIA character devices
  5327. +#
  5328. +# CONFIG_PCMCIA_SERIAL_CS is not set
  5329. +# CONFIG_SYNCLINK_CS is not set
  5330. +
  5331. +#
  5332. +# File systems
  5333. +#
  5334. +# CONFIG_QUOTA is not set
  5335. +# CONFIG_QFMT_V2 is not set
  5336. +CONFIG_AUTOFS_FS=y
  5337. +# CONFIG_AUTOFS4_FS is not set
  5338. +# CONFIG_REISERFS_FS is not set
  5339. +# CONFIG_REISERFS_CHECK is not set
  5340. +# CONFIG_REISERFS_PROC_INFO is not set
  5341. +# CONFIG_ADFS_FS is not set
  5342. +# CONFIG_ADFS_FS_RW is not set
  5343. +# CONFIG_AFFS_FS is not set
  5344. +# CONFIG_HFS_FS is not set
  5345. +# CONFIG_HFSPLUS_FS is not set
  5346. +# CONFIG_BEFS_FS is not set
  5347. +# CONFIG_BEFS_DEBUG is not set
  5348. +# CONFIG_BFS_FS is not set
  5349. +CONFIG_EXT3_FS=y
  5350. +CONFIG_JBD=y
  5351. +# CONFIG_JBD_DEBUG is not set
  5352. +CONFIG_FAT_FS=y
  5353. +CONFIG_MSDOS_FS=y
  5354. +# CONFIG_UMSDOS_FS is not set
  5355. +CONFIG_VFAT_FS=y
  5356. +# CONFIG_EFS_FS is not set
  5357. +# CONFIG_JFFS_FS is not set
  5358. +# CONFIG_JFFS2_FS is not set
  5359. +# CONFIG_CRAMFS is not set
  5360. +CONFIG_TMPFS=y
  5361. +CONFIG_RAMFS=y
  5362. +# CONFIG_ISO9660_FS is not set
  5363. +# CONFIG_JOLIET is not set
  5364. +# CONFIG_ZISOFS is not set
  5365. +# CONFIG_JFS_FS is not set
  5366. +# CONFIG_JFS_DEBUG is not set
  5367. +# CONFIG_JFS_STATISTICS is not set
  5368. +# CONFIG_MINIX_FS is not set
  5369. +# CONFIG_VXFS_FS is not set
  5370. +# CONFIG_NTFS_FS is not set
  5371. +# CONFIG_NTFS_RW is not set
  5372. +# CONFIG_HPFS_FS is not set
  5373. +CONFIG_PROC_FS=y
  5374. +# CONFIG_DEVFS_FS is not set
  5375. +# CONFIG_DEVFS_MOUNT is not set
  5376. +# CONFIG_DEVFS_DEBUG is not set
  5377. +CONFIG_DEVPTS_FS=y
  5378. +# CONFIG_QNX4FS_FS is not set
  5379. +# CONFIG_QNX4FS_RW is not set
  5380. +# CONFIG_ROMFS_FS is not set
  5381. +CONFIG_EXT2_FS=y
  5382. +# CONFIG_SYSV_FS is not set
  5383. +# CONFIG_UDF_FS is not set
  5384. +# CONFIG_UDF_RW is not set
  5385. +# CONFIG_UFS_FS is not set
  5386. +# CONFIG_UFS_FS_WRITE is not set
  5387. +# CONFIG_XFS_FS is not set
  5388. +# CONFIG_XFS_QUOTA is not set
  5389. +# CONFIG_XFS_RT is not set
  5390. +# CONFIG_XFS_TRACE is not set
  5391. +# CONFIG_XFS_DEBUG is not set
  5392. +
  5393. +#
  5394. +# Network File Systems
  5395. +#
  5396. +# CONFIG_CODA_FS is not set
  5397. +# CONFIG_INTERMEZZO_FS is not set
  5398. +CONFIG_NFS_FS=y
  5399. +CONFIG_NFS_V3=y
  5400. +# CONFIG_NFS_DIRECTIO is not set
  5401. +CONFIG_ROOT_NFS=y
  5402. +# CONFIG_NFSD is not set
  5403. +# CONFIG_NFSD_V3 is not set
  5404. +# CONFIG_NFSD_TCP is not set
  5405. +CONFIG_SUNRPC=y
  5406. +CONFIG_LOCKD=y
  5407. +CONFIG_LOCKD_V4=y
  5408. +# CONFIG_SMB_FS is not set
  5409. +# CONFIG_NCP_FS is not set
  5410. +# CONFIG_NCPFS_PACKET_SIGNING is not set
  5411. +# CONFIG_NCPFS_IOCTL_LOCKING is not set
  5412. +# CONFIG_NCPFS_STRONG is not set
  5413. +# CONFIG_NCPFS_NFS_NS is not set
  5414. +# CONFIG_NCPFS_OS2_NS is not set
  5415. +# CONFIG_NCPFS_SMALLDOS is not set
  5416. +# CONFIG_NCPFS_NLS is not set
  5417. +# CONFIG_NCPFS_EXTRAS is not set
  5418. +# CONFIG_ZISOFS_FS is not set
  5419. +
  5420. +#
  5421. +# Partition Types
  5422. +#
  5423. +# CONFIG_PARTITION_ADVANCED is not set
  5424. +CONFIG_MSDOS_PARTITION=y
  5425. +# CONFIG_SMB_NLS is not set
  5426. +CONFIG_NLS=y
  5427. +
  5428. +#
  5429. +# Native Language Support
  5430. +#
  5431. +CONFIG_NLS_DEFAULT="iso8859-1"
  5432. +# CONFIG_NLS_CODEPAGE_437 is not set
  5433. +# CONFIG_NLS_CODEPAGE_737 is not set
  5434. +# CONFIG_NLS_CODEPAGE_775 is not set
  5435. +# CONFIG_NLS_CODEPAGE_850 is not set
  5436. +# CONFIG_NLS_CODEPAGE_852 is not set
  5437. +# CONFIG_NLS_CODEPAGE_855 is not set
  5438. +# CONFIG_NLS_CODEPAGE_857 is not set
  5439. +# CONFIG_NLS_CODEPAGE_860 is not set
  5440. +# CONFIG_NLS_CODEPAGE_861 is not set
  5441. +# CONFIG_NLS_CODEPAGE_862 is not set
  5442. +# CONFIG_NLS_CODEPAGE_863 is not set
  5443. +# CONFIG_NLS_CODEPAGE_864 is not set
  5444. +# CONFIG_NLS_CODEPAGE_865 is not set
  5445. +# CONFIG_NLS_CODEPAGE_866 is not set
  5446. +# CONFIG_NLS_CODEPAGE_869 is not set
  5447. +# CONFIG_NLS_CODEPAGE_936 is not set
  5448. +# CONFIG_NLS_CODEPAGE_950 is not set
  5449. +# CONFIG_NLS_CODEPAGE_932 is not set
  5450. +# CONFIG_NLS_CODEPAGE_949 is not set
  5451. +# CONFIG_NLS_CODEPAGE_874 is not set
  5452. +# CONFIG_NLS_ISO8859_8 is not set
  5453. +# CONFIG_NLS_CODEPAGE_1250 is not set
  5454. +# CONFIG_NLS_CODEPAGE_1251 is not set
  5455. +# CONFIG_NLS_ISO8859_1 is not set
  5456. +# CONFIG_NLS_ISO8859_2 is not set
  5457. +# CONFIG_NLS_ISO8859_3 is not set
  5458. +# CONFIG_NLS_ISO8859_4 is not set
  5459. +# CONFIG_NLS_ISO8859_5 is not set
  5460. +# CONFIG_NLS_ISO8859_6 is not set
  5461. +# CONFIG_NLS_ISO8859_7 is not set
  5462. +# CONFIG_NLS_ISO8859_9 is not set
  5463. +# CONFIG_NLS_ISO8859_13 is not set
  5464. +# CONFIG_NLS_ISO8859_14 is not set
  5465. +# CONFIG_NLS_ISO8859_15 is not set
  5466. +# CONFIG_NLS_KOI8_R is not set
  5467. +# CONFIG_NLS_KOI8_U is not set
  5468. +# CONFIG_NLS_UTF8 is not set
  5469. +
  5470. +#
  5471. +# Multimedia devices
  5472. +#
  5473. +# CONFIG_VIDEO_DEV is not set
  5474. +
  5475. +#
  5476. +# Console drivers
  5477. +#
  5478. +# CONFIG_VGA_CONSOLE is not set
  5479. +# CONFIG_MDA_CONSOLE is not set
  5480. +
  5481. +#
  5482. +# Frame-buffer support
  5483. +#
  5484. +CONFIG_FB=y
  5485. +CONFIG_DUMMY_CONSOLE=y
  5486. +# CONFIG_FB_RIVA is not set
  5487. +# CONFIG_FB_CLGEN is not set
  5488. +# CONFIG_FB_PM2 is not set
  5489. +# CONFIG_FB_PM3 is not set
  5490. +# CONFIG_FB_CYBER2000 is not set
  5491. +# CONFIG_FB_MATROX is not set
  5492. +# CONFIG_FB_ATY is not set
  5493. +# CONFIG_FB_RADEON is not set
  5494. +# CONFIG_FB_ATY128 is not set
  5495. +# CONFIG_FB_INTEL is not set
  5496. +# CONFIG_FB_SIS is not set
  5497. +# CONFIG_FB_NEOMAGIC is not set
  5498. +# CONFIG_FB_3DFX is not set
  5499. +# CONFIG_FB_VOODOO1 is not set
  5500. +# CONFIG_FB_TRIDENT is not set
  5501. +# CONFIG_FB_E1356 is not set
  5502. +# CONFIG_FB_IT8181 is not set
  5503. +# CONFIG_FB_VIRTUAL is not set
  5504. +CONFIG_FBCON_ADVANCED=y
  5505. +# CONFIG_FBCON_MFB is not set
  5506. +# CONFIG_FBCON_CFB2 is not set
  5507. +# CONFIG_FBCON_CFB4 is not set
  5508. +# CONFIG_FBCON_CFB8 is not set
  5509. +CONFIG_FBCON_CFB16=y
  5510. +# CONFIG_FBCON_CFB24 is not set
  5511. +CONFIG_FBCON_CFB32=y
  5512. +# CONFIG_FBCON_AFB is not set
  5513. +# CONFIG_FBCON_ILBM is not set
  5514. +# CONFIG_FBCON_IPLAN2P2 is not set
  5515. +# CONFIG_FBCON_IPLAN2P4 is not set
  5516. +# CONFIG_FBCON_IPLAN2P8 is not set
  5517. +# CONFIG_FBCON_MAC is not set
  5518. +# CONFIG_FBCON_VGA_PLANES is not set
  5519. +# CONFIG_FBCON_VGA is not set
  5520. +# CONFIG_FBCON_HGA is not set
  5521. +# CONFIG_FBCON_FONTWIDTH8_ONLY is not set
  5522. +CONFIG_FBCON_FONTS=y
  5523. +CONFIG_FONT_8x8=y
  5524. +CONFIG_FONT_8x16=y
  5525. +# CONFIG_FONT_SUN8x16 is not set
  5526. +# CONFIG_FONT_SUN12x22 is not set
  5527. +# CONFIG_FONT_6x11 is not set
  5528. +# CONFIG_FONT_PEARL_8x8 is not set
  5529. +# CONFIG_FONT_ACORN_8x8 is not set
  5530. +
  5531. +#
  5532. +# Sound
  5533. +#
  5534. +CONFIG_SOUND=y
  5535. +# CONFIG_SOUND_ALI5455 is not set
  5536. +# CONFIG_SOUND_BT878 is not set
  5537. +# CONFIG_SOUND_CMPCI is not set
  5538. +# CONFIG_SOUND_EMU10K1 is not set
  5539. +# CONFIG_MIDI_EMU10K1 is not set
  5540. +# CONFIG_SOUND_FUSION is not set
  5541. +# CONFIG_SOUND_CS4281 is not set
  5542. +# CONFIG_SOUND_ES1370 is not set
  5543. +# CONFIG_SOUND_ES1371 is not set
  5544. +# CONFIG_SOUND_ESSSOLO1 is not set
  5545. +# CONFIG_SOUND_MAESTRO is not set
  5546. +# CONFIG_SOUND_MAESTRO3 is not set
  5547. +# CONFIG_SOUND_FORTE is not set
  5548. +# CONFIG_SOUND_ICH is not set
  5549. +# CONFIG_SOUND_RME96XX is not set
  5550. +# CONFIG_SOUND_SONICVIBES is not set
  5551. +# CONFIG_SOUND_TRIDENT is not set
  5552. +# CONFIG_SOUND_MSNDCLAS is not set
  5553. +# CONFIG_SOUND_MSNDPIN is not set
  5554. +# CONFIG_SOUND_VIA82CXXX is not set
  5555. +# CONFIG_MIDI_VIA82CXXX is not set
  5556. +# CONFIG_SOUND_OSS is not set
  5557. +# CONFIG_SOUND_TVMIXER is not set
  5558. +# CONFIG_SOUND_AD1980 is not set
  5559. +# CONFIG_SOUND_WM97XX is not set
  5560. +
  5561. +#
  5562. +# USB support
  5563. +#
  5564. +CONFIG_USB=y
  5565. +# CONFIG_USB_DEBUG is not set
  5566. +
  5567. +#
  5568. +# Miscellaneous USB options
  5569. +#
  5570. +CONFIG_USB_DEVICEFS=y
  5571. +# CONFIG_USB_BANDWIDTH is not set
  5572. +
  5573. +#
  5574. +# USB Host Controller Drivers
  5575. +#
  5576. +# CONFIG_USB_EHCI_HCD is not set
  5577. +# CONFIG_USB_UHCI is not set
  5578. +# CONFIG_USB_UHCI_ALT is not set
  5579. +CONFIG_USB_OHCI=y
  5580. +
  5581. +#
  5582. +# USB Device Class drivers
  5583. +#
  5584. +# CONFIG_USB_AUDIO is not set
  5585. +# CONFIG_USB_EMI26 is not set
  5586. +# CONFIG_USB_BLUETOOTH is not set
  5587. +# CONFIG_USB_MIDI is not set
  5588. +CONFIG_USB_STORAGE=y
  5589. +# CONFIG_USB_STORAGE_DEBUG is not set
  5590. +# CONFIG_USB_STORAGE_DATAFAB is not set
  5591. +# CONFIG_USB_STORAGE_FREECOM is not set
  5592. +# CONFIG_USB_STORAGE_ISD200 is not set
  5593. +# CONFIG_USB_STORAGE_DPCM is not set
  5594. +# CONFIG_USB_STORAGE_HP8200e is not set
  5595. +# CONFIG_USB_STORAGE_SDDR09 is not set
  5596. +# CONFIG_USB_STORAGE_SDDR55 is not set
  5597. +# CONFIG_USB_STORAGE_JUMPSHOT is not set
  5598. +# CONFIG_USB_ACM is not set
  5599. +# CONFIG_USB_PRINTER is not set
  5600. +
  5601. +#
  5602. +# USB Human Interface Devices (HID)
  5603. +#
  5604. +CONFIG_USB_HID=y
  5605. +CONFIG_USB_HIDINPUT=y
  5606. +CONFIG_USB_HIDDEV=y
  5607. +# CONFIG_USB_AIPTEK is not set
  5608. +# CONFIG_USB_WACOM is not set
  5609. +# CONFIG_USB_KBTAB is not set
  5610. +# CONFIG_USB_POWERMATE is not set
  5611. +
  5612. +#
  5613. +# USB Imaging devices
  5614. +#
  5615. +# CONFIG_USB_DC2XX is not set
  5616. +# CONFIG_USB_MDC800 is not set
  5617. +# CONFIG_USB_SCANNER is not set
  5618. +# CONFIG_USB_MICROTEK is not set
  5619. +# CONFIG_USB_HPUSBSCSI is not set
  5620. +
  5621. +#
  5622. +# USB Multimedia devices
  5623. +#
  5624. +
  5625. +#
  5626. +# Video4Linux support is needed for USB Multimedia device support
  5627. +#
  5628. +
  5629. +#
  5630. +# USB Network adaptors
  5631. +#
  5632. +# CONFIG_USB_PEGASUS is not set
  5633. +# CONFIG_USB_RTL8150 is not set
  5634. +# CONFIG_USB_KAWETH is not set
  5635. +# CONFIG_USB_CATC is not set
  5636. +# CONFIG_USB_CDCETHER is not set
  5637. +# CONFIG_USB_USBNET is not set
  5638. +
  5639. +#
  5640. +# USB port drivers
  5641. +#
  5642. +# CONFIG_USB_USS720 is not set
  5643. +
  5644. +#
  5645. +# USB Serial Converter support
  5646. +#
  5647. +# CONFIG_USB_SERIAL is not set
  5648. +
  5649. +#
  5650. +# USB Miscellaneous drivers
  5651. +#
  5652. +# CONFIG_USB_RIO500 is not set
  5653. +# CONFIG_USB_AUERSWALD is not set
  5654. +# CONFIG_USB_TIGL is not set
  5655. +# CONFIG_USB_BRLVGER is not set
  5656. +# CONFIG_USB_LCD is not set
  5657. +
  5658. +#
  5659. +# Support for USB gadgets
  5660. +#
  5661. +# CONFIG_USB_GADGET is not set
  5662. +
  5663. +#
  5664. +# Bluetooth support
  5665. +#
  5666. +# CONFIG_BLUEZ is not set
  5667. +
  5668. +#
  5669. +# Kernel hacking
  5670. +#
  5671. +CONFIG_CROSSCOMPILE=y
  5672. +# CONFIG_RUNTIME_DEBUG is not set
  5673. +# CONFIG_KGDB is not set
  5674. +# CONFIG_GDB_CONSOLE is not set
  5675. +# CONFIG_DEBUG_INFO is not set
  5676. +# CONFIG_MAGIC_SYSRQ is not set
  5677. +# CONFIG_MIPS_UNCACHED is not set
  5678. +CONFIG_LOG_BUF_SHIFT=0
  5679. +
  5680. +#
  5681. +# Cryptographic options
  5682. +#
  5683. +# CONFIG_CRYPTO is not set
  5684. +
  5685. +#
  5686. +# Library routines
  5687. +#
  5688. +# CONFIG_CRC32 is not set
  5689. +CONFIG_ZLIB_INFLATE=m
  5690. +CONFIG_ZLIB_DEFLATE=m
  5691. +# CONFIG_FW_LOADER is not set
  5692. Index: linux-2.4.35.4/arch/mips/defconfig-db1500
  5693. ===================================================================
  5694. --- linux-2.4.35.4.orig/arch/mips/defconfig-db1500
  5695. +++ linux-2.4.35.4/arch/mips/defconfig-db1500
  5696. @@ -30,8 +30,8 @@ CONFIG_MIPS_DB1500=y
  5697. # CONFIG_MIPS_PB1000 is not set
  5698. # CONFIG_MIPS_PB1100 is not set
  5699. # CONFIG_MIPS_PB1500 is not set
  5700. -# CONFIG_MIPS_HYDROGEN3 is not set
  5701. # CONFIG_MIPS_PB1550 is not set
  5702. +# CONFIG_MIPS_HYDROGEN3 is not set
  5703. # CONFIG_MIPS_XXS1500 is not set
  5704. # CONFIG_MIPS_MTX1 is not set
  5705. # CONFIG_COGENT_CSB250 is not set
  5706. @@ -267,11 +267,6 @@ CONFIG_IP_PNP_BOOTP=y
  5707. #
  5708. # CONFIG_IPX is not set
  5709. # CONFIG_ATALK is not set
  5710. -
  5711. -#
  5712. -# Appletalk devices
  5713. -#
  5714. -# CONFIG_DEV_APPLETALK is not set
  5715. # CONFIG_DECNET is not set
  5716. # CONFIG_BRIDGE is not set
  5717. # CONFIG_X25 is not set
  5718. @@ -555,7 +550,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  5719. # CONFIG_AU1X00_USB_TTY is not set
  5720. # CONFIG_AU1X00_USB_RAW is not set
  5721. # CONFIG_TXX927_SERIAL is not set
  5722. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  5723. CONFIG_UNIX98_PTYS=y
  5724. CONFIG_UNIX98_PTY_COUNT=256
  5725. Index: linux-2.4.35.4/arch/mips/defconfig-db1550
  5726. ===================================================================
  5727. --- linux-2.4.35.4.orig/arch/mips/defconfig-db1550
  5728. +++ linux-2.4.35.4/arch/mips/defconfig-db1550
  5729. @@ -30,8 +30,8 @@ CONFIG_MIPS_DB1550=y
  5730. # CONFIG_MIPS_PB1000 is not set
  5731. # CONFIG_MIPS_PB1100 is not set
  5732. # CONFIG_MIPS_PB1500 is not set
  5733. -# CONFIG_MIPS_HYDROGEN3 is not set
  5734. # CONFIG_MIPS_PB1550 is not set
  5735. +# CONFIG_MIPS_HYDROGEN3 is not set
  5736. # CONFIG_MIPS_XXS1500 is not set
  5737. # CONFIG_MIPS_MTX1 is not set
  5738. # CONFIG_COGENT_CSB250 is not set
  5739. @@ -213,11 +213,9 @@ CONFIG_MTD_CFI_AMDSTD=y
  5740. # CONFIG_MTD_BOSPORUS is not set
  5741. # CONFIG_MTD_XXS1500 is not set
  5742. # CONFIG_MTD_MTX1 is not set
  5743. -# CONFIG_MTD_DB1X00 is not set
  5744. CONFIG_MTD_PB1550=y
  5745. CONFIG_MTD_PB1550_BOOT=y
  5746. CONFIG_MTD_PB1550_USER=y
  5747. -# CONFIG_MTD_HYDROGEN3 is not set
  5748. # CONFIG_MTD_MIRAGE is not set
  5749. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  5750. # CONFIG_MTD_OCELOT is not set
  5751. @@ -236,7 +234,6 @@ CONFIG_MTD_PB1550_USER=y
  5752. #
  5753. # Disk-On-Chip Device Drivers
  5754. #
  5755. -# CONFIG_MTD_DOC1000 is not set
  5756. # CONFIG_MTD_DOC2000 is not set
  5757. # CONFIG_MTD_DOC2001 is not set
  5758. # CONFIG_MTD_DOCPROBE is not set
  5759. @@ -343,11 +340,6 @@ CONFIG_IP_PNP_BOOTP=y
  5760. #
  5761. # CONFIG_IPX is not set
  5762. # CONFIG_ATALK is not set
  5763. -
  5764. -#
  5765. -# Appletalk devices
  5766. -#
  5767. -# CONFIG_DEV_APPLETALK is not set
  5768. # CONFIG_DECNET is not set
  5769. # CONFIG_BRIDGE is not set
  5770. # CONFIG_X25 is not set
  5771. @@ -633,7 +625,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  5772. # CONFIG_AU1X00_USB_TTY is not set
  5773. # CONFIG_AU1X00_USB_RAW is not set
  5774. # CONFIG_TXX927_SERIAL is not set
  5775. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  5776. CONFIG_UNIX98_PTYS=y
  5777. CONFIG_UNIX98_PTY_COUNT=256
  5778. Index: linux-2.4.35.4/arch/mips/defconfig-ddb5476
  5779. ===================================================================
  5780. --- linux-2.4.35.4.orig/arch/mips/defconfig-ddb5476
  5781. +++ linux-2.4.35.4/arch/mips/defconfig-ddb5476
  5782. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  5783. # CONFIG_MIPS_PB1000 is not set
  5784. # CONFIG_MIPS_PB1100 is not set
  5785. # CONFIG_MIPS_PB1500 is not set
  5786. -# CONFIG_MIPS_HYDROGEN3 is not set
  5787. # CONFIG_MIPS_PB1550 is not set
  5788. +# CONFIG_MIPS_HYDROGEN3 is not set
  5789. # CONFIG_MIPS_XXS1500 is not set
  5790. # CONFIG_MIPS_MTX1 is not set
  5791. # CONFIG_COGENT_CSB250 is not set
  5792. @@ -226,11 +226,6 @@ CONFIG_IP_PNP_BOOTP=y
  5793. #
  5794. # CONFIG_IPX is not set
  5795. # CONFIG_ATALK is not set
  5796. -
  5797. -#
  5798. -# Appletalk devices
  5799. -#
  5800. -# CONFIG_DEV_APPLETALK is not set
  5801. # CONFIG_DECNET is not set
  5802. # CONFIG_BRIDGE is not set
  5803. # CONFIG_X25 is not set
  5804. @@ -517,7 +512,6 @@ CONFIG_SERIAL=y
  5805. CONFIG_SERIAL_CONSOLE=y
  5806. # CONFIG_SERIAL_EXTENDED is not set
  5807. # CONFIG_SERIAL_NONSTANDARD is not set
  5808. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  5809. CONFIG_UNIX98_PTYS=y
  5810. CONFIG_UNIX98_PTY_COUNT=256
  5811. Index: linux-2.4.35.4/arch/mips/defconfig-ddb5477
  5812. ===================================================================
  5813. --- linux-2.4.35.4.orig/arch/mips/defconfig-ddb5477
  5814. +++ linux-2.4.35.4/arch/mips/defconfig-ddb5477
  5815. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  5816. # CONFIG_MIPS_PB1000 is not set
  5817. # CONFIG_MIPS_PB1100 is not set
  5818. # CONFIG_MIPS_PB1500 is not set
  5819. -# CONFIG_MIPS_HYDROGEN3 is not set
  5820. # CONFIG_MIPS_PB1550 is not set
  5821. +# CONFIG_MIPS_HYDROGEN3 is not set
  5822. # CONFIG_MIPS_XXS1500 is not set
  5823. # CONFIG_MIPS_MTX1 is not set
  5824. # CONFIG_COGENT_CSB250 is not set
  5825. @@ -226,11 +226,6 @@ CONFIG_IP_PNP_BOOTP=y
  5826. #
  5827. # CONFIG_IPX is not set
  5828. # CONFIG_ATALK is not set
  5829. -
  5830. -#
  5831. -# Appletalk devices
  5832. -#
  5833. -# CONFIG_DEV_APPLETALK is not set
  5834. # CONFIG_DECNET is not set
  5835. # CONFIG_BRIDGE is not set
  5836. # CONFIG_X25 is not set
  5837. @@ -434,7 +429,6 @@ CONFIG_SERIAL=y
  5838. CONFIG_SERIAL_CONSOLE=y
  5839. # CONFIG_SERIAL_EXTENDED is not set
  5840. # CONFIG_SERIAL_NONSTANDARD is not set
  5841. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  5842. CONFIG_UNIX98_PTYS=y
  5843. CONFIG_UNIX98_PTY_COUNT=256
  5844. Index: linux-2.4.35.4/arch/mips/defconfig-decstation
  5845. ===================================================================
  5846. --- linux-2.4.35.4.orig/arch/mips/defconfig-decstation
  5847. +++ linux-2.4.35.4/arch/mips/defconfig-decstation
  5848. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  5849. # CONFIG_MIPS_PB1000 is not set
  5850. # CONFIG_MIPS_PB1100 is not set
  5851. # CONFIG_MIPS_PB1500 is not set
  5852. -# CONFIG_MIPS_HYDROGEN3 is not set
  5853. # CONFIG_MIPS_PB1550 is not set
  5854. +# CONFIG_MIPS_HYDROGEN3 is not set
  5855. # CONFIG_MIPS_XXS1500 is not set
  5856. # CONFIG_MIPS_MTX1 is not set
  5857. # CONFIG_COGENT_CSB250 is not set
  5858. @@ -223,11 +223,6 @@ CONFIG_IP_PNP_BOOTP=y
  5859. #
  5860. # CONFIG_IPX is not set
  5861. # CONFIG_ATALK is not set
  5862. -
  5863. -#
  5864. -# Appletalk devices
  5865. -#
  5866. -# CONFIG_DEV_APPLETALK is not set
  5867. # CONFIG_DECNET is not set
  5868. # CONFIG_BRIDGE is not set
  5869. # CONFIG_X25 is not set
  5870. @@ -306,9 +301,11 @@ CONFIG_SCSI_DECNCR=y
  5871. # CONFIG_SCSI_MEGARAID is not set
  5872. # CONFIG_SCSI_MEGARAID2 is not set
  5873. # CONFIG_SCSI_SATA is not set
  5874. +# CONFIG_SCSI_SATA_AHCI is not set
  5875. # CONFIG_SCSI_SATA_SVW is not set
  5876. # CONFIG_SCSI_ATA_PIIX is not set
  5877. # CONFIG_SCSI_SATA_NV is not set
  5878. +# CONFIG_SCSI_SATA_QSTOR is not set
  5879. # CONFIG_SCSI_SATA_PROMISE is not set
  5880. # CONFIG_SCSI_SATA_SX4 is not set
  5881. # CONFIG_SCSI_SATA_SIL is not set
  5882. @@ -477,7 +474,6 @@ CONFIG_SERIAL_DEC=y
  5883. CONFIG_SERIAL_DEC_CONSOLE=y
  5884. CONFIG_DZ=y
  5885. CONFIG_ZS=y
  5886. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  5887. CONFIG_UNIX98_PTYS=y
  5888. CONFIG_UNIX98_PTY_COUNT=256
  5889. Index: linux-2.4.35.4/arch/mips/defconfig-e55
  5890. ===================================================================
  5891. --- linux-2.4.35.4.orig/arch/mips/defconfig-e55
  5892. +++ linux-2.4.35.4/arch/mips/defconfig-e55
  5893. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  5894. # CONFIG_MIPS_PB1000 is not set
  5895. # CONFIG_MIPS_PB1100 is not set
  5896. # CONFIG_MIPS_PB1500 is not set
  5897. -# CONFIG_MIPS_HYDROGEN3 is not set
  5898. # CONFIG_MIPS_PB1550 is not set
  5899. +# CONFIG_MIPS_HYDROGEN3 is not set
  5900. # CONFIG_MIPS_XXS1500 is not set
  5901. # CONFIG_MIPS_MTX1 is not set
  5902. # CONFIG_COGENT_CSB250 is not set
  5903. @@ -222,11 +222,6 @@ CONFIG_IP_MULTICAST=y
  5904. #
  5905. # CONFIG_IPX is not set
  5906. # CONFIG_ATALK is not set
  5907. -
  5908. -#
  5909. -# Appletalk devices
  5910. -#
  5911. -# CONFIG_DEV_APPLETALK is not set
  5912. # CONFIG_DECNET is not set
  5913. # CONFIG_BRIDGE is not set
  5914. # CONFIG_X25 is not set
  5915. @@ -426,7 +421,6 @@ CONFIG_SERIAL_MANY_PORTS=y
  5916. # CONFIG_SERIAL_MULTIPORT is not set
  5917. # CONFIG_HUB6 is not set
  5918. # CONFIG_SERIAL_NONSTANDARD is not set
  5919. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  5920. # CONFIG_VR41XX_KIU is not set
  5921. CONFIG_UNIX98_PTYS=y
  5922. CONFIG_UNIX98_PTY_COUNT=256
  5923. Index: linux-2.4.35.4/arch/mips/defconfig-eagle
  5924. ===================================================================
  5925. --- linux-2.4.35.4.orig/arch/mips/defconfig-eagle
  5926. +++ linux-2.4.35.4/arch/mips/defconfig-eagle
  5927. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  5928. # CONFIG_MIPS_PB1000 is not set
  5929. # CONFIG_MIPS_PB1100 is not set
  5930. # CONFIG_MIPS_PB1500 is not set
  5931. -# CONFIG_MIPS_HYDROGEN3 is not set
  5932. # CONFIG_MIPS_PB1550 is not set
  5933. +# CONFIG_MIPS_HYDROGEN3 is not set
  5934. # CONFIG_MIPS_XXS1500 is not set
  5935. # CONFIG_MIPS_MTX1 is not set
  5936. # CONFIG_COGENT_CSB250 is not set
  5937. @@ -208,8 +208,8 @@ CONFIG_MTD_CFI_INTELEXT=y
  5938. # Mapping drivers for chip access
  5939. #
  5940. CONFIG_MTD_PHYSMAP=y
  5941. -CONFIG_MTD_PHYSMAP_START=1c000000
  5942. -CONFIG_MTD_PHYSMAP_LEN=2000000
  5943. +CONFIG_MTD_PHYSMAP_START=0x1c000000
  5944. +CONFIG_MTD_PHYSMAP_LEN=0x2000000
  5945. CONFIG_MTD_PHYSMAP_BUSWIDTH=4
  5946. # CONFIG_MTD_PB1000 is not set
  5947. # CONFIG_MTD_PB1500 is not set
  5948. @@ -217,9 +217,7 @@ CONFIG_MTD_PHYSMAP_BUSWIDTH=4
  5949. # CONFIG_MTD_BOSPORUS is not set
  5950. # CONFIG_MTD_XXS1500 is not set
  5951. # CONFIG_MTD_MTX1 is not set
  5952. -# CONFIG_MTD_DB1X00 is not set
  5953. # CONFIG_MTD_PB1550 is not set
  5954. -# CONFIG_MTD_HYDROGEN3 is not set
  5955. # CONFIG_MTD_MIRAGE is not set
  5956. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  5957. # CONFIG_MTD_OCELOT is not set
  5958. @@ -238,7 +236,6 @@ CONFIG_MTD_PHYSMAP_BUSWIDTH=4
  5959. #
  5960. # Disk-On-Chip Device Drivers
  5961. #
  5962. -# CONFIG_MTD_DOC1000 is not set
  5963. # CONFIG_MTD_DOC2000 is not set
  5964. # CONFIG_MTD_DOC2001 is not set
  5965. # CONFIG_MTD_DOCPROBE is not set
  5966. @@ -327,11 +324,6 @@ CONFIG_IP_PNP_BOOTP=y
  5967. #
  5968. # CONFIG_IPX is not set
  5969. # CONFIG_ATALK is not set
  5970. -
  5971. -#
  5972. -# Appletalk devices
  5973. -#
  5974. -# CONFIG_DEV_APPLETALK is not set
  5975. # CONFIG_DECNET is not set
  5976. # CONFIG_BRIDGE is not set
  5977. # CONFIG_X25 is not set
  5978. @@ -587,7 +579,6 @@ CONFIG_SERIAL=y
  5979. CONFIG_SERIAL_CONSOLE=y
  5980. # CONFIG_SERIAL_EXTENDED is not set
  5981. # CONFIG_SERIAL_NONSTANDARD is not set
  5982. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  5983. # CONFIG_VR41XX_KIU is not set
  5984. CONFIG_UNIX98_PTYS=y
  5985. CONFIG_UNIX98_PTY_COUNT=256
  5986. Index: linux-2.4.35.4/arch/mips/defconfig-ev64120
  5987. ===================================================================
  5988. --- linux-2.4.35.4.orig/arch/mips/defconfig-ev64120
  5989. +++ linux-2.4.35.4/arch/mips/defconfig-ev64120
  5990. @@ -30,8 +30,8 @@ CONFIG_MODULES=y
  5991. # CONFIG_MIPS_PB1000 is not set
  5992. # CONFIG_MIPS_PB1100 is not set
  5993. # CONFIG_MIPS_PB1500 is not set
  5994. -# CONFIG_MIPS_HYDROGEN3 is not set
  5995. # CONFIG_MIPS_PB1550 is not set
  5996. +# CONFIG_MIPS_HYDROGEN3 is not set
  5997. # CONFIG_MIPS_XXS1500 is not set
  5998. # CONFIG_MIPS_MTX1 is not set
  5999. # CONFIG_COGENT_CSB250 is not set
  6000. @@ -230,11 +230,6 @@ CONFIG_IP_PNP=y
  6001. #
  6002. # CONFIG_IPX is not set
  6003. # CONFIG_ATALK is not set
  6004. -
  6005. -#
  6006. -# Appletalk devices
  6007. -#
  6008. -# CONFIG_DEV_APPLETALK is not set
  6009. # CONFIG_DECNET is not set
  6010. # CONFIG_BRIDGE is not set
  6011. # CONFIG_X25 is not set
  6012. @@ -443,7 +438,6 @@ CONFIG_SERIAL=y
  6013. # CONFIG_SERIAL_CONSOLE is not set
  6014. # CONFIG_SERIAL_EXTENDED is not set
  6015. # CONFIG_SERIAL_NONSTANDARD is not set
  6016. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  6017. CONFIG_UNIX98_PTYS=y
  6018. CONFIG_UNIX98_PTY_COUNT=256
  6019. Index: linux-2.4.35.4/arch/mips/defconfig-ev96100
  6020. ===================================================================
  6021. --- linux-2.4.35.4.orig/arch/mips/defconfig-ev96100
  6022. +++ linux-2.4.35.4/arch/mips/defconfig-ev96100
  6023. @@ -30,8 +30,8 @@ CONFIG_MODULES=y
  6024. # CONFIG_MIPS_PB1000 is not set
  6025. # CONFIG_MIPS_PB1100 is not set
  6026. # CONFIG_MIPS_PB1500 is not set
  6027. -# CONFIG_MIPS_HYDROGEN3 is not set
  6028. # CONFIG_MIPS_PB1550 is not set
  6029. +# CONFIG_MIPS_HYDROGEN3 is not set
  6030. # CONFIG_MIPS_XXS1500 is not set
  6031. # CONFIG_MIPS_MTX1 is not set
  6032. # CONFIG_COGENT_CSB250 is not set
  6033. @@ -232,11 +232,6 @@ CONFIG_IP_PNP_BOOTP=y
  6034. #
  6035. # CONFIG_IPX is not set
  6036. # CONFIG_ATALK is not set
  6037. -
  6038. -#
  6039. -# Appletalk devices
  6040. -#
  6041. -# CONFIG_DEV_APPLETALK is not set
  6042. # CONFIG_DECNET is not set
  6043. # CONFIG_BRIDGE is not set
  6044. # CONFIG_X25 is not set
  6045. @@ -441,7 +436,6 @@ CONFIG_SERIAL=y
  6046. CONFIG_SERIAL_CONSOLE=y
  6047. # CONFIG_SERIAL_EXTENDED is not set
  6048. # CONFIG_SERIAL_NONSTANDARD is not set
  6049. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  6050. CONFIG_UNIX98_PTYS=y
  6051. CONFIG_UNIX98_PTY_COUNT=256
  6052. Index: linux-2.4.35.4/arch/mips/defconfig-ficmmp
  6053. ===================================================================
  6054. --- /dev/null
  6055. +++ linux-2.4.35.4/arch/mips/defconfig-ficmmp
  6056. @@ -0,0 +1,862 @@
  6057. +#
  6058. +# Automatically generated make config: don't edit
  6059. +#
  6060. +CONFIG_MIPS=y
  6061. +CONFIG_MIPS32=y
  6062. +# CONFIG_MIPS64 is not set
  6063. +
  6064. +#
  6065. +# Code maturity level options
  6066. +#
  6067. +CONFIG_EXPERIMENTAL=y
  6068. +
  6069. +#
  6070. +# Loadable module support
  6071. +#
  6072. +CONFIG_MODULES=y
  6073. +# CONFIG_MODVERSIONS is not set
  6074. +CONFIG_KMOD=y
  6075. +
  6076. +#
  6077. +# Machine selection
  6078. +#
  6079. +# CONFIG_ACER_PICA_61 is not set
  6080. +# CONFIG_MIPS_BOSPORUS is not set
  6081. +# CONFIG_MIPS_MIRAGE is not set
  6082. +# CONFIG_MIPS_DB1000 is not set
  6083. +# CONFIG_MIPS_DB1100 is not set
  6084. +# CONFIG_MIPS_DB1500 is not set
  6085. +# CONFIG_MIPS_DB1550 is not set
  6086. +# CONFIG_MIPS_PB1000 is not set
  6087. +# CONFIG_MIPS_PB1100 is not set
  6088. +# CONFIG_MIPS_PB1500 is not set
  6089. +# CONFIG_MIPS_PB1550 is not set
  6090. +# CONFIG_MIPS_HYDROGEN3 is not set
  6091. +# CONFIG_MIPS_XXS1500 is not set
  6092. +# CONFIG_MIPS_MTX1 is not set
  6093. +# CONFIG_COGENT_CSB250 is not set
  6094. +# CONFIG_BAGET_MIPS is not set
  6095. +# CONFIG_CASIO_E55 is not set
  6096. +# CONFIG_MIPS_COBALT is not set
  6097. +# CONFIG_DECSTATION is not set
  6098. +# CONFIG_MIPS_EV64120 is not set
  6099. +# CONFIG_MIPS_EV96100 is not set
  6100. +# CONFIG_MIPS_IVR is not set
  6101. +# CONFIG_HP_LASERJET is not set
  6102. +# CONFIG_IBM_WORKPAD is not set
  6103. +# CONFIG_LASAT is not set
  6104. +# CONFIG_MIPS_ITE8172 is not set
  6105. +# CONFIG_MIPS_ATLAS is not set
  6106. +# CONFIG_MIPS_MAGNUM_4000 is not set
  6107. +# CONFIG_MIPS_MALTA is not set
  6108. +# CONFIG_MIPS_SEAD is not set
  6109. +# CONFIG_MOMENCO_OCELOT is not set
  6110. +# CONFIG_MOMENCO_OCELOT_G is not set
  6111. +# CONFIG_MOMENCO_OCELOT_C is not set
  6112. +# CONFIG_MOMENCO_JAGUAR_ATX is not set
  6113. +# CONFIG_PMC_BIG_SUR is not set
  6114. +# CONFIG_PMC_STRETCH is not set
  6115. +# CONFIG_PMC_YOSEMITE is not set
  6116. +# CONFIG_DDB5074 is not set
  6117. +# CONFIG_DDB5476 is not set
  6118. +# CONFIG_DDB5477 is not set
  6119. +# CONFIG_NEC_OSPREY is not set
  6120. +# CONFIG_NEC_EAGLE is not set
  6121. +# CONFIG_OLIVETTI_M700 is not set
  6122. +# CONFIG_NINO is not set
  6123. +# CONFIG_SGI_IP22 is not set
  6124. +# CONFIG_SGI_IP27 is not set
  6125. +# CONFIG_SIBYTE_SB1xxx_SOC is not set
  6126. +# CONFIG_SNI_RM200_PCI is not set
  6127. +# CONFIG_TANBAC_TB0226 is not set
  6128. +# CONFIG_TANBAC_TB0229 is not set
  6129. +# CONFIG_TOSHIBA_JMR3927 is not set
  6130. +# CONFIG_TOSHIBA_RBTX4927 is not set
  6131. +# CONFIG_VICTOR_MPC30X is not set
  6132. +# CONFIG_ZAO_CAPCELLA is not set
  6133. +# CONFIG_HIGHMEM is not set
  6134. +CONFIG_RWSEM_GENERIC_SPINLOCK=y
  6135. +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
  6136. +# CONFIG_MIPS_AU1000 is not set
  6137. +
  6138. +#
  6139. +# CPU selection
  6140. +#
  6141. +CONFIG_CPU_MIPS32=y
  6142. +# CONFIG_CPU_MIPS64 is not set
  6143. +# CONFIG_CPU_R3000 is not set
  6144. +# CONFIG_CPU_TX39XX is not set
  6145. +# CONFIG_CPU_VR41XX is not set
  6146. +# CONFIG_CPU_R4300 is not set
  6147. +# CONFIG_CPU_R4X00 is not set
  6148. +# CONFIG_CPU_TX49XX is not set
  6149. +# CONFIG_CPU_R5000 is not set
  6150. +# CONFIG_CPU_R5432 is not set
  6151. +# CONFIG_CPU_R6000 is not set
  6152. +# CONFIG_CPU_NEVADA is not set
  6153. +# CONFIG_CPU_R8000 is not set
  6154. +# CONFIG_CPU_R10000 is not set
  6155. +# CONFIG_CPU_RM7000 is not set
  6156. +# CONFIG_CPU_RM9000 is not set
  6157. +# CONFIG_CPU_SB1 is not set
  6158. +CONFIG_PAGE_SIZE_4KB=y
  6159. +# CONFIG_PAGE_SIZE_16KB is not set
  6160. +# CONFIG_PAGE_SIZE_64KB is not set
  6161. +CONFIG_CPU_HAS_PREFETCH=y
  6162. +# CONFIG_VTAG_ICACHE is not set
  6163. +CONFIG_64BIT_PHYS_ADDR=y
  6164. +# CONFIG_CPU_ADVANCED is not set
  6165. +CONFIG_CPU_HAS_LLSC=y
  6166. +# CONFIG_CPU_HAS_LLDSCD is not set
  6167. +# CONFIG_CPU_HAS_WB is not set
  6168. +CONFIG_CPU_HAS_SYNC=y
  6169. +
  6170. +#
  6171. +# General setup
  6172. +#
  6173. +CONFIG_CPU_LITTLE_ENDIAN=y
  6174. +# CONFIG_BUILD_ELF64 is not set
  6175. +CONFIG_NET=y
  6176. +# CONFIG_PCI is not set
  6177. +# CONFIG_PCI_NEW is not set
  6178. +CONFIG_PCI_AUTO=y
  6179. +# CONFIG_ISA is not set
  6180. +# CONFIG_TC is not set
  6181. +# CONFIG_MCA is not set
  6182. +# CONFIG_SBUS is not set
  6183. +# CONFIG_HOTPLUG is not set
  6184. +# CONFIG_PCMCIA is not set
  6185. +# CONFIG_HOTPLUG_PCI is not set
  6186. +CONFIG_SYSVIPC=y
  6187. +# CONFIG_BSD_PROCESS_ACCT is not set
  6188. +CONFIG_SYSCTL=y
  6189. +CONFIG_KCORE_ELF=y
  6190. +# CONFIG_KCORE_AOUT is not set
  6191. +# CONFIG_BINFMT_AOUT is not set
  6192. +CONFIG_BINFMT_ELF=y
  6193. +# CONFIG_MIPS32_COMPAT is not set
  6194. +# CONFIG_MIPS32_O32 is not set
  6195. +# CONFIG_MIPS32_N32 is not set
  6196. +# CONFIG_BINFMT_ELF32 is not set
  6197. +# CONFIG_BINFMT_MISC is not set
  6198. +# CONFIG_OOM_KILLER is not set
  6199. +CONFIG_CMDLINE_BOOL=y
  6200. +CONFIG_CMDLINE="ide3=dma mem=96M root=/dev/hda2 rootflags=data=journal"
  6201. +
  6202. +#
  6203. +# Memory Technology Devices (MTD)
  6204. +#
  6205. +# CONFIG_MTD is not set
  6206. +
  6207. +#
  6208. +# Parallel port support
  6209. +#
  6210. +# CONFIG_PARPORT is not set
  6211. +
  6212. +#
  6213. +# Plug and Play configuration
  6214. +#
  6215. +# CONFIG_PNP is not set
  6216. +# CONFIG_ISAPNP is not set
  6217. +
  6218. +#
  6219. +# Block devices
  6220. +#
  6221. +# CONFIG_BLK_DEV_FD is not set
  6222. +# CONFIG_BLK_DEV_XD is not set
  6223. +# CONFIG_PARIDE is not set
  6224. +# CONFIG_BLK_CPQ_DA is not set
  6225. +# CONFIG_BLK_CPQ_CISS_DA is not set
  6226. +# CONFIG_CISS_SCSI_TAPE is not set
  6227. +# CONFIG_CISS_MONITOR_THREAD is not set
  6228. +# CONFIG_BLK_DEV_DAC960 is not set
  6229. +# CONFIG_BLK_DEV_UMEM is not set
  6230. +# CONFIG_BLK_DEV_SX8 is not set
  6231. +CONFIG_BLK_DEV_LOOP=y
  6232. +# CONFIG_BLK_DEV_NBD is not set
  6233. +# CONFIG_BLK_DEV_RAM is not set
  6234. +# CONFIG_BLK_DEV_INITRD is not set
  6235. +# CONFIG_BLK_STATS is not set
  6236. +
  6237. +#
  6238. +# Multi-device support (RAID and LVM)
  6239. +#
  6240. +# CONFIG_MD is not set
  6241. +# CONFIG_BLK_DEV_MD is not set
  6242. +# CONFIG_MD_LINEAR is not set
  6243. +# CONFIG_MD_RAID0 is not set
  6244. +# CONFIG_MD_RAID1 is not set
  6245. +# CONFIG_MD_RAID5 is not set
  6246. +# CONFIG_MD_MULTIPATH is not set
  6247. +# CONFIG_BLK_DEV_LVM is not set
  6248. +
  6249. +#
  6250. +# Networking options
  6251. +#
  6252. +CONFIG_PACKET=y
  6253. +# CONFIG_PACKET_MMAP is not set
  6254. +# CONFIG_NETLINK_DEV is not set
  6255. +CONFIG_NETFILTER=y
  6256. +# CONFIG_NETFILTER_DEBUG is not set
  6257. +CONFIG_FILTER=y
  6258. +CONFIG_UNIX=y
  6259. +CONFIG_INET=y
  6260. +CONFIG_IP_MULTICAST=y
  6261. +# CONFIG_IP_ADVANCED_ROUTER is not set
  6262. +# CONFIG_IP_PNP is not set
  6263. +# CONFIG_NET_IPIP is not set
  6264. +# CONFIG_NET_IPGRE is not set
  6265. +# CONFIG_IP_MROUTE is not set
  6266. +# CONFIG_ARPD is not set
  6267. +# CONFIG_INET_ECN is not set
  6268. +# CONFIG_SYN_COOKIES is not set
  6269. +
  6270. +#
  6271. +# IP: Netfilter Configuration
  6272. +#
  6273. +# CONFIG_IP_NF_CONNTRACK is not set
  6274. +# CONFIG_IP_NF_QUEUE is not set
  6275. +# CONFIG_IP_NF_IPTABLES is not set
  6276. +# CONFIG_IP_NF_ARPTABLES is not set
  6277. +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
  6278. +# CONFIG_IP_NF_COMPAT_IPFWADM is not set
  6279. +
  6280. +#
  6281. +# IP: Virtual Server Configuration
  6282. +#
  6283. +# CONFIG_IP_VS is not set
  6284. +# CONFIG_IPV6 is not set
  6285. +# CONFIG_KHTTPD is not set
  6286. +
  6287. +#
  6288. +# SCTP Configuration (EXPERIMENTAL)
  6289. +#
  6290. +# CONFIG_IP_SCTP is not set
  6291. +# CONFIG_ATM is not set
  6292. +# CONFIG_VLAN_8021Q is not set
  6293. +
  6294. +#
  6295. +#
  6296. +#
  6297. +# CONFIG_IPX is not set
  6298. +# CONFIG_ATALK is not set
  6299. +# CONFIG_DECNET is not set
  6300. +# CONFIG_BRIDGE is not set
  6301. +# CONFIG_X25 is not set
  6302. +# CONFIG_LAPB is not set
  6303. +# CONFIG_LLC is not set
  6304. +# CONFIG_NET_DIVERT is not set
  6305. +# CONFIG_ECONET is not set
  6306. +# CONFIG_WAN_ROUTER is not set
  6307. +# CONFIG_NET_FASTROUTE is not set
  6308. +# CONFIG_NET_HW_FLOWCONTROL is not set
  6309. +
  6310. +#
  6311. +# QoS and/or fair queueing
  6312. +#
  6313. +# CONFIG_NET_SCHED is not set
  6314. +
  6315. +#
  6316. +# Network testing
  6317. +#
  6318. +# CONFIG_NET_PKTGEN is not set
  6319. +
  6320. +#
  6321. +# Telephony Support
  6322. +#
  6323. +# CONFIG_PHONE is not set
  6324. +# CONFIG_PHONE_IXJ is not set
  6325. +# CONFIG_PHONE_IXJ_PCMCIA is not set
  6326. +
  6327. +#
  6328. +# ATA/IDE/MFM/RLL support
  6329. +#
  6330. +CONFIG_IDE=y
  6331. +
  6332. +#
  6333. +# IDE, ATA and ATAPI Block devices
  6334. +#
  6335. +CONFIG_BLK_DEV_IDE=y
  6336. +
  6337. +#
  6338. +# Please see Documentation/ide.txt for help/info on IDE drives
  6339. +#
  6340. +CONFIG_BLK_DEV_HD_IDE=y
  6341. +CONFIG_BLK_DEV_HD=y
  6342. +# CONFIG_BLK_DEV_IDE_SATA is not set
  6343. +CONFIG_BLK_DEV_IDEDISK=y
  6344. +CONFIG_IDEDISK_MULTI_MODE=y
  6345. +CONFIG_IDEDISK_STROKE=y
  6346. +# CONFIG_BLK_DEV_IDECS is not set
  6347. +# CONFIG_BLK_DEV_DELKIN is not set
  6348. +# CONFIG_BLK_DEV_IDECD is not set
  6349. +# CONFIG_BLK_DEV_IDETAPE is not set
  6350. +# CONFIG_BLK_DEV_IDEFLOPPY is not set
  6351. +# CONFIG_BLK_DEV_IDESCSI is not set
  6352. +# CONFIG_IDE_TASK_IOCTL is not set
  6353. +
  6354. +#
  6355. +# IDE chipset support/bugfixes
  6356. +#
  6357. +# CONFIG_BLK_DEV_CMD640 is not set
  6358. +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
  6359. +# CONFIG_BLK_DEV_ISAPNP is not set
  6360. +# CONFIG_IDE_CHIPSETS is not set
  6361. +# CONFIG_IDEDMA_AUTO is not set
  6362. +# CONFIG_DMA_NONPCI is not set
  6363. +# CONFIG_BLK_DEV_ATARAID is not set
  6364. +# CONFIG_BLK_DEV_ATARAID_PDC is not set
  6365. +# CONFIG_BLK_DEV_ATARAID_HPT is not set
  6366. +# CONFIG_BLK_DEV_ATARAID_MEDLEY is not set
  6367. +# CONFIG_BLK_DEV_ATARAID_SII is not set
  6368. +
  6369. +#
  6370. +# SCSI support
  6371. +#
  6372. +CONFIG_SCSI=y
  6373. +
  6374. +#
  6375. +# SCSI support type (disk, tape, CD-ROM)
  6376. +#
  6377. +CONFIG_BLK_DEV_SD=y
  6378. +CONFIG_SD_EXTRA_DEVS=40
  6379. +CONFIG_CHR_DEV_ST=y
  6380. +# CONFIG_CHR_DEV_OSST is not set
  6381. +CONFIG_BLK_DEV_SR=y
  6382. +# CONFIG_BLK_DEV_SR_VENDOR is not set
  6383. +CONFIG_SR_EXTRA_DEVS=2
  6384. +# CONFIG_CHR_DEV_SG is not set
  6385. +
  6386. +#
  6387. +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
  6388. +#
  6389. +# CONFIG_SCSI_DEBUG_QUEUES is not set
  6390. +# CONFIG_SCSI_MULTI_LUN is not set
  6391. +CONFIG_SCSI_CONSTANTS=y
  6392. +# CONFIG_SCSI_LOGGING is not set
  6393. +
  6394. +#
  6395. +# SCSI low-level drivers
  6396. +#
  6397. +# CONFIG_SCSI_7000FASST is not set
  6398. +# CONFIG_SCSI_ACARD is not set
  6399. +# CONFIG_SCSI_AHA152X is not set
  6400. +# CONFIG_SCSI_AHA1542 is not set
  6401. +# CONFIG_SCSI_AHA1740 is not set
  6402. +# CONFIG_SCSI_AACRAID is not set
  6403. +# CONFIG_SCSI_AIC7XXX is not set
  6404. +# CONFIG_SCSI_AIC79XX is not set
  6405. +# CONFIG_SCSI_AIC7XXX_OLD is not set
  6406. +# CONFIG_SCSI_DPT_I2O is not set
  6407. +# CONFIG_SCSI_ADVANSYS is not set
  6408. +# CONFIG_SCSI_IN2000 is not set
  6409. +# CONFIG_SCSI_AM53C974 is not set
  6410. +# CONFIG_SCSI_MEGARAID is not set
  6411. +# CONFIG_SCSI_MEGARAID2 is not set
  6412. +# CONFIG_SCSI_SATA is not set
  6413. +# CONFIG_SCSI_SATA_AHCI is not set
  6414. +# CONFIG_SCSI_SATA_SVW is not set
  6415. +# CONFIG_SCSI_ATA_PIIX is not set
  6416. +# CONFIG_SCSI_SATA_NV is not set
  6417. +# CONFIG_SCSI_SATA_QSTOR is not set
  6418. +# CONFIG_SCSI_SATA_PROMISE is not set
  6419. +# CONFIG_SCSI_SATA_SX4 is not set
  6420. +# CONFIG_SCSI_SATA_SIL is not set
  6421. +# CONFIG_SCSI_SATA_SIS is not set
  6422. +# CONFIG_SCSI_SATA_ULI is not set
  6423. +# CONFIG_SCSI_SATA_VIA is not set
  6424. +# CONFIG_SCSI_SATA_VITESSE is not set
  6425. +# CONFIG_SCSI_BUSLOGIC is not set
  6426. +# CONFIG_SCSI_DMX3191D is not set
  6427. +# CONFIG_SCSI_DTC3280 is not set
  6428. +# CONFIG_SCSI_EATA is not set
  6429. +# CONFIG_SCSI_EATA_DMA is not set
  6430. +# CONFIG_SCSI_EATA_PIO is not set
  6431. +# CONFIG_SCSI_FUTURE_DOMAIN is not set
  6432. +# CONFIG_SCSI_GDTH is not set
  6433. +# CONFIG_SCSI_GENERIC_NCR5380 is not set
  6434. +# CONFIG_SCSI_INITIO is not set
  6435. +# CONFIG_SCSI_INIA100 is not set
  6436. +# CONFIG_SCSI_NCR53C406A is not set
  6437. +# CONFIG_SCSI_NCR53C7xx is not set
  6438. +# CONFIG_SCSI_PAS16 is not set
  6439. +# CONFIG_SCSI_PCI2000 is not set
  6440. +# CONFIG_SCSI_PCI2220I is not set
  6441. +# CONFIG_SCSI_PSI240I is not set
  6442. +# CONFIG_SCSI_QLOGIC_FAS is not set
  6443. +# CONFIG_SCSI_SIM710 is not set
  6444. +# CONFIG_SCSI_SYM53C416 is not set
  6445. +# CONFIG_SCSI_T128 is not set
  6446. +# CONFIG_SCSI_U14_34F is not set
  6447. +# CONFIG_SCSI_NSP32 is not set
  6448. +# CONFIG_SCSI_DEBUG is not set
  6449. +
  6450. +#
  6451. +# Fusion MPT device support
  6452. +#
  6453. +# CONFIG_FUSION is not set
  6454. +# CONFIG_FUSION_BOOT is not set
  6455. +# CONFIG_FUSION_ISENSE is not set
  6456. +# CONFIG_FUSION_CTL is not set
  6457. +# CONFIG_FUSION_LAN is not set
  6458. +
  6459. +#
  6460. +# Network device support
  6461. +#
  6462. +CONFIG_NETDEVICES=y
  6463. +
  6464. +#
  6465. +# ARCnet devices
  6466. +#
  6467. +# CONFIG_ARCNET is not set
  6468. +# CONFIG_DUMMY is not set
  6469. +# CONFIG_BONDING is not set
  6470. +# CONFIG_EQUALIZER is not set
  6471. +# CONFIG_TUN is not set
  6472. +# CONFIG_ETHERTAP is not set
  6473. +
  6474. +#
  6475. +# Ethernet (10 or 100Mbit)
  6476. +#
  6477. +CONFIG_NET_ETHERNET=y
  6478. +# CONFIG_SUNLANCE is not set
  6479. +# CONFIG_SUNBMAC is not set
  6480. +# CONFIG_SUNQE is not set
  6481. +# CONFIG_SUNGEM is not set
  6482. +# CONFIG_NET_VENDOR_3COM is not set
  6483. +# CONFIG_LANCE is not set
  6484. +# CONFIG_NET_VENDOR_SMC is not set
  6485. +# CONFIG_NET_VENDOR_RACAL is not set
  6486. +# CONFIG_NET_ISA is not set
  6487. +# CONFIG_NET_PCI is not set
  6488. +# CONFIG_NET_POCKET is not set
  6489. +
  6490. +#
  6491. +# Ethernet (1000 Mbit)
  6492. +#
  6493. +# CONFIG_ACENIC is not set
  6494. +# CONFIG_DL2K is not set
  6495. +# CONFIG_E1000 is not set
  6496. +# CONFIG_MYRI_SBUS is not set
  6497. +# CONFIG_NS83820 is not set
  6498. +# CONFIG_HAMACHI is not set
  6499. +# CONFIG_YELLOWFIN is not set
  6500. +# CONFIG_R8169 is not set
  6501. +# CONFIG_SK98LIN is not set
  6502. +# CONFIG_TIGON3 is not set
  6503. +# CONFIG_FDDI is not set
  6504. +# CONFIG_HIPPI is not set
  6505. +# CONFIG_PLIP is not set
  6506. +# CONFIG_PPP is not set
  6507. +# CONFIG_SLIP is not set
  6508. +
  6509. +#
  6510. +# Wireless LAN (non-hamradio)
  6511. +#
  6512. +# CONFIG_NET_RADIO is not set
  6513. +
  6514. +#
  6515. +# Token Ring devices
  6516. +#
  6517. +# CONFIG_TR is not set
  6518. +# CONFIG_NET_FC is not set
  6519. +# CONFIG_RCPCI is not set
  6520. +# CONFIG_SHAPER is not set
  6521. +
  6522. +#
  6523. +# Wan interfaces
  6524. +#
  6525. +# CONFIG_WAN is not set
  6526. +
  6527. +#
  6528. +# Amateur Radio support
  6529. +#
  6530. +# CONFIG_HAMRADIO is not set
  6531. +
  6532. +#
  6533. +# IrDA (infrared) support
  6534. +#
  6535. +# CONFIG_IRDA is not set
  6536. +
  6537. +#
  6538. +# ISDN subsystem
  6539. +#
  6540. +# CONFIG_ISDN is not set
  6541. +
  6542. +#
  6543. +# Input core support
  6544. +#
  6545. +CONFIG_INPUT=y
  6546. +CONFIG_INPUT_KEYBDEV=y
  6547. +CONFIG_INPUT_MOUSEDEV=y
  6548. +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
  6549. +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
  6550. +# CONFIG_INPUT_JOYDEV is not set
  6551. +CONFIG_INPUT_EVDEV=y
  6552. +# CONFIG_INPUT_UINPUT is not set
  6553. +
  6554. +#
  6555. +# Character devices
  6556. +#
  6557. +CONFIG_VT=y
  6558. +CONFIG_VT_CONSOLE=y
  6559. +# CONFIG_SERIAL is not set
  6560. +# CONFIG_SERIAL_EXTENDED is not set
  6561. +CONFIG_SERIAL_NONSTANDARD=y
  6562. +# CONFIG_COMPUTONE is not set
  6563. +# CONFIG_ROCKETPORT is not set
  6564. +# CONFIG_CYCLADES is not set
  6565. +# CONFIG_DIGIEPCA is not set
  6566. +# CONFIG_DIGI is not set
  6567. +# CONFIG_ESPSERIAL is not set
  6568. +# CONFIG_MOXA_INTELLIO is not set
  6569. +# CONFIG_MOXA_SMARTIO is not set
  6570. +# CONFIG_ISI is not set
  6571. +# CONFIG_SYNCLINK is not set
  6572. +# CONFIG_SYNCLINKMP is not set
  6573. +# CONFIG_N_HDLC is not set
  6574. +# CONFIG_RISCOM8 is not set
  6575. +# CONFIG_SPECIALIX is not set
  6576. +# CONFIG_SX is not set
  6577. +# CONFIG_RIO is not set
  6578. +# CONFIG_STALDRV is not set
  6579. +# CONFIG_SERIAL_TX3912 is not set
  6580. +# CONFIG_SERIAL_TX3912_CONSOLE is not set
  6581. +# CONFIG_SERIAL_TXX9 is not set
  6582. +# CONFIG_SERIAL_TXX9_CONSOLE is not set
  6583. +# CONFIG_TXX927_SERIAL is not set
  6584. +CONFIG_UNIX98_PTYS=y
  6585. +CONFIG_UNIX98_PTY_COUNT=256
  6586. +
  6587. +#
  6588. +# I2C support
  6589. +#
  6590. +CONFIG_I2C=y
  6591. +# CONFIG_I2C_ALGOBIT is not set
  6592. +# CONFIG_SCx200_ACB is not set
  6593. +# CONFIG_I2C_ALGOPCF is not set
  6594. +# CONFIG_I2C_CHARDEV is not set
  6595. +# CONFIG_I2C_PROC is not set
  6596. +
  6597. +#
  6598. +# Mice
  6599. +#
  6600. +# CONFIG_BUSMOUSE is not set
  6601. +# CONFIG_MOUSE is not set
  6602. +
  6603. +#
  6604. +# Joysticks
  6605. +#
  6606. +# CONFIG_INPUT_GAMEPORT is not set
  6607. +# CONFIG_INPUT_NS558 is not set
  6608. +# CONFIG_INPUT_LIGHTNING is not set
  6609. +# CONFIG_INPUT_PCIGAME is not set
  6610. +# CONFIG_INPUT_CS461X is not set
  6611. +# CONFIG_INPUT_EMU10K1 is not set
  6612. +# CONFIG_INPUT_SERIO is not set
  6613. +# CONFIG_INPUT_SERPORT is not set
  6614. +
  6615. +#
  6616. +# Joysticks
  6617. +#
  6618. +# CONFIG_INPUT_ANALOG is not set
  6619. +# CONFIG_INPUT_A3D is not set
  6620. +# CONFIG_INPUT_ADI is not set
  6621. +# CONFIG_INPUT_COBRA is not set
  6622. +# CONFIG_INPUT_GF2K is not set
  6623. +# CONFIG_INPUT_GRIP is not set
  6624. +# CONFIG_INPUT_INTERACT is not set
  6625. +# CONFIG_INPUT_TMDC is not set
  6626. +# CONFIG_INPUT_SIDEWINDER is not set
  6627. +# CONFIG_INPUT_IFORCE_USB is not set
  6628. +# CONFIG_INPUT_IFORCE_232 is not set
  6629. +# CONFIG_INPUT_WARRIOR is not set
  6630. +# CONFIG_INPUT_MAGELLAN is not set
  6631. +# CONFIG_INPUT_SPACEORB is not set
  6632. +# CONFIG_INPUT_SPACEBALL is not set
  6633. +# CONFIG_INPUT_STINGER is not set
  6634. +# CONFIG_INPUT_DB9 is not set
  6635. +# CONFIG_INPUT_GAMECON is not set
  6636. +# CONFIG_INPUT_TURBOGRAFX is not set
  6637. +# CONFIG_QIC02_TAPE is not set
  6638. +# CONFIG_IPMI_HANDLER is not set
  6639. +# CONFIG_IPMI_PANIC_EVENT is not set
  6640. +# CONFIG_IPMI_DEVICE_INTERFACE is not set
  6641. +# CONFIG_IPMI_KCS is not set
  6642. +# CONFIG_IPMI_WATCHDOG is not set
  6643. +
  6644. +#
  6645. +# Watchdog Cards
  6646. +#
  6647. +# CONFIG_WATCHDOG is not set
  6648. +# CONFIG_SCx200 is not set
  6649. +# CONFIG_SCx200_GPIO is not set
  6650. +# CONFIG_AMD_PM768 is not set
  6651. +# CONFIG_NVRAM is not set
  6652. +# CONFIG_RTC is not set
  6653. +# CONFIG_DTLK is not set
  6654. +# CONFIG_R3964 is not set
  6655. +# CONFIG_APPLICOM is not set
  6656. +
  6657. +#
  6658. +# Ftape, the floppy tape device driver
  6659. +#
  6660. +# CONFIG_FTAPE is not set
  6661. +# CONFIG_AGP is not set
  6662. +
  6663. +#
  6664. +# Direct Rendering Manager (XFree86 DRI support)
  6665. +#
  6666. +# CONFIG_DRM is not set
  6667. +
  6668. +#
  6669. +# File systems
  6670. +#
  6671. +# CONFIG_QUOTA is not set
  6672. +# CONFIG_QFMT_V2 is not set
  6673. +CONFIG_AUTOFS_FS=y
  6674. +# CONFIG_AUTOFS4_FS is not set
  6675. +# CONFIG_REISERFS_FS is not set
  6676. +# CONFIG_REISERFS_CHECK is not set
  6677. +# CONFIG_REISERFS_PROC_INFO is not set
  6678. +# CONFIG_ADFS_FS is not set
  6679. +# CONFIG_ADFS_FS_RW is not set
  6680. +# CONFIG_AFFS_FS is not set
  6681. +# CONFIG_HFS_FS is not set
  6682. +# CONFIG_HFSPLUS_FS is not set
  6683. +# CONFIG_BEFS_FS is not set
  6684. +# CONFIG_BEFS_DEBUG is not set
  6685. +# CONFIG_BFS_FS is not set
  6686. +CONFIG_EXT3_FS=y
  6687. +CONFIG_JBD=y
  6688. +# CONFIG_JBD_DEBUG is not set
  6689. +CONFIG_FAT_FS=y
  6690. +CONFIG_MSDOS_FS=y
  6691. +# CONFIG_UMSDOS_FS is not set
  6692. +CONFIG_VFAT_FS=y
  6693. +# CONFIG_EFS_FS is not set
  6694. +# CONFIG_JFFS_FS is not set
  6695. +# CONFIG_JFFS2_FS is not set
  6696. +# CONFIG_CRAMFS is not set
  6697. +# CONFIG_TMPFS is not set
  6698. +CONFIG_RAMFS=y
  6699. +# CONFIG_ISO9660_FS is not set
  6700. +# CONFIG_JOLIET is not set
  6701. +# CONFIG_ZISOFS is not set
  6702. +# CONFIG_JFS_FS is not set
  6703. +# CONFIG_JFS_DEBUG is not set
  6704. +# CONFIG_JFS_STATISTICS is not set
  6705. +# CONFIG_MINIX_FS is not set
  6706. +# CONFIG_VXFS_FS is not set
  6707. +# CONFIG_NTFS_FS is not set
  6708. +# CONFIG_NTFS_RW is not set
  6709. +# CONFIG_HPFS_FS is not set
  6710. +CONFIG_PROC_FS=y
  6711. +# CONFIG_DEVFS_FS is not set
  6712. +# CONFIG_DEVFS_MOUNT is not set
  6713. +# CONFIG_DEVFS_DEBUG is not set
  6714. +CONFIG_DEVPTS_FS=y
  6715. +# CONFIG_QNX4FS_FS is not set
  6716. +# CONFIG_QNX4FS_RW is not set
  6717. +# CONFIG_ROMFS_FS is not set
  6718. +CONFIG_EXT2_FS=y
  6719. +# CONFIG_SYSV_FS is not set
  6720. +# CONFIG_UDF_FS is not set
  6721. +# CONFIG_UDF_RW is not set
  6722. +# CONFIG_UFS_FS is not set
  6723. +# CONFIG_UFS_FS_WRITE is not set
  6724. +# CONFIG_XFS_FS is not set
  6725. +# CONFIG_XFS_QUOTA is not set
  6726. +# CONFIG_XFS_RT is not set
  6727. +# CONFIG_XFS_TRACE is not set
  6728. +# CONFIG_XFS_DEBUG is not set
  6729. +
  6730. +#
  6731. +# Network File Systems
  6732. +#
  6733. +# CONFIG_CODA_FS is not set
  6734. +# CONFIG_INTERMEZZO_FS is not set
  6735. +# CONFIG_NFS_FS is not set
  6736. +# CONFIG_NFS_V3 is not set
  6737. +# CONFIG_NFS_DIRECTIO is not set
  6738. +# CONFIG_ROOT_NFS is not set
  6739. +# CONFIG_NFSD is not set
  6740. +# CONFIG_NFSD_V3 is not set
  6741. +# CONFIG_NFSD_TCP is not set
  6742. +# CONFIG_SUNRPC is not set
  6743. +# CONFIG_LOCKD is not set
  6744. +# CONFIG_SMB_FS is not set
  6745. +# CONFIG_NCP_FS is not set
  6746. +# CONFIG_NCPFS_PACKET_SIGNING is not set
  6747. +# CONFIG_NCPFS_IOCTL_LOCKING is not set
  6748. +# CONFIG_NCPFS_STRONG is not set
  6749. +# CONFIG_NCPFS_NFS_NS is not set
  6750. +# CONFIG_NCPFS_OS2_NS is not set
  6751. +# CONFIG_NCPFS_SMALLDOS is not set
  6752. +# CONFIG_NCPFS_NLS is not set
  6753. +# CONFIG_NCPFS_EXTRAS is not set
  6754. +# CONFIG_ZISOFS_FS is not set
  6755. +
  6756. +#
  6757. +# Partition Types
  6758. +#
  6759. +# CONFIG_PARTITION_ADVANCED is not set
  6760. +CONFIG_MSDOS_PARTITION=y
  6761. +# CONFIG_SMB_NLS is not set
  6762. +CONFIG_NLS=y
  6763. +
  6764. +#
  6765. +# Native Language Support
  6766. +#
  6767. +CONFIG_NLS_DEFAULT="iso8859-1"
  6768. +# CONFIG_NLS_CODEPAGE_437 is not set
  6769. +# CONFIG_NLS_CODEPAGE_737 is not set
  6770. +# CONFIG_NLS_CODEPAGE_775 is not set
  6771. +# CONFIG_NLS_CODEPAGE_850 is not set
  6772. +# CONFIG_NLS_CODEPAGE_852 is not set
  6773. +# CONFIG_NLS_CODEPAGE_855 is not set
  6774. +# CONFIG_NLS_CODEPAGE_857 is not set
  6775. +# CONFIG_NLS_CODEPAGE_860 is not set
  6776. +# CONFIG_NLS_CODEPAGE_861 is not set
  6777. +# CONFIG_NLS_CODEPAGE_862 is not set
  6778. +# CONFIG_NLS_CODEPAGE_863 is not set
  6779. +# CONFIG_NLS_CODEPAGE_864 is not set
  6780. +# CONFIG_NLS_CODEPAGE_865 is not set
  6781. +# CONFIG_NLS_CODEPAGE_866 is not set
  6782. +# CONFIG_NLS_CODEPAGE_869 is not set
  6783. +# CONFIG_NLS_CODEPAGE_936 is not set
  6784. +# CONFIG_NLS_CODEPAGE_950 is not set
  6785. +# CONFIG_NLS_CODEPAGE_932 is not set
  6786. +# CONFIG_NLS_CODEPAGE_949 is not set
  6787. +# CONFIG_NLS_CODEPAGE_874 is not set
  6788. +# CONFIG_NLS_ISO8859_8 is not set
  6789. +# CONFIG_NLS_CODEPAGE_1250 is not set
  6790. +# CONFIG_NLS_CODEPAGE_1251 is not set
  6791. +# CONFIG_NLS_ISO8859_1 is not set
  6792. +# CONFIG_NLS_ISO8859_2 is not set
  6793. +# CONFIG_NLS_ISO8859_3 is not set
  6794. +# CONFIG_NLS_ISO8859_4 is not set
  6795. +# CONFIG_NLS_ISO8859_5 is not set
  6796. +# CONFIG_NLS_ISO8859_6 is not set
  6797. +# CONFIG_NLS_ISO8859_7 is not set
  6798. +# CONFIG_NLS_ISO8859_9 is not set
  6799. +# CONFIG_NLS_ISO8859_13 is not set
  6800. +# CONFIG_NLS_ISO8859_14 is not set
  6801. +# CONFIG_NLS_ISO8859_15 is not set
  6802. +# CONFIG_NLS_KOI8_R is not set
  6803. +# CONFIG_NLS_KOI8_U is not set
  6804. +# CONFIG_NLS_UTF8 is not set
  6805. +
  6806. +#
  6807. +# Multimedia devices
  6808. +#
  6809. +# CONFIG_VIDEO_DEV is not set
  6810. +
  6811. +#
  6812. +# Console drivers
  6813. +#
  6814. +# CONFIG_VGA_CONSOLE is not set
  6815. +# CONFIG_MDA_CONSOLE is not set
  6816. +
  6817. +#
  6818. +# Frame-buffer support
  6819. +#
  6820. +CONFIG_FB=y
  6821. +CONFIG_DUMMY_CONSOLE=y
  6822. +# CONFIG_FB_CYBER2000 is not set
  6823. +# CONFIG_FB_VIRTUAL is not set
  6824. +CONFIG_FBCON_ADVANCED=y
  6825. +# CONFIG_FBCON_MFB is not set
  6826. +# CONFIG_FBCON_CFB2 is not set
  6827. +# CONFIG_FBCON_CFB4 is not set
  6828. +# CONFIG_FBCON_CFB8 is not set
  6829. +CONFIG_FBCON_CFB16=y
  6830. +# CONFIG_FBCON_CFB24 is not set
  6831. +# CONFIG_FBCON_CFB32 is not set
  6832. +# CONFIG_FBCON_AFB is not set
  6833. +# CONFIG_FBCON_ILBM is not set
  6834. +# CONFIG_FBCON_IPLAN2P2 is not set
  6835. +# CONFIG_FBCON_IPLAN2P4 is not set
  6836. +# CONFIG_FBCON_IPLAN2P8 is not set
  6837. +# CONFIG_FBCON_MAC is not set
  6838. +# CONFIG_FBCON_VGA_PLANES is not set
  6839. +# CONFIG_FBCON_VGA is not set
  6840. +# CONFIG_FBCON_HGA is not set
  6841. +# CONFIG_FBCON_FONTWIDTH8_ONLY is not set
  6842. +CONFIG_FBCON_FONTS=y
  6843. +CONFIG_FONT_8x8=y
  6844. +CONFIG_FONT_8x16=y
  6845. +# CONFIG_FONT_SUN8x16 is not set
  6846. +# CONFIG_FONT_SUN12x22 is not set
  6847. +# CONFIG_FONT_6x11 is not set
  6848. +# CONFIG_FONT_PEARL_8x8 is not set
  6849. +# CONFIG_FONT_ACORN_8x8 is not set
  6850. +
  6851. +#
  6852. +# Sound
  6853. +#
  6854. +CONFIG_SOUND=y
  6855. +# CONFIG_SOUND_ALI5455 is not set
  6856. +# CONFIG_SOUND_BT878 is not set
  6857. +# CONFIG_SOUND_CMPCI is not set
  6858. +# CONFIG_SOUND_EMU10K1 is not set
  6859. +# CONFIG_MIDI_EMU10K1 is not set
  6860. +# CONFIG_SOUND_FUSION is not set
  6861. +# CONFIG_SOUND_CS4281 is not set
  6862. +# CONFIG_SOUND_ES1370 is not set
  6863. +# CONFIG_SOUND_ES1371 is not set
  6864. +# CONFIG_SOUND_ESSSOLO1 is not set
  6865. +# CONFIG_SOUND_MAESTRO is not set
  6866. +# CONFIG_SOUND_MAESTRO3 is not set
  6867. +# CONFIG_SOUND_FORTE is not set
  6868. +# CONFIG_SOUND_ICH is not set
  6869. +# CONFIG_SOUND_RME96XX is not set
  6870. +# CONFIG_SOUND_SONICVIBES is not set
  6871. +# CONFIG_SOUND_TRIDENT is not set
  6872. +# CONFIG_SOUND_MSNDCLAS is not set
  6873. +# CONFIG_SOUND_MSNDPIN is not set
  6874. +# CONFIG_SOUND_VIA82CXXX is not set
  6875. +# CONFIG_MIDI_VIA82CXXX is not set
  6876. +# CONFIG_SOUND_OSS is not set
  6877. +# CONFIG_SOUND_TVMIXER is not set
  6878. +# CONFIG_SOUND_AD1980 is not set
  6879. +# CONFIG_SOUND_WM97XX is not set
  6880. +
  6881. +#
  6882. +# USB support
  6883. +#
  6884. +# CONFIG_USB is not set
  6885. +
  6886. +#
  6887. +# Support for USB gadgets
  6888. +#
  6889. +# CONFIG_USB_GADGET is not set
  6890. +
  6891. +#
  6892. +# Bluetooth support
  6893. +#
  6894. +# CONFIG_BLUEZ is not set
  6895. +
  6896. +#
  6897. +# Kernel hacking
  6898. +#
  6899. +CONFIG_CROSSCOMPILE=y
  6900. +# CONFIG_RUNTIME_DEBUG is not set
  6901. +# CONFIG_KGDB is not set
  6902. +# CONFIG_GDB_CONSOLE is not set
  6903. +# CONFIG_DEBUG_INFO is not set
  6904. +# CONFIG_MAGIC_SYSRQ is not set
  6905. +# CONFIG_MIPS_UNCACHED is not set
  6906. +CONFIG_LOG_BUF_SHIFT=0
  6907. +
  6908. +#
  6909. +# Cryptographic options
  6910. +#
  6911. +# CONFIG_CRYPTO is not set
  6912. +
  6913. +#
  6914. +# Library routines
  6915. +#
  6916. +# CONFIG_CRC32 is not set
  6917. +CONFIG_ZLIB_INFLATE=m
  6918. +CONFIG_ZLIB_DEFLATE=m
  6919. Index: linux-2.4.35.4/arch/mips/defconfig-hp-lj
  6920. ===================================================================
  6921. --- linux-2.4.35.4.orig/arch/mips/defconfig-hp-lj
  6922. +++ linux-2.4.35.4/arch/mips/defconfig-hp-lj
  6923. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  6924. # CONFIG_MIPS_PB1000 is not set
  6925. # CONFIG_MIPS_PB1100 is not set
  6926. # CONFIG_MIPS_PB1500 is not set
  6927. -# CONFIG_MIPS_HYDROGEN3 is not set
  6928. # CONFIG_MIPS_PB1550 is not set
  6929. +# CONFIG_MIPS_HYDROGEN3 is not set
  6930. # CONFIG_MIPS_XXS1500 is not set
  6931. # CONFIG_MIPS_MTX1 is not set
  6932. # CONFIG_COGENT_CSB250 is not set
  6933. @@ -184,8 +184,8 @@ CONFIG_MTD_CFI_AMDSTD=y
  6934. # Mapping drivers for chip access
  6935. #
  6936. CONFIG_MTD_PHYSMAP=y
  6937. -CONFIG_MTD_PHYSMAP_START=10040000
  6938. -CONFIG_MTD_PHYSMAP_LEN=00fc0000
  6939. +CONFIG_MTD_PHYSMAP_START=0x10040000
  6940. +CONFIG_MTD_PHYSMAP_LEN=0x00fc0000
  6941. CONFIG_MTD_PHYSMAP_BUSWIDTH=4
  6942. # CONFIG_MTD_PB1000 is not set
  6943. # CONFIG_MTD_PB1500 is not set
  6944. @@ -193,9 +193,7 @@ CONFIG_MTD_PHYSMAP_BUSWIDTH=4
  6945. # CONFIG_MTD_BOSPORUS is not set
  6946. # CONFIG_MTD_XXS1500 is not set
  6947. # CONFIG_MTD_MTX1 is not set
  6948. -# CONFIG_MTD_DB1X00 is not set
  6949. # CONFIG_MTD_PB1550 is not set
  6950. -# CONFIG_MTD_HYDROGEN3 is not set
  6951. # CONFIG_MTD_MIRAGE is not set
  6952. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  6953. # CONFIG_MTD_OCELOT is not set
  6954. @@ -214,7 +212,6 @@ CONFIG_MTD_PHYSMAP_BUSWIDTH=4
  6955. #
  6956. # Disk-On-Chip Device Drivers
  6957. #
  6958. -# CONFIG_MTD_DOC1000 is not set
  6959. # CONFIG_MTD_DOC2000 is not set
  6960. # CONFIG_MTD_DOC2001 is not set
  6961. # CONFIG_MTD_DOCPROBE is not set
  6962. @@ -304,11 +301,6 @@ CONFIG_IP_PNP_DHCP=y
  6963. #
  6964. # CONFIG_IPX is not set
  6965. # CONFIG_ATALK is not set
  6966. -
  6967. -#
  6968. -# Appletalk devices
  6969. -#
  6970. -# CONFIG_DEV_APPLETALK is not set
  6971. # CONFIG_DECNET is not set
  6972. # CONFIG_BRIDGE is not set
  6973. # CONFIG_X25 is not set
  6974. @@ -604,7 +596,6 @@ CONFIG_SERIAL=y
  6975. CONFIG_SERIAL_CONSOLE=y
  6976. # CONFIG_SERIAL_EXTENDED is not set
  6977. # CONFIG_SERIAL_NONSTANDARD is not set
  6978. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  6979. # CONFIG_UNIX98_PTYS is not set
  6980. #
  6981. Index: linux-2.4.35.4/arch/mips/defconfig-hydrogen3
  6982. ===================================================================
  6983. --- linux-2.4.35.4.orig/arch/mips/defconfig-hydrogen3
  6984. +++ linux-2.4.35.4/arch/mips/defconfig-hydrogen3
  6985. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  6986. # CONFIG_MIPS_PB1000 is not set
  6987. # CONFIG_MIPS_PB1100 is not set
  6988. # CONFIG_MIPS_PB1500 is not set
  6989. -CONFIG_MIPS_HYDROGEN3=y
  6990. # CONFIG_MIPS_PB1550 is not set
  6991. +CONFIG_MIPS_HYDROGEN3=y
  6992. # CONFIG_MIPS_XXS1500 is not set
  6993. # CONFIG_MIPS_MTX1 is not set
  6994. # CONFIG_COGENT_CSB250 is not set
  6995. @@ -214,9 +214,7 @@ CONFIG_MTD_CFI_AMDSTD=y
  6996. # CONFIG_MTD_BOSPORUS is not set
  6997. # CONFIG_MTD_XXS1500 is not set
  6998. # CONFIG_MTD_MTX1 is not set
  6999. -# CONFIG_MTD_DB1X00 is not set
  7000. # CONFIG_MTD_PB1550 is not set
  7001. -CONFIG_MTD_HYDROGEN3=y
  7002. # CONFIG_MTD_MIRAGE is not set
  7003. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  7004. # CONFIG_MTD_OCELOT is not set
  7005. @@ -235,7 +233,6 @@ CONFIG_MTD_HYDROGEN3=y
  7006. #
  7007. # Disk-On-Chip Device Drivers
  7008. #
  7009. -# CONFIG_MTD_DOC1000 is not set
  7010. # CONFIG_MTD_DOC2000 is not set
  7011. # CONFIG_MTD_DOC2001 is not set
  7012. # CONFIG_MTD_DOCPROBE is not set
  7013. @@ -340,11 +337,6 @@ CONFIG_IP_PNP_BOOTP=y
  7014. #
  7015. # CONFIG_IPX is not set
  7016. # CONFIG_ATALK is not set
  7017. -
  7018. -#
  7019. -# Appletalk devices
  7020. -#
  7021. -# CONFIG_DEV_APPLETALK is not set
  7022. # CONFIG_DECNET is not set
  7023. # CONFIG_BRIDGE is not set
  7024. # CONFIG_X25 is not set
  7025. @@ -590,7 +582,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  7026. # CONFIG_AU1X00_USB_TTY is not set
  7027. # CONFIG_AU1X00_USB_RAW is not set
  7028. # CONFIG_TXX927_SERIAL is not set
  7029. -CONFIG_MIPS_HYDROGEN3_BUTTONS=y
  7030. CONFIG_UNIX98_PTYS=y
  7031. CONFIG_UNIX98_PTY_COUNT=256
  7032. @@ -838,6 +829,7 @@ CONFIG_DUMMY_CONSOLE=y
  7033. # CONFIG_FB_PM2 is not set
  7034. # CONFIG_FB_PM3 is not set
  7035. # CONFIG_FB_CYBER2000 is not set
  7036. +CONFIG_FB_AU1100=y
  7037. # CONFIG_FB_MATROX is not set
  7038. # CONFIG_FB_ATY is not set
  7039. # CONFIG_FB_RADEON is not set
  7040. @@ -849,7 +841,6 @@ CONFIG_DUMMY_CONSOLE=y
  7041. # CONFIG_FB_VOODOO1 is not set
  7042. # CONFIG_FB_TRIDENT is not set
  7043. # CONFIG_FB_E1356 is not set
  7044. -CONFIG_FB_AU1100=y
  7045. # CONFIG_FB_IT8181 is not set
  7046. # CONFIG_FB_VIRTUAL is not set
  7047. CONFIG_FBCON_ADVANCED=y
  7048. Index: linux-2.4.35.4/arch/mips/defconfig-ip22
  7049. ===================================================================
  7050. --- linux-2.4.35.4.orig/arch/mips/defconfig-ip22
  7051. +++ linux-2.4.35.4/arch/mips/defconfig-ip22
  7052. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  7053. # CONFIG_MIPS_PB1000 is not set
  7054. # CONFIG_MIPS_PB1100 is not set
  7055. # CONFIG_MIPS_PB1500 is not set
  7056. -# CONFIG_MIPS_HYDROGEN3 is not set
  7057. # CONFIG_MIPS_PB1550 is not set
  7058. +# CONFIG_MIPS_HYDROGEN3 is not set
  7059. # CONFIG_MIPS_XXS1500 is not set
  7060. # CONFIG_MIPS_MTX1 is not set
  7061. # CONFIG_COGENT_CSB250 is not set
  7062. @@ -235,11 +235,6 @@ CONFIG_IP_PNP_BOOTP=y
  7063. #
  7064. # CONFIG_IPX is not set
  7065. # CONFIG_ATALK is not set
  7066. -
  7067. -#
  7068. -# Appletalk devices
  7069. -#
  7070. -# CONFIG_DEV_APPLETALK is not set
  7071. # CONFIG_DECNET is not set
  7072. # CONFIG_BRIDGE is not set
  7073. # CONFIG_X25 is not set
  7074. @@ -319,9 +314,11 @@ CONFIG_SGIWD93_SCSI=y
  7075. # CONFIG_SCSI_MEGARAID is not set
  7076. # CONFIG_SCSI_MEGARAID2 is not set
  7077. # CONFIG_SCSI_SATA is not set
  7078. +# CONFIG_SCSI_SATA_AHCI is not set
  7079. # CONFIG_SCSI_SATA_SVW is not set
  7080. # CONFIG_SCSI_ATA_PIIX is not set
  7081. # CONFIG_SCSI_SATA_NV is not set
  7082. +# CONFIG_SCSI_SATA_QSTOR is not set
  7083. # CONFIG_SCSI_SATA_PROMISE is not set
  7084. # CONFIG_SCSI_SATA_SX4 is not set
  7085. # CONFIG_SCSI_SATA_SIL is not set
  7086. @@ -465,7 +462,6 @@ CONFIG_VT_CONSOLE=y
  7087. # CONFIG_SERIAL is not set
  7088. # CONFIG_SERIAL_EXTENDED is not set
  7089. # CONFIG_SERIAL_NONSTANDARD is not set
  7090. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7091. CONFIG_UNIX98_PTYS=y
  7092. CONFIG_UNIX98_PTY_COUNT=256
  7093. Index: linux-2.4.35.4/arch/mips/defconfig-it8172
  7094. ===================================================================
  7095. --- linux-2.4.35.4.orig/arch/mips/defconfig-it8172
  7096. +++ linux-2.4.35.4/arch/mips/defconfig-it8172
  7097. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  7098. # CONFIG_MIPS_PB1000 is not set
  7099. # CONFIG_MIPS_PB1100 is not set
  7100. # CONFIG_MIPS_PB1500 is not set
  7101. -# CONFIG_MIPS_HYDROGEN3 is not set
  7102. # CONFIG_MIPS_PB1550 is not set
  7103. +# CONFIG_MIPS_HYDROGEN3 is not set
  7104. # CONFIG_MIPS_XXS1500 is not set
  7105. # CONFIG_MIPS_MTX1 is not set
  7106. # CONFIG_COGENT_CSB250 is not set
  7107. @@ -186,8 +186,8 @@ CONFIG_MTD_CFI_INTELEXT=y
  7108. # Mapping drivers for chip access
  7109. #
  7110. CONFIG_MTD_PHYSMAP=y
  7111. -CONFIG_MTD_PHYSMAP_START=8000000
  7112. -CONFIG_MTD_PHYSMAP_LEN=2000000
  7113. +CONFIG_MTD_PHYSMAP_START=0x8000000
  7114. +CONFIG_MTD_PHYSMAP_LEN=0x2000000
  7115. CONFIG_MTD_PHYSMAP_BUSWIDTH=4
  7116. # CONFIG_MTD_PB1000 is not set
  7117. # CONFIG_MTD_PB1500 is not set
  7118. @@ -195,9 +195,7 @@ CONFIG_MTD_PHYSMAP_BUSWIDTH=4
  7119. # CONFIG_MTD_BOSPORUS is not set
  7120. # CONFIG_MTD_XXS1500 is not set
  7121. # CONFIG_MTD_MTX1 is not set
  7122. -# CONFIG_MTD_DB1X00 is not set
  7123. # CONFIG_MTD_PB1550 is not set
  7124. -# CONFIG_MTD_HYDROGEN3 is not set
  7125. # CONFIG_MTD_MIRAGE is not set
  7126. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  7127. # CONFIG_MTD_OCELOT is not set
  7128. @@ -216,7 +214,6 @@ CONFIG_MTD_PHYSMAP_BUSWIDTH=4
  7129. #
  7130. # Disk-On-Chip Device Drivers
  7131. #
  7132. -# CONFIG_MTD_DOC1000 is not set
  7133. # CONFIG_MTD_DOC2000 is not set
  7134. # CONFIG_MTD_DOC2001 is not set
  7135. # CONFIG_MTD_DOCPROBE is not set
  7136. @@ -304,11 +301,6 @@ CONFIG_IP_PNP_BOOTP=y
  7137. #
  7138. # CONFIG_IPX is not set
  7139. # CONFIG_ATALK is not set
  7140. -
  7141. -#
  7142. -# Appletalk devices
  7143. -#
  7144. -# CONFIG_DEV_APPLETALK is not set
  7145. # CONFIG_DECNET is not set
  7146. # CONFIG_BRIDGE is not set
  7147. # CONFIG_X25 is not set
  7148. @@ -592,7 +584,6 @@ CONFIG_SERIAL_CONSOLE=y
  7149. CONFIG_PC_KEYB=y
  7150. # CONFIG_IT8172_SCR0 is not set
  7151. # CONFIG_IT8172_SCR1 is not set
  7152. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7153. CONFIG_UNIX98_PTYS=y
  7154. CONFIG_UNIX98_PTY_COUNT=256
  7155. Index: linux-2.4.35.4/arch/mips/defconfig-ivr
  7156. ===================================================================
  7157. --- linux-2.4.35.4.orig/arch/mips/defconfig-ivr
  7158. +++ linux-2.4.35.4/arch/mips/defconfig-ivr
  7159. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  7160. # CONFIG_MIPS_PB1000 is not set
  7161. # CONFIG_MIPS_PB1100 is not set
  7162. # CONFIG_MIPS_PB1500 is not set
  7163. -# CONFIG_MIPS_HYDROGEN3 is not set
  7164. # CONFIG_MIPS_PB1550 is not set
  7165. +# CONFIG_MIPS_HYDROGEN3 is not set
  7166. # CONFIG_MIPS_XXS1500 is not set
  7167. # CONFIG_MIPS_MTX1 is not set
  7168. # CONFIG_COGENT_CSB250 is not set
  7169. @@ -226,11 +226,6 @@ CONFIG_IP_PNP_BOOTP=y
  7170. #
  7171. # CONFIG_IPX is not set
  7172. # CONFIG_ATALK is not set
  7173. -
  7174. -#
  7175. -# Appletalk devices
  7176. -#
  7177. -# CONFIG_DEV_APPLETALK is not set
  7178. # CONFIG_DECNET is not set
  7179. # CONFIG_BRIDGE is not set
  7180. # CONFIG_X25 is not set
  7181. @@ -516,7 +511,6 @@ CONFIG_SERIAL_CONSOLE=y
  7182. CONFIG_QTRONIX_KEYBOARD=y
  7183. CONFIG_IT8172_CIR=y
  7184. # CONFIG_IT8172_SCR0 is not set
  7185. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7186. CONFIG_UNIX98_PTYS=y
  7187. CONFIG_UNIX98_PTY_COUNT=256
  7188. Index: linux-2.4.35.4/arch/mips/defconfig-jmr3927
  7189. ===================================================================
  7190. --- linux-2.4.35.4.orig/arch/mips/defconfig-jmr3927
  7191. +++ linux-2.4.35.4/arch/mips/defconfig-jmr3927
  7192. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  7193. # CONFIG_MIPS_PB1000 is not set
  7194. # CONFIG_MIPS_PB1100 is not set
  7195. # CONFIG_MIPS_PB1500 is not set
  7196. -# CONFIG_MIPS_HYDROGEN3 is not set
  7197. # CONFIG_MIPS_PB1550 is not set
  7198. +# CONFIG_MIPS_HYDROGEN3 is not set
  7199. # CONFIG_MIPS_XXS1500 is not set
  7200. # CONFIG_MIPS_MTX1 is not set
  7201. # CONFIG_COGENT_CSB250 is not set
  7202. @@ -225,11 +225,6 @@ CONFIG_IP_PNP_BOOTP=y
  7203. #
  7204. # CONFIG_IPX is not set
  7205. # CONFIG_ATALK is not set
  7206. -
  7207. -#
  7208. -# Appletalk devices
  7209. -#
  7210. -# CONFIG_DEV_APPLETALK is not set
  7211. # CONFIG_DECNET is not set
  7212. # CONFIG_BRIDGE is not set
  7213. # CONFIG_X25 is not set
  7214. @@ -454,7 +449,6 @@ CONFIG_SERIAL_NONSTANDARD=y
  7215. # CONFIG_SERIAL_TXX9_CONSOLE is not set
  7216. CONFIG_TXX927_SERIAL=y
  7217. CONFIG_TXX927_SERIAL_CONSOLE=y
  7218. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7219. # CONFIG_UNIX98_PTYS is not set
  7220. #
  7221. Index: linux-2.4.35.4/arch/mips/defconfig-lasat
  7222. ===================================================================
  7223. --- linux-2.4.35.4.orig/arch/mips/defconfig-lasat
  7224. +++ linux-2.4.35.4/arch/mips/defconfig-lasat
  7225. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  7226. # CONFIG_MIPS_PB1000 is not set
  7227. # CONFIG_MIPS_PB1100 is not set
  7228. # CONFIG_MIPS_PB1500 is not set
  7229. -# CONFIG_MIPS_HYDROGEN3 is not set
  7230. # CONFIG_MIPS_PB1550 is not set
  7231. +# CONFIG_MIPS_HYDROGEN3 is not set
  7232. # CONFIG_MIPS_XXS1500 is not set
  7233. # CONFIG_MIPS_MTX1 is not set
  7234. # CONFIG_COGENT_CSB250 is not set
  7235. @@ -198,9 +198,7 @@ CONFIG_MTD_CFI_AMDSTD=y
  7236. # CONFIG_MTD_BOSPORUS is not set
  7237. # CONFIG_MTD_XXS1500 is not set
  7238. # CONFIG_MTD_MTX1 is not set
  7239. -# CONFIG_MTD_DB1X00 is not set
  7240. # CONFIG_MTD_PB1550 is not set
  7241. -# CONFIG_MTD_HYDROGEN3 is not set
  7242. # CONFIG_MTD_MIRAGE is not set
  7243. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  7244. # CONFIG_MTD_OCELOT is not set
  7245. @@ -219,7 +217,6 @@ CONFIG_MTD_LASAT=y
  7246. #
  7247. # Disk-On-Chip Device Drivers
  7248. #
  7249. -# CONFIG_MTD_DOC1000 is not set
  7250. # CONFIG_MTD_DOC2000 is not set
  7251. # CONFIG_MTD_DOC2001 is not set
  7252. # CONFIG_MTD_DOCPROBE is not set
  7253. @@ -303,11 +300,6 @@ CONFIG_INET=y
  7254. #
  7255. # CONFIG_IPX is not set
  7256. # CONFIG_ATALK is not set
  7257. -
  7258. -#
  7259. -# Appletalk devices
  7260. -#
  7261. -# CONFIG_DEV_APPLETALK is not set
  7262. # CONFIG_DECNET is not set
  7263. # CONFIG_BRIDGE is not set
  7264. # CONFIG_X25 is not set
  7265. @@ -584,7 +576,6 @@ CONFIG_SERIAL=y
  7266. CONFIG_SERIAL_CONSOLE=y
  7267. # CONFIG_SERIAL_EXTENDED is not set
  7268. # CONFIG_SERIAL_NONSTANDARD is not set
  7269. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7270. CONFIG_UNIX98_PTYS=y
  7271. CONFIG_UNIX98_PTY_COUNT=256
  7272. Index: linux-2.4.35.4/arch/mips/defconfig-malta
  7273. ===================================================================
  7274. --- linux-2.4.35.4.orig/arch/mips/defconfig-malta
  7275. +++ linux-2.4.35.4/arch/mips/defconfig-malta
  7276. @@ -22,16 +22,19 @@ CONFIG_KMOD=y
  7277. #
  7278. # CONFIG_ACER_PICA_61 is not set
  7279. # CONFIG_MIPS_BOSPORUS is not set
  7280. +# CONFIG_MIPS_FICMMP is not set
  7281. # CONFIG_MIPS_MIRAGE is not set
  7282. # CONFIG_MIPS_DB1000 is not set
  7283. # CONFIG_MIPS_DB1100 is not set
  7284. # CONFIG_MIPS_DB1500 is not set
  7285. # CONFIG_MIPS_DB1550 is not set
  7286. +# CONFIG_MIPS_DB1200 is not set
  7287. # CONFIG_MIPS_PB1000 is not set
  7288. # CONFIG_MIPS_PB1100 is not set
  7289. # CONFIG_MIPS_PB1500 is not set
  7290. -# CONFIG_MIPS_HYDROGEN3 is not set
  7291. # CONFIG_MIPS_PB1550 is not set
  7292. +# CONFIG_MIPS_PB1200 is not set
  7293. +# CONFIG_MIPS_HYDROGEN3 is not set
  7294. # CONFIG_MIPS_XXS1500 is not set
  7295. # CONFIG_MIPS_MTX1 is not set
  7296. # CONFIG_COGENT_CSB250 is not set
  7297. @@ -237,11 +240,6 @@ CONFIG_IP_PNP_BOOTP=y
  7298. #
  7299. # CONFIG_IPX is not set
  7300. # CONFIG_ATALK is not set
  7301. -
  7302. -#
  7303. -# Appletalk devices
  7304. -#
  7305. -# CONFIG_DEV_APPLETALK is not set
  7306. # CONFIG_DECNET is not set
  7307. # CONFIG_BRIDGE is not set
  7308. # CONFIG_X25 is not set
  7309. @@ -273,8 +271,83 @@ CONFIG_IP_PNP_BOOTP=y
  7310. #
  7311. # ATA/IDE/MFM/RLL support
  7312. #
  7313. -# CONFIG_IDE is not set
  7314. +CONFIG_IDE=y
  7315. +
  7316. +#
  7317. +# IDE, ATA and ATAPI Block devices
  7318. +#
  7319. +CONFIG_BLK_DEV_IDE=y
  7320. +
  7321. +#
  7322. +# Please see Documentation/ide.txt for help/info on IDE drives
  7323. +#
  7324. +# CONFIG_BLK_DEV_HD_IDE is not set
  7325. # CONFIG_BLK_DEV_HD is not set
  7326. +# CONFIG_BLK_DEV_IDE_SATA is not set
  7327. +CONFIG_BLK_DEV_IDEDISK=y
  7328. +# CONFIG_IDEDISK_MULTI_MODE is not set
  7329. +# CONFIG_IDEDISK_STROKE is not set
  7330. +# CONFIG_BLK_DEV_IDECS is not set
  7331. +# CONFIG_BLK_DEV_DELKIN is not set
  7332. +CONFIG_BLK_DEV_IDECD=y
  7333. +CONFIG_BLK_DEV_IDETAPE=y
  7334. +CONFIG_BLK_DEV_IDEFLOPPY=y
  7335. +CONFIG_BLK_DEV_IDESCSI=y
  7336. +# CONFIG_IDE_TASK_IOCTL is not set
  7337. +
  7338. +#
  7339. +# IDE chipset support/bugfixes
  7340. +#
  7341. +# CONFIG_BLK_DEV_CMD640 is not set
  7342. +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
  7343. +# CONFIG_BLK_DEV_ISAPNP is not set
  7344. +CONFIG_BLK_DEV_IDEPCI=y
  7345. +CONFIG_BLK_DEV_GENERIC=y
  7346. +CONFIG_IDEPCI_SHARE_IRQ=y
  7347. +CONFIG_BLK_DEV_IDEDMA_PCI=y
  7348. +# CONFIG_BLK_DEV_OFFBOARD is not set
  7349. +CONFIG_BLK_DEV_IDEDMA_FORCED=y
  7350. +CONFIG_IDEDMA_PCI_AUTO=y
  7351. +# CONFIG_IDEDMA_ONLYDISK is not set
  7352. +CONFIG_BLK_DEV_IDEDMA=y
  7353. +# CONFIG_IDEDMA_PCI_WIP is not set
  7354. +# CONFIG_BLK_DEV_ADMA100 is not set
  7355. +# CONFIG_BLK_DEV_AEC62XX is not set
  7356. +# CONFIG_BLK_DEV_ALI15X3 is not set
  7357. +# CONFIG_WDC_ALI15X3 is not set
  7358. +# CONFIG_BLK_DEV_AMD74XX is not set
  7359. +# CONFIG_AMD74XX_OVERRIDE is not set
  7360. +# CONFIG_BLK_DEV_ATIIXP is not set
  7361. +# CONFIG_BLK_DEV_CMD64X is not set
  7362. +# CONFIG_BLK_DEV_TRIFLEX is not set
  7363. +# CONFIG_BLK_DEV_CY82C693 is not set
  7364. +# CONFIG_BLK_DEV_CS5530 is not set
  7365. +# CONFIG_BLK_DEV_HPT34X is not set
  7366. +# CONFIG_HPT34X_AUTODMA is not set
  7367. +# CONFIG_BLK_DEV_HPT366 is not set
  7368. +CONFIG_BLK_DEV_PIIX=y
  7369. +# CONFIG_BLK_DEV_NS87415 is not set
  7370. +# CONFIG_BLK_DEV_OPTI621 is not set
  7371. +# CONFIG_BLK_DEV_PDC202XX_OLD is not set
  7372. +# CONFIG_PDC202XX_BURST is not set
  7373. +# CONFIG_BLK_DEV_PDC202XX_NEW is not set
  7374. +# CONFIG_BLK_DEV_RZ1000 is not set
  7375. +# CONFIG_BLK_DEV_SC1200 is not set
  7376. +# CONFIG_BLK_DEV_SVWKS is not set
  7377. +# CONFIG_BLK_DEV_SIIMAGE is not set
  7378. +# CONFIG_BLK_DEV_SIS5513 is not set
  7379. +# CONFIG_BLK_DEV_SLC90E66 is not set
  7380. +# CONFIG_BLK_DEV_TRM290 is not set
  7381. +# CONFIG_BLK_DEV_VIA82CXXX is not set
  7382. +# CONFIG_IDE_CHIPSETS is not set
  7383. +CONFIG_IDEDMA_AUTO=y
  7384. +# CONFIG_IDEDMA_IVB is not set
  7385. +# CONFIG_DMA_NONPCI is not set
  7386. +# CONFIG_BLK_DEV_ATARAID is not set
  7387. +# CONFIG_BLK_DEV_ATARAID_PDC is not set
  7388. +# CONFIG_BLK_DEV_ATARAID_HPT is not set
  7389. +# CONFIG_BLK_DEV_ATARAID_MEDLEY is not set
  7390. +# CONFIG_BLK_DEV_ATARAID_SII is not set
  7391. #
  7392. # SCSI support
  7393. @@ -319,9 +392,11 @@ CONFIG_SD_EXTRA_DEVS=40
  7394. # CONFIG_SCSI_MEGARAID is not set
  7395. # CONFIG_SCSI_MEGARAID2 is not set
  7396. # CONFIG_SCSI_SATA is not set
  7397. +# CONFIG_SCSI_SATA_AHCI is not set
  7398. # CONFIG_SCSI_SATA_SVW is not set
  7399. # CONFIG_SCSI_ATA_PIIX is not set
  7400. # CONFIG_SCSI_SATA_NV is not set
  7401. +# CONFIG_SCSI_SATA_QSTOR is not set
  7402. # CONFIG_SCSI_SATA_PROMISE is not set
  7403. # CONFIG_SCSI_SATA_SX4 is not set
  7404. # CONFIG_SCSI_SATA_SIL is not set
  7405. @@ -524,7 +599,6 @@ CONFIG_SERIAL=y
  7406. CONFIG_SERIAL_CONSOLE=y
  7407. # CONFIG_SERIAL_EXTENDED is not set
  7408. # CONFIG_SERIAL_NONSTANDARD is not set
  7409. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7410. CONFIG_UNIX98_PTYS=y
  7411. CONFIG_UNIX98_PTY_COUNT=256
  7412. Index: linux-2.4.35.4/arch/mips/defconfig-mirage
  7413. ===================================================================
  7414. --- linux-2.4.35.4.orig/arch/mips/defconfig-mirage
  7415. +++ linux-2.4.35.4/arch/mips/defconfig-mirage
  7416. @@ -30,8 +30,8 @@ CONFIG_MIPS_MIRAGE=y
  7417. # CONFIG_MIPS_PB1000 is not set
  7418. # CONFIG_MIPS_PB1100 is not set
  7419. # CONFIG_MIPS_PB1500 is not set
  7420. -# CONFIG_MIPS_HYDROGEN3 is not set
  7421. # CONFIG_MIPS_PB1550 is not set
  7422. +# CONFIG_MIPS_HYDROGEN3 is not set
  7423. # CONFIG_MIPS_XXS1500 is not set
  7424. # CONFIG_MIPS_MTX1 is not set
  7425. # CONFIG_COGENT_CSB250 is not set
  7426. @@ -209,9 +209,7 @@ CONFIG_MTD_CFI_AMDSTD=y
  7427. # CONFIG_MTD_BOSPORUS is not set
  7428. # CONFIG_MTD_XXS1500 is not set
  7429. # CONFIG_MTD_MTX1 is not set
  7430. -# CONFIG_MTD_DB1X00 is not set
  7431. # CONFIG_MTD_PB1550 is not set
  7432. -# CONFIG_MTD_HYDROGEN3 is not set
  7433. CONFIG_MTD_MIRAGE=y
  7434. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  7435. # CONFIG_MTD_OCELOT is not set
  7436. @@ -230,7 +228,6 @@ CONFIG_MTD_MIRAGE=y
  7437. #
  7438. # Disk-On-Chip Device Drivers
  7439. #
  7440. -# CONFIG_MTD_DOC1000 is not set
  7441. # CONFIG_MTD_DOC2000 is not set
  7442. # CONFIG_MTD_DOC2001 is not set
  7443. # CONFIG_MTD_DOCPROBE is not set
  7444. @@ -335,11 +332,6 @@ CONFIG_IP_PNP_BOOTP=y
  7445. #
  7446. # CONFIG_IPX is not set
  7447. # CONFIG_ATALK is not set
  7448. -
  7449. -#
  7450. -# Appletalk devices
  7451. -#
  7452. -# CONFIG_DEV_APPLETALK is not set
  7453. # CONFIG_DECNET is not set
  7454. # CONFIG_BRIDGE is not set
  7455. # CONFIG_X25 is not set
  7456. @@ -560,7 +552,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  7457. # CONFIG_AU1X00_USB_TTY is not set
  7458. # CONFIG_AU1X00_USB_RAW is not set
  7459. # CONFIG_TXX927_SERIAL is not set
  7460. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7461. CONFIG_UNIX98_PTYS=y
  7462. CONFIG_UNIX98_PTY_COUNT=256
  7463. Index: linux-2.4.35.4/arch/mips/defconfig-mpc30x
  7464. ===================================================================
  7465. --- linux-2.4.35.4.orig/arch/mips/defconfig-mpc30x
  7466. +++ linux-2.4.35.4/arch/mips/defconfig-mpc30x
  7467. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  7468. # CONFIG_MIPS_PB1000 is not set
  7469. # CONFIG_MIPS_PB1100 is not set
  7470. # CONFIG_MIPS_PB1500 is not set
  7471. -# CONFIG_MIPS_HYDROGEN3 is not set
  7472. # CONFIG_MIPS_PB1550 is not set
  7473. +# CONFIG_MIPS_HYDROGEN3 is not set
  7474. # CONFIG_MIPS_XXS1500 is not set
  7475. # CONFIG_MIPS_MTX1 is not set
  7476. # CONFIG_COGENT_CSB250 is not set
  7477. @@ -228,11 +228,6 @@ CONFIG_IP_PNP_BOOTP=y
  7478. #
  7479. # CONFIG_IPX is not set
  7480. # CONFIG_ATALK is not set
  7481. -
  7482. -#
  7483. -# Appletalk devices
  7484. -#
  7485. -# CONFIG_DEV_APPLETALK is not set
  7486. # CONFIG_DECNET is not set
  7487. # CONFIG_BRIDGE is not set
  7488. # CONFIG_X25 is not set
  7489. @@ -400,7 +395,6 @@ CONFIG_SERIAL=y
  7490. CONFIG_SERIAL_CONSOLE=y
  7491. # CONFIG_SERIAL_EXTENDED is not set
  7492. # CONFIG_SERIAL_NONSTANDARD is not set
  7493. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7494. # CONFIG_VR41XX_KIU is not set
  7495. CONFIG_UNIX98_PTYS=y
  7496. CONFIG_UNIX98_PTY_COUNT=256
  7497. Index: linux-2.4.35.4/arch/mips/defconfig-mtx-1
  7498. ===================================================================
  7499. --- linux-2.4.35.4.orig/arch/mips/defconfig-mtx-1
  7500. +++ linux-2.4.35.4/arch/mips/defconfig-mtx-1
  7501. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  7502. # CONFIG_MIPS_PB1000 is not set
  7503. # CONFIG_MIPS_PB1100 is not set
  7504. # CONFIG_MIPS_PB1500 is not set
  7505. -# CONFIG_MIPS_HYDROGEN3 is not set
  7506. # CONFIG_MIPS_PB1550 is not set
  7507. +# CONFIG_MIPS_HYDROGEN3 is not set
  7508. # CONFIG_MIPS_XXS1500 is not set
  7509. CONFIG_MIPS_MTX1=y
  7510. # CONFIG_COGENT_CSB250 is not set
  7511. @@ -193,9 +193,7 @@ CONFIG_MTD_CFI_AMDSTD=y
  7512. # CONFIG_MTD_BOSPORUS is not set
  7513. # CONFIG_MTD_XXS1500 is not set
  7514. CONFIG_MTD_MTX1=y
  7515. -# CONFIG_MTD_DB1X00 is not set
  7516. # CONFIG_MTD_PB1550 is not set
  7517. -# CONFIG_MTD_HYDROGEN3 is not set
  7518. # CONFIG_MTD_MIRAGE is not set
  7519. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  7520. # CONFIG_MTD_OCELOT is not set
  7521. @@ -214,7 +212,6 @@ CONFIG_MTD_MTX1=y
  7522. #
  7523. # Disk-On-Chip Device Drivers
  7524. #
  7525. -# CONFIG_MTD_DOC1000 is not set
  7526. # CONFIG_MTD_DOC2000 is not set
  7527. # CONFIG_MTD_DOC2001 is not set
  7528. # CONFIG_MTD_DOCPROBE is not set
  7529. @@ -371,11 +368,6 @@ CONFIG_VLAN_8021Q=m
  7530. #
  7531. # CONFIG_IPX is not set
  7532. # CONFIG_ATALK is not set
  7533. -
  7534. -#
  7535. -# Appletalk devices
  7536. -#
  7537. -# CONFIG_DEV_APPLETALK is not set
  7538. # CONFIG_DECNET is not set
  7539. CONFIG_BRIDGE=m
  7540. # CONFIG_X25 is not set
  7541. @@ -479,9 +471,11 @@ CONFIG_SR_EXTRA_DEVS=2
  7542. # CONFIG_SCSI_MEGARAID is not set
  7543. # CONFIG_SCSI_MEGARAID2 is not set
  7544. # CONFIG_SCSI_SATA is not set
  7545. +# CONFIG_SCSI_SATA_AHCI is not set
  7546. # CONFIG_SCSI_SATA_SVW is not set
  7547. # CONFIG_SCSI_ATA_PIIX is not set
  7548. # CONFIG_SCSI_SATA_NV is not set
  7549. +# CONFIG_SCSI_SATA_QSTOR is not set
  7550. # CONFIG_SCSI_SATA_PROMISE is not set
  7551. # CONFIG_SCSI_SATA_SX4 is not set
  7552. # CONFIG_SCSI_SATA_SIL is not set
  7553. @@ -700,7 +694,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  7554. # CONFIG_AU1X00_USB_TTY is not set
  7555. # CONFIG_AU1X00_USB_RAW is not set
  7556. # CONFIG_TXX927_SERIAL is not set
  7557. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7558. CONFIG_UNIX98_PTYS=y
  7559. CONFIG_UNIX98_PTY_COUNT=256
  7560. Index: linux-2.4.35.4/arch/mips/defconfig-nino
  7561. ===================================================================
  7562. --- linux-2.4.35.4.orig/arch/mips/defconfig-nino
  7563. +++ linux-2.4.35.4/arch/mips/defconfig-nino
  7564. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  7565. # CONFIG_MIPS_PB1000 is not set
  7566. # CONFIG_MIPS_PB1100 is not set
  7567. # CONFIG_MIPS_PB1500 is not set
  7568. -# CONFIG_MIPS_HYDROGEN3 is not set
  7569. # CONFIG_MIPS_PB1550 is not set
  7570. +# CONFIG_MIPS_HYDROGEN3 is not set
  7571. # CONFIG_MIPS_XXS1500 is not set
  7572. # CONFIG_MIPS_MTX1 is not set
  7573. # CONFIG_COGENT_CSB250 is not set
  7574. @@ -226,11 +226,6 @@ CONFIG_INET=y
  7575. #
  7576. # CONFIG_IPX is not set
  7577. # CONFIG_ATALK is not set
  7578. -
  7579. -#
  7580. -# Appletalk devices
  7581. -#
  7582. -# CONFIG_DEV_APPLETALK is not set
  7583. # CONFIG_DECNET is not set
  7584. # CONFIG_BRIDGE is not set
  7585. # CONFIG_X25 is not set
  7586. @@ -339,7 +334,6 @@ CONFIG_SERIAL_TX3912_CONSOLE=y
  7587. # CONFIG_SERIAL_TXX9 is not set
  7588. # CONFIG_SERIAL_TXX9_CONSOLE is not set
  7589. # CONFIG_TXX927_SERIAL is not set
  7590. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7591. # CONFIG_UNIX98_PTYS is not set
  7592. #
  7593. Index: linux-2.4.35.4/arch/mips/defconfig-ocelot
  7594. ===================================================================
  7595. --- linux-2.4.35.4.orig/arch/mips/defconfig-ocelot
  7596. +++ linux-2.4.35.4/arch/mips/defconfig-ocelot
  7597. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  7598. # CONFIG_MIPS_PB1000 is not set
  7599. # CONFIG_MIPS_PB1100 is not set
  7600. # CONFIG_MIPS_PB1500 is not set
  7601. -# CONFIG_MIPS_HYDROGEN3 is not set
  7602. # CONFIG_MIPS_PB1550 is not set
  7603. +# CONFIG_MIPS_HYDROGEN3 is not set
  7604. # CONFIG_MIPS_XXS1500 is not set
  7605. # CONFIG_MIPS_MTX1 is not set
  7606. # CONFIG_COGENT_CSB250 is not set
  7607. @@ -194,9 +194,7 @@ CONFIG_MTD_JEDEC=y
  7608. # CONFIG_MTD_BOSPORUS is not set
  7609. # CONFIG_MTD_XXS1500 is not set
  7610. # CONFIG_MTD_MTX1 is not set
  7611. -# CONFIG_MTD_DB1X00 is not set
  7612. # CONFIG_MTD_PB1550 is not set
  7613. -# CONFIG_MTD_HYDROGEN3 is not set
  7614. # CONFIG_MTD_MIRAGE is not set
  7615. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  7616. CONFIG_MTD_OCELOT=y
  7617. @@ -215,7 +213,6 @@ CONFIG_MTD_OCELOT=y
  7618. #
  7619. # Disk-On-Chip Device Drivers
  7620. #
  7621. -# CONFIG_MTD_DOC1000 is not set
  7622. CONFIG_MTD_DOC2000=y
  7623. # CONFIG_MTD_DOC2001 is not set
  7624. CONFIG_MTD_DOCPROBE=y
  7625. @@ -307,11 +304,6 @@ CONFIG_IP_PNP_BOOTP=y
  7626. #
  7627. # CONFIG_IPX is not set
  7628. # CONFIG_ATALK is not set
  7629. -
  7630. -#
  7631. -# Appletalk devices
  7632. -#
  7633. -# CONFIG_DEV_APPLETALK is not set
  7634. # CONFIG_DECNET is not set
  7635. # CONFIG_BRIDGE is not set
  7636. # CONFIG_X25 is not set
  7637. @@ -513,7 +505,6 @@ CONFIG_SERIAL=y
  7638. CONFIG_SERIAL_CONSOLE=y
  7639. # CONFIG_SERIAL_EXTENDED is not set
  7640. # CONFIG_SERIAL_NONSTANDARD is not set
  7641. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7642. CONFIG_UNIX98_PTYS=y
  7643. CONFIG_UNIX98_PTY_COUNT=256
  7644. Index: linux-2.4.35.4/arch/mips/defconfig-osprey
  7645. ===================================================================
  7646. --- linux-2.4.35.4.orig/arch/mips/defconfig-osprey
  7647. +++ linux-2.4.35.4/arch/mips/defconfig-osprey
  7648. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  7649. # CONFIG_MIPS_PB1000 is not set
  7650. # CONFIG_MIPS_PB1100 is not set
  7651. # CONFIG_MIPS_PB1500 is not set
  7652. -# CONFIG_MIPS_HYDROGEN3 is not set
  7653. # CONFIG_MIPS_PB1550 is not set
  7654. +# CONFIG_MIPS_HYDROGEN3 is not set
  7655. # CONFIG_MIPS_XXS1500 is not set
  7656. # CONFIG_MIPS_MTX1 is not set
  7657. # CONFIG_COGENT_CSB250 is not set
  7658. @@ -227,11 +227,6 @@ CONFIG_IP_PNP_BOOTP=y
  7659. #
  7660. # CONFIG_IPX is not set
  7661. # CONFIG_ATALK is not set
  7662. -
  7663. -#
  7664. -# Appletalk devices
  7665. -#
  7666. -# CONFIG_DEV_APPLETALK is not set
  7667. # CONFIG_DECNET is not set
  7668. # CONFIG_BRIDGE is not set
  7669. # CONFIG_X25 is not set
  7670. @@ -388,7 +383,6 @@ CONFIG_SERIAL_MANY_PORTS=y
  7671. # CONFIG_SERIAL_MULTIPORT is not set
  7672. # CONFIG_HUB6 is not set
  7673. # CONFIG_SERIAL_NONSTANDARD is not set
  7674. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7675. # CONFIG_VR41XX_KIU is not set
  7676. CONFIG_UNIX98_PTYS=y
  7677. CONFIG_UNIX98_PTY_COUNT=256
  7678. Index: linux-2.4.35.4/arch/mips/defconfig-pb1000
  7679. ===================================================================
  7680. --- linux-2.4.35.4.orig/arch/mips/defconfig-pb1000
  7681. +++ linux-2.4.35.4/arch/mips/defconfig-pb1000
  7682. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  7683. CONFIG_MIPS_PB1000=y
  7684. # CONFIG_MIPS_PB1100 is not set
  7685. # CONFIG_MIPS_PB1500 is not set
  7686. -# CONFIG_MIPS_HYDROGEN3 is not set
  7687. # CONFIG_MIPS_PB1550 is not set
  7688. +# CONFIG_MIPS_HYDROGEN3 is not set
  7689. # CONFIG_MIPS_XXS1500 is not set
  7690. # CONFIG_MIPS_MTX1 is not set
  7691. # CONFIG_COGENT_CSB250 is not set
  7692. @@ -215,9 +215,7 @@ CONFIG_MTD_PB1000=y
  7693. # CONFIG_MTD_BOSPORUS is not set
  7694. # CONFIG_MTD_XXS1500 is not set
  7695. # CONFIG_MTD_MTX1 is not set
  7696. -# CONFIG_MTD_DB1X00 is not set
  7697. # CONFIG_MTD_PB1550 is not set
  7698. -# CONFIG_MTD_HYDROGEN3 is not set
  7699. # CONFIG_MTD_MIRAGE is not set
  7700. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  7701. # CONFIG_MTD_OCELOT is not set
  7702. @@ -236,7 +234,6 @@ CONFIG_MTD_PB1000=y
  7703. #
  7704. # Disk-On-Chip Device Drivers
  7705. #
  7706. -# CONFIG_MTD_DOC1000 is not set
  7707. # CONFIG_MTD_DOC2000 is not set
  7708. # CONFIG_MTD_DOC2001 is not set
  7709. # CONFIG_MTD_DOCPROBE is not set
  7710. @@ -324,11 +321,6 @@ CONFIG_IP_PNP_BOOTP=y
  7711. #
  7712. # CONFIG_IPX is not set
  7713. # CONFIG_ATALK is not set
  7714. -
  7715. -#
  7716. -# Appletalk devices
  7717. -#
  7718. -# CONFIG_DEV_APPLETALK is not set
  7719. # CONFIG_DECNET is not set
  7720. # CONFIG_BRIDGE is not set
  7721. # CONFIG_X25 is not set
  7722. @@ -622,7 +614,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  7723. # CONFIG_AU1X00_USB_TTY is not set
  7724. # CONFIG_AU1X00_USB_RAW is not set
  7725. # CONFIG_TXX927_SERIAL is not set
  7726. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7727. CONFIG_UNIX98_PTYS=y
  7728. CONFIG_UNIX98_PTY_COUNT=256
  7729. @@ -707,7 +698,7 @@ CONFIG_UNIX98_PTY_COUNT=256
  7730. #
  7731. # CONFIG_PCMCIA_SERIAL_CS is not set
  7732. # CONFIG_SYNCLINK_CS is not set
  7733. -CONFIG_AU1X00_GPIO=m
  7734. +CONFIG_AU1X00_GPIO=y
  7735. # CONFIG_TS_AU1X00_ADS7846 is not set
  7736. #
  7737. Index: linux-2.4.35.4/arch/mips/defconfig-pb1100
  7738. ===================================================================
  7739. --- linux-2.4.35.4.orig/arch/mips/defconfig-pb1100
  7740. +++ linux-2.4.35.4/arch/mips/defconfig-pb1100
  7741. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  7742. # CONFIG_MIPS_PB1000 is not set
  7743. CONFIG_MIPS_PB1100=y
  7744. # CONFIG_MIPS_PB1500 is not set
  7745. -# CONFIG_MIPS_HYDROGEN3 is not set
  7746. # CONFIG_MIPS_PB1550 is not set
  7747. +# CONFIG_MIPS_HYDROGEN3 is not set
  7748. # CONFIG_MIPS_XXS1500 is not set
  7749. # CONFIG_MIPS_MTX1 is not set
  7750. # CONFIG_COGENT_CSB250 is not set
  7751. @@ -198,9 +198,7 @@ CONFIG_MTD_PB1100=y
  7752. # CONFIG_MTD_MTX1 is not set
  7753. CONFIG_MTD_PB1500_BOOT=y
  7754. CONFIG_MTD_PB1500_USER=y
  7755. -# CONFIG_MTD_DB1X00 is not set
  7756. # CONFIG_MTD_PB1550 is not set
  7757. -# CONFIG_MTD_HYDROGEN3 is not set
  7758. # CONFIG_MTD_MIRAGE is not set
  7759. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  7760. # CONFIG_MTD_OCELOT is not set
  7761. @@ -219,7 +217,6 @@ CONFIG_MTD_PB1500_USER=y
  7762. #
  7763. # Disk-On-Chip Device Drivers
  7764. #
  7765. -# CONFIG_MTD_DOC1000 is not set
  7766. # CONFIG_MTD_DOC2000 is not set
  7767. # CONFIG_MTD_DOC2001 is not set
  7768. # CONFIG_MTD_DOCPROBE is not set
  7769. @@ -324,11 +321,6 @@ CONFIG_IP_PNP_BOOTP=y
  7770. #
  7771. # CONFIG_IPX is not set
  7772. # CONFIG_ATALK is not set
  7773. -
  7774. -#
  7775. -# Appletalk devices
  7776. -#
  7777. -# CONFIG_DEV_APPLETALK is not set
  7778. # CONFIG_DECNET is not set
  7779. # CONFIG_BRIDGE is not set
  7780. # CONFIG_X25 is not set
  7781. @@ -613,7 +605,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  7782. # CONFIG_AU1X00_USB_TTY is not set
  7783. # CONFIG_AU1X00_USB_RAW is not set
  7784. # CONFIG_TXX927_SERIAL is not set
  7785. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7786. CONFIG_UNIX98_PTYS=y
  7787. CONFIG_UNIX98_PTY_COUNT=256
  7788. @@ -859,6 +850,7 @@ CONFIG_DUMMY_CONSOLE=y
  7789. # CONFIG_FB_PM2 is not set
  7790. # CONFIG_FB_PM3 is not set
  7791. # CONFIG_FB_CYBER2000 is not set
  7792. +CONFIG_FB_AU1100=y
  7793. # CONFIG_FB_MATROX is not set
  7794. # CONFIG_FB_ATY is not set
  7795. # CONFIG_FB_RADEON is not set
  7796. @@ -870,7 +862,6 @@ CONFIG_DUMMY_CONSOLE=y
  7797. # CONFIG_FB_VOODOO1 is not set
  7798. # CONFIG_FB_TRIDENT is not set
  7799. # CONFIG_FB_E1356 is not set
  7800. -CONFIG_FB_AU1100=y
  7801. # CONFIG_FB_IT8181 is not set
  7802. # CONFIG_FB_VIRTUAL is not set
  7803. CONFIG_FBCON_ADVANCED=y
  7804. Index: linux-2.4.35.4/arch/mips/defconfig-pb1200
  7805. ===================================================================
  7806. --- /dev/null
  7807. +++ linux-2.4.35.4/arch/mips/defconfig-pb1200
  7808. @@ -0,0 +1,1060 @@
  7809. +#
  7810. +# Automatically generated make config: don't edit
  7811. +#
  7812. +CONFIG_MIPS=y
  7813. +CONFIG_MIPS32=y
  7814. +# CONFIG_MIPS64 is not set
  7815. +
  7816. +#
  7817. +# Code maturity level options
  7818. +#
  7819. +CONFIG_EXPERIMENTAL=y
  7820. +
  7821. +#
  7822. +# Loadable module support
  7823. +#
  7824. +CONFIG_MODULES=y
  7825. +# CONFIG_MODVERSIONS is not set
  7826. +CONFIG_KMOD=y
  7827. +
  7828. +#
  7829. +# Machine selection
  7830. +#
  7831. +# CONFIG_ACER_PICA_61 is not set
  7832. +# CONFIG_MIPS_BOSPORUS is not set
  7833. +# CONFIG_MIPS_MIRAGE is not set
  7834. +# CONFIG_MIPS_DB1000 is not set
  7835. +# CONFIG_MIPS_DB1100 is not set
  7836. +# CONFIG_MIPS_DB1500 is not set
  7837. +# CONFIG_MIPS_DB1550 is not set
  7838. +# CONFIG_MIPS_PB1000 is not set
  7839. +# CONFIG_MIPS_PB1100 is not set
  7840. +# CONFIG_MIPS_PB1500 is not set
  7841. +# CONFIG_MIPS_PB1550 is not set
  7842. +# CONFIG_MIPS_HYDROGEN3 is not set
  7843. +# CONFIG_MIPS_XXS1500 is not set
  7844. +# CONFIG_MIPS_MTX1 is not set
  7845. +# CONFIG_COGENT_CSB250 is not set
  7846. +# CONFIG_BAGET_MIPS is not set
  7847. +# CONFIG_CASIO_E55 is not set
  7848. +# CONFIG_MIPS_COBALT is not set
  7849. +# CONFIG_DECSTATION is not set
  7850. +# CONFIG_MIPS_EV64120 is not set
  7851. +# CONFIG_MIPS_EV96100 is not set
  7852. +# CONFIG_MIPS_IVR is not set
  7853. +# CONFIG_HP_LASERJET is not set
  7854. +# CONFIG_IBM_WORKPAD is not set
  7855. +# CONFIG_LASAT is not set
  7856. +# CONFIG_MIPS_ITE8172 is not set
  7857. +# CONFIG_MIPS_ATLAS is not set
  7858. +# CONFIG_MIPS_MAGNUM_4000 is not set
  7859. +# CONFIG_MIPS_MALTA is not set
  7860. +# CONFIG_MIPS_SEAD is not set
  7861. +# CONFIG_MOMENCO_OCELOT is not set
  7862. +# CONFIG_MOMENCO_OCELOT_G is not set
  7863. +# CONFIG_MOMENCO_OCELOT_C is not set
  7864. +# CONFIG_MOMENCO_JAGUAR_ATX is not set
  7865. +# CONFIG_PMC_BIG_SUR is not set
  7866. +# CONFIG_PMC_STRETCH is not set
  7867. +# CONFIG_PMC_YOSEMITE is not set
  7868. +# CONFIG_DDB5074 is not set
  7869. +# CONFIG_DDB5476 is not set
  7870. +# CONFIG_DDB5477 is not set
  7871. +# CONFIG_NEC_OSPREY is not set
  7872. +# CONFIG_NEC_EAGLE is not set
  7873. +# CONFIG_OLIVETTI_M700 is not set
  7874. +# CONFIG_NINO is not set
  7875. +# CONFIG_SGI_IP22 is not set
  7876. +# CONFIG_SGI_IP27 is not set
  7877. +# CONFIG_SIBYTE_SB1xxx_SOC is not set
  7878. +# CONFIG_SNI_RM200_PCI is not set
  7879. +# CONFIG_TANBAC_TB0226 is not set
  7880. +# CONFIG_TANBAC_TB0229 is not set
  7881. +# CONFIG_TOSHIBA_JMR3927 is not set
  7882. +# CONFIG_TOSHIBA_RBTX4927 is not set
  7883. +# CONFIG_VICTOR_MPC30X is not set
  7884. +# CONFIG_ZAO_CAPCELLA is not set
  7885. +# CONFIG_HIGHMEM is not set
  7886. +CONFIG_RWSEM_GENERIC_SPINLOCK=y
  7887. +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
  7888. +CONFIG_SOC_AU1X00=y
  7889. +CONFIG_SOC_AU1200=y
  7890. +CONFIG_NONCOHERENT_IO=y
  7891. +CONFIG_PC_KEYB=y
  7892. +# CONFIG_MIPS_AU1000 is not set
  7893. +
  7894. +#
  7895. +# CPU selection
  7896. +#
  7897. +CONFIG_CPU_MIPS32=y
  7898. +# CONFIG_CPU_MIPS64 is not set
  7899. +# CONFIG_CPU_R3000 is not set
  7900. +# CONFIG_CPU_TX39XX is not set
  7901. +# CONFIG_CPU_VR41XX is not set
  7902. +# CONFIG_CPU_R4300 is not set
  7903. +# CONFIG_CPU_R4X00 is not set
  7904. +# CONFIG_CPU_TX49XX is not set
  7905. +# CONFIG_CPU_R5000 is not set
  7906. +# CONFIG_CPU_R5432 is not set
  7907. +# CONFIG_CPU_R6000 is not set
  7908. +# CONFIG_CPU_NEVADA is not set
  7909. +# CONFIG_CPU_R8000 is not set
  7910. +# CONFIG_CPU_R10000 is not set
  7911. +# CONFIG_CPU_RM7000 is not set
  7912. +# CONFIG_CPU_RM9000 is not set
  7913. +# CONFIG_CPU_SB1 is not set
  7914. +CONFIG_PAGE_SIZE_4KB=y
  7915. +# CONFIG_PAGE_SIZE_16KB is not set
  7916. +# CONFIG_PAGE_SIZE_64KB is not set
  7917. +CONFIG_CPU_HAS_PREFETCH=y
  7918. +# CONFIG_VTAG_ICACHE is not set
  7919. +CONFIG_64BIT_PHYS_ADDR=y
  7920. +# CONFIG_CPU_ADVANCED is not set
  7921. +CONFIG_CPU_HAS_LLSC=y
  7922. +# CONFIG_CPU_HAS_LLDSCD is not set
  7923. +# CONFIG_CPU_HAS_WB is not set
  7924. +CONFIG_CPU_HAS_SYNC=y
  7925. +
  7926. +#
  7927. +# General setup
  7928. +#
  7929. +CONFIG_CPU_LITTLE_ENDIAN=y
  7930. +# CONFIG_BUILD_ELF64 is not set
  7931. +CONFIG_NET=y
  7932. +CONFIG_PCI=y
  7933. +CONFIG_PCI_NEW=y
  7934. +CONFIG_PCI_AUTO=y
  7935. +# CONFIG_PCI_NAMES is not set
  7936. +# CONFIG_ISA is not set
  7937. +# CONFIG_TC is not set
  7938. +# CONFIG_MCA is not set
  7939. +# CONFIG_SBUS is not set
  7940. +CONFIG_HOTPLUG=y
  7941. +
  7942. +#
  7943. +# PCMCIA/CardBus support
  7944. +#
  7945. +CONFIG_PCMCIA=m
  7946. +# CONFIG_CARDBUS is not set
  7947. +# CONFIG_TCIC is not set
  7948. +# CONFIG_I82092 is not set
  7949. +# CONFIG_I82365 is not set
  7950. +CONFIG_PCMCIA_AU1X00=m
  7951. +
  7952. +#
  7953. +# PCI Hotplug Support
  7954. +#
  7955. +# CONFIG_HOTPLUG_PCI is not set
  7956. +# CONFIG_HOTPLUG_PCI_COMPAQ is not set
  7957. +# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
  7958. +# CONFIG_HOTPLUG_PCI_SHPC is not set
  7959. +# CONFIG_HOTPLUG_PCI_SHPC_POLL_EVENT_MODE is not set
  7960. +# CONFIG_HOTPLUG_PCI_PCIE is not set
  7961. +# CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE is not set
  7962. +CONFIG_SYSVIPC=y
  7963. +# CONFIG_BSD_PROCESS_ACCT is not set
  7964. +CONFIG_SYSCTL=y
  7965. +CONFIG_KCORE_ELF=y
  7966. +# CONFIG_KCORE_AOUT is not set
  7967. +# CONFIG_BINFMT_AOUT is not set
  7968. +CONFIG_BINFMT_ELF=y
  7969. +# CONFIG_MIPS32_COMPAT is not set
  7970. +# CONFIG_MIPS32_O32 is not set
  7971. +# CONFIG_MIPS32_N32 is not set
  7972. +# CONFIG_BINFMT_ELF32 is not set
  7973. +# CONFIG_BINFMT_MISC is not set
  7974. +# CONFIG_OOM_KILLER is not set
  7975. +CONFIG_CMDLINE_BOOL=y
  7976. +CONFIG_CMDLINE="mem=96M"
  7977. +# CONFIG_PM is not set
  7978. +
  7979. +#
  7980. +# Memory Technology Devices (MTD)
  7981. +#
  7982. +# CONFIG_MTD is not set
  7983. +
  7984. +#
  7985. +# Parallel port support
  7986. +#
  7987. +# CONFIG_PARPORT is not set
  7988. +
  7989. +#
  7990. +# Plug and Play configuration
  7991. +#
  7992. +# CONFIG_PNP is not set
  7993. +# CONFIG_ISAPNP is not set
  7994. +
  7995. +#
  7996. +# Block devices
  7997. +#
  7998. +# CONFIG_BLK_DEV_FD is not set
  7999. +# CONFIG_BLK_DEV_XD is not set
  8000. +# CONFIG_PARIDE is not set
  8001. +# CONFIG_BLK_CPQ_DA is not set
  8002. +# CONFIG_BLK_CPQ_CISS_DA is not set
  8003. +# CONFIG_CISS_SCSI_TAPE is not set
  8004. +# CONFIG_CISS_MONITOR_THREAD is not set
  8005. +# CONFIG_BLK_DEV_DAC960 is not set
  8006. +# CONFIG_BLK_DEV_UMEM is not set
  8007. +# CONFIG_BLK_DEV_SX8 is not set
  8008. +CONFIG_BLK_DEV_LOOP=y
  8009. +# CONFIG_BLK_DEV_NBD is not set
  8010. +# CONFIG_BLK_DEV_RAM is not set
  8011. +# CONFIG_BLK_DEV_INITRD is not set
  8012. +# CONFIG_BLK_STATS is not set
  8013. +
  8014. +#
  8015. +# Multi-device support (RAID and LVM)
  8016. +#
  8017. +# CONFIG_MD is not set
  8018. +# CONFIG_BLK_DEV_MD is not set
  8019. +# CONFIG_MD_LINEAR is not set
  8020. +# CONFIG_MD_RAID0 is not set
  8021. +# CONFIG_MD_RAID1 is not set
  8022. +# CONFIG_MD_RAID5 is not set
  8023. +# CONFIG_MD_MULTIPATH is not set
  8024. +# CONFIG_BLK_DEV_LVM is not set
  8025. +
  8026. +#
  8027. +# Networking options
  8028. +#
  8029. +CONFIG_PACKET=y
  8030. +# CONFIG_PACKET_MMAP is not set
  8031. +# CONFIG_NETLINK_DEV is not set
  8032. +CONFIG_NETFILTER=y
  8033. +# CONFIG_NETFILTER_DEBUG is not set
  8034. +CONFIG_FILTER=y
  8035. +CONFIG_UNIX=y
  8036. +CONFIG_INET=y
  8037. +CONFIG_IP_MULTICAST=y
  8038. +# CONFIG_IP_ADVANCED_ROUTER is not set
  8039. +CONFIG_IP_PNP=y
  8040. +# CONFIG_IP_PNP_DHCP is not set
  8041. +CONFIG_IP_PNP_BOOTP=y
  8042. +# CONFIG_IP_PNP_RARP is not set
  8043. +# CONFIG_NET_IPIP is not set
  8044. +# CONFIG_NET_IPGRE is not set
  8045. +# CONFIG_IP_MROUTE is not set
  8046. +# CONFIG_ARPD is not set
  8047. +# CONFIG_INET_ECN is not set
  8048. +# CONFIG_SYN_COOKIES is not set
  8049. +
  8050. +#
  8051. +# IP: Netfilter Configuration
  8052. +#
  8053. +# CONFIG_IP_NF_CONNTRACK is not set
  8054. +# CONFIG_IP_NF_QUEUE is not set
  8055. +# CONFIG_IP_NF_IPTABLES is not set
  8056. +# CONFIG_IP_NF_ARPTABLES is not set
  8057. +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
  8058. +# CONFIG_IP_NF_COMPAT_IPFWADM is not set
  8059. +
  8060. +#
  8061. +# IP: Virtual Server Configuration
  8062. +#
  8063. +# CONFIG_IP_VS is not set
  8064. +# CONFIG_IPV6 is not set
  8065. +# CONFIG_KHTTPD is not set
  8066. +
  8067. +#
  8068. +# SCTP Configuration (EXPERIMENTAL)
  8069. +#
  8070. +# CONFIG_IP_SCTP is not set
  8071. +# CONFIG_ATM is not set
  8072. +# CONFIG_VLAN_8021Q is not set
  8073. +
  8074. +#
  8075. +#
  8076. +#
  8077. +# CONFIG_IPX is not set
  8078. +# CONFIG_ATALK is not set
  8079. +# CONFIG_DECNET is not set
  8080. +# CONFIG_BRIDGE is not set
  8081. +# CONFIG_X25 is not set
  8082. +# CONFIG_LAPB is not set
  8083. +# CONFIG_LLC is not set
  8084. +# CONFIG_NET_DIVERT is not set
  8085. +# CONFIG_ECONET is not set
  8086. +# CONFIG_WAN_ROUTER is not set
  8087. +# CONFIG_NET_FASTROUTE is not set
  8088. +# CONFIG_NET_HW_FLOWCONTROL is not set
  8089. +
  8090. +#
  8091. +# QoS and/or fair queueing
  8092. +#
  8093. +# CONFIG_NET_SCHED is not set
  8094. +
  8095. +#
  8096. +# Network testing
  8097. +#
  8098. +# CONFIG_NET_PKTGEN is not set
  8099. +
  8100. +#
  8101. +# Telephony Support
  8102. +#
  8103. +# CONFIG_PHONE is not set
  8104. +# CONFIG_PHONE_IXJ is not set
  8105. +# CONFIG_PHONE_IXJ_PCMCIA is not set
  8106. +
  8107. +#
  8108. +# ATA/IDE/MFM/RLL support
  8109. +#
  8110. +CONFIG_IDE=y
  8111. +
  8112. +#
  8113. +# IDE, ATA and ATAPI Block devices
  8114. +#
  8115. +CONFIG_BLK_DEV_IDE=y
  8116. +
  8117. +#
  8118. +# Please see Documentation/ide.txt for help/info on IDE drives
  8119. +#
  8120. +# CONFIG_BLK_DEV_HD_IDE is not set
  8121. +# CONFIG_BLK_DEV_HD is not set
  8122. +# CONFIG_BLK_DEV_IDE_SATA is not set
  8123. +CONFIG_BLK_DEV_IDEDISK=y
  8124. +CONFIG_IDEDISK_MULTI_MODE=y
  8125. +CONFIG_IDEDISK_STROKE=y
  8126. +CONFIG_BLK_DEV_IDECS=m
  8127. +# CONFIG_BLK_DEV_DELKIN is not set
  8128. +# CONFIG_BLK_DEV_IDECD is not set
  8129. +# CONFIG_BLK_DEV_IDETAPE is not set
  8130. +# CONFIG_BLK_DEV_IDEFLOPPY is not set
  8131. +# CONFIG_BLK_DEV_IDESCSI is not set
  8132. +# CONFIG_IDE_TASK_IOCTL is not set
  8133. +
  8134. +#
  8135. +# IDE chipset support/bugfixes
  8136. +#
  8137. +# CONFIG_BLK_DEV_CMD640 is not set
  8138. +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
  8139. +# CONFIG_BLK_DEV_ISAPNP is not set
  8140. +# CONFIG_BLK_DEV_IDEPCI is not set
  8141. +# CONFIG_IDE_CHIPSETS is not set
  8142. +# CONFIG_IDEDMA_AUTO is not set
  8143. +# CONFIG_DMA_NONPCI is not set
  8144. +# CONFIG_BLK_DEV_ATARAID is not set
  8145. +# CONFIG_BLK_DEV_ATARAID_PDC is not set
  8146. +# CONFIG_BLK_DEV_ATARAID_HPT is not set
  8147. +# CONFIG_BLK_DEV_ATARAID_MEDLEY is not set
  8148. +# CONFIG_BLK_DEV_ATARAID_SII is not set
  8149. +
  8150. +#
  8151. +# SCSI support
  8152. +#
  8153. +CONFIG_SCSI=y
  8154. +
  8155. +#
  8156. +# SCSI support type (disk, tape, CD-ROM)
  8157. +#
  8158. +CONFIG_BLK_DEV_SD=y
  8159. +CONFIG_SD_EXTRA_DEVS=40
  8160. +CONFIG_CHR_DEV_ST=y
  8161. +# CONFIG_CHR_DEV_OSST is not set
  8162. +CONFIG_BLK_DEV_SR=y
  8163. +# CONFIG_BLK_DEV_SR_VENDOR is not set
  8164. +CONFIG_SR_EXTRA_DEVS=2
  8165. +# CONFIG_CHR_DEV_SG is not set
  8166. +
  8167. +#
  8168. +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
  8169. +#
  8170. +# CONFIG_SCSI_DEBUG_QUEUES is not set
  8171. +# CONFIG_SCSI_MULTI_LUN is not set
  8172. +CONFIG_SCSI_CONSTANTS=y
  8173. +# CONFIG_SCSI_LOGGING is not set
  8174. +
  8175. +#
  8176. +# SCSI low-level drivers
  8177. +#
  8178. +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
  8179. +# CONFIG_SCSI_7000FASST is not set
  8180. +# CONFIG_SCSI_ACARD is not set
  8181. +# CONFIG_SCSI_AHA152X is not set
  8182. +# CONFIG_SCSI_AHA1542 is not set
  8183. +# CONFIG_SCSI_AHA1740 is not set
  8184. +# CONFIG_SCSI_AACRAID is not set
  8185. +# CONFIG_SCSI_AIC7XXX is not set
  8186. +# CONFIG_SCSI_AIC79XX is not set
  8187. +# CONFIG_SCSI_AIC7XXX_OLD is not set
  8188. +# CONFIG_SCSI_DPT_I2O is not set
  8189. +# CONFIG_SCSI_ADVANSYS is not set
  8190. +# CONFIG_SCSI_IN2000 is not set
  8191. +# CONFIG_SCSI_AM53C974 is not set
  8192. +# CONFIG_SCSI_MEGARAID is not set
  8193. +# CONFIG_SCSI_MEGARAID2 is not set
  8194. +# CONFIG_SCSI_SATA is not set
  8195. +# CONFIG_SCSI_SATA_AHCI is not set
  8196. +# CONFIG_SCSI_SATA_SVW is not set
  8197. +# CONFIG_SCSI_ATA_PIIX is not set
  8198. +# CONFIG_SCSI_SATA_NV is not set
  8199. +# CONFIG_SCSI_SATA_QSTOR is not set
  8200. +# CONFIG_SCSI_SATA_PROMISE is not set
  8201. +# CONFIG_SCSI_SATA_SX4 is not set
  8202. +# CONFIG_SCSI_SATA_SIL is not set
  8203. +# CONFIG_SCSI_SATA_SIS is not set
  8204. +# CONFIG_SCSI_SATA_ULI is not set
  8205. +# CONFIG_SCSI_SATA_VIA is not set
  8206. +# CONFIG_SCSI_SATA_VITESSE is not set
  8207. +# CONFIG_SCSI_BUSLOGIC is not set
  8208. +# CONFIG_SCSI_CPQFCTS is not set
  8209. +# CONFIG_SCSI_DMX3191D is not set
  8210. +# CONFIG_SCSI_DTC3280 is not set
  8211. +# CONFIG_SCSI_EATA is not set
  8212. +# CONFIG_SCSI_EATA_DMA is not set
  8213. +# CONFIG_SCSI_EATA_PIO is not set
  8214. +# CONFIG_SCSI_FUTURE_DOMAIN is not set
  8215. +# CONFIG_SCSI_GDTH is not set
  8216. +# CONFIG_SCSI_GENERIC_NCR5380 is not set
  8217. +# CONFIG_SCSI_INITIO is not set
  8218. +# CONFIG_SCSI_INIA100 is not set
  8219. +# CONFIG_SCSI_NCR53C406A is not set
  8220. +# CONFIG_SCSI_NCR53C7xx is not set
  8221. +# CONFIG_SCSI_SYM53C8XX_2 is not set
  8222. +# CONFIG_SCSI_NCR53C8XX is not set
  8223. +# CONFIG_SCSI_SYM53C8XX is not set
  8224. +# CONFIG_SCSI_PAS16 is not set
  8225. +# CONFIG_SCSI_PCI2000 is not set
  8226. +# CONFIG_SCSI_PCI2220I is not set
  8227. +# CONFIG_SCSI_PSI240I is not set
  8228. +# CONFIG_SCSI_QLOGIC_FAS is not set
  8229. +# CONFIG_SCSI_QLOGIC_ISP is not set
  8230. +# CONFIG_SCSI_QLOGIC_FC is not set
  8231. +# CONFIG_SCSI_QLOGIC_1280 is not set
  8232. +# CONFIG_SCSI_SIM710 is not set
  8233. +# CONFIG_SCSI_SYM53C416 is not set
  8234. +# CONFIG_SCSI_DC390T is not set
  8235. +# CONFIG_SCSI_T128 is not set
  8236. +# CONFIG_SCSI_U14_34F is not set
  8237. +# CONFIG_SCSI_NSP32 is not set
  8238. +# CONFIG_SCSI_DEBUG is not set
  8239. +
  8240. +#
  8241. +# PCMCIA SCSI adapter support
  8242. +#
  8243. +# CONFIG_SCSI_PCMCIA is not set
  8244. +
  8245. +#
  8246. +# Fusion MPT device support
  8247. +#
  8248. +# CONFIG_FUSION is not set
  8249. +# CONFIG_FUSION_BOOT is not set
  8250. +# CONFIG_FUSION_ISENSE is not set
  8251. +# CONFIG_FUSION_CTL is not set
  8252. +# CONFIG_FUSION_LAN is not set
  8253. +
  8254. +#
  8255. +# IEEE 1394 (FireWire) support (EXPERIMENTAL)
  8256. +#
  8257. +# CONFIG_IEEE1394 is not set
  8258. +
  8259. +#
  8260. +# I2O device support
  8261. +#
  8262. +# CONFIG_I2O is not set
  8263. +# CONFIG_I2O_PCI is not set
  8264. +# CONFIG_I2O_BLOCK is not set
  8265. +# CONFIG_I2O_LAN is not set
  8266. +# CONFIG_I2O_SCSI is not set
  8267. +# CONFIG_I2O_PROC is not set
  8268. +
  8269. +#
  8270. +# Network device support
  8271. +#
  8272. +CONFIG_NETDEVICES=y
  8273. +
  8274. +#
  8275. +# ARCnet devices
  8276. +#
  8277. +# CONFIG_ARCNET is not set
  8278. +# CONFIG_DUMMY is not set
  8279. +# CONFIG_BONDING is not set
  8280. +# CONFIG_EQUALIZER is not set
  8281. +# CONFIG_TUN is not set
  8282. +# CONFIG_ETHERTAP is not set
  8283. +
  8284. +#
  8285. +# Ethernet (10 or 100Mbit)
  8286. +#
  8287. +CONFIG_NET_ETHERNET=y
  8288. +# CONFIG_MIPS_AU1X00_ENET is not set
  8289. +# CONFIG_SUNLANCE is not set
  8290. +# CONFIG_HAPPYMEAL is not set
  8291. +# CONFIG_SUNBMAC is not set
  8292. +# CONFIG_SUNQE is not set
  8293. +# CONFIG_SUNGEM is not set
  8294. +# CONFIG_NET_VENDOR_3COM is not set
  8295. +# CONFIG_LANCE is not set
  8296. +# CONFIG_NET_VENDOR_SMC is not set
  8297. +# CONFIG_NET_VENDOR_RACAL is not set
  8298. +# CONFIG_HP100 is not set
  8299. +# CONFIG_NET_ISA is not set
  8300. +# CONFIG_NET_PCI is not set
  8301. +# CONFIG_NET_POCKET is not set
  8302. +
  8303. +#
  8304. +# Ethernet (1000 Mbit)
  8305. +#
  8306. +# CONFIG_ACENIC is not set
  8307. +# CONFIG_DL2K is not set
  8308. +# CONFIG_E1000 is not set
  8309. +# CONFIG_MYRI_SBUS is not set
  8310. +# CONFIG_NS83820 is not set
  8311. +# CONFIG_HAMACHI is not set
  8312. +# CONFIG_YELLOWFIN is not set
  8313. +# CONFIG_R8169 is not set
  8314. +# CONFIG_SK98LIN is not set
  8315. +# CONFIG_TIGON3 is not set
  8316. +# CONFIG_FDDI is not set
  8317. +# CONFIG_HIPPI is not set
  8318. +# CONFIG_PLIP is not set
  8319. +CONFIG_PPP=m
  8320. +CONFIG_PPP_MULTILINK=y
  8321. +# CONFIG_PPP_FILTER is not set
  8322. +CONFIG_PPP_ASYNC=m
  8323. +# CONFIG_PPP_SYNC_TTY is not set
  8324. +CONFIG_PPP_DEFLATE=m
  8325. +# CONFIG_PPP_BSDCOMP is not set
  8326. +CONFIG_PPPOE=m
  8327. +# CONFIG_SLIP is not set
  8328. +
  8329. +#
  8330. +# Wireless LAN (non-hamradio)
  8331. +#
  8332. +# CONFIG_NET_RADIO is not set
  8333. +
  8334. +#
  8335. +# Token Ring devices
  8336. +#
  8337. +# CONFIG_TR is not set
  8338. +# CONFIG_NET_FC is not set
  8339. +# CONFIG_RCPCI is not set
  8340. +# CONFIG_SHAPER is not set
  8341. +
  8342. +#
  8343. +# Wan interfaces
  8344. +#
  8345. +# CONFIG_WAN is not set
  8346. +
  8347. +#
  8348. +# PCMCIA network device support
  8349. +#
  8350. +# CONFIG_NET_PCMCIA is not set
  8351. +
  8352. +#
  8353. +# Amateur Radio support
  8354. +#
  8355. +# CONFIG_HAMRADIO is not set
  8356. +
  8357. +#
  8358. +# IrDA (infrared) support
  8359. +#
  8360. +# CONFIG_IRDA is not set
  8361. +
  8362. +#
  8363. +# ISDN subsystem
  8364. +#
  8365. +# CONFIG_ISDN is not set
  8366. +
  8367. +#
  8368. +# Input core support
  8369. +#
  8370. +CONFIG_INPUT=y
  8371. +CONFIG_INPUT_KEYBDEV=y
  8372. +CONFIG_INPUT_MOUSEDEV=y
  8373. +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
  8374. +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
  8375. +# CONFIG_INPUT_JOYDEV is not set
  8376. +CONFIG_INPUT_EVDEV=y
  8377. +# CONFIG_INPUT_UINPUT is not set
  8378. +
  8379. +#
  8380. +# Character devices
  8381. +#
  8382. +CONFIG_VT=y
  8383. +# CONFIG_VT_CONSOLE is not set
  8384. +# CONFIG_SERIAL is not set
  8385. +# CONFIG_SERIAL_EXTENDED is not set
  8386. +CONFIG_SERIAL_NONSTANDARD=y
  8387. +# CONFIG_COMPUTONE is not set
  8388. +# CONFIG_ROCKETPORT is not set
  8389. +# CONFIG_CYCLADES is not set
  8390. +# CONFIG_DIGIEPCA is not set
  8391. +# CONFIG_DIGI is not set
  8392. +# CONFIG_ESPSERIAL is not set
  8393. +# CONFIG_MOXA_INTELLIO is not set
  8394. +# CONFIG_MOXA_SMARTIO is not set
  8395. +# CONFIG_ISI is not set
  8396. +# CONFIG_SYNCLINK is not set
  8397. +# CONFIG_SYNCLINKMP is not set
  8398. +# CONFIG_N_HDLC is not set
  8399. +# CONFIG_RISCOM8 is not set
  8400. +# CONFIG_SPECIALIX is not set
  8401. +# CONFIG_SX is not set
  8402. +# CONFIG_RIO is not set
  8403. +# CONFIG_STALDRV is not set
  8404. +# CONFIG_SERIAL_TX3912 is not set
  8405. +# CONFIG_SERIAL_TX3912_CONSOLE is not set
  8406. +# CONFIG_SERIAL_TXX9 is not set
  8407. +# CONFIG_SERIAL_TXX9_CONSOLE is not set
  8408. +CONFIG_AU1X00_UART=y
  8409. +CONFIG_AU1X00_SERIAL_CONSOLE=y
  8410. +# CONFIG_AU1X00_USB_TTY is not set
  8411. +# CONFIG_AU1X00_USB_RAW is not set
  8412. +# CONFIG_TXX927_SERIAL is not set
  8413. +CONFIG_UNIX98_PTYS=y
  8414. +CONFIG_UNIX98_PTY_COUNT=256
  8415. +
  8416. +#
  8417. +# I2C support
  8418. +#
  8419. +CONFIG_I2C=y
  8420. +# CONFIG_I2C_ALGOBIT is not set
  8421. +# CONFIG_SCx200_ACB is not set
  8422. +# CONFIG_I2C_ALGOPCF is not set
  8423. +# CONFIG_I2C_CHARDEV is not set
  8424. +CONFIG_I2C_PROC=y
  8425. +
  8426. +#
  8427. +# Mice
  8428. +#
  8429. +# CONFIG_BUSMOUSE is not set
  8430. +# CONFIG_MOUSE is not set
  8431. +
  8432. +#
  8433. +# Joysticks
  8434. +#
  8435. +# CONFIG_INPUT_GAMEPORT is not set
  8436. +# CONFIG_INPUT_NS558 is not set
  8437. +# CONFIG_INPUT_LIGHTNING is not set
  8438. +# CONFIG_INPUT_PCIGAME is not set
  8439. +# CONFIG_INPUT_CS461X is not set
  8440. +# CONFIG_INPUT_EMU10K1 is not set
  8441. +# CONFIG_INPUT_SERIO is not set
  8442. +# CONFIG_INPUT_SERPORT is not set
  8443. +
  8444. +#
  8445. +# Joysticks
  8446. +#
  8447. +# CONFIG_INPUT_ANALOG is not set
  8448. +# CONFIG_INPUT_A3D is not set
  8449. +# CONFIG_INPUT_ADI is not set
  8450. +# CONFIG_INPUT_COBRA is not set
  8451. +# CONFIG_INPUT_GF2K is not set
  8452. +# CONFIG_INPUT_GRIP is not set
  8453. +# CONFIG_INPUT_INTERACT is not set
  8454. +# CONFIG_INPUT_TMDC is not set
  8455. +# CONFIG_INPUT_SIDEWINDER is not set
  8456. +# CONFIG_INPUT_IFORCE_USB is not set
  8457. +# CONFIG_INPUT_IFORCE_232 is not set
  8458. +# CONFIG_INPUT_WARRIOR is not set
  8459. +# CONFIG_INPUT_MAGELLAN is not set
  8460. +# CONFIG_INPUT_SPACEORB is not set
  8461. +# CONFIG_INPUT_SPACEBALL is not set
  8462. +# CONFIG_INPUT_STINGER is not set
  8463. +# CONFIG_INPUT_DB9 is not set
  8464. +# CONFIG_INPUT_GAMECON is not set
  8465. +# CONFIG_INPUT_TURBOGRAFX is not set
  8466. +# CONFIG_QIC02_TAPE is not set
  8467. +# CONFIG_IPMI_HANDLER is not set
  8468. +# CONFIG_IPMI_PANIC_EVENT is not set
  8469. +# CONFIG_IPMI_DEVICE_INTERFACE is not set
  8470. +# CONFIG_IPMI_KCS is not set
  8471. +# CONFIG_IPMI_WATCHDOG is not set
  8472. +
  8473. +#
  8474. +# Watchdog Cards
  8475. +#
  8476. +# CONFIG_WATCHDOG is not set
  8477. +# CONFIG_SCx200 is not set
  8478. +# CONFIG_SCx200_GPIO is not set
  8479. +# CONFIG_AMD_PM768 is not set
  8480. +# CONFIG_NVRAM is not set
  8481. +# CONFIG_RTC is not set
  8482. +# CONFIG_DTLK is not set
  8483. +# CONFIG_R3964 is not set
  8484. +# CONFIG_APPLICOM is not set
  8485. +
  8486. +#
  8487. +# Ftape, the floppy tape device driver
  8488. +#
  8489. +# CONFIG_FTAPE is not set
  8490. +# CONFIG_AGP is not set
  8491. +
  8492. +#
  8493. +# Direct Rendering Manager (XFree86 DRI support)
  8494. +#
  8495. +# CONFIG_DRM is not set
  8496. +
  8497. +#
  8498. +# PCMCIA character devices
  8499. +#
  8500. +# CONFIG_PCMCIA_SERIAL_CS is not set
  8501. +# CONFIG_SYNCLINK_CS is not set
  8502. +# CONFIG_AU1X00_GPIO is not set
  8503. +# CONFIG_TS_AU1X00_ADS7846 is not set
  8504. +
  8505. +#
  8506. +# File systems
  8507. +#
  8508. +# CONFIG_QUOTA is not set
  8509. +# CONFIG_QFMT_V2 is not set
  8510. +CONFIG_AUTOFS_FS=y
  8511. +# CONFIG_AUTOFS4_FS is not set
  8512. +# CONFIG_REISERFS_FS is not set
  8513. +# CONFIG_REISERFS_CHECK is not set
  8514. +# CONFIG_REISERFS_PROC_INFO is not set
  8515. +# CONFIG_ADFS_FS is not set
  8516. +# CONFIG_ADFS_FS_RW is not set
  8517. +# CONFIG_AFFS_FS is not set
  8518. +# CONFIG_HFS_FS is not set
  8519. +# CONFIG_HFSPLUS_FS is not set
  8520. +# CONFIG_BEFS_FS is not set
  8521. +# CONFIG_BEFS_DEBUG is not set
  8522. +# CONFIG_BFS_FS is not set
  8523. +CONFIG_EXT3_FS=y
  8524. +CONFIG_JBD=y
  8525. +# CONFIG_JBD_DEBUG is not set
  8526. +CONFIG_FAT_FS=y
  8527. +CONFIG_MSDOS_FS=y
  8528. +# CONFIG_UMSDOS_FS is not set
  8529. +CONFIG_VFAT_FS=y
  8530. +# CONFIG_EFS_FS is not set
  8531. +# CONFIG_JFFS_FS is not set
  8532. +# CONFIG_JFFS2_FS is not set
  8533. +# CONFIG_CRAMFS is not set
  8534. +CONFIG_TMPFS=y
  8535. +CONFIG_RAMFS=y
  8536. +# CONFIG_ISO9660_FS is not set
  8537. +# CONFIG_JOLIET is not set
  8538. +# CONFIG_ZISOFS is not set
  8539. +# CONFIG_JFS_FS is not set
  8540. +# CONFIG_JFS_DEBUG is not set
  8541. +# CONFIG_JFS_STATISTICS is not set
  8542. +# CONFIG_MINIX_FS is not set
  8543. +# CONFIG_VXFS_FS is not set
  8544. +# CONFIG_NTFS_FS is not set
  8545. +# CONFIG_NTFS_RW is not set
  8546. +# CONFIG_HPFS_FS is not set
  8547. +CONFIG_PROC_FS=y
  8548. +# CONFIG_DEVFS_FS is not set
  8549. +# CONFIG_DEVFS_MOUNT is not set
  8550. +# CONFIG_DEVFS_DEBUG is not set
  8551. +CONFIG_DEVPTS_FS=y
  8552. +# CONFIG_QNX4FS_FS is not set
  8553. +# CONFIG_QNX4FS_RW is not set
  8554. +# CONFIG_ROMFS_FS is not set
  8555. +CONFIG_EXT2_FS=y
  8556. +# CONFIG_SYSV_FS is not set
  8557. +# CONFIG_UDF_FS is not set
  8558. +# CONFIG_UDF_RW is not set
  8559. +# CONFIG_UFS_FS is not set
  8560. +# CONFIG_UFS_FS_WRITE is not set
  8561. +# CONFIG_XFS_FS is not set
  8562. +# CONFIG_XFS_QUOTA is not set
  8563. +# CONFIG_XFS_RT is not set
  8564. +# CONFIG_XFS_TRACE is not set
  8565. +# CONFIG_XFS_DEBUG is not set
  8566. +
  8567. +#
  8568. +# Network File Systems
  8569. +#
  8570. +# CONFIG_CODA_FS is not set
  8571. +# CONFIG_INTERMEZZO_FS is not set
  8572. +CONFIG_NFS_FS=y
  8573. +CONFIG_NFS_V3=y
  8574. +# CONFIG_NFS_DIRECTIO is not set
  8575. +CONFIG_ROOT_NFS=y
  8576. +# CONFIG_NFSD is not set
  8577. +# CONFIG_NFSD_V3 is not set
  8578. +# CONFIG_NFSD_TCP is not set
  8579. +CONFIG_SUNRPC=y
  8580. +CONFIG_LOCKD=y
  8581. +CONFIG_LOCKD_V4=y
  8582. +# CONFIG_SMB_FS is not set
  8583. +# CONFIG_NCP_FS is not set
  8584. +# CONFIG_NCPFS_PACKET_SIGNING is not set
  8585. +# CONFIG_NCPFS_IOCTL_LOCKING is not set
  8586. +# CONFIG_NCPFS_STRONG is not set
  8587. +# CONFIG_NCPFS_NFS_NS is not set
  8588. +# CONFIG_NCPFS_OS2_NS is not set
  8589. +# CONFIG_NCPFS_SMALLDOS is not set
  8590. +# CONFIG_NCPFS_NLS is not set
  8591. +# CONFIG_NCPFS_EXTRAS is not set
  8592. +# CONFIG_ZISOFS_FS is not set
  8593. +
  8594. +#
  8595. +# Partition Types
  8596. +#
  8597. +# CONFIG_PARTITION_ADVANCED is not set
  8598. +CONFIG_MSDOS_PARTITION=y
  8599. +# CONFIG_SMB_NLS is not set
  8600. +CONFIG_NLS=y
  8601. +
  8602. +#
  8603. +# Native Language Support
  8604. +#
  8605. +CONFIG_NLS_DEFAULT="iso8859-1"
  8606. +# CONFIG_NLS_CODEPAGE_437 is not set
  8607. +# CONFIG_NLS_CODEPAGE_737 is not set
  8608. +# CONFIG_NLS_CODEPAGE_775 is not set
  8609. +# CONFIG_NLS_CODEPAGE_850 is not set
  8610. +# CONFIG_NLS_CODEPAGE_852 is not set
  8611. +# CONFIG_NLS_CODEPAGE_855 is not set
  8612. +# CONFIG_NLS_CODEPAGE_857 is not set
  8613. +# CONFIG_NLS_CODEPAGE_860 is not set
  8614. +# CONFIG_NLS_CODEPAGE_861 is not set
  8615. +# CONFIG_NLS_CODEPAGE_862 is not set
  8616. +# CONFIG_NLS_CODEPAGE_863 is not set
  8617. +# CONFIG_NLS_CODEPAGE_864 is not set
  8618. +# CONFIG_NLS_CODEPAGE_865 is not set
  8619. +# CONFIG_NLS_CODEPAGE_866 is not set
  8620. +# CONFIG_NLS_CODEPAGE_869 is not set
  8621. +# CONFIG_NLS_CODEPAGE_936 is not set
  8622. +# CONFIG_NLS_CODEPAGE_950 is not set
  8623. +# CONFIG_NLS_CODEPAGE_932 is not set
  8624. +# CONFIG_NLS_CODEPAGE_949 is not set
  8625. +# CONFIG_NLS_CODEPAGE_874 is not set
  8626. +# CONFIG_NLS_ISO8859_8 is not set
  8627. +# CONFIG_NLS_CODEPAGE_1250 is not set
  8628. +# CONFIG_NLS_CODEPAGE_1251 is not set
  8629. +# CONFIG_NLS_ISO8859_1 is not set
  8630. +# CONFIG_NLS_ISO8859_2 is not set
  8631. +# CONFIG_NLS_ISO8859_3 is not set
  8632. +# CONFIG_NLS_ISO8859_4 is not set
  8633. +# CONFIG_NLS_ISO8859_5 is not set
  8634. +# CONFIG_NLS_ISO8859_6 is not set
  8635. +# CONFIG_NLS_ISO8859_7 is not set
  8636. +# CONFIG_NLS_ISO8859_9 is not set
  8637. +# CONFIG_NLS_ISO8859_13 is not set
  8638. +# CONFIG_NLS_ISO8859_14 is not set
  8639. +# CONFIG_NLS_ISO8859_15 is not set
  8640. +# CONFIG_NLS_KOI8_R is not set
  8641. +# CONFIG_NLS_KOI8_U is not set
  8642. +# CONFIG_NLS_UTF8 is not set
  8643. +
  8644. +#
  8645. +# Multimedia devices
  8646. +#
  8647. +# CONFIG_VIDEO_DEV is not set
  8648. +
  8649. +#
  8650. +# Console drivers
  8651. +#
  8652. +# CONFIG_VGA_CONSOLE is not set
  8653. +# CONFIG_MDA_CONSOLE is not set
  8654. +
  8655. +#
  8656. +# Frame-buffer support
  8657. +#
  8658. +CONFIG_FB=y
  8659. +CONFIG_DUMMY_CONSOLE=y
  8660. +# CONFIG_FB_RIVA is not set
  8661. +# CONFIG_FB_CLGEN is not set
  8662. +# CONFIG_FB_PM2 is not set
  8663. +# CONFIG_FB_PM3 is not set
  8664. +# CONFIG_FB_CYBER2000 is not set
  8665. +# CONFIG_FB_MATROX is not set
  8666. +# CONFIG_FB_ATY is not set
  8667. +# CONFIG_FB_RADEON is not set
  8668. +# CONFIG_FB_ATY128 is not set
  8669. +# CONFIG_FB_INTEL is not set
  8670. +# CONFIG_FB_SIS is not set
  8671. +# CONFIG_FB_NEOMAGIC is not set
  8672. +# CONFIG_FB_3DFX is not set
  8673. +# CONFIG_FB_VOODOO1 is not set
  8674. +# CONFIG_FB_TRIDENT is not set
  8675. +# CONFIG_FB_E1356 is not set
  8676. +# CONFIG_FB_IT8181 is not set
  8677. +# CONFIG_FB_VIRTUAL is not set
  8678. +CONFIG_FBCON_ADVANCED=y
  8679. +# CONFIG_FBCON_MFB is not set
  8680. +# CONFIG_FBCON_CFB2 is not set
  8681. +# CONFIG_FBCON_CFB4 is not set
  8682. +# CONFIG_FBCON_CFB8 is not set
  8683. +CONFIG_FBCON_CFB16=y
  8684. +# CONFIG_FBCON_CFB24 is not set
  8685. +CONFIG_FBCON_CFB32=y
  8686. +# CONFIG_FBCON_AFB is not set
  8687. +# CONFIG_FBCON_ILBM is not set
  8688. +# CONFIG_FBCON_IPLAN2P2 is not set
  8689. +# CONFIG_FBCON_IPLAN2P4 is not set
  8690. +# CONFIG_FBCON_IPLAN2P8 is not set
  8691. +# CONFIG_FBCON_MAC is not set
  8692. +# CONFIG_FBCON_VGA_PLANES is not set
  8693. +# CONFIG_FBCON_VGA is not set
  8694. +# CONFIG_FBCON_HGA is not set
  8695. +# CONFIG_FBCON_FONTWIDTH8_ONLY is not set
  8696. +CONFIG_FBCON_FONTS=y
  8697. +CONFIG_FONT_8x8=y
  8698. +CONFIG_FONT_8x16=y
  8699. +# CONFIG_FONT_SUN8x16 is not set
  8700. +# CONFIG_FONT_SUN12x22 is not set
  8701. +# CONFIG_FONT_6x11 is not set
  8702. +# CONFIG_FONT_PEARL_8x8 is not set
  8703. +# CONFIG_FONT_ACORN_8x8 is not set
  8704. +
  8705. +#
  8706. +# Sound
  8707. +#
  8708. +CONFIG_SOUND=y
  8709. +# CONFIG_SOUND_ALI5455 is not set
  8710. +# CONFIG_SOUND_BT878 is not set
  8711. +# CONFIG_SOUND_CMPCI is not set
  8712. +# CONFIG_SOUND_EMU10K1 is not set
  8713. +# CONFIG_MIDI_EMU10K1 is not set
  8714. +# CONFIG_SOUND_FUSION is not set
  8715. +# CONFIG_SOUND_CS4281 is not set
  8716. +# CONFIG_SOUND_ES1370 is not set
  8717. +# CONFIG_SOUND_ES1371 is not set
  8718. +# CONFIG_SOUND_ESSSOLO1 is not set
  8719. +# CONFIG_SOUND_MAESTRO is not set
  8720. +# CONFIG_SOUND_MAESTRO3 is not set
  8721. +# CONFIG_SOUND_FORTE is not set
  8722. +# CONFIG_SOUND_ICH is not set
  8723. +# CONFIG_SOUND_RME96XX is not set
  8724. +# CONFIG_SOUND_SONICVIBES is not set
  8725. +# CONFIG_SOUND_AU1X00 is not set
  8726. +CONFIG_SOUND_AU1550_PSC=y
  8727. +# CONFIG_SOUND_AU1550_I2S is not set
  8728. +# CONFIG_SOUND_TRIDENT is not set
  8729. +# CONFIG_SOUND_MSNDCLAS is not set
  8730. +# CONFIG_SOUND_MSNDPIN is not set
  8731. +# CONFIG_SOUND_VIA82CXXX is not set
  8732. +# CONFIG_MIDI_VIA82CXXX is not set
  8733. +# CONFIG_SOUND_OSS is not set
  8734. +# CONFIG_SOUND_TVMIXER is not set
  8735. +# CONFIG_SOUND_AD1980 is not set
  8736. +# CONFIG_SOUND_WM97XX is not set
  8737. +
  8738. +#
  8739. +# USB support
  8740. +#
  8741. +CONFIG_USB=y
  8742. +# CONFIG_USB_DEBUG is not set
  8743. +
  8744. +#
  8745. +# Miscellaneous USB options
  8746. +#
  8747. +CONFIG_USB_DEVICEFS=y
  8748. +# CONFIG_USB_BANDWIDTH is not set
  8749. +
  8750. +#
  8751. +# USB Host Controller Drivers
  8752. +#
  8753. +# CONFIG_USB_EHCI_HCD is not set
  8754. +# CONFIG_USB_UHCI is not set
  8755. +# CONFIG_USB_UHCI_ALT is not set
  8756. +CONFIG_USB_OHCI=y
  8757. +
  8758. +#
  8759. +# USB Device Class drivers
  8760. +#
  8761. +# CONFIG_USB_AUDIO is not set
  8762. +# CONFIG_USB_EMI26 is not set
  8763. +# CONFIG_USB_BLUETOOTH is not set
  8764. +# CONFIG_USB_MIDI is not set
  8765. +CONFIG_USB_STORAGE=y
  8766. +# CONFIG_USB_STORAGE_DEBUG is not set
  8767. +# CONFIG_USB_STORAGE_DATAFAB is not set
  8768. +# CONFIG_USB_STORAGE_FREECOM is not set
  8769. +# CONFIG_USB_STORAGE_ISD200 is not set
  8770. +# CONFIG_USB_STORAGE_DPCM is not set
  8771. +# CONFIG_USB_STORAGE_HP8200e is not set
  8772. +# CONFIG_USB_STORAGE_SDDR09 is not set
  8773. +# CONFIG_USB_STORAGE_SDDR55 is not set
  8774. +# CONFIG_USB_STORAGE_JUMPSHOT is not set
  8775. +# CONFIG_USB_ACM is not set
  8776. +# CONFIG_USB_PRINTER is not set
  8777. +
  8778. +#
  8779. +# USB Human Interface Devices (HID)
  8780. +#
  8781. +CONFIG_USB_HID=y
  8782. +CONFIG_USB_HIDINPUT=y
  8783. +CONFIG_USB_HIDDEV=y
  8784. +# CONFIG_USB_AIPTEK is not set
  8785. +# CONFIG_USB_WACOM is not set
  8786. +# CONFIG_USB_KBTAB is not set
  8787. +# CONFIG_USB_POWERMATE is not set
  8788. +
  8789. +#
  8790. +# USB Imaging devices
  8791. +#
  8792. +# CONFIG_USB_DC2XX is not set
  8793. +# CONFIG_USB_MDC800 is not set
  8794. +# CONFIG_USB_SCANNER is not set
  8795. +# CONFIG_USB_MICROTEK is not set
  8796. +# CONFIG_USB_HPUSBSCSI is not set
  8797. +
  8798. +#
  8799. +# USB Multimedia devices
  8800. +#
  8801. +
  8802. +#
  8803. +# Video4Linux support is needed for USB Multimedia device support
  8804. +#
  8805. +
  8806. +#
  8807. +# USB Network adaptors
  8808. +#
  8809. +# CONFIG_USB_PEGASUS is not set
  8810. +# CONFIG_USB_RTL8150 is not set
  8811. +# CONFIG_USB_KAWETH is not set
  8812. +# CONFIG_USB_CATC is not set
  8813. +# CONFIG_USB_CDCETHER is not set
  8814. +# CONFIG_USB_USBNET is not set
  8815. +
  8816. +#
  8817. +# USB port drivers
  8818. +#
  8819. +# CONFIG_USB_USS720 is not set
  8820. +
  8821. +#
  8822. +# USB Serial Converter support
  8823. +#
  8824. +# CONFIG_USB_SERIAL is not set
  8825. +
  8826. +#
  8827. +# USB Miscellaneous drivers
  8828. +#
  8829. +# CONFIG_USB_RIO500 is not set
  8830. +# CONFIG_USB_AUERSWALD is not set
  8831. +# CONFIG_USB_TIGL is not set
  8832. +# CONFIG_USB_BRLVGER is not set
  8833. +# CONFIG_USB_LCD is not set
  8834. +
  8835. +#
  8836. +# Support for USB gadgets
  8837. +#
  8838. +# CONFIG_USB_GADGET is not set
  8839. +
  8840. +#
  8841. +# Bluetooth support
  8842. +#
  8843. +# CONFIG_BLUEZ is not set
  8844. +
  8845. +#
  8846. +# Kernel hacking
  8847. +#
  8848. +CONFIG_CROSSCOMPILE=y
  8849. +# CONFIG_RUNTIME_DEBUG is not set
  8850. +# CONFIG_KGDB is not set
  8851. +# CONFIG_GDB_CONSOLE is not set
  8852. +# CONFIG_DEBUG_INFO is not set
  8853. +# CONFIG_MAGIC_SYSRQ is not set
  8854. +# CONFIG_MIPS_UNCACHED is not set
  8855. +CONFIG_LOG_BUF_SHIFT=0
  8856. +
  8857. +#
  8858. +# Cryptographic options
  8859. +#
  8860. +# CONFIG_CRYPTO is not set
  8861. +
  8862. +#
  8863. +# Library routines
  8864. +#
  8865. +# CONFIG_CRC32 is not set
  8866. +CONFIG_ZLIB_INFLATE=m
  8867. +CONFIG_ZLIB_DEFLATE=m
  8868. +# CONFIG_FW_LOADER is not set
  8869. Index: linux-2.4.35.4/arch/mips/defconfig-pb1500
  8870. ===================================================================
  8871. --- linux-2.4.35.4.orig/arch/mips/defconfig-pb1500
  8872. +++ linux-2.4.35.4/arch/mips/defconfig-pb1500
  8873. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  8874. # CONFIG_MIPS_PB1000 is not set
  8875. # CONFIG_MIPS_PB1100 is not set
  8876. CONFIG_MIPS_PB1500=y
  8877. -# CONFIG_MIPS_HYDROGEN3 is not set
  8878. # CONFIG_MIPS_PB1550 is not set
  8879. +# CONFIG_MIPS_HYDROGEN3 is not set
  8880. # CONFIG_MIPS_XXS1500 is not set
  8881. # CONFIG_MIPS_MTX1 is not set
  8882. # CONFIG_COGENT_CSB250 is not set
  8883. @@ -215,9 +215,7 @@ CONFIG_MTD_PB1500=y
  8884. # CONFIG_MTD_MTX1 is not set
  8885. CONFIG_MTD_PB1500_BOOT=y
  8886. # CONFIG_MTD_PB1500_USER is not set
  8887. -# CONFIG_MTD_DB1X00 is not set
  8888. # CONFIG_MTD_PB1550 is not set
  8889. -# CONFIG_MTD_HYDROGEN3 is not set
  8890. # CONFIG_MTD_MIRAGE is not set
  8891. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  8892. # CONFIG_MTD_OCELOT is not set
  8893. @@ -236,7 +234,6 @@ CONFIG_MTD_PB1500_BOOT=y
  8894. #
  8895. # Disk-On-Chip Device Drivers
  8896. #
  8897. -# CONFIG_MTD_DOC1000 is not set
  8898. # CONFIG_MTD_DOC2000 is not set
  8899. # CONFIG_MTD_DOC2001 is not set
  8900. # CONFIG_MTD_DOCPROBE is not set
  8901. @@ -341,11 +338,6 @@ CONFIG_IP_PNP_BOOTP=y
  8902. #
  8903. # CONFIG_IPX is not set
  8904. # CONFIG_ATALK is not set
  8905. -
  8906. -#
  8907. -# Appletalk devices
  8908. -#
  8909. -# CONFIG_DEV_APPLETALK is not set
  8910. # CONFIG_DECNET is not set
  8911. # CONFIG_BRIDGE is not set
  8912. # CONFIG_X25 is not set
  8913. @@ -675,7 +667,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  8914. # CONFIG_AU1X00_USB_TTY is not set
  8915. # CONFIG_AU1X00_USB_RAW is not set
  8916. # CONFIG_TXX927_SERIAL is not set
  8917. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  8918. CONFIG_UNIX98_PTYS=y
  8919. CONFIG_UNIX98_PTY_COUNT=256
  8920. Index: linux-2.4.35.4/arch/mips/defconfig-pb1550
  8921. ===================================================================
  8922. --- linux-2.4.35.4.orig/arch/mips/defconfig-pb1550
  8923. +++ linux-2.4.35.4/arch/mips/defconfig-pb1550
  8924. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  8925. # CONFIG_MIPS_PB1000 is not set
  8926. # CONFIG_MIPS_PB1100 is not set
  8927. # CONFIG_MIPS_PB1500 is not set
  8928. -# CONFIG_MIPS_HYDROGEN3 is not set
  8929. CONFIG_MIPS_PB1550=y
  8930. +# CONFIG_MIPS_HYDROGEN3 is not set
  8931. # CONFIG_MIPS_XXS1500 is not set
  8932. # CONFIG_MIPS_MTX1 is not set
  8933. # CONFIG_COGENT_CSB250 is not set
  8934. @@ -213,11 +213,9 @@ CONFIG_MTD_CFI_AMDSTD=y
  8935. # CONFIG_MTD_BOSPORUS is not set
  8936. # CONFIG_MTD_XXS1500 is not set
  8937. # CONFIG_MTD_MTX1 is not set
  8938. -# CONFIG_MTD_DB1X00 is not set
  8939. CONFIG_MTD_PB1550=y
  8940. CONFIG_MTD_PB1550_BOOT=y
  8941. CONFIG_MTD_PB1550_USER=y
  8942. -# CONFIG_MTD_HYDROGEN3 is not set
  8943. # CONFIG_MTD_MIRAGE is not set
  8944. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  8945. # CONFIG_MTD_OCELOT is not set
  8946. @@ -236,7 +234,6 @@ CONFIG_MTD_PB1550_USER=y
  8947. #
  8948. # Disk-On-Chip Device Drivers
  8949. #
  8950. -# CONFIG_MTD_DOC1000 is not set
  8951. # CONFIG_MTD_DOC2000 is not set
  8952. # CONFIG_MTD_DOC2001 is not set
  8953. # CONFIG_MTD_DOCPROBE is not set
  8954. @@ -343,11 +340,6 @@ CONFIG_IP_PNP_BOOTP=y
  8955. #
  8956. # CONFIG_IPX is not set
  8957. # CONFIG_ATALK is not set
  8958. -
  8959. -#
  8960. -# Appletalk devices
  8961. -#
  8962. -# CONFIG_DEV_APPLETALK is not set
  8963. # CONFIG_DECNET is not set
  8964. # CONFIG_BRIDGE is not set
  8965. # CONFIG_X25 is not set
  8966. @@ -633,7 +625,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  8967. # CONFIG_AU1X00_USB_TTY is not set
  8968. # CONFIG_AU1X00_USB_RAW is not set
  8969. # CONFIG_TXX927_SERIAL is not set
  8970. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  8971. CONFIG_UNIX98_PTYS=y
  8972. CONFIG_UNIX98_PTY_COUNT=256
  8973. Index: linux-2.4.35.4/arch/mips/defconfig-rbtx4927
  8974. ===================================================================
  8975. --- linux-2.4.35.4.orig/arch/mips/defconfig-rbtx4927
  8976. +++ linux-2.4.35.4/arch/mips/defconfig-rbtx4927
  8977. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  8978. # CONFIG_MIPS_PB1000 is not set
  8979. # CONFIG_MIPS_PB1100 is not set
  8980. # CONFIG_MIPS_PB1500 is not set
  8981. -# CONFIG_MIPS_HYDROGEN3 is not set
  8982. # CONFIG_MIPS_PB1550 is not set
  8983. +# CONFIG_MIPS_HYDROGEN3 is not set
  8984. # CONFIG_MIPS_XXS1500 is not set
  8985. # CONFIG_MIPS_MTX1 is not set
  8986. # CONFIG_COGENT_CSB250 is not set
  8987. @@ -223,11 +223,6 @@ CONFIG_IP_PNP_DHCP=y
  8988. #
  8989. # CONFIG_IPX is not set
  8990. # CONFIG_ATALK is not set
  8991. -
  8992. -#
  8993. -# Appletalk devices
  8994. -#
  8995. -# CONFIG_DEV_APPLETALK is not set
  8996. # CONFIG_DECNET is not set
  8997. # CONFIG_BRIDGE is not set
  8998. # CONFIG_X25 is not set
  8999. @@ -466,7 +461,6 @@ CONFIG_SERIAL_NONSTANDARD=y
  9000. CONFIG_SERIAL_TXX9=y
  9001. CONFIG_SERIAL_TXX9_CONSOLE=y
  9002. # CONFIG_TXX927_SERIAL is not set
  9003. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  9004. # CONFIG_UNIX98_PTYS is not set
  9005. #
  9006. Index: linux-2.4.35.4/arch/mips/defconfig-rm200
  9007. ===================================================================
  9008. --- linux-2.4.35.4.orig/arch/mips/defconfig-rm200
  9009. +++ linux-2.4.35.4/arch/mips/defconfig-rm200
  9010. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  9011. # CONFIG_MIPS_PB1000 is not set
  9012. # CONFIG_MIPS_PB1100 is not set
  9013. # CONFIG_MIPS_PB1500 is not set
  9014. -# CONFIG_MIPS_HYDROGEN3 is not set
  9015. # CONFIG_MIPS_PB1550 is not set
  9016. +# CONFIG_MIPS_HYDROGEN3 is not set
  9017. # CONFIG_MIPS_XXS1500 is not set
  9018. # CONFIG_MIPS_MTX1 is not set
  9019. # CONFIG_COGENT_CSB250 is not set
  9020. @@ -229,11 +229,6 @@ CONFIG_INET=y
  9021. #
  9022. # CONFIG_IPX is not set
  9023. # CONFIG_ATALK is not set
  9024. -
  9025. -#
  9026. -# Appletalk devices
  9027. -#
  9028. -# CONFIG_DEV_APPLETALK is not set
  9029. # CONFIG_DECNET is not set
  9030. # CONFIG_BRIDGE is not set
  9031. # CONFIG_X25 is not set
  9032. @@ -340,7 +335,6 @@ CONFIG_VT_CONSOLE=y
  9033. # CONFIG_SERIAL is not set
  9034. # CONFIG_SERIAL_EXTENDED is not set
  9035. # CONFIG_SERIAL_NONSTANDARD is not set
  9036. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  9037. CONFIG_UNIX98_PTYS=y
  9038. CONFIG_UNIX98_PTY_COUNT=256
  9039. Index: linux-2.4.35.4/arch/mips/defconfig-sb1250-swarm
  9040. ===================================================================
  9041. --- linux-2.4.35.4.orig/arch/mips/defconfig-sb1250-swarm
  9042. +++ linux-2.4.35.4/arch/mips/defconfig-sb1250-swarm
  9043. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  9044. # CONFIG_MIPS_PB1000 is not set
  9045. # CONFIG_MIPS_PB1100 is not set
  9046. # CONFIG_MIPS_PB1500 is not set
  9047. -# CONFIG_MIPS_HYDROGEN3 is not set
  9048. # CONFIG_MIPS_PB1550 is not set
  9049. +# CONFIG_MIPS_HYDROGEN3 is not set
  9050. # CONFIG_MIPS_XXS1500 is not set
  9051. # CONFIG_MIPS_MTX1 is not set
  9052. # CONFIG_COGENT_CSB250 is not set
  9053. @@ -90,6 +90,7 @@ CONFIG_SIBYTE_CFE=y
  9054. # CONFIG_SIBYTE_TBPROF is not set
  9055. CONFIG_SIBYTE_GENBUS_IDE=y
  9056. CONFIG_SMP_CAPABLE=y
  9057. +CONFIG_MIPS_RTC=y
  9058. # CONFIG_SNI_RM200_PCI is not set
  9059. # CONFIG_TANBAC_TB0226 is not set
  9060. # CONFIG_TANBAC_TB0229 is not set
  9061. @@ -253,11 +254,6 @@ CONFIG_INET=y
  9062. #
  9063. # CONFIG_IPX is not set
  9064. # CONFIG_ATALK is not set
  9065. -
  9066. -#
  9067. -# Appletalk devices
  9068. -#
  9069. -# CONFIG_DEV_APPLETALK is not set
  9070. # CONFIG_DECNET is not set
  9071. # CONFIG_BRIDGE is not set
  9072. # CONFIG_X25 is not set
  9073. @@ -469,7 +465,6 @@ CONFIG_SERIAL_NONSTANDARD=y
  9074. CONFIG_SIBYTE_SB1250_DUART=y
  9075. CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y
  9076. CONFIG_SERIAL_CONSOLE=y
  9077. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  9078. CONFIG_UNIX98_PTYS=y
  9079. CONFIG_UNIX98_PTY_COUNT=256
  9080. Index: linux-2.4.35.4/arch/mips/defconfig-sead
  9081. ===================================================================
  9082. --- linux-2.4.35.4.orig/arch/mips/defconfig-sead
  9083. +++ linux-2.4.35.4/arch/mips/defconfig-sead
  9084. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  9085. # CONFIG_MIPS_PB1000 is not set
  9086. # CONFIG_MIPS_PB1100 is not set
  9087. # CONFIG_MIPS_PB1500 is not set
  9088. -# CONFIG_MIPS_HYDROGEN3 is not set
  9089. # CONFIG_MIPS_PB1550 is not set
  9090. +# CONFIG_MIPS_HYDROGEN3 is not set
  9091. # CONFIG_MIPS_XXS1500 is not set
  9092. # CONFIG_MIPS_MTX1 is not set
  9093. # CONFIG_COGENT_CSB250 is not set
  9094. @@ -244,7 +244,6 @@ CONFIG_SERIAL=y
  9095. CONFIG_SERIAL_CONSOLE=y
  9096. # CONFIG_SERIAL_EXTENDED is not set
  9097. # CONFIG_SERIAL_NONSTANDARD is not set
  9098. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  9099. # CONFIG_UNIX98_PTYS is not set
  9100. #
  9101. Index: linux-2.4.35.4/arch/mips/defconfig-stretch
  9102. ===================================================================
  9103. --- linux-2.4.35.4.orig/arch/mips/defconfig-stretch
  9104. +++ linux-2.4.35.4/arch/mips/defconfig-stretch
  9105. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  9106. # CONFIG_MIPS_PB1000 is not set
  9107. # CONFIG_MIPS_PB1100 is not set
  9108. # CONFIG_MIPS_PB1500 is not set
  9109. -# CONFIG_MIPS_HYDROGEN3 is not set
  9110. # CONFIG_MIPS_PB1550 is not set
  9111. +# CONFIG_MIPS_HYDROGEN3 is not set
  9112. # CONFIG_MIPS_XXS1500 is not set
  9113. # CONFIG_MIPS_MTX1 is not set
  9114. # CONFIG_COGENT_CSB250 is not set
  9115. @@ -240,11 +240,6 @@ CONFIG_IP_PNP_DHCP=y
  9116. #
  9117. # CONFIG_IPX is not set
  9118. # CONFIG_ATALK is not set
  9119. -
  9120. -#
  9121. -# Appletalk devices
  9122. -#
  9123. -# CONFIG_DEV_APPLETALK is not set
  9124. # CONFIG_DECNET is not set
  9125. # CONFIG_BRIDGE is not set
  9126. # CONFIG_X25 is not set
  9127. @@ -324,9 +319,11 @@ CONFIG_CHR_DEV_SG=y
  9128. # CONFIG_SCSI_MEGARAID is not set
  9129. # CONFIG_SCSI_MEGARAID2 is not set
  9130. # CONFIG_SCSI_SATA is not set
  9131. +# CONFIG_SCSI_SATA_AHCI is not set
  9132. # CONFIG_SCSI_SATA_SVW is not set
  9133. # CONFIG_SCSI_ATA_PIIX is not set
  9134. # CONFIG_SCSI_SATA_NV is not set
  9135. +# CONFIG_SCSI_SATA_QSTOR is not set
  9136. # CONFIG_SCSI_SATA_PROMISE is not set
  9137. # CONFIG_SCSI_SATA_SX4 is not set
  9138. # CONFIG_SCSI_SATA_SIL is not set
  9139. @@ -516,7 +513,6 @@ CONFIG_SERIAL_NONSTANDARD=y
  9140. # CONFIG_SERIAL_TXX9 is not set
  9141. # CONFIG_SERIAL_TXX9_CONSOLE is not set
  9142. # CONFIG_TXX927_SERIAL is not set
  9143. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  9144. CONFIG_UNIX98_PTYS=y
  9145. CONFIG_UNIX98_PTY_COUNT=256
  9146. Index: linux-2.4.35.4/arch/mips/defconfig-tb0226
  9147. ===================================================================
  9148. --- linux-2.4.35.4.orig/arch/mips/defconfig-tb0226
  9149. +++ linux-2.4.35.4/arch/mips/defconfig-tb0226
  9150. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  9151. # CONFIG_MIPS_PB1000 is not set
  9152. # CONFIG_MIPS_PB1100 is not set
  9153. # CONFIG_MIPS_PB1500 is not set
  9154. -# CONFIG_MIPS_HYDROGEN3 is not set
  9155. # CONFIG_MIPS_PB1550 is not set
  9156. +# CONFIG_MIPS_HYDROGEN3 is not set
  9157. # CONFIG_MIPS_XXS1500 is not set
  9158. # CONFIG_MIPS_MTX1 is not set
  9159. # CONFIG_COGENT_CSB250 is not set
  9160. @@ -228,11 +228,6 @@ CONFIG_IP_PNP_BOOTP=y
  9161. #
  9162. # CONFIG_IPX is not set
  9163. # CONFIG_ATALK is not set
  9164. -
  9165. -#
  9166. -# Appletalk devices
  9167. -#
  9168. -# CONFIG_DEV_APPLETALK is not set
  9169. # CONFIG_DECNET is not set
  9170. # CONFIG_BRIDGE is not set
  9171. # CONFIG_X25 is not set
  9172. @@ -312,9 +307,11 @@ CONFIG_SCSI_CONSTANTS=y
  9173. # CONFIG_SCSI_MEGARAID is not set
  9174. # CONFIG_SCSI_MEGARAID2 is not set
  9175. # CONFIG_SCSI_SATA is not set
  9176. +# CONFIG_SCSI_SATA_AHCI is not set
  9177. # CONFIG_SCSI_SATA_SVW is not set
  9178. # CONFIG_SCSI_ATA_PIIX is not set
  9179. # CONFIG_SCSI_SATA_NV is not set
  9180. +# CONFIG_SCSI_SATA_QSTOR is not set
  9181. # CONFIG_SCSI_SATA_PROMISE is not set
  9182. # CONFIG_SCSI_SATA_SX4 is not set
  9183. # CONFIG_SCSI_SATA_SIL is not set
  9184. @@ -518,7 +515,6 @@ CONFIG_SERIAL=y
  9185. CONFIG_SERIAL_CONSOLE=y
  9186. # CONFIG_SERIAL_EXTENDED is not set
  9187. # CONFIG_SERIAL_NONSTANDARD is not set
  9188. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  9189. # CONFIG_VR41XX_KIU is not set
  9190. CONFIG_UNIX98_PTYS=y
  9191. CONFIG_UNIX98_PTY_COUNT=256
  9192. Index: linux-2.4.35.4/arch/mips/defconfig-tb0229
  9193. ===================================================================
  9194. --- linux-2.4.35.4.orig/arch/mips/defconfig-tb0229
  9195. +++ linux-2.4.35.4/arch/mips/defconfig-tb0229
  9196. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  9197. # CONFIG_MIPS_PB1000 is not set
  9198. # CONFIG_MIPS_PB1100 is not set
  9199. # CONFIG_MIPS_PB1500 is not set
  9200. -# CONFIG_MIPS_HYDROGEN3 is not set
  9201. # CONFIG_MIPS_PB1550 is not set
  9202. +# CONFIG_MIPS_HYDROGEN3 is not set
  9203. # CONFIG_MIPS_XXS1500 is not set
  9204. # CONFIG_MIPS_MTX1 is not set
  9205. # CONFIG_COGENT_CSB250 is not set
  9206. @@ -230,11 +230,6 @@ CONFIG_IP_PNP_BOOTP=y
  9207. #
  9208. # CONFIG_IPX is not set
  9209. # CONFIG_ATALK is not set
  9210. -
  9211. -#
  9212. -# Appletalk devices
  9213. -#
  9214. -# CONFIG_DEV_APPLETALK is not set
  9215. # CONFIG_DECNET is not set
  9216. # CONFIG_BRIDGE is not set
  9217. # CONFIG_X25 is not set
  9218. @@ -445,7 +440,6 @@ CONFIG_SERIAL=y
  9219. CONFIG_SERIAL_CONSOLE=y
  9220. # CONFIG_SERIAL_EXTENDED is not set
  9221. # CONFIG_SERIAL_NONSTANDARD is not set
  9222. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  9223. # CONFIG_VR41XX_KIU is not set
  9224. CONFIG_UNIX98_PTYS=y
  9225. CONFIG_UNIX98_PTY_COUNT=256
  9226. Index: linux-2.4.35.4/arch/mips/defconfig-ti1500
  9227. ===================================================================
  9228. --- linux-2.4.35.4.orig/arch/mips/defconfig-ti1500
  9229. +++ linux-2.4.35.4/arch/mips/defconfig-ti1500
  9230. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  9231. # CONFIG_MIPS_PB1000 is not set
  9232. # CONFIG_MIPS_PB1100 is not set
  9233. # CONFIG_MIPS_PB1500 is not set
  9234. -# CONFIG_MIPS_HYDROGEN3 is not set
  9235. # CONFIG_MIPS_PB1550 is not set
  9236. +# CONFIG_MIPS_HYDROGEN3 is not set
  9237. CONFIG_MIPS_XXS1500=y
  9238. # CONFIG_MIPS_MTX1 is not set
  9239. # CONFIG_COGENT_CSB250 is not set
  9240. @@ -213,9 +213,7 @@ CONFIG_MTD_CFI_AMDSTD=y
  9241. # CONFIG_MTD_BOSPORUS is not set
  9242. CONFIG_MTD_XXS1500=y
  9243. # CONFIG_MTD_MTX1 is not set
  9244. -# CONFIG_MTD_DB1X00 is not set
  9245. # CONFIG_MTD_PB1550 is not set
  9246. -# CONFIG_MTD_HYDROGEN3 is not set
  9247. # CONFIG_MTD_MIRAGE is not set
  9248. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  9249. # CONFIG_MTD_OCELOT is not set
  9250. @@ -234,7 +232,6 @@ CONFIG_MTD_XXS1500=y
  9251. #
  9252. # Disk-On-Chip Device Drivers
  9253. #
  9254. -# CONFIG_MTD_DOC1000 is not set
  9255. # CONFIG_MTD_DOC2000 is not set
  9256. # CONFIG_MTD_DOC2001 is not set
  9257. # CONFIG_MTD_DOCPROBE is not set
  9258. @@ -339,11 +336,6 @@ CONFIG_IP_PNP_BOOTP=y
  9259. #
  9260. # CONFIG_IPX is not set
  9261. # CONFIG_ATALK is not set
  9262. -
  9263. -#
  9264. -# Appletalk devices
  9265. -#
  9266. -# CONFIG_DEV_APPLETALK is not set
  9267. # CONFIG_DECNET is not set
  9268. # CONFIG_BRIDGE is not set
  9269. # CONFIG_X25 is not set
  9270. @@ -600,7 +592,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  9271. # CONFIG_AU1X00_USB_TTY is not set
  9272. # CONFIG_AU1X00_USB_RAW is not set
  9273. # CONFIG_TXX927_SERIAL is not set
  9274. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  9275. CONFIG_UNIX98_PTYS=y
  9276. CONFIG_UNIX98_PTY_COUNT=256
  9277. Index: linux-2.4.35.4/arch/mips/defconfig-workpad
  9278. ===================================================================
  9279. --- linux-2.4.35.4.orig/arch/mips/defconfig-workpad
  9280. +++ linux-2.4.35.4/arch/mips/defconfig-workpad
  9281. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  9282. # CONFIG_MIPS_PB1000 is not set
  9283. # CONFIG_MIPS_PB1100 is not set
  9284. # CONFIG_MIPS_PB1500 is not set
  9285. -# CONFIG_MIPS_HYDROGEN3 is not set
  9286. # CONFIG_MIPS_PB1550 is not set
  9287. +# CONFIG_MIPS_HYDROGEN3 is not set
  9288. # CONFIG_MIPS_XXS1500 is not set
  9289. # CONFIG_MIPS_MTX1 is not set
  9290. # CONFIG_COGENT_CSB250 is not set
  9291. @@ -222,11 +222,6 @@ CONFIG_IP_MULTICAST=y
  9292. #
  9293. # CONFIG_IPX is not set
  9294. # CONFIG_ATALK is not set
  9295. -
  9296. -#
  9297. -# Appletalk devices
  9298. -#
  9299. -# CONFIG_DEV_APPLETALK is not set
  9300. # CONFIG_DECNET is not set
  9301. # CONFIG_BRIDGE is not set
  9302. # CONFIG_X25 is not set
  9303. @@ -426,7 +421,6 @@ CONFIG_SERIAL_MANY_PORTS=y
  9304. # CONFIG_SERIAL_MULTIPORT is not set
  9305. # CONFIG_HUB6 is not set
  9306. # CONFIG_SERIAL_NONSTANDARD is not set
  9307. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  9308. # CONFIG_VR41XX_KIU is not set
  9309. CONFIG_UNIX98_PTYS=y
  9310. CONFIG_UNIX98_PTY_COUNT=256
  9311. Index: linux-2.4.35.4/arch/mips/defconfig-xxs1500
  9312. ===================================================================
  9313. --- linux-2.4.35.4.orig/arch/mips/defconfig-xxs1500
  9314. +++ linux-2.4.35.4/arch/mips/defconfig-xxs1500
  9315. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  9316. # CONFIG_MIPS_PB1000 is not set
  9317. # CONFIG_MIPS_PB1100 is not set
  9318. # CONFIG_MIPS_PB1500 is not set
  9319. -# CONFIG_MIPS_HYDROGEN3 is not set
  9320. # CONFIG_MIPS_PB1550 is not set
  9321. +# CONFIG_MIPS_HYDROGEN3 is not set
  9322. CONFIG_MIPS_XXS1500=y
  9323. # CONFIG_MIPS_MTX1 is not set
  9324. # CONFIG_COGENT_CSB250 is not set
  9325. @@ -213,9 +213,7 @@ CONFIG_MTD_CFI_AMDSTD=y
  9326. # CONFIG_MTD_BOSPORUS is not set
  9327. CONFIG_MTD_XXS1500=y
  9328. # CONFIG_MTD_MTX1 is not set
  9329. -# CONFIG_MTD_DB1X00 is not set
  9330. # CONFIG_MTD_PB1550 is not set
  9331. -# CONFIG_MTD_HYDROGEN3 is not set
  9332. # CONFIG_MTD_MIRAGE is not set
  9333. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  9334. # CONFIG_MTD_OCELOT is not set
  9335. @@ -234,7 +232,6 @@ CONFIG_MTD_XXS1500=y
  9336. #
  9337. # Disk-On-Chip Device Drivers
  9338. #
  9339. -# CONFIG_MTD_DOC1000 is not set
  9340. # CONFIG_MTD_DOC2000 is not set
  9341. # CONFIG_MTD_DOC2001 is not set
  9342. # CONFIG_MTD_DOCPROBE is not set
  9343. @@ -339,11 +336,6 @@ CONFIG_IP_PNP_BOOTP=y
  9344. #
  9345. # CONFIG_IPX is not set
  9346. # CONFIG_ATALK is not set
  9347. -
  9348. -#
  9349. -# Appletalk devices
  9350. -#
  9351. -# CONFIG_DEV_APPLETALK is not set
  9352. # CONFIG_DECNET is not set
  9353. # CONFIG_BRIDGE is not set
  9354. # CONFIG_X25 is not set
  9355. @@ -671,7 +663,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  9356. # CONFIG_AU1X00_USB_TTY is not set
  9357. # CONFIG_AU1X00_USB_RAW is not set
  9358. # CONFIG_TXX927_SERIAL is not set
  9359. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  9360. CONFIG_UNIX98_PTYS=y
  9361. CONFIG_UNIX98_PTY_COUNT=256
  9362. Index: linux-2.4.35.4/arch/mips/defconfig-yosemite
  9363. ===================================================================
  9364. --- linux-2.4.35.4.orig/arch/mips/defconfig-yosemite
  9365. +++ linux-2.4.35.4/arch/mips/defconfig-yosemite
  9366. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  9367. # CONFIG_MIPS_PB1000 is not set
  9368. # CONFIG_MIPS_PB1100 is not set
  9369. # CONFIG_MIPS_PB1500 is not set
  9370. -# CONFIG_MIPS_HYDROGEN3 is not set
  9371. # CONFIG_MIPS_PB1550 is not set
  9372. +# CONFIG_MIPS_HYDROGEN3 is not set
  9373. # CONFIG_MIPS_XXS1500 is not set
  9374. # CONFIG_MIPS_MTX1 is not set
  9375. # CONFIG_COGENT_CSB250 is not set
  9376. @@ -227,11 +227,6 @@ CONFIG_IP_PNP_DHCP=y
  9377. #
  9378. # CONFIG_IPX is not set
  9379. # CONFIG_ATALK is not set
  9380. -
  9381. -#
  9382. -# Appletalk devices
  9383. -#
  9384. -# CONFIG_DEV_APPLETALK is not set
  9385. # CONFIG_DECNET is not set
  9386. # CONFIG_BRIDGE is not set
  9387. # CONFIG_X25 is not set
  9388. @@ -310,9 +305,11 @@ CONFIG_CHR_DEV_SG=y
  9389. # CONFIG_SCSI_MEGARAID is not set
  9390. # CONFIG_SCSI_MEGARAID2 is not set
  9391. # CONFIG_SCSI_SATA is not set
  9392. +# CONFIG_SCSI_SATA_AHCI is not set
  9393. # CONFIG_SCSI_SATA_SVW is not set
  9394. # CONFIG_SCSI_ATA_PIIX is not set
  9395. # CONFIG_SCSI_SATA_NV is not set
  9396. +# CONFIG_SCSI_SATA_QSTOR is not set
  9397. # CONFIG_SCSI_SATA_PROMISE is not set
  9398. # CONFIG_SCSI_SATA_SX4 is not set
  9399. # CONFIG_SCSI_SATA_SIL is not set
  9400. @@ -477,7 +474,6 @@ CONFIG_SERIAL_NONSTANDARD=y
  9401. # CONFIG_SERIAL_TXX9 is not set
  9402. # CONFIG_SERIAL_TXX9_CONSOLE is not set
  9403. # CONFIG_TXX927_SERIAL is not set
  9404. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  9405. CONFIG_UNIX98_PTYS=y
  9406. CONFIG_UNIX98_PTY_COUNT=256
  9407. Index: linux-2.4.35.4/arch/mips/kernel/cpu-probe.c
  9408. ===================================================================
  9409. --- linux-2.4.35.4.orig/arch/mips/kernel/cpu-probe.c
  9410. +++ linux-2.4.35.4/arch/mips/kernel/cpu-probe.c
  9411. @@ -34,21 +34,16 @@ static void r4k_wait(void)
  9412. ".set\tmips0");
  9413. }
  9414. -/* The Au1xxx wait is available only if we run CONFIG_PM and
  9415. - * the timer setup found we had a 32KHz counter available.
  9416. - * There are still problems with functions that may call au1k_wait
  9417. - * directly, but that will be discovered pretty quickly.
  9418. - */
  9419. -extern void (*au1k_wait_ptr)(void);
  9420. -void au1k_wait(void)
  9421. +/* The Au1xxx wait is available only if using 32khz counter or
  9422. + * external timer source, but specifically not CP0 Counter. */
  9423. +int allow_au1k_wait;
  9424. +
  9425. +static void au1k_wait(void)
  9426. {
  9427. -#ifdef CONFIG_PM
  9428. - unsigned long addr;
  9429. /* using the wait instruction makes CP0 counter unusable */
  9430. - __asm__("la %0,au1k_wait\n\t"
  9431. - ".set mips3\n\t"
  9432. - "cache 0x14,0(%0)\n\t"
  9433. - "cache 0x14,32(%0)\n\t"
  9434. + __asm__(".set mips3\n\t"
  9435. + "cache 0x14, 0(%0)\n\t"
  9436. + "cache 0x14, 32(%0)\n\t"
  9437. "sync\n\t"
  9438. "nop\n\t"
  9439. "wait\n\t"
  9440. @@ -57,11 +52,7 @@ void au1k_wait(void)
  9441. "nop\n\t"
  9442. "nop\n\t"
  9443. ".set mips0\n\t"
  9444. - : : "r" (addr));
  9445. -#else
  9446. - __asm__("nop\n\t"
  9447. - "nop");
  9448. -#endif
  9449. + : : "r" (au1k_wait));
  9450. }
  9451. static inline void check_wait(void)
  9452. @@ -100,20 +91,17 @@ static inline void check_wait(void)
  9453. cpu_wait = r4k_wait;
  9454. printk(" available.\n");
  9455. break;
  9456. -#ifdef CONFIG_PM
  9457. case CPU_AU1000:
  9458. case CPU_AU1100:
  9459. case CPU_AU1500:
  9460. case CPU_AU1550:
  9461. - if (au1k_wait_ptr != NULL) {
  9462. - cpu_wait = au1k_wait_ptr;
  9463. + case CPU_AU1200:
  9464. + if (allow_au1k_wait) {
  9465. + cpu_wait = au1k_wait;
  9466. printk(" available.\n");
  9467. - }
  9468. - else {
  9469. + } else
  9470. printk(" unavailable.\n");
  9471. - }
  9472. break;
  9473. -#endif
  9474. default:
  9475. printk(" unavailable.\n");
  9476. break;
  9477. Index: linux-2.4.35.4/arch/mips/kernel/head.S
  9478. ===================================================================
  9479. --- linux-2.4.35.4.orig/arch/mips/kernel/head.S
  9480. +++ linux-2.4.35.4/arch/mips/kernel/head.S
  9481. @@ -43,9 +43,9 @@
  9482. /* Cache Error */
  9483. LEAF(except_vec2_generic)
  9484. + .set push
  9485. .set noreorder
  9486. .set noat
  9487. - .set mips0
  9488. /*
  9489. * This is a very bad place to be. Our cache error
  9490. * detection has triggered. If we have write-back data
  9491. @@ -64,10 +64,9 @@
  9492. j cache_parity_error
  9493. nop
  9494. + .set pop
  9495. END(except_vec2_generic)
  9496. - .set at
  9497. -
  9498. /*
  9499. * Special interrupt vector for embedded MIPS. This is a
  9500. * dedicated interrupt vector which reduces interrupt processing
  9501. @@ -76,8 +75,11 @@
  9502. * size!
  9503. */
  9504. NESTED(except_vec4, 0, sp)
  9505. + .set push
  9506. + .set noreorder
  9507. 1: j 1b /* Dummy, will be replaced */
  9508. nop
  9509. + .set pop
  9510. END(except_vec4)
  9511. /*
  9512. @@ -87,8 +89,11 @@
  9513. * unconditional jump to this vector.
  9514. */
  9515. NESTED(except_vec_ejtag_debug, 0, sp)
  9516. + .set push
  9517. + .set noreorder
  9518. j ejtag_debug_handler
  9519. nop
  9520. + .set pop
  9521. END(except_vec_ejtag_debug)
  9522. __FINIT
  9523. @@ -97,6 +102,7 @@
  9524. * EJTAG debug exception handler.
  9525. */
  9526. NESTED(ejtag_debug_handler, PT_SIZE, sp)
  9527. + .set push
  9528. .set noat
  9529. .set noreorder
  9530. mtc0 k0, CP0_DESAVE
  9531. @@ -120,7 +126,7 @@ ejtag_return:
  9532. deret
  9533. .set mips0
  9534. nop
  9535. - .set at
  9536. + .set pop
  9537. END(ejtag_debug_handler)
  9538. __INIT
  9539. @@ -132,13 +138,17 @@ ejtag_return:
  9540. * unconditional jump to this vector.
  9541. */
  9542. NESTED(except_vec_nmi, 0, sp)
  9543. + .set push
  9544. + .set noreorder
  9545. j nmi_handler
  9546. nop
  9547. + .set pop
  9548. END(except_vec_nmi)
  9549. __FINIT
  9550. NESTED(nmi_handler, PT_SIZE, sp)
  9551. + .set push
  9552. .set noat
  9553. .set noreorder
  9554. .set mips3
  9555. @@ -147,8 +157,7 @@ ejtag_return:
  9556. move a0, sp
  9557. RESTORE_ALL
  9558. eret
  9559. - .set at
  9560. - .set mips0
  9561. + .set pop
  9562. END(nmi_handler)
  9563. __INIT
  9564. @@ -157,7 +166,20 @@ ejtag_return:
  9565. * Kernel entry point
  9566. */
  9567. NESTED(kernel_entry, 16, sp)
  9568. + .set push
  9569. + /*
  9570. + * For the moment disable interrupts and mark the kernel mode.
  9571. + * A full initialization of the CPU's status register is done
  9572. + * later in per_cpu_trap_init().
  9573. + */
  9574. + mfc0 t0, CP0_STATUS
  9575. + or t0, ST0_CU0|0x1f
  9576. + xor t0, 0x1f
  9577. + mtc0 t0, CP0_STATUS
  9578. +
  9579. .set noreorder
  9580. + sll zero,3 # ehb
  9581. + .set reorder
  9582. /*
  9583. * The firmware/bootloader passes argc/argp/envp
  9584. @@ -170,8 +192,8 @@ ejtag_return:
  9585. la t1, (_end - 4)
  9586. 1:
  9587. addiu t0, 4
  9588. + sw zero, (t0)
  9589. bne t0, t1, 1b
  9590. - sw zero, (t0)
  9591. /*
  9592. * Stack for kernel and init, current variable
  9593. @@ -182,7 +204,7 @@ ejtag_return:
  9594. sw t0, kernelsp
  9595. jal init_arch
  9596. - nop
  9597. + .set pop
  9598. END(kernel_entry)
  9599. @@ -193,17 +215,26 @@ ejtag_return:
  9600. * function after setting up the stack and gp registers.
  9601. */
  9602. LEAF(smp_bootstrap)
  9603. - .set push
  9604. - .set noreorder
  9605. - mtc0 zero, CP0_WIRED
  9606. - CLI
  9607. + .set push
  9608. + /*
  9609. + * For the moment disable interrupts and bootstrap exception
  9610. + * vectors and mark the kernel mode. A full initialization of
  9611. + * the CPU's status register is done later in
  9612. + * per_cpu_trap_init().
  9613. + */
  9614. mfc0 t0, CP0_STATUS
  9615. - li t1, ~(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX|ST0_UX)
  9616. - and t0, t1
  9617. - or t0, (ST0_CU0);
  9618. + or t0, ST0_CU0|ST0_BEV|0x1f
  9619. + xor t0, ST0_BEV|0x1f
  9620. + mtc0 t0, CP0_STATUS
  9621. +
  9622. + .set noreorder
  9623. + sll zero,3 # ehb
  9624. + .set reorder
  9625. +
  9626. + mtc0 zero, CP0_WIRED
  9627. +
  9628. jal start_secondary
  9629. - mtc0 t0, CP0_STATUS
  9630. - .set pop
  9631. + .set pop
  9632. END(smp_bootstrap)
  9633. #endif
  9634. Index: linux-2.4.35.4/arch/mips/kernel/process.c
  9635. ===================================================================
  9636. --- linux-2.4.35.4.orig/arch/mips/kernel/process.c
  9637. +++ linux-2.4.35.4/arch/mips/kernel/process.c
  9638. @@ -128,6 +128,26 @@ int dump_fpu(struct pt_regs *regs, elf_f
  9639. return 1;
  9640. }
  9641. +void dump_regs(elf_greg_t *gp, struct pt_regs *regs)
  9642. +{
  9643. + int i;
  9644. +
  9645. + for (i = 0; i < EF_REG0; i++)
  9646. + gp[i] = 0;
  9647. + gp[EF_REG0] = 0;
  9648. + for (i = 1; i <= 31; i++)
  9649. + gp[EF_REG0 + i] = regs->regs[i];
  9650. + gp[EF_REG26] = 0;
  9651. + gp[EF_REG27] = 0;
  9652. + gp[EF_LO] = regs->lo;
  9653. + gp[EF_HI] = regs->hi;
  9654. + gp[EF_CP0_EPC] = regs->cp0_epc;
  9655. + gp[EF_CP0_BADVADDR] = regs->cp0_badvaddr;
  9656. + gp[EF_CP0_STATUS] = regs->cp0_status;
  9657. + gp[EF_CP0_CAUSE] = regs->cp0_cause;
  9658. + gp[EF_UNUSED0] = 0;
  9659. +}
  9660. +
  9661. /*
  9662. * Create a kernel thread
  9663. */
  9664. Index: linux-2.4.35.4/arch/mips/kernel/scall_o32.S
  9665. ===================================================================
  9666. --- linux-2.4.35.4.orig/arch/mips/kernel/scall_o32.S
  9667. +++ linux-2.4.35.4/arch/mips/kernel/scall_o32.S
  9668. @@ -121,15 +121,14 @@ reschedule:
  9669. trace_a_syscall:
  9670. SAVE_STATIC
  9671. - sw t2, PT_R1(sp)
  9672. + move s0, t2
  9673. jal syscall_trace
  9674. - lw t2, PT_R1(sp)
  9675. lw a0, PT_R4(sp) # Restore argument registers
  9676. lw a1, PT_R5(sp)
  9677. lw a2, PT_R6(sp)
  9678. lw a3, PT_R7(sp)
  9679. - jalr t2
  9680. + jalr s0
  9681. li t0, -EMAXERRNO - 1 # error?
  9682. sltu t0, t0, v0
  9683. Index: linux-2.4.35.4/arch/mips/kernel/setup.c
  9684. ===================================================================
  9685. --- linux-2.4.35.4.orig/arch/mips/kernel/setup.c
  9686. +++ linux-2.4.35.4/arch/mips/kernel/setup.c
  9687. @@ -5,7 +5,7 @@
  9688. *
  9689. * Copyright (C) 1995 Linus Torvalds
  9690. * Copyright (C) 1995 Waldorf Electronics
  9691. - * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001 Ralf Baechle
  9692. + * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 01, 05 Ralf Baechle
  9693. * Copyright (C) 1996 Stoned Elipot
  9694. * Copyright (C) 2000, 2001, 2002 Maciej W. Rozycki
  9695. */
  9696. @@ -71,6 +71,8 @@ extern void * __rd_start, * __rd_end;
  9697. extern struct rtc_ops no_rtc_ops;
  9698. struct rtc_ops *rtc_ops;
  9699. +EXPORT_SYMBOL(rtc_ops);
  9700. +
  9701. #ifdef CONFIG_PC_KEYB
  9702. struct kbd_ops *kbd_ops;
  9703. #endif
  9704. @@ -132,10 +134,6 @@ init_arch(int argc, char **argv, char **
  9705. */
  9706. load_mmu();
  9707. - /* Disable coprocessors and set FPU for 16/32 FPR register model */
  9708. - clear_c0_status(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX|ST0_FR);
  9709. - set_c0_status(ST0_CU0);
  9710. -
  9711. start_kernel();
  9712. }
  9713. Index: linux-2.4.35.4/arch/mips/kernel/traps.c
  9714. ===================================================================
  9715. --- linux-2.4.35.4.orig/arch/mips/kernel/traps.c
  9716. +++ linux-2.4.35.4/arch/mips/kernel/traps.c
  9717. @@ -452,9 +452,10 @@ static inline void simulate_ll(struct pt
  9718. }
  9719. ll_task = current;
  9720. + compute_return_epc(regs);
  9721. +
  9722. regs->regs[(opcode & RT) >> 16] = value;
  9723. - compute_return_epc(regs);
  9724. return;
  9725. sig:
  9726. @@ -485,8 +486,8 @@ static inline void simulate_sc(struct pt
  9727. goto sig;
  9728. }
  9729. if (ll_bit == 0 || ll_task != current) {
  9730. - regs->regs[reg] = 0;
  9731. compute_return_epc(regs);
  9732. + regs->regs[reg] = 0;
  9733. return;
  9734. }
  9735. @@ -495,9 +496,9 @@ static inline void simulate_sc(struct pt
  9736. goto sig;
  9737. }
  9738. + compute_return_epc(regs);
  9739. regs->regs[reg] = 1;
  9740. - compute_return_epc(regs);
  9741. return;
  9742. sig:
  9743. @@ -887,12 +888,18 @@ extern asmlinkage int fpu_emulator_resto
  9744. void __init per_cpu_trap_init(void)
  9745. {
  9746. unsigned int cpu = smp_processor_id();
  9747. + unsigned int status_set = ST0_CU0;
  9748. - /* Some firmware leaves the BEV flag set, clear it. */
  9749. - clear_c0_status(ST0_CU3|ST0_CU2|ST0_CU1|ST0_BEV|ST0_KX|ST0_SX|ST0_UX);
  9750. -
  9751. + /*
  9752. + * Disable coprocessors and 64-bit addressing and set FPU for
  9753. + * the 16/32 FPR register model. Reset the BEV flag that some
  9754. + * firmware may have left set and the TS bit (for IP27). Set
  9755. + * XX for ISA IV code to work.
  9756. + */
  9757. if (current_cpu_data.isa_level == MIPS_CPU_ISA_IV)
  9758. - set_c0_status(ST0_XX);
  9759. + status_set |= ST0_XX;
  9760. + change_c0_status(ST0_CU|ST0_FR|ST0_BEV|ST0_TS|ST0_KX|ST0_SX|ST0_UX,
  9761. + status_set);
  9762. /*
  9763. * Some MIPS CPUs have a dedicated interrupt vector which reduces the
  9764. @@ -902,7 +909,7 @@ void __init per_cpu_trap_init(void)
  9765. set_c0_cause(CAUSEF_IV);
  9766. cpu_data[cpu].asid_cache = ASID_FIRST_VERSION;
  9767. - write_c0_context(cpu << 23);
  9768. + TLBMISS_HANDLER_SETUP();
  9769. atomic_inc(&init_mm.mm_count);
  9770. current->active_mm = &init_mm;
  9771. @@ -918,8 +925,6 @@ void __init trap_init(void)
  9772. extern char except_vec4;
  9773. unsigned long i;
  9774. - per_cpu_trap_init();
  9775. -
  9776. /* Copy the generic exception handler code to it's final destination. */
  9777. memcpy((void *)(KSEG0 + 0x80), &except_vec1_generic, 0x80);
  9778. @@ -1020,10 +1025,5 @@ void __init trap_init(void)
  9779. flush_icache_range(KSEG0, KSEG0 + 0x400);
  9780. - atomic_inc(&init_mm.mm_count); /* XXX UP? */
  9781. - current->active_mm = &init_mm;
  9782. -
  9783. - /* XXX Must be done for all CPUs */
  9784. - current_cpu_data.asid_cache = ASID_FIRST_VERSION;
  9785. - TLBMISS_HANDLER_SETUP();
  9786. + per_cpu_trap_init();
  9787. }
  9788. Index: linux-2.4.35.4/arch/mips/lib/rtc-no.c
  9789. ===================================================================
  9790. --- linux-2.4.35.4.orig/arch/mips/lib/rtc-no.c
  9791. +++ linux-2.4.35.4/arch/mips/lib/rtc-no.c
  9792. @@ -6,10 +6,9 @@
  9793. * Stub RTC routines to keep Linux from crashing on machine which don't
  9794. * have a RTC chip.
  9795. *
  9796. - * Copyright (C) 1998, 2001 by Ralf Baechle
  9797. + * Copyright (C) 1998, 2001, 2005 by Ralf Baechle
  9798. */
  9799. #include <linux/kernel.h>
  9800. -#include <linux/module.h>
  9801. #include <linux/mc146818rtc.h>
  9802. static unsigned int shouldnt_happen(void)
  9803. @@ -29,5 +28,3 @@ struct rtc_ops no_rtc_ops = {
  9804. .rtc_write_data = (void *) &shouldnt_happen,
  9805. .rtc_bcd_mode = (void *) &shouldnt_happen
  9806. };
  9807. -
  9808. -EXPORT_SYMBOL(rtc_ops);
  9809. Index: linux-2.4.35.4/arch/mips/lib/rtc-std.c
  9810. ===================================================================
  9811. --- linux-2.4.35.4.orig/arch/mips/lib/rtc-std.c
  9812. +++ linux-2.4.35.4/arch/mips/lib/rtc-std.c
  9813. @@ -5,9 +5,8 @@
  9814. *
  9815. * RTC routines for PC style attached Dallas chip.
  9816. *
  9817. - * Copyright (C) 1998, 2001 by Ralf Baechle
  9818. + * Copyright (C) 1998, 2001, 05 by Ralf Baechle
  9819. */
  9820. -#include <linux/module.h>
  9821. #include <linux/mc146818rtc.h>
  9822. #include <asm/io.h>
  9823. @@ -33,5 +32,3 @@ struct rtc_ops std_rtc_ops = {
  9824. &std_rtc_write_data,
  9825. &std_rtc_bcd_mode
  9826. };
  9827. -
  9828. -EXPORT_SYMBOL(rtc_ops);
  9829. Index: linux-2.4.35.4/arch/mips/Makefile
  9830. ===================================================================
  9831. --- linux-2.4.35.4.orig/arch/mips/Makefile
  9832. +++ linux-2.4.35.4/arch/mips/Makefile
  9833. @@ -209,7 +209,7 @@ LOADADDR := 0x80080000
  9834. endif
  9835. #
  9836. -# Au1000 (Alchemy Semi PB1000) eval board
  9837. +# Au1x AMD Alchemy eval boards
  9838. #
  9839. ifdef CONFIG_MIPS_PB1000
  9840. LIBS += arch/mips/au1000/pb1000/pb1000.o \
  9841. @@ -218,9 +218,6 @@ SUBDIRS += arch/mips/au1000/pb1000 arch
  9842. LOADADDR := 0x80100000
  9843. endif
  9844. -#
  9845. -# Au1100 (Alchemy Semi PB1100) eval board
  9846. -#
  9847. ifdef CONFIG_MIPS_PB1100
  9848. LIBS += arch/mips/au1000/pb1100/pb1100.o \
  9849. arch/mips/au1000/common/au1000.o
  9850. @@ -228,9 +225,6 @@ SUBDIRS += arch/mips/au1000/pb1100
  9851. LOADADDR += 0x80100000
  9852. endif
  9853. -#
  9854. -# Au1500 (Alchemy Semi PB1500) eval board
  9855. -#
  9856. ifdef CONFIG_MIPS_PB1500
  9857. LIBS += arch/mips/au1000/pb1500/pb1500.o \
  9858. arch/mips/au1000/common/au1000.o
  9859. @@ -238,9 +232,6 @@ SUBDIRS += arch/mips/au1000/pb1500 arch
  9860. LOADADDR := 0x80100000
  9861. endif
  9862. -#
  9863. -# Au1x00 (AMD/Alchemy) eval boards
  9864. -#
  9865. ifdef CONFIG_MIPS_DB1000
  9866. LIBS += arch/mips/au1000/db1x00/db1x00.o \
  9867. arch/mips/au1000/common/au1000.o
  9868. @@ -311,6 +302,27 @@ SUBDIRS += arch/mips/au1000/pb1550
  9869. LOADADDR += 0x80100000
  9870. endif
  9871. +ifdef CONFIG_MIPS_PB1200
  9872. +LIBS += arch/mips/au1000/pb1200/pb1200.o \
  9873. + arch/mips/au1000/common/au1000.o
  9874. +SUBDIRS += arch/mips/au1000/pb1200 arch/mips/au1000/common
  9875. +LOADADDR += 0x80100000
  9876. +endif
  9877. +
  9878. +ifdef CONFIG_MIPS_DB1200
  9879. +LIBS += arch/mips/au1000/pb1200/pb1200.o \
  9880. + arch/mips/au1000/common/au1000.o
  9881. +SUBDIRS += arch/mips/au1000/pb1200 arch/mips/au1000/common
  9882. +LOADADDR += 0x80100000
  9883. +endif
  9884. +
  9885. +ifdef CONFIG_MIPS_FICMMP
  9886. +LIBS += arch/mips/au1000/ficmmp/ficmmp.o \
  9887. + arch/mips/au1000/common/au1000.o
  9888. +SUBDIRS += arch/mips/au1000/ficmmp arch/mips/au1000/common
  9889. +LOADADDR += 0x80100000
  9890. +endif
  9891. +
  9892. #
  9893. # Cogent CSB250
  9894. Index: linux-2.4.35.4/arch/mips/mm/cerr-sb1.c
  9895. ===================================================================
  9896. --- linux-2.4.35.4.orig/arch/mips/mm/cerr-sb1.c
  9897. +++ linux-2.4.35.4/arch/mips/mm/cerr-sb1.c
  9898. @@ -252,14 +252,14 @@ static const uint8_t parity[256] = {
  9899. /* Masks to select bits for Hamming parity, mask_72_64[i] for bit[i] */
  9900. static const uint64_t mask_72_64[8] = {
  9901. - 0x0738C808099264FFL,
  9902. - 0x38C808099264FF07L,
  9903. - 0xC808099264FF0738L,
  9904. - 0x08099264FF0738C8L,
  9905. - 0x099264FF0738C808L,
  9906. - 0x9264FF0738C80809L,
  9907. - 0x64FF0738C8080992L,
  9908. - 0xFF0738C808099264L
  9909. + 0x0738C808099264FFULL,
  9910. + 0x38C808099264FF07ULL,
  9911. + 0xC808099264FF0738ULL,
  9912. + 0x08099264FF0738C8ULL,
  9913. + 0x099264FF0738C808ULL,
  9914. + 0x9264FF0738C80809ULL,
  9915. + 0x64FF0738C8080992ULL,
  9916. + 0xFF0738C808099264ULL
  9917. };
  9918. /* Calculate the parity on a range of bits */
  9919. @@ -331,9 +331,9 @@ static uint32_t extract_ic(unsigned shor
  9920. ((lru >> 4) & 0x3),
  9921. ((lru >> 6) & 0x3));
  9922. }
  9923. - va = (taglo & 0xC0000FFFFFFFE000) | addr;
  9924. + va = (taglo & 0xC0000FFFFFFFE000ULL) | addr;
  9925. if ((taglo & (1 << 31)) && (((taglo >> 62) & 0x3) == 3))
  9926. - va |= 0x3FFFF00000000000;
  9927. + va |= 0x3FFFF00000000000ULL;
  9928. valid = ((taghi >> 29) & 1);
  9929. if (valid) {
  9930. tlo_tmp = taglo & 0xfff3ff;
  9931. @@ -474,7 +474,7 @@ static uint32_t extract_dc(unsigned shor
  9932. : "r" ((way << 13) | addr));
  9933. taglo = ((unsigned long long)taglohi << 32) | taglolo;
  9934. - pa = (taglo & 0xFFFFFFE000) | addr;
  9935. + pa = (taglo & 0xFFFFFFE000ULL) | addr;
  9936. if (way == 0) {
  9937. lru = (taghi >> 14) & 0xff;
  9938. prom_printf("[Bank %d Set 0x%02x] LRU > %d %d %d %d > MRU\n",
  9939. Index: linux-2.4.35.4/arch/mips/mm/c-r4k.c
  9940. ===================================================================
  9941. --- linux-2.4.35.4.orig/arch/mips/mm/c-r4k.c
  9942. +++ linux-2.4.35.4/arch/mips/mm/c-r4k.c
  9943. @@ -867,9 +867,16 @@ static void __init probe_pcache(void)
  9944. * normally they'd suffer from aliases but magic in the hardware deals
  9945. * with that for us so we don't need to take care ourselves.
  9946. */
  9947. - if (c->cputype != CPU_R10000 && c->cputype != CPU_R12000)
  9948. - if (c->dcache.waysize > PAGE_SIZE)
  9949. - c->dcache.flags |= MIPS_CACHE_ALIASES;
  9950. + switch (c->cputype) {
  9951. + case CPU_R10000:
  9952. + case CPU_R12000:
  9953. + break;
  9954. + case CPU_24K:
  9955. + if (!(read_c0_config7() & (1 << 16)))
  9956. + default:
  9957. + if (c->dcache.waysize > PAGE_SIZE)
  9958. + c->dcache.flags |= MIPS_CACHE_ALIASES;
  9959. + }
  9960. switch (c->cputype) {
  9961. case CPU_20KC:
  9962. @@ -1069,9 +1076,6 @@ void __init ld_mmu_r4xx0(void)
  9963. probe_pcache();
  9964. setup_scache();
  9965. - if (c->dcache.sets * c->dcache.ways > PAGE_SIZE)
  9966. - c->dcache.flags |= MIPS_CACHE_ALIASES;
  9967. -
  9968. r4k_blast_dcache_page_setup();
  9969. r4k_blast_dcache_page_indexed_setup();
  9970. r4k_blast_dcache_setup();
  9971. Index: linux-2.4.35.4/arch/mips/mm/tlbex-mips32.S
  9972. ===================================================================
  9973. --- linux-2.4.35.4.orig/arch/mips/mm/tlbex-mips32.S
  9974. +++ linux-2.4.35.4/arch/mips/mm/tlbex-mips32.S
  9975. @@ -196,7 +196,7 @@
  9976. .set noat; \
  9977. SAVE_ALL; \
  9978. mfc0 a2, CP0_BADVADDR; \
  9979. - STI; \
  9980. + KMODE; \
  9981. .set at; \
  9982. move a0, sp; \
  9983. jal do_page_fault; \
  9984. Index: linux-2.4.35.4/arch/mips/mm/tlbex-r4k.S
  9985. ===================================================================
  9986. --- linux-2.4.35.4.orig/arch/mips/mm/tlbex-r4k.S
  9987. +++ linux-2.4.35.4/arch/mips/mm/tlbex-r4k.S
  9988. @@ -184,13 +184,10 @@
  9989. P_MTC0 k0, CP0_ENTRYLO0 # load it
  9990. PTE_SRL k1, k1, 6 # convert to entrylo1
  9991. P_MTC0 k1, CP0_ENTRYLO1 # load it
  9992. - b 1f
  9993. - rm9000_tlb_hazard
  9994. + mtc0_tlbw_hazard
  9995. tlbwr # write random tlb entry
  9996. -1:
  9997. - nop
  9998. - rm9000_tlb_hazard
  9999. - eret # return from trap
  10000. + tlbw_eret_hazard
  10001. + eret
  10002. END(except_vec0_r4000)
  10003. /* TLB refill, EXL == 0, R4600 version */
  10004. @@ -468,13 +465,9 @@ invalid_tlbl:
  10005. PTE_PRESENT(k0, k1, nopage_tlbl)
  10006. PTE_MAKEVALID(k0, k1)
  10007. PTE_RELOAD(k1, k0)
  10008. - rm9000_tlb_hazard
  10009. - nop
  10010. - b 1f
  10011. - tlbwi
  10012. -1:
  10013. - nop
  10014. - rm9000_tlb_hazard
  10015. + mtc0_tlbw_hazard
  10016. + tlbwi
  10017. + tlbw_eret_hazard
  10018. .set mips3
  10019. eret
  10020. .set mips0
  10021. @@ -496,13 +489,9 @@ nopage_tlbl:
  10022. PTE_WRITABLE(k0, k1, nopage_tlbs)
  10023. PTE_MAKEWRITE(k0, k1)
  10024. PTE_RELOAD(k1, k0)
  10025. - rm9000_tlb_hazard
  10026. - nop
  10027. - b 1f
  10028. - tlbwi
  10029. -1:
  10030. - nop
  10031. - rm9000_tlb_hazard
  10032. + mtc0_tlbw_hazard
  10033. + tlbwi
  10034. + tlbw_eret_hazard
  10035. .set mips3
  10036. eret
  10037. .set mips0
  10038. @@ -529,13 +518,9 @@ nopage_tlbs:
  10039. /* Now reload the entry into the tlb. */
  10040. PTE_RELOAD(k1, k0)
  10041. - rm9000_tlb_hazard
  10042. - nop
  10043. - b 1f
  10044. - tlbwi
  10045. -1:
  10046. - rm9000_tlb_hazard
  10047. - nop
  10048. + mtc0_tlbw_hazard
  10049. + tlbwi
  10050. + tlbw_eret_hazard
  10051. .set mips3
  10052. eret
  10053. .set mips0
  10054. Index: linux-2.4.35.4/arch/mips/mm/tlb-r4k.c
  10055. ===================================================================
  10056. --- linux-2.4.35.4.orig/arch/mips/mm/tlb-r4k.c
  10057. +++ linux-2.4.35.4/arch/mips/mm/tlb-r4k.c
  10058. @@ -3,17 +3,12 @@
  10059. * License. See the file "COPYING" in the main directory of this archive
  10060. * for more details.
  10061. *
  10062. - * r4xx0.c: R4000 processor variant specific MMU/Cache routines.
  10063. - *
  10064. * Copyright (C) 1996 David S. Miller ([email protected])
  10065. * Copyright (C) 1997, 1998, 1999, 2000 Ralf Baechle [email protected]
  10066. - *
  10067. - * To do:
  10068. - *
  10069. - * - this code is a overbloated pig
  10070. - * - many of the bug workarounds are not efficient at all, but at
  10071. - * least they are functional ...
  10072. + * Carsten Langgaard, [email protected]
  10073. + * Copyright (C) 2002 MIPS Technologies, Inc. All rights reserved.
  10074. */
  10075. +#include <linux/config.h>
  10076. #include <linux/init.h>
  10077. #include <linux/sched.h>
  10078. #include <linux/mm.h>
  10079. @@ -25,9 +20,6 @@
  10080. #include <asm/pgtable.h>
  10081. #include <asm/system.h>
  10082. -#undef DEBUG_TLB
  10083. -#undef DEBUG_TLBUPDATE
  10084. -
  10085. extern char except_vec0_nevada, except_vec0_r4000, except_vec0_r4600;
  10086. /* CP0 hazard avoidance. */
  10087. @@ -41,33 +33,23 @@ void local_flush_tlb_all(void)
  10088. unsigned long old_ctx;
  10089. int entry;
  10090. -#ifdef DEBUG_TLB
  10091. - printk("[tlball]");
  10092. -#endif
  10093. -
  10094. local_irq_save(flags);
  10095. /* Save old context and create impossible VPN2 value */
  10096. old_ctx = read_c0_entryhi();
  10097. write_c0_entrylo0(0);
  10098. write_c0_entrylo1(0);
  10099. - BARRIER;
  10100. entry = read_c0_wired();
  10101. /* Blast 'em all away. */
  10102. while (entry < current_cpu_data.tlbsize) {
  10103. - /*
  10104. - * Make sure all entries differ. If they're not different
  10105. - * MIPS32 will take revenge ...
  10106. - */
  10107. write_c0_entryhi(KSEG0 + entry*0x2000);
  10108. write_c0_index(entry);
  10109. - BARRIER;
  10110. + mtc0_tlbw_hazard();
  10111. tlb_write_indexed();
  10112. - BARRIER;
  10113. entry++;
  10114. }
  10115. - BARRIER;
  10116. + tlbw_use_hazard();
  10117. write_c0_entryhi(old_ctx);
  10118. local_irq_restore(flags);
  10119. }
  10120. @@ -76,12 +58,8 @@ void local_flush_tlb_mm(struct mm_struct
  10121. {
  10122. int cpu = smp_processor_id();
  10123. - if (cpu_context(cpu, mm) != 0) {
  10124. -#ifdef DEBUG_TLB
  10125. - printk("[tlbmm<%d>]", cpu_context(cpu, mm));
  10126. -#endif
  10127. + if (cpu_context(cpu, mm) != 0)
  10128. drop_mmu_context(mm,cpu);
  10129. - }
  10130. }
  10131. void local_flush_tlb_range(struct mm_struct *mm, unsigned long start,
  10132. @@ -93,10 +71,6 @@ void local_flush_tlb_range(struct mm_str
  10133. unsigned long flags;
  10134. int size;
  10135. -#ifdef DEBUG_TLB
  10136. - printk("[tlbrange<%02x,%08lx,%08lx>]",
  10137. - cpu_asid(cpu, mm), start, end);
  10138. -#endif
  10139. local_irq_save(flags);
  10140. size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
  10141. size = (size + 1) >> 1;
  10142. @@ -112,7 +86,7 @@ void local_flush_tlb_range(struct mm_str
  10143. write_c0_entryhi(start | newpid);
  10144. start += (PAGE_SIZE << 1);
  10145. - BARRIER;
  10146. + mtc0_tlbw_hazard();
  10147. tlb_probe();
  10148. BARRIER;
  10149. idx = read_c0_index();
  10150. @@ -122,10 +96,10 @@ void local_flush_tlb_range(struct mm_str
  10151. continue;
  10152. /* Make sure all entries differ. */
  10153. write_c0_entryhi(KSEG0 + idx*0x2000);
  10154. - BARRIER;
  10155. + mtc0_tlbw_hazard();
  10156. tlb_write_indexed();
  10157. - BARRIER;
  10158. }
  10159. + tlbw_use_hazard();
  10160. write_c0_entryhi(oldpid);
  10161. } else {
  10162. drop_mmu_context(mm, cpu);
  10163. @@ -138,34 +112,30 @@ void local_flush_tlb_page(struct vm_area
  10164. {
  10165. int cpu = smp_processor_id();
  10166. - if (!vma || cpu_context(cpu, vma->vm_mm) != 0) {
  10167. + if (cpu_context(cpu, vma->vm_mm) != 0) {
  10168. unsigned long flags;
  10169. - int oldpid, newpid, idx;
  10170. + unsigned long oldpid, newpid, idx;
  10171. -#ifdef DEBUG_TLB
  10172. - printk("[tlbpage<%d,%08lx>]", cpu_context(cpu, vma->vm_mm),
  10173. - page);
  10174. -#endif
  10175. newpid = cpu_asid(cpu, vma->vm_mm);
  10176. page &= (PAGE_MASK << 1);
  10177. local_irq_save(flags);
  10178. oldpid = read_c0_entryhi();
  10179. write_c0_entryhi(page | newpid);
  10180. - BARRIER;
  10181. + mtc0_tlbw_hazard();
  10182. tlb_probe();
  10183. BARRIER;
  10184. idx = read_c0_index();
  10185. write_c0_entrylo0(0);
  10186. write_c0_entrylo1(0);
  10187. - if(idx < 0)
  10188. + if (idx < 0)
  10189. goto finish;
  10190. /* Make sure all entries differ. */
  10191. write_c0_entryhi(KSEG0+idx*0x2000);
  10192. - BARRIER;
  10193. + mtc0_tlbw_hazard();
  10194. tlb_write_indexed();
  10195. + tlbw_use_hazard();
  10196. finish:
  10197. - BARRIER;
  10198. write_c0_entryhi(oldpid);
  10199. local_irq_restore(flags);
  10200. }
  10201. @@ -185,7 +155,7 @@ void local_flush_tlb_one(unsigned long p
  10202. local_irq_save(flags);
  10203. write_c0_entryhi(page);
  10204. - BARRIER;
  10205. + mtc0_tlbw_hazard();
  10206. tlb_probe();
  10207. BARRIER;
  10208. idx = read_c0_index();
  10209. @@ -194,18 +164,19 @@ void local_flush_tlb_one(unsigned long p
  10210. if (idx >= 0) {
  10211. /* Make sure all entries differ. */
  10212. write_c0_entryhi(KSEG0+idx*0x2000);
  10213. + mtc0_tlbw_hazard();
  10214. tlb_write_indexed();
  10215. + tlbw_use_hazard();
  10216. }
  10217. - BARRIER;
  10218. write_c0_entryhi(oldpid);
  10219. +
  10220. local_irq_restore(flags);
  10221. }
  10222. EXPORT_SYMBOL(local_flush_tlb_one);
  10223. -/* We will need multiple versions of update_mmu_cache(), one that just
  10224. - * updates the TLB with the new pte(s), and another which also checks
  10225. - * for the R4k "end of page" hardware bug and does the needy.
  10226. +/*
  10227. + * Updates the TLB with the new pte(s).
  10228. */
  10229. void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
  10230. {
  10231. @@ -223,25 +194,16 @@ void __update_tlb(struct vm_area_struct
  10232. pid = read_c0_entryhi() & ASID_MASK;
  10233. -#ifdef DEBUG_TLB
  10234. - if ((pid != cpu_asid(cpu, vma->vm_mm)) ||
  10235. - (cpu_context(vma->vm_mm) == 0)) {
  10236. - printk("update_mmu_cache: Wheee, bogus tlbpid mmpid=%d "
  10237. - "tlbpid=%d\n", (int) (cpu_asid(cpu, vma->vm_mm)), pid);
  10238. - }
  10239. -#endif
  10240. -
  10241. local_irq_save(flags);
  10242. address &= (PAGE_MASK << 1);
  10243. write_c0_entryhi(address | pid);
  10244. pgdp = pgd_offset(vma->vm_mm, address);
  10245. - BARRIER;
  10246. + mtc0_tlbw_hazard();
  10247. tlb_probe();
  10248. BARRIER;
  10249. pmdp = pmd_offset(pgdp, address);
  10250. idx = read_c0_index();
  10251. ptep = pte_offset(pmdp, address);
  10252. - BARRIER;
  10253. #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
  10254. write_c0_entrylo0(ptep->pte_high);
  10255. ptep++;
  10256. @@ -251,15 +213,13 @@ void __update_tlb(struct vm_area_struct
  10257. write_c0_entrylo1(pte_val(*ptep) >> 6);
  10258. #endif
  10259. write_c0_entryhi(address | pid);
  10260. - BARRIER;
  10261. - if (idx < 0) {
  10262. + mtc0_tlbw_hazard();
  10263. + if (idx < 0)
  10264. tlb_write_random();
  10265. - } else {
  10266. + else
  10267. tlb_write_indexed();
  10268. - }
  10269. - BARRIER;
  10270. + tlbw_use_hazard();
  10271. write_c0_entryhi(pid);
  10272. - BARRIER;
  10273. local_irq_restore(flags);
  10274. }
  10275. @@ -279,24 +239,26 @@ static void r4k_update_mmu_cache_hwbug(s
  10276. asid = read_c0_entryhi() & ASID_MASK;
  10277. write_c0_entryhi(address | asid);
  10278. pgdp = pgd_offset(vma->vm_mm, address);
  10279. + mtc0_tlbw_hazard();
  10280. tlb_probe();
  10281. + BARRIER;
  10282. pmdp = pmd_offset(pgdp, address);
  10283. idx = read_c0_index();
  10284. ptep = pte_offset(pmdp, address);
  10285. write_c0_entrylo0(pte_val(*ptep++) >> 6);
  10286. write_c0_entrylo1(pte_val(*ptep) >> 6);
  10287. - BARRIER;
  10288. + mtc0_tlbw_hazard();
  10289. if (idx < 0)
  10290. tlb_write_random();
  10291. else
  10292. tlb_write_indexed();
  10293. - BARRIER;
  10294. + tlbw_use_hazard();
  10295. local_irq_restore(flags);
  10296. }
  10297. #endif
  10298. void __init add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
  10299. - unsigned long entryhi, unsigned long pagemask)
  10300. + unsigned long entryhi, unsigned long pagemask)
  10301. {
  10302. unsigned long flags;
  10303. unsigned long wired;
  10304. @@ -315,9 +277,9 @@ void __init add_wired_entry(unsigned lon
  10305. write_c0_entryhi(entryhi);
  10306. write_c0_entrylo0(entrylo0);
  10307. write_c0_entrylo1(entrylo1);
  10308. - BARRIER;
  10309. + mtc0_tlbw_hazard();
  10310. tlb_write_indexed();
  10311. - BARRIER;
  10312. + tlbw_use_hazard();
  10313. write_c0_entryhi(old_ctx);
  10314. BARRIER;
  10315. @@ -355,17 +317,15 @@ __init int add_temporary_entry(unsigned
  10316. }
  10317. write_c0_index(temp_tlb_entry);
  10318. - BARRIER;
  10319. write_c0_pagemask(pagemask);
  10320. write_c0_entryhi(entryhi);
  10321. write_c0_entrylo0(entrylo0);
  10322. write_c0_entrylo1(entrylo1);
  10323. - BARRIER;
  10324. + mtc0_tlbw_hazard();
  10325. tlb_write_indexed();
  10326. - BARRIER;
  10327. + tlbw_use_hazard();
  10328. write_c0_entryhi(old_ctx);
  10329. - BARRIER;
  10330. write_c0_pagemask(old_pagemask);
  10331. out:
  10332. local_irq_restore(flags);
  10333. @@ -375,7 +335,7 @@ out:
  10334. static void __init probe_tlb(unsigned long config)
  10335. {
  10336. struct cpuinfo_mips *c = &current_cpu_data;
  10337. - unsigned int reg;
  10338. + unsigned int config1;
  10339. /*
  10340. * If this isn't a MIPS32 / MIPS64 compliant CPU. Config 1 register
  10341. @@ -385,16 +345,16 @@ static void __init probe_tlb(unsigned lo
  10342. if ((c->processor_id & 0xff0000) == PRID_COMP_LEGACY)
  10343. return;
  10344. - reg = read_c0_config1();
  10345. + config1 = read_c0_config1();
  10346. if (!((config >> 7) & 3))
  10347. panic("No TLB present");
  10348. - c->tlbsize = ((reg >> 25) & 0x3f) + 1;
  10349. + c->tlbsize = ((config1 >> 25) & 0x3f) + 1;
  10350. }
  10351. void __init r4k_tlb_init(void)
  10352. {
  10353. - u32 config = read_c0_config();
  10354. + unsigned int config = read_c0_config();
  10355. /*
  10356. * You should never change this register:
  10357. Index: linux-2.4.35.4/arch/mips64/defconfig
  10358. ===================================================================
  10359. --- linux-2.4.35.4.orig/arch/mips64/defconfig
  10360. +++ linux-2.4.35.4/arch/mips64/defconfig
  10361. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  10362. # CONFIG_MIPS_PB1000 is not set
  10363. # CONFIG_MIPS_PB1100 is not set
  10364. # CONFIG_MIPS_PB1500 is not set
  10365. -# CONFIG_MIPS_HYDROGEN3 is not set
  10366. # CONFIG_MIPS_PB1550 is not set
  10367. +# CONFIG_MIPS_HYDROGEN3 is not set
  10368. # CONFIG_MIPS_XXS1500 is not set
  10369. # CONFIG_MIPS_MTX1 is not set
  10370. # CONFIG_COGENT_CSB250 is not set
  10371. @@ -470,9 +470,11 @@ CONFIG_SCSI_LOGGING=y
  10372. # CONFIG_SCSI_MEGARAID is not set
  10373. # CONFIG_SCSI_MEGARAID2 is not set
  10374. # CONFIG_SCSI_SATA is not set
  10375. +# CONFIG_SCSI_SATA_AHCI is not set
  10376. # CONFIG_SCSI_SATA_SVW is not set
  10377. # CONFIG_SCSI_ATA_PIIX is not set
  10378. # CONFIG_SCSI_SATA_NV is not set
  10379. +# CONFIG_SCSI_SATA_QSTOR is not set
  10380. # CONFIG_SCSI_SATA_PROMISE is not set
  10381. # CONFIG_SCSI_SATA_SX4 is not set
  10382. # CONFIG_SCSI_SATA_SIL is not set
  10383. @@ -658,7 +660,6 @@ CONFIG_SERIAL=y
  10384. CONFIG_SERIAL_CONSOLE=y
  10385. # CONFIG_SERIAL_EXTENDED is not set
  10386. # CONFIG_SERIAL_NONSTANDARD is not set
  10387. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  10388. CONFIG_UNIX98_PTYS=y
  10389. CONFIG_UNIX98_PTY_COUNT=256
  10390. Index: linux-2.4.35.4/arch/mips64/defconfig-atlas
  10391. ===================================================================
  10392. --- linux-2.4.35.4.orig/arch/mips64/defconfig-atlas
  10393. +++ linux-2.4.35.4/arch/mips64/defconfig-atlas
  10394. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  10395. # CONFIG_MIPS_PB1000 is not set
  10396. # CONFIG_MIPS_PB1100 is not set
  10397. # CONFIG_MIPS_PB1500 is not set
  10398. -# CONFIG_MIPS_HYDROGEN3 is not set
  10399. # CONFIG_MIPS_PB1550 is not set
  10400. +# CONFIG_MIPS_HYDROGEN3 is not set
  10401. # CONFIG_MIPS_XXS1500 is not set
  10402. # CONFIG_MIPS_MTX1 is not set
  10403. # CONFIG_COGENT_CSB250 is not set
  10404. @@ -232,11 +232,6 @@ CONFIG_IP_PNP=y
  10405. #
  10406. # CONFIG_IPX is not set
  10407. # CONFIG_ATALK is not set
  10408. -
  10409. -#
  10410. -# Appletalk devices
  10411. -#
  10412. -# CONFIG_DEV_APPLETALK is not set
  10413. # CONFIG_DECNET is not set
  10414. # CONFIG_BRIDGE is not set
  10415. # CONFIG_X25 is not set
  10416. @@ -314,9 +309,11 @@ CONFIG_SD_EXTRA_DEVS=40
  10417. # CONFIG_SCSI_MEGARAID is not set
  10418. # CONFIG_SCSI_MEGARAID2 is not set
  10419. # CONFIG_SCSI_SATA is not set
  10420. +# CONFIG_SCSI_SATA_AHCI is not set
  10421. # CONFIG_SCSI_SATA_SVW is not set
  10422. # CONFIG_SCSI_ATA_PIIX is not set
  10423. # CONFIG_SCSI_SATA_NV is not set
  10424. +# CONFIG_SCSI_SATA_QSTOR is not set
  10425. # CONFIG_SCSI_SATA_PROMISE is not set
  10426. # CONFIG_SCSI_SATA_SX4 is not set
  10427. # CONFIG_SCSI_SATA_SIL is not set
  10428. @@ -474,7 +471,6 @@ CONFIG_SERIAL=y
  10429. CONFIG_SERIAL_CONSOLE=y
  10430. # CONFIG_SERIAL_EXTENDED is not set
  10431. # CONFIG_SERIAL_NONSTANDARD is not set
  10432. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  10433. CONFIG_UNIX98_PTYS=y
  10434. CONFIG_UNIX98_PTY_COUNT=256
  10435. Index: linux-2.4.35.4/arch/mips64/defconfig-decstation
  10436. ===================================================================
  10437. --- linux-2.4.35.4.orig/arch/mips64/defconfig-decstation
  10438. +++ linux-2.4.35.4/arch/mips64/defconfig-decstation
  10439. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  10440. # CONFIG_MIPS_PB1000 is not set
  10441. # CONFIG_MIPS_PB1100 is not set
  10442. # CONFIG_MIPS_PB1500 is not set
  10443. -# CONFIG_MIPS_HYDROGEN3 is not set
  10444. # CONFIG_MIPS_PB1550 is not set
  10445. +# CONFIG_MIPS_HYDROGEN3 is not set
  10446. # CONFIG_MIPS_XXS1500 is not set
  10447. # CONFIG_MIPS_MTX1 is not set
  10448. # CONFIG_COGENT_CSB250 is not set
  10449. @@ -224,11 +224,6 @@ CONFIG_IP_PNP_BOOTP=y
  10450. #
  10451. # CONFIG_IPX is not set
  10452. # CONFIG_ATALK is not set
  10453. -
  10454. -#
  10455. -# Appletalk devices
  10456. -#
  10457. -# CONFIG_DEV_APPLETALK is not set
  10458. # CONFIG_DECNET is not set
  10459. # CONFIG_BRIDGE is not set
  10460. # CONFIG_X25 is not set
  10461. @@ -307,9 +302,11 @@ CONFIG_SCSI_DECNCR=y
  10462. # CONFIG_SCSI_MEGARAID is not set
  10463. # CONFIG_SCSI_MEGARAID2 is not set
  10464. # CONFIG_SCSI_SATA is not set
  10465. +# CONFIG_SCSI_SATA_AHCI is not set
  10466. # CONFIG_SCSI_SATA_SVW is not set
  10467. # CONFIG_SCSI_ATA_PIIX is not set
  10468. # CONFIG_SCSI_SATA_NV is not set
  10469. +# CONFIG_SCSI_SATA_QSTOR is not set
  10470. # CONFIG_SCSI_SATA_PROMISE is not set
  10471. # CONFIG_SCSI_SATA_SX4 is not set
  10472. # CONFIG_SCSI_SATA_SIL is not set
  10473. @@ -477,7 +474,6 @@ CONFIG_SERIAL_DEC=y
  10474. CONFIG_SERIAL_DEC_CONSOLE=y
  10475. # CONFIG_DZ is not set
  10476. CONFIG_ZS=y
  10477. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  10478. CONFIG_UNIX98_PTYS=y
  10479. CONFIG_UNIX98_PTY_COUNT=256
  10480. Index: linux-2.4.35.4/arch/mips64/defconfig-ip22
  10481. ===================================================================
  10482. --- linux-2.4.35.4.orig/arch/mips64/defconfig-ip22
  10483. +++ linux-2.4.35.4/arch/mips64/defconfig-ip22
  10484. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  10485. # CONFIG_MIPS_PB1000 is not set
  10486. # CONFIG_MIPS_PB1100 is not set
  10487. # CONFIG_MIPS_PB1500 is not set
  10488. -# CONFIG_MIPS_HYDROGEN3 is not set
  10489. # CONFIG_MIPS_PB1550 is not set
  10490. +# CONFIG_MIPS_HYDROGEN3 is not set
  10491. # CONFIG_MIPS_XXS1500 is not set
  10492. # CONFIG_MIPS_MTX1 is not set
  10493. # CONFIG_COGENT_CSB250 is not set
  10494. @@ -235,11 +235,6 @@ CONFIG_IP_PNP_BOOTP=y
  10495. #
  10496. # CONFIG_IPX is not set
  10497. # CONFIG_ATALK is not set
  10498. -
  10499. -#
  10500. -# Appletalk devices
  10501. -#
  10502. -# CONFIG_DEV_APPLETALK is not set
  10503. # CONFIG_DECNET is not set
  10504. # CONFIG_BRIDGE is not set
  10505. # CONFIG_X25 is not set
  10506. @@ -319,9 +314,11 @@ CONFIG_SGIWD93_SCSI=y
  10507. # CONFIG_SCSI_MEGARAID is not set
  10508. # CONFIG_SCSI_MEGARAID2 is not set
  10509. # CONFIG_SCSI_SATA is not set
  10510. +# CONFIG_SCSI_SATA_AHCI is not set
  10511. # CONFIG_SCSI_SATA_SVW is not set
  10512. # CONFIG_SCSI_ATA_PIIX is not set
  10513. # CONFIG_SCSI_SATA_NV is not set
  10514. +# CONFIG_SCSI_SATA_QSTOR is not set
  10515. # CONFIG_SCSI_SATA_PROMISE is not set
  10516. # CONFIG_SCSI_SATA_SX4 is not set
  10517. # CONFIG_SCSI_SATA_SIL is not set
  10518. @@ -488,7 +485,6 @@ CONFIG_SERIAL_NONSTANDARD=y
  10519. # CONFIG_SERIAL_TXX9_CONSOLE is not set
  10520. # CONFIG_TXX927_SERIAL is not set
  10521. CONFIG_IP22_SERIAL=y
  10522. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  10523. CONFIG_UNIX98_PTYS=y
  10524. CONFIG_UNIX98_PTY_COUNT=256
  10525. Index: linux-2.4.35.4/arch/mips64/defconfig-ip27
  10526. ===================================================================
  10527. --- linux-2.4.35.4.orig/arch/mips64/defconfig-ip27
  10528. +++ linux-2.4.35.4/arch/mips64/defconfig-ip27
  10529. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  10530. # CONFIG_MIPS_PB1000 is not set
  10531. # CONFIG_MIPS_PB1100 is not set
  10532. # CONFIG_MIPS_PB1500 is not set
  10533. -# CONFIG_MIPS_HYDROGEN3 is not set
  10534. # CONFIG_MIPS_PB1550 is not set
  10535. +# CONFIG_MIPS_HYDROGEN3 is not set
  10536. # CONFIG_MIPS_XXS1500 is not set
  10537. # CONFIG_MIPS_MTX1 is not set
  10538. # CONFIG_COGENT_CSB250 is not set
  10539. @@ -470,9 +470,11 @@ CONFIG_SCSI_LOGGING=y
  10540. # CONFIG_SCSI_MEGARAID is not set
  10541. # CONFIG_SCSI_MEGARAID2 is not set
  10542. # CONFIG_SCSI_SATA is not set
  10543. +# CONFIG_SCSI_SATA_AHCI is not set
  10544. # CONFIG_SCSI_SATA_SVW is not set
  10545. # CONFIG_SCSI_ATA_PIIX is not set
  10546. # CONFIG_SCSI_SATA_NV is not set
  10547. +# CONFIG_SCSI_SATA_QSTOR is not set
  10548. # CONFIG_SCSI_SATA_PROMISE is not set
  10549. # CONFIG_SCSI_SATA_SX4 is not set
  10550. # CONFIG_SCSI_SATA_SIL is not set
  10551. @@ -658,7 +660,6 @@ CONFIG_SERIAL=y
  10552. CONFIG_SERIAL_CONSOLE=y
  10553. # CONFIG_SERIAL_EXTENDED is not set
  10554. # CONFIG_SERIAL_NONSTANDARD is not set
  10555. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  10556. CONFIG_UNIX98_PTYS=y
  10557. CONFIG_UNIX98_PTY_COUNT=256
  10558. Index: linux-2.4.35.4/arch/mips64/defconfig-jaguar
  10559. ===================================================================
  10560. --- linux-2.4.35.4.orig/arch/mips64/defconfig-jaguar
  10561. +++ linux-2.4.35.4/arch/mips64/defconfig-jaguar
  10562. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  10563. # CONFIG_MIPS_PB1000 is not set
  10564. # CONFIG_MIPS_PB1100 is not set
  10565. # CONFIG_MIPS_PB1500 is not set
  10566. -# CONFIG_MIPS_HYDROGEN3 is not set
  10567. # CONFIG_MIPS_PB1550 is not set
  10568. +# CONFIG_MIPS_HYDROGEN3 is not set
  10569. # CONFIG_MIPS_XXS1500 is not set
  10570. # CONFIG_MIPS_MTX1 is not set
  10571. # CONFIG_COGENT_CSB250 is not set
  10572. @@ -227,11 +227,6 @@ CONFIG_IP_PNP_DHCP=y
  10573. #
  10574. # CONFIG_IPX is not set
  10575. # CONFIG_ATALK is not set
  10576. -
  10577. -#
  10578. -# Appletalk devices
  10579. -#
  10580. -# CONFIG_DEV_APPLETALK is not set
  10581. # CONFIG_DECNET is not set
  10582. # CONFIG_BRIDGE is not set
  10583. # CONFIG_X25 is not set
  10584. @@ -403,7 +398,6 @@ CONFIG_SERIAL_NONSTANDARD=y
  10585. # CONFIG_SERIAL_TXX9 is not set
  10586. # CONFIG_SERIAL_TXX9_CONSOLE is not set
  10587. # CONFIG_TXX927_SERIAL is not set
  10588. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  10589. CONFIG_UNIX98_PTYS=y
  10590. CONFIG_UNIX98_PTY_COUNT=256
  10591. Index: linux-2.4.35.4/arch/mips64/defconfig-malta
  10592. ===================================================================
  10593. --- linux-2.4.35.4.orig/arch/mips64/defconfig-malta
  10594. +++ linux-2.4.35.4/arch/mips64/defconfig-malta
  10595. @@ -22,16 +22,19 @@ CONFIG_KMOD=y
  10596. #
  10597. # CONFIG_ACER_PICA_61 is not set
  10598. # CONFIG_MIPS_BOSPORUS is not set
  10599. +# CONFIG_MIPS_FICMMP is not set
  10600. # CONFIG_MIPS_MIRAGE is not set
  10601. # CONFIG_MIPS_DB1000 is not set
  10602. # CONFIG_MIPS_DB1100 is not set
  10603. # CONFIG_MIPS_DB1500 is not set
  10604. # CONFIG_MIPS_DB1550 is not set
  10605. +# CONFIG_MIPS_DB1200 is not set
  10606. # CONFIG_MIPS_PB1000 is not set
  10607. # CONFIG_MIPS_PB1100 is not set
  10608. # CONFIG_MIPS_PB1500 is not set
  10609. -# CONFIG_MIPS_HYDROGEN3 is not set
  10610. # CONFIG_MIPS_PB1550 is not set
  10611. +# CONFIG_MIPS_PB1200 is not set
  10612. +# CONFIG_MIPS_HYDROGEN3 is not set
  10613. # CONFIG_MIPS_XXS1500 is not set
  10614. # CONFIG_MIPS_MTX1 is not set
  10615. # CONFIG_COGENT_CSB250 is not set
  10616. @@ -146,9 +149,9 @@ CONFIG_KCORE_ELF=y
  10617. CONFIG_BINFMT_ELF=y
  10618. CONFIG_MIPS32_COMPAT=y
  10619. CONFIG_MIPS32_O32=y
  10620. -# CONFIG_MIPS32_N32 is not set
  10621. +CONFIG_MIPS32_N32=y
  10622. CONFIG_BINFMT_ELF32=y
  10623. -# CONFIG_BINFMT_MISC is not set
  10624. +CONFIG_BINFMT_MISC=y
  10625. # CONFIG_OOM_KILLER is not set
  10626. # CONFIG_CMDLINE_BOOL is not set
  10627. @@ -235,11 +238,6 @@ CONFIG_IP_PNP_BOOTP=y
  10628. #
  10629. # CONFIG_IPX is not set
  10630. # CONFIG_ATALK is not set
  10631. -
  10632. -#
  10633. -# Appletalk devices
  10634. -#
  10635. -# CONFIG_DEV_APPLETALK is not set
  10636. # CONFIG_DECNET is not set
  10637. # CONFIG_BRIDGE is not set
  10638. # CONFIG_X25 is not set
  10639. @@ -271,8 +269,83 @@ CONFIG_IP_PNP_BOOTP=y
  10640. #
  10641. # ATA/IDE/MFM/RLL support
  10642. #
  10643. -# CONFIG_IDE is not set
  10644. +CONFIG_IDE=y
  10645. +
  10646. +#
  10647. +# IDE, ATA and ATAPI Block devices
  10648. +#
  10649. +CONFIG_BLK_DEV_IDE=y
  10650. +
  10651. +#
  10652. +# Please see Documentation/ide.txt for help/info on IDE drives
  10653. +#
  10654. +# CONFIG_BLK_DEV_HD_IDE is not set
  10655. # CONFIG_BLK_DEV_HD is not set
  10656. +# CONFIG_BLK_DEV_IDE_SATA is not set
  10657. +CONFIG_BLK_DEV_IDEDISK=y
  10658. +# CONFIG_IDEDISK_MULTI_MODE is not set
  10659. +# CONFIG_IDEDISK_STROKE is not set
  10660. +# CONFIG_BLK_DEV_IDECS is not set
  10661. +# CONFIG_BLK_DEV_DELKIN is not set
  10662. +CONFIG_BLK_DEV_IDECD=y
  10663. +CONFIG_BLK_DEV_IDETAPE=y
  10664. +CONFIG_BLK_DEV_IDEFLOPPY=y
  10665. +# CONFIG_BLK_DEV_IDESCSI is not set
  10666. +# CONFIG_IDE_TASK_IOCTL is not set
  10667. +
  10668. +#
  10669. +# IDE chipset support/bugfixes
  10670. +#
  10671. +# CONFIG_BLK_DEV_CMD640 is not set
  10672. +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
  10673. +# CONFIG_BLK_DEV_ISAPNP is not set
  10674. +CONFIG_BLK_DEV_IDEPCI=y
  10675. +CONFIG_BLK_DEV_GENERIC=y
  10676. +CONFIG_IDEPCI_SHARE_IRQ=y
  10677. +CONFIG_BLK_DEV_IDEDMA_PCI=y
  10678. +# CONFIG_BLK_DEV_OFFBOARD is not set
  10679. +CONFIG_BLK_DEV_IDEDMA_FORCED=y
  10680. +CONFIG_IDEDMA_PCI_AUTO=y
  10681. +# CONFIG_IDEDMA_ONLYDISK is not set
  10682. +CONFIG_BLK_DEV_IDEDMA=y
  10683. +# CONFIG_IDEDMA_PCI_WIP is not set
  10684. +# CONFIG_BLK_DEV_ADMA100 is not set
  10685. +# CONFIG_BLK_DEV_AEC62XX is not set
  10686. +# CONFIG_BLK_DEV_ALI15X3 is not set
  10687. +# CONFIG_WDC_ALI15X3 is not set
  10688. +# CONFIG_BLK_DEV_AMD74XX is not set
  10689. +# CONFIG_AMD74XX_OVERRIDE is not set
  10690. +# CONFIG_BLK_DEV_ATIIXP is not set
  10691. +# CONFIG_BLK_DEV_CMD64X is not set
  10692. +# CONFIG_BLK_DEV_TRIFLEX is not set
  10693. +# CONFIG_BLK_DEV_CY82C693 is not set
  10694. +# CONFIG_BLK_DEV_CS5530 is not set
  10695. +# CONFIG_BLK_DEV_HPT34X is not set
  10696. +# CONFIG_HPT34X_AUTODMA is not set
  10697. +# CONFIG_BLK_DEV_HPT366 is not set
  10698. +CONFIG_BLK_DEV_PIIX=y
  10699. +# CONFIG_BLK_DEV_NS87415 is not set
  10700. +# CONFIG_BLK_DEV_OPTI621 is not set
  10701. +# CONFIG_BLK_DEV_PDC202XX_OLD is not set
  10702. +# CONFIG_PDC202XX_BURST is not set
  10703. +# CONFIG_BLK_DEV_PDC202XX_NEW is not set
  10704. +# CONFIG_BLK_DEV_RZ1000 is not set
  10705. +# CONFIG_BLK_DEV_SC1200 is not set
  10706. +# CONFIG_BLK_DEV_SVWKS is not set
  10707. +# CONFIG_BLK_DEV_SIIMAGE is not set
  10708. +# CONFIG_BLK_DEV_SIS5513 is not set
  10709. +# CONFIG_BLK_DEV_SLC90E66 is not set
  10710. +# CONFIG_BLK_DEV_TRM290 is not set
  10711. +# CONFIG_BLK_DEV_VIA82CXXX is not set
  10712. +# CONFIG_IDE_CHIPSETS is not set
  10713. +CONFIG_IDEDMA_AUTO=y
  10714. +# CONFIG_IDEDMA_IVB is not set
  10715. +# CONFIG_DMA_NONPCI is not set
  10716. +# CONFIG_BLK_DEV_ATARAID is not set
  10717. +# CONFIG_BLK_DEV_ATARAID_PDC is not set
  10718. +# CONFIG_BLK_DEV_ATARAID_HPT is not set
  10719. +# CONFIG_BLK_DEV_ATARAID_MEDLEY is not set
  10720. +# CONFIG_BLK_DEV_ATARAID_SII is not set
  10721. #
  10722. # SCSI support
  10723. @@ -317,9 +390,11 @@ CONFIG_SD_EXTRA_DEVS=40
  10724. # CONFIG_SCSI_MEGARAID is not set
  10725. # CONFIG_SCSI_MEGARAID2 is not set
  10726. # CONFIG_SCSI_SATA is not set
  10727. +# CONFIG_SCSI_SATA_AHCI is not set
  10728. # CONFIG_SCSI_SATA_SVW is not set
  10729. # CONFIG_SCSI_ATA_PIIX is not set
  10730. # CONFIG_SCSI_SATA_NV is not set
  10731. +# CONFIG_SCSI_SATA_QSTOR is not set
  10732. # CONFIG_SCSI_SATA_PROMISE is not set
  10733. # CONFIG_SCSI_SATA_SX4 is not set
  10734. # CONFIG_SCSI_SATA_SIL is not set
  10735. @@ -477,7 +552,6 @@ CONFIG_SERIAL=y
  10736. CONFIG_SERIAL_CONSOLE=y
  10737. # CONFIG_SERIAL_EXTENDED is not set
  10738. # CONFIG_SERIAL_NONSTANDARD is not set
  10739. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  10740. CONFIG_UNIX98_PTYS=y
  10741. CONFIG_UNIX98_PTY_COUNT=256
  10742. Index: linux-2.4.35.4/arch/mips64/defconfig-ocelotc
  10743. ===================================================================
  10744. --- linux-2.4.35.4.orig/arch/mips64/defconfig-ocelotc
  10745. +++ linux-2.4.35.4/arch/mips64/defconfig-ocelotc
  10746. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  10747. # CONFIG_MIPS_PB1000 is not set
  10748. # CONFIG_MIPS_PB1100 is not set
  10749. # CONFIG_MIPS_PB1500 is not set
  10750. -# CONFIG_MIPS_HYDROGEN3 is not set
  10751. # CONFIG_MIPS_PB1550 is not set
  10752. +# CONFIG_MIPS_HYDROGEN3 is not set
  10753. # CONFIG_MIPS_XXS1500 is not set
  10754. # CONFIG_MIPS_MTX1 is not set
  10755. # CONFIG_COGENT_CSB250 is not set
  10756. @@ -231,11 +231,6 @@ CONFIG_IP_PNP_DHCP=y
  10757. #
  10758. # CONFIG_IPX is not set
  10759. # CONFIG_ATALK is not set
  10760. -
  10761. -#
  10762. -# Appletalk devices
  10763. -#
  10764. -# CONFIG_DEV_APPLETALK is not set
  10765. # CONFIG_DECNET is not set
  10766. # CONFIG_BRIDGE is not set
  10767. # CONFIG_X25 is not set
  10768. @@ -453,7 +448,6 @@ CONFIG_SERIAL_NONSTANDARD=y
  10769. # CONFIG_SERIAL_TXX9 is not set
  10770. # CONFIG_SERIAL_TXX9_CONSOLE is not set
  10771. # CONFIG_TXX927_SERIAL is not set
  10772. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  10773. CONFIG_UNIX98_PTYS=y
  10774. CONFIG_UNIX98_PTY_COUNT=256
  10775. Index: linux-2.4.35.4/arch/mips64/defconfig-sb1250-swarm
  10776. ===================================================================
  10777. --- linux-2.4.35.4.orig/arch/mips64/defconfig-sb1250-swarm
  10778. +++ linux-2.4.35.4/arch/mips64/defconfig-sb1250-swarm
  10779. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  10780. # CONFIG_MIPS_PB1000 is not set
  10781. # CONFIG_MIPS_PB1100 is not set
  10782. # CONFIG_MIPS_PB1500 is not set
  10783. -# CONFIG_MIPS_HYDROGEN3 is not set
  10784. # CONFIG_MIPS_PB1550 is not set
  10785. +# CONFIG_MIPS_HYDROGEN3 is not set
  10786. # CONFIG_MIPS_XXS1500 is not set
  10787. # CONFIG_MIPS_MTX1 is not set
  10788. # CONFIG_COGENT_CSB250 is not set
  10789. @@ -90,6 +90,7 @@ CONFIG_SIBYTE_CFE=y
  10790. # CONFIG_SIBYTE_TBPROF is not set
  10791. CONFIG_SIBYTE_GENBUS_IDE=y
  10792. CONFIG_SMP_CAPABLE=y
  10793. +CONFIG_MIPS_RTC=y
  10794. # CONFIG_SNI_RM200_PCI is not set
  10795. # CONFIG_TANBAC_TB0226 is not set
  10796. # CONFIG_TANBAC_TB0229 is not set
  10797. @@ -253,11 +254,6 @@ CONFIG_INET=y
  10798. #
  10799. # CONFIG_IPX is not set
  10800. # CONFIG_ATALK is not set
  10801. -
  10802. -#
  10803. -# Appletalk devices
  10804. -#
  10805. -# CONFIG_DEV_APPLETALK is not set
  10806. # CONFIG_DECNET is not set
  10807. # CONFIG_BRIDGE is not set
  10808. # CONFIG_X25 is not set
  10809. @@ -432,7 +428,6 @@ CONFIG_SERIAL_NONSTANDARD=y
  10810. CONFIG_SIBYTE_SB1250_DUART=y
  10811. CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y
  10812. CONFIG_SERIAL_CONSOLE=y
  10813. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  10814. CONFIG_UNIX98_PTYS=y
  10815. CONFIG_UNIX98_PTY_COUNT=256
  10816. Index: linux-2.4.35.4/arch/mips64/defconfig-sead
  10817. ===================================================================
  10818. --- linux-2.4.35.4.orig/arch/mips64/defconfig-sead
  10819. +++ linux-2.4.35.4/arch/mips64/defconfig-sead
  10820. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  10821. # CONFIG_MIPS_PB1000 is not set
  10822. # CONFIG_MIPS_PB1100 is not set
  10823. # CONFIG_MIPS_PB1500 is not set
  10824. -# CONFIG_MIPS_HYDROGEN3 is not set
  10825. # CONFIG_MIPS_PB1550 is not set
  10826. +# CONFIG_MIPS_HYDROGEN3 is not set
  10827. # CONFIG_MIPS_XXS1500 is not set
  10828. # CONFIG_MIPS_MTX1 is not set
  10829. # CONFIG_COGENT_CSB250 is not set
  10830. @@ -242,7 +242,6 @@ CONFIG_SERIAL=y
  10831. CONFIG_SERIAL_CONSOLE=y
  10832. # CONFIG_SERIAL_EXTENDED is not set
  10833. # CONFIG_SERIAL_NONSTANDARD is not set
  10834. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  10835. # CONFIG_UNIX98_PTYS is not set
  10836. #
  10837. Index: linux-2.4.35.4/arch/mips64/kernel/binfmt_elfn32.c
  10838. ===================================================================
  10839. --- linux-2.4.35.4.orig/arch/mips64/kernel/binfmt_elfn32.c
  10840. +++ linux-2.4.35.4/arch/mips64/kernel/binfmt_elfn32.c
  10841. @@ -116,4 +116,7 @@ MODULE_AUTHOR("Ralf Baechle (ralf@linux-
  10842. #undef MODULE_DESCRIPTION
  10843. #undef MODULE_AUTHOR
  10844. +#undef TASK_SIZE
  10845. +#define TASK_SIZE TASK_SIZE32
  10846. +
  10847. #include "../../../fs/binfmt_elf.c"
  10848. Index: linux-2.4.35.4/arch/mips64/kernel/binfmt_elfo32.c
  10849. ===================================================================
  10850. --- linux-2.4.35.4.orig/arch/mips64/kernel/binfmt_elfo32.c
  10851. +++ linux-2.4.35.4/arch/mips64/kernel/binfmt_elfo32.c
  10852. @@ -137,4 +137,7 @@ MODULE_AUTHOR("Ralf Baechle (ralf@linux-
  10853. #undef MODULE_DESCRIPTION
  10854. #undef MODULE_AUTHOR
  10855. +#undef TASK_SIZE
  10856. +#define TASK_SIZE TASK_SIZE32
  10857. +
  10858. #include "../../../fs/binfmt_elf.c"
  10859. Index: linux-2.4.35.4/arch/mips64/kernel/head.S
  10860. ===================================================================
  10861. --- linux-2.4.35.4.orig/arch/mips64/kernel/head.S
  10862. +++ linux-2.4.35.4/arch/mips64/kernel/head.S
  10863. @@ -91,6 +91,21 @@ EXPORT(_stext)
  10864. __INIT
  10865. NESTED(kernel_entry, 16, sp) # kernel entry point
  10866. + .set push
  10867. + /*
  10868. + * For the moment disable interrupts, mark the kernel mode and
  10869. + * set ST0_KX so that the CPU does not spit fire when using
  10870. + * 64-bit addresses. A full initialization of the CPU's status
  10871. + * register is done later in per_cpu_trap_init().
  10872. + */
  10873. + mfc0 t0, CP0_STATUS
  10874. + or t0, ST0_CU0|ST0_KX|0x1f
  10875. + xor t0, 0x1f
  10876. + mtc0 t0, CP0_STATUS
  10877. +
  10878. + .set noreorder
  10879. + sll zero,3 # ehb
  10880. + .set reorder
  10881. ori sp, 0xf # align stack on 16 byte.
  10882. xori sp, 0xf
  10883. @@ -103,8 +118,6 @@ NESTED(kernel_entry, 16, sp) # kernel
  10884. ARC64_TWIDDLE_PC
  10885. - CLI # disable interrupts
  10886. -
  10887. /*
  10888. * The firmware/bootloader passes argc/argp/envp
  10889. * to us as arguments. But clear bss first because
  10890. @@ -125,6 +138,7 @@ NESTED(kernel_entry, 16, sp) # kernel
  10891. dsubu sp, 4*SZREG # init stack pointer
  10892. j init_arch
  10893. + .set pop
  10894. END(kernel_entry)
  10895. #ifdef CONFIG_SMP
  10896. @@ -133,6 +147,23 @@ NESTED(kernel_entry, 16, sp) # kernel
  10897. * function after setting up the stack and gp registers.
  10898. */
  10899. NESTED(smp_bootstrap, 16, sp)
  10900. + .set push
  10901. + /*
  10902. + * For the moment disable interrupts and bootstrap exception
  10903. + * vectors, mark the kernel mode and set ST0_KX so that the CPU
  10904. + * does not spit fire when using 64-bit addresses. A full
  10905. + * initialization of the CPU's status register is done later in
  10906. + * per_cpu_trap_init().
  10907. + */
  10908. + mfc0 t0, CP0_STATUS
  10909. + or t0, ST0_CU0|ST0_BEV|ST0_KX|0x1f
  10910. + xor t0, ST0_BEV|0x1f
  10911. + mtc0 t0, CP0_STATUS
  10912. +
  10913. + .set noreorder
  10914. + sll zero,3 # ehb
  10915. + .set reorder
  10916. +
  10917. #ifdef CONFIG_SGI_IP27
  10918. GET_NASID_ASM t1
  10919. dli t0, KLDIR_OFFSET + (KLI_KERN_VARS * KLDIR_ENT_SIZE) + \
  10920. @@ -146,19 +177,8 @@ NESTED(smp_bootstrap, 16, sp)
  10921. ARC64_TWIDDLE_PC
  10922. #endif /* CONFIG_SGI_IP27 */
  10923. - CLI
  10924. -
  10925. - /*
  10926. - * For the moment set ST0_KU so the CPU will not spit fire when
  10927. - * executing 64-bit instructions. The full initialization of the
  10928. - * CPU's status register is done later in per_cpu_trap_init().
  10929. - */
  10930. - mfc0 t0, CP0_STATUS
  10931. - or t0, ST0_KX
  10932. - mtc0 t0, CP0_STATUS
  10933. -
  10934. jal start_secondary # XXX: IP27: cboot
  10935. -
  10936. + .set pop
  10937. END(smp_bootstrap)
  10938. #endif /* CONFIG_SMP */
  10939. Index: linux-2.4.35.4/arch/mips64/kernel/ioctl32.c
  10940. ===================================================================
  10941. --- linux-2.4.35.4.orig/arch/mips64/kernel/ioctl32.c
  10942. +++ linux-2.4.35.4/arch/mips64/kernel/ioctl32.c
  10943. @@ -2352,7 +2352,7 @@ static struct ioctl32_list ioctl32_handl
  10944. IOCTL32_HANDLER(AUTOFS_IOC_SETTIMEOUT32, ioc_settimeout),
  10945. IOCTL32_DEFAULT(AUTOFS_IOC_EXPIRE),
  10946. IOCTL32_DEFAULT(AUTOFS_IOC_EXPIRE_MULTI),
  10947. - IOCTL32_DEFAULT(AUTOFS_IOC_PROTSUBVER),
  10948. + IOCTL32_DEFAULT(AUTOFS_IOC_PROTOSUBVER),
  10949. IOCTL32_DEFAULT(AUTOFS_IOC_ASKREGHOST),
  10950. IOCTL32_DEFAULT(AUTOFS_IOC_TOGGLEREGHOST),
  10951. IOCTL32_DEFAULT(AUTOFS_IOC_ASKUMOUNT),
  10952. Index: linux-2.4.35.4/arch/mips64/kernel/linux32.c
  10953. ===================================================================
  10954. --- linux-2.4.35.4.orig/arch/mips64/kernel/linux32.c
  10955. +++ linux-2.4.35.4/arch/mips64/kernel/linux32.c
  10956. @@ -1101,6 +1101,7 @@ do_readv_writev32(int type, struct file
  10957. * specially as they have atomicity guarantees and can handle
  10958. * iovec's natively
  10959. */
  10960. + inode = file->f_dentry->d_inode;
  10961. if (inode->i_sock) {
  10962. int err;
  10963. err = sock_readv_writev(type, inode, file, iov, count, tot_len);
  10964. @@ -1187,72 +1188,19 @@ bad_file:
  10965. lseek back to original location. They fail just like lseek does on
  10966. non-seekable files. */
  10967. -asmlinkage ssize_t sys32_pread(unsigned int fd, char * buf,
  10968. - size_t count, u32 unused, u64 a4, u64 a5)
  10969. +asmlinkage ssize_t sys32_pread(unsigned int fd, char *buf,
  10970. + size_t count, u32 unused, u64 a4, u64 a5)
  10971. {
  10972. - ssize_t ret;
  10973. - struct file * file;
  10974. - ssize_t (*read)(struct file *, char *, size_t, loff_t *);
  10975. - loff_t pos;
  10976. -
  10977. - ret = -EBADF;
  10978. - file = fget(fd);
  10979. - if (!file)
  10980. - goto bad_file;
  10981. - if (!(file->f_mode & FMODE_READ))
  10982. - goto out;
  10983. - pos = merge_64(a4, a5);
  10984. - ret = locks_verify_area(FLOCK_VERIFY_READ, file->f_dentry->d_inode,
  10985. - file, pos, count);
  10986. - if (ret)
  10987. - goto out;
  10988. - ret = -EINVAL;
  10989. - if (!file->f_op || !(read = file->f_op->read))
  10990. - goto out;
  10991. - if (pos < 0)
  10992. - goto out;
  10993. - ret = read(file, buf, count, &pos);
  10994. - if (ret > 0)
  10995. - dnotify_parent(file->f_dentry, DN_ACCESS);
  10996. -out:
  10997. - fput(file);
  10998. -bad_file:
  10999. - return ret;
  11000. + return sys_pread(fd, buf, count, merge_64(a4, a5));
  11001. }
  11002. asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char * buf,
  11003. size_t count, u32 unused, u64 a4, u64 a5)
  11004. {
  11005. - ssize_t ret;
  11006. - struct file * file;
  11007. - ssize_t (*write)(struct file *, const char *, size_t, loff_t *);
  11008. - loff_t pos;
  11009. + return sys_pwrite(fd, buf, count, merge_64(a4, a5));
  11010. +}
  11011. - ret = -EBADF;
  11012. - file = fget(fd);
  11013. - if (!file)
  11014. - goto bad_file;
  11015. - if (!(file->f_mode & FMODE_WRITE))
  11016. - goto out;
  11017. - pos = merge_64(a4, a5);
  11018. - ret = locks_verify_area(FLOCK_VERIFY_WRITE, file->f_dentry->d_inode,
  11019. - file, pos, count);
  11020. - if (ret)
  11021. - goto out;
  11022. - ret = -EINVAL;
  11023. - if (!file->f_op || !(write = file->f_op->write))
  11024. - goto out;
  11025. - if (pos < 0)
  11026. - goto out;
  11027. - ret = write(file, buf, count, &pos);
  11028. - if (ret > 0)
  11029. - dnotify_parent(file->f_dentry, DN_MODIFY);
  11030. -out:
  11031. - fput(file);
  11032. -bad_file:
  11033. - return ret;
  11034. -}
  11035. /*
  11036. * Ooo, nasty. We need here to frob 32-bit unsigned longs to
  11037. * 64-bit unsigned longs.
  11038. Index: linux-2.4.35.4/arch/mips64/kernel/process.c
  11039. ===================================================================
  11040. --- linux-2.4.35.4.orig/arch/mips64/kernel/process.c
  11041. +++ linux-2.4.35.4/arch/mips64/kernel/process.c
  11042. @@ -125,6 +125,25 @@ int dump_fpu(struct pt_regs *regs, elf_f
  11043. return 1;
  11044. }
  11045. +void dump_regs(elf_greg_t *gp, struct pt_regs *regs)
  11046. +{
  11047. + int i;
  11048. +
  11049. + for (i = 0; i < EF_REG0; i++)
  11050. + gp[i] = 0;
  11051. + gp[EF_REG0] = 0;
  11052. + for (i = 1; i <= 31; i++)
  11053. + gp[EF_REG0 + i] = regs->regs[i];
  11054. + gp[EF_REG26] = 0;
  11055. + gp[EF_REG27] = 0;
  11056. + gp[EF_LO] = regs->lo;
  11057. + gp[EF_HI] = regs->hi;
  11058. + gp[EF_CP0_EPC] = regs->cp0_epc;
  11059. + gp[EF_CP0_BADVADDR] = regs->cp0_badvaddr;
  11060. + gp[EF_CP0_STATUS] = regs->cp0_status;
  11061. + gp[EF_CP0_CAUSE] = regs->cp0_cause;
  11062. +}
  11063. +
  11064. /*
  11065. * Create a kernel thread
  11066. */
  11067. Index: linux-2.4.35.4/arch/mips64/kernel/scall_64.S
  11068. ===================================================================
  11069. --- linux-2.4.35.4.orig/arch/mips64/kernel/scall_64.S
  11070. +++ linux-2.4.35.4/arch/mips64/kernel/scall_64.S
  11071. @@ -102,15 +102,14 @@ _64_reschedule:
  11072. trace_a_syscall:
  11073. SAVE_STATIC
  11074. - sd t2,PT_R1(sp)
  11075. + move s0, t2
  11076. jal syscall_trace
  11077. - ld t2,PT_R1(sp)
  11078. ld a0, PT_R4(sp) # Restore argument registers
  11079. ld a1, PT_R5(sp)
  11080. ld a2, PT_R6(sp)
  11081. ld a3, PT_R7(sp)
  11082. - jalr t2
  11083. + jalr s0
  11084. li t0, -EMAXERRNO - 1 # error?
  11085. sltu t0, t0, v0
  11086. Index: linux-2.4.35.4/arch/mips64/kernel/scall_n32.S
  11087. ===================================================================
  11088. --- linux-2.4.35.4.orig/arch/mips64/kernel/scall_n32.S
  11089. +++ linux-2.4.35.4/arch/mips64/kernel/scall_n32.S
  11090. @@ -106,15 +106,14 @@ n32_reschedule:
  11091. trace_a_syscall:
  11092. SAVE_STATIC
  11093. - sd t2,PT_R1(sp)
  11094. + move s0, t2
  11095. jal syscall_trace
  11096. - ld t2,PT_R1(sp)
  11097. ld a0, PT_R4(sp) # Restore argument registers
  11098. ld a1, PT_R5(sp)
  11099. ld a2, PT_R6(sp)
  11100. ld a3, PT_R7(sp)
  11101. - jalr t2
  11102. + jalr s0
  11103. li t0, -EMAXERRNO - 1 # error?
  11104. sltu t0, t0, v0
  11105. Index: linux-2.4.35.4/arch/mips64/kernel/scall_o32.S
  11106. ===================================================================
  11107. --- linux-2.4.35.4.orig/arch/mips64/kernel/scall_o32.S
  11108. +++ linux-2.4.35.4/arch/mips64/kernel/scall_o32.S
  11109. @@ -118,9 +118,8 @@ trace_a_syscall:
  11110. sd a6, PT_R10(sp)
  11111. sd a7, PT_R11(sp)
  11112. - sd t2,PT_R1(sp)
  11113. + move s0, t2
  11114. jal syscall_trace
  11115. - ld t2,PT_R1(sp)
  11116. ld a0, PT_R4(sp) # Restore argument registers
  11117. ld a1, PT_R5(sp)
  11118. @@ -129,7 +128,7 @@ trace_a_syscall:
  11119. ld a4, PT_R8(sp)
  11120. ld a5, PT_R9(sp)
  11121. - jalr t2
  11122. + jalr s0
  11123. li t0, -EMAXERRNO - 1 # error?
  11124. sltu t0, t0, v0
  11125. @@ -576,6 +575,8 @@ out: jr ra
  11126. sys_call_table:
  11127. syscalltable
  11128. + .purgem sys
  11129. +
  11130. .macro sys function, nargs
  11131. .byte \nargs
  11132. .endm
  11133. Index: linux-2.4.35.4/arch/mips64/kernel/setup.c
  11134. ===================================================================
  11135. --- linux-2.4.35.4.orig/arch/mips64/kernel/setup.c
  11136. +++ linux-2.4.35.4/arch/mips64/kernel/setup.c
  11137. @@ -129,14 +129,6 @@ asmlinkage void __init init_arch(int arg
  11138. */
  11139. load_mmu();
  11140. - /*
  11141. - * On IP27, I am seeing the TS bit set when the kernel is loaded.
  11142. - * Maybe because the kernel is in ckseg0 and not xkphys? Clear it
  11143. - * anyway ...
  11144. - */
  11145. - clear_c0_status(ST0_BEV|ST0_TS|ST0_CU1|ST0_CU2|ST0_CU3);
  11146. - set_c0_status(ST0_CU0|ST0_KX|ST0_SX|ST0_FR);
  11147. -
  11148. start_kernel();
  11149. }
  11150. Index: linux-2.4.35.4/arch/mips64/kernel/signal_n32.c
  11151. ===================================================================
  11152. --- linux-2.4.35.4.orig/arch/mips64/kernel/signal_n32.c
  11153. +++ linux-2.4.35.4/arch/mips64/kernel/signal_n32.c
  11154. @@ -68,7 +68,7 @@ struct rt_sigframe_n32 {
  11155. };
  11156. extern asmlinkage int restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc);
  11157. -extern int inline setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc);
  11158. +extern int setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc);
  11159. asmlinkage void sysn32_rt_sigreturn(abi64_no_regargs, struct pt_regs regs)
  11160. {
  11161. Index: linux-2.4.35.4/arch/mips64/kernel/traps.c
  11162. ===================================================================
  11163. --- linux-2.4.35.4.orig/arch/mips64/kernel/traps.c
  11164. +++ linux-2.4.35.4/arch/mips64/kernel/traps.c
  11165. @@ -462,9 +462,10 @@ static inline void simulate_ll(struct pt
  11166. }
  11167. ll_task = current;
  11168. + compute_return_epc(regs);
  11169. +
  11170. regs->regs[(opcode & RT) >> 16] = value;
  11171. - compute_return_epc(regs);
  11172. return;
  11173. sig:
  11174. @@ -495,8 +496,8 @@ static inline void simulate_sc(struct pt
  11175. goto sig;
  11176. }
  11177. if (ll_bit == 0 || ll_task != current) {
  11178. - regs->regs[reg] = 0;
  11179. compute_return_epc(regs);
  11180. + regs->regs[reg] = 0;
  11181. return;
  11182. }
  11183. @@ -505,9 +506,9 @@ static inline void simulate_sc(struct pt
  11184. goto sig;
  11185. }
  11186. + compute_return_epc(regs);
  11187. regs->regs[reg] = 1;
  11188. - compute_return_epc(regs);
  11189. return;
  11190. sig:
  11191. @@ -809,13 +810,18 @@ extern asmlinkage int fpu_emulator_resto
  11192. void __init per_cpu_trap_init(void)
  11193. {
  11194. unsigned int cpu = smp_processor_id();
  11195. + unsigned int status_set = ST0_CU0|ST0_FR|ST0_KX|ST0_SX|ST0_UX;
  11196. - /* Some firmware leaves the BEV flag set, clear it. */
  11197. - clear_c0_status(ST0_CU1|ST0_CU2|ST0_CU3|ST0_BEV);
  11198. - set_c0_status(ST0_CU0|ST0_FR|ST0_KX|ST0_SX|ST0_UX);
  11199. -
  11200. + /*
  11201. + * Disable coprocessors, enable 64-bit addressing and set FPU
  11202. + * for the 32/32 FPR register model. Reset the BEV flag that
  11203. + * some firmware may have left set and the TS bit (for IP27).
  11204. + * Set XX for ISA IV code to work.
  11205. + */
  11206. if (current_cpu_data.isa_level == MIPS_CPU_ISA_IV)
  11207. - set_c0_status(ST0_XX);
  11208. + status_set |= ST0_XX;
  11209. + change_c0_status(ST0_CU|ST0_FR|ST0_BEV|ST0_TS|ST0_KX|ST0_SX|ST0_UX,
  11210. + status_set);
  11211. /*
  11212. * Some MIPS CPUs have a dedicated interrupt vector which reduces the
  11213. @@ -825,13 +831,11 @@ void __init per_cpu_trap_init(void)
  11214. set_c0_cause(CAUSEF_IV);
  11215. cpu_data[cpu].asid_cache = ASID_FIRST_VERSION;
  11216. - write_c0_context(((long)(&pgd_current[cpu])) << 23);
  11217. - write_c0_wired(0);
  11218. + TLBMISS_HANDLER_SETUP();
  11219. atomic_inc(&init_mm.mm_count);
  11220. current->active_mm = &init_mm;
  11221. - if (current->mm)
  11222. - BUG();
  11223. + BUG_ON(current->mm);
  11224. enter_lazy_tlb(&init_mm, current, cpu);
  11225. }
  11226. @@ -842,8 +846,6 @@ void __init trap_init(void)
  11227. extern char except_vec4;
  11228. unsigned long i;
  11229. - per_cpu_trap_init();
  11230. -
  11231. /* Copy the generic exception handlers to their final destination. */
  11232. memcpy((void *) KSEG0 , &except_vec0_generic, 0x80);
  11233. memcpy((void *)(KSEG0 + 0x180), &except_vec3_generic, 0x80);
  11234. @@ -933,6 +935,5 @@ void __init trap_init(void)
  11235. flush_icache_range(KSEG0, KSEG0 + 0x400);
  11236. - atomic_inc(&init_mm.mm_count); /* XXX UP? */
  11237. - current->active_mm = &init_mm;
  11238. + per_cpu_trap_init();
  11239. }
  11240. Index: linux-2.4.35.4/arch/mips64/mm/cerr-sb1.c
  11241. ===================================================================
  11242. --- linux-2.4.35.4.orig/arch/mips64/mm/cerr-sb1.c
  11243. +++ linux-2.4.35.4/arch/mips64/mm/cerr-sb1.c
  11244. @@ -252,14 +252,14 @@ static const uint8_t parity[256] = {
  11245. /* Masks to select bits for Hamming parity, mask_72_64[i] for bit[i] */
  11246. static const uint64_t mask_72_64[8] = {
  11247. - 0x0738C808099264FFL,
  11248. - 0x38C808099264FF07L,
  11249. - 0xC808099264FF0738L,
  11250. - 0x08099264FF0738C8L,
  11251. - 0x099264FF0738C808L,
  11252. - 0x9264FF0738C80809L,
  11253. - 0x64FF0738C8080992L,
  11254. - 0xFF0738C808099264L
  11255. + 0x0738C808099264FFULL,
  11256. + 0x38C808099264FF07ULL,
  11257. + 0xC808099264FF0738ULL,
  11258. + 0x08099264FF0738C8ULL,
  11259. + 0x099264FF0738C808ULL,
  11260. + 0x9264FF0738C80809ULL,
  11261. + 0x64FF0738C8080992ULL,
  11262. + 0xFF0738C808099264ULL
  11263. };
  11264. /* Calculate the parity on a range of bits */
  11265. @@ -331,9 +331,9 @@ static uint32_t extract_ic(unsigned shor
  11266. ((lru >> 4) & 0x3),
  11267. ((lru >> 6) & 0x3));
  11268. }
  11269. - va = (taglo & 0xC0000FFFFFFFE000) | addr;
  11270. + va = (taglo & 0xC0000FFFFFFFE000ULL) | addr;
  11271. if ((taglo & (1 << 31)) && (((taglo >> 62) & 0x3) == 3))
  11272. - va |= 0x3FFFF00000000000;
  11273. + va |= 0x3FFFF00000000000ULL;
  11274. valid = ((taghi >> 29) & 1);
  11275. if (valid) {
  11276. tlo_tmp = taglo & 0xfff3ff;
  11277. @@ -474,7 +474,7 @@ static uint32_t extract_dc(unsigned shor
  11278. : "r" ((way << 13) | addr));
  11279. taglo = ((unsigned long long)taglohi << 32) | taglolo;
  11280. - pa = (taglo & 0xFFFFFFE000) | addr;
  11281. + pa = (taglo & 0xFFFFFFE000ULL) | addr;
  11282. if (way == 0) {
  11283. lru = (taghi >> 14) & 0xff;
  11284. prom_printf("[Bank %d Set 0x%02x] LRU > %d %d %d %d > MRU\n",
  11285. Index: linux-2.4.35.4/arch/mips64/mm/c-r4k.c
  11286. ===================================================================
  11287. --- linux-2.4.35.4.orig/arch/mips64/mm/c-r4k.c
  11288. +++ linux-2.4.35.4/arch/mips64/mm/c-r4k.c
  11289. @@ -867,9 +867,16 @@ static void __init probe_pcache(void)
  11290. * normally they'd suffer from aliases but magic in the hardware deals
  11291. * with that for us so we don't need to take care ourselves.
  11292. */
  11293. - if (c->cputype != CPU_R10000 && c->cputype != CPU_R12000)
  11294. - if (c->dcache.waysize > PAGE_SIZE)
  11295. - c->dcache.flags |= MIPS_CACHE_ALIASES;
  11296. + switch (c->cputype) {
  11297. + case CPU_R10000:
  11298. + case CPU_R12000:
  11299. + break;
  11300. + case CPU_24K:
  11301. + if (!(read_c0_config7() & (1 << 16)))
  11302. + default:
  11303. + if (c->dcache.waysize > PAGE_SIZE)
  11304. + c->dcache.flags |= MIPS_CACHE_ALIASES;
  11305. + }
  11306. switch (c->cputype) {
  11307. case CPU_20KC:
  11308. @@ -1070,9 +1077,6 @@ void __init ld_mmu_r4xx0(void)
  11309. setup_scache();
  11310. coherency_setup();
  11311. - if (c->dcache.sets * c->dcache.ways > PAGE_SIZE)
  11312. - c->dcache.flags |= MIPS_CACHE_ALIASES;
  11313. -
  11314. r4k_blast_dcache_page_setup();
  11315. r4k_blast_dcache_page_indexed_setup();
  11316. r4k_blast_dcache_setup();
  11317. Index: linux-2.4.35.4/arch/mips64/mm/tlbex-r4k.S
  11318. ===================================================================
  11319. --- linux-2.4.35.4.orig/arch/mips64/mm/tlbex-r4k.S
  11320. +++ linux-2.4.35.4/arch/mips64/mm/tlbex-r4k.S
  11321. @@ -125,6 +125,33 @@ LEAF(except_vec1_r4k)
  11322. nop
  11323. END(except_vec1_r4k)
  11324. + __FINIT
  11325. +
  11326. + .align 5
  11327. +LEAF(handle_vec1_r4k)
  11328. + .set noat
  11329. + LOAD_PTE2 k1 k0 9f
  11330. + ld k0, 0(k1) # get even pte
  11331. + ld k1, 8(k1) # get odd pte
  11332. + PTE_RELOAD k0 k1
  11333. + mtc0_tlbw_hazard
  11334. + tlbwr
  11335. + tlbw_eret_hazard
  11336. + eret
  11337. +
  11338. +9: # handle the vmalloc range
  11339. + LOAD_KPTE2 k1 k0 invalid_vmalloc_address
  11340. + ld k0, 0(k1) # get even pte
  11341. + ld k1, 8(k1) # get odd pte
  11342. + PTE_RELOAD k0 k1
  11343. + mtc0_tlbw_hazard
  11344. + tlbwr
  11345. + tlbw_eret_hazard
  11346. + eret
  11347. +END(handle_vec1_r4k)
  11348. +
  11349. + __INIT
  11350. +
  11351. LEAF(except_vec1_sb1)
  11352. #if BCM1250_M3_WAR
  11353. dmfc0 k0, CP0_BADVADDR
  11354. @@ -134,28 +161,24 @@ LEAF(except_vec1_sb1)
  11355. bnez k0, 1f
  11356. #endif
  11357. .set noat
  11358. - dla k0, handle_vec1_r4k
  11359. + dla k0, handle_vec1_sb1
  11360. jr k0
  11361. nop
  11362. 1: eret
  11363. - nop
  11364. END(except_vec1_sb1)
  11365. __FINIT
  11366. .align 5
  11367. -LEAF(handle_vec1_r4k)
  11368. +LEAF(handle_vec1_sb1)
  11369. .set noat
  11370. LOAD_PTE2 k1 k0 9f
  11371. ld k0, 0(k1) # get even pte
  11372. ld k1, 8(k1) # get odd pte
  11373. PTE_RELOAD k0 k1
  11374. - rm9000_tlb_hazard
  11375. - b 1f
  11376. - tlbwr
  11377. -1: nop
  11378. - rm9000_tlb_hazard
  11379. + mtc0_tlbw_hazard
  11380. + tlbwr
  11381. eret
  11382. 9: # handle the vmalloc range
  11383. @@ -163,13 +186,10 @@ LEAF(handle_vec1_r4k)
  11384. ld k0, 0(k1) # get even pte
  11385. ld k1, 8(k1) # get odd pte
  11386. PTE_RELOAD k0 k1
  11387. - rm9000_tlb_hazard
  11388. - b 1f
  11389. - tlbwr
  11390. -1: nop
  11391. - rm9000_tlb_hazard
  11392. + mtc0_tlbw_hazard
  11393. + tlbwr
  11394. eret
  11395. -END(handle_vec1_r4k)
  11396. +END(handle_vec1_sb1)
  11397. __INIT
  11398. @@ -195,10 +215,8 @@ LEAF(handle_vec1_r10k)
  11399. ld k0, 0(k1) # get even pte
  11400. ld k1, 8(k1) # get odd pte
  11401. PTE_RELOAD k0 k1
  11402. - rm9000_tlb_hazard
  11403. - nop
  11404. + mtc0_tlbw_hazard
  11405. tlbwr
  11406. - rm9000_tlb_hazard
  11407. eret
  11408. 9: # handle the vmalloc range
  11409. @@ -206,10 +224,8 @@ LEAF(handle_vec1_r10k)
  11410. ld k0, 0(k1) # get even pte
  11411. ld k1, 8(k1) # get odd pte
  11412. PTE_RELOAD k0 k1
  11413. - rm9000_tlb_hazard
  11414. - nop
  11415. + mtc0_tlbw_hazard
  11416. tlbwr
  11417. - rm9000_tlb_hazard
  11418. eret
  11419. END(handle_vec1_r10k)
  11420. Index: linux-2.4.35.4/arch/mips64/mm/tlb-r4k.c
  11421. ===================================================================
  11422. --- linux-2.4.35.4.orig/arch/mips64/mm/tlb-r4k.c
  11423. +++ linux-2.4.35.4/arch/mips64/mm/tlb-r4k.c
  11424. @@ -1,24 +1,12 @@
  11425. /*
  11426. - * Carsten Langgaard, [email protected]
  11427. - * Copyright (C) 2002 MIPS Technologies, Inc. All rights reserved.
  11428. - *
  11429. - * This program is free software; you can distribute it and/or modify it
  11430. - * under the terms of the GNU General Public License (Version 2) as
  11431. - * published by the Free Software Foundation.
  11432. - *
  11433. - * This program is distributed in the hope it will be useful, but WITHOUT
  11434. - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11435. - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  11436. + * This file is subject to the terms and conditions of the GNU General Public
  11437. + * License. See the file "COPYING" in the main directory of this archive
  11438. * for more details.
  11439. *
  11440. - * You should have received a copy of the GNU General Public License along
  11441. - * with this program; if not, write to the Free Software Foundation, Inc.,
  11442. - * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  11443. - *
  11444. - * MIPS64 CPU variant specific MMU routines.
  11445. - * These routine are not optimized in any way, they are done in a generic way
  11446. - * so they can be used on all MIPS64 compliant CPUs, and also done in an
  11447. - * attempt not to break anything for the R4xx0 style CPUs.
  11448. + * Copyright (C) 1996 David S. Miller ([email protected])
  11449. + * Copyright (C) 1997, 1998, 1999, 2000 Ralf Baechle [email protected]
  11450. + * Carsten Langgaard, [email protected]
  11451. + * Copyright (C) 2002 MIPS Technologies, Inc. All rights reserved.
  11452. */
  11453. #include <linux/init.h>
  11454. #include <linux/sched.h>
  11455. @@ -30,9 +18,6 @@
  11456. #include <asm/pgtable.h>
  11457. #include <asm/system.h>
  11458. -#undef DEBUG_TLB
  11459. -#undef DEBUG_TLBUPDATE
  11460. -
  11461. extern void except_vec1_r4k(void);
  11462. /* CP0 hazard avoidance. */
  11463. @@ -46,31 +31,23 @@ void local_flush_tlb_all(void)
  11464. unsigned long old_ctx;
  11465. int entry;
  11466. -#ifdef DEBUG_TLB
  11467. - printk("[tlball]");
  11468. -#endif
  11469. -
  11470. local_irq_save(flags);
  11471. /* Save old context and create impossible VPN2 value */
  11472. old_ctx = read_c0_entryhi();
  11473. - write_c0_entryhi(XKPHYS);
  11474. write_c0_entrylo0(0);
  11475. write_c0_entrylo1(0);
  11476. - BARRIER;
  11477. entry = read_c0_wired();
  11478. /* Blast 'em all away. */
  11479. - while(entry < current_cpu_data.tlbsize) {
  11480. - /* Make sure all entries differ. */
  11481. - write_c0_entryhi(XKPHYS+entry*0x2000);
  11482. + while (entry < current_cpu_data.tlbsize) {
  11483. + write_c0_entryhi(XKPHYS + entry*0x2000);
  11484. write_c0_index(entry);
  11485. - BARRIER;
  11486. + mtc0_tlbw_hazard();
  11487. tlb_write_indexed();
  11488. - BARRIER;
  11489. entry++;
  11490. }
  11491. - BARRIER;
  11492. + tlbw_use_hazard();
  11493. write_c0_entryhi(old_ctx);
  11494. local_irq_restore(flags);
  11495. }
  11496. @@ -79,12 +56,8 @@ void local_flush_tlb_mm(struct mm_struct
  11497. {
  11498. int cpu = smp_processor_id();
  11499. - if (cpu_context(cpu, mm) != 0) {
  11500. -#ifdef DEBUG_TLB
  11501. - printk("[tlbmm<%d>]", mm->context);
  11502. -#endif
  11503. + if (cpu_context(cpu, mm) != 0)
  11504. drop_mmu_context(mm,cpu);
  11505. - }
  11506. }
  11507. void local_flush_tlb_range(struct mm_struct *mm, unsigned long start,
  11508. @@ -96,10 +69,6 @@ void local_flush_tlb_range(struct mm_str
  11509. unsigned long flags;
  11510. int size;
  11511. -#ifdef DEBUG_TLB
  11512. - printk("[tlbrange<%02x,%08lx,%08lx>]", (mm->context & ASID_MASK),
  11513. - start, end);
  11514. -#endif
  11515. local_irq_save(flags);
  11516. size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
  11517. size = (size + 1) >> 1;
  11518. @@ -110,25 +79,25 @@ void local_flush_tlb_range(struct mm_str
  11519. start &= (PAGE_MASK << 1);
  11520. end += ((PAGE_SIZE << 1) - 1);
  11521. end &= (PAGE_MASK << 1);
  11522. - while(start < end) {
  11523. + while (start < end) {
  11524. int idx;
  11525. write_c0_entryhi(start | newpid);
  11526. start += (PAGE_SIZE << 1);
  11527. - BARRIER;
  11528. + mtc0_tlbw_hazard();
  11529. tlb_probe();
  11530. BARRIER;
  11531. idx = read_c0_index();
  11532. write_c0_entrylo0(0);
  11533. write_c0_entrylo1(0);
  11534. - if(idx < 0)
  11535. + if (idx < 0)
  11536. continue;
  11537. /* Make sure all entries differ. */
  11538. write_c0_entryhi(XKPHYS+idx*0x2000);
  11539. - BARRIER;
  11540. + mtc0_tlbw_hazard();
  11541. tlb_write_indexed();
  11542. - BARRIER;
  11543. }
  11544. + tlbw_use_hazard();
  11545. write_c0_entryhi(oldpid);
  11546. } else {
  11547. drop_mmu_context(mm, cpu);
  11548. @@ -145,28 +114,26 @@ void local_flush_tlb_page(struct vm_area
  11549. unsigned long flags;
  11550. unsigned long oldpid, newpid, idx;
  11551. -#ifdef DEBUG_TLB
  11552. - printk("[tlbpage<%d,%08lx>]", vma->vm_mm->context, page);
  11553. -#endif
  11554. newpid = cpu_asid(cpu, vma->vm_mm);
  11555. page &= (PAGE_MASK << 1);
  11556. local_irq_save(flags);
  11557. oldpid = read_c0_entryhi();
  11558. write_c0_entryhi(page | newpid);
  11559. - BARRIER;
  11560. + mtc0_tlbw_hazard();
  11561. tlb_probe();
  11562. BARRIER;
  11563. idx = read_c0_index();
  11564. write_c0_entrylo0(0);
  11565. write_c0_entrylo1(0);
  11566. - if(idx < 0)
  11567. + if (idx < 0)
  11568. goto finish;
  11569. /* Make sure all entries differ. */
  11570. write_c0_entryhi(XKPHYS+idx*0x2000);
  11571. - BARRIER;
  11572. + mtc0_tlbw_hazard();
  11573. tlb_write_indexed();
  11574. + tlbw_use_hazard();
  11575. +
  11576. finish:
  11577. - BARRIER;
  11578. write_c0_entryhi(oldpid);
  11579. local_irq_restore(flags);
  11580. }
  11581. @@ -186,7 +153,7 @@ void local_flush_tlb_one(unsigned long p
  11582. local_irq_save(flags);
  11583. write_c0_entryhi(page);
  11584. - BARRIER;
  11585. + mtc0_tlbw_hazard();
  11586. tlb_probe();
  11587. BARRIER;
  11588. idx = read_c0_index();
  11589. @@ -195,10 +162,12 @@ void local_flush_tlb_one(unsigned long p
  11590. if (idx >= 0) {
  11591. /* Make sure all entries differ. */
  11592. write_c0_entryhi(KSEG0+idx*0x2000);
  11593. + mtc0_tlbw_hazard();
  11594. tlb_write_indexed();
  11595. + tlbw_use_hazard();
  11596. }
  11597. - BARRIER;
  11598. write_c0_entryhi(oldpid);
  11599. +
  11600. local_irq_restore(flags);
  11601. }
  11602. @@ -208,7 +177,6 @@ void local_flush_tlb_one(unsigned long p
  11603. void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
  11604. {
  11605. unsigned long flags;
  11606. - unsigned int asid;
  11607. pgd_t *pgdp;
  11608. pmd_t *pmdp;
  11609. pte_t *ptep;
  11610. @@ -222,70 +190,58 @@ void __update_tlb(struct vm_area_struct
  11611. pid = read_c0_entryhi() & ASID_MASK;
  11612. -#ifdef DEBUG_TLB
  11613. - if ((pid != (cpu_asid(smp_processor_id(), vma->vm_mm))) ||
  11614. - (cpu_context(smp_processor_id(), vma->vm_mm) == 0)) {
  11615. - printk("update_mmu_cache: Wheee, bogus tlbpid mmpid=%d"
  11616. - "tlbpid=%d\n", (int) (cpu_context(smp_processor_id(),
  11617. - vma->vm_mm) & ASID_MASK), pid);
  11618. - }
  11619. -#endif
  11620. -
  11621. local_irq_save(flags);
  11622. address &= (PAGE_MASK << 1);
  11623. - write_c0_entryhi(address | (pid));
  11624. + write_c0_entryhi(address | pid);
  11625. pgdp = pgd_offset(vma->vm_mm, address);
  11626. - BARRIER;
  11627. + mtc0_tlbw_hazard();
  11628. tlb_probe();
  11629. BARRIER;
  11630. pmdp = pmd_offset(pgdp, address);
  11631. idx = read_c0_index();
  11632. ptep = pte_offset(pmdp, address);
  11633. - BARRIER;
  11634. write_c0_entrylo0(pte_val(*ptep++) >> 6);
  11635. write_c0_entrylo1(pte_val(*ptep) >> 6);
  11636. - write_c0_entryhi(address | (pid));
  11637. - BARRIER;
  11638. - if(idx < 0) {
  11639. + write_c0_entryhi(address | pid);
  11640. + mtc0_tlbw_hazard();
  11641. + if (idx < 0)
  11642. tlb_write_random();
  11643. - } else {
  11644. + else
  11645. tlb_write_indexed();
  11646. - }
  11647. - BARRIER;
  11648. + tlbw_use_hazard();
  11649. write_c0_entryhi(pid);
  11650. - BARRIER;
  11651. local_irq_restore(flags);
  11652. }
  11653. -void add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
  11654. - unsigned long entryhi, unsigned long pagemask)
  11655. +void __init add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
  11656. + unsigned long entryhi, unsigned long pagemask)
  11657. {
  11658. - unsigned long flags;
  11659. - unsigned long wired;
  11660. - unsigned long old_pagemask;
  11661. - unsigned long old_ctx;
  11662. -
  11663. - local_irq_save(flags);
  11664. - /* Save old context and create impossible VPN2 value */
  11665. - old_ctx = (read_c0_entryhi() & ASID_MASK);
  11666. - old_pagemask = read_c0_pagemask();
  11667. - wired = read_c0_wired();
  11668. - write_c0_wired(wired + 1);
  11669. - write_c0_index(wired);
  11670. - BARRIER;
  11671. - write_c0_pagemask(pagemask);
  11672. - write_c0_entryhi(entryhi);
  11673. - write_c0_entrylo0(entrylo0);
  11674. - write_c0_entrylo1(entrylo1);
  11675. - BARRIER;
  11676. - tlb_write_indexed();
  11677. - BARRIER;
  11678. -
  11679. - write_c0_entryhi(old_ctx);
  11680. - BARRIER;
  11681. - write_c0_pagemask(old_pagemask);
  11682. - local_flush_tlb_all();
  11683. - local_irq_restore(flags);
  11684. + unsigned long flags;
  11685. + unsigned long wired;
  11686. + unsigned long old_pagemask;
  11687. + unsigned long old_ctx;
  11688. +
  11689. + local_irq_save(flags);
  11690. + /* Save old context and create impossible VPN2 value */
  11691. + old_ctx = read_c0_entryhi() & ASID_MASK;
  11692. + old_pagemask = read_c0_pagemask();
  11693. + wired = read_c0_wired();
  11694. + write_c0_wired(wired + 1);
  11695. + write_c0_index(wired);
  11696. + BARRIER;
  11697. + write_c0_pagemask(pagemask);
  11698. + write_c0_entryhi(entryhi);
  11699. + write_c0_entrylo0(entrylo0);
  11700. + write_c0_entrylo1(entrylo1);
  11701. + mtc0_tlbw_hazard();
  11702. + tlb_write_indexed();
  11703. + tlbw_use_hazard();
  11704. +
  11705. + write_c0_entryhi(old_ctx);
  11706. + BARRIER;
  11707. + write_c0_pagemask(old_pagemask);
  11708. + local_flush_tlb_all();
  11709. + local_irq_restore(flags);
  11710. }
  11711. /*
  11712. @@ -317,17 +273,15 @@ __init int add_temporary_entry(unsigned
  11713. }
  11714. write_c0_index(temp_tlb_entry);
  11715. - BARRIER;
  11716. write_c0_pagemask(pagemask);
  11717. write_c0_entryhi(entryhi);
  11718. write_c0_entrylo0(entrylo0);
  11719. write_c0_entrylo1(entrylo1);
  11720. - BARRIER;
  11721. + mtc0_tlbw_hazard();
  11722. tlb_write_indexed();
  11723. - BARRIER;
  11724. + tlbw_use_hazard();
  11725. write_c0_entryhi(old_ctx);
  11726. - BARRIER;
  11727. write_c0_pagemask(old_pagemask);
  11728. out:
  11729. local_irq_restore(flags);
  11730. @@ -348,15 +302,23 @@ static void __init probe_tlb(unsigned lo
  11731. return;
  11732. config1 = read_c0_config1();
  11733. - if (!((config1 >> 7) & 3))
  11734. - panic("No MMU present");
  11735. + if (!((config >> 7) & 3))
  11736. + panic("No TLB present");
  11737. c->tlbsize = ((config1 >> 25) & 0x3f) + 1;
  11738. }
  11739. void __init r4k_tlb_init(void)
  11740. {
  11741. - unsigned long config = read_c0_config();
  11742. + unsigned int config = read_c0_config();
  11743. +
  11744. + /*
  11745. + * You should never change this register:
  11746. + * - On R4600 1.7 the tlbp never hits for pages smaller than
  11747. + * the value in the c0_pagemask register.
  11748. + * - The entire mm handling assumes the c0_pagemask register to
  11749. + * be set for 4kb pages.
  11750. + */
  11751. probe_tlb(config);
  11752. write_c0_pagemask(PM_DEFAULT_MASK);
  11753. write_c0_wired(0);
  11754. Index: linux-2.4.35.4/drivers/char/au1000_gpio.c
  11755. ===================================================================
  11756. --- linux-2.4.35.4.orig/drivers/char/au1000_gpio.c
  11757. +++ linux-2.4.35.4/drivers/char/au1000_gpio.c
  11758. @@ -246,7 +246,7 @@ static struct file_operations au1000gpio
  11759. static struct miscdevice au1000gpio_miscdev =
  11760. {
  11761. - GPIO_MINOR,
  11762. + MISC_DYNAMIC_MINOR,
  11763. "au1000_gpio",
  11764. &au1000gpio_fops
  11765. };
  11766. Index: linux-2.4.35.4/drivers/char/au1550_psc_spi.c
  11767. ===================================================================
  11768. --- /dev/null
  11769. +++ linux-2.4.35.4/drivers/char/au1550_psc_spi.c
  11770. @@ -0,0 +1,466 @@
  11771. +/*
  11772. + * Driver for Alchemy Au1550 SPI on the PSC.
  11773. + *
  11774. + * Copyright 2004 Embedded Edge, LLC.
  11775. + * [email protected]
  11776. + *
  11777. + * This program is free software; you can redistribute it and/or modify it
  11778. + * under the terms of the GNU General Public License as published by the
  11779. + * Free Software Foundation; either version 2 of the License, or (at your
  11780. + * option) any later version.
  11781. + *
  11782. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  11783. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  11784. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  11785. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  11786. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  11787. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  11788. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  11789. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  11790. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  11791. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  11792. + *
  11793. + * You should have received a copy of the GNU General Public License along
  11794. + * with this program; if not, write to the Free Software Foundation, Inc.,
  11795. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  11796. + */
  11797. +
  11798. +#include <linux/module.h>
  11799. +#include <linux/config.h>
  11800. +#include <linux/types.h>
  11801. +#include <linux/kernel.h>
  11802. +#include <linux/miscdevice.h>
  11803. +#include <linux/init.h>
  11804. +#include <asm/uaccess.h>
  11805. +#include <asm/io.h>
  11806. +#include <asm/au1000.h>
  11807. +#include <asm/au1550_spi.h>
  11808. +#include <asm/au1xxx_psc.h>
  11809. +
  11810. +#ifdef CONFIG_MIPS_PB1550
  11811. +#include <asm/pb1550.h>
  11812. +#endif
  11813. +
  11814. +#ifdef CONFIG_MIPS_DB1550
  11815. +#include <asm/db1x00.h>
  11816. +#endif
  11817. +
  11818. +#ifdef CONFIG_MIPS_PB1200
  11819. +#include <asm/pb1200.h>
  11820. +#endif
  11821. +
  11822. +/* This is just a simple programmed I/O SPI interface on the PSC of the 1550.
  11823. + * We support open, close, write, and ioctl. The SPI is a full duplex
  11824. + * interface, you can't read without writing. So, the write system call
  11825. + * copies the bytes out to the SPI, and whatever is returned is placed
  11826. + * in the same buffer. Kinda weird, maybe we'll change it, but for now
  11827. + * it works OK.
  11828. + * I didn't implement any DMA yet, and it's a debate about the necessity.
  11829. + * The SPI clocks are usually quite fast, so data is sent/received as
  11830. + * quickly as you can stuff the FIFO. The overhead of DMA and interrupts
  11831. + * are usually far greater than the data transfer itself. If, however,
  11832. + * we find applications that move large amounts of data, we may choose
  11833. + * use the overhead of buffering and DMA to do the work.
  11834. + */
  11835. +
  11836. +/* The maximum clock rate specified in the manual is 2mHz.
  11837. +*/
  11838. +#define MAX_BAUD_RATE (2 * 1000000)
  11839. +#define PSC_INTCLK_RATE (32 * 1000000)
  11840. +
  11841. +static int inuse;
  11842. +
  11843. +/* We have to know what the user requested for the data length
  11844. + * so we know how to stuff the fifo. The FIFO is 32 bits wide,
  11845. + * and we have to load it with the bits to go in a single transfer.
  11846. + */
  11847. +static uint spi_datalen;
  11848. +
  11849. +static int
  11850. +au1550spi_master_done( int ms )
  11851. +{
  11852. + int timeout=ms;
  11853. + volatile psc_spi_t *sp;
  11854. +
  11855. + sp = (volatile psc_spi_t *)SPI_PSC_BASE;
  11856. +
  11857. + /* Loop until MD is set or timeout has expired */
  11858. + while(!(sp->psc_spievent & PSC_SPIEVNT_MD) && timeout--) udelay(1000);
  11859. +
  11860. + if ( !timeout )
  11861. + return 0;
  11862. + else
  11863. + sp->psc_spievent |= PSC_SPIEVNT_MD;
  11864. +
  11865. + return 1;
  11866. +}
  11867. +
  11868. +static int
  11869. +au1550spi_open(struct inode *inode, struct file *file)
  11870. +{
  11871. + if (inuse)
  11872. + return -EBUSY;
  11873. +
  11874. + inuse = 1;
  11875. +
  11876. + MOD_INC_USE_COUNT;
  11877. +
  11878. + return 0;
  11879. +}
  11880. +
  11881. +static ssize_t
  11882. +au1550spi_write(struct file *fp, const char *bp, size_t count, loff_t *ppos)
  11883. +{
  11884. + int bytelen, i;
  11885. + size_t rcount, retval;
  11886. + unsigned char sb, *rp, *wp;
  11887. + uint fifoword, pcr, stat;
  11888. + volatile psc_spi_t *sp;
  11889. +
  11890. + /* Get the number of bytes per transfer.
  11891. + */
  11892. + bytelen = ((spi_datalen - 1) / 8) + 1;
  11893. +
  11894. + /* User needs to send us multiple of this count.
  11895. + */
  11896. + if ((count % bytelen) != 0)
  11897. + return -EINVAL;
  11898. +
  11899. + rp = wp = (unsigned char *)bp;
  11900. + retval = rcount = count;
  11901. +
  11902. + /* Reset the FIFO.
  11903. + */
  11904. + sp = (volatile psc_spi_t *)SPI_PSC_BASE;
  11905. + sp->psc_spipcr = (PSC_SPIPCR_RC | PSC_SPIPCR_TC);
  11906. + au_sync();
  11907. + do {
  11908. + pcr = sp->psc_spipcr;
  11909. + au_sync();
  11910. + } while (pcr != 0);
  11911. +
  11912. + /* Prime the transmit FIFO.
  11913. + */
  11914. + while (count > 0) {
  11915. + fifoword = 0;
  11916. + for (i=0; i<bytelen; i++) {
  11917. + fifoword <<= 8;
  11918. + if (get_user(sb, wp) < 0)
  11919. + return -EFAULT;
  11920. + fifoword |= sb;
  11921. + wp++;
  11922. + }
  11923. + count -= bytelen;
  11924. + if (count <= 0)
  11925. + fifoword |= PSC_SPITXRX_LC;
  11926. + sp->psc_spitxrx = fifoword;
  11927. + au_sync();
  11928. + stat = sp->psc_spistat;
  11929. + au_sync();
  11930. + if (stat & PSC_SPISTAT_TF)
  11931. + break;
  11932. + }
  11933. +
  11934. + /* Start the transfer.
  11935. + */
  11936. + sp->psc_spipcr = PSC_SPIPCR_MS;
  11937. + au_sync();
  11938. +
  11939. + /* Now, just keep the transmit fifo full and empty the receive.
  11940. + */
  11941. + while (count > 0) {
  11942. + stat = sp->psc_spistat;
  11943. + au_sync();
  11944. + while ((stat & PSC_SPISTAT_RE) == 0) {
  11945. + fifoword = sp->psc_spitxrx;
  11946. + au_sync();
  11947. + for (i=0; i<bytelen; i++) {
  11948. + sb = fifoword & 0xff;
  11949. + if (put_user(sb, rp) < 0)
  11950. + return -EFAULT;
  11951. + fifoword >>= 8;
  11952. + rp++;
  11953. + }
  11954. + rcount -= bytelen;
  11955. + stat = sp->psc_spistat;
  11956. + au_sync();
  11957. + }
  11958. + if ((stat & PSC_SPISTAT_TF) == 0) {
  11959. + fifoword = 0;
  11960. + for (i=0; i<bytelen; i++) {
  11961. + fifoword <<= 8;
  11962. + if (get_user(sb, wp) < 0)
  11963. + return -EFAULT;
  11964. + fifoword |= sb;
  11965. + wp++;
  11966. + }
  11967. + count -= bytelen;
  11968. + if (count <= 0)
  11969. + fifoword |= PSC_SPITXRX_LC;
  11970. + sp->psc_spitxrx = fifoword;
  11971. + au_sync();
  11972. + }
  11973. + }
  11974. +
  11975. + /* All of the bytes for transmit have been written. Hang
  11976. + * out waiting for any residual bytes that are yet to be
  11977. + * read from the fifo.
  11978. + */
  11979. + while (rcount > 0) {
  11980. + stat = sp->psc_spistat;
  11981. + au_sync();
  11982. + if ((stat & PSC_SPISTAT_RE) == 0) {
  11983. + fifoword = sp->psc_spitxrx;
  11984. + au_sync();
  11985. + for (i=0; i<bytelen; i++) {
  11986. + sb = fifoword & 0xff;
  11987. + if (put_user(sb, rp) < 0)
  11988. + return -EFAULT;
  11989. + fifoword >>= 8;
  11990. + rp++;
  11991. + }
  11992. + rcount -= bytelen;
  11993. + }
  11994. + }
  11995. +
  11996. + /* Wait for MasterDone event. 30ms timeout */
  11997. + if (!au1550spi_master_done(30) ) retval = -EFAULT;
  11998. + return retval;
  11999. +}
  12000. +
  12001. +static int
  12002. +au1550spi_release(struct inode *inode, struct file *file)
  12003. +{
  12004. + MOD_DEC_USE_COUNT;
  12005. +
  12006. + inuse = 0;
  12007. +
  12008. + return 0;
  12009. +}
  12010. +
  12011. +/* Set the baud rate closest to the request, then return the actual
  12012. + * value we are using.
  12013. + */
  12014. +static uint
  12015. +set_baud_rate(uint baud)
  12016. +{
  12017. + uint rate, tmpclk, brg, ctl, stat;
  12018. + volatile psc_spi_t *sp;
  12019. +
  12020. + /* For starters, the input clock is divided by two.
  12021. + */
  12022. + tmpclk = PSC_INTCLK_RATE/2;
  12023. +
  12024. + rate = tmpclk / baud;
  12025. +
  12026. + /* The dividers work as follows:
  12027. + * baud = tmpclk / (2 * (brg + 1))
  12028. + */
  12029. + brg = (rate/2) - 1;
  12030. +
  12031. + /* Test BRG to ensure it will fit into the 6 bits allocated.
  12032. + */
  12033. +
  12034. + /* Make sure the device is disabled while we make the change.
  12035. + */
  12036. + sp = (volatile psc_spi_t *)SPI_PSC_BASE;
  12037. + ctl = sp->psc_spicfg;
  12038. + au_sync();
  12039. + sp->psc_spicfg = ctl & ~PSC_SPICFG_DE_ENABLE;
  12040. + au_sync();
  12041. + ctl = PSC_SPICFG_CLR_BAUD(ctl);
  12042. + ctl |= PSC_SPICFG_SET_BAUD(brg);
  12043. + sp->psc_spicfg = ctl;
  12044. + au_sync();
  12045. +
  12046. + /* If the device was running prior to getting here, wait for
  12047. + * it to restart.
  12048. + */
  12049. + if (ctl & PSC_SPICFG_DE_ENABLE) {
  12050. + do {
  12051. + stat = sp->psc_spistat;
  12052. + au_sync();
  12053. + } while ((stat & PSC_SPISTAT_DR) == 0);
  12054. + }
  12055. +
  12056. + /* Return the actual value.
  12057. + */
  12058. + rate = tmpclk / (2 * (brg + 1));
  12059. +
  12060. + return(rate);
  12061. +}
  12062. +
  12063. +static uint
  12064. +set_word_len(uint len)
  12065. +{
  12066. + uint ctl, stat;
  12067. + volatile psc_spi_t *sp;
  12068. +
  12069. + if ((len < 4) || (len > 24))
  12070. + return -EINVAL;
  12071. +
  12072. + /* Make sure the device is disabled while we make the change.
  12073. + */
  12074. + sp = (volatile psc_spi_t *)SPI_PSC_BASE;
  12075. + ctl = sp->psc_spicfg;
  12076. + au_sync();
  12077. + sp->psc_spicfg = ctl & ~PSC_SPICFG_DE_ENABLE;
  12078. + au_sync();
  12079. + ctl = PSC_SPICFG_CLR_LEN(ctl);
  12080. + ctl |= PSC_SPICFG_SET_LEN(len);
  12081. + sp->psc_spicfg = ctl;
  12082. + au_sync();
  12083. +
  12084. + /* If the device was running prior to getting here, wait for
  12085. + * it to restart.
  12086. + */
  12087. + if (ctl & PSC_SPICFG_DE_ENABLE) {
  12088. + do {
  12089. + stat = sp->psc_spistat;
  12090. + au_sync();
  12091. + } while ((stat & PSC_SPISTAT_DR) == 0);
  12092. + }
  12093. +
  12094. + return 0;
  12095. +}
  12096. +
  12097. +static int
  12098. +au1550spi_ioctl(struct inode *inode, struct file *file,
  12099. + unsigned int cmd, unsigned long arg)
  12100. +{
  12101. + int status;
  12102. + u32 val;
  12103. +
  12104. + status = 0;
  12105. +
  12106. + switch(cmd) {
  12107. + case AU1550SPI_WORD_LEN:
  12108. + status = set_word_len(arg);
  12109. + break;
  12110. +
  12111. + case AU1550SPI_SET_BAUD:
  12112. + if (get_user(val, (u32 *)arg))
  12113. + return -EFAULT;
  12114. +
  12115. + val = set_baud_rate(val);
  12116. + if (put_user(val, (u32 *)arg))
  12117. + return -EFAULT;
  12118. + break;
  12119. +
  12120. + default:
  12121. + status = -ENOIOCTLCMD;
  12122. +
  12123. + }
  12124. +
  12125. + return status;
  12126. +}
  12127. +
  12128. +
  12129. +static struct file_operations au1550spi_fops =
  12130. +{
  12131. + owner: THIS_MODULE,
  12132. + write: au1550spi_write,
  12133. + ioctl: au1550spi_ioctl,
  12134. + open: au1550spi_open,
  12135. + release: au1550spi_release,
  12136. +};
  12137. +
  12138. +
  12139. +static struct miscdevice au1550spi_miscdev =
  12140. +{
  12141. + MISC_DYNAMIC_MINOR,
  12142. + "au1550_spi",
  12143. + &au1550spi_fops
  12144. +};
  12145. +
  12146. +
  12147. +int __init
  12148. +au1550spi_init(void)
  12149. +{
  12150. + uint clk, rate, stat;
  12151. + volatile psc_spi_t *sp;
  12152. +
  12153. + /* Wire up Freq3 as a clock for the SPI. The PSC does
  12154. + * factor of 2 divisor, so run a higher rate so we can
  12155. + * get some granularity to the clock speeds.
  12156. + * We can't do this in board set up because the frequency
  12157. + * is computed too late.
  12158. + */
  12159. + rate = get_au1x00_speed();
  12160. + rate /= PSC_INTCLK_RATE;
  12161. +
  12162. + /* The FRDIV in the frequency control is (FRDIV + 1) * 2
  12163. + */
  12164. + rate /=2;
  12165. + rate--;
  12166. + clk = au_readl(SYS_FREQCTRL1);
  12167. + au_sync();
  12168. + clk &= ~SYS_FC_FRDIV3_MASK;
  12169. + clk |= (rate << SYS_FC_FRDIV3_BIT);
  12170. + clk |= SYS_FC_FE3;
  12171. + au_writel(clk, SYS_FREQCTRL1);
  12172. + au_sync();
  12173. +
  12174. + /* Set up the clock source routing to get Freq3 to PSC0_intclk.
  12175. + */
  12176. + clk = au_readl(SYS_CLKSRC);
  12177. + au_sync();
  12178. + clk &= ~0x03e0;
  12179. + clk |= (5 << 7);
  12180. + au_writel(clk, SYS_CLKSRC);
  12181. + au_sync();
  12182. +
  12183. + /* Set up GPIO pin function to drive PSC0_SYNC1, which is
  12184. + * the SPI Select.
  12185. + */
  12186. + clk = au_readl(SYS_PINFUNC);
  12187. + au_sync();
  12188. + clk |= 1;
  12189. + au_writel(clk, SYS_PINFUNC);
  12190. + au_sync();
  12191. +
  12192. + /* Now, set up the PSC for SPI PIO mode.
  12193. + */
  12194. + sp = (volatile psc_spi_t *)SPI_PSC_BASE;
  12195. + sp->psc_ctrl = PSC_CTRL_DISABLE;
  12196. + au_sync();
  12197. + sp->psc_sel = PSC_SEL_PS_SPIMODE;
  12198. + sp->psc_spicfg = 0;
  12199. + au_sync();
  12200. + sp->psc_ctrl = PSC_CTRL_ENABLE;
  12201. + au_sync();
  12202. + do {
  12203. + stat = sp->psc_spistat;
  12204. + au_sync();
  12205. + } while ((stat & PSC_SPISTAT_SR) == 0);
  12206. +
  12207. + sp->psc_spicfg = (PSC_SPICFG_RT_FIFO8 | PSC_SPICFG_TT_FIFO8 |
  12208. + PSC_SPICFG_DD_DISABLE | PSC_SPICFG_MO);
  12209. + sp->psc_spicfg |= PSC_SPICFG_SET_LEN(8);
  12210. + spi_datalen = 8;
  12211. + sp->psc_spimsk = PSC_SPIMSK_ALLMASK;
  12212. + au_sync();
  12213. +
  12214. + set_baud_rate(1000000);
  12215. +
  12216. + sp->psc_spicfg |= PSC_SPICFG_DE_ENABLE;
  12217. + do {
  12218. + stat = sp->psc_spistat;
  12219. + au_sync();
  12220. + } while ((stat & PSC_SPISTAT_DR) == 0);
  12221. +
  12222. + misc_register(&au1550spi_miscdev);
  12223. + printk("Au1550 SPI driver\n");
  12224. + return 0;
  12225. +}
  12226. +
  12227. +
  12228. +void __exit
  12229. +au1550spi_exit(void)
  12230. +{
  12231. + misc_deregister(&au1550spi_miscdev);
  12232. +}
  12233. +
  12234. +
  12235. +module_init(au1550spi_init);
  12236. +module_exit(au1550spi_exit);
  12237. Index: linux-2.4.35.4/drivers/char/Config.in
  12238. ===================================================================
  12239. --- linux-2.4.35.4.orig/drivers/char/Config.in
  12240. +++ linux-2.4.35.4/drivers/char/Config.in
  12241. @@ -314,14 +314,11 @@ fi
  12242. if [ "$CONFIG_OBSOLETE" = "y" -a "$CONFIG_ALPHA_BOOK1" = "y" ]; then
  12243. bool 'Tadpole ANA H8 Support (OBSOLETE)' CONFIG_H8
  12244. fi
  12245. -if [ "$CONFIG_MIPS" = "y" -a "$CONFIG_NEW_TIME_C" = "y" ]; then
  12246. - tristate 'Generic MIPS RTC Support' CONFIG_MIPS_RTC
  12247. -fi
  12248. if [ "$CONFIG_SGI_IP22" = "y" ]; then
  12249. - bool 'SGI DS1286 RTC support' CONFIG_SGI_DS1286
  12250. + tristate 'Dallas DS1286 RTC support' CONFIG_DS1286
  12251. fi
  12252. if [ "$CONFIG_SGI_IP27" = "y" ]; then
  12253. - bool 'SGI M48T35 RTC support' CONFIG_SGI_IP27_RTC
  12254. + tristate 'SGI M48T35 RTC support' CONFIG_SGI_IP27_RTC
  12255. fi
  12256. if [ "$CONFIG_TOSHIBA_RBTX4927" = "y" -o "$CONFIG_TOSHIBA_JMR3927" = "y" ]; then
  12257. tristate 'Dallas DS1742 RTC support' CONFIG_DS1742
  12258. @@ -384,6 +381,11 @@ if [ "$CONFIG_DRM" = "y" ]; then
  12259. source drivers/char/drm/Config.in
  12260. fi
  12261. fi
  12262. +
  12263. +if [ "$CONFIG_X86" = "y" ]; then
  12264. + tristate 'ACP Modem (Mwave) support' CONFIG_MWAVE
  12265. +fi
  12266. +
  12267. endmenu
  12268. if [ "$CONFIG_HOTPLUG" = "y" -a "$CONFIG_PCMCIA" != "n" ]; then
  12269. @@ -392,6 +394,7 @@ fi
  12270. if [ "$CONFIG_SOC_AU1X00" = "y" ]; then
  12271. tristate ' Alchemy Au1x00 GPIO device support' CONFIG_AU1X00_GPIO
  12272. tristate ' Au1000/ADS7846 touchscreen support' CONFIG_TS_AU1X00_ADS7846
  12273. + #tristate ' Alchemy Au1550 PSC SPI support' CONFIG_AU1550_PSC_SPI
  12274. fi
  12275. if [ "$CONFIG_MIPS_ITE8172" = "y" ]; then
  12276. tristate ' ITE GPIO' CONFIG_ITE_GPIO
  12277. Index: linux-2.4.35.4/drivers/char/decserial.c
  12278. ===================================================================
  12279. --- linux-2.4.35.4.orig/drivers/char/decserial.c
  12280. +++ linux-2.4.35.4/drivers/char/decserial.c
  12281. @@ -3,95 +3,105 @@
  12282. * choose the right serial device at boot time
  12283. *
  12284. * triemer 6-SEP-1998
  12285. - * sercons.c is designed to allow the three different kinds
  12286. + * sercons.c is designed to allow the three different kinds
  12287. * of serial devices under the decstation world to co-exist
  12288. - * in the same kernel. The idea here is to abstract
  12289. + * in the same kernel. The idea here is to abstract
  12290. * the pieces of the drivers that are common to this file
  12291. * so that they do not clash at compile time and runtime.
  12292. *
  12293. * HK 16-SEP-1998 v0.002
  12294. * removed the PROM console as this is not a real serial
  12295. * device. Added support for PROM console in drivers/char/tty_io.c
  12296. - * instead. Although it may work to enable more than one
  12297. + * instead. Although it may work to enable more than one
  12298. * console device I strongly recommend to use only one.
  12299. + *
  12300. + * Copyright (C) 2004 Maciej W. Rozycki
  12301. */
  12302. #include <linux/config.h>
  12303. +#include <linux/errno.h>
  12304. #include <linux/init.h>
  12305. +
  12306. #include <asm/dec/machtype.h>
  12307. +#include <asm/dec/serial.h>
  12308. +
  12309. +extern int register_zs_hook(unsigned int channel,
  12310. + struct dec_serial_hook *hook);
  12311. +extern int unregister_zs_hook(unsigned int channel);
  12312. +
  12313. +extern int register_dz_hook(unsigned int channel,
  12314. + struct dec_serial_hook *hook);
  12315. +extern int unregister_dz_hook(unsigned int channel);
  12316. +int register_dec_serial_hook(unsigned int channel,
  12317. + struct dec_serial_hook *hook)
  12318. +{
  12319. #ifdef CONFIG_ZS
  12320. -extern int zs_init(void);
  12321. + if (IOASIC)
  12322. + return register_zs_hook(channel, hook);
  12323. #endif
  12324. -
  12325. #ifdef CONFIG_DZ
  12326. -extern int dz_init(void);
  12327. + if (!IOASIC)
  12328. + return register_dz_hook(channel, hook);
  12329. #endif
  12330. + return 0;
  12331. +}
  12332. -#ifdef CONFIG_SERIAL_DEC_CONSOLE
  12333. -
  12334. +int unregister_dec_serial_hook(unsigned int channel)
  12335. +{
  12336. #ifdef CONFIG_ZS
  12337. -extern void zs_serial_console_init(void);
  12338. + if (IOASIC)
  12339. + return unregister_zs_hook(channel);
  12340. #endif
  12341. -
  12342. #ifdef CONFIG_DZ
  12343. -extern void dz_serial_console_init(void);
  12344. -#endif
  12345. -
  12346. + if (!IOASIC)
  12347. + return unregister_dz_hook(channel);
  12348. #endif
  12349. + return 0;
  12350. +}
  12351. -/* rs_init - starts up the serial interface -
  12352. - handle normal case of starting up the serial interface */
  12353. -#ifdef CONFIG_SERIAL_DEC
  12354. +extern int zs_init(void);
  12355. +extern int dz_init(void);
  12356. +/*
  12357. + * rs_init - starts up the serial interface -
  12358. + * handle normal case of starting up the serial interface
  12359. + */
  12360. int __init rs_init(void)
  12361. {
  12362. -
  12363. -#if defined(CONFIG_ZS) && defined(CONFIG_DZ)
  12364. - if (IOASIC)
  12365. - return zs_init();
  12366. - else
  12367. - return dz_init();
  12368. -#else
  12369. -
  12370. #ifdef CONFIG_ZS
  12371. - return zs_init();
  12372. + if (IOASIC)
  12373. + return zs_init();
  12374. #endif
  12375. -
  12376. #ifdef CONFIG_DZ
  12377. - return dz_init();
  12378. -#endif
  12379. -
  12380. + if (!IOASIC)
  12381. + return dz_init();
  12382. #endif
  12383. + return -ENXIO;
  12384. }
  12385. __initcall(rs_init);
  12386. -#endif
  12387. #ifdef CONFIG_SERIAL_DEC_CONSOLE
  12388. -/* dec_serial_console_init handles the special case of starting
  12389. - * up the console on the serial port
  12390. +extern void zs_serial_console_init(void);
  12391. +extern void dz_serial_console_init(void);
  12392. +
  12393. +/*
  12394. + * dec_serial_console_init handles the special case of starting
  12395. + * up the console on the serial port
  12396. */
  12397. void __init dec_serial_console_init(void)
  12398. {
  12399. -#if defined(CONFIG_ZS) && defined(CONFIG_DZ)
  12400. - if (IOASIC)
  12401. - zs_serial_console_init();
  12402. - else
  12403. - dz_serial_console_init();
  12404. -#else
  12405. -
  12406. #ifdef CONFIG_ZS
  12407. - zs_serial_console_init();
  12408. + if (IOASIC)
  12409. + zs_serial_console_init();
  12410. #endif
  12411. -
  12412. #ifdef CONFIG_DZ
  12413. - dz_serial_console_init();
  12414. -#endif
  12415. -
  12416. + if (!IOASIC)
  12417. + dz_serial_console_init();
  12418. #endif
  12419. }
  12420. Index: linux-2.4.35.4/drivers/char/ds1286.c
  12421. ===================================================================
  12422. --- linux-2.4.35.4.orig/drivers/char/ds1286.c
  12423. +++ linux-2.4.35.4/drivers/char/ds1286.c
  12424. @@ -1,6 +1,10 @@
  12425. /*
  12426. * DS1286 Real Time Clock interface for Linux
  12427. *
  12428. + * Copyright (C) 2003 TimeSys Corp.
  12429. + * S. James Hill ([email protected])
  12430. + * ([email protected])
  12431. + *
  12432. * Copyright (C) 1998, 1999, 2000 Ralf Baechle
  12433. *
  12434. * Based on code written by Paul Gortmaker.
  12435. @@ -29,6 +33,7 @@
  12436. #include <linux/types.h>
  12437. #include <linux/errno.h>
  12438. #include <linux/miscdevice.h>
  12439. +#include <linux/module.h>
  12440. #include <linux/slab.h>
  12441. #include <linux/ioport.h>
  12442. #include <linux/fcntl.h>
  12443. @@ -95,6 +100,12 @@ static ssize_t ds1286_read(struct file *
  12444. return -EIO;
  12445. }
  12446. +void rtc_ds1286_wait(void)
  12447. +{
  12448. + unsigned char sec = CMOS_READ(RTC_SECONDS);
  12449. + while (sec == CMOS_READ(RTC_SECONDS));
  12450. +}
  12451. +
  12452. static int ds1286_ioctl(struct inode *inode, struct file *file,
  12453. unsigned int cmd, unsigned long arg)
  12454. {
  12455. @@ -249,23 +260,22 @@ static int ds1286_open(struct inode *ino
  12456. {
  12457. spin_lock_irq(&ds1286_lock);
  12458. - if (ds1286_status & RTC_IS_OPEN)
  12459. - goto out_busy;
  12460. + if (ds1286_status & RTC_IS_OPEN) {
  12461. + spin_unlock_irq(&ds1286_lock);
  12462. + return -EBUSY;
  12463. + }
  12464. ds1286_status |= RTC_IS_OPEN;
  12465. - spin_lock_irq(&ds1286_lock);
  12466. + spin_unlock_irq(&ds1286_lock);
  12467. return 0;
  12468. -
  12469. -out_busy:
  12470. - spin_lock_irq(&ds1286_lock);
  12471. - return -EBUSY;
  12472. }
  12473. static int ds1286_release(struct inode *inode, struct file *file)
  12474. {
  12475. + spin_lock_irq(&ds1286_lock);
  12476. ds1286_status &= ~RTC_IS_OPEN;
  12477. -
  12478. + spin_unlock_irq(&ds1286_lock);
  12479. return 0;
  12480. }
  12481. @@ -276,32 +286,6 @@ static unsigned int ds1286_poll(struct f
  12482. return 0;
  12483. }
  12484. -/*
  12485. - * The various file operations we support.
  12486. - */
  12487. -
  12488. -static struct file_operations ds1286_fops = {
  12489. - .llseek = no_llseek,
  12490. - .read = ds1286_read,
  12491. - .poll = ds1286_poll,
  12492. - .ioctl = ds1286_ioctl,
  12493. - .open = ds1286_open,
  12494. - .release = ds1286_release,
  12495. -};
  12496. -
  12497. -static struct miscdevice ds1286_dev=
  12498. -{
  12499. - .minor = RTC_MINOR,
  12500. - .name = "rtc",
  12501. - .fops = &ds1286_fops,
  12502. -};
  12503. -
  12504. -int __init ds1286_init(void)
  12505. -{
  12506. - printk(KERN_INFO "DS1286 Real Time Clock Driver v%s\n", DS1286_VERSION);
  12507. - return misc_register(&ds1286_dev);
  12508. -}
  12509. -
  12510. static char *days[] = {
  12511. "***", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
  12512. };
  12513. @@ -528,3 +512,38 @@ void ds1286_get_alm_time(struct rtc_time
  12514. BCD_TO_BIN(alm_tm->tm_hour);
  12515. alm_tm->tm_sec = 0;
  12516. }
  12517. +
  12518. +static struct file_operations ds1286_fops = {
  12519. + .owner = THIS_MODULE,
  12520. + .llseek = no_llseek,
  12521. + .read = ds1286_read,
  12522. + .poll = ds1286_poll,
  12523. + .ioctl = ds1286_ioctl,
  12524. + .open = ds1286_open,
  12525. + .release = ds1286_release,
  12526. +};
  12527. +
  12528. +static struct miscdevice ds1286_dev =
  12529. +{
  12530. + .minor = RTC_MINOR,
  12531. + .name = "rtc",
  12532. + .fops = &ds1286_fops,
  12533. +};
  12534. +
  12535. +static int __init ds1286_init(void)
  12536. +{
  12537. + printk(KERN_INFO "DS1286 Real Time Clock Driver v%s\n", DS1286_VERSION);
  12538. + return misc_register(&ds1286_dev);
  12539. +}
  12540. +
  12541. +static void __exit ds1286_exit(void)
  12542. +{
  12543. + misc_deregister(&ds1286_dev);
  12544. +}
  12545. +
  12546. +module_init(ds1286_init);
  12547. +module_exit(ds1286_exit);
  12548. +EXPORT_NO_SYMBOLS;
  12549. +
  12550. +MODULE_AUTHOR("Ralf Baechle");
  12551. +MODULE_LICENSE("GPL");
  12552. Index: linux-2.4.35.4/drivers/char/ds1742.c
  12553. ===================================================================
  12554. --- linux-2.4.35.4.orig/drivers/char/ds1742.c
  12555. +++ linux-2.4.35.4/drivers/char/ds1742.c
  12556. @@ -142,6 +142,7 @@ static int rtc_ds1742_set_time(unsigned
  12557. CMOS_WRITE(RTC_WRITE, RTC_CONTROL);
  12558. /* convert */
  12559. + memset(&tm, 0, sizeof(struct rtc_time));
  12560. to_tm(t, &tm);
  12561. /* check each field one by one */
  12562. @@ -216,6 +217,7 @@ static int get_ds1742_status(char *buf)
  12563. unsigned long curr_time;
  12564. curr_time = rtc_ds1742_get_time();
  12565. + memset(&tm, 0, sizeof(struct rtc_time));
  12566. to_tm(curr_time, &tm);
  12567. p = buf;
  12568. @@ -251,8 +253,8 @@ static int ds1742_read_proc(char *page,
  12569. void rtc_ds1742_wait(void)
  12570. {
  12571. - while (CMOS_READ(RTC_SECONDS) & 1);
  12572. - while (!(CMOS_READ(RTC_SECONDS) & 1));
  12573. + unsigned char sec = CMOS_READ(RTC_SECONDS);
  12574. + while (sec == CMOS_READ(RTC_SECONDS));
  12575. }
  12576. static int ds1742_ioctl(struct inode *inode, struct file *file,
  12577. @@ -264,6 +266,7 @@ static int ds1742_ioctl(struct inode *in
  12578. switch (cmd) {
  12579. case RTC_RD_TIME: /* Read the time/date from RTC */
  12580. curr_time = rtc_ds1742_get_time();
  12581. + memset(&rtc_tm, 0, sizeof(struct rtc_time));
  12582. to_tm(curr_time, &rtc_tm);
  12583. rtc_tm.tm_year -= 1900;
  12584. return copy_to_user((void *) arg, &rtc_tm, sizeof(rtc_tm)) ?
  12585. Index: linux-2.4.35.4/drivers/char/dummy_keyb.c
  12586. ===================================================================
  12587. --- linux-2.4.35.4.orig/drivers/char/dummy_keyb.c
  12588. +++ linux-2.4.35.4/drivers/char/dummy_keyb.c
  12589. @@ -141,3 +141,7 @@ void __init kbd_init_hw(void)
  12590. {
  12591. printk("Dummy keyboard driver installed.\n");
  12592. }
  12593. +#ifdef CONFIG_MAGIC_SYSRQ
  12594. +unsigned char kbd_sysrq_key;
  12595. +unsigned char kbd_sysrq_xlate[128];
  12596. +#endif
  12597. Index: linux-2.4.35.4/drivers/char/dz.c
  12598. ===================================================================
  12599. --- linux-2.4.35.4.orig/drivers/char/dz.c
  12600. +++ linux-2.4.35.4/drivers/char/dz.c
  12601. @@ -1,11 +1,13 @@
  12602. /*
  12603. - * dz.c: Serial port driver for DECStations equiped
  12604. + * dz.c: Serial port driver for DECstations equipped
  12605. * with the DZ chipset.
  12606. *
  12607. * Copyright (C) 1998 Olivier A. D. Lebaillif
  12608. *
  12609. * Email: [email protected]
  12610. *
  12611. + * Copyright (C) 2004 Maciej W. Rozycki
  12612. + *
  12613. * [31-AUG-98] triemer
  12614. * Changed IRQ to use Harald's dec internals interrupts.h
  12615. * removed base_addr code - moving address assignment to setup.c
  12616. @@ -24,6 +26,7 @@
  12617. #undef DEBUG_DZ
  12618. #include <linux/config.h>
  12619. +#include <linux/delay.h>
  12620. #include <linux/version.h>
  12621. #include <linux/kernel.h>
  12622. #include <linux/sched.h>
  12623. @@ -54,33 +57,56 @@
  12624. #include <asm/system.h>
  12625. #include <asm/uaccess.h>
  12626. -#define CONSOLE_LINE (3) /* for definition of struct console */
  12627. +#ifdef CONFIG_MAGIC_SYSRQ
  12628. +#include <linux/sysrq.h>
  12629. +#endif
  12630. #include "dz.h"
  12631. -#define DZ_INTR_DEBUG 1
  12632. -
  12633. DECLARE_TASK_QUEUE(tq_serial);
  12634. -static struct dz_serial *lines[4];
  12635. -static unsigned char tmp_buffer[256];
  12636. +static struct dz_serial multi[DZ_NB_PORT]; /* Four serial lines in the DZ chip */
  12637. +static struct tty_driver serial_driver, callout_driver;
  12638. +
  12639. +static struct tty_struct *serial_table[DZ_NB_PORT];
  12640. +static struct termios *serial_termios[DZ_NB_PORT];
  12641. +static struct termios *serial_termios_locked[DZ_NB_PORT];
  12642. +
  12643. +static int serial_refcount;
  12644. -#ifdef DEBUG_DZ
  12645. /*
  12646. - * debugging code to send out chars via prom
  12647. + * tmp_buf is used as a temporary buffer by serial_write. We need to
  12648. + * lock it in case the copy_from_user blocks while swapping in a page,
  12649. + * and some other program tries to do a serial write at the same time.
  12650. + * Since the lock will only come under contention when the system is
  12651. + * swapping and available memory is low, it makes sense to share one
  12652. + * buffer across all the serial ports, since it significantly saves
  12653. + * memory if large numbers of serial ports are open.
  12654. */
  12655. -static void debug_console(const char *s, int count)
  12656. -{
  12657. - unsigned i;
  12658. +static unsigned char *tmp_buf;
  12659. +static DECLARE_MUTEX(tmp_buf_sem);
  12660. - for (i = 0; i < count; i++) {
  12661. - if (*s == 10)
  12662. - prom_printf("%c", 13);
  12663. - prom_printf("%c", *s++);
  12664. - }
  12665. -}
  12666. +static char *dz_name __initdata = "DECstation DZ serial driver version ";
  12667. +static char *dz_version __initdata = "1.03";
  12668. +
  12669. +static struct dz_serial *lines[DZ_NB_PORT];
  12670. +static unsigned char tmp_buffer[256];
  12671. +
  12672. +#ifdef CONFIG_SERIAL_DEC_CONSOLE
  12673. +static struct console dz_sercons;
  12674. +#endif
  12675. +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
  12676. + !defined(MODULE)
  12677. +static unsigned long break_pressed; /* break, really ... */
  12678. #endif
  12679. +static void change_speed (struct dz_serial *);
  12680. +
  12681. +static int baud_table[] = {
  12682. + 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800,
  12683. + 9600, 0
  12684. +};
  12685. +
  12686. /*
  12687. * ------------------------------------------------------------
  12688. * dz_in () and dz_out ()
  12689. @@ -94,15 +120,16 @@ static inline unsigned short dz_in(struc
  12690. {
  12691. volatile unsigned short *addr =
  12692. (volatile unsigned short *) (info->port + offset);
  12693. +
  12694. return *addr;
  12695. }
  12696. static inline void dz_out(struct dz_serial *info, unsigned offset,
  12697. unsigned short value)
  12698. {
  12699. -
  12700. volatile unsigned short *addr =
  12701. (volatile unsigned short *) (info->port + offset);
  12702. +
  12703. *addr = value;
  12704. }
  12705. @@ -143,25 +170,24 @@ static void dz_start(struct tty_struct *
  12706. tmp |= mask; /* set the TX flag */
  12707. dz_out(info, DZ_TCR, tmp);
  12708. -
  12709. }
  12710. /*
  12711. * ------------------------------------------------------------
  12712. - * Here starts the interrupt handling routines. All of the
  12713. - * following subroutines are declared as inline and are folded
  12714. - * into dz_interrupt. They were separated out for readability's
  12715. - * sake.
  12716. *
  12717. - * Note: rs_interrupt() is a "fast" interrupt, which means that it
  12718. + * Here starts the interrupt handling routines. All of the following
  12719. + * subroutines are declared as inline and are folded into
  12720. + * dz_interrupt(). They were separated out for readability's sake.
  12721. + *
  12722. + * Note: dz_interrupt() is a "fast" interrupt, which means that it
  12723. * runs with interrupts turned off. People who may want to modify
  12724. - * rs_interrupt() should try to keep the interrupt handler as fast as
  12725. + * dz_interrupt() should try to keep the interrupt handler as fast as
  12726. * possible. After you are done making modifications, it is not a bad
  12727. * idea to do:
  12728. *
  12729. * gcc -S -DKERNEL -Wall -Wstrict-prototypes -O6 -fomit-frame-pointer dz.c
  12730. *
  12731. - * and look at the resulting assemble code in serial.s.
  12732. + * and look at the resulting assemble code in dz.s.
  12733. *
  12734. * ------------------------------------------------------------
  12735. */
  12736. @@ -188,101 +214,97 @@ static inline void dz_sched_event(struct
  12737. * This routine deals with inputs from any lines.
  12738. * ------------------------------------------------------------
  12739. */
  12740. -static inline void receive_chars(struct dz_serial *info_in)
  12741. +static inline void receive_chars(struct dz_serial *info_in,
  12742. + struct pt_regs *regs)
  12743. {
  12744. -
  12745. struct dz_serial *info;
  12746. - struct tty_struct *tty = 0;
  12747. + struct tty_struct *tty;
  12748. struct async_icount *icount;
  12749. - int ignore = 0;
  12750. - unsigned short status, tmp;
  12751. - unsigned char ch;
  12752. -
  12753. - /* this code is going to be a problem...
  12754. - the call to tty_flip_buffer is going to need
  12755. - to be rethought...
  12756. - */
  12757. - do {
  12758. - status = dz_in(info_in, DZ_RBUF);
  12759. - info = lines[LINE(status)];
  12760. + int lines_rx[DZ_NB_PORT] = { [0 ... DZ_NB_PORT - 1] = 0 };
  12761. + unsigned short status;
  12762. + unsigned char ch, flag;
  12763. + int i;
  12764. - /* punt so we don't get duplicate characters */
  12765. - if (!(status & DZ_DVAL))
  12766. - goto ignore_char;
  12767. -
  12768. - ch = UCHAR(status); /* grab the char */
  12769. -
  12770. -#if 0
  12771. - if (info->is_console) {
  12772. - if (ch == 0)
  12773. - return; /* it's a break ... */
  12774. - }
  12775. -#endif
  12776. + while ((status = dz_in(info_in, DZ_RBUF)) & DZ_DVAL) {
  12777. + info = lines[LINE(status)];
  12778. + tty = info->tty; /* point to the proper dev */
  12779. - tty = info->tty; /* now tty points to the proper dev */
  12780. - icount = &info->icount;
  12781. + ch = UCHAR(status); /* grab the char */
  12782. - if (!tty)
  12783. - break;
  12784. - if (tty->flip.count >= TTY_FLIPBUF_SIZE)
  12785. - break;
  12786. + if (!tty && (!info->hook || !info->hook->rx_char))
  12787. + continue;
  12788. - *tty->flip.char_buf_ptr = ch;
  12789. - *tty->flip.flag_buf_ptr = 0;
  12790. + icount = &info->icount;
  12791. icount->rx++;
  12792. - /* keep track of the statistics */
  12793. - if (status & (DZ_OERR | DZ_FERR | DZ_PERR)) {
  12794. - if (status & DZ_PERR) /* parity error */
  12795. - icount->parity++;
  12796. - else if (status & DZ_FERR) /* frame error */
  12797. - icount->frame++;
  12798. - if (status & DZ_OERR) /* overrun error */
  12799. - icount->overrun++;
  12800. -
  12801. - /* check to see if we should ignore the character
  12802. - and mask off conditions that should be ignored
  12803. + flag = 0;
  12804. + if (status & DZ_FERR) { /* frame error */
  12805. + /*
  12806. + * There is no separate BREAK status bit, so
  12807. + * treat framing errors as BREAKs for Magic SysRq
  12808. + * and SAK; normally, otherwise.
  12809. */
  12810. -
  12811. - if (status & info->ignore_status_mask) {
  12812. - if (++ignore > 100)
  12813. - break;
  12814. - goto ignore_char;
  12815. +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
  12816. + !defined(MODULE)
  12817. + if (info->line == dz_sercons.index) {
  12818. + if (!break_pressed)
  12819. + break_pressed = jiffies;
  12820. + continue;
  12821. }
  12822. - /* mask off the error conditions we want to ignore */
  12823. - tmp = status & info->read_status_mask;
  12824. -
  12825. - if (tmp & DZ_PERR) {
  12826. - *tty->flip.flag_buf_ptr = TTY_PARITY;
  12827. -#ifdef DEBUG_DZ
  12828. - debug_console("PERR\n", 5);
  12829. -#endif
  12830. - } else if (tmp & DZ_FERR) {
  12831. - *tty->flip.flag_buf_ptr = TTY_FRAME;
  12832. -#ifdef DEBUG_DZ
  12833. - debug_console("FERR\n", 5);
  12834. #endif
  12835. + flag = TTY_BREAK;
  12836. + if (info->flags & DZ_SAK)
  12837. + do_SAK(tty);
  12838. + else
  12839. + flag = TTY_FRAME;
  12840. + } else if (status & DZ_OERR) /* overrun error */
  12841. + flag = TTY_OVERRUN;
  12842. + else if (status & DZ_PERR) /* parity error */
  12843. + flag = TTY_PARITY;
  12844. +
  12845. +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
  12846. + !defined(MODULE)
  12847. + if (break_pressed && info->line == dz_sercons.index) {
  12848. + if (time_before(jiffies, break_pressed + HZ * 5)) {
  12849. + handle_sysrq(ch, regs, NULL, NULL);
  12850. + break_pressed = 0;
  12851. + continue;
  12852. }
  12853. - if (tmp & DZ_OERR) {
  12854. -#ifdef DEBUG_DZ
  12855. - debug_console("OERR\n", 5);
  12856. + break_pressed = 0;
  12857. + }
  12858. #endif
  12859. - if (tty->flip.count < TTY_FLIPBUF_SIZE) {
  12860. - tty->flip.count++;
  12861. - tty->flip.flag_buf_ptr++;
  12862. - tty->flip.char_buf_ptr++;
  12863. - *tty->flip.flag_buf_ptr = TTY_OVERRUN;
  12864. - }
  12865. - }
  12866. +
  12867. + if (info->hook && info->hook->rx_char) {
  12868. + (*info->hook->rx_char)(ch, flag);
  12869. + return;
  12870. }
  12871. - tty->flip.flag_buf_ptr++;
  12872. - tty->flip.char_buf_ptr++;
  12873. - tty->flip.count++;
  12874. - ignore_char:
  12875. - } while (status & DZ_DVAL);
  12876. - if (tty)
  12877. - tty_flip_buffer_push(tty);
  12878. + /* keep track of the statistics */
  12879. + switch (flag) {
  12880. + case TTY_FRAME:
  12881. + icount->frame++;
  12882. + break;
  12883. + case TTY_PARITY:
  12884. + icount->parity++;
  12885. + break;
  12886. + case TTY_OVERRUN:
  12887. + icount->overrun++;
  12888. + break;
  12889. + case TTY_BREAK:
  12890. + icount->brk++;
  12891. + break;
  12892. + default:
  12893. + break;
  12894. + }
  12895. +
  12896. + if ((status & info->ignore_status_mask) == 0) {
  12897. + tty_insert_flip_char(tty, ch, flag);
  12898. + lines_rx[LINE(status)] = 1;
  12899. + }
  12900. + }
  12901. + for (i = 0; i < DZ_NB_PORT; i++)
  12902. + if (lines_rx[i])
  12903. + tty_flip_buffer_push(lines[i]->tty);
  12904. }
  12905. /*
  12906. @@ -292,20 +314,34 @@ static inline void receive_chars(struct
  12907. * This routine deals with outputs to any lines.
  12908. * ------------------------------------------------------------
  12909. */
  12910. -static inline void transmit_chars(struct dz_serial *info)
  12911. +static inline void transmit_chars(struct dz_serial *info_in)
  12912. {
  12913. + struct dz_serial *info;
  12914. + unsigned short status;
  12915. unsigned char tmp;
  12916. + status = dz_in(info_in, DZ_CSR);
  12917. + info = lines[LINE(status)];
  12918. + if (info->hook || !info->tty) {
  12919. + unsigned short mask, tmp;
  12920. - if (info->x_char) { /* XON/XOFF chars */
  12921. + mask = 1 << info->line;
  12922. + tmp = dz_in(info, DZ_TCR); /* read the TX flag */
  12923. + tmp &= ~mask; /* clear the TX flag */
  12924. + dz_out(info, DZ_TCR, tmp);
  12925. + return;
  12926. + }
  12927. +
  12928. + if (info->x_char) { /* XON/XOFF chars */
  12929. dz_out(info, DZ_TDR, info->x_char);
  12930. info->icount.tx++;
  12931. info->x_char = 0;
  12932. return;
  12933. }
  12934. /* if nothing to do or stopped or hardware stopped */
  12935. - if ((info->xmit_cnt <= 0) || info->tty->stopped || info->tty->hw_stopped) {
  12936. + if (info->xmit_cnt <= 0 ||
  12937. + info->tty->stopped || info->tty->hw_stopped) {
  12938. dz_stop(info->tty);
  12939. return;
  12940. }
  12941. @@ -359,15 +395,14 @@ static inline void check_modem_status(st
  12942. */
  12943. static void dz_interrupt(int irq, void *dev, struct pt_regs *regs)
  12944. {
  12945. - struct dz_serial *info;
  12946. + struct dz_serial *info = (struct dz_serial *)dev;
  12947. unsigned short status;
  12948. /* get the reason why we just got an irq */
  12949. - status = dz_in((struct dz_serial *) dev, DZ_CSR);
  12950. - info = lines[LINE(status)]; /* re-arrange info the proper port */
  12951. + status = dz_in(info, DZ_CSR);
  12952. if (status & DZ_RDONE)
  12953. - receive_chars(info); /* the receive function */
  12954. + receive_chars(info, regs);
  12955. if (status & DZ_TRDY)
  12956. transmit_chars(info);
  12957. @@ -514,7 +549,7 @@ static void shutdown(struct dz_serial *i
  12958. info->cflags &= ~DZ_CREAD; /* turn off receive enable flag */
  12959. - dz_out(info, DZ_LPR, info->cflags);
  12960. + dz_out(info, DZ_LPR, info->cflags | info->line);
  12961. if (info->xmit_buf) { /* free Tx buffer */
  12962. free_page((unsigned long) info->xmit_buf);
  12963. @@ -545,18 +580,21 @@ static void change_speed(struct dz_seria
  12964. {
  12965. unsigned long flags;
  12966. unsigned cflag;
  12967. - int baud;
  12968. + int baud, i;
  12969. - if (!info->tty || !info->tty->termios)
  12970. - return;
  12971. + if (!info->hook) {
  12972. + if (!info->tty || !info->tty->termios)
  12973. + return;
  12974. + cflag = info->tty->termios->c_cflag;
  12975. + } else {
  12976. + cflag = info->hook->cflags;
  12977. + }
  12978. save_flags(flags);
  12979. cli();
  12980. info->cflags = info->line;
  12981. - cflag = info->tty->termios->c_cflag;
  12982. -
  12983. switch (cflag & CSIZE) {
  12984. case CS5:
  12985. info->cflags |= DZ_CS5;
  12986. @@ -579,7 +617,16 @@ static void change_speed(struct dz_seria
  12987. if (cflag & PARODD)
  12988. info->cflags |= DZ_PARODD;
  12989. - baud = tty_get_baud_rate(info->tty);
  12990. + i = cflag & CBAUD;
  12991. + if (i & CBAUDEX) {
  12992. + i &= ~CBAUDEX;
  12993. + if (!info->hook)
  12994. + info->tty->termios->c_cflag &= ~CBAUDEX;
  12995. + else
  12996. + info->hook->cflags &= ~CBAUDEX;
  12997. + }
  12998. + baud = baud_table[i];
  12999. +
  13000. switch (baud) {
  13001. case 50:
  13002. info->cflags |= DZ_B50;
  13003. @@ -629,16 +676,16 @@ static void change_speed(struct dz_seria
  13004. }
  13005. info->cflags |= DZ_RXENAB;
  13006. - dz_out(info, DZ_LPR, info->cflags);
  13007. + dz_out(info, DZ_LPR, info->cflags | info->line);
  13008. /* setup accept flag */
  13009. info->read_status_mask = DZ_OERR;
  13010. - if (I_INPCK(info->tty))
  13011. + if (info->tty && I_INPCK(info->tty))
  13012. info->read_status_mask |= (DZ_FERR | DZ_PERR);
  13013. /* characters to ignore */
  13014. info->ignore_status_mask = 0;
  13015. - if (I_IGNPAR(info->tty))
  13016. + if (info->tty && I_IGNPAR(info->tty))
  13017. info->ignore_status_mask |= (DZ_FERR | DZ_PERR);
  13018. restore_flags(flags);
  13019. @@ -694,7 +741,7 @@ static int dz_write(struct tty_struct *t
  13020. down(&tmp_buf_sem);
  13021. while (1) {
  13022. - c = MIN(count, MIN(DZ_XMIT_SIZE - info->xmit_cnt - 1, DZ_XMIT_SIZE - info->xmit_head));
  13023. + c = min(count, min(DZ_XMIT_SIZE - info->xmit_cnt - 1, DZ_XMIT_SIZE - info->xmit_head));
  13024. if (c <= 0)
  13025. break;
  13026. @@ -707,7 +754,7 @@ static int dz_write(struct tty_struct *t
  13027. save_flags(flags);
  13028. cli();
  13029. - c = MIN(c, MIN(DZ_XMIT_SIZE - info->xmit_cnt - 1, DZ_XMIT_SIZE - info->xmit_head));
  13030. + c = min(c, min(DZ_XMIT_SIZE - info->xmit_cnt - 1, DZ_XMIT_SIZE - info->xmit_head));
  13031. memcpy(info->xmit_buf + info->xmit_head, tmp_buf, c);
  13032. info->xmit_head = ((info->xmit_head + c) & (DZ_XMIT_SIZE - 1));
  13033. info->xmit_cnt += c;
  13034. @@ -727,7 +774,7 @@ static int dz_write(struct tty_struct *t
  13035. save_flags(flags);
  13036. cli();
  13037. - c = MIN(count, MIN(DZ_XMIT_SIZE - info->xmit_cnt - 1, DZ_XMIT_SIZE - info->xmit_head));
  13038. + c = min(count, min(DZ_XMIT_SIZE - info->xmit_cnt - 1, DZ_XMIT_SIZE - info->xmit_head));
  13039. if (c <= 0) {
  13040. restore_flags(flags);
  13041. break;
  13042. @@ -845,7 +892,7 @@ static void dz_send_xchar(struct tty_str
  13043. /*
  13044. * ------------------------------------------------------------
  13045. - * rs_ioctl () and friends
  13046. + * dz_ioctl () and friends
  13047. * ------------------------------------------------------------
  13048. */
  13049. static int get_serial_info(struct dz_serial *info,
  13050. @@ -958,6 +1005,9 @@ static int dz_ioctl(struct tty_struct *t
  13051. struct dz_serial *info = (struct dz_serial *) tty->driver_data;
  13052. int retval;
  13053. + if (info->hook)
  13054. + return -ENODEV;
  13055. +
  13056. if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
  13057. (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGWILD) &&
  13058. (cmd != TIOCSERSWILD) && (cmd != TIOCSERGSTRUCT)) {
  13059. @@ -1252,19 +1302,14 @@ static int dz_open(struct tty_struct *tt
  13060. int retval, line;
  13061. line = MINOR(tty->device) - tty->driver.minor_start;
  13062. -
  13063. - /* The dz lines for the mouse/keyboard must be
  13064. - * opened using their respective drivers.
  13065. - */
  13066. if ((line < 0) || (line >= DZ_NB_PORT))
  13067. return -ENODEV;
  13068. + info = lines[line];
  13069. - if ((line == DZ_KEYBOARD) || (line == DZ_MOUSE))
  13070. + if (info->hook)
  13071. return -ENODEV;
  13072. - info = lines[line];
  13073. info->count++;
  13074. -
  13075. tty->driver_data = info;
  13076. info->tty = tty;
  13077. @@ -1285,14 +1330,21 @@ static int dz_open(struct tty_struct *tt
  13078. else
  13079. *tty->termios = info->callout_termios;
  13080. change_speed(info);
  13081. -
  13082. }
  13083. +#ifdef CONFIG_SERIAL_DEC_CONSOLE
  13084. + if (dz_sercons.cflag && dz_sercons.index == line) {
  13085. + tty->termios->c_cflag = dz_sercons.cflag;
  13086. + dz_sercons.cflag = 0;
  13087. + change_speed(info);
  13088. + }
  13089. +#endif
  13090. +
  13091. info->session = current->session;
  13092. info->pgrp = current->pgrp;
  13093. return 0;
  13094. }
  13095. -static void show_serial_version(void)
  13096. +static void __init show_serial_version(void)
  13097. {
  13098. printk("%s%s\n", dz_name, dz_version);
  13099. }
  13100. @@ -1300,7 +1352,6 @@ static void show_serial_version(void)
  13101. int __init dz_init(void)
  13102. {
  13103. int i;
  13104. - long flags;
  13105. struct dz_serial *info;
  13106. /* Setup base handler, and timer table. */
  13107. @@ -1311,9 +1362,9 @@ int __init dz_init(void)
  13108. memset(&serial_driver, 0, sizeof(struct tty_driver));
  13109. serial_driver.magic = TTY_DRIVER_MAGIC;
  13110. #if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
  13111. - serial_driver.name = "ttyS";
  13112. -#else
  13113. serial_driver.name = "tts/%d";
  13114. +#else
  13115. + serial_driver.name = "ttyS";
  13116. #endif
  13117. serial_driver.major = TTY_MAJOR;
  13118. serial_driver.minor_start = 64;
  13119. @@ -1352,9 +1403,9 @@ int __init dz_init(void)
  13120. */
  13121. callout_driver = serial_driver;
  13122. #if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
  13123. - callout_driver.name = "cua";
  13124. -#else
  13125. callout_driver.name = "cua/%d";
  13126. +#else
  13127. + callout_driver.name = "cua";
  13128. #endif
  13129. callout_driver.major = TTYAUX_MAJOR;
  13130. callout_driver.subtype = SERIAL_TYPE_CALLOUT;
  13131. @@ -1363,25 +1414,27 @@ int __init dz_init(void)
  13132. panic("Couldn't register serial driver");
  13133. if (tty_register_driver(&callout_driver))
  13134. panic("Couldn't register callout driver");
  13135. - save_flags(flags);
  13136. - cli();
  13137. for (i = 0; i < DZ_NB_PORT; i++) {
  13138. info = &multi[i];
  13139. lines[i] = info;
  13140. - info->magic = SERIAL_MAGIC;
  13141. -
  13142. + info->tty = 0;
  13143. + info->x_char = 0;
  13144. if (mips_machtype == MACH_DS23100 ||
  13145. mips_machtype == MACH_DS5100)
  13146. info->port = (unsigned long) KN01_DZ11_BASE;
  13147. else
  13148. info->port = (unsigned long) KN02_DZ11_BASE;
  13149. -
  13150. info->line = i;
  13151. - info->tty = 0;
  13152. +
  13153. + if (info->hook && info->hook->init_info) {
  13154. + (*info->hook->init_info)(info);
  13155. + continue;
  13156. + }
  13157. +
  13158. + info->magic = SERIAL_MAGIC;
  13159. info->close_delay = 50;
  13160. info->closing_wait = 3000;
  13161. - info->x_char = 0;
  13162. info->event = 0;
  13163. info->count = 0;
  13164. info->blocked_open = 0;
  13165. @@ -1393,25 +1446,16 @@ int __init dz_init(void)
  13166. info->normal_termios = serial_driver.init_termios;
  13167. init_waitqueue_head(&info->open_wait);
  13168. init_waitqueue_head(&info->close_wait);
  13169. -
  13170. - /*
  13171. - * If we are pointing to address zero then punt - not correctly
  13172. - * set up in setup.c to handle this.
  13173. - */
  13174. - if (!info->port)
  13175. - return 0;
  13176. -
  13177. - printk("ttyS%02d at 0x%08x (irq = %d)\n", info->line,
  13178. - info->port, dec_interrupt[DEC_IRQ_DZ11]);
  13179. -
  13180. + printk("ttyS%02d at 0x%08x (irq = %d) is a DC7085 DZ\n",
  13181. + info->line, info->port, dec_interrupt[DEC_IRQ_DZ11]);
  13182. tty_register_devfs(&serial_driver, 0,
  13183. - serial_driver.minor_start + info->line);
  13184. + serial_driver.minor_start + info->line);
  13185. tty_register_devfs(&callout_driver, 0,
  13186. - callout_driver.minor_start + info->line);
  13187. + callout_driver.minor_start + info->line);
  13188. }
  13189. - /* reset the chip */
  13190. #ifndef CONFIG_SERIAL_DEC_CONSOLE
  13191. + /* reset the chip */
  13192. dz_out(info, DZ_CSR, DZ_CLR);
  13193. while (dz_in(info, DZ_CSR) & DZ_CLR);
  13194. iob();
  13195. @@ -1420,43 +1464,104 @@ int __init dz_init(void)
  13196. dz_out(info, DZ_CSR, DZ_MSE);
  13197. #endif
  13198. - /* order matters here... the trick is that flags
  13199. - is updated... in request_irq - to immediatedly obliterate
  13200. - it is unwise. */
  13201. - restore_flags(flags);
  13202. -
  13203. -
  13204. if (request_irq(dec_interrupt[DEC_IRQ_DZ11], dz_interrupt,
  13205. - SA_INTERRUPT, "DZ", lines[0]))
  13206. + 0, "DZ", lines[0]))
  13207. panic("Unable to register DZ interrupt");
  13208. + for (i = 0; i < DZ_NB_PORT; i++)
  13209. + if (lines[i]->hook) {
  13210. + startup(lines[i]);
  13211. + if (lines[i]->hook->init_channel)
  13212. + (*lines[i]->hook->init_channel)(lines[i]);
  13213. + }
  13214. +
  13215. return 0;
  13216. }
  13217. -#ifdef CONFIG_SERIAL_DEC_CONSOLE
  13218. -static void dz_console_put_char(unsigned char ch)
  13219. +/*
  13220. + * polling I/O routines
  13221. + */
  13222. +static int dz_poll_tx_char(void *handle, unsigned char ch)
  13223. {
  13224. unsigned long flags;
  13225. - int loops = 2500;
  13226. - unsigned short tmp = ch;
  13227. - /* this code sends stuff out to serial device - spinning its
  13228. - wheels and waiting. */
  13229. + struct dz_serial *info = handle;
  13230. + unsigned short csr, tcr, trdy, mask;
  13231. + int loops = 10000;
  13232. + int ret;
  13233. - /* force the issue - point it at lines[3] */
  13234. - dz_console = &multi[CONSOLE_LINE];
  13235. + local_irq_save(flags);
  13236. + csr = dz_in(info, DZ_CSR);
  13237. + dz_out(info, DZ_CSR, csr & ~DZ_TIE);
  13238. + tcr = dz_in(info, DZ_TCR);
  13239. + tcr |= 1 << info->line;
  13240. + mask = tcr;
  13241. + dz_out(info, DZ_TCR, mask);
  13242. + iob();
  13243. + local_irq_restore(flags);
  13244. - save_flags(flags);
  13245. - cli();
  13246. + while (loops--) {
  13247. + trdy = dz_in(info, DZ_CSR);
  13248. + if (!(trdy & DZ_TRDY))
  13249. + continue;
  13250. + trdy = (trdy & DZ_TLINE) >> 8;
  13251. + if (trdy == info->line)
  13252. + break;
  13253. + mask &= ~(1 << trdy);
  13254. + dz_out(info, DZ_TCR, mask);
  13255. + iob();
  13256. + udelay(2);
  13257. + }
  13258. + if (loops) {
  13259. + dz_out(info, DZ_TDR, ch);
  13260. + ret = 0;
  13261. + } else
  13262. + ret = -EAGAIN;
  13263. - /* spin our wheels */
  13264. - while (((dz_in(dz_console, DZ_CSR) & DZ_TRDY) != DZ_TRDY) && loops--);
  13265. + dz_out(info, DZ_TCR, tcr);
  13266. + dz_out(info, DZ_CSR, csr);
  13267. - /* Actually transmit the character. */
  13268. - dz_out(dz_console, DZ_TDR, tmp);
  13269. + return ret;
  13270. +}
  13271. - restore_flags(flags);
  13272. +static int dz_poll_rx_char(void *handle)
  13273. +{
  13274. + return -ENODEV;
  13275. +}
  13276. +
  13277. +int register_dz_hook(unsigned int channel, struct dec_serial_hook *hook)
  13278. +{
  13279. + struct dz_serial *info = multi + channel;
  13280. +
  13281. + if (info->hook) {
  13282. + printk("%s: line %d has already a hook registered\n",
  13283. + __FUNCTION__, channel);
  13284. +
  13285. + return 0;
  13286. + } else {
  13287. + hook->poll_rx_char = dz_poll_rx_char;
  13288. + hook->poll_tx_char = dz_poll_tx_char;
  13289. + info->hook = hook;
  13290. +
  13291. + return 1;
  13292. + }
  13293. +}
  13294. +
  13295. +int unregister_dz_hook(unsigned int channel)
  13296. +{
  13297. + struct dz_serial *info = &multi[channel];
  13298. +
  13299. + if (info->hook) {
  13300. + info->hook = NULL;
  13301. + return 1;
  13302. + } else {
  13303. + printk("%s: trying to unregister hook on line %d,"
  13304. + " but none is registered\n", __FUNCTION__, channel);
  13305. + return 0;
  13306. + }
  13307. }
  13308. +
  13309. +#ifdef CONFIG_SERIAL_DEC_CONSOLE
  13310. /*
  13311. * -------------------------------------------------------------------
  13312. * dz_console_print ()
  13313. @@ -1465,17 +1570,19 @@ static void dz_console_put_char(unsigned
  13314. * The console must be locked when we get here.
  13315. * -------------------------------------------------------------------
  13316. */
  13317. -static void dz_console_print(struct console *cons,
  13318. +static void dz_console_print(struct console *co,
  13319. const char *str,
  13320. unsigned int count)
  13321. {
  13322. + struct dz_serial *info = multi + co->index;
  13323. +
  13324. #ifdef DEBUG_DZ
  13325. prom_printf((char *) str);
  13326. #endif
  13327. while (count--) {
  13328. if (*str == '\n')
  13329. - dz_console_put_char('\r');
  13330. - dz_console_put_char(*str++);
  13331. + dz_poll_tx_char(info, '\r');
  13332. + dz_poll_tx_char(info, *str++);
  13333. }
  13334. }
  13335. @@ -1486,12 +1593,12 @@ static kdev_t dz_console_device(struct c
  13336. static int __init dz_console_setup(struct console *co, char *options)
  13337. {
  13338. + struct dz_serial *info = multi + co->index;
  13339. int baud = 9600;
  13340. int bits = 8;
  13341. int parity = 'n';
  13342. int cflag = CREAD | HUPCL | CLOCAL;
  13343. char *s;
  13344. - unsigned short mask, tmp;
  13345. if (options) {
  13346. baud = simple_strtoul(options, NULL, 10);
  13347. @@ -1542,44 +1649,31 @@ static int __init dz_console_setup(struc
  13348. }
  13349. co->cflag = cflag;
  13350. - /* TOFIX: force to console line */
  13351. - dz_console = &multi[CONSOLE_LINE];
  13352. if ((mips_machtype == MACH_DS23100) || (mips_machtype == MACH_DS5100))
  13353. - dz_console->port = KN01_DZ11_BASE;
  13354. + info->port = KN01_DZ11_BASE;
  13355. else
  13356. - dz_console->port = KN02_DZ11_BASE;
  13357. - dz_console->line = CONSOLE_LINE;
  13358. + info->port = KN02_DZ11_BASE;
  13359. + info->line = co->index;
  13360. - dz_out(dz_console, DZ_CSR, DZ_CLR);
  13361. - while ((tmp = dz_in(dz_console, DZ_CSR)) & DZ_CLR);
  13362. + dz_out(info, DZ_CSR, DZ_CLR);
  13363. + while (dz_in(info, DZ_CSR) & DZ_CLR);
  13364. /* enable scanning */
  13365. - dz_out(dz_console, DZ_CSR, DZ_MSE);
  13366. + dz_out(info, DZ_CSR, DZ_MSE);
  13367. /* Set up flags... */
  13368. - dz_console->cflags = 0;
  13369. - dz_console->cflags |= DZ_B9600;
  13370. - dz_console->cflags |= DZ_CS8;
  13371. - dz_console->cflags |= DZ_PARENB;
  13372. - dz_out(dz_console, DZ_LPR, dz_console->cflags);
  13373. -
  13374. - mask = 1 << dz_console->line;
  13375. - tmp = dz_in(dz_console, DZ_TCR); /* read the TX flag */
  13376. - if (!(tmp & mask)) {
  13377. - tmp |= mask; /* set the TX flag */
  13378. - dz_out(dz_console, DZ_TCR, tmp);
  13379. - }
  13380. + dz_out(info, DZ_LPR, cflag | info->line);
  13381. +
  13382. return 0;
  13383. }
  13384. -static struct console dz_sercons =
  13385. -{
  13386. - .name = "ttyS",
  13387. - .write = dz_console_print,
  13388. - .device = dz_console_device,
  13389. - .setup = dz_console_setup,
  13390. - .flags = CON_CONSDEV | CON_PRINTBUFFER,
  13391. - .index = CONSOLE_LINE,
  13392. +static struct console dz_sercons = {
  13393. + .name = "ttyS",
  13394. + .write = dz_console_print,
  13395. + .device = dz_console_device,
  13396. + .setup = dz_console_setup,
  13397. + .flags = CON_PRINTBUFFER,
  13398. + .index = -1,
  13399. };
  13400. void __init dz_serial_console_init(void)
  13401. Index: linux-2.4.35.4/drivers/char/dz.h
  13402. ===================================================================
  13403. --- linux-2.4.35.4.orig/drivers/char/dz.h
  13404. +++ linux-2.4.35.4/drivers/char/dz.h
  13405. @@ -10,6 +10,8 @@
  13406. #ifndef DZ_SERIAL_H
  13407. #define DZ_SERIAL_H
  13408. +#include <asm/dec/serial.h>
  13409. +
  13410. #define SERIAL_MAGIC 0x5301
  13411. /*
  13412. @@ -17,6 +19,7 @@
  13413. */
  13414. #define DZ_TRDY 0x8000 /* Transmitter empty */
  13415. #define DZ_TIE 0x4000 /* Transmitter Interrupt Enable */
  13416. +#define DZ_TLINE 0x0300 /* Transmitter Line Number */
  13417. #define DZ_RDONE 0x0080 /* Receiver data ready */
  13418. #define DZ_RIE 0x0040 /* Receive Interrupt Enable */
  13419. #define DZ_MSE 0x0020 /* Master Scan Enable */
  13420. @@ -37,19 +40,30 @@
  13421. #define UCHAR(x) (unsigned char)(x & DZ_RBUF_MASK)
  13422. /*
  13423. - * Definitions for the Transmit Register.
  13424. + * Definitions for the Transmit Control Register.
  13425. */
  13426. #define DZ_LINE_KEYBOARD 0x0001
  13427. #define DZ_LINE_MOUSE 0x0002
  13428. #define DZ_LINE_MODEM 0x0004
  13429. #define DZ_LINE_PRINTER 0x0008
  13430. +#define DZ_MODEM_RTS 0x0800 /* RTS for the modem line (2) */
  13431. #define DZ_MODEM_DTR 0x0400 /* DTR for the modem line (2) */
  13432. +#define DZ_PRINT_RTS 0x0200 /* RTS for the printer line (3) */
  13433. +#define DZ_PRINT_DTR 0x0100 /* DTR for the printer line (3) */
  13434. +#define DZ_LNENB 0x000f /* Transmitter Line Enable */
  13435. /*
  13436. * Definitions for the Modem Status Register.
  13437. */
  13438. +#define DZ_MODEM_RI 0x0800 /* RI for the modem line (2) */
  13439. +#define DZ_MODEM_CD 0x0400 /* CD for the modem line (2) */
  13440. #define DZ_MODEM_DSR 0x0200 /* DSR for the modem line (2) */
  13441. +#define DZ_MODEM_CTS 0x0100 /* CTS for the modem line (2) */
  13442. +#define DZ_PRINT_RI 0x0008 /* RI for the printer line (2) */
  13443. +#define DZ_PRINT_CD 0x0004 /* CD for the printer line (2) */
  13444. +#define DZ_PRINT_DSR 0x0002 /* DSR for the printer line (2) */
  13445. +#define DZ_PRINT_CTS 0x0001 /* CTS for the printer line (2) */
  13446. /*
  13447. * Definitions for the Transmit Data Register.
  13448. @@ -115,9 +129,6 @@
  13449. #define DZ_EVENT_WRITE_WAKEUP 0
  13450. -#ifndef MIN
  13451. -#define MIN(a,b) ((a) < (b) ? (a) : (b))
  13452. -
  13453. #define DZ_INITIALIZED 0x80000000 /* Serial port was initialized */
  13454. #define DZ_CALLOUT_ACTIVE 0x40000000 /* Call out device is active */
  13455. #define DZ_NORMAL_ACTIVE 0x20000000 /* Normal device is active */
  13456. @@ -129,6 +140,7 @@
  13457. #define DZ_CLOSING_WAIT_INF 0
  13458. #define DZ_CLOSING_WAIT_NONE 65535
  13459. +#define DZ_SAK 0x0004 /* Secure Attention Key (Orange book) */
  13460. #define DZ_SPLIT_TERMIOS 0x0008 /* Separate termios for dialin/callout */
  13461. #define DZ_SESSION_LOCKOUT 0x0100 /* Lock out cua opens based on session */
  13462. #define DZ_PGRP_LOCKOUT 0x0200 /* Lock out cua opens based on pgrp */
  13463. @@ -166,79 +178,9 @@ struct dz_serial {
  13464. long session; /* Session of opening process */
  13465. long pgrp; /* pgrp of opening process */
  13466. + struct dec_serial_hook *hook; /* Hook on this channel. */
  13467. unsigned char is_console; /* flag indicating a serial console */
  13468. unsigned char is_initialized;
  13469. };
  13470. -static struct dz_serial multi[DZ_NB_PORT]; /* Four serial lines in the DZ chip */
  13471. -static struct dz_serial *dz_console;
  13472. -static struct tty_driver serial_driver, callout_driver;
  13473. -
  13474. -static struct tty_struct *serial_table[DZ_NB_PORT];
  13475. -static struct termios *serial_termios[DZ_NB_PORT];
  13476. -static struct termios *serial_termios_locked[DZ_NB_PORT];
  13477. -
  13478. -static int serial_refcount;
  13479. -
  13480. -/*
  13481. - * tmp_buf is used as a temporary buffer by serial_write. We need to
  13482. - * lock it in case the copy_from_user blocks while swapping in a page,
  13483. - * and some other program tries to do a serial write at the same time.
  13484. - * Since the lock will only come under contention when the system is
  13485. - * swapping and available memory is low, it makes sense to share one
  13486. - * buffer across all the serial ports, since it significantly saves
  13487. - * memory if large numbers of serial ports are open.
  13488. - */
  13489. -static unsigned char *tmp_buf;
  13490. -static DECLARE_MUTEX(tmp_buf_sem);
  13491. -
  13492. -static char *dz_name = "DECstation DZ serial driver version ";
  13493. -static char *dz_version = "1.02";
  13494. -
  13495. -static inline unsigned short dz_in (struct dz_serial *, unsigned);
  13496. -static inline void dz_out (struct dz_serial *, unsigned, unsigned short);
  13497. -
  13498. -static inline void dz_sched_event (struct dz_serial *, int);
  13499. -static inline void receive_chars (struct dz_serial *);
  13500. -static inline void transmit_chars (struct dz_serial *);
  13501. -static inline void check_modem_status (struct dz_serial *);
  13502. -
  13503. -static void dz_stop (struct tty_struct *);
  13504. -static void dz_start (struct tty_struct *);
  13505. -static void dz_interrupt (int, void *, struct pt_regs *);
  13506. -static void do_serial_bh (void);
  13507. -static void do_softint (void *);
  13508. -static void do_serial_hangup (void *);
  13509. -static void change_speed (struct dz_serial *);
  13510. -static void dz_flush_chars (struct tty_struct *);
  13511. -static void dz_console_print (struct console *, const char *, unsigned int);
  13512. -static void dz_flush_buffer (struct tty_struct *);
  13513. -static void dz_throttle (struct tty_struct *);
  13514. -static void dz_unthrottle (struct tty_struct *);
  13515. -static void dz_send_xchar (struct tty_struct *, char);
  13516. -static void shutdown (struct dz_serial *);
  13517. -static void send_break (struct dz_serial *, int);
  13518. -static void dz_set_termios (struct tty_struct *, struct termios *);
  13519. -static void dz_close (struct tty_struct *, struct file *);
  13520. -static void dz_hangup (struct tty_struct *);
  13521. -static void show_serial_version (void);
  13522. -
  13523. -static int dz_write (struct tty_struct *, int, const unsigned char *, int);
  13524. -static int dz_write_room (struct tty_struct *);
  13525. -static int dz_chars_in_buffer (struct tty_struct *);
  13526. -static int startup (struct dz_serial *);
  13527. -static int get_serial_info (struct dz_serial *, struct serial_struct *);
  13528. -static int set_serial_info (struct dz_serial *, struct serial_struct *);
  13529. -static int get_lsr_info (struct dz_serial *, unsigned int *);
  13530. -static int dz_ioctl (struct tty_struct *, struct file *, unsigned int, unsigned long);
  13531. -static int block_til_ready (struct tty_struct *, struct file *, struct dz_serial *);
  13532. -static int dz_open (struct tty_struct *, struct file *);
  13533. -
  13534. -#ifdef MODULE
  13535. -int init_module (void)
  13536. -void cleanup_module (void)
  13537. -#endif
  13538. -
  13539. -#endif
  13540. -
  13541. #endif /* DZ_SERIAL_H */
  13542. Index: linux-2.4.35.4/drivers/char/ibm_workpad_keymap.map
  13543. ===================================================================
  13544. --- /dev/null
  13545. +++ linux-2.4.35.4/drivers/char/ibm_workpad_keymap.map
  13546. @@ -0,0 +1,343 @@
  13547. +# Keymap for IBM Workpad z50
  13548. +# US Mapping
  13549. +#
  13550. +# by Michael Klar <[email protected]>
  13551. +#
  13552. +# This is a great big mess on account of how the Caps Lock key is handled as
  13553. +# LeftShift-RightShift. Right shift key had to be broken out, so don't use
  13554. +# use this map file as a basis for other keyboards that don't do the same
  13555. +# thing with Caps Lock.
  13556. +#
  13557. +# This file is subject to the terms and conditions of the GNU General Public
  13558. +# License. See the file "COPYING" in the main directory of this archive
  13559. +# for more details.
  13560. +
  13561. +keymaps 0-2,4-5,8,12,32-33,36-37
  13562. +strings as usual
  13563. +
  13564. +keycode 0 = F1 F11 Console_13
  13565. + shiftr keycode 0 = F11
  13566. + shift shiftr keycode 0 = F11
  13567. + control keycode 0 = F1
  13568. + alt keycode 0 = Console_1
  13569. + control alt keycode 0 = Console_1
  13570. +keycode 1 = F3 F13 Console_15
  13571. + shiftr keycode 1 = F13
  13572. + shift shiftr keycode 1 = F13
  13573. + control keycode 1 = F3
  13574. + alt keycode 1 = Console_3
  13575. + control alt keycode 1 = Console_3
  13576. +keycode 2 = F5 F15 Console_17
  13577. + shiftr keycode 2 = F15
  13578. + shift shiftr keycode 2 = F15
  13579. + control keycode 2 = F5
  13580. + alt keycode 2 = Console_5
  13581. + control alt keycode 2 = Console_5
  13582. +keycode 3 = F7 F17 Console_19
  13583. + shiftr keycode 3 = F17
  13584. + shift shiftr keycode 3 = F17
  13585. + control keycode 3 = F7
  13586. + alt keycode 3 = Console_7
  13587. + control alt keycode 3 = Console_7
  13588. +keycode 4 = F9 F19 Console_21
  13589. + shiftr keycode 4 = F19
  13590. + shift shiftr keycode 4 = F19
  13591. + control keycode 4 = F9
  13592. + alt keycode 4 = Console_9
  13593. + control alt keycode 4 = Console_9
  13594. +#keycode 5 is contrast down
  13595. +#keycode 6 is contrast up
  13596. +keycode 7 = F11 F11 Console_23
  13597. + shiftr keycode 7 = F11
  13598. + shift shiftr keycode 7 = F11
  13599. + control keycode 7 = F11
  13600. + alt keycode 7 = Console_11
  13601. + control alt keycode 7 = Console_11
  13602. +keycode 8 = F2 F12 Console_14
  13603. + shiftr keycode 8 = F12
  13604. + shift shiftr keycode 8 = F12
  13605. + control keycode 8 = F2
  13606. + alt keycode 8 = Console_2
  13607. + control alt keycode 8 = Console_2
  13608. +keycode 9 = F4 F14 Console_16
  13609. + shiftr keycode 9 = F14
  13610. + shift shiftr keycode 9 = F14
  13611. + control keycode 9 = F4
  13612. + alt keycode 9 = Console_4
  13613. + control alt keycode 9 = Console_4
  13614. +keycode 10 = F6 F16 Console_18
  13615. + shiftr keycode 10 = F16
  13616. + shift shiftr keycode 10 = F16
  13617. + control keycode 10 = F6
  13618. + alt keycode 10 = Console_6
  13619. + control alt keycode 10 = Console_6
  13620. +keycode 11 = F8 F18 Console_20
  13621. + shiftr keycode 11 = F18
  13622. + shift shiftr keycode 11 = F18
  13623. + control keycode 11 = F8
  13624. + alt keycode 11 = Console_8
  13625. + control alt keycode 11 = Console_8
  13626. +keycode 12 = F10 F20 Console_22
  13627. + shiftr keycode 12 = F20
  13628. + shift shiftr keycode 12 = F20
  13629. + control keycode 12 = F10
  13630. + alt keycode 12 = Console_10
  13631. + control alt keycode 12 = Console_10
  13632. +#keycode 13 is brightness down
  13633. +#keycode 14 is brightness up
  13634. +keycode 15 = F12 F12 Console_24
  13635. + shiftr keycode 15 = F12
  13636. + shift shiftr keycode 15 = F12
  13637. + control keycode 15 = F12
  13638. + alt keycode 15 = Console_12
  13639. + control alt keycode 15 = Console_12
  13640. +keycode 16 = apostrophe quotedbl
  13641. + shiftr keycode 16 = quotedbl
  13642. + shift shiftr keycode 16 = quotedbl
  13643. + control keycode 16 = Control_g
  13644. + alt keycode 16 = Meta_apostrophe
  13645. +keycode 17 = bracketleft braceleft
  13646. + shiftr keycode 17 = braceleft
  13647. + shift shiftr keycode 17 = braceleft
  13648. + control keycode 17 = Escape
  13649. + alt keycode 17 = Meta_bracketleft
  13650. +keycode 18 = minus underscore backslash
  13651. + shiftr keycode 18 = underscore
  13652. + shift shiftr keycode 18 = underscore
  13653. + control keycode 18 = Control_underscore
  13654. + shift control keycode 18 = Control_underscore
  13655. + shiftr control keycode 18 = Control_underscore
  13656. + shift shiftr control keycode 18 = Control_underscore
  13657. + alt keycode 18 = Meta_minus
  13658. +keycode 19 = zero parenright braceright
  13659. + shiftr keycode 19 = parenright
  13660. + shift shiftr keycode 19 = parenright
  13661. + alt keycode 19 = Meta_zero
  13662. +keycode 20 = p
  13663. + shiftr keycode 20 = +P
  13664. + shift shiftr keycode 20 = +p
  13665. +keycode 21 = semicolon colon
  13666. + shiftr keycode 21 = colon
  13667. + shift shiftr keycode 21 = colon
  13668. + alt keycode 21 = Meta_semicolon
  13669. +keycode 22 = Up Scroll_Backward
  13670. + shiftr keycode 22 = Scroll_Backward
  13671. + shift shiftr keycode 22 = Scroll_Backward
  13672. + alt keycode 22 = Prior
  13673. +keycode 23 = slash question
  13674. + shiftr keycode 23 = question
  13675. + shift shiftr keycode 23 = question
  13676. + control keycode 23 = Delete
  13677. + alt keycode 23 = Meta_slash
  13678. +
  13679. +keycode 27 = nine parenleft bracketright
  13680. + shiftr keycode 27 = parenleft
  13681. + shift shiftr keycode 27 = parenleft
  13682. + alt keycode 27 = Meta_nine
  13683. +keycode 28 = o
  13684. + shiftr keycode 28 = +O
  13685. + shift shiftr keycode 28 = +o
  13686. +keycode 29 = l
  13687. + shiftr keycode 29 = +L
  13688. + shift shiftr keycode 29 = +l
  13689. +keycode 30 = period greater
  13690. + shiftr keycode 30 = greater
  13691. + shift shiftr keycode 30 = greater
  13692. + control keycode 30 = Compose
  13693. + alt keycode 30 = Meta_period
  13694. +
  13695. +keycode 32 = Left Decr_Console
  13696. + shiftr keycode 32 = Decr_Console
  13697. + shift shiftr keycode 32 = Decr_Console
  13698. + alt keycode 32 = Home
  13699. +keycode 33 = bracketright braceright asciitilde
  13700. + shiftr keycode 33 = braceright
  13701. + shift shiftr keycode 33 = braceright
  13702. + control keycode 33 = Control_bracketright
  13703. + alt keycode 33 = Meta_bracketright
  13704. +keycode 34 = equal plus
  13705. + shiftr keycode 34 = plus
  13706. + shift shiftr keycode 34 = plus
  13707. + alt keycode 34 = Meta_equal
  13708. +keycode 35 = eight asterisk bracketleft
  13709. + shiftr keycode 35 = asterisk
  13710. + shift shiftr keycode 35 = asterisk
  13711. + control keycode 35 = Delete
  13712. + alt keycode 35 = Meta_eight
  13713. +keycode 36 = i
  13714. + shiftr keycode 36 = +I
  13715. + shift shiftr keycode 36 = +i
  13716. +keycode 37 = k
  13717. + shiftr keycode 37 = +K
  13718. + shift shiftr keycode 37 = +k
  13719. +keycode 38 = comma less
  13720. + shiftr keycode 38 = less
  13721. + shift shiftr keycode 38 = less
  13722. + alt keycode 38 = Meta_comma
  13723. +
  13724. +keycode 40 = h
  13725. + shiftr keycode 40 = +H
  13726. + shift shiftr keycode 40 = +h
  13727. +keycode 41 = y
  13728. + shiftr keycode 41 = +Y
  13729. + shift shiftr keycode 41 = +y
  13730. +keycode 42 = six asciicircum
  13731. + shiftr keycode 42 = asciicircum
  13732. + shift shiftr keycode 42 = asciicircum
  13733. + control keycode 42 = Control_asciicircum
  13734. + alt keycode 42 = Meta_six
  13735. +keycode 43 = seven ampersand braceleft
  13736. + shiftr keycode 43 = ampersand
  13737. + shift shiftr keycode 43 = ampersand
  13738. + control keycode 43 = Control_underscore
  13739. + alt keycode 43 = Meta_seven
  13740. +keycode 44 = u
  13741. + shiftr keycode 44 = +U
  13742. + shift shiftr keycode 44 = +u
  13743. +keycode 45 = j
  13744. + shiftr keycode 45 = +J
  13745. + shift shiftr keycode 45 = +j
  13746. +keycode 46 = m
  13747. + shiftr keycode 46 = +M
  13748. + shift shiftr keycode 46 = +m
  13749. +keycode 47 = n
  13750. + shiftr keycode 47 = +N
  13751. + shift shiftr keycode 47 = +n
  13752. +
  13753. +# This is the "Backspace" key:
  13754. +keycode 49 = Delete Delete
  13755. + shiftr keycode 49 = Delete
  13756. + shift shiftr keycode 49 = Delete
  13757. + control keycode 49 = BackSpace
  13758. + alt keycode 49 = Meta_Delete
  13759. +keycode 50 = Num_Lock
  13760. + shift keycode 50 = Bare_Num_Lock
  13761. + shiftr keycode 50 = Bare_Num_Lock
  13762. + shift shiftr keycode 50 = Bare_Num_Lock
  13763. +# This is the "Delete" key:
  13764. +keycode 51 = Remove
  13765. + control alt keycode 51 = Boot
  13766. +
  13767. +keycode 53 = backslash bar
  13768. + shiftr keycode 53 = bar
  13769. + shift shiftr keycode 53 = bar
  13770. + control keycode 53 = Control_backslash
  13771. + alt keycode 53 = Meta_backslash
  13772. +keycode 54 = Return
  13773. + alt keycode 54 = Meta_Control_m
  13774. +keycode 55 = space space
  13775. + shiftr keycode 55 = space
  13776. + shift shiftr keycode 55 = space
  13777. + control keycode 55 = nul
  13778. + alt keycode 55 = Meta_space
  13779. +keycode 56 = g
  13780. + shiftr keycode 56 = +G
  13781. + shift shiftr keycode 56 = +g
  13782. +keycode 57 = t
  13783. + shiftr keycode 57 = +T
  13784. + shift shiftr keycode 57 = +t
  13785. +keycode 58 = five percent
  13786. + shiftr keycode 58 = percent
  13787. + shift shiftr keycode 58 = percent
  13788. + control keycode 58 = Control_bracketright
  13789. + alt keycode 58 = Meta_five
  13790. +keycode 59 = four dollar dollar
  13791. + shiftr keycode 59 = dollar
  13792. + shift shiftr keycode 59 = dollar
  13793. + control keycode 59 = Control_backslash
  13794. + alt keycode 59 = Meta_four
  13795. +keycode 60 = r
  13796. + shiftr keycode 60 = +R
  13797. + shift shiftr keycode 60 = +r
  13798. +keycode 61 = f
  13799. + shiftr keycode 61 = +F
  13800. + shift shiftr keycode 61 = +f
  13801. + altgr keycode 61 = Hex_F
  13802. +keycode 62 = v
  13803. + shiftr keycode 62 = +V
  13804. + shift shiftr keycode 62 = +v
  13805. +keycode 63 = b
  13806. + shiftr keycode 63 = +B
  13807. + shift shiftr keycode 63 = +b
  13808. + altgr keycode 63 = Hex_B
  13809. +
  13810. +keycode 67 = three numbersign
  13811. + shiftr keycode 67 = numbersign
  13812. + shift shiftr keycode 67 = numbersign
  13813. + control keycode 67 = Escape
  13814. + alt keycode 67 = Meta_three
  13815. +keycode 68 = e
  13816. + shiftr keycode 68 = +E
  13817. + shift shiftr keycode 68 = +e
  13818. + altgr keycode 68 = Hex_E
  13819. +keycode 69 = d
  13820. + shiftr keycode 69 = +D
  13821. + shift shiftr keycode 69 = +d
  13822. + altgr keycode 69 = Hex_D
  13823. +keycode 70 = c
  13824. + shiftr keycode 70 = +C
  13825. + shift shiftr keycode 70 = +c
  13826. + altgr keycode 70 = Hex_C
  13827. +keycode 71 = Right Incr_Console
  13828. + shiftr keycode 71 = Incr_Console
  13829. + shift shiftr keycode 71 = Incr_Console
  13830. + alt keycode 71 = End
  13831. +
  13832. +keycode 75 = two at at
  13833. + shiftr keycode 75 = at
  13834. + shift shiftr keycode 75 = at
  13835. + control keycode 75 = nul
  13836. + shift control keycode 75 = nul
  13837. + shiftr control keycode 75 = nul
  13838. + shift shiftr control keycode 75 = nul
  13839. + alt keycode 75 = Meta_two
  13840. +keycode 76 = w
  13841. + shiftr keycode 76 = +W
  13842. + shift shiftr keycode 76 = +w
  13843. +keycode 77 = s
  13844. + shiftr keycode 77 = +S
  13845. + shift shiftr keycode 77 = +s
  13846. +keycode 78 = x
  13847. + shiftr keycode 78 = +X
  13848. + shift shiftr keycode 78 = +x
  13849. +keycode 79 = Down Scroll_Forward
  13850. + shiftr keycode 79 = Scroll_Forward
  13851. + shift shiftr keycode 79 = Scroll_Forward
  13852. + alt keycode 79 = Next
  13853. +keycode 80 = Escape Escape
  13854. + shiftr keycode 80 = Escape
  13855. + shift shiftr keycode 80 = Escape
  13856. + alt keycode 80 = Meta_Escape
  13857. +keycode 81 = Tab Tab
  13858. + shiftr keycode 81 = Tab
  13859. + shift shiftr keycode 81 = Tab
  13860. + alt keycode 81 = Meta_Tab
  13861. +keycode 82 = grave asciitilde
  13862. + shiftr keycode 82 = asciitilde
  13863. + shift shiftr keycode 82 = asciitilde
  13864. + control keycode 82 = nul
  13865. + alt keycode 82 = Meta_grave
  13866. +keycode 83 = one exclam
  13867. + shiftr keycode 83 = exclam
  13868. + shift shiftr keycode 83 = exclam
  13869. + alt keycode 83 = Meta_one
  13870. +keycode 84 = q
  13871. + shiftr keycode 84 = +Q
  13872. + shift shiftr keycode 84 = +q
  13873. +keycode 85 = a
  13874. + shiftr keycode 85 = +A
  13875. + shift shiftr keycode 85 = +a
  13876. + altgr keycode 85 = Hex_A
  13877. +keycode 86 = z
  13878. + shiftr keycode 86 = +Z
  13879. + shift shiftr keycode 86 = +z
  13880. +
  13881. +# This is the windows key:
  13882. +keycode 88 = Decr_Console
  13883. +keycode 89 = Shift
  13884. +keycode 90 = Control
  13885. +keycode 91 = Control
  13886. +keycode 92 = Alt
  13887. +keycode 93 = AltGr
  13888. +keycode 94 = ShiftR
  13889. + shift keycode 94 = Caps_Lock
  13890. Index: linux-2.4.35.4/drivers/char/indydog.c
  13891. ===================================================================
  13892. --- linux-2.4.35.4.orig/drivers/char/indydog.c
  13893. +++ linux-2.4.35.4/drivers/char/indydog.c
  13894. @@ -1,5 +1,5 @@
  13895. /*
  13896. - * IndyDog 0.2 A Hardware Watchdog Device for SGI IP22
  13897. + * IndyDog 0.3 A Hardware Watchdog Device for SGI IP22
  13898. *
  13899. * (c) Copyright 2002 Guido Guenther <[email protected]>, All Rights Reserved.
  13900. *
  13901. @@ -7,10 +7,10 @@
  13902. * modify it under the terms of the GNU General Public License
  13903. * as published by the Free Software Foundation; either version
  13904. * 2 of the License, or (at your option) any later version.
  13905. - *
  13906. + *
  13907. * based on softdog.c by Alan Cox <[email protected]>
  13908. */
  13909. -
  13910. +
  13911. #include <linux/module.h>
  13912. #include <linux/config.h>
  13913. #include <linux/types.h>
  13914. @@ -19,13 +19,12 @@
  13915. #include <linux/mm.h>
  13916. #include <linux/miscdevice.h>
  13917. #include <linux/watchdog.h>
  13918. -#include <linux/smp_lock.h>
  13919. #include <linux/init.h>
  13920. #include <asm/uaccess.h>
  13921. #include <asm/sgi/mc.h>
  13922. -static unsigned long indydog_alive;
  13923. -static int expect_close = 0;
  13924. +#define PFX "indydog: "
  13925. +static int indydog_alive;
  13926. #ifdef CONFIG_WATCHDOG_NOWAYOUT
  13927. static int nowayout = 1;
  13928. @@ -33,10 +32,30 @@ static int nowayout = 1;
  13929. static int nowayout = 0;
  13930. #endif
  13931. +#define WATCHDOG_TIMEOUT 30 /* 30 sec default timeout */
  13932. +
  13933. MODULE_PARM(nowayout,"i");
  13934. MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
  13935. -static inline void indydog_ping(void)
  13936. +static void indydog_start(void)
  13937. +{
  13938. + u32 mc_ctrl0 = sgimc->cpuctrl0;
  13939. +
  13940. + mc_ctrl0 = sgimc->cpuctrl0 | SGIMC_CCTRL0_WDOG;
  13941. + sgimc->cpuctrl0 = mc_ctrl0;
  13942. +}
  13943. +
  13944. +static void indydog_stop(void)
  13945. +{
  13946. + u32 mc_ctrl0 = sgimc->cpuctrl0;
  13947. +
  13948. + mc_ctrl0 &= ~SGIMC_CCTRL0_WDOG;
  13949. + sgimc->cpuctrl0 = mc_ctrl0;
  13950. +
  13951. + printk(KERN_INFO PFX "Stopped watchdog timer.\n");
  13952. +}
  13953. +
  13954. +static void indydog_ping(void)
  13955. {
  13956. sgimc->watchdogt = 0;
  13957. }
  13958. @@ -46,18 +65,14 @@ static inline void indydog_ping(void)
  13959. */
  13960. static int indydog_open(struct inode *inode, struct file *file)
  13961. {
  13962. - u32 mc_ctrl0;
  13963. -
  13964. - if (test_and_set_bit(0,&indydog_alive))
  13965. + if (indydog_alive)
  13966. return -EBUSY;
  13967. - if (nowayout) {
  13968. + if (nowayout)
  13969. MOD_INC_USE_COUNT;
  13970. - }
  13971. /* Activate timer */
  13972. - mc_ctrl0 = sgimc->cpuctrl0 | SGIMC_CCTRL0_WDOG;
  13973. - sgimc->cpuctrl0 = mc_ctrl0;
  13974. + indydog_start();
  13975. indydog_ping();
  13976. indydog_alive = 1;
  13977. @@ -69,63 +84,48 @@ static int indydog_open(struct inode *in
  13978. static int indydog_release(struct inode *inode, struct file *file)
  13979. {
  13980. /* Shut off the timer.
  13981. - * Lock it in if it's a module and we set nowayout. */
  13982. - lock_kernel();
  13983. - if (expect_close) {
  13984. - u32 mc_ctrl0 = sgimc->cpuctrl0;
  13985. + * Lock it in if it's a module and we defined ...NOWAYOUT */
  13986. + if (!nowayout) {
  13987. + u32 mc_ctrl0 = sgimc->cpuctrl0;
  13988. mc_ctrl0 &= ~SGIMC_CCTRL0_WDOG;
  13989. sgimc->cpuctrl0 = mc_ctrl0;
  13990. printk(KERN_INFO "Stopped watchdog timer.\n");
  13991. - } else
  13992. - printk(KERN_CRIT "WDT device closed unexpectedly. WDT will not stop!\n");
  13993. - clear_bit(0, &indydog_alive);
  13994. - unlock_kernel();
  13995. + }
  13996. + indydog_alive = 0;
  13997. return 0;
  13998. }
  13999. static ssize_t indydog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
  14000. {
  14001. - /* Can't seek (pwrite) on this device */
  14002. + /* Can't seek (pwrite) on this device */
  14003. if (ppos != &file->f_pos)
  14004. return -ESPIPE;
  14005. - /*
  14006. - * Refresh the timer.
  14007. - */
  14008. + /* Refresh the timer. */
  14009. if (len) {
  14010. - if (!nowayout) {
  14011. - size_t i;
  14012. -
  14013. - /* In case it was set long ago */
  14014. - expect_close = 0;
  14015. -
  14016. - for (i = 0; i != len; i++) {
  14017. - char c;
  14018. - if (get_user(c, data + i))
  14019. - return -EFAULT;
  14020. - if (c == 'V')
  14021. - expect_close = 1;
  14022. - }
  14023. - }
  14024. indydog_ping();
  14025. - return 1;
  14026. }
  14027. - return 0;
  14028. + return len;
  14029. }
  14030. static int indydog_ioctl(struct inode *inode, struct file *file,
  14031. unsigned int cmd, unsigned long arg)
  14032. {
  14033. + int options, retval = -EINVAL;
  14034. static struct watchdog_info ident = {
  14035. - options: WDIOF_MAGICCLOSE,
  14036. - identity: "Hardware Watchdog for SGI IP22",
  14037. + .options = WDIOF_KEEPALIVEPING |
  14038. + WDIOF_MAGICCLOSE,
  14039. + .firmware_version = 0,
  14040. + .identity = "Hardware Watchdog for SGI IP22",
  14041. };
  14042. +
  14043. switch (cmd) {
  14044. default:
  14045. return -ENOIOCTLCMD;
  14046. case WDIOC_GETSUPPORT:
  14047. - if(copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident)))
  14048. + if (copy_to_user((struct watchdog_info *)arg,
  14049. + &ident, sizeof(ident)))
  14050. return -EFAULT;
  14051. return 0;
  14052. case WDIOC_GETSTATUS:
  14053. @@ -134,31 +134,53 @@ static int indydog_ioctl(struct inode *i
  14054. case WDIOC_KEEPALIVE:
  14055. indydog_ping();
  14056. return 0;
  14057. + case WDIOC_GETTIMEOUT:
  14058. + return put_user(WATCHDOG_TIMEOUT,(int *)arg);
  14059. + case WDIOC_SETOPTIONS:
  14060. + {
  14061. + if (get_user(options, (int *)arg))
  14062. + return -EFAULT;
  14063. +
  14064. + if (options & WDIOS_DISABLECARD) {
  14065. + indydog_stop();
  14066. + retval = 0;
  14067. + }
  14068. +
  14069. + if (options & WDIOS_ENABLECARD) {
  14070. + indydog_start();
  14071. + retval = 0;
  14072. + }
  14073. +
  14074. + return retval;
  14075. + }
  14076. }
  14077. }
  14078. static struct file_operations indydog_fops = {
  14079. - owner: THIS_MODULE,
  14080. - write: indydog_write,
  14081. - ioctl: indydog_ioctl,
  14082. - open: indydog_open,
  14083. - release: indydog_release,
  14084. + .owner = THIS_MODULE,
  14085. + .write = indydog_write,
  14086. + .ioctl = indydog_ioctl,
  14087. + .open = indydog_open,
  14088. + .release = indydog_release,
  14089. };
  14090. static struct miscdevice indydog_miscdev = {
  14091. - minor: WATCHDOG_MINOR,
  14092. - name: "watchdog",
  14093. - fops: &indydog_fops,
  14094. + .minor = WATCHDOG_MINOR,
  14095. + .name = "watchdog",
  14096. + .fops = &indydog_fops,
  14097. };
  14098. -static const char banner[] __initdata = KERN_INFO "Hardware Watchdog Timer for SGI IP22: 0.2\n";
  14099. +static char banner[] __initdata =
  14100. + KERN_INFO PFX "Hardware Watchdog Timer for SGI IP22: 0.3\n";
  14101. static int __init watchdog_init(void)
  14102. {
  14103. int ret = misc_register(&indydog_miscdev);
  14104. -
  14105. - if (ret)
  14106. + if (ret) {
  14107. + printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
  14108. + WATCHDOG_MINOR, ret);
  14109. return ret;
  14110. + }
  14111. printk(banner);
  14112. @@ -172,4 +194,7 @@ static void __exit watchdog_exit(void)
  14113. module_init(watchdog_init);
  14114. module_exit(watchdog_exit);
  14115. +
  14116. +MODULE_AUTHOR("Guido Guenther <[email protected]>");
  14117. +MODULE_DESCRIPTION("Hardware Watchdog Device for SGI IP22");
  14118. MODULE_LICENSE("GPL");
  14119. Index: linux-2.4.35.4/drivers/char/ip27-rtc.c
  14120. ===================================================================
  14121. --- linux-2.4.35.4.orig/drivers/char/ip27-rtc.c
  14122. +++ linux-2.4.35.4/drivers/char/ip27-rtc.c
  14123. @@ -44,6 +44,7 @@
  14124. #include <asm/sn/klconfig.h>
  14125. #include <asm/sn/sn0/ip27.h>
  14126. #include <asm/sn/sn0/hub.h>
  14127. +#include <asm/sn/sn_private.h>
  14128. static int rtc_ioctl(struct inode *inode, struct file *file,
  14129. unsigned int cmd, unsigned long arg);
  14130. @@ -209,11 +210,8 @@ static struct miscdevice rtc_dev=
  14131. static int __init rtc_init(void)
  14132. {
  14133. - nasid_t nid;
  14134. -
  14135. - nid = get_nasid();
  14136. rtc = (struct m48t35_rtc *)
  14137. - (KL_CONFIG_CH_CONS_INFO(nid)->memory_base + IOC3_BYTEBUS_DEV0);
  14138. + (KL_CONFIG_CH_CONS_INFO(master_nasid)->memory_base + IOC3_BYTEBUS_DEV0);
  14139. printk(KERN_INFO "Real Time Clock Driver v%s\n", RTC_VERSION);
  14140. if (misc_register(&rtc_dev)) {
  14141. @@ -325,3 +323,7 @@ static void get_rtc_time(struct rtc_time
  14142. rtc_tm->tm_mon--;
  14143. }
  14144. +
  14145. +MODULE_AUTHOR("Ralf Baechle <[email protected]>");
  14146. +MODULE_DESCRIPTION("SGI IP27 M48T35 RTC driver");
  14147. +MODULE_LICENSE("GPL");
  14148. Index: linux-2.4.35.4/drivers/char/Makefile
  14149. ===================================================================
  14150. --- linux-2.4.35.4.orig/drivers/char/Makefile
  14151. +++ linux-2.4.35.4/drivers/char/Makefile
  14152. @@ -48,7 +48,12 @@ ifeq ($(ARCH),mips)
  14153. KEYBD =
  14154. endif
  14155. ifeq ($(CONFIG_VR41XX_KIU),y)
  14156. - KEYMAP =
  14157. + ifeq ($(CONFIG_IBM_WORKPAD),y)
  14158. + KEYMAP = ibm_workpad_keymap.o
  14159. + endif
  14160. + ifeq ($(CONFIG_VICTOR_MPC30X),y)
  14161. + KEYMAP = victor_mpc30x_keymap.o
  14162. + endif
  14163. KEYBD = vr41xx_keyb.o
  14164. endif
  14165. endif
  14166. @@ -251,7 +256,6 @@ obj-$(CONFIG_MK712_MOUSE) += mk712.o
  14167. obj-$(CONFIG_RTC) += rtc.o
  14168. obj-$(CONFIG_GEN_RTC) += genrtc.o
  14169. obj-$(CONFIG_EFI_RTC) += efirtc.o
  14170. -obj-$(CONFIG_SGI_DS1286) += ds1286.o
  14171. obj-$(CONFIG_MIPS_RTC) += mips_rtc.o
  14172. obj-$(CONFIG_SGI_IP27_RTC) += ip27-rtc.o
  14173. ifeq ($(CONFIG_PPC),)
  14174. @@ -259,6 +263,7 @@ ifeq ($(CONFIG_PPC),)
  14175. endif
  14176. obj-$(CONFIG_TOSHIBA) += toshiba.o
  14177. obj-$(CONFIG_I8K) += i8k.o
  14178. +obj-$(CONFIG_DS1286) += ds1286.o
  14179. obj-$(CONFIG_DS1620) += ds1620.o
  14180. obj-$(CONFIG_DS1742) += ds1742.o
  14181. obj-$(CONFIG_INTEL_RNG) += i810_rng.o
  14182. @@ -269,6 +274,7 @@ obj-$(CONFIG_BRIQ_PANEL) += briq_panel.o
  14183. obj-$(CONFIG_ITE_GPIO) += ite_gpio.o
  14184. obj-$(CONFIG_AU1X00_GPIO) += au1000_gpio.o
  14185. +obj-$(CONFIG_AU1550_PSC_SPI) += au1550_psc_spi.o
  14186. obj-$(CONFIG_AU1X00_USB_TTY) += au1000_usbtty.o
  14187. obj-$(CONFIG_AU1X00_USB_RAW) += au1000_usbraw.o
  14188. obj-$(CONFIG_COBALT_LCD) += lcd.o
  14189. @@ -355,3 +361,9 @@ defkeymap.c: defkeymap.map
  14190. qtronixmap.c: qtronixmap.map
  14191. set -e ; loadkeys --mktable $< | sed -e 's/^static *//' > $@
  14192. +
  14193. +ibm_workpad_keymap.c: ibm_workpad_keymap.map
  14194. + set -e ; loadkeys --mktable $< | sed -e 's/^static *//' > $@
  14195. +
  14196. +victor_mpc30x_keymap.c: victor_mpc30x_keymap.map
  14197. + set -e ; loadkeys --mktable $< | sed -e 's/^static *//' > $@
  14198. Index: linux-2.4.35.4/drivers/char/mips_rtc.c
  14199. ===================================================================
  14200. --- linux-2.4.35.4.orig/drivers/char/mips_rtc.c
  14201. +++ linux-2.4.35.4/drivers/char/mips_rtc.c
  14202. @@ -53,14 +53,6 @@
  14203. #include <asm/io.h>
  14204. #include <asm/uaccess.h>
  14205. #include <asm/system.h>
  14206. -
  14207. -/*
  14208. - * Check machine
  14209. - */
  14210. -#if !defined(CONFIG_MIPS) || !defined(CONFIG_NEW_TIME_C)
  14211. -#error "This driver is for MIPS machines with CONFIG_NEW_TIME_C defined"
  14212. -#endif
  14213. -
  14214. #include <asm/time.h>
  14215. static unsigned long rtc_status = 0; /* bitmapped status byte. */
  14216. Index: linux-2.4.35.4/drivers/char/sb1250_duart.c
  14217. ===================================================================
  14218. --- linux-2.4.35.4.orig/drivers/char/sb1250_duart.c
  14219. +++ linux-2.4.35.4/drivers/char/sb1250_duart.c
  14220. @@ -328,10 +328,11 @@ static int duart_write(struct tty_struct
  14221. if (c <= 0) break;
  14222. if (from_user) {
  14223. + spin_unlock_irqrestore(&us->outp_lock, flags);
  14224. if (copy_from_user(us->outp_buf + us->outp_tail, buf, c)) {
  14225. - spin_unlock_irqrestore(&us->outp_lock, flags);
  14226. return -EFAULT;
  14227. }
  14228. + spin_lock_irqsave(&us->outp_lock, flags);
  14229. } else {
  14230. memcpy(us->outp_buf + us->outp_tail, buf, c);
  14231. }
  14232. @@ -498,9 +499,31 @@ static void duart_set_termios(struct tty
  14233. duart_set_cflag(us->line, tty->termios->c_cflag);
  14234. }
  14235. +static int get_serial_info(uart_state_t *us, struct serial_struct * retinfo) {
  14236. +
  14237. + struct serial_struct tmp;
  14238. +
  14239. + memset(&tmp, 0, sizeof(tmp));
  14240. +
  14241. + tmp.type=PORT_SB1250;
  14242. + tmp.line=us->line;
  14243. + tmp.port=A_DUART_CHANREG(tmp.line,0);
  14244. + tmp.irq=K_INT_UART_0 + tmp.line;
  14245. + tmp.xmit_fifo_size=16; /* fixed by hw */
  14246. + tmp.baud_base=5000000;
  14247. + tmp.io_type=SERIAL_IO_MEM;
  14248. +
  14249. + if (copy_to_user(retinfo,&tmp,sizeof(*retinfo)))
  14250. + return -EFAULT;
  14251. +
  14252. + return 0;
  14253. +}
  14254. +
  14255. static int duart_ioctl(struct tty_struct *tty, struct file * file,
  14256. unsigned int cmd, unsigned long arg)
  14257. {
  14258. + uart_state_t *us = (uart_state_t *) tty->driver_data;
  14259. +
  14260. /* if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
  14261. return -ENODEV;*/
  14262. switch (cmd) {
  14263. @@ -517,7 +540,7 @@ static int duart_ioctl(struct tty_struct
  14264. printk("Ignoring TIOCMSET\n");
  14265. break;
  14266. case TIOCGSERIAL:
  14267. - printk("Ignoring TIOCGSERIAL\n");
  14268. + return get_serial_info(us,(struct serial_struct *) arg);
  14269. break;
  14270. case TIOCSSERIAL:
  14271. printk("Ignoring TIOCSSERIAL\n");
  14272. Index: linux-2.4.35.4/drivers/char/serial.c
  14273. ===================================================================
  14274. --- linux-2.4.35.4.orig/drivers/char/serial.c
  14275. +++ linux-2.4.35.4/drivers/char/serial.c
  14276. @@ -62,6 +62,12 @@
  14277. * Robert Schwebel <[email protected]>,
  14278. * Juergen Beisert <[email protected]>,
  14279. * Theodore Ts'o <[email protected]>
  14280. + *
  14281. + * 10/00: Added suport for MIPS Atlas board.
  14282. + * 11/00: Hooks for serial kernel debug port support added.
  14283. + * Kevin D. Kissell, [email protected] and Carsten Langgaard,
  14284. + * [email protected]
  14285. + * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
  14286. */
  14287. static char *serial_version = "5.05c";
  14288. @@ -413,6 +419,22 @@ static inline int serial_paranoia_check(
  14289. return 0;
  14290. }
  14291. +#if defined(CONFIG_MIPS_ATLAS) || defined(CONFIG_MIPS_SEAD)
  14292. +
  14293. +#include <asm/mips-boards/atlas.h>
  14294. +
  14295. +static _INLINE_ unsigned int serial_in(struct async_struct *info, int offset)
  14296. +{
  14297. + return (*(volatile unsigned int *)(mips_io_port_base + ATLAS_UART_REGS_BASE + offset*8) & 0xff);
  14298. +}
  14299. +
  14300. +static _INLINE_ void serial_out(struct async_struct *info, int offset, int value)
  14301. +{
  14302. + *(volatile unsigned int *)(mips_io_port_base + ATLAS_UART_REGS_BASE + offset*8) = value;
  14303. +}
  14304. +
  14305. +#else
  14306. +
  14307. static _INLINE_ unsigned int serial_in(struct async_struct *info, int offset)
  14308. {
  14309. switch (info->io_type) {
  14310. @@ -447,6 +469,8 @@ static _INLINE_ void serial_out(struct a
  14311. outb(value, info->port+offset);
  14312. }
  14313. }
  14314. +#endif
  14315. +
  14316. /*
  14317. * We used to support using pause I/O for certain machines. We
  14318. Index: linux-2.4.35.4/drivers/char/victor_mpc30x_keymap.map
  14319. ===================================================================
  14320. --- /dev/null
  14321. +++ linux-2.4.35.4/drivers/char/victor_mpc30x_keymap.map
  14322. @@ -0,0 +1,102 @@
  14323. +# Victor Interlink MP-C303/304 keyboard keymap
  14324. +#
  14325. +# Copyright (C) 2003 Yoichi Yuasa <[email protected]>
  14326. +#
  14327. +# This file is subject to the terms and conditions of the GNU General Public
  14328. +# License. See the file "COPYING" in the main directory of this archive
  14329. +# for more details.
  14330. +keymaps 0-1,4-5,8-9,12
  14331. +alt_is_meta
  14332. +strings as usual
  14333. +compose as usual for "iso-8859-1"
  14334. +
  14335. +# First line
  14336. +keycode 89 = Escape
  14337. +keycode 9 = Delete
  14338. +
  14339. +# 2nd line
  14340. +keycode 73 = one exclam
  14341. +keycode 18 = two quotedbl
  14342. +keycode 92 = three numbersign
  14343. + control keycode 92 = Escape
  14344. +keycode 53 = four dollar
  14345. + control keycode 53 = Control_backslash
  14346. +keycode 21 = five percent
  14347. + control keycode 21 = Control_bracketright
  14348. +keycode 50 = six ampersand
  14349. + control keycode 50 = Control_underscore
  14350. +keycode 48 = seven apostrophe
  14351. +keycode 51 = eight parenleft
  14352. +keycode 16 = nine parenright
  14353. +keycode 80 = zero asciitilde
  14354. + control keycode 80 = nul
  14355. +keycode 49 = minus equal
  14356. +keycode 30 = asciicircum asciitilde
  14357. + control keycode 30 = Control_asciicircum
  14358. +keycode 5 = backslash bar
  14359. + control keycode 5 = Control_backslash
  14360. +keycode 13 = BackSpace
  14361. +# 3rd line
  14362. +keycode 57 = Tab
  14363. +keycode 74 = q
  14364. +keycode 26 = w
  14365. +keycode 81 = e
  14366. +keycode 29 = r
  14367. +keycode 37 = t
  14368. +keycode 45 = y
  14369. +keycode 72 = u
  14370. +keycode 24 = i
  14371. +keycode 32 = o
  14372. +keycode 41 = p
  14373. +keycode 1 = at grave
  14374. + control keycode 1 = nul
  14375. +keycode 54 = bracketleft braceleft
  14376. +keycode 63 = Return
  14377. + alt keycode 63 = Meta_Control_m
  14378. +# 4th line
  14379. +keycode 23 = Caps_Lock
  14380. +keycode 34 = a
  14381. +keycode 66 = s
  14382. +keycode 52 = d
  14383. +keycode 20 = f
  14384. +keycode 84 = g
  14385. +keycode 67 = h
  14386. +keycode 64 = j
  14387. +keycode 17 = k
  14388. +keycode 83 = l
  14389. +keycode 22 = semicolon plus
  14390. +keycode 61 = colon asterisk
  14391. + control keycode 61 = Control_g
  14392. +keycode 65 = bracketright braceright
  14393. + control keycode 65 = Control_bracketright
  14394. +# 5th line
  14395. +keycode 91 = Shift
  14396. +keycode 76 = z
  14397. +keycode 68 = x
  14398. +keycode 28 = c
  14399. +keycode 36 = v
  14400. +keycode 44 = b
  14401. +keycode 19 = n
  14402. +keycode 27 = m
  14403. +keycode 35 = comma less
  14404. +keycode 3 = period greater
  14405. + control keycode 3 = Compose
  14406. +keycode 38 = slash question
  14407. + control keycode 38 = Delete
  14408. + shift control keycode 38 = Delete
  14409. +keycode 6 = backslash underscore
  14410. + control keycode 6 = Control_backslash
  14411. +keycode 55 = Up
  14412. + alt keycode 55 = PageUp
  14413. +keycode 14 = Shift
  14414. +# 6th line
  14415. +keycode 56 = Control
  14416. +keycode 42 = Alt
  14417. +keycode 33 = space
  14418. + control keycode 33 = nul
  14419. +keycode 7 = Left
  14420. + alt keycode 7 = Home
  14421. +keycode 31 = Down
  14422. + alt keycode 31 = PageDown
  14423. +keycode 47 = Right
  14424. + alt keycode 47 = End
  14425. Index: linux-2.4.35.4/drivers/char/vr41xx_keyb.c
  14426. ===================================================================
  14427. --- linux-2.4.35.4.orig/drivers/char/vr41xx_keyb.c
  14428. +++ linux-2.4.35.4/drivers/char/vr41xx_keyb.c
  14429. @@ -308,7 +308,7 @@ void __devinit kbd_init_hw(void)
  14430. if (found != 0) {
  14431. kiu_base = VRC4173_KIU_OFFSET;
  14432. mkiuintreg = VRC4173_MKIUINTREG_OFFSET;
  14433. - vrc4173_clock_supply(VRC4173_KIU_CLOCK);
  14434. + vrc4173_supply_clock(VRC4173_KIU_CLOCK);
  14435. }
  14436. }
  14437. #endif
  14438. @@ -325,7 +325,7 @@ void __devinit kbd_init_hw(void)
  14439. if (current_cpu_data.cputype == CPU_VR4111 ||
  14440. current_cpu_data.cputype == CPU_VR4121)
  14441. - vr41xx_clock_supply(KIU_CLOCK);
  14442. + vr41xx_supply_clock(KIU_CLOCK);
  14443. kiu_writew(KIURST_KIURST, KIURST);
  14444. Index: linux-2.4.35.4/drivers/i2c/Config.in
  14445. ===================================================================
  14446. --- linux-2.4.35.4.orig/drivers/i2c/Config.in
  14447. +++ linux-2.4.35.4/drivers/i2c/Config.in
  14448. @@ -57,6 +57,10 @@ if [ "$CONFIG_I2C" != "n" ]; then
  14449. if [ "$CONFIG_SGI_IP22" = "y" ]; then
  14450. dep_tristate 'I2C SGI interfaces' CONFIG_I2C_ALGO_SGI $CONFIG_I2C
  14451. fi
  14452. +
  14453. + if [ "$CONFIG_SOC_AU1550" = "y" -o "$CONFIG_SOC_AU1200" ]; then
  14454. + dep_tristate 'Au1550/Au1200 SMBus interface' CONFIG_I2C_ALGO_AU1550 $CONFIG_I2C
  14455. + fi
  14456. # This is needed for automatic patch generation: sensors code starts here
  14457. # This is needed for automatic patch generation: sensors code ends here
  14458. Index: linux-2.4.35.4/drivers/i2c/i2c-algo-au1550.c
  14459. ===================================================================
  14460. --- /dev/null
  14461. +++ linux-2.4.35.4/drivers/i2c/i2c-algo-au1550.c
  14462. @@ -0,0 +1,340 @@
  14463. +/*
  14464. + * i2c-algo-au1550.c: SMBus (i2c) driver algorithms for Alchemy PSC interface
  14465. + * Copyright (C) 2004 Embedded Edge, LLC <[email protected]>
  14466. + *
  14467. + * The documentation describes this as an SMBus controller, but it doesn't
  14468. + * understand any of the SMBus protocol in hardware. It's really an I2C
  14469. + * controller that could emulate most of the SMBus in software.
  14470. + */
  14471. +
  14472. +#include <linux/kernel.h>
  14473. +#include <linux/module.h>
  14474. +#include <linux/init.h>
  14475. +#include <linux/errno.h>
  14476. +#include <linux/delay.h>
  14477. +
  14478. +#include <asm/au1000.h>
  14479. +#include <asm/au1xxx_psc.h>
  14480. +
  14481. +#include <linux/i2c.h>
  14482. +#include <linux/i2c-algo-au1550.h>
  14483. +
  14484. +static int
  14485. +wait_xfer_done(struct i2c_algo_au1550_data *adap)
  14486. +{
  14487. + u32 stat;
  14488. + int i;
  14489. + volatile psc_smb_t *sp;
  14490. +
  14491. + sp = (volatile psc_smb_t *)(adap->psc_base);
  14492. +
  14493. + /* Wait for Tx FIFO Underflow.
  14494. + */
  14495. + for (i = 0; i < adap->xfer_timeout; i++) {
  14496. + stat = sp->psc_smbevnt;
  14497. + au_sync();
  14498. + if ((stat & PSC_SMBEVNT_TU) != 0) {
  14499. + /* Clear it. */
  14500. + sp->psc_smbevnt = PSC_SMBEVNT_TU;
  14501. + au_sync();
  14502. + return 0;
  14503. + }
  14504. + udelay(1);
  14505. + }
  14506. +
  14507. + return -ETIMEDOUT;
  14508. +}
  14509. +
  14510. +static int
  14511. +wait_ack(struct i2c_algo_au1550_data *adap)
  14512. +{
  14513. + u32 stat;
  14514. + volatile psc_smb_t *sp;
  14515. +
  14516. + if (wait_xfer_done(adap))
  14517. + return -ETIMEDOUT;
  14518. +
  14519. + sp = (volatile psc_smb_t *)(adap->psc_base);
  14520. +
  14521. + stat = sp->psc_smbevnt;
  14522. + au_sync();
  14523. +
  14524. + if ((stat & (PSC_SMBEVNT_DN | PSC_SMBEVNT_AN | PSC_SMBEVNT_AL)) != 0)
  14525. + return -ETIMEDOUT;
  14526. +
  14527. + return 0;
  14528. +}
  14529. +
  14530. +static int
  14531. +wait_master_done(struct i2c_algo_au1550_data *adap)
  14532. +{
  14533. + u32 stat;
  14534. + int i;
  14535. + volatile psc_smb_t *sp;
  14536. +
  14537. + sp = (volatile psc_smb_t *)(adap->psc_base);
  14538. +
  14539. + /* Wait for Master Done.
  14540. + */
  14541. + for (i = 0; i < adap->xfer_timeout; i++) {
  14542. + stat = sp->psc_smbevnt;
  14543. + au_sync();
  14544. + if ((stat & PSC_SMBEVNT_MD) != 0)
  14545. + return 0;
  14546. + udelay(1);
  14547. + }
  14548. +
  14549. + return -ETIMEDOUT;
  14550. +}
  14551. +
  14552. +static int
  14553. +do_address(struct i2c_algo_au1550_data *adap, unsigned int addr, int rd)
  14554. +{
  14555. + volatile psc_smb_t *sp;
  14556. + u32 stat;
  14557. +
  14558. + sp = (volatile psc_smb_t *)(adap->psc_base);
  14559. +
  14560. + /* Reset the FIFOs, clear events.
  14561. + */
  14562. + sp->psc_smbpcr = PSC_SMBPCR_DC;
  14563. + sp->psc_smbevnt = PSC_SMBEVNT_ALLCLR;
  14564. + au_sync();
  14565. + do {
  14566. + stat = sp->psc_smbpcr;
  14567. + au_sync();
  14568. + } while ((stat & PSC_SMBPCR_DC) != 0);
  14569. +
  14570. + /* Write out the i2c chip address and specify operation
  14571. + */
  14572. + addr <<= 1;
  14573. + if (rd)
  14574. + addr |= 1;
  14575. +
  14576. + /* Put byte into fifo, start up master.
  14577. + */
  14578. + sp->psc_smbtxrx = addr;
  14579. + au_sync();
  14580. + sp->psc_smbpcr = PSC_SMBPCR_MS;
  14581. + au_sync();
  14582. + if (wait_ack(adap))
  14583. + return -EIO;
  14584. + return 0;
  14585. +}
  14586. +
  14587. +static u32
  14588. +wait_for_rx_byte(struct i2c_algo_au1550_data *adap, u32 *ret_data)
  14589. +{
  14590. + int j;
  14591. + u32 data, stat;
  14592. + volatile psc_smb_t *sp;
  14593. +
  14594. + if (wait_xfer_done(adap))
  14595. + return -EIO;
  14596. +
  14597. + sp = (volatile psc_smb_t *)(adap->psc_base);
  14598. +
  14599. + j = adap->xfer_timeout * 100;
  14600. + do {
  14601. + j--;
  14602. + if (j <= 0)
  14603. + return -EIO;
  14604. +
  14605. + stat = sp->psc_smbstat;
  14606. + au_sync();
  14607. + if ((stat & PSC_SMBSTAT_RE) == 0)
  14608. + j = 0;
  14609. + else
  14610. + udelay(1);
  14611. + } while (j > 0);
  14612. + data = sp->psc_smbtxrx;
  14613. + au_sync();
  14614. + *ret_data = data;
  14615. +
  14616. + return 0;
  14617. +}
  14618. +
  14619. +static int
  14620. +i2c_read(struct i2c_algo_au1550_data *adap, unsigned char *buf,
  14621. + unsigned int len)
  14622. +{
  14623. + int i;
  14624. + u32 data;
  14625. + volatile psc_smb_t *sp;
  14626. +
  14627. + if (len == 0)
  14628. + return 0;
  14629. +
  14630. + /* A read is performed by stuffing the transmit fifo with
  14631. + * zero bytes for timing, waiting for bytes to appear in the
  14632. + * receive fifo, then reading the bytes.
  14633. + */
  14634. +
  14635. + sp = (volatile psc_smb_t *)(adap->psc_base);
  14636. +
  14637. + i = 0;
  14638. + while (i < (len-1)) {
  14639. + sp->psc_smbtxrx = 0;
  14640. + au_sync();
  14641. + if (wait_for_rx_byte(adap, &data))
  14642. + return -EIO;
  14643. +
  14644. + buf[i] = data;
  14645. + i++;
  14646. + }
  14647. +
  14648. + /* The last byte has to indicate transfer done.
  14649. + */
  14650. + sp->psc_smbtxrx = PSC_SMBTXRX_STP;
  14651. + au_sync();
  14652. + if (wait_master_done(adap))
  14653. + return -EIO;
  14654. +
  14655. + data = sp->psc_smbtxrx;
  14656. + au_sync();
  14657. + buf[i] = data;
  14658. + return 0;
  14659. +}
  14660. +
  14661. +static int
  14662. +i2c_write(struct i2c_algo_au1550_data *adap, unsigned char *buf,
  14663. + unsigned int len)
  14664. +{
  14665. + int i;
  14666. + u32 data;
  14667. + volatile psc_smb_t *sp;
  14668. +
  14669. + if (len == 0)
  14670. + return 0;
  14671. +
  14672. + sp = (volatile psc_smb_t *)(adap->psc_base);
  14673. +
  14674. + i = 0;
  14675. + while (i < (len-1)) {
  14676. + data = buf[i];
  14677. + sp->psc_smbtxrx = data;
  14678. + au_sync();
  14679. + if (wait_ack(adap))
  14680. + return -EIO;
  14681. + i++;
  14682. + }
  14683. +
  14684. + /* The last byte has to indicate transfer done.
  14685. + */
  14686. + data = buf[i];
  14687. + data |= PSC_SMBTXRX_STP;
  14688. + sp->psc_smbtxrx = data;
  14689. + au_sync();
  14690. + if (wait_master_done(adap))
  14691. + return -EIO;
  14692. + return 0;
  14693. +}
  14694. +
  14695. +static int
  14696. +au1550_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)
  14697. +{
  14698. + struct i2c_algo_au1550_data *adap = i2c_adap->algo_data;
  14699. + struct i2c_msg *p;
  14700. + int i, err = 0;
  14701. +
  14702. + for (i = 0; !err && i < num; i++) {
  14703. + p = &msgs[i];
  14704. + err = do_address(adap, p->addr, p->flags & I2C_M_RD);
  14705. + if (err || !p->len)
  14706. + continue;
  14707. + if (p->flags & I2C_M_RD)
  14708. + err = i2c_read(adap, p->buf, p->len);
  14709. + else
  14710. + err = i2c_write(adap, p->buf, p->len);
  14711. + }
  14712. +
  14713. + /* Return the number of messages processed, or the error code.
  14714. + */
  14715. + if (err == 0)
  14716. + err = num;
  14717. + return err;
  14718. +}
  14719. +
  14720. +static u32
  14721. +au1550_func(struct i2c_adapter *adap)
  14722. +{
  14723. + return I2C_FUNC_I2C;
  14724. +}
  14725. +
  14726. +static struct i2c_algorithm au1550_algo = {
  14727. + .name = "Au1550 algorithm",
  14728. + .id = I2C_ALGO_AU1550,
  14729. + .master_xfer = au1550_xfer,
  14730. + .functionality = au1550_func,
  14731. +};
  14732. +
  14733. +/*
  14734. + * registering functions to load algorithms at runtime
  14735. + * Prior to calling us, the 50MHz clock frequency and routing
  14736. + * must have been set up for the PSC indicated by the adapter.
  14737. + */
  14738. +int
  14739. +i2c_au1550_add_bus(struct i2c_adapter *i2c_adap)
  14740. +{
  14741. + struct i2c_algo_au1550_data *adap = i2c_adap->algo_data;
  14742. + volatile psc_smb_t *sp;
  14743. + u32 stat;
  14744. +
  14745. + i2c_adap->algo = &au1550_algo;
  14746. +
  14747. + /* Now, set up the PSC for SMBus PIO mode.
  14748. + */
  14749. + sp = (volatile psc_smb_t *)(adap->psc_base);
  14750. + sp->psc_ctrl = PSC_CTRL_DISABLE;
  14751. + au_sync();
  14752. + sp->psc_sel = PSC_SEL_PS_SMBUSMODE;
  14753. + sp->psc_smbcfg = 0;
  14754. + au_sync();
  14755. + sp->psc_ctrl = PSC_CTRL_ENABLE;
  14756. + au_sync();
  14757. + do {
  14758. + stat = sp->psc_smbstat;
  14759. + au_sync();
  14760. + } while ((stat & PSC_SMBSTAT_SR) == 0);
  14761. +
  14762. + sp->psc_smbcfg = (PSC_SMBCFG_RT_FIFO8 | PSC_SMBCFG_TT_FIFO8 |
  14763. + PSC_SMBCFG_DD_DISABLE);
  14764. +
  14765. + /* Divide by 8 to get a 6.25 MHz clock. The later protocol
  14766. + * timings are based on this clock.
  14767. + */
  14768. + sp->psc_smbcfg |= PSC_SMBCFG_SET_DIV(PSC_SMBCFG_DIV2);
  14769. + sp->psc_smbmsk = PSC_SMBMSK_ALLMASK;
  14770. + au_sync();
  14771. +
  14772. + /* Set the protocol timer values. See Table 71 in the
  14773. + * Au1550 Data Book for standard timing values.
  14774. + */
  14775. + sp->psc_smbtmr = PSC_SMBTMR_SET_TH(2) | PSC_SMBTMR_SET_PS(15) | \
  14776. + PSC_SMBTMR_SET_PU(11) | PSC_SMBTMR_SET_SH(11) | \
  14777. + PSC_SMBTMR_SET_SU(11) | PSC_SMBTMR_SET_CL(15) | \
  14778. + PSC_SMBTMR_SET_CH(11);
  14779. + au_sync();
  14780. +
  14781. + sp->psc_smbcfg |= PSC_SMBCFG_DE_ENABLE;
  14782. + do {
  14783. + stat = sp->psc_smbstat;
  14784. + au_sync();
  14785. + } while ((stat & PSC_SMBSTAT_DR) == 0);
  14786. +
  14787. + return i2c_add_adapter(i2c_adap);
  14788. +}
  14789. +
  14790. +
  14791. +int
  14792. +i2c_au1550_del_bus(struct i2c_adapter *adap)
  14793. +{
  14794. + return i2c_del_adapter(adap);
  14795. +}
  14796. +
  14797. +EXPORT_SYMBOL(i2c_au1550_add_bus);
  14798. +EXPORT_SYMBOL(i2c_au1550_del_bus);
  14799. +
  14800. +MODULE_AUTHOR("Dan Malek <[email protected]>");
  14801. +MODULE_DESCRIPTION("SMBus Au1550 algorithm");
  14802. +MODULE_LICENSE("GPL");
  14803. Index: linux-2.4.35.4/drivers/i2c/i2c-au1550.c
  14804. ===================================================================
  14805. --- /dev/null
  14806. +++ linux-2.4.35.4/drivers/i2c/i2c-au1550.c
  14807. @@ -0,0 +1,154 @@
  14808. +/*
  14809. + * i2c-au1550.c: SMBus (i2c) adapter for Alchemy PSC interface
  14810. + * Copyright (C) 2004 Embedded Edge, LLC <[email protected]>
  14811. + *
  14812. + * This is just a skeleton adapter to use with the Au1550 PSC
  14813. + * algorithm. It was developed for the Pb1550, but will work with
  14814. + * any Au1550 board that has a similar PSC configuration.
  14815. + *
  14816. + * This program is free software; you can redistribute it and/or
  14817. + * modify it under the terms of the GNU General Public License
  14818. + * as published by the Free Software Foundation; either version 2
  14819. + * of the License, or (at your option) any later version.
  14820. + *
  14821. + * This program is distributed in the hope that it will be useful,
  14822. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14823. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14824. + * GNU General Public License for more details.
  14825. + *
  14826. + * You should have received a copy of the GNU General Public License
  14827. + * along with this program; if not, write to the Free Software
  14828. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14829. + */
  14830. +
  14831. +#include <linux/config.h>
  14832. +#include <linux/kernel.h>
  14833. +#include <linux/module.h>
  14834. +#include <linux/init.h>
  14835. +#include <linux/errno.h>
  14836. +
  14837. +#include <asm/au1000.h>
  14838. +#include <asm/au1xxx_psc.h>
  14839. +#if defined( CONFIG_MIPS_PB1550 )
  14840. + #include <asm/pb1550.h>
  14841. +#endif
  14842. +#if defined( CONFIG_MIPS_PB1200 )
  14843. + #include <asm/pb1200.h>
  14844. +#endif
  14845. +#if defined( CONFIG_MIPS_DB1200 )
  14846. + #include <asm/db1200.h>
  14847. +#endif
  14848. +#if defined( CONFIG_MIPS_FICMMP )
  14849. + #include <asm/ficmmp.h>
  14850. +#endif
  14851. +
  14852. +#include <linux/i2c.h>
  14853. +#include <linux/i2c-algo-au1550.h>
  14854. +
  14855. +
  14856. +
  14857. +static int
  14858. +pb1550_reg(struct i2c_client *client)
  14859. +{
  14860. + return 0;
  14861. +}
  14862. +
  14863. +static int
  14864. +pb1550_unreg(struct i2c_client *client)
  14865. +{
  14866. + return 0;
  14867. +}
  14868. +
  14869. +static void
  14870. +pb1550_inc_use(struct i2c_adapter *adap)
  14871. +{
  14872. +#ifdef MODULE
  14873. + MOD_INC_USE_COUNT;
  14874. +#endif
  14875. +}
  14876. +
  14877. +static void
  14878. +pb1550_dec_use(struct i2c_adapter *adap)
  14879. +{
  14880. +#ifdef MODULE
  14881. + MOD_DEC_USE_COUNT;
  14882. +#endif
  14883. +}
  14884. +
  14885. +static struct i2c_algo_au1550_data pb1550_i2c_info = {
  14886. + SMBUS_PSC_BASE, 200, 200
  14887. +};
  14888. +
  14889. +static struct i2c_adapter pb1550_board_adapter = {
  14890. + name: "pb1550 adapter",
  14891. + id: I2C_HW_AU1550_PSC,
  14892. + algo: NULL,
  14893. + algo_data: &pb1550_i2c_info,
  14894. + inc_use: pb1550_inc_use,
  14895. + dec_use: pb1550_dec_use,
  14896. + client_register: pb1550_reg,
  14897. + client_unregister: pb1550_unreg,
  14898. + client_count: 0,
  14899. +};
  14900. +
  14901. +int __init
  14902. +i2c_pb1550_init(void)
  14903. +{
  14904. + /* This is where we would set up a 50MHz clock source
  14905. + * and routing. On the Pb1550, the SMBus is PSC2, which
  14906. + * uses a shared clock with USB. This has been already
  14907. + * configured by Yamon as a 48MHz clock, close enough
  14908. + * for our work.
  14909. + */
  14910. + if (i2c_au1550_add_bus(&pb1550_board_adapter) < 0)
  14911. + return -ENODEV;
  14912. +
  14913. + return 0;
  14914. +}
  14915. +
  14916. +/* BIG hack to support the control interface on the Wolfson WM8731
  14917. + * audio codec on the Pb1550 board. We get an address and two data
  14918. + * bytes to write, create an i2c message, and send it across the
  14919. + * i2c transfer function. We do this here because we have access to
  14920. + * the i2c adapter structure.
  14921. + */
  14922. +static struct i2c_msg wm_i2c_msg; /* We don't want this stuff on the stack */
  14923. +static u8 i2cbuf[2];
  14924. +
  14925. +int
  14926. +pb1550_wm_codec_write(u8 addr, u8 reg, u8 val)
  14927. +{
  14928. + wm_i2c_msg.addr = addr;
  14929. + wm_i2c_msg.flags = 0;
  14930. + wm_i2c_msg.buf = i2cbuf;
  14931. + wm_i2c_msg.len = 2;
  14932. + i2cbuf[0] = reg;
  14933. + i2cbuf[1] = val;
  14934. +
  14935. + return pb1550_board_adapter.algo->master_xfer(&pb1550_board_adapter, &wm_i2c_msg, 1);
  14936. +}
  14937. +
  14938. +/* the next function is needed by DVB driver. */
  14939. +int pb1550_i2c_xfer(struct i2c_msg msgs[], int num)
  14940. +{
  14941. + return pb1550_board_adapter.algo->master_xfer(&pb1550_board_adapter, msgs, num);
  14942. +}
  14943. +
  14944. +EXPORT_SYMBOL(pb1550_wm_codec_write);
  14945. +EXPORT_SYMBOL(pb1550_i2c_xfer);
  14946. +
  14947. +MODULE_AUTHOR("Dan Malek, Embedded Edge, LLC.");
  14948. +MODULE_DESCRIPTION("SMBus adapter Alchemy pb1550");
  14949. +MODULE_LICENSE("GPL");
  14950. +
  14951. +int
  14952. +init_module(void)
  14953. +{
  14954. + return i2c_pb1550_init();
  14955. +}
  14956. +
  14957. +void
  14958. +cleanup_module(void)
  14959. +{
  14960. + i2c_au1550_del_bus(&pb1550_board_adapter);
  14961. +}
  14962. Index: linux-2.4.35.4/drivers/i2c/i2c-core.c
  14963. ===================================================================
  14964. --- linux-2.4.35.4.orig/drivers/i2c/i2c-core.c
  14965. +++ linux-2.4.35.4/drivers/i2c/i2c-core.c
  14966. @@ -1277,6 +1277,9 @@ static int __init i2c_init(void)
  14967. #ifdef CONFIG_I2C_MAX1617
  14968. extern int i2c_max1617_init(void);
  14969. #endif
  14970. +#ifdef CONFIG_I2C_ALGO_AU1550
  14971. + extern int i2c_pb1550_init(void);
  14972. +#endif
  14973. #ifdef CONFIG_I2C_PROC
  14974. extern int sensors_init(void);
  14975. @@ -1332,6 +1335,10 @@ int __init i2c_init_all(void)
  14976. i2c_max1617_init();
  14977. #endif
  14978. +#ifdef CONFIG_I2C_ALGO_AU1550
  14979. + i2c_pb1550_init();
  14980. +#endif
  14981. +
  14982. /* -------------- proc interface ---- */
  14983. #ifdef CONFIG_I2C_PROC
  14984. sensors_init();
  14985. Index: linux-2.4.35.4/drivers/i2c/Makefile
  14986. ===================================================================
  14987. --- linux-2.4.35.4.orig/drivers/i2c/Makefile
  14988. +++ linux-2.4.35.4/drivers/i2c/Makefile
  14989. @@ -6,7 +6,7 @@ O_TARGET := i2c.o
  14990. export-objs := i2c-core.o i2c-algo-bit.o i2c-algo-pcf.o \
  14991. i2c-algo-ite.o i2c-algo-sibyte.o i2c-algo-sgi.o \
  14992. - i2c-proc.o
  14993. + i2c-algo-au1550.o i2c-proc.o i2c-au1550.o
  14994. obj-$(CONFIG_I2C) += i2c-core.o
  14995. obj-$(CONFIG_I2C_CHARDEV) += i2c-dev.o
  14996. @@ -25,6 +25,7 @@ obj-$(CONFIG_I2C_KEYWEST) += i2c-keywest
  14997. obj-$(CONFIG_I2C_ALGO_SIBYTE) += i2c-algo-sibyte.o i2c-sibyte.o
  14998. obj-$(CONFIG_I2C_MAX1617) += i2c-max1617.o
  14999. obj-$(CONFIG_I2C_ALGO_SGI) += i2c-algo-sgi.o
  15000. +obj-$(CONFIG_I2C_ALGO_AU1550) += i2c-algo-au1550.o i2c-au1550.o
  15001. # This is needed for automatic patch generation: sensors code starts here
  15002. # This is needed for automatic patch generation: sensors code ends here
  15003. Index: linux-2.4.35.4/drivers/media/video/indycam.c
  15004. ===================================================================
  15005. --- linux-2.4.35.4.orig/drivers/media/video/indycam.c
  15006. +++ linux-2.4.35.4/drivers/media/video/indycam.c
  15007. @@ -50,13 +50,14 @@ static int indycam_attach(struct i2c_ada
  15008. 0x80, /* INDYCAM_GAMMA */
  15009. };
  15010. - int err = 0;
  15011. struct indycam *camera;
  15012. struct i2c_client *client;
  15013. + int err = 0;
  15014. client = kmalloc(sizeof(*client), GFP_KERNEL);
  15015. - if (!client)
  15016. + if (!client)
  15017. return -ENOMEM;
  15018. +
  15019. camera = kmalloc(sizeof(*camera), GFP_KERNEL);
  15020. if (!camera) {
  15021. err = -ENOMEM;
  15022. @@ -67,7 +68,7 @@ static int indycam_attach(struct i2c_ada
  15023. client->adapter = adap;
  15024. client->addr = addr;
  15025. client->driver = &i2c_driver_indycam;
  15026. - strcpy(client->name, "IndyCam client");
  15027. + strcpy(client->name, "IndyCam client");
  15028. camera->client = client;
  15029. err = i2c_attach_client(client);
  15030. @@ -75,18 +76,18 @@ static int indycam_attach(struct i2c_ada
  15031. goto out_free_camera;
  15032. camera->version = i2c_smbus_read_byte_data(client, INDYCAM_VERSION);
  15033. - if (camera->version != CAMERA_VERSION_INDY &&
  15034. - camera->version != CAMERA_VERSION_MOOSE) {
  15035. + if ((camera->version != CAMERA_VERSION_INDY) &&
  15036. + (camera->version != CAMERA_VERSION_MOOSE)) {
  15037. err = -ENODEV;
  15038. goto out_detach_client;
  15039. }
  15040. - printk(KERN_INFO "Indycam v%d.%d detected.\n",
  15041. + printk(KERN_INFO "IndyCam v%d.%d detected.\n",
  15042. INDYCAM_VERSION_MAJOR(camera->version),
  15043. INDYCAM_VERSION_MINOR(camera->version));
  15044. err = i2c_master_send(client, initseq, sizeof(initseq));
  15045. if (err)
  15046. - printk(KERN_INFO "IndyCam initalization failed\n");
  15047. + printk(KERN_ERR "IndyCam initalization failed.\n");
  15048. MOD_INC_USE_COUNT;
  15049. return 0;
  15050. Index: linux-2.4.35.4/drivers/media/video/vino.c
  15051. ===================================================================
  15052. --- linux-2.4.35.4.orig/drivers/media/video/vino.c
  15053. +++ linux-2.4.35.4/drivers/media/video/vino.c
  15054. @@ -5,6 +5,8 @@
  15055. * License version 2 as published by the Free Software Foundation.
  15056. *
  15057. * Copyright (C) 2003 Ladislav Michl <[email protected]>
  15058. + * Copyright (C) 2004 Mikael Nousiainen <[email protected]>
  15059. + *
  15060. */
  15061. #include <linux/module.h>
  15062. @@ -37,13 +39,23 @@
  15063. #define DEBUG(x...)
  15064. #endif
  15065. +/* Channels (who could have guessed) */
  15066. +#define VINO_CHAN_NONE 0
  15067. +#define VINO_CHAN_A 1
  15068. +#define VINO_CHAN_B 2
  15069. +
  15070. /* VINO video size */
  15071. #define VINO_PAL_WIDTH 768
  15072. #define VINO_PAL_HEIGHT 576
  15073. #define VINO_NTSC_WIDTH 646
  15074. #define VINO_NTSC_HEIGHT 486
  15075. -/* set this to some sensible values. note: VINO_MIN_WIDTH has to be 8*x */
  15076. +/* Minimum value for Y-clipping (for smaller values the images
  15077. + * will be corrupted) */
  15078. +#define VINO_MIN_Y_CLIPPING 2
  15079. +
  15080. +/* Set these to some sensible values.
  15081. + * Note: the picture width has to be divisible by 8 */
  15082. #define VINO_MIN_WIDTH 32
  15083. #define VINO_MIN_HEIGHT 32
  15084. @@ -64,9 +76,7 @@ static int threshold_b = 512;
  15085. struct vino_device {
  15086. struct video_device vdev;
  15087. -#define VINO_CHAN_A 1
  15088. -#define VINO_CHAN_B 2
  15089. - int chan;
  15090. + int chan; /* VINO_CHAN_NONE, VINO_CHAN_A or VINO_CHAN_B */
  15091. int alpha;
  15092. /* clipping... */
  15093. unsigned int left, right, top, bottom;
  15094. @@ -106,7 +116,7 @@ struct vino_device {
  15095. struct vino_client {
  15096. struct i2c_client *driver;
  15097. - int owner;
  15098. + int owner; /* VINO_CHAN_NONE, VINO_CHAN_A or VINO_CHAN_B */
  15099. };
  15100. struct vino_video {
  15101. @@ -362,6 +372,7 @@ static int set_scaling(struct vino_devic
  15102. static int dma_setup(struct vino_device *v)
  15103. {
  15104. u32 ctrl, intr;
  15105. + int ofs;
  15106. struct sgi_vino_channel *ch;
  15107. ch = (v->chan == VINO_CHAN_A) ? &vino->a : &vino->b;
  15108. @@ -377,14 +388,24 @@ static int dma_setup(struct vino_device
  15109. ch->line_size = v->line_size - 8;
  15110. /* set the alpha register */
  15111. ch->alpha = v->alpha;
  15112. - /* set cliping registers */
  15113. - ch->clip_start = VINO_CLIP_ODD(v->top) | VINO_CLIP_EVEN(v->top+1) |
  15114. + /* Set the clipping registers, this is the constant source of fun :)
  15115. + * Y clipping start has to be >= 2 and end has to be start + height/2
  15116. + * The values of top and bottom are even so dividing is not a problem
  15117. + *
  15118. + * The docs say that clipping values for the even field should be
  15119. + * odd_end + something_to_skip_vertical_blanking + some_lines and
  15120. + * even_start + height/2, though the image is good this way also
  15121. + *
  15122. + * TODO: for analog sources (SAA7191), the clipping values are a bit
  15123. + * different and that case isn't yet handled
  15124. + */
  15125. + ofs = VINO_MIN_Y_CLIPPING; /* Should depend on input source */
  15126. + ch->clip_start = VINO_CLIP_ODD(ofs + v->top / 2) |
  15127. + VINO_CLIP_EVEN(ofs + v->top / 2 + 1) |
  15128. VINO_CLIP_X(v->left);
  15129. - ch->clip_end = VINO_CLIP_ODD(v->bottom) | VINO_CLIP_EVEN(v->bottom+1) |
  15130. + ch->clip_end = VINO_CLIP_ODD(ofs + v->bottom / 2 - 1) |
  15131. + VINO_CLIP_EVEN(ofs + v->bottom / 2) |
  15132. VINO_CLIP_X(v->right);
  15133. - /* FIXME: end-of-field bug workaround
  15134. - VINO_CLIP_X(VINO_PAL_WIDTH);
  15135. - */
  15136. /* init the frame rate and norm (full frame rate only for now...) */
  15137. ch->frame_rate = VINO_FRAMERT_RT(0x1fff) |
  15138. (get_capture_norm(v) == VIDEO_MODE_PAL ?
  15139. @@ -510,6 +531,7 @@ static void field_done(struct vino_devic
  15140. static void vino_interrupt(int irq, void *dev_id, struct pt_regs *regs)
  15141. {
  15142. u32 intr, ctrl;
  15143. + int a_eof, b_eof;
  15144. spin_lock(&Vino->vino_lock);
  15145. ctrl = vino->control;
  15146. @@ -525,12 +547,14 @@ static void vino_interrupt(int irq, void
  15147. vino->control = ctrl;
  15148. clear_eod(&Vino->chB);
  15149. }
  15150. + a_eof = intr & VINO_INTSTAT_A_EOF;
  15151. + b_eof = intr & VINO_INTSTAT_B_EOF;
  15152. vino->intr_status = ~intr;
  15153. spin_unlock(&Vino->vino_lock);
  15154. - /* FIXME: For now we are assuming that interrupt means that frame is
  15155. - * done. That's not true, but we can live with such brokeness for
  15156. - * a while ;-) */
  15157. - field_done(&Vino->chA);
  15158. + if (a_eof)
  15159. + field_done(&Vino->chA);
  15160. + if (b_eof)
  15161. + field_done(&Vino->chB);
  15162. }
  15163. static int vino_grab(struct vino_device *v, int frame)
  15164. Index: linux-2.4.35.4/drivers/mtd/devices/docprobe.c
  15165. ===================================================================
  15166. --- linux-2.4.35.4.orig/drivers/mtd/devices/docprobe.c
  15167. +++ linux-2.4.35.4/drivers/mtd/devices/docprobe.c
  15168. @@ -89,10 +89,10 @@ static unsigned long __initdata doc_loca
  15169. 0xe4000000,
  15170. #elif defined(CONFIG_MOMENCO_OCELOT)
  15171. 0x2f000000,
  15172. - 0xff000000,
  15173. + 0xff000000,
  15174. #elif defined(CONFIG_MOMENCO_OCELOT_G) || defined (CONFIG_MOMENCO_OCELOT_C)
  15175. - 0xff000000,
  15176. -##else
  15177. + 0xff000000,
  15178. +#else
  15179. #warning Unknown architecture for DiskOnChip. No default probe locations defined
  15180. #endif
  15181. 0 };
  15182. Index: linux-2.4.35.4/drivers/mtd/devices/ms02-nv.c
  15183. ===================================================================
  15184. --- linux-2.4.35.4.orig/drivers/mtd/devices/ms02-nv.c
  15185. +++ linux-2.4.35.4/drivers/mtd/devices/ms02-nv.c
  15186. @@ -1,10 +1,10 @@
  15187. /*
  15188. - * Copyright (c) 2001 Maciej W. Rozycki
  15189. + * Copyright (c) 2001 Maciej W. Rozycki
  15190. *
  15191. - * This program is free software; you can redistribute it and/or
  15192. - * modify it under the terms of the GNU General Public License
  15193. - * as published by the Free Software Foundation; either version
  15194. - * 2 of the License, or (at your option) any later version.
  15195. + * This program is free software; you can redistribute it and/or
  15196. + * modify it under the terms of the GNU General Public License
  15197. + * as published by the Free Software Foundation; either version
  15198. + * 2 of the License, or (at your option) any later version.
  15199. *
  15200. * $Id: ms02-nv.c,v 1.2 2003/01/24 14:05:17 dwmw2 Exp $
  15201. */
  15202. @@ -29,18 +29,18 @@
  15203. static char version[] __initdata =
  15204. - "ms02-nv.c: v.1.0.0 13 Aug 2001 Maciej W. Rozycki.\n";
  15205. + "ms02-nv.c: v.1.0.0 13 Aug 2001 Maciej W. Rozycki.\n";
  15206. -MODULE_AUTHOR("Maciej W. Rozycki <[email protected]>");
  15207. +MODULE_AUTHOR("Maciej W. Rozycki <[email protected]>");
  15208. MODULE_DESCRIPTION("DEC MS02-NV NVRAM module driver");
  15209. MODULE_LICENSE("GPL");
  15210. /*
  15211. * Addresses we probe for an MS02-NV at. Modules may be located
  15212. - * at any 8MB boundary within a 0MB up to 112MB range or at any 32MB
  15213. - * boundary within a 0MB up to 448MB range. We don't support a module
  15214. - * at 0MB, though.
  15215. + * at any 8MiB boundary within a 0MiB up to 112MiB range or at any 32MiB
  15216. + * boundary within a 0MiB up to 448MiB range. We don't support a module
  15217. + * at 0MiB, though.
  15218. */
  15219. static ulong ms02nv_addrs[] __initdata = {
  15220. 0x07000000, 0x06800000, 0x06000000, 0x05800000, 0x05000000,
  15221. @@ -130,7 +130,7 @@ static int __init ms02nv_init_one(ulong
  15222. int ret = -ENODEV;
  15223. - /* The module decodes 8MB of address space. */
  15224. + /* The module decodes 8MiB of address space. */
  15225. mod_res = kmalloc(sizeof(*mod_res), GFP_KERNEL);
  15226. if (!mod_res)
  15227. return -ENOMEM;
  15228. @@ -233,7 +233,7 @@ static int __init ms02nv_init_one(ulong
  15229. goto err_out_csr_res;
  15230. }
  15231. - printk(KERN_INFO "mtd%d: %s at 0x%08lx, size %uMB.\n",
  15232. + printk(KERN_INFO "mtd%d: %s at 0x%08lx, size %uMiB.\n",
  15233. mtd->index, ms02nv_name, addr, size >> 20);
  15234. mp->next = root_ms02nv_mtd;
  15235. @@ -293,12 +293,12 @@ static int __init ms02nv_init(void)
  15236. switch (mips_machtype) {
  15237. case MACH_DS5000_200:
  15238. - csr = (volatile u32 *)KN02_CSR_ADDR;
  15239. + csr = (volatile u32 *)KN02_CSR_BASE;
  15240. if (*csr & KN02_CSR_BNK32M)
  15241. stride = 2;
  15242. break;
  15243. case MACH_DS5000_2X0:
  15244. - case MACH_DS5000:
  15245. + case MACH_DS5900:
  15246. csr = (volatile u32 *)KN03_MCR_BASE;
  15247. if (*csr & KN03_MCR_BNK32M)
  15248. stride = 2;
  15249. Index: linux-2.4.35.4/drivers/mtd/devices/ms02-nv.h
  15250. ===================================================================
  15251. --- linux-2.4.35.4.orig/drivers/mtd/devices/ms02-nv.h
  15252. +++ linux-2.4.35.4/drivers/mtd/devices/ms02-nv.h
  15253. @@ -1,32 +1,96 @@
  15254. /*
  15255. - * Copyright (c) 2001 Maciej W. Rozycki
  15256. + * Copyright (c) 2001, 2003 Maciej W. Rozycki
  15257. *
  15258. - * This program is free software; you can redistribute it and/or
  15259. - * modify it under the terms of the GNU General Public License
  15260. - * as published by the Free Software Foundation; either version
  15261. - * 2 of the License, or (at your option) any later version.
  15262. + * DEC MS02-NV (54-20948-01) battery backed-up NVRAM module for
  15263. + * DECstation/DECsystem 5000/2x0 and DECsystem 5900 and 5900/260
  15264. + * systems.
  15265. + *
  15266. + * This program is free software; you can redistribute it and/or
  15267. + * modify it under the terms of the GNU General Public License
  15268. + * as published by the Free Software Foundation; either version
  15269. + * 2 of the License, or (at your option) any later version.
  15270. + *
  15271. + * $Id: ms02-nv.h,v 1.3 2003/08/19 09:25:36 dwmw2 Exp $
  15272. */
  15273. #include <linux/ioport.h>
  15274. #include <linux/mtd/mtd.h>
  15275. +/*
  15276. + * Addresses are decoded as follows:
  15277. + *
  15278. + * 0x000000 - 0x3fffff SRAM
  15279. + * 0x400000 - 0x7fffff CSR
  15280. + *
  15281. + * Within the SRAM area the following ranges are forced by the system
  15282. + * firmware:
  15283. + *
  15284. + * 0x000000 - 0x0003ff diagnostic area, destroyed upon a reboot
  15285. + * 0x000400 - ENDofRAM storage area, available to operating systems
  15286. + *
  15287. + * but we can't really use the available area right from 0x000400 as
  15288. + * the first word is used by the firmware as a status flag passed
  15289. + * from an operating system. If anything but the valid data magic
  15290. + * ID value is found, the firmware considers the SRAM clean, i.e.
  15291. + * containing no valid data, and disables the battery resulting in
  15292. + * data being erased as soon as power is switched off. So the choice
  15293. + * for the start address of the user-available is 0x001000 which is
  15294. + * nicely page aligned. The area between 0x000404 and 0x000fff may
  15295. + * be used by the driver for own needs.
  15296. + *
  15297. + * The diagnostic area defines two status words to be read by an
  15298. + * operating system, a magic ID to distinguish a MS02-NV board from
  15299. + * anything else and a status information providing results of tests
  15300. + * as well as the size of SRAM available, which can be 1MiB or 2MiB
  15301. + * (that's what the firmware handles; no idea if 2MiB modules ever
  15302. + * existed).
  15303. + *
  15304. + * The firmware only handles the MS02-NV board if installed in the
  15305. + * last (15th) slot, so for any other location the status information
  15306. + * stored in the SRAM cannot be relied upon. But from the hardware
  15307. + * point of view there is no problem using up to 14 such boards in a
  15308. + * system -- only the 1st slot needs to be filled with a DRAM module.
  15309. + * The MS02-NV board is ECC-protected, like other MS02 memory boards.
  15310. + *
  15311. + * The state of the battery as provided by the CSR is reflected on
  15312. + * the two onboard LEDs. When facing the battery side of the board,
  15313. + * with the LEDs at the top left and the battery at the bottom right
  15314. + * (i.e. looking from the back side of the system box), their meaning
  15315. + * is as follows (the system has to be powered on):
  15316. + *
  15317. + * left LED battery disable status: lit = enabled
  15318. + * right LED battery condition status: lit = OK
  15319. + */
  15320. +
  15321. /* MS02-NV iomem register offsets. */
  15322. #define MS02NV_CSR 0x400000 /* control & status register */
  15323. +/* MS02-NV CSR status bits. */
  15324. +#define MS02NV_CSR_BATT_OK 0x01 /* battery OK */
  15325. +#define MS02NV_CSR_BATT_OFF 0x02 /* battery disabled */
  15326. +
  15327. +
  15328. /* MS02-NV memory offsets. */
  15329. #define MS02NV_DIAG 0x0003f8 /* diagnostic status */
  15330. #define MS02NV_MAGIC 0x0003fc /* MS02-NV magic ID */
  15331. -#define MS02NV_RAM 0x000400 /* general-purpose RAM start */
  15332. +#define MS02NV_VALID 0x000400 /* valid data magic ID */
  15333. +#define MS02NV_RAM 0x001000 /* user-exposed RAM start */
  15334. -/* MS02-NV diagnostic status constants. */
  15335. -#define MS02NV_DIAG_SIZE_MASK 0xf0 /* RAM size mask */
  15336. -#define MS02NV_DIAG_SIZE_SHIFT 0x10 /* RAM size shift (left) */
  15337. +/* MS02-NV diagnostic status bits. */
  15338. +#define MS02NV_DIAG_TEST 0x01 /* SRAM test done (?) */
  15339. +#define MS02NV_DIAG_RO 0x02 /* SRAM r/o test done */
  15340. +#define MS02NV_DIAG_RW 0x04 /* SRAM r/w test done */
  15341. +#define MS02NV_DIAG_FAIL 0x08 /* SRAM test failed */
  15342. +#define MS02NV_DIAG_SIZE_MASK 0xf0 /* SRAM size mask */
  15343. +#define MS02NV_DIAG_SIZE_SHIFT 0x10 /* SRAM size shift (left) */
  15344. /* MS02-NV general constants. */
  15345. #define MS02NV_ID 0x03021966 /* MS02-NV magic ID value */
  15346. +#define MS02NV_VALID_ID 0xbd100248 /* valid data magic ID value */
  15347. #define MS02NV_SLOT_SIZE 0x800000 /* size of the address space
  15348. decoded by the module */
  15349. +
  15350. typedef volatile u32 ms02nv_uint;
  15351. struct ms02nv_private {
  15352. Index: linux-2.4.35.4/drivers/mtd/maps/Config.in
  15353. ===================================================================
  15354. --- linux-2.4.35.4.orig/drivers/mtd/maps/Config.in
  15355. +++ linux-2.4.35.4/drivers/mtd/maps/Config.in
  15356. @@ -51,11 +51,26 @@ if [ "$CONFIG_MIPS" = "y" ]; then
  15357. dep_tristate ' Pb1000 MTD support' CONFIG_MTD_PB1000 $CONFIG_MIPS_PB1000
  15358. dep_tristate ' Pb1500 MTD support' CONFIG_MTD_PB1500 $CONFIG_MIPS_PB1500
  15359. dep_tristate ' Pb1100 MTD support' CONFIG_MTD_PB1100 $CONFIG_MIPS_PB1100
  15360. + dep_tristate ' Bosporus MTD support' CONFIG_MTD_BOSPORUS $CONFIG_MIPS_BOSPORUS
  15361. + dep_tristate ' XXS1500 boot flash device' CONFIG_MTD_XXS1500 $CONFIG_MIPS_XXS1500
  15362. + dep_tristate ' MTX-1 flash device' CONFIG_MTD_MTX1 $CONFIG_MIPS_MTX1
  15363. if [ "$CONFIG_MTD_PB1500" = "y" -o "$CONFIG_MTD_PB1500" = "m" \
  15364. -o "$CONFIG_MTD_PB1100" = "y" -o "$CONFIG_MTD_PB1100" = "m" ]; then
  15365. bool ' Pb[15]00 boot flash device' CONFIG_MTD_PB1500_BOOT
  15366. bool ' Pb[15]00 user flash device (2nd 32MiB bank)' CONFIG_MTD_PB1500_USER
  15367. fi
  15368. + tristate ' Db1x00 MTD support' CONFIG_MTD_DB1X00
  15369. + if [ "$CONFIG_MTD_DB1X00" = "y" -o "$CONFIG_MTD_DB1X00" = "m" ]; then
  15370. + bool ' Db1x00 boot flash device' CONFIG_MTD_DB1X00_BOOT
  15371. + bool ' Db1x00 user flash device (2nd bank)' CONFIG_MTD_DB1X00_USER
  15372. + fi
  15373. + tristate ' Pb1550 MTD support' CONFIG_MTD_PB1550
  15374. + if [ "$CONFIG_MTD_PB1550" = "y" -o "$CONFIG_MTD_PB1550" = "m" ]; then
  15375. + bool ' Pb1550 Boot Flash' CONFIG_MTD_PB1550_BOOT
  15376. + bool ' Pb1550 User Parameter Flash' CONFIG_MTD_PB1550_USER
  15377. + fi
  15378. + dep_tristate ' Hydrogen 3 MTD support' CONFIG_MTD_HYDROGEN3 $CONFIG_MIPS_HYDROGEN3
  15379. + dep_tristate ' Mirage MTD support' CONFIG_MTD_MIRAGE $CONFIG_MIPS_MIRAGE
  15380. dep_tristate ' Flash chip mapping on ITE QED-4N-S01B, Globespan IVR or custom board' CONFIG_MTD_CSTM_MIPS_IXX $CONFIG_MTD_CFI $CONFIG_MTD_JEDEC $CONFIG_MTD_PARTITIONS
  15381. if [ "$CONFIG_MTD_CSTM_MIPS_IXX" = "y" -o "$CONFIG_MTD_CSTM_MIPS_IXX" = "m" ]; then
  15382. hex ' Physical start address of flash mapping' CONFIG_MTD_CSTM_MIPS_IXX_START 0x8000000
  15383. Index: linux-2.4.35.4/drivers/mtd/maps/db1x00-flash.c
  15384. ===================================================================
  15385. --- /dev/null
  15386. +++ linux-2.4.35.4/drivers/mtd/maps/db1x00-flash.c
  15387. @@ -0,0 +1,283 @@
  15388. +/*
  15389. + * Flash memory access on Alchemy Db1xxx boards
  15390. + *
  15391. + * (C) 2003 Pete Popov <[email protected]>
  15392. + *
  15393. + */
  15394. +
  15395. +#include <linux/config.h>
  15396. +#include <linux/module.h>
  15397. +#include <linux/types.h>
  15398. +#include <linux/kernel.h>
  15399. +
  15400. +#include <linux/mtd/mtd.h>
  15401. +#include <linux/mtd/map.h>
  15402. +#include <linux/mtd/partitions.h>
  15403. +
  15404. +#include <asm/io.h>
  15405. +#include <asm/au1000.h>
  15406. +#include <asm/db1x00.h>
  15407. +
  15408. +#ifdef DEBUG_RW
  15409. +#define DBG(x...) printk(x)
  15410. +#else
  15411. +#define DBG(x...)
  15412. +#endif
  15413. +
  15414. +static unsigned long window_addr;
  15415. +static unsigned long window_size;
  15416. +static unsigned long flash_size;
  15417. +
  15418. +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
  15419. +{
  15420. + __u8 ret;
  15421. + ret = __raw_readb(map->map_priv_1 + ofs);
  15422. + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  15423. + return ret;
  15424. +}
  15425. +
  15426. +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
  15427. +{
  15428. + __u16 ret;
  15429. + ret = __raw_readw(map->map_priv_1 + ofs);
  15430. + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  15431. + return ret;
  15432. +}
  15433. +
  15434. +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
  15435. +{
  15436. + __u32 ret;
  15437. + ret = __raw_readl(map->map_priv_1 + ofs);
  15438. + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  15439. + return ret;
  15440. +}
  15441. +
  15442. +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
  15443. +{
  15444. + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
  15445. + memcpy_fromio(to, map->map_priv_1 + from, len);
  15446. +}
  15447. +
  15448. +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
  15449. +{
  15450. + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  15451. + __raw_writeb(d, map->map_priv_1 + adr);
  15452. + mb();
  15453. +}
  15454. +
  15455. +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
  15456. +{
  15457. + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  15458. + __raw_writew(d, map->map_priv_1 + adr);
  15459. + mb();
  15460. +}
  15461. +
  15462. +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
  15463. +{
  15464. + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  15465. + __raw_writel(d, map->map_priv_1 + adr);
  15466. + mb();
  15467. +}
  15468. +
  15469. +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
  15470. +{
  15471. + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
  15472. + memcpy_toio(map->map_priv_1 + to, from, len);
  15473. +}
  15474. +
  15475. +static struct map_info db1x00_map = {
  15476. + name: "Db1x00 flash",
  15477. + read8: physmap_read8,
  15478. + read16: physmap_read16,
  15479. + read32: physmap_read32,
  15480. + copy_from: physmap_copy_from,
  15481. + write8: physmap_write8,
  15482. + write16: physmap_write16,
  15483. + write32: physmap_write32,
  15484. + copy_to: physmap_copy_to,
  15485. +};
  15486. +
  15487. +static unsigned char flash_buswidth = 4;
  15488. +
  15489. +/*
  15490. + * The Db1x boards support different flash densities. We setup
  15491. + * the mtd_partition structures below for default of 64Mbit
  15492. + * flash densities, and override the partitions sizes, if
  15493. + * necessary, after we check the board status register.
  15494. + */
  15495. +
  15496. +#ifdef DB1X00_BOTH_BANKS
  15497. +/* both banks will be used. Combine the first bank and the first
  15498. + * part of the second bank together into a single jffs/jffs2
  15499. + * partition.
  15500. + */
  15501. +static struct mtd_partition db1x00_partitions[] = {
  15502. + {
  15503. + name: "User FS",
  15504. + size: 0x1c00000,
  15505. + offset: 0x0000000
  15506. + },{
  15507. + name: "yamon",
  15508. + size: 0x0100000,
  15509. + offset: MTDPART_OFS_APPEND,
  15510. + mask_flags: MTD_WRITEABLE
  15511. + },{
  15512. + name: "raw kernel",
  15513. + size: (0x300000-0x40000), /* last 256KB is yamon env */
  15514. + offset: MTDPART_OFS_APPEND,
  15515. + }
  15516. +};
  15517. +#elif defined(DB1X00_BOOT_ONLY)
  15518. +static struct mtd_partition db1x00_partitions[] = {
  15519. + {
  15520. + name: "User FS",
  15521. + size: 0x00c00000,
  15522. + offset: 0x0000000
  15523. + },{
  15524. + name: "yamon",
  15525. + size: 0x0100000,
  15526. + offset: MTDPART_OFS_APPEND,
  15527. + mask_flags: MTD_WRITEABLE
  15528. + },{
  15529. + name: "raw kernel",
  15530. + size: (0x300000-0x40000), /* last 256KB is yamon env */
  15531. + offset: MTDPART_OFS_APPEND,
  15532. + }
  15533. +};
  15534. +#elif defined(DB1X00_USER_ONLY)
  15535. +static struct mtd_partition db1x00_partitions[] = {
  15536. + {
  15537. + name: "User FS",
  15538. + size: 0x0e00000,
  15539. + offset: 0x0000000
  15540. + },{
  15541. + name: "raw kernel",
  15542. + size: MTDPART_SIZ_FULL,
  15543. + offset: MTDPART_OFS_APPEND,
  15544. + }
  15545. +};
  15546. +#else
  15547. +#error MTD_DB1X00 define combo error /* should never happen */
  15548. +#endif
  15549. +
  15550. +
  15551. +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
  15552. +
  15553. +static struct mtd_partition *parsed_parts;
  15554. +static struct mtd_info *mymtd;
  15555. +
  15556. +/*
  15557. + * Probe the flash density and setup window address and size
  15558. + * based on user CONFIG options. There are times when we don't
  15559. + * want the MTD driver to be probing the boot or user flash,
  15560. + * so having the option to enable only one bank is important.
  15561. + */
  15562. +int setup_flash_params()
  15563. +{
  15564. + switch ((bcsr->status >> 14) & 0x3) {
  15565. + case 0: /* 64Mbit devices */
  15566. + flash_size = 0x800000; /* 8MB per part */
  15567. +#if defined(DB1X00_BOTH_BANKS)
  15568. + window_addr = 0x1E000000;
  15569. + window_size = 0x2000000;
  15570. +#elif defined(DB1X00_BOOT_ONLY)
  15571. + window_addr = 0x1F000000;
  15572. + window_size = 0x1000000;
  15573. +#else /* USER ONLY */
  15574. + window_addr = 0x1E000000;
  15575. + window_size = 0x1000000;
  15576. +#endif
  15577. + break;
  15578. + case 1:
  15579. + /* 128 Mbit devices */
  15580. + flash_size = 0x1000000; /* 16MB per part */
  15581. +#if defined(DB1X00_BOTH_BANKS)
  15582. + window_addr = 0x1C000000;
  15583. + window_size = 0x4000000;
  15584. + /* USERFS from 0x1C00 0000 to 0x1FC0 0000 */
  15585. + db1x00_partitions[0].size = 0x3C00000;
  15586. +#elif defined(DB1X00_BOOT_ONLY)
  15587. + window_addr = 0x1E000000;
  15588. + window_size = 0x2000000;
  15589. + /* USERFS from 0x1E00 0000 to 0x1FC0 0000 */
  15590. + db1x00_partitions[0].size = 0x1C00000;
  15591. +#else /* USER ONLY */
  15592. + window_addr = 0x1C000000;
  15593. + window_size = 0x2000000;
  15594. + /* USERFS from 0x1C00 0000 to 0x1DE00000 */
  15595. + db1x00_partitions[0].size = 0x1DE0000;
  15596. +#endif
  15597. + break;
  15598. + case 2:
  15599. + /* 256 Mbit devices */
  15600. + flash_size = 0x4000000; /* 64MB per part */
  15601. +#if defined(DB1X00_BOTH_BANKS)
  15602. + return 1;
  15603. +#elif defined(DB1X00_BOOT_ONLY)
  15604. + /* Boot ROM flash bank only; no user bank */
  15605. + window_addr = 0x1C000000;
  15606. + window_size = 0x4000000;
  15607. + /* USERFS from 0x1C00 0000 to 0x1FC00000 */
  15608. + db1x00_partitions[0].size = 0x3C00000;
  15609. +#else /* USER ONLY */
  15610. + return 1;
  15611. +#endif
  15612. + break;
  15613. + default:
  15614. + return 1;
  15615. + }
  15616. + return 0;
  15617. +}
  15618. +
  15619. +int __init db1x00_mtd_init(void)
  15620. +{
  15621. + struct mtd_partition *parts;
  15622. + int nb_parts = 0;
  15623. + char *part_type;
  15624. +
  15625. + /* Default flash buswidth */
  15626. + db1x00_map.buswidth = flash_buswidth;
  15627. +
  15628. + if (setup_flash_params())
  15629. + return -ENXIO;
  15630. +
  15631. + /*
  15632. + * Static partition definition selection
  15633. + */
  15634. + part_type = "static";
  15635. + parts = db1x00_partitions;
  15636. + nb_parts = NB_OF(db1x00_partitions);
  15637. + db1x00_map.size = window_size;
  15638. +
  15639. + /*
  15640. + * Now let's probe for the actual flash. Do it here since
  15641. + * specific machine settings might have been set above.
  15642. + */
  15643. + printk(KERN_NOTICE "Db1xxx flash: probing %d-bit flash bus\n",
  15644. + db1x00_map.buswidth*8);
  15645. + db1x00_map.map_priv_1 =
  15646. + (unsigned long)ioremap(window_addr, window_size);
  15647. + mymtd = do_map_probe("cfi_probe", &db1x00_map);
  15648. + if (!mymtd) return -ENXIO;
  15649. + mymtd->module = THIS_MODULE;
  15650. +
  15651. + add_mtd_partitions(mymtd, parts, nb_parts);
  15652. + return 0;
  15653. +}
  15654. +
  15655. +static void __exit db1x00_mtd_cleanup(void)
  15656. +{
  15657. + if (mymtd) {
  15658. + del_mtd_partitions(mymtd);
  15659. + map_destroy(mymtd);
  15660. + if (parsed_parts)
  15661. + kfree(parsed_parts);
  15662. + }
  15663. +}
  15664. +
  15665. +module_init(db1x00_mtd_init);
  15666. +module_exit(db1x00_mtd_cleanup);
  15667. +
  15668. +MODULE_AUTHOR("Pete Popov");
  15669. +MODULE_DESCRIPTION("Db1x00 mtd map driver");
  15670. +MODULE_LICENSE("GPL");
  15671. Index: linux-2.4.35.4/drivers/mtd/maps/hydrogen3-flash.c
  15672. ===================================================================
  15673. --- /dev/null
  15674. +++ linux-2.4.35.4/drivers/mtd/maps/hydrogen3-flash.c
  15675. @@ -0,0 +1,189 @@
  15676. +/*
  15677. + * Flash memory access on Alchemy HydrogenIII boards
  15678. + *
  15679. + * (C) 2003 Pete Popov <[email protected]>
  15680. + *
  15681. + */
  15682. +
  15683. +#include <linux/config.h>
  15684. +#include <linux/module.h>
  15685. +#include <linux/types.h>
  15686. +#include <linux/kernel.h>
  15687. +
  15688. +#include <linux/mtd/mtd.h>
  15689. +#include <linux/mtd/map.h>
  15690. +#include <linux/mtd/partitions.h>
  15691. +
  15692. +#include <asm/io.h>
  15693. +#include <asm/au1000.h>
  15694. +
  15695. +#ifdef DEBUG_RW
  15696. +#define DBG(x...) printk(x)
  15697. +#else
  15698. +#define DBG(x...)
  15699. +#endif
  15700. +
  15701. +#define WINDOW_ADDR 0x1E000000
  15702. +#define WINDOW_SIZE 0x02000000
  15703. +
  15704. +
  15705. +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
  15706. +{
  15707. + __u8 ret;
  15708. + ret = __raw_readb(map->map_priv_1 + ofs);
  15709. + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  15710. + return ret;
  15711. +}
  15712. +
  15713. +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
  15714. +{
  15715. + __u16 ret;
  15716. + ret = __raw_readw(map->map_priv_1 + ofs);
  15717. + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  15718. + return ret;
  15719. +}
  15720. +
  15721. +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
  15722. +{
  15723. + __u32 ret;
  15724. + ret = __raw_readl(map->map_priv_1 + ofs);
  15725. + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  15726. + return ret;
  15727. +}
  15728. +
  15729. +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
  15730. +{
  15731. + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
  15732. + memcpy_fromio(to, map->map_priv_1 + from, len);
  15733. +}
  15734. +
  15735. +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
  15736. +{
  15737. + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  15738. + __raw_writeb(d, map->map_priv_1 + adr);
  15739. + mb();
  15740. +}
  15741. +
  15742. +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
  15743. +{
  15744. + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  15745. + __raw_writew(d, map->map_priv_1 + adr);
  15746. + mb();
  15747. +}
  15748. +
  15749. +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
  15750. +{
  15751. + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  15752. + __raw_writel(d, map->map_priv_1 + adr);
  15753. + mb();
  15754. +}
  15755. +
  15756. +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
  15757. +{
  15758. + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
  15759. + memcpy_toio(map->map_priv_1 + to, from, len);
  15760. +}
  15761. +
  15762. +static struct map_info hydrogen3_map = {
  15763. + name: "HydrogenIII flash",
  15764. + read8: physmap_read8,
  15765. + read16: physmap_read16,
  15766. + read32: physmap_read32,
  15767. + copy_from: physmap_copy_from,
  15768. + write8: physmap_write8,
  15769. + write16: physmap_write16,
  15770. + write32: physmap_write32,
  15771. + copy_to: physmap_copy_to,
  15772. +};
  15773. +
  15774. +static unsigned char flash_buswidth = 4;
  15775. +
  15776. +/* MTDPART_OFS_APPEND is vastly preferred to any attempt at statically lining
  15777. + * up the offsets. */
  15778. +static struct mtd_partition hydrogen3_partitions[] = {
  15779. + {
  15780. + name: "User FS",
  15781. + size: 0x1c00000,
  15782. + offset: 0x0000000
  15783. + },{
  15784. + name: "yamon",
  15785. + size: 0x0100000,
  15786. + offset: MTDPART_OFS_APPEND,
  15787. + mask_flags: MTD_WRITEABLE
  15788. + },{
  15789. + name: "raw kernel",
  15790. + size: 0x02c0000,
  15791. + offset: MTDPART_OFS_APPEND
  15792. + }
  15793. +};
  15794. +
  15795. +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
  15796. +
  15797. +static struct mtd_partition *parsed_parts;
  15798. +static struct mtd_info *mymtd;
  15799. +
  15800. +int __init hydrogen3_mtd_init(void)
  15801. +{
  15802. + struct mtd_partition *parts;
  15803. + int nb_parts = 0;
  15804. + char *part_type;
  15805. +
  15806. + /* Default flash buswidth */
  15807. + hydrogen3_map.buswidth = flash_buswidth;
  15808. +
  15809. + /*
  15810. + * Static partition definition selection
  15811. + */
  15812. + part_type = "static";
  15813. + parts = hydrogen3_partitions;
  15814. + nb_parts = NB_OF(hydrogen3_partitions);
  15815. + hydrogen3_map.size = WINDOW_SIZE;
  15816. +
  15817. + /*
  15818. + * Now let's probe for the actual flash. Do it here since
  15819. + * specific machine settings might have been set above.
  15820. + */
  15821. + printk(KERN_NOTICE "HydrogenIII flash: probing %d-bit flash bus\n",
  15822. + hydrogen3_map.buswidth*8);
  15823. + hydrogen3_map.map_priv_1 =
  15824. + (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
  15825. + mymtd = do_map_probe("cfi_probe", &hydrogen3_map);
  15826. + if (!mymtd) return -ENXIO;
  15827. + mymtd->module = THIS_MODULE;
  15828. +
  15829. + add_mtd_partitions(mymtd, parts, nb_parts);
  15830. + return 0;
  15831. +}
  15832. +
  15833. +static void __exit hydrogen3_mtd_cleanup(void)
  15834. +{
  15835. + if (mymtd) {
  15836. + del_mtd_partitions(mymtd);
  15837. + map_destroy(mymtd);
  15838. + if (parsed_parts)
  15839. + kfree(parsed_parts);
  15840. + }
  15841. +}
  15842. +
  15843. +/*#ifndef MODULE
  15844. +
  15845. +static int __init _bootflashonly(char *str)
  15846. +{
  15847. + bootflashonly = simple_strtol(str, NULL, 0);
  15848. + return 1;
  15849. +}
  15850. +
  15851. +
  15852. +__setup("bootflashonly=", _bootflashonly);
  15853. +
  15854. +#endif*/
  15855. +
  15856. +
  15857. +module_init(hydrogen3_mtd_init);
  15858. +module_exit(hydrogen3_mtd_cleanup);
  15859. +
  15860. +MODULE_PARM(bootflashonly, "i");
  15861. +MODULE_PARM_DESC(bootflashonly, "1=use \"boot flash only\"");
  15862. +MODULE_AUTHOR("Pete Popov");
  15863. +MODULE_DESCRIPTION("HydrogenIII mtd map driver");
  15864. +MODULE_LICENSE("GPL");
  15865. Index: linux-2.4.35.4/drivers/mtd/maps/lasat.c
  15866. ===================================================================
  15867. --- linux-2.4.35.4.orig/drivers/mtd/maps/lasat.c
  15868. +++ linux-2.4.35.4/drivers/mtd/maps/lasat.c
  15869. @@ -1,15 +1,6 @@
  15870. /*
  15871. * Flash device on lasat 100 and 200 boards
  15872. *
  15873. - * Presumably (C) 2002 Brian Murphy <[email protected]> or whoever he
  15874. - * works for.
  15875. - *
  15876. - * This program is free software; you can redistribute it and/or
  15877. - * modify it under the terms of the GNU General Public License version
  15878. - * 2 as published by the Free Software Foundation.
  15879. - *
  15880. - * $Id: lasat.c,v 1.1 2003/01/24 14:26:38 dwmw2 Exp $
  15881. - *
  15882. */
  15883. #include <linux/module.h>
  15884. @@ -21,7 +12,6 @@
  15885. #include <linux/mtd/partitions.h>
  15886. #include <linux/config.h>
  15887. #include <asm/lasat/lasat.h>
  15888. -#include <asm/lasat/lasat_mtd.h>
  15889. static struct mtd_info *mymtd;
  15890. @@ -69,30 +59,33 @@ static void sp_copy_to(struct map_info *
  15891. }
  15892. static struct map_info sp_map = {
  15893. - .name = "SP flash",
  15894. - .buswidth = 4,
  15895. - .read8 = sp_read8,
  15896. - .read16 = sp_read16,
  15897. - .read32 = sp_read32,
  15898. - .copy_from = sp_copy_from,
  15899. - .write8 = sp_write8,
  15900. - .write16 = sp_write16,
  15901. - .write32 = sp_write32,
  15902. - .copy_to = sp_copy_to
  15903. + name: "SP flash",
  15904. + buswidth: 4,
  15905. + read8: sp_read8,
  15906. + read16: sp_read16,
  15907. + read32: sp_read32,
  15908. + copy_from: sp_copy_from,
  15909. + write8: sp_write8,
  15910. + write16: sp_write16,
  15911. + write32: sp_write32,
  15912. + copy_to: sp_copy_to
  15913. };
  15914. static struct mtd_partition partition_info[LASAT_MTD_LAST];
  15915. -static char *lasat_mtd_partnames[] = {"Bootloader", "Service", "Normal", "Filesystem", "Config"};
  15916. +static char *lasat_mtd_partnames[] = {"Bootloader", "Service", "Normal", "Config", "Filesystem"};
  15917. static int __init init_sp(void)
  15918. {
  15919. int i;
  15920. + int nparts = 0;
  15921. /* this does not play well with the old flash code which
  15922. * protects and uprotects the flash when necessary */
  15923. printk(KERN_NOTICE "Unprotecting flash\n");
  15924. *lasat_misc->flash_wp_reg |= 1 << lasat_misc->flash_wp_bit;
  15925. - sp_map.map_priv_1 = lasat_flash_partition_start(LASAT_MTD_BOOTLOADER);
  15926. + sp_map.map_priv_1 = ioremap_nocache(
  15927. + lasat_flash_partition_start(LASAT_MTD_BOOTLOADER),
  15928. + lasat_board_info.li_flash_size);
  15929. sp_map.size = lasat_board_info.li_flash_size;
  15930. printk(KERN_NOTICE "sp flash device: %lx at %lx\n",
  15931. @@ -109,12 +102,15 @@ static int __init init_sp(void)
  15932. for (i=0; i < LASAT_MTD_LAST; i++) {
  15933. size = lasat_flash_partition_size(i);
  15934. - partition_info[i].size = size;
  15935. - partition_info[i].offset = offset;
  15936. - offset += size;
  15937. + if (size != 0) {
  15938. + nparts++;
  15939. + partition_info[i].size = size;
  15940. + partition_info[i].offset = offset;
  15941. + offset += size;
  15942. + }
  15943. }
  15944. - add_mtd_partitions( mymtd, partition_info, LASAT_MTD_LAST );
  15945. + add_mtd_partitions( mymtd, partition_info, nparts );
  15946. return 0;
  15947. }
  15948. @@ -124,11 +120,11 @@ static int __init init_sp(void)
  15949. static void __exit cleanup_sp(void)
  15950. {
  15951. if (mymtd) {
  15952. - del_mtd_partitions(mymtd);
  15953. - map_destroy(mymtd);
  15954. + del_mtd_partitions(mymtd);
  15955. + map_destroy(mymtd);
  15956. }
  15957. if (sp_map.map_priv_1) {
  15958. - sp_map.map_priv_1 = 0;
  15959. + sp_map.map_priv_1 = 0;
  15960. }
  15961. }
  15962. Index: linux-2.4.35.4/drivers/mtd/maps/Makefile
  15963. ===================================================================
  15964. --- linux-2.4.35.4.orig/drivers/mtd/maps/Makefile
  15965. +++ linux-2.4.35.4/drivers/mtd/maps/Makefile
  15966. @@ -52,7 +52,13 @@ obj-$(CONFIG_MTD_PCI) += pci.o
  15967. obj-$(CONFIG_MTD_PB1000) += pb1xxx-flash.o
  15968. obj-$(CONFIG_MTD_PB1100) += pb1xxx-flash.o
  15969. obj-$(CONFIG_MTD_PB1500) += pb1xxx-flash.o
  15970. +obj-$(CONFIG_MTD_XXS1500) += xxs1500.o
  15971. +obj-$(CONFIG_MTD_MTX1) += mtx-1.o
  15972. obj-$(CONFIG_MTD_LASAT) += lasat.o
  15973. +obj-$(CONFIG_MTD_DB1X00) += db1x00-flash.o
  15974. +obj-$(CONFIG_MTD_PB1550) += pb1550-flash.o
  15975. +obj-$(CONFIG_MTD_HYDROGEN3) += hydrogen3-flash.o
  15976. +obj-$(CONFIG_MTD_BOSPORUS) += pb1xxx-flash.o
  15977. obj-$(CONFIG_MTD_AUTCPU12) += autcpu12-nvram.o
  15978. obj-$(CONFIG_MTD_EDB7312) += edb7312.o
  15979. obj-$(CONFIG_MTD_IMPA7) += impa7.o
  15980. @@ -61,5 +67,6 @@ obj-$(CONFIG_MTD_REDWOOD) += redwood.o
  15981. obj-$(CONFIG_MTD_UCLINUX) += uclinux.o
  15982. obj-$(CONFIG_MTD_NETtel) += nettel.o
  15983. obj-$(CONFIG_MTD_SCB2_FLASH) += scb2_flash.o
  15984. +obj-$(CONFIG_MTD_MIRAGE) += mirage-flash.o
  15985. include $(TOPDIR)/Rules.make
  15986. Index: linux-2.4.35.4/drivers/mtd/maps/mirage-flash.c
  15987. ===================================================================
  15988. --- /dev/null
  15989. +++ linux-2.4.35.4/drivers/mtd/maps/mirage-flash.c
  15990. @@ -0,0 +1,194 @@
  15991. +/*
  15992. + * Flash memory access on AMD Mirage board.
  15993. + *
  15994. + * (C) 2003 Embedded Edge
  15995. + * based on mirage-flash.c:
  15996. + * (C) 2003 Pete Popov <[email protected]>
  15997. + *
  15998. + */
  15999. +
  16000. +#include <linux/config.h>
  16001. +#include <linux/module.h>
  16002. +#include <linux/types.h>
  16003. +#include <linux/kernel.h>
  16004. +
  16005. +#include <linux/mtd/mtd.h>
  16006. +#include <linux/mtd/map.h>
  16007. +#include <linux/mtd/partitions.h>
  16008. +
  16009. +#include <asm/io.h>
  16010. +#include <asm/au1000.h>
  16011. +//#include <asm/mirage.h>
  16012. +
  16013. +#ifdef DEBUG_RW
  16014. +#define DBG(x...) printk(x)
  16015. +#else
  16016. +#define DBG(x...)
  16017. +#endif
  16018. +
  16019. +static unsigned long window_addr;
  16020. +static unsigned long window_size;
  16021. +static unsigned long flash_size;
  16022. +
  16023. +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
  16024. +{
  16025. + __u8 ret;
  16026. + ret = __raw_readb(map->map_priv_1 + ofs);
  16027. + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  16028. + return ret;
  16029. +}
  16030. +
  16031. +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
  16032. +{
  16033. + __u16 ret;
  16034. + ret = __raw_readw(map->map_priv_1 + ofs);
  16035. + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  16036. + return ret;
  16037. +}
  16038. +
  16039. +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
  16040. +{
  16041. + __u32 ret;
  16042. + ret = __raw_readl(map->map_priv_1 + ofs);
  16043. + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  16044. + return ret;
  16045. +}
  16046. +
  16047. +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
  16048. +{
  16049. + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
  16050. + memcpy_fromio(to, map->map_priv_1 + from, len);
  16051. +}
  16052. +
  16053. +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
  16054. +{
  16055. + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  16056. + __raw_writeb(d, map->map_priv_1 + adr);
  16057. + mb();
  16058. +}
  16059. +
  16060. +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
  16061. +{
  16062. + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  16063. + __raw_writew(d, map->map_priv_1 + adr);
  16064. + mb();
  16065. +}
  16066. +
  16067. +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
  16068. +{
  16069. + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  16070. + __raw_writel(d, map->map_priv_1 + adr);
  16071. + mb();
  16072. +}
  16073. +
  16074. +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
  16075. +{
  16076. + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
  16077. + memcpy_toio(map->map_priv_1 + to, from, len);
  16078. +}
  16079. +
  16080. +static struct map_info mirage_map = {
  16081. + name: "Mirage flash",
  16082. + read8: physmap_read8,
  16083. + read16: physmap_read16,
  16084. + read32: physmap_read32,
  16085. + copy_from: physmap_copy_from,
  16086. + write8: physmap_write8,
  16087. + write16: physmap_write16,
  16088. + write32: physmap_write32,
  16089. + copy_to: physmap_copy_to,
  16090. +};
  16091. +
  16092. +static unsigned char flash_buswidth = 4;
  16093. +
  16094. +static struct mtd_partition mirage_partitions[] = {
  16095. + {
  16096. + name: "User FS",
  16097. + size: 0x1c00000,
  16098. + offset: 0x0000000
  16099. + },{
  16100. + name: "yamon",
  16101. + size: 0x0100000,
  16102. + offset: MTDPART_OFS_APPEND,
  16103. + mask_flags: MTD_WRITEABLE
  16104. + },{
  16105. + name: "raw kernel",
  16106. + size: (0x300000-0x40000), /* last 256KB is yamon env */
  16107. + offset: MTDPART_OFS_APPEND,
  16108. + }
  16109. +};
  16110. +
  16111. +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
  16112. +
  16113. +static struct mtd_partition *parsed_parts;
  16114. +static struct mtd_info *mymtd;
  16115. +
  16116. +/*
  16117. + * Probe the flash density and setup window address and size
  16118. + * based on user CONFIG options. There are times when we don't
  16119. + * want the MTD driver to be probing the boot or user flash,
  16120. + * so having the option to enable only one bank is important.
  16121. + */
  16122. +int setup_flash_params()
  16123. +{
  16124. + flash_size = 0x4000000; /* 64MB per part */
  16125. + /* Boot ROM flash bank only; no user bank */
  16126. + window_addr = 0x1C000000;
  16127. + window_size = 0x4000000;
  16128. + /* USERFS from 0x1C00 0000 to 0x1FC00000 */
  16129. + mirage_partitions[0].size = 0x3C00000;
  16130. + return 0;
  16131. +}
  16132. +
  16133. +int __init mirage_mtd_init(void)
  16134. +{
  16135. + struct mtd_partition *parts;
  16136. + int nb_parts = 0;
  16137. + char *part_type;
  16138. +
  16139. + /* Default flash buswidth */
  16140. + mirage_map.buswidth = flash_buswidth;
  16141. +
  16142. + if (setup_flash_params())
  16143. + return -ENXIO;
  16144. +
  16145. + /*
  16146. + * Static partition definition selection
  16147. + */
  16148. + part_type = "static";
  16149. + parts = mirage_partitions;
  16150. + nb_parts = NB_OF(mirage_partitions);
  16151. + mirage_map.size = window_size;
  16152. +
  16153. + /*
  16154. + * Now let's probe for the actual flash. Do it here since
  16155. + * specific machine settings might have been set above.
  16156. + */
  16157. + printk(KERN_NOTICE "Mirage flash: probing %d-bit flash bus\n",
  16158. + mirage_map.buswidth*8);
  16159. + mirage_map.map_priv_1 =
  16160. + (unsigned long)ioremap(window_addr, window_size);
  16161. + mymtd = do_map_probe("cfi_probe", &mirage_map);
  16162. + if (!mymtd) return -ENXIO;
  16163. + mymtd->module = THIS_MODULE;
  16164. +
  16165. + add_mtd_partitions(mymtd, parts, nb_parts);
  16166. + return 0;
  16167. +}
  16168. +
  16169. +static void __exit mirage_mtd_cleanup(void)
  16170. +{
  16171. + if (mymtd) {
  16172. + del_mtd_partitions(mymtd);
  16173. + map_destroy(mymtd);
  16174. + if (parsed_parts)
  16175. + kfree(parsed_parts);
  16176. + }
  16177. +}
  16178. +
  16179. +module_init(mirage_mtd_init);
  16180. +module_exit(mirage_mtd_cleanup);
  16181. +
  16182. +MODULE_AUTHOR("Embedded Edge");
  16183. +MODULE_DESCRIPTION("Mirage mtd map driver");
  16184. +MODULE_LICENSE("GPL");
  16185. Index: linux-2.4.35.4/drivers/mtd/maps/mtx-1.c
  16186. ===================================================================
  16187. --- /dev/null
  16188. +++ linux-2.4.35.4/drivers/mtd/maps/mtx-1.c
  16189. @@ -0,0 +1,181 @@
  16190. +/*
  16191. + * Flash memory access on 4G Systems MTX-1 board
  16192. + *
  16193. + * (C) 2003 Pete Popov <[email protected]>
  16194. + * Bruno Randolf <[email protected]>
  16195. + */
  16196. +
  16197. +#include <linux/config.h>
  16198. +#include <linux/module.h>
  16199. +#include <linux/types.h>
  16200. +#include <linux/kernel.h>
  16201. +
  16202. +#include <linux/mtd/mtd.h>
  16203. +#include <linux/mtd/map.h>
  16204. +#include <linux/mtd/partitions.h>
  16205. +
  16206. +#include <asm/io.h>
  16207. +#include <asm/au1000.h>
  16208. +
  16209. +#ifdef DEBUG_RW
  16210. +#define DBG(x...) printk(x)
  16211. +#else
  16212. +#define DBG(x...)
  16213. +#endif
  16214. +
  16215. +#ifdef CONFIG_MIPS_MTX1
  16216. +#define WINDOW_ADDR 0x1E000000
  16217. +#define WINDOW_SIZE 0x2000000
  16218. +#endif
  16219. +
  16220. +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
  16221. +{
  16222. + __u8 ret;
  16223. + ret = __raw_readb(map->map_priv_1 + ofs);
  16224. + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  16225. + return ret;
  16226. +}
  16227. +
  16228. +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
  16229. +{
  16230. + __u16 ret;
  16231. + ret = __raw_readw(map->map_priv_1 + ofs);
  16232. + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  16233. + return ret;
  16234. +}
  16235. +
  16236. +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
  16237. +{
  16238. + __u32 ret;
  16239. + ret = __raw_readl(map->map_priv_1 + ofs);
  16240. + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  16241. + return ret;
  16242. +}
  16243. +
  16244. +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
  16245. +{
  16246. + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
  16247. + memcpy_fromio(to, map->map_priv_1 + from, len);
  16248. +}
  16249. +
  16250. +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
  16251. +{
  16252. + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  16253. + __raw_writeb(d, map->map_priv_1 + adr);
  16254. + mb();
  16255. +}
  16256. +
  16257. +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
  16258. +{
  16259. + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  16260. + __raw_writew(d, map->map_priv_1 + adr);
  16261. + mb();
  16262. +}
  16263. +
  16264. +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
  16265. +{
  16266. + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  16267. + __raw_writel(d, map->map_priv_1 + adr);
  16268. + mb();
  16269. +}
  16270. +
  16271. +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
  16272. +{
  16273. + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
  16274. + memcpy_toio(map->map_priv_1 + to, from, len);
  16275. +}
  16276. +
  16277. +
  16278. +
  16279. +static struct map_info mtx1_map = {
  16280. + name: "MTX-1 flash",
  16281. + read8: physmap_read8,
  16282. + read16: physmap_read16,
  16283. + read32: physmap_read32,
  16284. + copy_from: physmap_copy_from,
  16285. + write8: physmap_write8,
  16286. + write16: physmap_write16,
  16287. + write32: physmap_write32,
  16288. + copy_to: physmap_copy_to,
  16289. +};
  16290. +
  16291. +
  16292. +static unsigned long flash_size = 0x01000000;
  16293. +static unsigned char flash_buswidth = 4;
  16294. +static struct mtd_partition mtx1_partitions[] = {
  16295. + {
  16296. + name: "user fs",
  16297. + size: 0x1c00000,
  16298. + offset: 0,
  16299. + },{
  16300. + name: "yamon",
  16301. + size: 0x0100000,
  16302. + offset: MTDPART_OFS_APPEND,
  16303. + mask_flags: MTD_WRITEABLE
  16304. + },{
  16305. + name: "raw kernel",
  16306. + size: 0x02c0000,
  16307. + offset: MTDPART_OFS_APPEND,
  16308. + },{
  16309. + name: "yamon env vars",
  16310. + size: 0x0040000,
  16311. + offset: MTDPART_OFS_APPEND,
  16312. + mask_flags: MTD_WRITEABLE
  16313. + }
  16314. +};
  16315. +
  16316. +
  16317. +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
  16318. +
  16319. +static struct mtd_partition *parsed_parts;
  16320. +static struct mtd_info *mymtd;
  16321. +
  16322. +int __init mtx1_mtd_init(void)
  16323. +{
  16324. + struct mtd_partition *parts;
  16325. + int nb_parts = 0;
  16326. + char *part_type;
  16327. +
  16328. + /* Default flash buswidth */
  16329. + mtx1_map.buswidth = flash_buswidth;
  16330. +
  16331. + /*
  16332. + * Static partition definition selection
  16333. + */
  16334. + part_type = "static";
  16335. + parts = mtx1_partitions;
  16336. + nb_parts = NB_OF(mtx1_partitions);
  16337. + mtx1_map.size = flash_size;
  16338. +
  16339. + /*
  16340. + * Now let's probe for the actual flash. Do it here since
  16341. + * specific machine settings might have been set above.
  16342. + */
  16343. + printk(KERN_NOTICE "MTX-1 flash: probing %d-bit flash bus\n",
  16344. + mtx1_map.buswidth*8);
  16345. + mtx1_map.map_priv_1 =
  16346. + (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
  16347. + mymtd = do_map_probe("cfi_probe", &mtx1_map);
  16348. + if (!mymtd) return -ENXIO;
  16349. + mymtd->module = THIS_MODULE;
  16350. +
  16351. + add_mtd_partitions(mymtd, parts, nb_parts);
  16352. + return 0;
  16353. +}
  16354. +
  16355. +static void __exit mtx1_mtd_cleanup(void)
  16356. +{
  16357. + if (mymtd) {
  16358. + del_mtd_partitions(mymtd);
  16359. + map_destroy(mymtd);
  16360. + if (parsed_parts)
  16361. + kfree(parsed_parts);
  16362. + }
  16363. +}
  16364. +
  16365. +module_init(mtx1_mtd_init);
  16366. +module_exit(mtx1_mtd_cleanup);
  16367. +
  16368. +MODULE_AUTHOR("Pete Popov");
  16369. +MODULE_DESCRIPTION("MTX-1 CFI map driver");
  16370. +MODULE_LICENSE("GPL");
  16371. Index: linux-2.4.35.4/drivers/mtd/maps/pb1550-flash.c
  16372. ===================================================================
  16373. --- /dev/null
  16374. +++ linux-2.4.35.4/drivers/mtd/maps/pb1550-flash.c
  16375. @@ -0,0 +1,270 @@
  16376. +/*
  16377. + * Flash memory access on Alchemy Pb1550 board
  16378. + *
  16379. + * (C) 2004 Embedded Edge, LLC, based on pb1550-flash.c:
  16380. + * (C) 2003 Pete Popov <[email protected]>
  16381. + *
  16382. + */
  16383. +
  16384. +#include <linux/config.h>
  16385. +#include <linux/module.h>
  16386. +#include <linux/types.h>
  16387. +#include <linux/kernel.h>
  16388. +
  16389. +#include <linux/mtd/mtd.h>
  16390. +#include <linux/mtd/map.h>
  16391. +#include <linux/mtd/partitions.h>
  16392. +
  16393. +#include <asm/io.h>
  16394. +#include <asm/au1000.h>
  16395. +#include <asm/pb1550.h>
  16396. +
  16397. +#ifdef DEBUG_RW
  16398. +#define DBG(x...) printk(x)
  16399. +#else
  16400. +#define DBG(x...)
  16401. +#endif
  16402. +
  16403. +static unsigned long window_addr;
  16404. +static unsigned long window_size;
  16405. +
  16406. +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
  16407. +{
  16408. + __u8 ret;
  16409. + ret = __raw_readb(map->map_priv_1 + ofs);
  16410. + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  16411. + return ret;
  16412. +}
  16413. +
  16414. +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
  16415. +{
  16416. + __u16 ret;
  16417. + ret = __raw_readw(map->map_priv_1 + ofs);
  16418. + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  16419. + return ret;
  16420. +}
  16421. +
  16422. +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
  16423. +{
  16424. + __u32 ret;
  16425. + ret = __raw_readl(map->map_priv_1 + ofs);
  16426. + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  16427. + return ret;
  16428. +}
  16429. +
  16430. +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
  16431. +{
  16432. + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
  16433. + memcpy_fromio(to, map->map_priv_1 + from, len);
  16434. +}
  16435. +
  16436. +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
  16437. +{
  16438. + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  16439. + __raw_writeb(d, map->map_priv_1 + adr);
  16440. + mb();
  16441. +}
  16442. +
  16443. +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
  16444. +{
  16445. + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  16446. + __raw_writew(d, map->map_priv_1 + adr);
  16447. + mb();
  16448. +}
  16449. +
  16450. +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
  16451. +{
  16452. + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  16453. + __raw_writel(d, map->map_priv_1 + adr);
  16454. + mb();
  16455. +}
  16456. +
  16457. +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
  16458. +{
  16459. + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
  16460. + memcpy_toio(map->map_priv_1 + to, from, len);
  16461. +}
  16462. +
  16463. +static struct map_info pb1550_map = {
  16464. + name: "Pb1550 flash",
  16465. + read8: physmap_read8,
  16466. + read16: physmap_read16,
  16467. + read32: physmap_read32,
  16468. + copy_from: physmap_copy_from,
  16469. + write8: physmap_write8,
  16470. + write16: physmap_write16,
  16471. + write32: physmap_write32,
  16472. + copy_to: physmap_copy_to,
  16473. +};
  16474. +
  16475. +static unsigned char flash_buswidth = 4;
  16476. +
  16477. +/*
  16478. + * Support only 64MB NOR Flash parts
  16479. + */
  16480. +
  16481. +#ifdef PB1550_BOTH_BANKS
  16482. +/* both banks will be used. Combine the first bank and the first
  16483. + * part of the second bank together into a single jffs/jffs2
  16484. + * partition.
  16485. + */
  16486. +static struct mtd_partition pb1550_partitions[] = {
  16487. + /* assume boot[2:0]:swap is '0000' or '1000', which translates to:
  16488. + * 1C00 0000 1FFF FFFF CE0 64MB Boot NOR Flash
  16489. + * 1800 0000 1BFF FFFF CE0 64MB Param NOR Flash
  16490. + */
  16491. + {
  16492. + name: "User FS",
  16493. + size: (0x1FC00000 - 0x18000000),
  16494. + offset: 0x0000000
  16495. + },{
  16496. + name: "yamon",
  16497. + size: 0x0100000,
  16498. + offset: MTDPART_OFS_APPEND,
  16499. + mask_flags: MTD_WRITEABLE
  16500. + },{
  16501. + name: "raw kernel",
  16502. + size: (0x300000 - 0x40000), /* last 256KB is yamon env */
  16503. + offset: MTDPART_OFS_APPEND,
  16504. + }
  16505. +};
  16506. +#elif defined(PB1550_BOOT_ONLY)
  16507. +static struct mtd_partition pb1550_partitions[] = {
  16508. + /* assume boot[2:0]:swap is '0000' or '1000', which translates to:
  16509. + * 1C00 0000 1FFF FFFF CE0 64MB Boot NOR Flash
  16510. + */
  16511. + {
  16512. + name: "User FS",
  16513. + size: 0x03c00000,
  16514. + offset: 0x0000000
  16515. + },{
  16516. + name: "yamon",
  16517. + size: 0x0100000,
  16518. + offset: MTDPART_OFS_APPEND,
  16519. + mask_flags: MTD_WRITEABLE
  16520. + },{
  16521. + name: "raw kernel",
  16522. + size: (0x300000-0x40000), /* last 256KB is yamon env */
  16523. + offset: MTDPART_OFS_APPEND,
  16524. + }
  16525. +};
  16526. +#elif defined(PB1550_USER_ONLY)
  16527. +static struct mtd_partition pb1550_partitions[] = {
  16528. + /* assume boot[2:0]:swap is '0000' or '1000', which translates to:
  16529. + * 1800 0000 1BFF FFFF CE0 64MB Param NOR Flash
  16530. + */
  16531. + {
  16532. + name: "User FS",
  16533. + size: (0x4000000 - 0x200000), /* reserve 2MB for raw kernel */
  16534. + offset: 0x0000000
  16535. + },{
  16536. + name: "raw kernel",
  16537. + size: MTDPART_SIZ_FULL,
  16538. + offset: MTDPART_OFS_APPEND,
  16539. + }
  16540. +};
  16541. +#else
  16542. +#error MTD_PB1550 define combo error /* should never happen */
  16543. +#endif
  16544. +
  16545. +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
  16546. +
  16547. +static struct mtd_partition *parsed_parts;
  16548. +static struct mtd_info *mymtd;
  16549. +
  16550. +/*
  16551. + * Probe the flash density and setup window address and size
  16552. + * based on user CONFIG options. There are times when we don't
  16553. + * want the MTD driver to be probing the boot or user flash,
  16554. + * so having the option to enable only one bank is important.
  16555. + */
  16556. +int setup_flash_params()
  16557. +{
  16558. + u16 boot_swapboot;
  16559. + boot_swapboot = (au_readl(MEM_STSTAT) & (0x7<<1)) |
  16560. + ((bcsr->status >> 6) & 0x1);
  16561. + printk("Pb1550 MTD: boot:swap %d\n", boot_swapboot);
  16562. +
  16563. + switch (boot_swapboot) {
  16564. + case 0: /* 512Mbit devices, both enabled */
  16565. + case 1:
  16566. + case 8:
  16567. + case 9:
  16568. +#if defined(PB1550_BOTH_BANKS)
  16569. + window_addr = 0x18000000;
  16570. + window_size = 0x8000000;
  16571. +#elif defined(PB1550_BOOT_ONLY)
  16572. + window_addr = 0x1C000000;
  16573. + window_size = 0x4000000;
  16574. +#else /* USER ONLY */
  16575. + window_addr = 0x1E000000;
  16576. + window_size = 0x1000000;
  16577. +#endif
  16578. + break;
  16579. + case 0xC:
  16580. + case 0xD:
  16581. + case 0xE:
  16582. + case 0xF:
  16583. + /* 64 MB Boot NOR Flash is disabled */
  16584. + /* and the start address is moved to 0x0C00000 */
  16585. + window_addr = 0x0C000000;
  16586. + window_size = 0x4000000;
  16587. + default:
  16588. + printk("Pb1550 MTD: unsupported boot:swap setting\n");
  16589. + return 1;
  16590. + }
  16591. + return 0;
  16592. +}
  16593. +
  16594. +int __init pb1550_mtd_init(void)
  16595. +{
  16596. + struct mtd_partition *parts;
  16597. + int nb_parts = 0;
  16598. + char *part_type;
  16599. +
  16600. + /* Default flash buswidth */
  16601. + pb1550_map.buswidth = flash_buswidth;
  16602. +
  16603. + if (setup_flash_params())
  16604. + return -ENXIO;
  16605. +
  16606. + /*
  16607. + * Static partition definition selection
  16608. + */
  16609. + part_type = "static";
  16610. + parts = pb1550_partitions;
  16611. + nb_parts = NB_OF(pb1550_partitions);
  16612. + pb1550_map.size = window_size;
  16613. +
  16614. + /*
  16615. + * Now let's probe for the actual flash. Do it here since
  16616. + * specific machine settings might have been set above.
  16617. + */
  16618. + printk(KERN_NOTICE "Pb1550 flash: probing %d-bit flash bus\n",
  16619. + pb1550_map.buswidth*8);
  16620. + pb1550_map.map_priv_1 =
  16621. + (unsigned long)ioremap(window_addr, window_size);
  16622. + mymtd = do_map_probe("cfi_probe", &pb1550_map);
  16623. + if (!mymtd) return -ENXIO;
  16624. + mymtd->module = THIS_MODULE;
  16625. +
  16626. + add_mtd_partitions(mymtd, parts, nb_parts);
  16627. + return 0;
  16628. +}
  16629. +
  16630. +static void __exit pb1550_mtd_cleanup(void)
  16631. +{
  16632. + if (mymtd) {
  16633. + del_mtd_partitions(mymtd);
  16634. + map_destroy(mymtd);
  16635. + if (parsed_parts)
  16636. + kfree(parsed_parts);
  16637. + }
  16638. +}
  16639. +
  16640. +module_init(pb1550_mtd_init);
  16641. +module_exit(pb1550_mtd_cleanup);
  16642. +
  16643. +MODULE_AUTHOR("Embedded Edge, LLC");
  16644. +MODULE_DESCRIPTION("Pb1550 mtd map driver");
  16645. +MODULE_LICENSE("GPL");
  16646. Index: linux-2.4.35.4/drivers/mtd/maps/pb1xxx-flash.c
  16647. ===================================================================
  16648. --- linux-2.4.35.4.orig/drivers/mtd/maps/pb1xxx-flash.c
  16649. +++ linux-2.4.35.4/drivers/mtd/maps/pb1xxx-flash.c
  16650. @@ -192,6 +192,34 @@ static struct mtd_partition pb1xxx_parti
  16651. #else
  16652. #error MTD_PB1500 define combo error /* should never happen */
  16653. #endif
  16654. +#elif defined(CONFIG_MTD_BOSPORUS)
  16655. +static unsigned char flash_buswidth = 2;
  16656. +static unsigned long flash_size = 0x02000000;
  16657. +#define WINDOW_ADDR 0x1F000000
  16658. +#define WINDOW_SIZE 0x2000000
  16659. +static struct mtd_partition pb1xxx_partitions[] = {
  16660. + {
  16661. + name: "User FS",
  16662. + size: 0x00400000,
  16663. + offset: 0x00000000,
  16664. + },{
  16665. + name: "Yamon-2",
  16666. + size: 0x00100000,
  16667. + offset: 0x00400000,
  16668. + },{
  16669. + name: "Root FS",
  16670. + size: 0x00700000,
  16671. + offset: 0x00500000,
  16672. + },{
  16673. + name: "Yamon-1",
  16674. + size: 0x00100000,
  16675. + offset: 0x00C00000,
  16676. + },{
  16677. + name: "Kernel",
  16678. + size: 0x00300000,
  16679. + offset: 0x00D00000,
  16680. + }
  16681. +};
  16682. #else
  16683. #error Unsupported board
  16684. #endif
  16685. Index: linux-2.4.35.4/drivers/mtd/maps/xxs1500.c
  16686. ===================================================================
  16687. --- /dev/null
  16688. +++ linux-2.4.35.4/drivers/mtd/maps/xxs1500.c
  16689. @@ -0,0 +1,186 @@
  16690. +/*
  16691. + * Flash memory access on MyCable XXS1500 board
  16692. + *
  16693. + * (C) 2003 Pete Popov <[email protected]>
  16694. + *
  16695. + * $Id: xxs1500.c,v 1.1.2.1 2003/06/13 21:15:46 ppopov Exp $
  16696. + */
  16697. +
  16698. +#include <linux/config.h>
  16699. +#include <linux/module.h>
  16700. +#include <linux/types.h>
  16701. +#include <linux/kernel.h>
  16702. +
  16703. +#include <linux/mtd/mtd.h>
  16704. +#include <linux/mtd/map.h>
  16705. +#include <linux/mtd/partitions.h>
  16706. +
  16707. +#include <asm/io.h>
  16708. +#include <asm/au1000.h>
  16709. +
  16710. +#ifdef DEBUG_RW
  16711. +#define DBG(x...) printk(x)
  16712. +#else
  16713. +#define DBG(x...)
  16714. +#endif
  16715. +
  16716. +#ifdef CONFIG_MIPS_XXS1500
  16717. +#define WINDOW_ADDR 0x1F000000
  16718. +#define WINDOW_SIZE 0x1000000
  16719. +#endif
  16720. +
  16721. +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
  16722. +{
  16723. + __u8 ret;
  16724. + ret = __raw_readb(map->map_priv_1 + ofs);
  16725. + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  16726. + return ret;
  16727. +}
  16728. +
  16729. +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
  16730. +{
  16731. + __u16 ret;
  16732. + ret = __raw_readw(map->map_priv_1 + ofs);
  16733. + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  16734. + return ret;
  16735. +}
  16736. +
  16737. +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
  16738. +{
  16739. + __u32 ret;
  16740. + ret = __raw_readl(map->map_priv_1 + ofs);
  16741. + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  16742. + return ret;
  16743. +}
  16744. +
  16745. +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
  16746. +{
  16747. + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
  16748. + memcpy_fromio(to, map->map_priv_1 + from, len);
  16749. +}
  16750. +
  16751. +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
  16752. +{
  16753. + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  16754. + __raw_writeb(d, map->map_priv_1 + adr);
  16755. + mb();
  16756. +}
  16757. +
  16758. +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
  16759. +{
  16760. + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  16761. + __raw_writew(d, map->map_priv_1 + adr);
  16762. + mb();
  16763. +}
  16764. +
  16765. +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
  16766. +{
  16767. + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  16768. + __raw_writel(d, map->map_priv_1 + adr);
  16769. + mb();
  16770. +}
  16771. +
  16772. +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
  16773. +{
  16774. + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
  16775. + memcpy_toio(map->map_priv_1 + to, from, len);
  16776. +}
  16777. +
  16778. +
  16779. +
  16780. +static struct map_info xxs1500_map = {
  16781. + name: "XXS1500 flash",
  16782. + read8: physmap_read8,
  16783. + read16: physmap_read16,
  16784. + read32: physmap_read32,
  16785. + copy_from: physmap_copy_from,
  16786. + write8: physmap_write8,
  16787. + write16: physmap_write16,
  16788. + write32: physmap_write32,
  16789. + copy_to: physmap_copy_to,
  16790. +};
  16791. +
  16792. +
  16793. +static unsigned long flash_size = 0x00800000;
  16794. +static unsigned char flash_buswidth = 4;
  16795. +static struct mtd_partition xxs1500_partitions[] = {
  16796. + {
  16797. + name: "kernel image",
  16798. + size: 0x00200000,
  16799. + offset: 0,
  16800. + },{
  16801. + name: "user fs 0",
  16802. + size: (0x00C00000-0x200000),
  16803. + offset: MTDPART_OFS_APPEND,
  16804. + },{
  16805. + name: "yamon",
  16806. + size: 0x00100000,
  16807. + offset: MTDPART_OFS_APPEND,
  16808. + mask_flags: MTD_WRITEABLE
  16809. + },{
  16810. + name: "user fs 1",
  16811. + size: 0x2c0000,
  16812. + offset: MTDPART_OFS_APPEND,
  16813. + },{
  16814. + name: "yamon env vars",
  16815. + size: 0x040000,
  16816. + offset: MTDPART_OFS_APPEND,
  16817. + mask_flags: MTD_WRITEABLE
  16818. + }
  16819. +};
  16820. +
  16821. +
  16822. +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
  16823. +
  16824. +static struct mtd_partition *parsed_parts;
  16825. +static struct mtd_info *mymtd;
  16826. +
  16827. +int __init xxs1500_mtd_init(void)
  16828. +{
  16829. + struct mtd_partition *parts;
  16830. + int nb_parts = 0;
  16831. + char *part_type;
  16832. +
  16833. + /* Default flash buswidth */
  16834. + xxs1500_map.buswidth = flash_buswidth;
  16835. +
  16836. + /*
  16837. + * Static partition definition selection
  16838. + */
  16839. + part_type = "static";
  16840. + parts = xxs1500_partitions;
  16841. + nb_parts = NB_OF(xxs1500_partitions);
  16842. + xxs1500_map.size = flash_size;
  16843. +
  16844. + /*
  16845. + * Now let's probe for the actual flash. Do it here since
  16846. + * specific machine settings might have been set above.
  16847. + */
  16848. + printk(KERN_NOTICE "XXS1500 flash: probing %d-bit flash bus\n",
  16849. + xxs1500_map.buswidth*8);
  16850. + xxs1500_map.map_priv_1 =
  16851. + (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
  16852. + mymtd = do_map_probe("cfi_probe", &xxs1500_map);
  16853. + if (!mymtd) return -ENXIO;
  16854. + mymtd->module = THIS_MODULE;
  16855. +
  16856. + add_mtd_partitions(mymtd, parts, nb_parts);
  16857. + return 0;
  16858. +}
  16859. +
  16860. +static void __exit xxs1500_mtd_cleanup(void)
  16861. +{
  16862. + if (mymtd) {
  16863. + del_mtd_partitions(mymtd);
  16864. + map_destroy(mymtd);
  16865. + if (parsed_parts)
  16866. + kfree(parsed_parts);
  16867. + }
  16868. +}
  16869. +
  16870. +module_init(xxs1500_mtd_init);
  16871. +module_exit(xxs1500_mtd_cleanup);
  16872. +
  16873. +MODULE_AUTHOR("Pete Popov");
  16874. +MODULE_DESCRIPTION("XXS1500 CFI map driver");
  16875. +MODULE_LICENSE("GPL");
  16876. Index: linux-2.4.35.4/drivers/net/defxx.c
  16877. ===================================================================
  16878. --- linux-2.4.35.4.orig/drivers/net/defxx.c
  16879. +++ linux-2.4.35.4/drivers/net/defxx.c
  16880. @@ -10,24 +10,18 @@
  16881. *
  16882. * Abstract:
  16883. * A Linux device driver supporting the Digital Equipment Corporation
  16884. - * FDDI EISA and PCI controller families. Supported adapters include:
  16885. + * FDDI TURBOchannel, EISA and PCI controller families. Supported
  16886. + * adapters include:
  16887. *
  16888. - * DEC FDDIcontroller/EISA (DEFEA)
  16889. - * DEC FDDIcontroller/PCI (DEFPA)
  16890. + * DEC FDDIcontroller/TURBOchannel (DEFTA)
  16891. + * DEC FDDIcontroller/EISA (DEFEA)
  16892. + * DEC FDDIcontroller/PCI (DEFPA)
  16893. *
  16894. - * Maintainers:
  16895. - * LVS Lawrence V. Stefani
  16896. - *
  16897. - * Contact:
  16898. - * The author may be reached at:
  16899. + * The original author:
  16900. + * LVS Lawrence V. Stefani <[email protected]>
  16901. *
  16902. - * Inet: [email protected]
  16903. - * (NOTE! this address no longer works -jgarzik)
  16904. - *
  16905. - * Mail: Digital Equipment Corporation
  16906. - * 550 King Street
  16907. - * M/S: LKG1-3/M07
  16908. - * Littleton, MA 01460
  16909. + * Maintainers:
  16910. + * macro Maciej W. Rozycki <[email protected]>
  16911. *
  16912. * Credits:
  16913. * I'd like to thank Patricia Cross for helping me get started with
  16914. @@ -197,16 +191,16 @@
  16915. * Sep 2000 tjeerd Fix leak on unload, cosmetic code cleanup
  16916. * Feb 2001 Skb allocation fixes
  16917. * Feb 2001 davej PCI enable cleanups.
  16918. + * 04 Aug 2003 macro Converted to the DMA API.
  16919. + * 14 Aug 2004 macro Fix device names reported.
  16920. + * 26 Sep 2004 macro TURBOchannel support.
  16921. */
  16922. /* Include files */
  16923. #include <linux/module.h>
  16924. -
  16925. #include <linux/kernel.h>
  16926. -#include <linux/sched.h>
  16927. #include <linux/string.h>
  16928. -#include <linux/ptrace.h>
  16929. #include <linux/errno.h>
  16930. #include <linux/ioport.h>
  16931. #include <linux/slab.h>
  16932. @@ -215,19 +209,33 @@
  16933. #include <linux/delay.h>
  16934. #include <linux/init.h>
  16935. #include <linux/netdevice.h>
  16936. +#include <linux/fddidevice.h>
  16937. +#include <linux/skbuff.h>
  16938. +
  16939. #include <asm/byteorder.h>
  16940. #include <asm/bitops.h>
  16941. #include <asm/io.h>
  16942. -#include <linux/fddidevice.h>
  16943. -#include <linux/skbuff.h>
  16944. +#ifdef CONFIG_TC
  16945. +#include <asm/dec/tc.h>
  16946. +#else
  16947. +static int search_tc_card(const char *name) { return -ENODEV; }
  16948. +static void claim_tc_card(int slot) { }
  16949. +static void release_tc_card(int slot) { }
  16950. +static unsigned long get_tc_base_addr(int slot) { return 0; }
  16951. +static unsigned long get_tc_irq_nr(int slot) { return -1; }
  16952. +#endif
  16953. #include "defxx.h"
  16954. -/* Version information string - should be updated prior to each new release!!! */
  16955. +/* Version information string should be updated prior to each new release! */
  16956. +#define DRV_NAME "defxx"
  16957. +#define DRV_VERSION "v1.07T"
  16958. +#define DRV_RELDATE "2004/09/26"
  16959. static char version[] __devinitdata =
  16960. - "defxx.c:v1.05e 2001/02/03 Lawrence V. Stefani and others\n";
  16961. + DRV_NAME ": " DRV_VERSION " " DRV_RELDATE
  16962. + " Lawrence V. Stefani and others\n";
  16963. #define DYNAMIC_BUFFERS 1
  16964. @@ -243,7 +251,7 @@ static char version[] __devinitdata =
  16965. static void dfx_bus_init(struct net_device *dev);
  16966. static void dfx_bus_config_check(DFX_board_t *bp);
  16967. -static int dfx_driver_init(struct net_device *dev);
  16968. +static int dfx_driver_init(struct net_device *dev, const char *print_name);
  16969. static int dfx_adap_init(DFX_board_t *bp, int get_buffers);
  16970. static int dfx_open(struct net_device *dev);
  16971. @@ -337,48 +345,84 @@ static inline void dfx_port_write_byte(
  16972. int offset,
  16973. u8 data
  16974. )
  16975. +{
  16976. + if (bp->bus_type == DFX_BUS_TYPE_TC)
  16977. + {
  16978. + volatile u8 *addr = (void *)(bp->base_addr + offset);
  16979. + *addr = data;
  16980. + mb();
  16981. + }
  16982. + else
  16983. {
  16984. u16 port = bp->base_addr + offset;
  16985. outb(data, port);
  16986. }
  16987. +}
  16988. static inline void dfx_port_read_byte(
  16989. DFX_board_t *bp,
  16990. int offset,
  16991. u8 *data
  16992. )
  16993. +{
  16994. + if (bp->bus_type == DFX_BUS_TYPE_TC)
  16995. + {
  16996. + volatile u8 *addr = (void *)(bp->base_addr + offset);
  16997. + mb();
  16998. + *data = *addr;
  16999. + }
  17000. + else
  17001. {
  17002. u16 port = bp->base_addr + offset;
  17003. *data = inb(port);
  17004. }
  17005. +}
  17006. static inline void dfx_port_write_long(
  17007. DFX_board_t *bp,
  17008. int offset,
  17009. u32 data
  17010. )
  17011. +{
  17012. + if (bp->bus_type == DFX_BUS_TYPE_TC)
  17013. + {
  17014. + volatile u32 *addr = (void *)(bp->base_addr + offset);
  17015. + *addr = data;
  17016. + mb();
  17017. + }
  17018. + else
  17019. {
  17020. u16 port = bp->base_addr + offset;
  17021. outl(data, port);
  17022. }
  17023. +}
  17024. static inline void dfx_port_read_long(
  17025. DFX_board_t *bp,
  17026. int offset,
  17027. u32 *data
  17028. )
  17029. +{
  17030. + if (bp->bus_type == DFX_BUS_TYPE_TC)
  17031. + {
  17032. + volatile u32 *addr = (void *)(bp->base_addr + offset);
  17033. + mb();
  17034. + *data = *addr;
  17035. + }
  17036. + else
  17037. {
  17038. u16 port = bp->base_addr + offset;
  17039. *data = inl(port);
  17040. }
  17041. +}
  17042. /*
  17043. @@ -393,8 +437,9 @@ static inline void dfx_port_read_long(
  17044. * Condition code
  17045. *
  17046. * Arguments:
  17047. - * pdev - pointer to pci device information (NULL for EISA)
  17048. - * ioaddr - pointer to port (NULL for PCI)
  17049. + * pdev - pointer to pci device information (NULL for EISA or TURBOchannel)
  17050. + * bus_type - bus type (one of DFX_BUS_TYPE_*)
  17051. + * handle - bus-specific data: slot (TC), pointer to port (EISA), NULL (PCI)
  17052. *
  17053. * Functional Description:
  17054. *
  17055. @@ -410,54 +455,68 @@ static inline void dfx_port_read_long(
  17056. * initialized and the board resources are read and stored in
  17057. * the device structure.
  17058. */
  17059. -static int __devinit dfx_init_one_pci_or_eisa(struct pci_dev *pdev, long ioaddr)
  17060. +static int __devinit dfx_init_one_pci_or_eisa(struct pci_dev *pdev, u32 bus_type, long handle)
  17061. {
  17062. + static int version_disp;
  17063. + char *print_name = DRV_NAME;
  17064. struct net_device *dev;
  17065. DFX_board_t *bp; /* board pointer */
  17066. + long ioaddr; /* pointer to port */
  17067. + unsigned long len; /* resource length */
  17068. + int alloc_size; /* total buffer size used */
  17069. int err;
  17070. -#ifndef MODULE
  17071. - static int version_disp;
  17072. -
  17073. - if (!version_disp) /* display version info if adapter is found */
  17074. - {
  17075. + if (!version_disp) { /* display version info if adapter is found */
  17076. version_disp = 1; /* set display flag to TRUE so that */
  17077. printk(version); /* we only display this string ONCE */
  17078. }
  17079. -#endif
  17080. - /*
  17081. - * init_fddidev() allocates a device structure with private data, clears the device structure and private data,
  17082. - * and calls fddi_setup() and register_netdev(). Not much left to do for us here.
  17083. - */
  17084. - dev = init_fddidev(NULL, sizeof(*bp));
  17085. + if (pdev != NULL)
  17086. + print_name = pdev->slot_name;
  17087. +
  17088. + dev = alloc_fddidev(sizeof(*bp));
  17089. if (!dev) {
  17090. - printk (KERN_ERR "defxx: unable to allocate fddidev, aborting\n");
  17091. + printk(KERN_ERR "%s: unable to allocate fddidev, aborting\n",
  17092. + print_name);
  17093. return -ENOMEM;
  17094. }
  17095. /* Enable PCI device. */
  17096. - if (pdev != NULL) {
  17097. + if (bus_type == DFX_BUS_TYPE_PCI) {
  17098. err = pci_enable_device (pdev);
  17099. if (err) goto err_out;
  17100. ioaddr = pci_resource_start (pdev, 1);
  17101. }
  17102. SET_MODULE_OWNER(dev);
  17103. + SET_NETDEV_DEV(dev, &pdev->dev);
  17104. bp = dev->priv;
  17105. - if (!request_region (ioaddr, pdev ? PFI_K_CSR_IO_LEN : PI_ESIC_K_CSR_IO_LEN, dev->name)) {
  17106. - printk (KERN_ERR "%s: Cannot reserve I/O resource 0x%x @ 0x%lx, aborting\n",
  17107. - dev->name, PFI_K_CSR_IO_LEN, ioaddr);
  17108. + if (bus_type == DFX_BUS_TYPE_TC) {
  17109. + /* TURBOchannel board */
  17110. + bp->slot = handle;
  17111. + claim_tc_card(bp->slot);
  17112. + ioaddr = get_tc_base_addr(handle) + PI_TC_K_CSR_OFFSET;
  17113. + len = PI_TC_K_CSR_LEN;
  17114. + } else if (bus_type == DFX_BUS_TYPE_EISA) {
  17115. + /* EISA board */
  17116. + ioaddr = handle;
  17117. + len = PI_ESIC_K_CSR_IO_LEN;
  17118. + } else
  17119. + /* PCI board */
  17120. + len = PFI_K_CSR_IO_LEN;
  17121. + dev->base_addr = ioaddr; /* save port (I/O) base address */
  17122. +
  17123. + if (!request_region(ioaddr, len, print_name)) {
  17124. + printk(KERN_ERR "%s: Cannot reserve I/O resource "
  17125. + "0x%lx @ 0x%lx, aborting\n", print_name, len, ioaddr);
  17126. err = -EBUSY;
  17127. goto err_out;
  17128. }
  17129. /* Initialize new device structure */
  17130. - dev->base_addr = ioaddr; /* save port (I/O) base address */
  17131. -
  17132. dev->get_stats = dfx_ctl_get_stats;
  17133. dev->open = dfx_open;
  17134. dev->stop = dfx_close;
  17135. @@ -465,37 +524,54 @@ static int __devinit dfx_init_one_pci_or
  17136. dev->set_multicast_list = dfx_ctl_set_multicast_list;
  17137. dev->set_mac_address = dfx_ctl_set_mac_address;
  17138. - if (pdev == NULL) {
  17139. - /* EISA board */
  17140. - bp->bus_type = DFX_BUS_TYPE_EISA;
  17141. + bp->bus_type = bus_type;
  17142. + if (bus_type == DFX_BUS_TYPE_TC || bus_type == DFX_BUS_TYPE_EISA) {
  17143. + /* TURBOchannel or EISA board */
  17144. bp->next = root_dfx_eisa_dev;
  17145. root_dfx_eisa_dev = dev;
  17146. } else {
  17147. /* PCI board */
  17148. - bp->bus_type = DFX_BUS_TYPE_PCI;
  17149. bp->pci_dev = pdev;
  17150. pci_set_drvdata (pdev, dev);
  17151. pci_set_master (pdev);
  17152. }
  17153. - if (dfx_driver_init(dev) != DFX_K_SUCCESS) {
  17154. +
  17155. + if (dfx_driver_init(dev, print_name) != DFX_K_SUCCESS) {
  17156. err = -ENODEV;
  17157. goto err_out_region;
  17158. }
  17159. + err = register_netdev(dev);
  17160. + if (err)
  17161. + goto err_out_kfree;
  17162. +
  17163. + printk("%s: registered as %s\n", print_name, dev->name);
  17164. return 0;
  17165. +err_out_kfree:
  17166. + alloc_size = sizeof(PI_DESCR_BLOCK) +
  17167. + PI_CMD_REQ_K_SIZE_MAX + PI_CMD_RSP_K_SIZE_MAX +
  17168. +#ifndef DYNAMIC_BUFFERS
  17169. + (bp->rcv_bufs_to_post * PI_RCV_DATA_K_SIZE_MAX) +
  17170. +#endif
  17171. + sizeof(PI_CONSUMER_BLOCK) +
  17172. + (PI_ALIGN_K_DESC_BLK - 1);
  17173. + if (bp->kmalloced)
  17174. + pci_free_consistent(pdev, alloc_size,
  17175. + bp->kmalloced, bp->kmalloced_dma);
  17176. err_out_region:
  17177. - release_region(ioaddr, pdev ? PFI_K_CSR_IO_LEN : PI_ESIC_K_CSR_IO_LEN);
  17178. + release_region(ioaddr, len);
  17179. err_out:
  17180. - unregister_netdev(dev);
  17181. - kfree(dev);
  17182. + if (bp->bus_type == DFX_BUS_TYPE_TC)
  17183. + release_tc_card(bp->slot);
  17184. + free_netdev(dev);
  17185. return err;
  17186. }
  17187. static int __devinit dfx_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
  17188. {
  17189. - return dfx_init_one_pci_or_eisa(pdev, 0);
  17190. + return dfx_init_one_pci_or_eisa(pdev, DFX_BUS_TYPE_PCI, 0);
  17191. }
  17192. static int __init dfx_eisa_init(void)
  17193. @@ -507,6 +583,7 @@ static int __init dfx_eisa_init(void)
  17194. DBG_printk("In dfx_eisa_init...\n");
  17195. +#ifdef CONFIG_EISA
  17196. /* Scan for FDDI EISA controllers */
  17197. for (i=0; i < DFX_MAX_EISA_SLOTS; i++) /* only scan for up to 16 EISA slots */
  17198. @@ -517,9 +594,27 @@ static int __init dfx_eisa_init(void)
  17199. {
  17200. port = (i << 12); /* recalc base addr */
  17201. - if (dfx_init_one_pci_or_eisa(NULL, port) == 0) rc = 0;
  17202. + if (dfx_init_one_pci_or_eisa(NULL, DFX_BUS_TYPE_EISA, port) == 0) rc = 0;
  17203. }
  17204. }
  17205. +#endif
  17206. + return rc;
  17207. +}
  17208. +
  17209. +static int __init dfx_tc_init(void)
  17210. +{
  17211. + int rc = -ENODEV;
  17212. + int slot; /* TC slot number */
  17213. +
  17214. + DBG_printk("In dfx_tc_init...\n");
  17215. +
  17216. + /* Scan for FDDI TC controllers */
  17217. + while ((slot = search_tc_card("PMAF-F")) >= 0) {
  17218. + if (dfx_init_one_pci_or_eisa(NULL, DFX_BUS_TYPE_TC, slot) == 0)
  17219. + rc = 0;
  17220. + else
  17221. + break;
  17222. + }
  17223. return rc;
  17224. }
  17225. @@ -583,8 +678,9 @@ static void __devinit dfx_bus_init(struc
  17226. /* Initialize adapter based on bus type */
  17227. - if (bp->bus_type == DFX_BUS_TYPE_EISA)
  17228. - {
  17229. + if (bp->bus_type == DFX_BUS_TYPE_TC) {
  17230. + dev->irq = get_tc_irq_nr(bp->slot);
  17231. + } else if (bp->bus_type == DFX_BUS_TYPE_EISA) {
  17232. /* Get the interrupt level from the ESIC chip */
  17233. dfx_port_read_byte(bp, PI_ESIC_K_IO_CONFIG_STAT_0, &val);
  17234. @@ -766,6 +862,7 @@ static void __devinit dfx_bus_config_che
  17235. *
  17236. * Arguments:
  17237. * dev - pointer to device information
  17238. + * print_name - printable device name
  17239. *
  17240. * Functional Description:
  17241. * This function allocates additional resources such as the host memory
  17242. @@ -780,20 +877,21 @@ static void __devinit dfx_bus_config_che
  17243. * or read adapter MAC address
  17244. *
  17245. * Assumptions:
  17246. - * Memory allocated from kmalloc() call is physically contiguous, locked
  17247. - * memory whose physical address equals its virtual address.
  17248. + * Memory allocated from pci_alloc_consistent() call is physically
  17249. + * contiguous, locked memory.
  17250. *
  17251. * Side Effects:
  17252. * Adapter is reset and should be in DMA_UNAVAILABLE state before
  17253. * returning from this routine.
  17254. */
  17255. -static int __devinit dfx_driver_init(struct net_device *dev)
  17256. +static int __devinit dfx_driver_init(struct net_device *dev,
  17257. + const char *print_name)
  17258. {
  17259. DFX_board_t *bp = dev->priv;
  17260. int alloc_size; /* total buffer size needed */
  17261. char *top_v, *curr_v; /* virtual addrs into memory block */
  17262. - u32 top_p, curr_p; /* physical addrs into memory block */
  17263. + dma_addr_t top_p, curr_p; /* physical addrs into memory block */
  17264. u32 data; /* host data register value */
  17265. DBG_printk("In dfx_driver_init...\n");
  17266. @@ -837,26 +935,20 @@ static int __devinit dfx_driver_init(str
  17267. /* Read the factory MAC address from the adapter then save it */
  17268. - if (dfx_hw_port_ctrl_req(bp,
  17269. - PI_PCTRL_M_MLA,
  17270. - PI_PDATA_A_MLA_K_LO,
  17271. - 0,
  17272. - &data) != DFX_K_SUCCESS)
  17273. - {
  17274. - printk("%s: Could not read adapter factory MAC address!\n", dev->name);
  17275. + if (dfx_hw_port_ctrl_req(bp, PI_PCTRL_M_MLA, PI_PDATA_A_MLA_K_LO, 0,
  17276. + &data) != DFX_K_SUCCESS) {
  17277. + printk("%s: Could not read adapter factory MAC address!\n",
  17278. + print_name);
  17279. return(DFX_K_FAILURE);
  17280. - }
  17281. + }
  17282. memcpy(&bp->factory_mac_addr[0], &data, sizeof(u32));
  17283. - if (dfx_hw_port_ctrl_req(bp,
  17284. - PI_PCTRL_M_MLA,
  17285. - PI_PDATA_A_MLA_K_HI,
  17286. - 0,
  17287. - &data) != DFX_K_SUCCESS)
  17288. - {
  17289. - printk("%s: Could not read adapter factory MAC address!\n", dev->name);
  17290. + if (dfx_hw_port_ctrl_req(bp, PI_PCTRL_M_MLA, PI_PDATA_A_MLA_K_HI, 0,
  17291. + &data) != DFX_K_SUCCESS) {
  17292. + printk("%s: Could not read adapter factory MAC address!\n",
  17293. + print_name);
  17294. return(DFX_K_FAILURE);
  17295. - }
  17296. + }
  17297. memcpy(&bp->factory_mac_addr[4], &data, sizeof(u16));
  17298. /*
  17299. @@ -867,28 +959,27 @@ static int __devinit dfx_driver_init(str
  17300. */
  17301. memcpy(dev->dev_addr, bp->factory_mac_addr, FDDI_K_ALEN);
  17302. - if (bp->bus_type == DFX_BUS_TYPE_EISA)
  17303. - printk("%s: DEFEA at I/O addr = 0x%lX, IRQ = %d, Hardware addr = %02X-%02X-%02X-%02X-%02X-%02X\n",
  17304. - dev->name,
  17305. - dev->base_addr,
  17306. - dev->irq,
  17307. - dev->dev_addr[0],
  17308. - dev->dev_addr[1],
  17309. - dev->dev_addr[2],
  17310. - dev->dev_addr[3],
  17311. - dev->dev_addr[4],
  17312. - dev->dev_addr[5]);
  17313. + if (bp->bus_type == DFX_BUS_TYPE_TC)
  17314. + printk("%s: DEFTA at addr = 0x%lX, IRQ = %d, "
  17315. + "Hardware addr = %02X-%02X-%02X-%02X-%02X-%02X\n",
  17316. + print_name, dev->base_addr, dev->irq,
  17317. + dev->dev_addr[0], dev->dev_addr[1],
  17318. + dev->dev_addr[2], dev->dev_addr[3],
  17319. + dev->dev_addr[4], dev->dev_addr[5]);
  17320. + else if (bp->bus_type == DFX_BUS_TYPE_EISA)
  17321. + printk("%s: DEFEA at I/O addr = 0x%lX, IRQ = %d, "
  17322. + "Hardware addr = %02X-%02X-%02X-%02X-%02X-%02X\n",
  17323. + print_name, dev->base_addr, dev->irq,
  17324. + dev->dev_addr[0], dev->dev_addr[1],
  17325. + dev->dev_addr[2], dev->dev_addr[3],
  17326. + dev->dev_addr[4], dev->dev_addr[5]);
  17327. else
  17328. - printk("%s: DEFPA at I/O addr = 0x%lX, IRQ = %d, Hardware addr = %02X-%02X-%02X-%02X-%02X-%02X\n",
  17329. - dev->name,
  17330. - dev->base_addr,
  17331. - dev->irq,
  17332. - dev->dev_addr[0],
  17333. - dev->dev_addr[1],
  17334. - dev->dev_addr[2],
  17335. - dev->dev_addr[3],
  17336. - dev->dev_addr[4],
  17337. - dev->dev_addr[5]);
  17338. + printk("%s: DEFPA at I/O addr = 0x%lX, IRQ = %d, "
  17339. + "Hardware addr = %02X-%02X-%02X-%02X-%02X-%02X\n",
  17340. + print_name, dev->base_addr, dev->irq,
  17341. + dev->dev_addr[0], dev->dev_addr[1],
  17342. + dev->dev_addr[2], dev->dev_addr[3],
  17343. + dev->dev_addr[4], dev->dev_addr[5]);
  17344. /*
  17345. * Get memory for descriptor block, consumer block, and other buffers
  17346. @@ -903,14 +994,15 @@ static int __devinit dfx_driver_init(str
  17347. #endif
  17348. sizeof(PI_CONSUMER_BLOCK) +
  17349. (PI_ALIGN_K_DESC_BLK - 1);
  17350. - bp->kmalloced = top_v = (char *) kmalloc(alloc_size, GFP_KERNEL);
  17351. - if (top_v == NULL)
  17352. - {
  17353. - printk("%s: Could not allocate memory for host buffers and structures!\n", dev->name);
  17354. + bp->kmalloced = top_v = pci_alloc_consistent(bp->pci_dev, alloc_size,
  17355. + &bp->kmalloced_dma);
  17356. + if (top_v == NULL) {
  17357. + printk("%s: Could not allocate memory for host buffers "
  17358. + "and structures!\n", print_name);
  17359. return(DFX_K_FAILURE);
  17360. - }
  17361. + }
  17362. memset(top_v, 0, alloc_size); /* zero out memory before continuing */
  17363. - top_p = virt_to_bus(top_v); /* get physical address of buffer */
  17364. + top_p = bp->kmalloced_dma; /* get physical address of buffer */
  17365. /*
  17366. * To guarantee the 8K alignment required for the descriptor block, 8K - 1
  17367. @@ -924,7 +1016,7 @@ static int __devinit dfx_driver_init(str
  17368. * for allocating the needed memory.
  17369. */
  17370. - curr_p = (u32) (ALIGN(top_p, PI_ALIGN_K_DESC_BLK));
  17371. + curr_p = ALIGN(top_p, PI_ALIGN_K_DESC_BLK);
  17372. curr_v = top_v + (curr_p - top_p);
  17373. /* Reserve space for descriptor block */
  17374. @@ -965,14 +1057,20 @@ static int __devinit dfx_driver_init(str
  17375. /* Display virtual and physical addresses if debug driver */
  17376. - DBG_printk("%s: Descriptor block virt = %0lX, phys = %0X\n", dev->name, (long)bp->descr_block_virt, bp->descr_block_phys);
  17377. - DBG_printk("%s: Command Request buffer virt = %0lX, phys = %0X\n", dev->name, (long)bp->cmd_req_virt, bp->cmd_req_phys);
  17378. - DBG_printk("%s: Command Response buffer virt = %0lX, phys = %0X\n", dev->name, (long)bp->cmd_rsp_virt, bp->cmd_rsp_phys);
  17379. - DBG_printk("%s: Receive buffer block virt = %0lX, phys = %0X\n", dev->name, (long)bp->rcv_block_virt, bp->rcv_block_phys);
  17380. - DBG_printk("%s: Consumer block virt = %0lX, phys = %0X\n", dev->name, (long)bp->cons_block_virt, bp->cons_block_phys);
  17381. + DBG_printk("%s: Descriptor block virt = %0lX, phys = %0X\n",
  17382. + print_name,
  17383. + (long)bp->descr_block_virt, bp->descr_block_phys);
  17384. + DBG_printk("%s: Command Request buffer virt = %0lX, phys = %0X\n",
  17385. + print_name, (long)bp->cmd_req_virt, bp->cmd_req_phys);
  17386. + DBG_printk("%s: Command Response buffer virt = %0lX, phys = %0X\n",
  17387. + print_name, (long)bp->cmd_rsp_virt, bp->cmd_rsp_phys);
  17388. + DBG_printk("%s: Receive buffer block virt = %0lX, phys = %0X\n",
  17389. + print_name, (long)bp->rcv_block_virt, bp->rcv_block_phys);
  17390. + DBG_printk("%s: Consumer block virt = %0lX, phys = %0X\n",
  17391. + print_name, (long)bp->cons_block_virt, bp->cons_block_phys);
  17392. return(DFX_K_SUCCESS);
  17393. - }
  17394. +}
  17395. /*
  17396. @@ -1218,7 +1316,9 @@ static int dfx_open(struct net_device *d
  17397. /* Register IRQ - support shared interrupts by passing device ptr */
  17398. - ret = request_irq(dev->irq, (void *)dfx_interrupt, SA_SHIRQ, dev->name, dev);
  17399. + ret = request_irq(dev->irq, (void *)dfx_interrupt,
  17400. + (bp->bus_type == DFX_BUS_TYPE_TC) ? 0 : SA_SHIRQ,
  17401. + dev->name, dev);
  17402. if (ret) {
  17403. printk(KERN_ERR "%s: Requested IRQ %d is busy\n", dev->name, dev->irq);
  17404. return ret;
  17405. @@ -1737,7 +1837,7 @@ static void dfx_interrupt(int irq, void
  17406. dfx_port_write_long(bp, PFI_K_REG_MODE_CTRL,
  17407. (PFI_MODE_M_PDQ_INT_ENB + PFI_MODE_M_DMA_ENB));
  17408. }
  17409. - else
  17410. + else if (bp->bus_type == DFX_BUS_TYPE_EISA)
  17411. {
  17412. /* Disable interrupts at the ESIC */
  17413. @@ -1755,6 +1855,13 @@ static void dfx_interrupt(int irq, void
  17414. tmp |= PI_CONFIG_STAT_0_M_INT_ENB;
  17415. dfx_port_write_byte(bp, PI_ESIC_K_IO_CONFIG_STAT_0, tmp);
  17416. }
  17417. + else {
  17418. + /* TC doesn't share interrupts so no need to disable them */
  17419. +
  17420. + /* Call interrupt service routine for this adapter */
  17421. +
  17422. + dfx_int_common(dev);
  17423. + }
  17424. spin_unlock(&bp->lock);
  17425. }
  17426. @@ -2663,12 +2770,12 @@ static int dfx_hw_dma_uninit(DFX_board_t
  17427. static void my_skb_align(struct sk_buff *skb, int n)
  17428. {
  17429. - u32 x=(u32)skb->data; /* We only want the low bits .. */
  17430. - u32 v;
  17431. + unsigned long x = (unsigned long)skb->data;
  17432. + unsigned long v;
  17433. - v=(x+n-1)&~(n-1); /* Where we want to be */
  17434. + v = ALIGN(x, n); /* Where we want to be */
  17435. - skb_reserve(skb, v-x);
  17436. + skb_reserve(skb, v - x);
  17437. }
  17438. @@ -2745,7 +2852,10 @@ static int dfx_rcv_init(DFX_board_t *bp,
  17439. */
  17440. my_skb_align(newskb, 128);
  17441. - bp->descr_block_virt->rcv_data[i+j].long_1 = virt_to_bus(newskb->data);
  17442. + bp->descr_block_virt->rcv_data[i + j].long_1 =
  17443. + (u32)pci_map_single(bp->pci_dev, newskb->data,
  17444. + NEW_SKB_SIZE,
  17445. + PCI_DMA_FROMDEVICE);
  17446. /*
  17447. * p_rcv_buff_va is only used inside the
  17448. * kernel so we put the skb pointer here.
  17449. @@ -2859,9 +2969,17 @@ static void dfx_rcv_queue_process(
  17450. my_skb_align(newskb, 128);
  17451. skb = (struct sk_buff *)bp->p_rcv_buff_va[entry];
  17452. + pci_unmap_single(bp->pci_dev,
  17453. + bp->descr_block_virt->rcv_data[entry].long_1,
  17454. + NEW_SKB_SIZE,
  17455. + PCI_DMA_FROMDEVICE);
  17456. skb_reserve(skb, RCV_BUFF_K_PADDING);
  17457. bp->p_rcv_buff_va[entry] = (char *)newskb;
  17458. - bp->descr_block_virt->rcv_data[entry].long_1 = virt_to_bus(newskb->data);
  17459. + bp->descr_block_virt->rcv_data[entry].long_1 =
  17460. + (u32)pci_map_single(bp->pci_dev,
  17461. + newskb->data,
  17462. + NEW_SKB_SIZE,
  17463. + PCI_DMA_FROMDEVICE);
  17464. } else
  17465. skb = NULL;
  17466. } else
  17467. @@ -2934,7 +3052,7 @@ static void dfx_rcv_queue_process(
  17468. * is contained in a single physically contiguous buffer
  17469. * in which the virtual address of the start of packet
  17470. * (skb->data) can be converted to a physical address
  17471. - * by using virt_to_bus().
  17472. + * by using pci_map_single().
  17473. *
  17474. * Since the adapter architecture requires a three byte
  17475. * packet request header to prepend the start of packet,
  17476. @@ -3082,12 +3200,13 @@ static int dfx_xmt_queue_pkt(
  17477. * skb->data.
  17478. * 6. The physical address of the start of packet
  17479. * can be determined from the virtual address
  17480. - * by using virt_to_bus() and is only 32-bits
  17481. + * by using pci_map_single() and is only 32-bits
  17482. * wide.
  17483. */
  17484. p_xmt_descr->long_0 = (u32) (PI_XMT_DESCR_M_SOP | PI_XMT_DESCR_M_EOP | ((skb->len) << PI_XMT_DESCR_V_SEG_LEN));
  17485. - p_xmt_descr->long_1 = (u32) virt_to_bus(skb->data);
  17486. + p_xmt_descr->long_1 = (u32)pci_map_single(bp->pci_dev, skb->data,
  17487. + skb->len, PCI_DMA_TODEVICE);
  17488. /*
  17489. * Verify that descriptor is actually available
  17490. @@ -3171,6 +3290,7 @@ static int dfx_xmt_done(DFX_board_t *bp)
  17491. {
  17492. XMT_DRIVER_DESCR *p_xmt_drv_descr; /* ptr to transmit driver descriptor */
  17493. PI_TYPE_2_CONSUMER *p_type_2_cons; /* ptr to rcv/xmt consumer block register */
  17494. + u8 comp; /* local transmit completion index */
  17495. int freed = 0; /* buffers freed */
  17496. /* Service all consumed transmit frames */
  17497. @@ -3188,7 +3308,11 @@ static int dfx_xmt_done(DFX_board_t *bp)
  17498. bp->xmt_total_bytes += p_xmt_drv_descr->p_skb->len;
  17499. /* Return skb to operating system */
  17500. -
  17501. + comp = bp->rcv_xmt_reg.index.xmt_comp;
  17502. + pci_unmap_single(bp->pci_dev,
  17503. + bp->descr_block_virt->xmt_data[comp].long_1,
  17504. + p_xmt_drv_descr->p_skb->len,
  17505. + PCI_DMA_TODEVICE);
  17506. dev_kfree_skb_irq(p_xmt_drv_descr->p_skb);
  17507. /*
  17508. @@ -3297,6 +3421,7 @@ static void dfx_xmt_flush( DFX_board_t *
  17509. {
  17510. u32 prod_cons; /* rcv/xmt consumer block longword */
  17511. XMT_DRIVER_DESCR *p_xmt_drv_descr; /* ptr to transmit driver descriptor */
  17512. + u8 comp; /* local transmit completion index */
  17513. /* Flush all outstanding transmit frames */
  17514. @@ -3307,7 +3432,11 @@ static void dfx_xmt_flush( DFX_board_t *
  17515. p_xmt_drv_descr = &(bp->xmt_drv_descr_blk[bp->rcv_xmt_reg.index.xmt_comp]);
  17516. /* Return skb to operating system */
  17517. -
  17518. + comp = bp->rcv_xmt_reg.index.xmt_comp;
  17519. + pci_unmap_single(bp->pci_dev,
  17520. + bp->descr_block_virt->xmt_data[comp].long_1,
  17521. + p_xmt_drv_descr->p_skb->len,
  17522. + PCI_DMA_TODEVICE);
  17523. dev_kfree_skb(p_xmt_drv_descr->p_skb);
  17524. /* Increment transmit error counter */
  17525. @@ -3337,12 +3466,36 @@ static void dfx_xmt_flush( DFX_board_t *
  17526. static void __devexit dfx_remove_one_pci_or_eisa(struct pci_dev *pdev, struct net_device *dev)
  17527. {
  17528. - DFX_board_t *bp = dev->priv;
  17529. + DFX_board_t *bp = dev->priv;
  17530. + unsigned long len; /* resource length */
  17531. + int alloc_size; /* total buffer size used */
  17532. + if (bp->bus_type == DFX_BUS_TYPE_TC) {
  17533. + /* TURBOchannel board */
  17534. + len = PI_TC_K_CSR_LEN;
  17535. + } else if (bp->bus_type == DFX_BUS_TYPE_EISA) {
  17536. + /* EISA board */
  17537. + len = PI_ESIC_K_CSR_IO_LEN;
  17538. + } else {
  17539. + len = PFI_K_CSR_IO_LEN;
  17540. + }
  17541. unregister_netdev(dev);
  17542. - release_region(dev->base_addr, pdev ? PFI_K_CSR_IO_LEN : PI_ESIC_K_CSR_IO_LEN );
  17543. - if (bp->kmalloced) kfree(bp->kmalloced);
  17544. - kfree(dev);
  17545. + release_region(dev->base_addr, len);
  17546. +
  17547. + if (bp->bus_type == DFX_BUS_TYPE_TC)
  17548. + release_tc_card(bp->slot);
  17549. +
  17550. + alloc_size = sizeof(PI_DESCR_BLOCK) +
  17551. + PI_CMD_REQ_K_SIZE_MAX + PI_CMD_RSP_K_SIZE_MAX +
  17552. +#ifndef DYNAMIC_BUFFERS
  17553. + (bp->rcv_bufs_to_post * PI_RCV_DATA_K_SIZE_MAX) +
  17554. +#endif
  17555. + sizeof(PI_CONSUMER_BLOCK) +
  17556. + (PI_ALIGN_K_DESC_BLK - 1);
  17557. + if (bp->kmalloced)
  17558. + pci_free_consistent(pdev, alloc_size, bp->kmalloced,
  17559. + bp->kmalloced_dma);
  17560. + free_netdev(dev);
  17561. }
  17562. static void __devexit dfx_remove_one (struct pci_dev *pdev)
  17563. @@ -3353,21 +3506,22 @@ static void __devexit dfx_remove_one (st
  17564. pci_set_drvdata(pdev, NULL);
  17565. }
  17566. -static struct pci_device_id dfx_pci_tbl[] __devinitdata = {
  17567. +static struct pci_device_id dfx_pci_tbl[] = {
  17568. { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_FDDI, PCI_ANY_ID, PCI_ANY_ID, },
  17569. { 0, }
  17570. };
  17571. MODULE_DEVICE_TABLE(pci, dfx_pci_tbl);
  17572. static struct pci_driver dfx_driver = {
  17573. - name: "defxx",
  17574. - probe: dfx_init_one,
  17575. - remove: __devexit_p(dfx_remove_one),
  17576. - id_table: dfx_pci_tbl,
  17577. + .name = "defxx",
  17578. + .probe = dfx_init_one,
  17579. + .remove = __devexit_p(dfx_remove_one),
  17580. + .id_table = dfx_pci_tbl,
  17581. };
  17582. static int dfx_have_pci;
  17583. static int dfx_have_eisa;
  17584. +static int dfx_have_tc;
  17585. static void __exit dfx_eisa_cleanup(void)
  17586. @@ -3388,12 +3542,7 @@ static void __exit dfx_eisa_cleanup(void
  17587. static int __init dfx_init(void)
  17588. {
  17589. - int rc_pci, rc_eisa;
  17590. -
  17591. -/* when a module, this is printed whether or not devices are found in probe */
  17592. -#ifdef MODULE
  17593. - printk(version);
  17594. -#endif
  17595. + int rc_pci, rc_eisa, rc_tc;
  17596. rc_pci = pci_module_init(&dfx_driver);
  17597. if (rc_pci >= 0) dfx_have_pci = 1;
  17598. @@ -3401,20 +3550,27 @@ static int __init dfx_init(void)
  17599. rc_eisa = dfx_eisa_init();
  17600. if (rc_eisa >= 0) dfx_have_eisa = 1;
  17601. - return ((rc_eisa < 0) ? 0 : rc_eisa) + ((rc_pci < 0) ? 0 : rc_pci);
  17602. + rc_tc = dfx_tc_init();
  17603. + if (rc_tc >= 0) dfx_have_tc = 1;
  17604. +
  17605. + return ((rc_tc < 0) ? 0 : rc_tc) +
  17606. + ((rc_eisa < 0) ? 0 : rc_eisa) +
  17607. + ((rc_pci < 0) ? 0 : rc_pci);
  17608. }
  17609. static void __exit dfx_cleanup(void)
  17610. {
  17611. if (dfx_have_pci)
  17612. pci_unregister_driver(&dfx_driver);
  17613. - if (dfx_have_eisa)
  17614. + if (dfx_have_eisa || dfx_have_tc)
  17615. dfx_eisa_cleanup();
  17616. -
  17617. }
  17618. module_init(dfx_init);
  17619. module_exit(dfx_cleanup);
  17620. +MODULE_AUTHOR("Lawrence V. Stefani");
  17621. +MODULE_DESCRIPTION("DEC FDDIcontroller EISA/PCI (DEFEA/DEFPA) driver "
  17622. + DRV_VERSION " " DRV_RELDATE);
  17623. MODULE_LICENSE("GPL");
  17624. Index: linux-2.4.35.4/drivers/net/defxx.h
  17625. ===================================================================
  17626. --- linux-2.4.35.4.orig/drivers/net/defxx.h
  17627. +++ linux-2.4.35.4/drivers/net/defxx.h
  17628. @@ -12,17 +12,11 @@
  17629. * Contains all definitions specified by port specification and required
  17630. * by the defxx.c driver.
  17631. *
  17632. - * Maintainers:
  17633. - * LVS Lawrence V. Stefani
  17634. - *
  17635. - * Contact:
  17636. - * The author may be reached at:
  17637. + * The original author:
  17638. + * LVS Lawrence V. Stefani <[email protected]>
  17639. *
  17640. - * Inet: [email protected]
  17641. - * Mail: Digital Equipment Corporation
  17642. - * 550 King Street
  17643. - * M/S: LKG1-3/M07
  17644. - * Littleton, MA 01460
  17645. + * Maintainers:
  17646. + * macro Maciej W. Rozycki <[email protected]>
  17647. *
  17648. * Modification History:
  17649. * Date Name Description
  17650. @@ -30,6 +24,7 @@
  17651. * 09-Sep-96 LVS Added group_prom field. Moved read/write I/O
  17652. * macros to DEFXX.C.
  17653. * 12-Sep-96 LVS Removed packet request header pointers.
  17654. + * 04 Aug 2003 macro Converted to the DMA API.
  17655. */
  17656. #ifndef _DEFXX_H_
  17657. @@ -1467,6 +1462,11 @@ typedef union
  17658. #endif /* #ifndef BIG_ENDIAN */
  17659. +/* Define TC PDQ CSR offset and length */
  17660. +
  17661. +#define PI_TC_K_CSR_OFFSET 0x100000
  17662. +#define PI_TC_K_CSR_LEN 0x80 /* 128 bytes */
  17663. +
  17664. /* Define EISA controller register offsets */
  17665. #define PI_ESIC_K_BURST_HOLDOFF 0x040
  17666. @@ -1634,6 +1634,7 @@ typedef union
  17667. #define DFX_BUS_TYPE_PCI 0 /* type code for DEC FDDIcontroller/PCI */
  17668. #define DFX_BUS_TYPE_EISA 1 /* type code for DEC FDDIcontroller/EISA */
  17669. +#define DFX_BUS_TYPE_TC 2 /* type code for DEC FDDIcontroller/TURBOchannel */
  17670. #define DFX_FC_PRH2_PRH1_PRH0 0x54003820 /* Packet Request Header bytes + FC */
  17671. #define DFX_PRH0_BYTE 0x20 /* Packet Request Header byte 0 */
  17672. @@ -1704,17 +1705,19 @@ typedef struct DFX_board_tag
  17673. {
  17674. /* Keep virtual and physical pointers to locked, physically contiguous memory */
  17675. - char *kmalloced; /* kfree this on unload */
  17676. + char *kmalloced; /* pci_free_consistent this on unload */
  17677. + dma_addr_t kmalloced_dma;
  17678. + /* DMA handle for the above */
  17679. PI_DESCR_BLOCK *descr_block_virt; /* PDQ descriptor block virt address */
  17680. - u32 descr_block_phys; /* PDQ descriptor block phys address */
  17681. + dma_addr_t descr_block_phys; /* PDQ descriptor block phys address */
  17682. PI_DMA_CMD_REQ *cmd_req_virt; /* Command request buffer virt address */
  17683. - u32 cmd_req_phys; /* Command request buffer phys address */
  17684. + dma_addr_t cmd_req_phys; /* Command request buffer phys address */
  17685. PI_DMA_CMD_RSP *cmd_rsp_virt; /* Command response buffer virt address */
  17686. - u32 cmd_rsp_phys; /* Command response buffer phys address */
  17687. + dma_addr_t cmd_rsp_phys; /* Command response buffer phys address */
  17688. char *rcv_block_virt; /* LLC host receive queue buf blk virt */
  17689. - u32 rcv_block_phys; /* LLC host receive queue buf blk phys */
  17690. + dma_addr_t rcv_block_phys; /* LLC host receive queue buf blk phys */
  17691. PI_CONSUMER_BLOCK *cons_block_virt; /* PDQ consumer block virt address */
  17692. - u32 cons_block_phys; /* PDQ consumer block phys address */
  17693. + dma_addr_t cons_block_phys; /* PDQ consumer block phys address */
  17694. /* Keep local copies of Type 1 and Type 2 register data */
  17695. @@ -1758,8 +1761,9 @@ typedef struct DFX_board_tag
  17696. struct net_device *dev; /* pointer to device structure */
  17697. struct net_device *next;
  17698. - u32 bus_type; /* bus type (0 == PCI, 1 == EISA) */
  17699. - u16 base_addr; /* base I/O address (same as dev->base_addr) */
  17700. + u32 bus_type; /* bus type (0 == PCI, 1 == EISA, 2 == TC) */
  17701. + long base_addr; /* base I/O address (same as dev->base_addr) */
  17702. + int slot; /* TC slot number */
  17703. struct pci_dev * pci_dev;
  17704. u32 full_duplex_enb; /* FDDI Full Duplex enable (1 == on, 2 == off) */
  17705. u32 req_ttrt; /* requested TTRT value (in 80ns units) */
  17706. Index: linux-2.4.35.4/drivers/net/hamradio/hdlcdrv.c
  17707. ===================================================================
  17708. --- linux-2.4.35.4.orig/drivers/net/hamradio/hdlcdrv.c
  17709. +++ linux-2.4.35.4/drivers/net/hamradio/hdlcdrv.c
  17710. @@ -587,6 +587,8 @@ static int hdlcdrv_close(struct net_devi
  17711. return -EINVAL;
  17712. s = (struct hdlcdrv_state *)dev->priv;
  17713. + netif_stop_queue(dev);
  17714. +
  17715. if (s->ops && s->ops->close)
  17716. i = s->ops->close(dev);
  17717. if (s->skb)
  17718. Index: linux-2.4.35.4/drivers/net/irda/au1k_ir.c
  17719. ===================================================================
  17720. --- linux-2.4.35.4.orig/drivers/net/irda/au1k_ir.c
  17721. +++ linux-2.4.35.4/drivers/net/irda/au1k_ir.c
  17722. @@ -81,10 +81,6 @@ static char version[] __devinitdata =
  17723. #define RUN_AT(x) (jiffies + (x))
  17724. -#if defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100)
  17725. -static BCSR * const bcsr = (BCSR *)0xAE000000;
  17726. -#endif
  17727. -
  17728. static spinlock_t ir_lock = SPIN_LOCK_UNLOCKED;
  17729. /*
  17730. Index: linux-2.4.35.4/drivers/net/sgiseeq.c
  17731. ===================================================================
  17732. --- linux-2.4.35.4.orig/drivers/net/sgiseeq.c
  17733. +++ linux-2.4.35.4/drivers/net/sgiseeq.c
  17734. @@ -24,16 +24,16 @@
  17735. #include <asm/io.h>
  17736. #include <asm/system.h>
  17737. #include <asm/bitops.h>
  17738. +#include <asm/paccess.h>
  17739. #include <asm/page.h>
  17740. #include <asm/pgtable.h>
  17741. +#include <asm/sgi/mc.h>
  17742. #include <asm/sgi/hpc3.h>
  17743. #include <asm/sgi/ip22.h>
  17744. #include <asm/sgialib.h>
  17745. #include "sgiseeq.h"
  17746. -static char *version = "sgiseeq.c: David S. Miller ([email protected])\n";
  17747. -
  17748. static char *sgiseeqstr = "SGI Seeq8003";
  17749. /*
  17750. @@ -113,9 +113,9 @@ static struct net_device *root_sgiseeq_d
  17751. static inline void hpc3_eth_reset(struct hpc3_ethregs *hregs)
  17752. {
  17753. - hregs->rx_reset = HPC3_ERXRST_CRESET | HPC3_ERXRST_CLRIRQ;
  17754. + hregs->reset = HPC3_ERST_CRESET | HPC3_ERST_CLRIRQ;
  17755. udelay(20);
  17756. - hregs->rx_reset = 0;
  17757. + hregs->reset = 0;
  17758. }
  17759. static inline void reset_hpc3_and_seeq(struct hpc3_ethregs *hregs,
  17760. @@ -238,7 +238,6 @@ void sgiseeq_dump_rings(void)
  17761. #define TSTAT_INIT_SEEQ (SEEQ_TCMD_IPT|SEEQ_TCMD_I16|SEEQ_TCMD_IC|SEEQ_TCMD_IUF)
  17762. #define TSTAT_INIT_EDLC ((TSTAT_INIT_SEEQ) | SEEQ_TCMD_RB2)
  17763. -#define RDMACFG_INIT (HPC3_ERXDCFG_FRXDC | HPC3_ERXDCFG_FEOP | HPC3_ERXDCFG_FIRQ)
  17764. static int init_seeq(struct net_device *dev, struct sgiseeq_private *sp,
  17765. struct sgiseeq_regs *sregs)
  17766. @@ -260,8 +259,6 @@ static int init_seeq(struct net_device *
  17767. sregs->tstat = TSTAT_INIT_SEEQ;
  17768. }
  17769. - hregs->rx_dconfig |= RDMACFG_INIT;
  17770. -
  17771. hregs->rx_ndptr = PHYSADDR(&sp->srings.rx_desc[0]);
  17772. hregs->tx_ndptr = PHYSADDR(&sp->srings.tx_desc[0]);
  17773. @@ -432,7 +429,7 @@ static void sgiseeq_interrupt(int irq, v
  17774. spin_lock(&sp->tx_lock);
  17775. /* Ack the IRQ and set software state. */
  17776. - hregs->rx_reset = HPC3_ERXRST_CLRIRQ;
  17777. + hregs->reset = HPC3_ERST_CLRIRQ;
  17778. /* Always check for received packets. */
  17779. sgiseeq_rx(dev, sp, hregs, sregs);
  17780. @@ -616,7 +613,7 @@ static inline void setup_rx_ring(struct
  17781. #define ALIGNED(x) ((((unsigned long)(x)) + 0xf) & ~(0xf))
  17782. -int sgiseeq_init(struct hpc3_regs* regs, int irq)
  17783. +int sgiseeq_init(struct hpc3_regs* hpcregs, int irq, int has_eeprom)
  17784. {
  17785. struct net_device *dev;
  17786. struct sgiseeq_private *sp;
  17787. @@ -629,7 +626,7 @@ int sgiseeq_init(struct hpc3_regs* regs,
  17788. goto err_out;
  17789. }
  17790. /* Make private data page aligned */
  17791. - sp = (struct sgiseeq_private *) get_zeroed_page(GFP_KERNEL);
  17792. + sp = (struct sgiseeq_private *) get_zeroed_page(GFP_KERNEL);
  17793. if (!sp) {
  17794. printk(KERN_ERR "Sgiseeq: Page alloc failed, aborting.\n");
  17795. err = -ENOMEM;
  17796. @@ -644,7 +641,9 @@ int sgiseeq_init(struct hpc3_regs* regs,
  17797. #define EADDR_NVOFS 250
  17798. for (i = 0; i < 3; i++) {
  17799. - unsigned short tmp = ip22_nvram_read(EADDR_NVOFS / 2 + i);
  17800. + unsigned short tmp = has_eeprom ?
  17801. + ip22_eeprom_read(&hpcregs->eeprom, EADDR_NVOFS / 2+i) :
  17802. + ip22_nvram_read(EADDR_NVOFS / 2+i);
  17803. dev->dev_addr[2 * i] = tmp >> 8;
  17804. dev->dev_addr[2 * i + 1] = tmp & 0xff;
  17805. @@ -654,8 +653,8 @@ int sgiseeq_init(struct hpc3_regs* regs,
  17806. gpriv = sp;
  17807. gdev = dev;
  17808. #endif
  17809. - sp->sregs = (struct sgiseeq_regs *) &hpc3c0->eth_ext[0];
  17810. - sp->hregs = &hpc3c0->ethregs;
  17811. + sp->sregs = (struct sgiseeq_regs *) &hpcregs->eth_ext[0];
  17812. + sp->hregs = &hpcregs->ethregs;
  17813. sp->name = sgiseeqstr;
  17814. sp->mode = SEEQ_RCMD_RBCAST;
  17815. @@ -672,6 +671,11 @@ int sgiseeq_init(struct hpc3_regs* regs,
  17816. setup_rx_ring(sp->srings.rx_desc, SEEQ_RX_BUFFERS);
  17817. setup_tx_ring(sp->srings.tx_desc, SEEQ_TX_BUFFERS);
  17818. + /* Setup PIO and DMA transfer timing */
  17819. + sp->hregs->pconfig = 0x161;
  17820. + sp->hregs->dconfig = HPC3_EDCFG_FIRQ | HPC3_EDCFG_FEOP |
  17821. + HPC3_EDCFG_FRXDC | HPC3_EDCFG_PTO | 0x026;
  17822. +
  17823. /* Reset the chip. */
  17824. hpc3_eth_reset(sp->hregs);
  17825. @@ -699,7 +703,7 @@ int sgiseeq_init(struct hpc3_regs* regs,
  17826. goto err_out_free_irq;
  17827. }
  17828. - printk(KERN_INFO "%s: SGI Seeq8003 ", dev->name);
  17829. + printk(KERN_INFO "%s: %s ", dev->name, sgiseeqstr);
  17830. for (i = 0; i < 6; i++)
  17831. printk("%2.2x%c", dev->dev_addr[i], i == 5 ? '\n' : ':');
  17832. @@ -721,10 +725,22 @@ err_out:
  17833. static int __init sgiseeq_probe(void)
  17834. {
  17835. - printk(version);
  17836. + unsigned int tmp, ret1, ret2 = 0;
  17837. /* On board adapter on 1st HPC is always present */
  17838. - return sgiseeq_init(hpc3c0, SGI_ENET_IRQ);
  17839. + ret1 = sgiseeq_init(hpc3c0, SGI_ENET_IRQ, 0);
  17840. + /* Let's see if second HPC is there */
  17841. + if (!(ip22_is_fullhouse()) &&
  17842. + get_dbe(tmp, (unsigned int *)&hpc3c1->pbdma[1]) == 0) {
  17843. + sgimc->giopar |= SGIMC_GIOPAR_MASTEREXP1 |
  17844. + SGIMC_GIOPAR_EXP164 |
  17845. + SGIMC_GIOPAR_HPC264;
  17846. + hpc3c1->pbus_piocfg[0][0] = 0x3ffff;
  17847. + /* interrupt/config register on Challenge S Mezz board */
  17848. + hpc3c1->pbus_extregs[0][0] = 0x30;
  17849. + ret2 = sgiseeq_init(hpc3c1, SGI_GIO_0_IRQ, 1);
  17850. + }
  17851. + return (ret1 & ret2) ? ret1 : 0;
  17852. }
  17853. static void __exit sgiseeq_exit(void)
  17854. @@ -747,4 +763,6 @@ static void __exit sgiseeq_exit(void)
  17855. module_init(sgiseeq_probe);
  17856. module_exit(sgiseeq_exit);
  17857. +MODULE_DESCRIPTION("SGI Seeq 8003 driver");
  17858. +MODULE_AUTHOR("David S. Miller");
  17859. MODULE_LICENSE("GPL");
  17860. Index: linux-2.4.35.4/drivers/pci/pci.c
  17861. ===================================================================
  17862. --- linux-2.4.35.4.orig/drivers/pci/pci.c
  17863. +++ linux-2.4.35.4/drivers/pci/pci.c
  17864. @@ -1281,11 +1281,17 @@ static int __devinit pci_scan_bridge(str
  17865. {
  17866. unsigned int buses;
  17867. unsigned short cr;
  17868. + unsigned short bctl;
  17869. struct pci_bus *child;
  17870. int is_cardbus = (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS);
  17871. pci_read_config_dword(dev, PCI_PRIMARY_BUS, &buses);
  17872. DBG("Scanning behind PCI bridge %s, config %06x, pass %d\n", dev->slot_name, buses & 0xffffff, pass);
  17873. + /* Disable MasterAbortMode during probing to avoid reporting
  17874. + of bus errors (in some architectures) */
  17875. + pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &bctl);
  17876. + pci_write_config_word(dev, PCI_BRIDGE_CONTROL,
  17877. + bctl & ~PCI_BRIDGE_CTL_MASTER_ABORT);
  17878. if ((buses & 0xffff00) && !pcibios_assign_all_busses()) {
  17879. /*
  17880. * Bus already configured by firmware, process it in the first
  17881. @@ -1351,6 +1357,7 @@ static int __devinit pci_scan_bridge(str
  17882. pci_write_config_byte(dev, PCI_SUBORDINATE_BUS, max);
  17883. pci_write_config_word(dev, PCI_COMMAND, cr);
  17884. }
  17885. + pci_write_config_word(dev, PCI_BRIDGE_CONTROL, bctl);
  17886. sprintf(child->name, (is_cardbus ? "PCI CardBus #%02x" : "PCI Bus #%02x"), child->number);
  17887. return max;
  17888. }
  17889. Index: linux-2.4.35.4/drivers/pcmcia/au1000_db1x00.c
  17890. ===================================================================
  17891. --- linux-2.4.35.4.orig/drivers/pcmcia/au1000_db1x00.c
  17892. +++ linux-2.4.35.4/drivers/pcmcia/au1000_db1x00.c
  17893. @@ -1,6 +1,6 @@
  17894. /*
  17895. *
  17896. - * Alchemy Semi Db1x00 boards specific pcmcia routines.
  17897. + * AMD Alchemy DUAL-SLOT Db1x00 boards' specific pcmcia routines.
  17898. *
  17899. * Copyright 2002 MontaVista Software Inc.
  17900. * Author: MontaVista Software, Inc.
  17901. @@ -54,9 +54,20 @@
  17902. #include <asm/au1000.h>
  17903. #include <asm/au1000_pcmcia.h>
  17904. +#if defined(CONFIG_MIPS_PB1200)
  17905. +#include <asm/pb1200.h>
  17906. +#elif defined(CONFIG_MIPS_DB1200)
  17907. +#include <asm/db1200.h>
  17908. +#else
  17909. #include <asm/db1x00.h>
  17910. +#endif
  17911. -static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  17912. +#define PCMCIA_MAX_SOCK 1
  17913. +#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK+1)
  17914. +
  17915. +/* VPP/VCC */
  17916. +#define SET_VCC_VPP(VCC, VPP, SLOT)\
  17917. + ((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8))
  17918. static int db1x00_pcmcia_init(struct pcmcia_init *init)
  17919. {
  17920. @@ -76,7 +87,7 @@ static int
  17921. db1x00_pcmcia_socket_state(unsigned sock, struct pcmcia_state *state)
  17922. {
  17923. u32 inserted;
  17924. - unsigned char vs;
  17925. + u16 vs;
  17926. if(sock > PCMCIA_MAX_SOCK) return -1;
  17927. @@ -87,11 +98,11 @@ db1x00_pcmcia_socket_state(unsigned sock
  17928. if (sock == 0) {
  17929. vs = bcsr->status & 0x3;
  17930. - inserted = !(bcsr->status & (1<<4));
  17931. + inserted = BOARD_CARD_INSERTED(0);
  17932. }
  17933. else {
  17934. vs = (bcsr->status & 0xC)>>2;
  17935. - inserted = !(bcsr->status & (1<<5));
  17936. + inserted = BOARD_CARD_INSERTED(1);
  17937. }
  17938. DEBUG(KERN_DEBUG "db1x00 socket %d: inserted %d, vs %d\n",
  17939. @@ -144,16 +155,9 @@ static int db1x00_pcmcia_get_irq_info(st
  17940. if(info->sock > PCMCIA_MAX_SOCK) return -1;
  17941. if(info->sock == 0)
  17942. -#ifdef CONFIG_MIPS_DB1550
  17943. - info->irq = AU1000_GPIO_3;
  17944. + info->irq = BOARD_PC0_INT;
  17945. else
  17946. - info->irq = AU1000_GPIO_5;
  17947. -#else
  17948. - info->irq = AU1000_GPIO_2;
  17949. - else
  17950. - info->irq = AU1000_GPIO_5;
  17951. -#endif
  17952. -
  17953. + info->irq = BOARD_PC1_INT;
  17954. return 0;
  17955. }
  17956. Index: linux-2.4.35.4/drivers/pcmcia/Config.in
  17957. ===================================================================
  17958. --- linux-2.4.35.4.orig/drivers/pcmcia/Config.in
  17959. +++ linux-2.4.35.4/drivers/pcmcia/Config.in
  17960. @@ -30,16 +30,14 @@ if [ "$CONFIG_PCMCIA" != "n" ]; then
  17961. dep_tristate ' M8xx support' CONFIG_PCMCIA_M8XX $CONFIG_PCMCIA
  17962. fi
  17963. if [ "$CONFIG_SOC_AU1X00" = "y" ]; then
  17964. - dep_tristate ' Au1x00 PCMCIA support' CONFIG_PCMCIA_AU1X00 $CONFIG_PCMCIA
  17965. - if [ "$CONFIG_PCMCIA_AU1X00" != "n" ]; then
  17966. - bool ' Pb1x00 board support' CONFIG_PCMCIA_PB1X00
  17967. - bool ' Db1x00 board support' CONFIG_PCMCIA_DB1X00
  17968. - bool ' XXS1500 board support' CONFIG_PCMCIA_XXS1500
  17969. - fi
  17970. + dep_tristate ' Au1x00 PCMCIA support' CONFIG_PCMCIA_AU1X00 $CONFIG_PCMCIA
  17971. fi
  17972. if [ "$CONFIG_SIBYTE_SB1xxx_SOC" = "y" ]; then
  17973. dep_bool ' SiByte PCMCIA support' CONFIG_PCMCIA_SIBYTE $CONFIG_PCMCIA $CONFIG_BLK_DEV_IDE_SIBYTE
  17974. fi
  17975. + if [ "$CONFIG_VRC4171" = "y" -o "$CONFIG_VRC4171" = "m" ]; then
  17976. + dep_tristate ' NEC VRC4171 Card Controllers support' CONFIG_PCMCIA_VRC4171 $CONFIG_PCMCIA
  17977. + fi
  17978. if [ "$CONFIG_VRC4173" = "y" -o "$CONFIG_VRC4173" = "m" ]; then
  17979. dep_tristate ' NEC VRC4173 CARDU support' CONFIG_PCMCIA_VRC4173 $CONFIG_PCMCIA
  17980. fi
  17981. Index: linux-2.4.35.4/drivers/pcmcia/Makefile
  17982. ===================================================================
  17983. --- linux-2.4.35.4.orig/drivers/pcmcia/Makefile
  17984. +++ linux-2.4.35.4/drivers/pcmcia/Makefile
  17985. @@ -61,9 +61,18 @@ endif
  17986. obj-$(CONFIG_PCMCIA_AU1X00) += au1x00_ss.o
  17987. au1000_ss-objs-y := au1000_generic.o
  17988. -au1000_ss-objs-$(CONFIG_PCMCIA_PB1X00) += au1000_pb1x00.o
  17989. -au1000_ss-objs-$(CONFIG_PCMCIA_DB1X00) += au1000_db1x00.o
  17990. -au1000_ss-objs-$(CONFIG_PCMCIA_XXS1500) += au1000_xxs1500.o
  17991. +au1000_ss-objs-$(CONFIG_MIPS_PB1000) += au1000_pb1x00.o
  17992. +au1000_ss-objs-$(CONFIG_MIPS_PB1100) += au1000_pb1x00.o
  17993. +au1000_ss-objs-$(CONFIG_MIPS_PB1500) += au1000_pb1x00.o
  17994. +au1000_ss-objs-$(CONFIG_MIPS_PB1550) += au1000_pb1550.o
  17995. +au1000_ss-objs-$(CONFIG_MIPS_PB1200) += au1000_db1x00.o
  17996. +au1000_ss-objs-$(CONFIG_MIPS_DB1000) += au1000_db1x00.o
  17997. +au1000_ss-objs-$(CONFIG_MIPS_DB1100) += au1000_db1x00.o
  17998. +au1000_ss-objs-$(CONFIG_MIPS_DB1500) += au1000_db1x00.o
  17999. +au1000_ss-objs-$(CONFIG_MIPS_DB1550) += au1000_db1x00.o
  18000. +au1000_ss-objs-$(CONFIG_MIPS_DB1200) += au1000_db1x00.o
  18001. +au1000_ss-objs-$(CONFIG_MIPS_HYDROGEN3) += au1000_hydrogen3.o
  18002. +au1000_ss-objs-$(CONFIG_MIPS_XXS1500) += au1000_xxs1500.o
  18003. obj-$(CONFIG_PCMCIA_SA1100) += sa1100_cs.o
  18004. obj-$(CONFIG_PCMCIA_M8XX) += m8xx_pcmcia.o
  18005. @@ -89,6 +98,7 @@ sa1100_cs-objs-$(CONFIG_SA1100_STORK) +
  18006. sa1100_cs-objs-$(CONFIG_SA1100_XP860) += sa1100_xp860.o sa1111_generic.o
  18007. sa1100_cs-objs-$(CONFIG_SA1100_YOPY) += sa1100_yopy.o
  18008. +obj-$(CONFIG_PCMCIA_VRC4171) += vrc4171_card.o
  18009. obj-$(CONFIG_PCMCIA_VRC4173) += vrc4173_cardu.o
  18010. include $(TOPDIR)/Rules.make
  18011. Index: linux-2.4.35.4/drivers/pcmcia/vrc4171_card.c
  18012. ===================================================================
  18013. --- /dev/null
  18014. +++ linux-2.4.35.4/drivers/pcmcia/vrc4171_card.c
  18015. @@ -0,0 +1,886 @@
  18016. +/*
  18017. + * vrc4171_card.c, NEC VRC4171 Card Controller driver for Socket Services.
  18018. + *
  18019. + * Copyright (C) 2003 Yoichi Yuasa <[email protected]>
  18020. + *
  18021. + * This program is free software; you can redistribute it and/or modify
  18022. + * it under the terms of the GNU General Public License as published by
  18023. + * the Free Software Foundation; either version 2 of the License, or
  18024. + * (at your option) any later version.
  18025. + *
  18026. + * This program is distributed in the hope that it will be useful,
  18027. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18028. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18029. + * GNU General Public License for more details.
  18030. + *
  18031. + * You should have received a copy of the GNU General Public License
  18032. + * along with this program; if not, write to the Free Software
  18033. + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18034. + */
  18035. +#include <linux/init.h>
  18036. +#include <linux/ioport.h>
  18037. +#include <linux/irq.h>
  18038. +#include <linux/module.h>
  18039. +#include <linux/spinlock.h>
  18040. +#include <linux/sched.h>
  18041. +#include <linux/types.h>
  18042. +
  18043. +#include <asm/io.h>
  18044. +#include <asm/vr41xx/vrc4171.h>
  18045. +
  18046. +#include <pcmcia/ss.h>
  18047. +
  18048. +#include "i82365.h"
  18049. +
  18050. +MODULE_DESCRIPTION("NEC VRC4171 Card Controllers driver for Socket Services");
  18051. +MODULE_AUTHOR("Yoichi Yuasa <[email protected]>");
  18052. +MODULE_LICENSE("GPL");
  18053. +
  18054. +#define CARD_MAX_SLOTS 2
  18055. +#define CARD_SLOTA 0
  18056. +#define CARD_SLOTB 1
  18057. +#define CARD_SLOTB_OFFSET 0x40
  18058. +
  18059. +#define CARD_MEM_START 0x10000000
  18060. +#define CARD_MEM_END 0x13ffffff
  18061. +#define CARD_MAX_MEM_OFFSET 0x3ffffff
  18062. +#define CARD_MAX_MEM_SPEED 1000
  18063. +
  18064. +#define CARD_CONTROLLER_INDEX 0x03e0
  18065. +#define CARD_CONTROLLER_DATA 0x03e1
  18066. +#define CARD_CONTROLLER_SIZE 2
  18067. + /* Power register */
  18068. + #define VPP_GET_VCC 0x01
  18069. + #define POWER_ENABLE 0x10
  18070. + #define CARD_VOLTAGE_SENSE 0x1f
  18071. + #define VCC_3VORXV_CAPABLE 0x00
  18072. + #define VCC_XV_ONLY 0x01
  18073. + #define VCC_3V_CAPABLE 0x02
  18074. + #define VCC_5V_ONLY 0x03
  18075. + #define CARD_VOLTAGE_SELECT 0x2f
  18076. + #define VCC_3V 0x01
  18077. + #define VCC_5V 0x00
  18078. + #define VCC_XV 0x02
  18079. + #define VCC_STATUS_3V 0x02
  18080. + #define VCC_STATUS_5V 0x01
  18081. + #define VCC_STATUS_XV 0x03
  18082. + #define GLOBAL_CONTROL 0x1e
  18083. + #define EXWRBK 0x04
  18084. + #define IRQPM_EN 0x08
  18085. + #define CLRPMIRQ 0x10
  18086. +
  18087. +#define IO_MAX_MAPS 2
  18088. +#define MEM_MAX_MAPS 5
  18089. +
  18090. +enum {
  18091. + SLOTB_PROBE = 0,
  18092. + SLOTB_NOPROBE_IO,
  18093. + SLOTB_NOPROBE_MEM,
  18094. + SLOTB_NOPROBE_ALL
  18095. +};
  18096. +
  18097. +typedef struct vrc4171_socket {
  18098. + int noprobe;
  18099. + void (*handler)(void *, unsigned int);
  18100. + void *info;
  18101. + socket_cap_t cap;
  18102. + spinlock_t event_lock;
  18103. + uint16_t events;
  18104. + struct socket_info_t *pcmcia_socket;
  18105. + struct tq_struct tq_task;
  18106. + char name[24];
  18107. + int csc_irq;
  18108. + int io_irq;
  18109. +} vrc4171_socket_t;
  18110. +
  18111. +static vrc4171_socket_t vrc4171_sockets[CARD_MAX_SLOTS];
  18112. +static int vrc4171_slotb = SLOTB_IS_NONE;
  18113. +static unsigned int vrc4171_irq;
  18114. +static uint16_t vrc4171_irq_mask = 0xdeb8;
  18115. +
  18116. +extern struct socket_info_t *pcmcia_register_socket(int slot,
  18117. + struct pccard_operations *vtable,
  18118. + int use_bus_pm);
  18119. +extern void pcmcia_unregister_socket(struct socket_info_t *s);
  18120. +
  18121. +static inline uint8_t exca_read_byte(int slot, uint8_t index)
  18122. +{
  18123. + if (slot == CARD_SLOTB)
  18124. + index += CARD_SLOTB_OFFSET;
  18125. +
  18126. + outb(index, CARD_CONTROLLER_INDEX);
  18127. + return inb(CARD_CONTROLLER_DATA);
  18128. +}
  18129. +
  18130. +static inline uint16_t exca_read_word(int slot, uint8_t index)
  18131. +{
  18132. + uint16_t data;
  18133. +
  18134. + if (slot == CARD_SLOTB)
  18135. + index += CARD_SLOTB_OFFSET;
  18136. +
  18137. + outb(index++, CARD_CONTROLLER_INDEX);
  18138. + data = inb(CARD_CONTROLLER_DATA);
  18139. +
  18140. + outb(index, CARD_CONTROLLER_INDEX);
  18141. + data |= ((uint16_t)inb(CARD_CONTROLLER_DATA)) << 8;
  18142. +
  18143. + return data;
  18144. +}
  18145. +
  18146. +static inline uint8_t exca_write_byte(int slot, uint8_t index, uint8_t data)
  18147. +{
  18148. + if (slot == CARD_SLOTB)
  18149. + index += CARD_SLOTB_OFFSET;
  18150. +
  18151. + outb(index, CARD_CONTROLLER_INDEX);
  18152. + outb(data, CARD_CONTROLLER_DATA);
  18153. +
  18154. + return data;
  18155. +}
  18156. +
  18157. +static inline uint16_t exca_write_word(int slot, uint8_t index, uint16_t data)
  18158. +{
  18159. + if (slot == CARD_SLOTB)
  18160. + index += CARD_SLOTB_OFFSET;
  18161. +
  18162. + outb(index++, CARD_CONTROLLER_INDEX);
  18163. + outb(data, CARD_CONTROLLER_DATA);
  18164. +
  18165. + outb(index, CARD_CONTROLLER_INDEX);
  18166. + outb((uint8_t)(data >> 8), CARD_CONTROLLER_DATA);
  18167. +
  18168. + return data;
  18169. +}
  18170. +
  18171. +static inline int search_nonuse_irq(void)
  18172. +{
  18173. + int i;
  18174. +
  18175. + for (i = 0; i < 16; i++) {
  18176. + if (vrc4171_irq_mask & (1 << i)) {
  18177. + vrc4171_irq_mask &= ~(1 << i);
  18178. + return i;
  18179. + }
  18180. + }
  18181. +
  18182. + return -1;
  18183. +}
  18184. +
  18185. +static int pccard_init(unsigned int slot)
  18186. +{
  18187. + vrc4171_socket_t *socket = &vrc4171_sockets[slot];
  18188. +
  18189. + socket->cap.features |= SS_CAP_PCCARD | SS_CAP_PAGE_REGS;
  18190. + socket->cap.irq_mask = 0;
  18191. + socket->cap.pci_irq = vrc4171_irq;
  18192. + socket->cap.map_size = 0x1000;
  18193. + socket->events = 0;
  18194. + spin_lock_init(socket->event_lock);
  18195. + socket->csc_irq = search_nonuse_irq();
  18196. + socket->io_irq = search_nonuse_irq();
  18197. +
  18198. + return 0;
  18199. +}
  18200. +
  18201. +static int pccard_suspend(unsigned int slot)
  18202. +{
  18203. + return -EINVAL;
  18204. +}
  18205. +
  18206. +static int pccard_register_callback(unsigned int slot,
  18207. + void (*handler)(void *, unsigned int),
  18208. + void *info)
  18209. +{
  18210. + vrc4171_socket_t *socket;
  18211. +
  18212. + if (slot >= CARD_MAX_SLOTS)
  18213. + return -EINVAL;
  18214. +
  18215. + socket = &vrc4171_sockets[slot];
  18216. +
  18217. + socket->handler = handler;
  18218. + socket->info = info;
  18219. +
  18220. + if (handler)
  18221. + MOD_INC_USE_COUNT;
  18222. + else
  18223. + MOD_DEC_USE_COUNT;
  18224. +
  18225. + return 0;
  18226. +}
  18227. +
  18228. +static int pccard_inquire_socket(unsigned int slot, socket_cap_t *cap)
  18229. +{
  18230. + vrc4171_socket_t *socket;
  18231. +
  18232. + if (slot >= CARD_MAX_SLOTS || cap == NULL)
  18233. + return -EINVAL;
  18234. +
  18235. + socket = &vrc4171_sockets[slot];
  18236. +
  18237. + *cap = socket->cap;
  18238. +
  18239. + return 0;
  18240. +}
  18241. +
  18242. +static int pccard_get_status(unsigned int slot, u_int *value)
  18243. +{
  18244. + uint8_t status, sense;
  18245. + u_int val = 0;
  18246. +
  18247. + if (slot >= CARD_MAX_SLOTS || value == NULL)
  18248. + return -EINVAL;
  18249. +
  18250. + status = exca_read_byte(slot, I365_STATUS);
  18251. + if (exca_read_byte(slot, I365_INTCTL) & I365_PC_IOCARD) {
  18252. + if (status & I365_CS_STSCHG)
  18253. + val |= SS_STSCHG;
  18254. + } else {
  18255. + if (!(status & I365_CS_BVD1))
  18256. + val |= SS_BATDEAD;
  18257. + else if ((status & (I365_CS_BVD1 | I365_CS_BVD2)) == I365_CS_BVD1)
  18258. + val |= SS_BATWARN;
  18259. + }
  18260. + if ((status & I365_CS_DETECT) == I365_CS_DETECT)
  18261. + val |= SS_DETECT;
  18262. + if (status & I365_CS_WRPROT)
  18263. + val |= SS_WRPROT;
  18264. + if (status & I365_CS_READY)
  18265. + val |= SS_READY;
  18266. + if (status & I365_CS_POWERON)
  18267. + val |= SS_POWERON;
  18268. +
  18269. + sense = exca_read_byte(slot, CARD_VOLTAGE_SENSE);
  18270. + switch (sense) {
  18271. + case VCC_3VORXV_CAPABLE:
  18272. + val |= SS_3VCARD | SS_XVCARD;
  18273. + break;
  18274. + case VCC_XV_ONLY:
  18275. + val |= SS_XVCARD;
  18276. + break;
  18277. + case VCC_3V_CAPABLE:
  18278. + val |= SS_3VCARD;
  18279. + break;
  18280. + default:
  18281. + /* 5V only */
  18282. + break;
  18283. + }
  18284. +
  18285. + *value = val;
  18286. +
  18287. + return 0;
  18288. +}
  18289. +
  18290. +static inline u_char get_Vcc_value(uint8_t voltage)
  18291. +{
  18292. + switch (voltage) {
  18293. + case VCC_STATUS_3V:
  18294. + return 33;
  18295. + case VCC_STATUS_5V:
  18296. + return 50;
  18297. + default:
  18298. + break;
  18299. + }
  18300. +
  18301. + return 0;
  18302. +}
  18303. +
  18304. +static inline u_char get_Vpp_value(uint8_t power, u_char Vcc)
  18305. +{
  18306. + if ((power & 0x03) == 0x01 || (power & 0x03) == 0x02)
  18307. + return Vcc;
  18308. +
  18309. + return 0;
  18310. +}
  18311. +
  18312. +static int pccard_get_socket(unsigned int slot, socket_state_t *state)
  18313. +{
  18314. + vrc4171_socket_t *socket;
  18315. + uint8_t power, voltage, control, cscint;
  18316. +
  18317. + if (slot >= CARD_MAX_SLOTS || state == NULL)
  18318. + return -EINVAL;
  18319. +
  18320. + socket = &vrc4171_sockets[slot];
  18321. +
  18322. + power = exca_read_byte(slot, I365_POWER);
  18323. + voltage = exca_read_byte(slot, CARD_VOLTAGE_SELECT);
  18324. +
  18325. + state->Vcc = get_Vcc_value(voltage);
  18326. + state->Vpp = get_Vpp_value(power, state->Vcc);
  18327. +
  18328. + state->flags = 0;
  18329. + if (power & POWER_ENABLE)
  18330. + state->flags |= SS_PWR_AUTO;
  18331. + if (power & I365_PWR_OUT)
  18332. + state->flags |= SS_OUTPUT_ENA;
  18333. +
  18334. + control = exca_read_byte(slot, I365_INTCTL);
  18335. + if (control & I365_PC_IOCARD)
  18336. + state->flags |= SS_IOCARD;
  18337. + if (!(control & I365_PC_RESET))
  18338. + state->flags |= SS_RESET;
  18339. +
  18340. + cscint = exca_read_byte(slot, I365_CSCINT);
  18341. + state->csc_mask = 0;
  18342. + if (state->flags & SS_IOCARD) {
  18343. + if (cscint & I365_CSC_STSCHG)
  18344. + state->flags |= SS_STSCHG;
  18345. + } else {
  18346. + if (cscint & I365_CSC_BVD1)
  18347. + state->csc_mask |= SS_BATDEAD;
  18348. + if (cscint & I365_CSC_BVD2)
  18349. + state->csc_mask |= SS_BATWARN;
  18350. + }
  18351. + if (cscint & I365_CSC_READY)
  18352. + state->csc_mask |= SS_READY;
  18353. + if (cscint & I365_CSC_DETECT)
  18354. + state->csc_mask |= SS_DETECT;
  18355. +
  18356. + return 0;
  18357. +}
  18358. +
  18359. +static inline uint8_t set_Vcc_value(u_char Vcc)
  18360. +{
  18361. + switch (Vcc) {
  18362. + case 33:
  18363. + return VCC_3V;
  18364. + case 50:
  18365. + return VCC_5V;
  18366. + }
  18367. +
  18368. + /* Small voltage is chosen for safety. */
  18369. + return VCC_3V;
  18370. +}
  18371. +
  18372. +static int pccard_set_socket(unsigned int slot, socket_state_t *state)
  18373. +{
  18374. + vrc4171_socket_t *socket;
  18375. + uint8_t voltage, power, control, cscint;
  18376. +
  18377. + if (slot >= CARD_MAX_SLOTS ||
  18378. + (state->Vpp != state->Vcc && state->Vpp != 0) ||
  18379. + (state->Vcc != 50 && state->Vcc != 33 && state->Vcc != 0))
  18380. + return -EINVAL;
  18381. +
  18382. + socket = &vrc4171_sockets[slot];
  18383. +
  18384. + spin_lock_irq(&socket->event_lock);
  18385. +
  18386. + voltage = set_Vcc_value(state->Vcc);
  18387. + exca_write_byte(slot, CARD_VOLTAGE_SELECT, voltage);
  18388. +
  18389. + power = POWER_ENABLE;
  18390. + if (state->Vpp == state->Vcc)
  18391. + power |= VPP_GET_VCC;
  18392. + if (state->flags & SS_OUTPUT_ENA)
  18393. + power |= I365_PWR_OUT;
  18394. + exca_write_byte(slot, I365_POWER, power);
  18395. +
  18396. + control = 0;
  18397. + if (state->io_irq != 0)
  18398. + control |= socket->io_irq;
  18399. + if (state->flags & SS_IOCARD)
  18400. + control |= I365_PC_IOCARD;
  18401. + if (state->flags & SS_RESET)
  18402. + control &= ~I365_PC_RESET;
  18403. + else
  18404. + control |= I365_PC_RESET;
  18405. + exca_write_byte(slot, I365_INTCTL, control);
  18406. +
  18407. + cscint = 0;
  18408. + exca_write_byte(slot, I365_CSCINT, cscint);
  18409. + exca_read_byte(slot, I365_CSC); /* clear CardStatus change */
  18410. + if (state->csc_mask != 0)
  18411. + cscint |= socket->csc_irq << 8;
  18412. + if (state->flags & SS_IOCARD) {
  18413. + if (state->csc_mask & SS_STSCHG)
  18414. + cscint |= I365_CSC_STSCHG;
  18415. + } else {
  18416. + if (state->csc_mask & SS_BATDEAD)
  18417. + cscint |= I365_CSC_BVD1;
  18418. + if (state->csc_mask & SS_BATWARN)
  18419. + cscint |= I365_CSC_BVD2;
  18420. + }
  18421. + if (state->csc_mask & SS_READY)
  18422. + cscint |= I365_CSC_READY;
  18423. + if (state->csc_mask & SS_DETECT)
  18424. + cscint |= I365_CSC_DETECT;
  18425. + exca_write_byte(slot, I365_CSCINT, cscint);
  18426. +
  18427. + spin_unlock_irq(&socket->event_lock);
  18428. +
  18429. + return 0;
  18430. +}
  18431. +
  18432. +static int pccard_get_io_map(unsigned int slot, struct pccard_io_map *io)
  18433. +{
  18434. + vrc4171_socket_t *socket;
  18435. + uint8_t ioctl, addrwin;
  18436. + u_char map;
  18437. +
  18438. + if (slot >= CARD_MAX_SLOTS || io == NULL ||
  18439. + io->map >= IO_MAX_MAPS)
  18440. + return -EINVAL;
  18441. +
  18442. + socket = &vrc4171_sockets[slot];
  18443. + map = io->map;
  18444. +
  18445. + io->start = exca_read_word(slot, I365_IO(map)+I365_W_START);
  18446. + io->stop = exca_read_word(slot, I365_IO(map)+I365_W_STOP);
  18447. +
  18448. + ioctl = exca_read_byte(slot, I365_IOCTL);
  18449. + if (io->flags & I365_IOCTL_WAIT(map))
  18450. + io->speed = 1;
  18451. + else
  18452. + io->speed = 0;
  18453. +
  18454. + io->flags = 0;
  18455. + if (ioctl & I365_IOCTL_16BIT(map))
  18456. + io->flags |= MAP_16BIT;
  18457. + if (ioctl & I365_IOCTL_IOCS16(map))
  18458. + io->flags |= MAP_AUTOSZ;
  18459. + if (ioctl & I365_IOCTL_0WS(map))
  18460. + io->flags |= MAP_0WS;
  18461. +
  18462. + addrwin = exca_read_byte(slot, I365_ADDRWIN);
  18463. + if (addrwin & I365_ENA_IO(map))
  18464. + io->flags |= MAP_ACTIVE;
  18465. +
  18466. + return 0;
  18467. +}
  18468. +
  18469. +static int pccard_set_io_map(unsigned int slot, struct pccard_io_map *io)
  18470. +{
  18471. + vrc4171_socket_t *socket;
  18472. + uint8_t ioctl, addrwin;
  18473. + u_char map;
  18474. +
  18475. + if (slot >= CARD_MAX_SLOTS ||
  18476. + io == NULL || io->map >= IO_MAX_MAPS ||
  18477. + io->start > 0xffff || io->stop > 0xffff || io->start > io->stop)
  18478. + return -EINVAL;
  18479. +
  18480. + socket = &vrc4171_sockets[slot];
  18481. + map = io->map;
  18482. +
  18483. + addrwin = exca_read_byte(slot, I365_ADDRWIN);
  18484. + if (addrwin & I365_ENA_IO(map)) {
  18485. + addrwin &= ~I365_ENA_IO(map);
  18486. + exca_write_byte(slot, I365_ADDRWIN, addrwin);
  18487. + }
  18488. +
  18489. + exca_write_word(slot, I365_IO(map)+I365_W_START, io->start);
  18490. + exca_write_word(slot, I365_IO(map)+I365_W_STOP, io->stop);
  18491. +
  18492. + ioctl = 0;
  18493. + if (io->speed > 0)
  18494. + ioctl |= I365_IOCTL_WAIT(map);
  18495. + if (io->flags & MAP_16BIT)
  18496. + ioctl |= I365_IOCTL_16BIT(map);
  18497. + if (io->flags & MAP_AUTOSZ)
  18498. + ioctl |= I365_IOCTL_IOCS16(map);
  18499. + if (io->flags & MAP_0WS)
  18500. + ioctl |= I365_IOCTL_0WS(map);
  18501. + exca_write_byte(slot, I365_IOCTL, ioctl);
  18502. +
  18503. + if (io->flags & MAP_ACTIVE) {
  18504. + addrwin |= I365_ENA_IO(map);
  18505. + exca_write_byte(slot, I365_ADDRWIN, addrwin);
  18506. + }
  18507. +
  18508. + return 0;
  18509. +}
  18510. +
  18511. +static int pccard_get_mem_map(unsigned int slot, struct pccard_mem_map *mem)
  18512. +{
  18513. + vrc4171_socket_t *socket;
  18514. + uint8_t addrwin;
  18515. + u_long start, stop;
  18516. + u_int offset;
  18517. + u_char map;
  18518. +
  18519. + if (slot >= CARD_MAX_SLOTS || mem == NULL || mem->map >= MEM_MAX_MAPS)
  18520. + return -EINVAL;
  18521. +
  18522. + socket = &vrc4171_sockets[slot];
  18523. + map = mem->map;
  18524. +
  18525. + mem->flags = 0;
  18526. + mem->speed = 0;
  18527. +
  18528. + addrwin = exca_read_byte(slot, I365_ADDRWIN);
  18529. + if (addrwin & I365_ENA_MEM(map))
  18530. + mem->flags |= MAP_ACTIVE;
  18531. +
  18532. + start = exca_read_word(slot, I365_MEM(map)+I365_W_START);
  18533. + if (start & I365_MEM_16BIT)
  18534. + mem->flags |= MAP_16BIT;
  18535. + mem->sys_start = (start & 0x3fffUL) << 12;
  18536. +
  18537. + stop = exca_read_word(slot, I365_MEM(map)+I365_W_STOP);
  18538. + if (start & I365_MEM_WS0)
  18539. + mem->speed += 1;
  18540. + if (start & I365_MEM_WS1)
  18541. + mem->speed += 2;
  18542. + mem->sys_stop = ((stop & 0x3fffUL) << 12) + 0xfffUL;
  18543. +
  18544. + offset = exca_read_word(slot, I365_MEM(map)+I365_W_OFF);
  18545. + if (offset & I365_MEM_REG)
  18546. + mem->flags |= MAP_ATTRIB;
  18547. + if (offset & I365_MEM_WRPROT)
  18548. + mem->flags |= MAP_WRPROT;
  18549. + mem->card_start = (offset & 0x3fffUL) << 12;
  18550. +
  18551. + mem->sys_start += CARD_MEM_START;
  18552. + mem->sys_stop += CARD_MEM_START;
  18553. +
  18554. + return 0;
  18555. +}
  18556. +
  18557. +static int pccard_set_mem_map(unsigned int slot, struct pccard_mem_map *mem)
  18558. +{
  18559. + vrc4171_socket_t *socket;
  18560. + uint16_t start, stop, offset;
  18561. + uint8_t addrwin;
  18562. + u_char map;
  18563. +
  18564. + if (slot >= CARD_MAX_SLOTS ||
  18565. + mem == NULL || mem->map >= MEM_MAX_MAPS ||
  18566. + mem->sys_start < CARD_MEM_START || mem->sys_start > CARD_MEM_END ||
  18567. + mem->sys_stop < CARD_MEM_START || mem->sys_stop > CARD_MEM_END ||
  18568. + mem->sys_start > mem->sys_stop ||
  18569. + mem->card_start > CARD_MAX_MEM_OFFSET ||
  18570. + mem->speed > CARD_MAX_MEM_SPEED)
  18571. + return -EINVAL;
  18572. +
  18573. + socket = &vrc4171_sockets[slot];
  18574. + map = mem->map;
  18575. +
  18576. + addrwin = exca_read_byte(slot, I365_ADDRWIN);
  18577. + if (addrwin & I365_ENA_MEM(map)) {
  18578. + addrwin &= ~I365_ENA_MEM(map);
  18579. + exca_write_byte(slot, I365_ADDRWIN, addrwin);
  18580. + }
  18581. +
  18582. + start = (mem->sys_start >> 12) & 0x3fff;
  18583. + if (mem->flags & MAP_16BIT)
  18584. + start |= I365_MEM_16BIT;
  18585. + exca_write_word(slot, I365_MEM(map)+I365_W_START, start);
  18586. +
  18587. + stop = (mem->sys_stop >> 12) & 0x3fff;
  18588. + switch (mem->speed) {
  18589. + case 0:
  18590. + break;
  18591. + case 1:
  18592. + stop |= I365_MEM_WS0;
  18593. + break;
  18594. + case 2:
  18595. + stop |= I365_MEM_WS1;
  18596. + break;
  18597. + default:
  18598. + stop |= I365_MEM_WS0 | I365_MEM_WS1;
  18599. + break;
  18600. + }
  18601. + exca_write_word(slot, I365_MEM(map)+I365_W_STOP, stop);
  18602. +
  18603. + offset = (mem->card_start >> 12) & 0x3fff;
  18604. + if (mem->flags & MAP_ATTRIB)
  18605. + offset |= I365_MEM_REG;
  18606. + if (mem->flags & MAP_WRPROT)
  18607. + offset |= I365_MEM_WRPROT;
  18608. + exca_write_word(slot, I365_MEM(map)+I365_W_OFF, offset);
  18609. +
  18610. + if (mem->flags & MAP_ACTIVE) {
  18611. + addrwin |= I365_ENA_MEM(map);
  18612. + exca_write_byte(slot, I365_ADDRWIN, addrwin);
  18613. + }
  18614. +
  18615. + return 0;
  18616. +}
  18617. +
  18618. +static void pccard_proc_setup(unsigned int slot, struct proc_dir_entry *base)
  18619. +{
  18620. +}
  18621. +
  18622. +static struct pccard_operations vrc4171_pccard_operations = {
  18623. + .init = pccard_init,
  18624. + .suspend = pccard_suspend,
  18625. + .register_callback = pccard_register_callback,
  18626. + .inquire_socket = pccard_inquire_socket,
  18627. + .get_status = pccard_get_status,
  18628. + .get_socket = pccard_get_socket,
  18629. + .set_socket = pccard_set_socket,
  18630. + .get_io_map = pccard_get_io_map,
  18631. + .set_io_map = pccard_set_io_map,
  18632. + .get_mem_map = pccard_get_mem_map,
  18633. + .set_mem_map = pccard_set_mem_map,
  18634. + .proc_setup = pccard_proc_setup,
  18635. +};
  18636. +
  18637. +static void pccard_bh(void *data)
  18638. +{
  18639. + vrc4171_socket_t *socket = (vrc4171_socket_t *)data;
  18640. + uint16_t events;
  18641. +
  18642. + spin_lock_irq(&socket->event_lock);
  18643. + events = socket->events;
  18644. + socket->events = 0;
  18645. + spin_unlock_irq(&socket->event_lock);
  18646. +
  18647. + if (socket->handler)
  18648. + socket->handler(socket->info, events);
  18649. +}
  18650. +
  18651. +static inline uint16_t get_events(int slot)
  18652. +{
  18653. + uint16_t events = 0;
  18654. + uint8_t status, csc;
  18655. +
  18656. + status = exca_read_byte(slot, I365_STATUS);
  18657. + csc = exca_read_byte(slot, I365_CSC);
  18658. +
  18659. + if (exca_read_byte(slot, I365_INTCTL) & I365_PC_IOCARD) {
  18660. + if ((csc & I365_CSC_STSCHG) && (status & I365_CS_STSCHG))
  18661. + events |= SS_STSCHG;
  18662. + } else {
  18663. + if (csc & (I365_CSC_BVD1 | I365_CSC_BVD2)) {
  18664. + if (!(status & I365_CS_BVD1))
  18665. + events |= SS_BATDEAD;
  18666. + else if ((status & (I365_CS_BVD1 | I365_CS_BVD2)) == I365_CS_BVD1)
  18667. + events |= SS_BATWARN;
  18668. + }
  18669. + }
  18670. + if ((csc & I365_CSC_READY) && (status & I365_CS_READY))
  18671. + events |= SS_READY;
  18672. + if ((csc & I365_CSC_DETECT) && ((status & I365_CS_DETECT) == I365_CS_DETECT))
  18673. + events |= SS_DETECT;
  18674. +
  18675. + return events;
  18676. +}
  18677. +
  18678. +static void pccard_status_change(int slot, vrc4171_socket_t *socket)
  18679. +{
  18680. + uint16_t events;
  18681. +
  18682. + socket->tq_task.routine = pccard_bh;
  18683. + socket->tq_task.data = socket;
  18684. +
  18685. + events = get_events(slot);
  18686. + if (events) {
  18687. + spin_lock(&socket->event_lock);
  18688. + socket->events |= events;
  18689. + spin_unlock(&socket->event_lock);
  18690. + schedule_task(&socket->tq_task);
  18691. + }
  18692. +}
  18693. +
  18694. +static void pccard_interrupt(int irq, void *dev_id, struct pt_regs *regs)
  18695. +{
  18696. + vrc4171_socket_t *socket;
  18697. + uint16_t status;
  18698. +
  18699. + status = vrc4171_get_irq_status();
  18700. + if (status & IRQ_A) {
  18701. + socket = &vrc4171_sockets[CARD_SLOTA];
  18702. + if (socket->noprobe == SLOTB_PROBE) {
  18703. + if (status & (1 << socket->csc_irq))
  18704. + pccard_status_change(CARD_SLOTA, socket);
  18705. + }
  18706. + }
  18707. +
  18708. + if (status & IRQ_B) {
  18709. + socket = &vrc4171_sockets[CARD_SLOTB];
  18710. + if (socket->noprobe == SLOTB_PROBE) {
  18711. + if (status & (1 << socket->csc_irq))
  18712. + pccard_status_change(CARD_SLOTB, socket);
  18713. + }
  18714. + }
  18715. +}
  18716. +
  18717. +static inline void reserve_using_irq(int slot)
  18718. +{
  18719. + unsigned int irq;
  18720. +
  18721. + irq = exca_read_byte(slot, I365_INTCTL);
  18722. + irq &= 0x0f;
  18723. + vrc4171_irq_mask &= ~(1 << irq);
  18724. +
  18725. + irq = exca_read_byte(slot, I365_CSCINT);
  18726. + irq = (irq & 0xf0) >> 4;
  18727. + vrc4171_irq_mask &= ~(1 << irq);
  18728. +}
  18729. +
  18730. +static int __devinit vrc4171_add_socket(int slot)
  18731. +{
  18732. + vrc4171_socket_t *socket;
  18733. +
  18734. + if (slot >= CARD_MAX_SLOTS)
  18735. + return -EINVAL;
  18736. +
  18737. + socket = &vrc4171_sockets[slot];
  18738. + if (socket->noprobe != SLOTB_PROBE) {
  18739. + uint8_t addrwin;
  18740. +
  18741. + switch (socket->noprobe) {
  18742. + case SLOTB_NOPROBE_MEM:
  18743. + addrwin = exca_read_byte(slot, I365_ADDRWIN);
  18744. + addrwin &= 0x1f;
  18745. + exca_write_byte(slot, I365_ADDRWIN, addrwin);
  18746. + break;
  18747. + case SLOTB_NOPROBE_IO:
  18748. + addrwin = exca_read_byte(slot, I365_ADDRWIN);
  18749. + addrwin &= 0xc0;
  18750. + exca_write_byte(slot, I365_ADDRWIN, addrwin);
  18751. + break;
  18752. + default:
  18753. + break;
  18754. + }
  18755. +
  18756. + reserve_using_irq(slot);
  18757. +
  18758. + return 0;
  18759. + }
  18760. +
  18761. + sprintf(socket->name, "NEC VRC4171 Card Slot %1c", 'A' + slot);
  18762. +
  18763. + socket->pcmcia_socket = pcmcia_register_socket(slot, &vrc4171_pccard_operations, 1);
  18764. + if (socket->pcmcia_socket == NULL)
  18765. + return -ENOMEM;
  18766. +
  18767. + exca_write_byte(slot, I365_ADDRWIN, 0);
  18768. +
  18769. + exca_write_byte(slot, GLOBAL_CONTROL, 0);
  18770. +
  18771. + return 0;
  18772. +}
  18773. +
  18774. +static void vrc4171_remove_socket(int slot)
  18775. +{
  18776. + vrc4171_socket_t *socket;
  18777. +
  18778. + if (slot >= CARD_MAX_SLOTS)
  18779. + return;
  18780. +
  18781. + socket = &vrc4171_sockets[slot];
  18782. +
  18783. + if (socket->pcmcia_socket != NULL) {
  18784. + pcmcia_unregister_socket(socket->pcmcia_socket);
  18785. + socket->pcmcia_socket = NULL;
  18786. + }
  18787. +}
  18788. +
  18789. +static int __devinit vrc4171_card_setup(char *options)
  18790. +{
  18791. + if (options == NULL || *options == '\0')
  18792. + return 0;
  18793. +
  18794. + if (strncmp(options, "irq:", 4) == 0) {
  18795. + int irq;
  18796. + options += 4;
  18797. + irq = simple_strtoul(options, &options, 0);
  18798. + if (irq >= 0 && irq < NR_IRQS)
  18799. + vrc4171_irq = irq;
  18800. +
  18801. + if (*options != ',')
  18802. + return 0;
  18803. + options++;
  18804. + }
  18805. +
  18806. + if (strncmp(options, "slota:", 6) == 0) {
  18807. + options += 6;
  18808. + if (*options != '\0') {
  18809. + if (strncmp(options, "noprobe", 7) == 0) {
  18810. + vrc4171_sockets[CARD_SLOTA].noprobe = 1;
  18811. + options += 7;
  18812. + }
  18813. +
  18814. + if (*options != ',')
  18815. + return 0;
  18816. + options++;
  18817. + } else
  18818. + return 0;
  18819. +
  18820. + }
  18821. +
  18822. + if (strncmp(options, "slotb:", 6) == 0) {
  18823. + options += 6;
  18824. + if (*options != '\0') {
  18825. + if (strncmp(options, "pccard", 6) == 0) {
  18826. + vrc4171_slotb = SLOTB_IS_PCCARD;
  18827. + options += 6;
  18828. + } else if (strncmp(options, "cf", 2) == 0) {
  18829. + vrc4171_slotb = SLOTB_IS_CF;
  18830. + options += 2;
  18831. + } else if (strncmp(options, "flashrom", 8) == 0) {
  18832. + vrc4171_slotb = SLOTB_IS_FLASHROM;
  18833. + options += 8;
  18834. + } else if (strncmp(options, "none", 4) == 0) {
  18835. + vrc4171_slotb = SLOTB_IS_NONE;
  18836. + options += 4;
  18837. + }
  18838. +
  18839. + if (*options != ',')
  18840. + return 0;
  18841. + options++;
  18842. +
  18843. + if ( strncmp(options, "memnoprobe", 10) == 0)
  18844. + vrc4171_sockets[CARD_SLOTB].noprobe = SLOTB_NOPROBE_MEM;
  18845. + if ( strncmp(options, "ionoprobe", 9) == 0)
  18846. + vrc4171_sockets[CARD_SLOTB].noprobe = SLOTB_NOPROBE_IO;
  18847. + if ( strncmp(options, "noprobe", 7) == 0)
  18848. + vrc4171_sockets[CARD_SLOTB].noprobe = SLOTB_NOPROBE_ALL;
  18849. + }
  18850. + }
  18851. +
  18852. + return 0;
  18853. +}
  18854. +
  18855. +__setup("vrc4171_card=", vrc4171_card_setup);
  18856. +
  18857. +static int __devinit vrc4171_card_init(void)
  18858. +{
  18859. + int retval, slot;
  18860. +
  18861. + vrc4171_set_multifunction_pin(vrc4171_slotb);
  18862. +
  18863. + if (request_region(CARD_CONTROLLER_INDEX, CARD_CONTROLLER_SIZE,
  18864. + "NEC VRC4171 Card Controller") == NULL)
  18865. + return -EBUSY;
  18866. +
  18867. + for (slot = 0; slot < CARD_MAX_SLOTS; slot++) {
  18868. + if (slot == CARD_SLOTB && vrc4171_slotb == SLOTB_IS_NONE)
  18869. + break;
  18870. +
  18871. + retval = vrc4171_add_socket(slot);
  18872. + if (retval != 0)
  18873. + return retval;
  18874. + }
  18875. +
  18876. + retval = request_irq(vrc4171_irq, pccard_interrupt, SA_SHIRQ,
  18877. + "NEC VRC4171 Card Controller", vrc4171_sockets);
  18878. + if (retval < 0) {
  18879. + for (slot = 0; slot < CARD_MAX_SLOTS; slot++)
  18880. + vrc4171_remove_socket(slot);
  18881. +
  18882. + return retval;
  18883. + }
  18884. +
  18885. + printk(KERN_INFO "NEC VRC4171 Card Controller, connected to IRQ %d\n", vrc4171_irq);
  18886. +
  18887. + return 0;
  18888. +}
  18889. +
  18890. +static void __devexit vrc4171_card_exit(void)
  18891. +{
  18892. + int slot;
  18893. +
  18894. + for (slot = 0; slot < CARD_MAX_SLOTS; slot++)
  18895. + vrc4171_remove_socket(slot);
  18896. +
  18897. + release_region(CARD_CONTROLLER_INDEX, CARD_CONTROLLER_SIZE);
  18898. +}
  18899. +
  18900. +module_init(vrc4171_card_init);
  18901. +module_exit(vrc4171_card_exit);
  18902. Index: linux-2.4.35.4/drivers/scsi/NCR53C9x.h
  18903. ===================================================================
  18904. --- linux-2.4.35.4.orig/drivers/scsi/NCR53C9x.h
  18905. +++ linux-2.4.35.4/drivers/scsi/NCR53C9x.h
  18906. @@ -144,12 +144,7 @@
  18907. #ifndef MULTIPLE_PAD_SIZES
  18908. -#ifdef CONFIG_CPU_HAS_WB
  18909. -#include <asm/wbflush.h>
  18910. -#define esp_write(__reg, __val) do{(__reg) = (__val); wbflush();} while(0)
  18911. -#else
  18912. -#define esp_write(__reg, __val) ((__reg) = (__val))
  18913. -#endif
  18914. +#define esp_write(__reg, __val) do{(__reg) = (__val); iob();} while(0)
  18915. #define esp_read(__reg) (__reg)
  18916. struct ESP_regs {
  18917. Index: linux-2.4.35.4/drivers/sound/au1550_i2s.c
  18918. ===================================================================
  18919. --- linux-2.4.35.4.orig/drivers/sound/au1550_i2s.c
  18920. +++ linux-2.4.35.4/drivers/sound/au1550_i2s.c
  18921. @@ -41,6 +41,7 @@
  18922. * 675 Mass Ave, Cambridge, MA 02139, USA.
  18923. *
  18924. */
  18925. +
  18926. #include <linux/version.h>
  18927. #include <linux/module.h>
  18928. #include <linux/string.h>
  18929. @@ -62,7 +63,45 @@
  18930. #include <asm/uaccess.h>
  18931. #include <asm/hardirq.h>
  18932. #include <asm/au1000.h>
  18933. +
  18934. +#if defined(CONFIG_SOC_AU1550)
  18935. #include <asm/pb1550.h>
  18936. +#endif
  18937. +
  18938. +#if defined(CONFIG_MIPS_PB1200)
  18939. +#define WM8731
  18940. +#define WM_MODE_USB
  18941. +#include <asm/pb1200.h>
  18942. +#endif
  18943. +
  18944. +#if defined(CONFIG_MIPS_FICMMP)
  18945. +#define WM8721
  18946. +#define WM_MODE_NORMAL
  18947. +#include <asm/ficmmp.h>
  18948. +#endif
  18949. +
  18950. +
  18951. +#define WM_VOLUME_MIN 47
  18952. +#define WM_VOLUME_SCALE 80
  18953. +
  18954. +#if defined(WM8731)
  18955. + /* OSS interface to the wm i2s.. */
  18956. + #define CODEC_NAME "Wolfson WM8731 I2S"
  18957. + #define WM_I2S_STEREO_MASK (SOUND_MASK_PCM | SOUND_MASK_LINE)
  18958. + #define WM_I2S_SUPPORTED_MASK (WM_I2S_STEREO_MASK | SOUND_MASK_MIC)
  18959. + #define WM_I2S_RECORD_MASK (SOUND_MASK_MIC | SOUND_MASK_LINE1 | SOUND_MASK_LINE)
  18960. +#elif defined(WM8721)
  18961. + #define CODEC_NAME "Wolfson WM8721 I2S"
  18962. + #define WM_I2S_STEREO_MASK (SOUND_MASK_PCM)
  18963. + #define WM_I2S_SUPPORTED_MASK (WM_I2S_STEREO_MASK)
  18964. + #define WM_I2S_RECORD_MASK (0)
  18965. +#endif
  18966. +
  18967. +
  18968. +#define supported_mixer(FOO) ((FOO >= 0) && \
  18969. + (FOO < SOUND_MIXER_NRDEVICES) && \
  18970. + WM_I2S_SUPPORTED_MASK & (1<<FOO) )
  18971. +
  18972. #include <asm/au1xxx_psc.h>
  18973. #include <asm/au1xxx_dbdma.h>
  18974. @@ -98,13 +137,51 @@
  18975. * 0 = no VRA, 1 = use VRA if codec supports it
  18976. * The framework is here, but we currently force no VRA.
  18977. */
  18978. +#if defined(CONFIG_MIPS_PB1200) | defined(CONFIG_MIPS_PB1550)
  18979. static int vra = 0;
  18980. +#elif defined(CONFIG_MIPS_FICMMP)
  18981. +static int vra = 1;
  18982. +#endif
  18983. +
  18984. +#define WM_REG_L_HEADPHONE_OUT 0x02
  18985. +#define WM_REG_R_HEADPHONE_OUT 0x03
  18986. +#define WM_REG_ANALOGUE_AUDIO_PATH_CTRL 0x04
  18987. +#define WM_REG_DIGITAL_AUDIO_PATH_CTRL 0x05
  18988. +#define WM_REG_POWER_DOWN_CTRL 0x06
  18989. +#define WM_REG_DIGITAL_AUDIO_IF 0x07
  18990. +#define WM_REG_SAMPLING_CONTROL 0x08
  18991. +#define WM_REG_ACTIVE_CTRL 0x09
  18992. +#define WM_REG_RESET 0x0F
  18993. +#define WM_SC_SR_96000 (0x7<<2)
  18994. +#define WM_SC_SR_88200 (0xF<<2)
  18995. +#define WM_SC_SR_48000 (0x0<<2)
  18996. +#define WM_SC_SR_44100 (0x8<<2)
  18997. +#define WM_SC_SR_32000 (0x6<<2)
  18998. +#define WM_SC_SR_8018 (0x9<<2)
  18999. +#define WM_SC_SR_8000 (0x1<<2)
  19000. +#define WM_SC_MODE_USB 1
  19001. +#define WM_SC_MODE_NORMAL 0
  19002. +#define WM_SC_BOSR_250FS (0<<1)
  19003. +#define WM_SC_BOSR_272FS (1<<1)
  19004. +#define WM_SC_BOSR_256FS (0<<1)
  19005. +#define WM_SC_BOSR_128FS (0<<1)
  19006. +#define WM_SC_BOSR_384FS (1<<1)
  19007. +#define WM_SC_BOSR_192FS (1<<1)
  19008. +
  19009. +#define WS_64FS 31
  19010. +#define WS_96FS 47
  19011. +#define WS_128FS 63
  19012. +#define WS_192FS 95
  19013. +
  19014. +#define MIN_Q_COUNT 2
  19015. +
  19016. MODULE_PARM(vra, "i");
  19017. MODULE_PARM_DESC(vra, "if 1 use VRA if codec supports it");
  19018. static struct au1550_state {
  19019. /* soundcore stuff */
  19020. int dev_audio;
  19021. + int dev_mixer;
  19022. spinlock_t lock;
  19023. struct semaphore open_sem;
  19024. @@ -114,6 +191,11 @@ static struct au1550_state {
  19025. int no_vra;
  19026. volatile psc_i2s_t *psc_addr;
  19027. + int level_line;
  19028. + int level_mic;
  19029. + int level_left;
  19030. + int level_right;
  19031. +
  19032. struct dmabuf {
  19033. u32 dmanr;
  19034. unsigned sample_rate;
  19035. @@ -195,60 +277,224 @@ au1550_delay(int msec)
  19036. }
  19037. }
  19038. -/* Just a place holder. The Wolfson codec is a write only device,
  19039. - * so we would have to keep a local copy of the data.
  19040. - */
  19041. -#if 0
  19042. -static u8
  19043. -rdcodec(u8 addr)
  19044. -{
  19045. - return 0 /* data */;
  19046. -}
  19047. -#endif
  19048. -
  19049. -
  19050. static void
  19051. -wrcodec(u8 ctlreg, u8 val)
  19052. +wrcodec(u8 ctlreg, u16 val)
  19053. {
  19054. int rcnt;
  19055. extern int pb1550_wm_codec_write(u8 addr, u8 reg, u8 val);
  19056. -
  19057. /* The codec is a write only device, with a 16-bit control/data
  19058. * word. Although it is written as two bytes on the I2C, the
  19059. * format is actually 7 bits of register and 9 bits of data.
  19060. * The ls bit of the first byte is the ms bit of the data.
  19061. */
  19062. rcnt = 0;
  19063. - while ((pb1550_wm_codec_write((0x36 >> 1), ctlreg, val) != 1)
  19064. - && (rcnt < 50)) {
  19065. + while ((pb1550_wm_codec_write((0x36 >> 1),
  19066. + (ctlreg << 1) | ((val >> 8) & 0x01),
  19067. + (u8) (val & 0x00FF)) != 1) &&
  19068. + (rcnt < 50)) {
  19069. rcnt++;
  19070. -#if 0
  19071. - printk("Codec write retry %02x %02x\n", ctlreg, val);
  19072. -#endif
  19073. }
  19074. +
  19075. + au1550_delay(10);
  19076. +}
  19077. +
  19078. +static int
  19079. +au1550_open_mixdev(struct inode *inode, struct file *file)
  19080. +{
  19081. + file->private_data = &au1550_state;
  19082. + return 0;
  19083. +}
  19084. +
  19085. +static int
  19086. +au1550_release_mixdev(struct inode *inode, struct file *file)
  19087. +{
  19088. + return 0;
  19089. +}
  19090. +
  19091. +static int wm_i2s_read_mixer(struct au1550_state *s, int oss_channel)
  19092. +{
  19093. + int ret = 0;
  19094. +
  19095. + if (WM_I2S_STEREO_MASK & (1 << oss_channel)) {
  19096. + /* nice stereo mixers .. */
  19097. +
  19098. + ret = s->level_left | (s->level_right << 8);
  19099. + } else if (oss_channel == SOUND_MIXER_MIC) {
  19100. + ret = 0;
  19101. + /* TODO: Implement read mixer for input/output codecs */
  19102. + }
  19103. +
  19104. + return ret;
  19105. }
  19106. +static void wm_i2s_write_mixer(struct au1550_state *s, int oss_channel, unsigned int left, unsigned int right)
  19107. +{
  19108. + if (WM_I2S_STEREO_MASK & (1 << oss_channel)) {
  19109. + /* stereo mixers */
  19110. + s->level_left = left;
  19111. + s->level_right = right;
  19112. +
  19113. + right = (right * WM_VOLUME_SCALE) / 100;
  19114. + left = (left * WM_VOLUME_SCALE) / 100;
  19115. + if (right > WM_VOLUME_SCALE)
  19116. + right = WM_VOLUME_SCALE;
  19117. + if (left > WM_VOLUME_SCALE)
  19118. + left = WM_VOLUME_SCALE;
  19119. +
  19120. + right += WM_VOLUME_MIN;
  19121. + left += WM_VOLUME_MIN;
  19122. +
  19123. + wrcodec(WM_REG_L_HEADPHONE_OUT, left);
  19124. + wrcodec(WM_REG_R_HEADPHONE_OUT, right);
  19125. +
  19126. + }else if (oss_channel == SOUND_MIXER_MIC) {
  19127. + /* TODO: implement write mixer for input/output codecs */
  19128. + }
  19129. +}
  19130. +
  19131. +/* a thin wrapper for write_mixer */
  19132. +static void wm_i2s_set_mixer(struct au1550_state *s, unsigned int oss_mixer, unsigned int val )
  19133. +{
  19134. + unsigned int left,right;
  19135. +
  19136. + /* cleanse input a little */
  19137. + right = ((val >> 8) & 0xff) ;
  19138. + left = (val & 0xff) ;
  19139. +
  19140. + if (right > 100) right = 100;
  19141. + if (left > 100) left = 100;
  19142. +
  19143. + wm_i2s_write_mixer(s, oss_mixer, left, right);
  19144. +}
  19145. +
  19146. +static int
  19147. +au1550_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
  19148. +{
  19149. + struct au1550_state *s = (struct au1550_state *)file->private_data;
  19150. +
  19151. + int i, val = 0;
  19152. +
  19153. + if (cmd == SOUND_MIXER_INFO) {
  19154. + mixer_info info;
  19155. + strncpy(info.id, CODEC_NAME, sizeof(info.id));
  19156. + strncpy(info.name, CODEC_NAME, sizeof(info.name));
  19157. + info.modify_counter = 0;
  19158. + if (copy_to_user((void *)arg, &info, sizeof(info)))
  19159. + return -EFAULT;
  19160. + return 0;
  19161. + }
  19162. + if (cmd == SOUND_OLD_MIXER_INFO) {
  19163. + _old_mixer_info info;
  19164. + strncpy(info.id, CODEC_NAME, sizeof(info.id));
  19165. + strncpy(info.name, CODEC_NAME, sizeof(info.name));
  19166. + if (copy_to_user((void *)arg, &info, sizeof(info)))
  19167. + return -EFAULT;
  19168. + return 0;
  19169. + }
  19170. +
  19171. + if (_IOC_TYPE(cmd) != 'M' || _SIOC_SIZE(cmd) != sizeof(int))
  19172. + return -EINVAL;
  19173. +
  19174. + if (cmd == OSS_GETVERSION)
  19175. + return put_user(SOUND_VERSION, (int *)arg);
  19176. +
  19177. + if (_SIOC_DIR(cmd) == _SIOC_READ) {
  19178. + switch (_IOC_NR(cmd)) {
  19179. + case SOUND_MIXER_RECSRC: /* give them the current record src */
  19180. + val = 0;
  19181. + /*
  19182. + if (!codec->recmask_io) {
  19183. + val = 0;
  19184. + } else {
  19185. + val = codec->recmask_io(codec, 1, 0);
  19186. + }*/
  19187. + break;
  19188. +
  19189. + case SOUND_MIXER_DEVMASK: /* give them the supported mixers */
  19190. + val = WM_I2S_SUPPORTED_MASK;
  19191. + break;
  19192. +
  19193. + case SOUND_MIXER_RECMASK:
  19194. + /* Arg contains a bit for each supported recording
  19195. + * source */
  19196. + val = WM_I2S_RECORD_MASK;
  19197. + break;
  19198. +
  19199. + case SOUND_MIXER_STEREODEVS:
  19200. + /* Mixer channels supporting stereo */
  19201. + val = WM_I2S_STEREO_MASK;
  19202. + break;
  19203. +
  19204. + case SOUND_MIXER_CAPS:
  19205. + val = SOUND_CAP_EXCL_INPUT;
  19206. + break;
  19207. +
  19208. + default: /* read a specific mixer */
  19209. + i = _IOC_NR(cmd);
  19210. +
  19211. + if (!supported_mixer(i))
  19212. + return -EINVAL;
  19213. +
  19214. + val = wm_i2s_read_mixer(s, i);
  19215. + break;
  19216. + }
  19217. + return put_user(val, (int *)arg);
  19218. + }
  19219. +
  19220. + if (_SIOC_DIR(cmd) == (_SIOC_WRITE|_SIOC_READ)) {
  19221. + if (get_user(val, (int *)arg))
  19222. + return -EFAULT;
  19223. +
  19224. + switch (_IOC_NR(cmd)) {
  19225. + case SOUND_MIXER_RECSRC:
  19226. + /* Arg contains a bit for each recording source */
  19227. + if (!WM_I2S_RECORD_MASK)
  19228. + return -EINVAL;
  19229. + if (!val)
  19230. + return 0;
  19231. + if (!(val &= WM_I2S_RECORD_MASK))
  19232. + return -EINVAL;
  19233. +
  19234. + return 0;
  19235. + default: /* write a specific mixer */
  19236. + i = _IOC_NR(cmd);
  19237. +
  19238. + if (!supported_mixer(i))
  19239. + return -EINVAL;
  19240. +
  19241. + wm_i2s_set_mixer(s, i, val);
  19242. +
  19243. + return 0;
  19244. + }
  19245. +}
  19246. + return -EINVAL;
  19247. +}
  19248. +
  19249. +static loff_t
  19250. +au1550_llseek(struct file *file, loff_t offset, int origin)
  19251. +{
  19252. + return -ESPIPE;
  19253. +}
  19254. +
  19255. +static /*const */ struct file_operations au1550_mixer_fops = {
  19256. + owner:THIS_MODULE,
  19257. + llseek:au1550_llseek,
  19258. + ioctl:au1550_ioctl_mixdev,
  19259. + open:au1550_open_mixdev,
  19260. + release:au1550_release_mixdev,
  19261. +};
  19262. +
  19263. void
  19264. -codec_init(void)
  19265. +codec_init(struct au1550_state *s)
  19266. {
  19267. - wrcodec(0x1e, 0x00); /* Reset */
  19268. - au1550_delay(200);
  19269. - wrcodec(0x0c, 0x00); /* Power up everything */
  19270. - au1550_delay(10);
  19271. - wrcodec(0x12, 0x00); /* Deactivate codec */
  19272. - au1550_delay(10);
  19273. - wrcodec(0x08, 0x10); /* Select DAC outputs to line out */
  19274. - au1550_delay(10);
  19275. - wrcodec(0x0a, 0x00); /* Disable output mute */
  19276. - au1550_delay(10);
  19277. - wrcodec(0x05, 0x70); /* lower output volume on headphone */
  19278. - au1550_delay(10);
  19279. - wrcodec(0x0e, 0x02); /* Set slave, 16-bit, I2S modes */
  19280. - au1550_delay(10);
  19281. - wrcodec(0x10, 0x01); /* 12MHz (USB), 250fs */
  19282. - au1550_delay(10);
  19283. - wrcodec(0x12, 0x01); /* Activate codec */
  19284. - au1550_delay(10);
  19285. + wrcodec(WM_REG_RESET, 0x00); /* Reset */
  19286. + wrcodec(WM_REG_POWER_DOWN_CTRL, 0x00); /* Power up everything */
  19287. + wrcodec(WM_REG_ACTIVE_CTRL, 0x00); /* Deactivate codec */
  19288. + wrcodec(WM_REG_ANALOGUE_AUDIO_PATH_CTRL, 0x10); /* Select DAC outputs to line out */
  19289. + wrcodec(WM_REG_DIGITAL_AUDIO_PATH_CTRL, 0x00); /* Disable output mute */
  19290. + wm_i2s_write_mixer(s, SOUND_MIXER_PCM, 74, 74);
  19291. + wrcodec(WM_REG_DIGITAL_AUDIO_IF, 0x02); /* Set slave, 16-bit, I2S modes */
  19292. + wrcodec(WM_REG_ACTIVE_CTRL, 0x01); /* Activate codec */
  19293. }
  19294. /* stop the ADC before calling */
  19295. @@ -256,27 +502,16 @@ static void
  19296. set_adc_rate(struct au1550_state *s, unsigned rate)
  19297. {
  19298. struct dmabuf *adc = &s->dma_adc;
  19299. - struct dmabuf *dac = &s->dma_dac;
  19300. - if (s->no_vra) {
  19301. - /* calc SRC factor
  19302. - */
  19303. + #if defined(WM_MODE_USB)
  19304. adc->src_factor = (((SAMP_RATE*2) / rate) + 1) >> 1;
  19305. adc->sample_rate = SAMP_RATE / adc->src_factor;
  19306. return;
  19307. - }
  19308. + #else
  19309. + //TODO: Need code for normal mode
  19310. + #endif
  19311. adc->src_factor = 1;
  19312. -
  19313. -
  19314. -#if 0
  19315. - rate = rate > SAMP_RATE ? SAMP_RATE : rate;
  19316. -
  19317. - wrcodec(0, 0); /* I don't yet know what to write here if we vra */
  19318. -
  19319. - adc->sample_rate = rate;
  19320. - dac->sample_rate = rate;
  19321. -#endif
  19322. }
  19323. /* stop the DAC before calling */
  19324. @@ -284,26 +519,89 @@ static void
  19325. set_dac_rate(struct au1550_state *s, unsigned rate)
  19326. {
  19327. struct dmabuf *dac = &s->dma_dac;
  19328. - struct dmabuf *adc = &s->dma_adc;
  19329. - if (s->no_vra) {
  19330. - /* calc SRC factor
  19331. - */
  19332. - dac->src_factor = (((SAMP_RATE*2) / rate) + 1) >> 1;
  19333. - dac->sample_rate = SAMP_RATE / dac->src_factor;
  19334. - return;
  19335. + u16 sr, ws, div, bosr, mode;
  19336. + volatile psc_i2s_t* ip = (volatile psc_i2s_t *)I2S_PSC_BASE;
  19337. + u32 cfg;
  19338. +
  19339. + #if defined(CONFIG_MIPS_FICMMP)
  19340. + rate = ficmmp_set_i2s_sample_rate(rate);
  19341. + #endif
  19342. +
  19343. + switch(rate)
  19344. + {
  19345. + case 96000:
  19346. + sr = WM_SC_SR_96000;
  19347. + ws = WS_64FS;
  19348. + div = PSC_I2SCFG_DIV2;
  19349. + break;
  19350. + case 88200:
  19351. + sr = WM_SC_SR_88200;
  19352. + ws = WS_64FS;
  19353. + div = PSC_I2SCFG_DIV2;
  19354. + break;
  19355. + case 44100:
  19356. + sr = WM_SC_SR_44100;
  19357. + ws = WS_128FS;
  19358. + div = PSC_I2SCFG_DIV2;
  19359. + break;
  19360. + case 48000:
  19361. + sr = WM_SC_SR_48000;
  19362. + ws = WS_128FS;
  19363. + div = PSC_I2SCFG_DIV2;
  19364. + break;
  19365. + case 32000:
  19366. + sr = WM_SC_SR_32000;
  19367. + ws = WS_96FS;
  19368. + div = PSC_I2SCFG_DIV4;
  19369. + break;
  19370. + case 8018:
  19371. + sr = WM_SC_SR_8018;
  19372. + ws = WS_128FS;
  19373. + div = PSC_I2SCFG_DIV2;
  19374. + break;
  19375. + case 8000:
  19376. + default:
  19377. + sr = WM_SC_SR_8000;
  19378. + ws = WS_96FS;
  19379. + div = PSC_I2SCFG_DIV16;
  19380. + break;
  19381. }
  19382. + #if defined(WM_MODE_USB)
  19383. + mode = WM_SC_MODE_USB;
  19384. + #else
  19385. + mode = WM_SC_MODE_NORMAL;
  19386. + #endif
  19387. +
  19388. + bosr = 0;
  19389. +
  19390. dac->src_factor = 1;
  19391. + dac->sample_rate = rate;
  19392. -#if 0
  19393. - rate = rate > SAMP_RATE ? SAMP_RATE : rate;
  19394. + /* Deactivate codec */
  19395. + wrcodec(WM_REG_ACTIVE_CTRL, 0x00);
  19396. - wrcodec(0, 0); /* I don't yet know what to write here if we vra */
  19397. + /* Disable I2S controller */
  19398. + ip->psc_i2scfg &= ~PSC_I2SCFG_DE_ENABLE;
  19399. + /* Wait for device disabled */
  19400. + while ((ip->psc_i2sstat & PSC_I2SSTAT_DR) == 1);
  19401. +
  19402. + cfg = ip->psc_i2scfg;
  19403. + /* Clear WS and DIVIDER values */
  19404. + cfg &= ~(PSC_I2SCFG_WS_MASK | PSC_I2SCFG_DIV_MASK);
  19405. + cfg |= PSC_I2SCFG_WS(ws) | div;
  19406. + /* Reconfigure and enable */
  19407. + ip->psc_i2scfg = cfg | PSC_I2SCFG_DE_ENABLE;
  19408. - adc->sample_rate = rate;
  19409. - dac->sample_rate = rate;
  19410. -#endif
  19411. + /* Wait for device enabled */
  19412. + while ((ip->psc_i2sstat & PSC_I2SSTAT_DR) == 0);
  19413. +
  19414. + /* Set appropriate sampling rate */
  19415. + wrcodec(WM_REG_SAMPLING_CONTROL, bosr | mode | sr);
  19416. +
  19417. + /* Activate codec */
  19418. + wrcodec(WM_REG_ACTIVE_CTRL, 0x01);
  19419. }
  19420. static void
  19421. @@ -354,8 +652,7 @@ stop_adc(struct au1550_state *s)
  19422. ip->psc_i2spcr = PSC_I2SPCR_RP;
  19423. au_sync();
  19424. - /* Wait for Receive Busy to show disabled.
  19425. - */
  19426. + /* Wait for Receive Busy to show disabled. */
  19427. do {
  19428. stat = ip->psc_i2sstat;
  19429. au_sync();
  19430. @@ -463,7 +760,6 @@ prog_dmabuf(struct au1550_state *s, stru
  19431. if (db->num_channels == 1)
  19432. db->cnt_factor *= 2;
  19433. db->cnt_factor *= db->src_factor;
  19434. -
  19435. db->count = 0;
  19436. db->dma_qcount = 0;
  19437. db->nextIn = db->nextOut = db->rawbuf;
  19438. @@ -546,12 +842,13 @@ dac_dma_interrupt(int irq, void *dev_id,
  19439. if (i2s_stat & (PSC_I2SSTAT_TF | PSC_I2SSTAT_TR | PSC_I2SSTAT_TF))
  19440. dbg("I2S status = 0x%08x", i2s_stat);
  19441. #endif
  19442. +
  19443. db->dma_qcount--;
  19444. if (db->count >= db->fragsize) {
  19445. - if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut,
  19446. - db->fragsize) == 0) {
  19447. - err("qcount < 2 and no ring room!");
  19448. + if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut, db->fragsize) == 0)
  19449. + {
  19450. + err("qcount < MIN_Q_COUNT and no ring room!");
  19451. }
  19452. db->nextOut += db->fragsize;
  19453. if (db->nextOut >= db->rawbuf + db->dmasize)
  19454. @@ -606,65 +903,43 @@ adc_dma_interrupt(int irq, void *dev_id,
  19455. }
  19456. -static loff_t
  19457. -au1550_llseek(struct file *file, loff_t offset, int origin)
  19458. -{
  19459. - return -ESPIPE;
  19460. -}
  19461. -
  19462. -
  19463. -#if 0
  19464. -static int
  19465. -au1550_open_mixdev(struct inode *inode, struct file *file)
  19466. -{
  19467. - file->private_data = &au1550_state;
  19468. - return 0;
  19469. -}
  19470. -
  19471. -static int
  19472. -au1550_release_mixdev(struct inode *inode, struct file *file)
  19473. -{
  19474. - return 0;
  19475. -}
  19476. -
  19477. -static int
  19478. -mixdev_ioctl(struct ac97_codec *codec, unsigned int cmd,
  19479. - unsigned long arg)
  19480. -{
  19481. - return codec->mixer_ioctl(codec, cmd, arg);
  19482. -}
  19483. -
  19484. -static int
  19485. -au1550_ioctl_mixdev(struct inode *inode, struct file *file,
  19486. - unsigned int cmd, unsigned long arg)
  19487. -{
  19488. - struct au1550_state *s = (struct au1550_state *)file->private_data;
  19489. - struct ac97_codec *codec = s->codec;
  19490. -
  19491. - return mixdev_ioctl(codec, cmd, arg);
  19492. -}
  19493. -
  19494. -static /*const */ struct file_operations au1550_mixer_fops = {
  19495. - owner:THIS_MODULE,
  19496. - llseek:au1550_llseek,
  19497. - ioctl:au1550_ioctl_mixdev,
  19498. - open:au1550_open_mixdev,
  19499. - release:au1550_release_mixdev,
  19500. -};
  19501. -#endif
  19502. -
  19503. static int
  19504. drain_dac(struct au1550_state *s, int nonblock)
  19505. {
  19506. unsigned long flags;
  19507. int count, tmo;
  19508. + struct dmabuf *db = &s->dma_dac;
  19509. +
  19510. + //DPRINTF();
  19511. if (s->dma_dac.mapped || !s->dma_dac.ready || s->dma_dac.stopped)
  19512. return 0;
  19513. for (;;) {
  19514. spin_lock_irqsave(&s->lock, flags);
  19515. - count = s->dma_dac.count;
  19516. + count = db->count;
  19517. +
  19518. + /* Pad the ddma buffer with zeros if the amount remaining
  19519. + * is not a multiple of fragsize */
  19520. + if(count % db->fragsize != 0)
  19521. + {
  19522. + int pad = db->fragsize - (count % db->fragsize);
  19523. + char* bufptr = db->nextIn;
  19524. + char* bufend = db->rawbuf + db->dmasize;
  19525. +
  19526. + if((bufend - bufptr) < pad)
  19527. + printk("Error! ddma padding is bigger than available ring space!\n");
  19528. + else
  19529. + {
  19530. + memset((void*)bufptr, 0, pad);
  19531. + count += pad;
  19532. + db->nextIn += pad;
  19533. + db->count += pad;
  19534. + if (db->dma_qcount == 0)
  19535. + start_dac(s);
  19536. + db->dma_qcount++;
  19537. + }
  19538. + }
  19539. spin_unlock_irqrestore(&s->lock, flags);
  19540. if (count <= 0)
  19541. break;
  19542. @@ -672,9 +947,9 @@ drain_dac(struct au1550_state *s, int no
  19543. break;
  19544. if (nonblock)
  19545. return -EBUSY;
  19546. - tmo = 1000 * count / (s->no_vra ?
  19547. - SAMP_RATE : s->dma_dac.sample_rate);
  19548. + tmo = 1000 * count / s->dma_dac.sample_rate;
  19549. tmo /= s->dma_dac.dma_bytes_per_sample;
  19550. +
  19551. au1550_delay(tmo);
  19552. }
  19553. if (signal_pending(current))
  19554. @@ -698,8 +973,7 @@ static inline s16 U8_TO_S16(u8 ch)
  19555. * If interpolating (no VRA), duplicate every audio frame src_factor times.
  19556. */
  19557. static int
  19558. -translate_from_user(struct dmabuf *db, char* dmabuf, char* userbuf,
  19559. - int dmacount)
  19560. +translate_from_user(struct dmabuf *db, char* dmabuf, char* userbuf, int dmacount)
  19561. {
  19562. int sample, i;
  19563. int interp_bytes_per_sample;
  19564. @@ -737,11 +1011,12 @@ translate_from_user(struct dmabuf *db, c
  19565. /* duplicate every audio frame src_factor times
  19566. */
  19567. - for (i = 0; i < db->src_factor; i++)
  19568. + for (i = 0; i < db->src_factor; i++) {
  19569. memcpy(dmabuf, dmasample, db->dma_bytes_per_sample);
  19570. + dmabuf += interp_bytes_per_sample;
  19571. + }
  19572. userbuf += db->user_bytes_per_sample;
  19573. - dmabuf += interp_bytes_per_sample;
  19574. }
  19575. return num_samples * interp_bytes_per_sample;
  19576. @@ -996,15 +1271,14 @@ au1550_write(struct file *file, const ch
  19577. * on the dma queue. If the queue count reaches zero,
  19578. * we know the dma has stopped.
  19579. */
  19580. - while ((db->dma_qcount < 2) && (db->count >= db->fragsize)) {
  19581. + while ((db->dma_qcount < MIN_Q_COUNT) && (db->count >= db->fragsize)) {
  19582. if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut,
  19583. db->fragsize) == 0) {
  19584. - err("qcount < 2 and no ring room!");
  19585. + err("qcount < MIN_Q_COUNT and no ring room!");
  19586. }
  19587. db->nextOut += db->fragsize;
  19588. if (db->nextOut >= db->rawbuf + db->dmasize)
  19589. db->nextOut -= db->dmasize;
  19590. - db->count -= db->fragsize;
  19591. db->total_bytes += db->dma_fragsize;
  19592. if (db->dma_qcount == 0)
  19593. start_dac(s);
  19594. @@ -1017,7 +1291,6 @@ au1550_write(struct file *file, const ch
  19595. buffer += usercnt;
  19596. ret += usercnt;
  19597. } /* while (count > 0) */
  19598. -
  19599. out:
  19600. up(&s->sem);
  19601. out2:
  19602. @@ -1371,9 +1644,6 @@ au1550_ioctl(struct inode *inode, struct
  19603. s->dma_dac.cnt_factor;
  19604. abinfo.fragstotal = s->dma_dac.numfrag;
  19605. abinfo.fragments = abinfo.bytes >> s->dma_dac.fragshift;
  19606. -#ifdef AU1000_VERBOSE_DEBUG
  19607. - dbg("bytes=%d, fragments=%d", abinfo.bytes, abinfo.fragments);
  19608. -#endif
  19609. return copy_to_user((void *) arg, &abinfo,
  19610. sizeof(abinfo)) ? -EFAULT : 0;
  19611. @@ -1536,13 +1806,9 @@ au1550_ioctl(struct inode *inode, struct
  19612. case SNDCTL_DSP_SETSYNCRO:
  19613. case SOUND_PCM_READ_FILTER:
  19614. return -EINVAL;
  19615. + default: break;
  19616. }
  19617. -
  19618. -#if 0
  19619. - return mixdev_ioctl(s->codec, cmd, arg);
  19620. -#else
  19621. return 0;
  19622. -#endif
  19623. }
  19624. @@ -1664,15 +1930,15 @@ static /*const */ struct file_operations
  19625. MODULE_AUTHOR("Advanced Micro Devices (AMD), [email protected]");
  19626. MODULE_DESCRIPTION("Au1550 Audio Driver");
  19627. +#if defined(WM_MODE_USB)
  19628. /* Set up an internal clock for the PSC3. This will then get
  19629. * driven out of the Au1550 as the master.
  19630. */
  19631. static void
  19632. intclk_setup(void)
  19633. {
  19634. - uint clk, rate, stat;
  19635. -
  19636. - /* Wire up Freq4 as a clock for the PSC3.
  19637. + uint clk, rate;
  19638. + /* Wire up Freq4 as a clock for the PSC.
  19639. * We know SMBus uses Freq3.
  19640. * By making changes to this rate, plus the word strobe
  19641. * size, we can make fine adjustments to the actual data rate.
  19642. @@ -1700,11 +1966,17 @@ intclk_setup(void)
  19643. */
  19644. clk = au_readl(SYS_CLKSRC);
  19645. au_sync();
  19646. +#if defined(CONFIG_SOC_AU1550)
  19647. clk &= ~0x01f00000;
  19648. clk |= (6 << 22);
  19649. +#elif defined(CONFIG_SOC_AU1200)
  19650. + clk &= ~0x3e000000;
  19651. + clk |= (6 << 27);
  19652. +#endif
  19653. au_writel(clk, SYS_CLKSRC);
  19654. au_sync();
  19655. }
  19656. +#endif
  19657. static int __devinit
  19658. au1550_probe(void)
  19659. @@ -1724,6 +1996,11 @@ au1550_probe(void)
  19660. init_MUTEX(&s->open_sem);
  19661. spin_lock_init(&s->lock);
  19662. + /* CPLD Mux for I2s */
  19663. +
  19664. +#if defined(CONFIG_MIPS_PB1200)
  19665. + bcsr->resets |= BCSR_RESETS_PCS1MUX;
  19666. +#endif
  19667. s->psc_addr = (volatile psc_i2s_t *)I2S_PSC_BASE;
  19668. ip = s->psc_addr;
  19669. @@ -1765,9 +2042,8 @@ au1550_probe(void)
  19670. if ((s->dev_audio = register_sound_dsp(&au1550_audio_fops, -1)) < 0)
  19671. goto err_dev1;
  19672. -#if 0
  19673. - if ((s->codec->dev_mixer =
  19674. - register_sound_mixer(&au1550_mixer_fops, -1)) < 0)
  19675. +#if 1
  19676. + if ((s->dev_mixer = register_sound_mixer(&au1550_mixer_fops, -1)) < 0)
  19677. goto err_dev2;
  19678. #endif
  19679. @@ -1777,7 +2053,6 @@ au1550_probe(void)
  19680. proc_au1550_dump, NULL);
  19681. #endif /* AU1550_DEBUG */
  19682. - intclk_setup();
  19683. /* The GPIO for the appropriate PSC was configured by the
  19684. * board specific start up.
  19685. @@ -1786,7 +2061,12 @@ au1550_probe(void)
  19686. */
  19687. ip->psc_ctrl = PSC_CTRL_DISABLE; /* Disable PSC */
  19688. au_sync();
  19689. +#if defined(WM_MODE_USB)
  19690. + intclk_setup();
  19691. ip->psc_sel = (PSC_SEL_CLK_INTCLK | PSC_SEL_PS_I2SMODE);
  19692. +#else
  19693. + ip->psc_sel = (PSC_SEL_CLK_EXTCLK | PSC_SEL_PS_I2SMODE);
  19694. +#endif
  19695. au_sync();
  19696. /* Enable PSC
  19697. @@ -1806,42 +2086,18 @@ au1550_probe(void)
  19698. * Actual I2S mode (first bit delayed by one clock).
  19699. * Master mode (We provide the clock from the PSC).
  19700. */
  19701. - val = PSC_I2SCFG_SET_LEN(16);
  19702. -#ifdef TRY_441KHz
  19703. - /* This really should be 250, but it appears that all of the
  19704. - * PLLs, dividers and so on in the chain shift it. That's the
  19705. - * problem with sourceing the clock instead of letting the very
  19706. - * stable codec provide it. But, the PSC doesn't appear to want
  19707. - * to work in slave mode, so this is what we get. It's not
  19708. - * studio quality timing, but it's good enough for listening
  19709. - * to mp3s.
  19710. - */
  19711. - val |= PSC_I2SCFG_SET_WS(252);
  19712. -#else
  19713. - val |= PSC_I2SCFG_SET_WS(250);
  19714. -#endif
  19715. - val |= PSC_I2SCFG_RT_FIFO8 | PSC_I2SCFG_TT_FIFO8 | \
  19716. +
  19717. + val = PSC_I2SCFG_SET_LEN(16) | PSC_I2SCFG_WS(WS_128FS) | PSC_I2SCFG_RT_FIFO8 | PSC_I2SCFG_TT_FIFO8 | \
  19718. PSC_I2SCFG_BI | PSC_I2SCFG_XM;
  19719. - ip->psc_i2scfg = val;
  19720. - au_sync();
  19721. - val |= PSC_I2SCFG_DE_ENABLE;
  19722. - ip->psc_i2scfg = val;
  19723. - au_sync();
  19724. + ip->psc_i2scfg = val | PSC_I2SCFG_DE_ENABLE;
  19725. - /* Wait for Device ready.
  19726. - */
  19727. - do {
  19728. - val = ip->psc_i2sstat;
  19729. - au_sync();
  19730. - } while ((val & PSC_I2SSTAT_DR) == 0);
  19731. + set_dac_rate(s, 8000); //Set default rate
  19732. - val = ip->psc_i2scfg;
  19733. - au_sync();
  19734. + codec_init(s);
  19735. - codec_init();
  19736. + s->no_vra = vra ? 0 : 1;
  19737. - s->no_vra = 1;
  19738. if (s->no_vra)
  19739. info("no VRA, interpolating and decimating");
  19740. @@ -1866,6 +2122,8 @@ au1550_probe(void)
  19741. err_dev2:
  19742. unregister_sound_dsp(s->dev_audio);
  19743. #endif
  19744. + err_dev2:
  19745. + unregister_sound_dsp(s->dev_audio);
  19746. err_dev1:
  19747. au1xxx_dbdma_chan_free(s->dma_adc.dmanr);
  19748. err_dma2:
  19749. Index: linux-2.4.35.4/drivers/sound/au1550_psc.c
  19750. ===================================================================
  19751. --- linux-2.4.35.4.orig/drivers/sound/au1550_psc.c
  19752. +++ linux-2.4.35.4/drivers/sound/au1550_psc.c
  19753. @@ -30,6 +30,7 @@
  19754. * 675 Mass Ave, Cambridge, MA 02139, USA.
  19755. *
  19756. */
  19757. +
  19758. #include <linux/version.h>
  19759. #include <linux/module.h>
  19760. #include <linux/string.h>
  19761. @@ -63,6 +64,14 @@
  19762. #include <asm/db1x00.h>
  19763. #endif
  19764. +#ifdef CONFIG_MIPS_PB1200
  19765. +#include <asm/pb1200.h>
  19766. +#endif
  19767. +
  19768. +#ifdef CONFIG_MIPS_DB1200
  19769. +#include <asm/db1200.h>
  19770. +#endif
  19771. +
  19772. #undef OSS_DOCUMENTED_MIXER_SEMANTICS
  19773. #define AU1550_MODULE_NAME "Au1550 psc audio"
  19774. @@ -521,7 +530,14 @@ stop_adc(struct au1550_state *s)
  19775. spin_unlock_irqrestore(&s->lock, flags);
  19776. }
  19777. -
  19778. +/*
  19779. + NOTE: The xmit slots cannot be changed on the fly when in full-duplex
  19780. + because the AC'97 block must be stopped/started. When using this driver
  19781. + in full-duplex (in & out at the same time), the DMA engine will stop if
  19782. + you disable the block.
  19783. + TODO: change implementation to properly restart adc/dac after setting
  19784. + xmit slots.
  19785. +*/
  19786. static void
  19787. set_xmit_slots(int num_channels)
  19788. {
  19789. @@ -565,6 +581,14 @@ set_xmit_slots(int num_channels)
  19790. } while ((stat & PSC_AC97STAT_DR) == 0);
  19791. }
  19792. +/*
  19793. + NOTE: The recv slots cannot be changed on the fly when in full-duplex
  19794. + because the AC'97 block must be stopped/started. When using this driver
  19795. + in full-duplex (in & out at the same time), the DMA engine will stop if
  19796. + you disable the block.
  19797. + TODO: change implementation to properly restart adc/dac after setting
  19798. + recv slots.
  19799. +*/
  19800. static void
  19801. set_recv_slots(int num_channels)
  19802. {
  19803. @@ -608,7 +632,6 @@ start_dac(struct au1550_state *s)
  19804. spin_lock_irqsave(&s->lock, flags);
  19805. - set_xmit_slots(db->num_channels);
  19806. au_writel(PSC_AC97PCR_TC, PSC_AC97PCR);
  19807. au_sync();
  19808. au_writel(PSC_AC97PCR_TS, PSC_AC97PCR);
  19809. @@ -640,7 +663,6 @@ start_adc(struct au1550_state *s)
  19810. db->nextIn -= db->dmasize;
  19811. }
  19812. - set_recv_slots(db->num_channels);
  19813. au1xxx_dbdma_start(db->dmanr);
  19814. au_writel(PSC_AC97PCR_RC, PSC_AC97PCR);
  19815. au_sync();
  19816. @@ -752,12 +774,16 @@ dac_dma_interrupt(int irq, void *dev_id,
  19817. if (ac97c_stat & (AC97C_XU | AC97C_XO | AC97C_TE))
  19818. dbg("AC97C status = 0x%08x", ac97c_stat);
  19819. #endif
  19820. + /* There is a possiblity that we are getting 1 interrupt for
  19821. + multiple descriptors. Use ddma api to find out how many
  19822. + completed.
  19823. + */
  19824. db->dma_qcount--;
  19825. if (db->count >= db->fragsize) {
  19826. if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut,
  19827. db->fragsize) == 0) {
  19828. - err("qcount < 2 and no ring room!");
  19829. + err("qcount < 2 and no ring room1!");
  19830. }
  19831. db->nextOut += db->fragsize;
  19832. if (db->nextOut >= db->rawbuf + db->dmasize)
  19833. @@ -941,11 +967,12 @@ translate_from_user(struct dmabuf *db, c
  19834. /* duplicate every audio frame src_factor times
  19835. */
  19836. - for (i = 0; i < db->src_factor; i++)
  19837. + for (i = 0; i < db->src_factor; i++) {
  19838. memcpy(dmabuf, dmasample, db->dma_bytes_per_sample);
  19839. + dmabuf += interp_bytes_per_sample;
  19840. + }
  19841. userbuf += db->user_bytes_per_sample;
  19842. - dmabuf += interp_bytes_per_sample;
  19843. }
  19844. return num_samples * interp_bytes_per_sample;
  19845. @@ -1203,7 +1230,7 @@ au1550_write(struct file *file, const ch
  19846. while ((db->dma_qcount < 2) && (db->count >= db->fragsize)) {
  19847. if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut,
  19848. db->fragsize) == 0) {
  19849. - err("qcount < 2 and no ring room!");
  19850. + err("qcount < 2 and no ring room!0");
  19851. }
  19852. db->nextOut += db->fragsize;
  19853. if (db->nextOut >= db->rawbuf + db->dmasize)
  19854. @@ -1481,6 +1508,7 @@ au1550_ioctl(struct inode *inode, struct
  19855. return -EINVAL;
  19856. stop_adc(s);
  19857. s->dma_adc.num_channels = val;
  19858. + set_recv_slots(val);
  19859. if ((ret = prog_dmabuf_adc(s)))
  19860. return ret;
  19861. }
  19862. @@ -1538,6 +1566,7 @@ au1550_ioctl(struct inode *inode, struct
  19863. }
  19864. s->dma_dac.num_channels = val;
  19865. + set_xmit_slots(val);
  19866. if ((ret = prog_dmabuf_dac(s)))
  19867. return ret;
  19868. }
  19869. @@ -1832,10 +1861,8 @@ au1550_open(struct inode *inode, struct
  19870. down(&s->open_sem);
  19871. }
  19872. - stop_dac(s);
  19873. - stop_adc(s);
  19874. -
  19875. if (file->f_mode & FMODE_READ) {
  19876. + stop_adc(s);
  19877. s->dma_adc.ossfragshift = s->dma_adc.ossmaxfrags =
  19878. s->dma_adc.subdivision = s->dma_adc.total_bytes = 0;
  19879. s->dma_adc.num_channels = 1;
  19880. @@ -1846,6 +1873,7 @@ au1550_open(struct inode *inode, struct
  19881. }
  19882. if (file->f_mode & FMODE_WRITE) {
  19883. + stop_dac(s);
  19884. s->dma_dac.ossfragshift = s->dma_dac.ossmaxfrags =
  19885. s->dma_dac.subdivision = s->dma_dac.total_bytes = 0;
  19886. s->dma_dac.num_channels = 1;
  19887. @@ -2091,6 +2119,9 @@ au1550_probe(void)
  19888. ac97_read_proc, &s->codec);
  19889. #endif
  19890. + set_xmit_slots(1);
  19891. + set_recv_slots(1);
  19892. +
  19893. return 0;
  19894. err_dev3:
  19895. Index: linux-2.4.35.4/drivers/sound/Config.in
  19896. ===================================================================
  19897. --- linux-2.4.35.4.orig/drivers/sound/Config.in
  19898. +++ linux-2.4.35.4/drivers/sound/Config.in
  19899. @@ -72,10 +72,15 @@ fi
  19900. if [ "$CONFIG_DDB5477" = "y" ]; then
  19901. dep_tristate ' NEC Vrc5477 AC97 sound' CONFIG_SOUND_VRC5477 $CONFIG_SOUND
  19902. fi
  19903. -if [ "$CONFIG_SOC_AU1X00" = "y" -o "$CONFIG_SOC_AU1500" = "y" ]; then
  19904. - dep_tristate ' Au1x00 Sound' CONFIG_SOUND_AU1X00 $CONFIG_SOUND
  19905. - dep_tristate ' Au1550 PSC Sound' CONFIG_SOUND_AU1550_PSC $CONFIG_SOUND
  19906. - dep_tristate ' Au1550 I2S Sound' CONFIG_SOUND_AU1550_I2S $CONFIG_SOUND
  19907. +if [ "$CONFIG_SOC_AU1000" = "y" -o \
  19908. + "$CONFIG_SOC_AU1500" = "y" -o \
  19909. + "$CONFIG_SOC_AU1100" = "y" ]; then
  19910. + dep_tristate ' Au1x00 AC97 Sound' CONFIG_SOUND_AU1X00 $CONFIG_SOUND
  19911. +fi
  19912. +if [ "$CONFIG_SOC_AU1550" = "y" -o \
  19913. + "$CONFIG_SOC_AU1200" = "y" ]; then
  19914. + dep_tristate ' Au1550/Au1200 PSC AC97 Sound' CONFIG_SOUND_AU1550_PSC $CONFIG_SOUND
  19915. + dep_tristate ' Au1550/Au1200 PSC I2S Sound' CONFIG_SOUND_AU1550_I2S $CONFIG_SOUND
  19916. fi
  19917. dep_tristate ' Trident 4DWave DX/NX, SiS 7018 or ALi 5451 PCI Audio Core' CONFIG_SOUND_TRIDENT $CONFIG_SOUND $CONFIG_PCI
  19918. Index: linux-2.4.35.4/drivers/tc/lk201.c
  19919. ===================================================================
  19920. --- linux-2.4.35.4.orig/drivers/tc/lk201.c
  19921. +++ linux-2.4.35.4/drivers/tc/lk201.c
  19922. @@ -5,7 +5,7 @@
  19923. * for more details.
  19924. *
  19925. * Copyright (C) 1999-2002 Harald Koerfgen <[email protected]>
  19926. - * Copyright (C) 2001, 2002, 2003 Maciej W. Rozycki <[email protected]>
  19927. + * Copyright (C) 2001, 2002, 2003, 2004 Maciej W. Rozycki
  19928. */
  19929. #include <linux/config.h>
  19930. @@ -23,8 +23,8 @@
  19931. #include <asm/keyboard.h>
  19932. #include <asm/dec/tc.h>
  19933. #include <asm/dec/machtype.h>
  19934. +#include <asm/dec/serial.h>
  19935. -#include "zs.h"
  19936. #include "lk201.h"
  19937. /*
  19938. @@ -55,19 +55,20 @@ unsigned char *kbd_sysrq_xlate = lk201_s
  19939. unsigned char kbd_sysrq_key = -1;
  19940. #endif
  19941. -#define KEYB_LINE 3
  19942. +#define KEYB_LINE_ZS 3
  19943. +#define KEYB_LINE_DZ 0
  19944. -static int __init lk201_init(struct dec_serial *);
  19945. -static void __init lk201_info(struct dec_serial *);
  19946. -static void lk201_kbd_rx_char(unsigned char, unsigned char);
  19947. +static int __init lk201_init(void *);
  19948. +static void __init lk201_info(void *);
  19949. +static void lk201_rx_char(unsigned char, unsigned char);
  19950. -struct zs_hook lk201_kbdhook = {
  19951. +static struct dec_serial_hook lk201_hook = {
  19952. .init_channel = lk201_init,
  19953. .init_info = lk201_info,
  19954. .rx_char = NULL,
  19955. .poll_rx_char = NULL,
  19956. .poll_tx_char = NULL,
  19957. - .cflags = B4800 | CS8 | CSTOPB | CLOCAL
  19958. + .cflags = B4800 | CS8 | CSTOPB | CLOCAL,
  19959. };
  19960. /*
  19961. @@ -93,28 +94,28 @@ static unsigned char lk201_reset_string[
  19962. LK_CMD_ENB_BELL, LK_PARAM_VOLUME(4),
  19963. };
  19964. -static struct dec_serial* lk201kbd_info;
  19965. +static void *lk201_handle;
  19966. -static int lk201_send(struct dec_serial *info, unsigned char ch)
  19967. +static int lk201_send(unsigned char ch)
  19968. {
  19969. - if (info->hook->poll_tx_char(info, ch)) {
  19970. + if (lk201_hook.poll_tx_char(lk201_handle, ch)) {
  19971. printk(KERN_ERR "lk201: transmit timeout\n");
  19972. return -EIO;
  19973. }
  19974. return 0;
  19975. }
  19976. -static inline int lk201_get_id(struct dec_serial *info)
  19977. +static inline int lk201_get_id(void)
  19978. {
  19979. - return lk201_send(info, LK_CMD_REQ_ID);
  19980. + return lk201_send(LK_CMD_REQ_ID);
  19981. }
  19982. -static int lk201_reset(struct dec_serial *info)
  19983. +static int lk201_reset(void)
  19984. {
  19985. int i, r;
  19986. for (i = 0; i < sizeof(lk201_reset_string); i++) {
  19987. - r = lk201_send(info, lk201_reset_string[i]);
  19988. + r = lk201_send(lk201_reset_string[i]);
  19989. if (r < 0)
  19990. return r;
  19991. }
  19992. @@ -203,24 +204,26 @@ static void parse_kbd_rate(struct kbd_re
  19993. static int write_kbd_rate(struct kbd_repeat *rep)
  19994. {
  19995. - struct dec_serial* info = lk201kbd_info;
  19996. int delay, rate;
  19997. int i;
  19998. delay = rep->delay / 5;
  19999. rate = rep->rate;
  20000. for (i = 0; i < 4; i++) {
  20001. - if (info->hook->poll_tx_char(info, LK_CMD_RPT_RATE(i)))
  20002. + if (lk201_hook.poll_tx_char(lk201_handle,
  20003. + LK_CMD_RPT_RATE(i)))
  20004. return 1;
  20005. - if (info->hook->poll_tx_char(info, LK_PARAM_DELAY(delay)))
  20006. + if (lk201_hook.poll_tx_char(lk201_handle,
  20007. + LK_PARAM_DELAY(delay)))
  20008. return 1;
  20009. - if (info->hook->poll_tx_char(info, LK_PARAM_RATE(rate)))
  20010. + if (lk201_hook.poll_tx_char(lk201_handle,
  20011. + LK_PARAM_RATE(rate)))
  20012. return 1;
  20013. }
  20014. return 0;
  20015. }
  20016. -static int lk201kbd_rate(struct kbd_repeat *rep)
  20017. +static int lk201_kbd_rate(struct kbd_repeat *rep)
  20018. {
  20019. if (rep == NULL)
  20020. return -EINVAL;
  20021. @@ -237,10 +240,8 @@ static int lk201kbd_rate(struct kbd_repe
  20022. return 0;
  20023. }
  20024. -static void lk201kd_mksound(unsigned int hz, unsigned int ticks)
  20025. +static void lk201_kd_mksound(unsigned int hz, unsigned int ticks)
  20026. {
  20027. - struct dec_serial* info = lk201kbd_info;
  20028. -
  20029. if (!ticks)
  20030. return;
  20031. @@ -253,20 +254,19 @@ static void lk201kd_mksound(unsigned int
  20032. ticks = 7;
  20033. ticks = 7 - ticks;
  20034. - if (info->hook->poll_tx_char(info, LK_CMD_ENB_BELL))
  20035. + if (lk201_hook.poll_tx_char(lk201_handle, LK_CMD_ENB_BELL))
  20036. return;
  20037. - if (info->hook->poll_tx_char(info, LK_PARAM_VOLUME(ticks)))
  20038. + if (lk201_hook.poll_tx_char(lk201_handle, LK_PARAM_VOLUME(ticks)))
  20039. return;
  20040. - if (info->hook->poll_tx_char(info, LK_CMD_BELL))
  20041. + if (lk201_hook.poll_tx_char(lk201_handle, LK_CMD_BELL))
  20042. return;
  20043. }
  20044. void kbd_leds(unsigned char leds)
  20045. {
  20046. - struct dec_serial* info = lk201kbd_info;
  20047. unsigned char l = 0;
  20048. - if (!info) /* FIXME */
  20049. + if (!lk201_handle) /* FIXME */
  20050. return;
  20051. /* FIXME -- Only Hold and Lock LEDs for now. --macro */
  20052. @@ -275,13 +275,13 @@ void kbd_leds(unsigned char leds)
  20053. if (leds & LED_CAP)
  20054. l |= LK_LED_LOCK;
  20055. - if (info->hook->poll_tx_char(info, LK_CMD_LEDS_ON))
  20056. + if (lk201_hook.poll_tx_char(lk201_handle, LK_CMD_LEDS_ON))
  20057. return;
  20058. - if (info->hook->poll_tx_char(info, LK_PARAM_LED_MASK(l)))
  20059. + if (lk201_hook.poll_tx_char(lk201_handle, LK_PARAM_LED_MASK(l)))
  20060. return;
  20061. - if (info->hook->poll_tx_char(info, LK_CMD_LEDS_OFF))
  20062. + if (lk201_hook.poll_tx_char(lk201_handle, LK_CMD_LEDS_OFF))
  20063. return;
  20064. - if (info->hook->poll_tx_char(info, LK_PARAM_LED_MASK(~l)))
  20065. + if (lk201_hook.poll_tx_char(lk201_handle, LK_PARAM_LED_MASK(~l)))
  20066. return;
  20067. }
  20068. @@ -307,7 +307,7 @@ char kbd_unexpected_up(unsigned char key
  20069. return 0x80;
  20070. }
  20071. -static void lk201_kbd_rx_char(unsigned char ch, unsigned char stat)
  20072. +static void lk201_rx_char(unsigned char ch, unsigned char fl)
  20073. {
  20074. static unsigned char id[6];
  20075. static int id_i;
  20076. @@ -316,9 +316,8 @@ static void lk201_kbd_rx_char(unsigned c
  20077. static int prev_scancode;
  20078. unsigned char c = scancodeRemap[ch];
  20079. - if (stat && stat != TTY_OVERRUN) {
  20080. - printk(KERN_ERR "lk201: keyboard receive error: 0x%02x\n",
  20081. - stat);
  20082. + if (fl != TTY_NORMAL && fl != TTY_OVERRUN) {
  20083. + printk(KERN_ERR "lk201: keyboard receive error: 0x%02x\n", fl);
  20084. return;
  20085. }
  20086. @@ -335,7 +334,7 @@ static void lk201_kbd_rx_char(unsigned c
  20087. /* OK, the power-up concluded. */
  20088. lk201_report(id);
  20089. if (id[2] == LK_STAT_PWRUP_OK)
  20090. - lk201_get_id(lk201kbd_info);
  20091. + lk201_get_id();
  20092. else {
  20093. id_i = 0;
  20094. printk(KERN_ERR "lk201: keyboard power-up "
  20095. @@ -345,7 +344,7 @@ static void lk201_kbd_rx_char(unsigned c
  20096. /* We got the ID; report it and start operation. */
  20097. id_i = 0;
  20098. lk201_id(id);
  20099. - lk201_reset(lk201kbd_info);
  20100. + lk201_reset();
  20101. }
  20102. return;
  20103. }
  20104. @@ -398,29 +397,28 @@ static void lk201_kbd_rx_char(unsigned c
  20105. tasklet_schedule(&keyboard_tasklet);
  20106. }
  20107. -static void __init lk201_info(struct dec_serial *info)
  20108. +static void __init lk201_info(void *handle)
  20109. {
  20110. }
  20111. -static int __init lk201_init(struct dec_serial *info)
  20112. +static int __init lk201_init(void *handle)
  20113. {
  20114. /* First install handlers. */
  20115. - lk201kbd_info = info;
  20116. - kbd_rate = lk201kbd_rate;
  20117. - kd_mksound = lk201kd_mksound;
  20118. + lk201_handle = handle;
  20119. + kbd_rate = lk201_kbd_rate;
  20120. + kd_mksound = lk201_kd_mksound;
  20121. - info->hook->rx_char = lk201_kbd_rx_char;
  20122. + lk201_hook.rx_char = lk201_rx_char;
  20123. /* Then just issue a reset -- the handlers will do the rest. */
  20124. - lk201_send(info, LK_CMD_POWER_UP);
  20125. + lk201_send(LK_CMD_POWER_UP);
  20126. return 0;
  20127. }
  20128. void __init kbd_init_hw(void)
  20129. {
  20130. - extern int register_zs_hook(unsigned int, struct zs_hook *);
  20131. - extern int unregister_zs_hook(unsigned int);
  20132. + int keyb_line;
  20133. /* Maxine uses LK501 at the Access.Bus. */
  20134. if (!LK_IFACE)
  20135. @@ -428,19 +426,15 @@ void __init kbd_init_hw(void)
  20136. printk(KERN_INFO "lk201: DECstation LK keyboard driver v0.05.\n");
  20137. - if (LK_IFACE_ZS) {
  20138. - /*
  20139. - * kbd_init_hw() is being called before
  20140. - * rs_init() so just register the kbd hook
  20141. - * and let zs_init do the rest :-)
  20142. - */
  20143. - if(!register_zs_hook(KEYB_LINE, &lk201_kbdhook))
  20144. - unregister_zs_hook(KEYB_LINE);
  20145. - } else {
  20146. - /*
  20147. - * TODO: modify dz.c to allow similar hooks
  20148. - * for LK201 handling on DS2100, DS3100, and DS5000/200
  20149. - */
  20150. - printk(KERN_ERR "lk201: support for DZ11 not yet ready.\n");
  20151. - }
  20152. + /*
  20153. + * kbd_init_hw() is being called before
  20154. + * rs_init() so just register the kbd hook
  20155. + * and let zs_init do the rest :-)
  20156. + */
  20157. + if (LK_IFACE_ZS)
  20158. + keyb_line = KEYB_LINE_ZS;
  20159. + else
  20160. + keyb_line = KEYB_LINE_DZ;
  20161. + if (!register_dec_serial_hook(keyb_line, &lk201_hook))
  20162. + unregister_dec_serial_hook(keyb_line);
  20163. }
  20164. Index: linux-2.4.35.4/drivers/tc/zs.c
  20165. ===================================================================
  20166. --- linux-2.4.35.4.orig/drivers/tc/zs.c
  20167. +++ linux-2.4.35.4/drivers/tc/zs.c
  20168. @@ -68,6 +68,8 @@
  20169. #include <asm/bitops.h>
  20170. #include <asm/uaccess.h>
  20171. #include <asm/bootinfo.h>
  20172. +#include <asm/dec/serial.h>
  20173. +
  20174. #ifdef CONFIG_DECSTATION
  20175. #include <asm/dec/interrupts.h>
  20176. #include <asm/dec/machtype.h>
  20177. @@ -160,8 +162,8 @@ struct tty_struct zs_ttys[NUM_CHANNELS];
  20178. #ifdef CONFIG_SERIAL_DEC_CONSOLE
  20179. static struct console sercons;
  20180. #endif
  20181. -#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) \
  20182. - && !defined(MODULE)
  20183. +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
  20184. + !defined(MODULE)
  20185. static unsigned long break_pressed; /* break, really ... */
  20186. #endif
  20187. @@ -196,7 +198,6 @@ static int serial_refcount;
  20188. /*
  20189. * Debugging.
  20190. */
  20191. -#undef SERIAL_DEBUG_INTR
  20192. #undef SERIAL_DEBUG_OPEN
  20193. #undef SERIAL_DEBUG_FLOW
  20194. #undef SERIAL_DEBUG_THROTTLE
  20195. @@ -221,10 +222,6 @@ static struct tty_struct *serial_table[N
  20196. static struct termios *serial_termios[NUM_CHANNELS];
  20197. static struct termios *serial_termios_locked[NUM_CHANNELS];
  20198. -#ifndef MIN
  20199. -#define MIN(a,b) ((a) < (b) ? (a) : (b))
  20200. -#endif
  20201. -
  20202. /*
  20203. * tmp_buf is used as a temporary buffer by serial_write. We need to
  20204. * lock it in case the copy_from_user blocks while swapping in a page,
  20205. @@ -386,8 +383,6 @@ static inline void rs_recv_clear(struct
  20206. * -----------------------------------------------------------------------
  20207. */
  20208. -static int tty_break; /* Set whenever BREAK condition is detected. */
  20209. -
  20210. /*
  20211. * This routine is used by the interrupt handler to schedule
  20212. * processing in the software interrupt portion of the driver.
  20213. @@ -414,20 +409,15 @@ static _INLINE_ void receive_chars(struc
  20214. if (!tty && (!info->hook || !info->hook->rx_char))
  20215. continue;
  20216. - if (tty_break) {
  20217. - tty_break = 0;
  20218. -#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && !defined(MODULE)
  20219. - if (info->line == sercons.index) {
  20220. - if (!break_pressed) {
  20221. - break_pressed = jiffies;
  20222. - goto ignore_char;
  20223. - }
  20224. - break_pressed = 0;
  20225. - }
  20226. -#endif
  20227. + flag = TTY_NORMAL;
  20228. + if (info->tty_break) {
  20229. + info->tty_break = 0;
  20230. flag = TTY_BREAK;
  20231. if (info->flags & ZILOG_SAK)
  20232. do_SAK(tty);
  20233. + /* Ignore the null char got when BREAK is removed. */
  20234. + if (ch == 0)
  20235. + continue;
  20236. } else {
  20237. if (stat & Rx_OVR) {
  20238. flag = TTY_OVERRUN;
  20239. @@ -435,20 +425,22 @@ static _INLINE_ void receive_chars(struc
  20240. flag = TTY_FRAME;
  20241. } else if (stat & PAR_ERR) {
  20242. flag = TTY_PARITY;
  20243. - } else
  20244. - flag = 0;
  20245. - if (flag)
  20246. + }
  20247. + if (flag != TTY_NORMAL)
  20248. /* reset the error indication */
  20249. write_zsreg(info->zs_channel, R0, ERR_RES);
  20250. }
  20251. -#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && !defined(MODULE)
  20252. +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
  20253. + !defined(MODULE)
  20254. if (break_pressed && info->line == sercons.index) {
  20255. - if (ch != 0 &&
  20256. - time_before(jiffies, break_pressed + HZ*5)) {
  20257. + /* Ignore the null char got when BREAK is removed. */
  20258. + if (ch == 0)
  20259. + continue;
  20260. + if (time_before(jiffies, break_pressed + HZ * 5)) {
  20261. handle_sysrq(ch, regs, NULL, NULL);
  20262. break_pressed = 0;
  20263. - goto ignore_char;
  20264. + continue;
  20265. }
  20266. break_pressed = 0;
  20267. }
  20268. @@ -459,23 +451,7 @@ static _INLINE_ void receive_chars(struc
  20269. return;
  20270. }
  20271. - if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
  20272. - static int flip_buf_ovf;
  20273. - ++flip_buf_ovf;
  20274. - continue;
  20275. - }
  20276. - tty->flip.count++;
  20277. - {
  20278. - static int flip_max_cnt;
  20279. - if (flip_max_cnt < tty->flip.count)
  20280. - flip_max_cnt = tty->flip.count;
  20281. - }
  20282. -
  20283. - *tty->flip.flag_buf_ptr++ = flag;
  20284. - *tty->flip.char_buf_ptr++ = ch;
  20285. -#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && !defined(MODULE)
  20286. - ignore_char:
  20287. -#endif
  20288. + tty_insert_flip_char(tty, ch, flag);
  20289. }
  20290. if (tty)
  20291. tty_flip_buffer_push(tty);
  20292. @@ -517,11 +493,15 @@ static _INLINE_ void status_handle(struc
  20293. /* Get status from Read Register 0 */
  20294. stat = read_zsreg(info->zs_channel, R0);
  20295. - if (stat & BRK_ABRT) {
  20296. -#ifdef SERIAL_DEBUG_INTR
  20297. - printk("handling break....");
  20298. + if ((stat & BRK_ABRT) && !(info->read_reg_zero & BRK_ABRT)) {
  20299. +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
  20300. + !defined(MODULE)
  20301. + if (info->line == sercons.index) {
  20302. + if (!break_pressed)
  20303. + break_pressed = jiffies;
  20304. + } else
  20305. #endif
  20306. - tty_break = 1;
  20307. + info->tty_break = 1;
  20308. }
  20309. if (info->zs_channel != info->zs_chan_a) {
  20310. @@ -957,7 +937,7 @@ static int rs_write(struct tty_struct *
  20311. save_flags(flags);
  20312. while (1) {
  20313. cli();
  20314. - c = MIN(count, MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
  20315. + c = min(count, min(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
  20316. SERIAL_XMIT_SIZE - info->xmit_head));
  20317. if (c <= 0)
  20318. break;
  20319. @@ -965,7 +945,7 @@ static int rs_write(struct tty_struct *
  20320. if (from_user) {
  20321. down(&tmp_buf_sem);
  20322. copy_from_user(tmp_buf, buf, c);
  20323. - c = MIN(c, MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
  20324. + c = min(c, min(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
  20325. SERIAL_XMIT_SIZE - info->xmit_head));
  20326. memcpy(info->xmit_buf + info->xmit_head, tmp_buf, c);
  20327. up(&tmp_buf_sem);
  20328. @@ -1282,46 +1262,48 @@ static int rs_ioctl(struct tty_struct *t
  20329. }
  20330. switch (cmd) {
  20331. - case TIOCMGET:
  20332. - error = verify_area(VERIFY_WRITE, (void *) arg,
  20333. - sizeof(unsigned int));
  20334. - if (error)
  20335. - return error;
  20336. - return get_modem_info(info, (unsigned int *) arg);
  20337. - case TIOCMBIS:
  20338. - case TIOCMBIC:
  20339. - case TIOCMSET:
  20340. - return set_modem_info(info, cmd, (unsigned int *) arg);
  20341. - case TIOCGSERIAL:
  20342. - error = verify_area(VERIFY_WRITE, (void *) arg,
  20343. - sizeof(struct serial_struct));
  20344. - if (error)
  20345. - return error;
  20346. - return get_serial_info(info,
  20347. - (struct serial_struct *) arg);
  20348. - case TIOCSSERIAL:
  20349. - return set_serial_info(info,
  20350. - (struct serial_struct *) arg);
  20351. - case TIOCSERGETLSR: /* Get line status register */
  20352. - error = verify_area(VERIFY_WRITE, (void *) arg,
  20353. - sizeof(unsigned int));
  20354. - if (error)
  20355. - return error;
  20356. - else
  20357. - return get_lsr_info(info, (unsigned int *) arg);
  20358. + case TIOCMGET:
  20359. + error = verify_area(VERIFY_WRITE, (void *)arg,
  20360. + sizeof(unsigned int));
  20361. + if (error)
  20362. + return error;
  20363. + return get_modem_info(info, (unsigned int *)arg);
  20364. - case TIOCSERGSTRUCT:
  20365. - error = verify_area(VERIFY_WRITE, (void *) arg,
  20366. - sizeof(struct dec_serial));
  20367. - if (error)
  20368. - return error;
  20369. - copy_from_user((struct dec_serial *) arg,
  20370. - info, sizeof(struct dec_serial));
  20371. - return 0;
  20372. + case TIOCMBIS:
  20373. + case TIOCMBIC:
  20374. + case TIOCMSET:
  20375. + return set_modem_info(info, cmd, (unsigned int *)arg);
  20376. - default:
  20377. - return -ENOIOCTLCMD;
  20378. - }
  20379. + case TIOCGSERIAL:
  20380. + error = verify_area(VERIFY_WRITE, (void *)arg,
  20381. + sizeof(struct serial_struct));
  20382. + if (error)
  20383. + return error;
  20384. + return get_serial_info(info, (struct serial_struct *)arg);
  20385. +
  20386. + case TIOCSSERIAL:
  20387. + return set_serial_info(info, (struct serial_struct *)arg);
  20388. +
  20389. + case TIOCSERGETLSR: /* Get line status register */
  20390. + error = verify_area(VERIFY_WRITE, (void *)arg,
  20391. + sizeof(unsigned int));
  20392. + if (error)
  20393. + return error;
  20394. + else
  20395. + return get_lsr_info(info, (unsigned int *)arg);
  20396. +
  20397. + case TIOCSERGSTRUCT:
  20398. + error = verify_area(VERIFY_WRITE, (void *)arg,
  20399. + sizeof(struct dec_serial));
  20400. + if (error)
  20401. + return error;
  20402. + copy_from_user((struct dec_serial *)arg, info,
  20403. + sizeof(struct dec_serial));
  20404. + return 0;
  20405. +
  20406. + default:
  20407. + return -ENOIOCTLCMD;
  20408. + }
  20409. return 0;
  20410. }
  20411. @@ -1446,7 +1428,8 @@ static void rs_close(struct tty_struct *
  20412. static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
  20413. {
  20414. struct dec_serial *info = (struct dec_serial *) tty->driver_data;
  20415. - unsigned long orig_jiffies, char_time;
  20416. + unsigned long orig_jiffies;
  20417. + int char_time;
  20418. if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
  20419. return;
  20420. @@ -1462,7 +1445,7 @@ static void rs_wait_until_sent(struct tt
  20421. if (char_time == 0)
  20422. char_time = 1;
  20423. if (timeout)
  20424. - char_time = MIN(char_time, timeout);
  20425. + char_time = min(char_time, timeout);
  20426. while ((read_zsreg(info->zs_channel, 1) & Tx_BUF_EMP) == 0) {
  20427. current->state = TASK_INTERRUPTIBLE;
  20428. schedule_timeout(char_time);
  20429. @@ -1714,7 +1697,7 @@ int rs_open(struct tty_struct *tty, stru
  20430. static void __init show_serial_version(void)
  20431. {
  20432. - printk("DECstation Z8530 serial driver version 0.08\n");
  20433. + printk("DECstation Z8530 serial driver version 0.09\n");
  20434. }
  20435. /* Initialize Z8530s zs_channels
  20436. @@ -1994,8 +1977,9 @@ int __init zs_init(void)
  20437. * polling I/O routines
  20438. */
  20439. static int
  20440. -zs_poll_tx_char(struct dec_serial *info, unsigned char ch)
  20441. +zs_poll_tx_char(void *handle, unsigned char ch)
  20442. {
  20443. + struct dec_serial *info = handle;
  20444. struct dec_zschannel *chan = info->zs_channel;
  20445. int ret;
  20446. @@ -2017,8 +2001,9 @@ zs_poll_tx_char(struct dec_serial *info,
  20447. }
  20448. static int
  20449. -zs_poll_rx_char(struct dec_serial *info)
  20450. +zs_poll_rx_char(void *handle)
  20451. {
  20452. + struct dec_serial *info = handle;
  20453. struct dec_zschannel *chan = info->zs_channel;
  20454. int ret;
  20455. @@ -2038,12 +2023,13 @@ zs_poll_rx_char(struct dec_serial *info)
  20456. return -ENODEV;
  20457. }
  20458. -unsigned int register_zs_hook(unsigned int channel, struct zs_hook *hook)
  20459. +int register_zs_hook(unsigned int channel, struct dec_serial_hook *hook)
  20460. {
  20461. struct dec_serial *info = &zs_soft[channel];
  20462. if (info->hook) {
  20463. - printk(__FUNCTION__": line %d has already a hook registered\n", channel);
  20464. + printk("%s: line %d has already a hook registered\n",
  20465. + __FUNCTION__, channel);
  20466. return 0;
  20467. } else {
  20468. @@ -2055,7 +2041,7 @@ unsigned int register_zs_hook(unsigned i
  20469. }
  20470. }
  20471. -unsigned int unregister_zs_hook(unsigned int channel)
  20472. +int unregister_zs_hook(unsigned int channel)
  20473. {
  20474. struct dec_serial *info = &zs_soft[channel];
  20475. @@ -2063,8 +2049,8 @@ unsigned int unregister_zs_hook(unsigned
  20476. info->hook = NULL;
  20477. return 1;
  20478. } else {
  20479. - printk(__FUNCTION__": trying to unregister hook on line %d,"
  20480. - " but none is registered\n", channel);
  20481. + printk("%s: trying to unregister hook on line %d,"
  20482. + " but none is registered\n", __FUNCTION__, channel);
  20483. return 0;
  20484. }
  20485. }
  20486. @@ -2319,22 +2305,23 @@ void kgdb_interruptible(int yes)
  20487. write_zsreg(chan, 9, nine);
  20488. }
  20489. -static int kgdbhook_init_channel(struct dec_serial* info)
  20490. +static int kgdbhook_init_channel(void *handle)
  20491. {
  20492. return 0;
  20493. }
  20494. -static void kgdbhook_init_info(struct dec_serial* info)
  20495. +static void kgdbhook_init_info(void *handle)
  20496. {
  20497. }
  20498. -static void kgdbhook_rx_char(struct dec_serial* info,
  20499. - unsigned char ch, unsigned char stat)
  20500. +static void kgdbhook_rx_char(void *handle, unsigned char ch, unsigned char fl)
  20501. {
  20502. + struct dec_serial *info = handle;
  20503. +
  20504. + if (fl != TTY_NORMAL)
  20505. + return;
  20506. if (ch == 0x03 || ch == '$')
  20507. breakpoint();
  20508. - if (stat & (Rx_OVR|FRM_ERR|PAR_ERR))
  20509. - write_zsreg(info->zs_channel, 0, ERR_RES);
  20510. }
  20511. /* This sets up the serial port we're using, and turns on
  20512. @@ -2360,11 +2347,11 @@ static inline void kgdb_chaninit(struct
  20513. * for /dev/ttyb which is determined in setup_arch() from the
  20514. * boot command line flags.
  20515. */
  20516. -struct zs_hook zs_kgdbhook = {
  20517. - init_channel : kgdbhook_init_channel,
  20518. - init_info : kgdbhook_init_info,
  20519. - cflags : B38400|CS8|CLOCAL,
  20520. - rx_char : kgdbhook_rx_char,
  20521. +struct dec_serial_hook zs_kgdbhook = {
  20522. + .init_channel = kgdbhook_init_channel,
  20523. + .init_info = kgdbhook_init_info,
  20524. + .rx_char = kgdbhook_rx_char,
  20525. + .cflags = B38400 | CS8 | CLOCAL,
  20526. }
  20527. void __init zs_kgdb_hook(int tty_num)
  20528. Index: linux-2.4.35.4/drivers/tc/zs.h
  20529. ===================================================================
  20530. --- linux-2.4.35.4.orig/drivers/tc/zs.h
  20531. +++ linux-2.4.35.4/drivers/tc/zs.h
  20532. @@ -1,14 +1,18 @@
  20533. /*
  20534. - * macserial.h: Definitions for the Macintosh Z8530 serial driver.
  20535. + * drivers/tc/zs.h: Definitions for the DECstation Z85C30 serial driver.
  20536. *
  20537. * Adapted from drivers/sbus/char/sunserial.h by Paul Mackerras.
  20538. + * Adapted from drivers/macintosh/macserial.h by Harald Koerfgen.
  20539. *
  20540. * Copyright (C) 1996 Paul Mackerras ([email protected])
  20541. * Copyright (C) 1995 David S. Miller ([email protected])
  20542. + * Copyright (C) 2004 Maciej W. Rozycki
  20543. */
  20544. #ifndef _DECSERIAL_H
  20545. #define _DECSERIAL_H
  20546. +#include <asm/dec/serial.h>
  20547. +
  20548. #define NUM_ZSREGS 16
  20549. struct serial_struct {
  20550. @@ -89,63 +93,50 @@ struct dec_zschannel {
  20551. unsigned char curregs[NUM_ZSREGS];
  20552. };
  20553. -struct dec_serial;
  20554. -
  20555. -struct zs_hook {
  20556. - int (*init_channel)(struct dec_serial* info);
  20557. - void (*init_info)(struct dec_serial* info);
  20558. - void (*rx_char)(unsigned char ch, unsigned char stat);
  20559. - int (*poll_rx_char)(struct dec_serial* info);
  20560. - int (*poll_tx_char)(struct dec_serial* info,
  20561. - unsigned char ch);
  20562. - unsigned cflags;
  20563. -};
  20564. -
  20565. struct dec_serial {
  20566. - struct dec_serial *zs_next; /* For IRQ servicing chain */
  20567. - struct dec_zschannel *zs_channel; /* Channel registers */
  20568. - struct dec_zschannel *zs_chan_a; /* A side registers */
  20569. - unsigned char read_reg_zero;
  20570. -
  20571. - char soft_carrier; /* Use soft carrier on this channel */
  20572. - char break_abort; /* Is serial console in, so process brk/abrt */
  20573. - struct zs_hook *hook; /* Hook on this channel */
  20574. - char is_cons; /* Is this our console. */
  20575. - unsigned char tx_active; /* character is being xmitted */
  20576. - unsigned char tx_stopped; /* output is suspended */
  20577. -
  20578. - /* We need to know the current clock divisor
  20579. - * to read the bps rate the chip has currently
  20580. - * loaded.
  20581. + struct dec_serial *zs_next; /* For IRQ servicing chain. */
  20582. + struct dec_zschannel *zs_channel; /* Channel registers. */
  20583. + struct dec_zschannel *zs_chan_a; /* A side registers. */
  20584. + unsigned char read_reg_zero;
  20585. +
  20586. + struct dec_serial_hook *hook; /* Hook on this channel. */
  20587. + int tty_break; /* Set on BREAK condition. */
  20588. + int is_cons; /* Is this our console. */
  20589. + int tx_active; /* Char is being xmitted. */
  20590. + int tx_stopped; /* Output is suspended. */
  20591. +
  20592. + /*
  20593. + * We need to know the current clock divisor
  20594. + * to read the bps rate the chip has currently loaded.
  20595. */
  20596. - unsigned char clk_divisor; /* May be 1, 16, 32, or 64 */
  20597. - int zs_baud;
  20598. + int clk_divisor; /* May be 1, 16, 32, or 64. */
  20599. + int zs_baud;
  20600. - char change_needed;
  20601. + char change_needed;
  20602. int magic;
  20603. int baud_base;
  20604. int port;
  20605. int irq;
  20606. - int flags; /* defined in tty.h */
  20607. - int type; /* UART type */
  20608. + int flags; /* Defined in tty.h. */
  20609. + int type; /* UART type. */
  20610. struct tty_struct *tty;
  20611. int read_status_mask;
  20612. int ignore_status_mask;
  20613. int timeout;
  20614. int xmit_fifo_size;
  20615. int custom_divisor;
  20616. - int x_char; /* xon/xoff character */
  20617. + int x_char; /* XON/XOFF character. */
  20618. int close_delay;
  20619. unsigned short closing_wait;
  20620. unsigned short closing_wait2;
  20621. unsigned long event;
  20622. unsigned long last_active;
  20623. int line;
  20624. - int count; /* # of fd on device */
  20625. - int blocked_open; /* # of blocked opens */
  20626. - long session; /* Session of opening process */
  20627. - long pgrp; /* pgrp of opening process */
  20628. + int count; /* # of fds on device. */
  20629. + int blocked_open; /* # of blocked opens. */
  20630. + long session; /* Sess of opening process. */
  20631. + long pgrp; /* Pgrp of opening process. */
  20632. unsigned char *xmit_buf;
  20633. int xmit_head;
  20634. int xmit_tail;
  20635. Index: linux-2.4.35.4/drivers/video/au1200fb.c
  20636. ===================================================================
  20637. --- /dev/null
  20638. +++ linux-2.4.35.4/drivers/video/au1200fb.c
  20639. @@ -0,0 +1,1564 @@
  20640. +/*
  20641. + * BRIEF MODULE DESCRIPTION
  20642. + * Au1200 LCD Driver.
  20643. + *
  20644. + * Copyright 2004 AMD
  20645. + * Author: AMD
  20646. + *
  20647. + * Based on:
  20648. + * linux/drivers/video/skeletonfb.c -- Skeleton for a frame buffer device
  20649. + * Created 28 Dec 1997 by Geert Uytterhoeven
  20650. + *
  20651. + * This program is free software; you can redistribute it and/or modify it
  20652. + * under the terms of the GNU General Public License as published by the
  20653. + * Free Software Foundation; either version 2 of the License, or (at your
  20654. + * option) any later version.
  20655. + *
  20656. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  20657. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  20658. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  20659. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  20660. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  20661. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  20662. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  20663. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  20664. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  20665. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  20666. + *
  20667. + * You should have received a copy of the GNU General Public License along
  20668. + * with this program; if not, write to the Free Software Foundation, Inc.,
  20669. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  20670. + */
  20671. +
  20672. +#include <linux/module.h>
  20673. +#include <linux/kernel.h>
  20674. +#include <linux/errno.h>
  20675. +#include <linux/string.h>
  20676. +#include <linux/mm.h>
  20677. +#include <linux/tty.h>
  20678. +#include <linux/slab.h>
  20679. +#include <linux/delay.h>
  20680. +#include <linux/fb.h>
  20681. +#include <linux/init.h>
  20682. +#include <asm/uaccess.h>
  20683. +
  20684. +#include <asm/au1000.h>
  20685. +#include <asm/au1xxx_gpio.h>
  20686. +#include "au1200fb.h"
  20687. +
  20688. +#include <video/fbcon.h>
  20689. +#include <video/fbcon-cfb16.h>
  20690. +#include <video/fbcon-cfb32.h>
  20691. +#define CMAPSIZE 16
  20692. +
  20693. +#define AU1200_LCD_GET_WINENABLE 1
  20694. +#define AU1200_LCD_SET_WINENABLE 2
  20695. +#define AU1200_LCD_GET_WINLOCATION 3
  20696. +#define AU1200_LCD_SET_WINLOCATION 4
  20697. +#define AU1200_LCD_GET_WINSIZE 5
  20698. +#define AU1200_LCD_SET_WINSIZE 6
  20699. +#define AU1200_LCD_GET_BACKCOLOR 7
  20700. +#define AU1200_LCD_SET_BACKCOLOR 8
  20701. +#define AU1200_LCD_GET_COLORKEY 9
  20702. +#define AU1200_LCD_SET_COLORKEY 10
  20703. +#define AU1200_LCD_GET_PANEL 11
  20704. +#define AU1200_LCD_SET_PANEL 12
  20705. +
  20706. +typedef struct au1200_lcd_getset_t
  20707. +{
  20708. + unsigned int subcmd;
  20709. + union {
  20710. + struct {
  20711. + int enable;
  20712. + } winenable;
  20713. + struct {
  20714. + int x, y;
  20715. + } winlocation;
  20716. + struct {
  20717. + int hsz, vsz;
  20718. + } winsize;
  20719. + struct {
  20720. + unsigned int color;
  20721. + } backcolor;
  20722. + struct {
  20723. + unsigned int key;
  20724. + unsigned int mask;
  20725. + } colorkey;
  20726. + struct {
  20727. + int panel;
  20728. + char desc[80];
  20729. + } panel;
  20730. + };
  20731. +} au1200_lcd_getset_t;
  20732. +
  20733. +AU1200_LCD *lcd = (AU1200_LCD *)AU1200_LCD_ADDR;
  20734. +static int window_index = 0; /* default is zero */
  20735. +static int panel_index = -1; /* default is call board_au1200fb_panel */
  20736. +
  20737. +struct window_settings
  20738. +{
  20739. + unsigned char name[64];
  20740. + uint32 mode_backcolor;
  20741. + uint32 mode_colorkey;
  20742. + uint32 mode_colorkeymsk;
  20743. + struct
  20744. + {
  20745. + int xres;
  20746. + int yres;
  20747. + int xpos;
  20748. + int ypos;
  20749. + uint32 mode_winctrl1; /* winctrl1[FRM,CCO,PO,PIPE] */
  20750. + uint32 mode_winenable;
  20751. + } w[4];
  20752. +};
  20753. +
  20754. +struct panel_settings
  20755. +{
  20756. + unsigned char name[64];
  20757. + /* panel physical dimensions */
  20758. + uint32 Xres;
  20759. + uint32 Yres;
  20760. + /* panel timings */
  20761. + uint32 mode_screen;
  20762. + uint32 mode_horztiming;
  20763. + uint32 mode_verttiming;
  20764. + uint32 mode_clkcontrol;
  20765. + uint32 mode_pwmdiv;
  20766. + uint32 mode_pwmhi;
  20767. + uint32 mode_outmask;
  20768. + uint32 mode_fifoctrl;
  20769. + uint32 mode_toyclksrc;
  20770. + uint32 mode_backlight;
  20771. + uint32 mode_auxpll;
  20772. + int (*device_init)(void);
  20773. + int (*device_shutdown)(void);
  20774. +};
  20775. +
  20776. +#if defined(__BIG_ENDIAN)
  20777. +#define LCD_WINCTRL1_PO_16BPP LCD_WINCTRL1_PO_00
  20778. +#else
  20779. +#define LCD_WINCTRL1_PO_16BPP LCD_WINCTRL1_PO_01
  20780. +#endif
  20781. +
  20782. +extern int board_au1200fb_panel (void);
  20783. +extern int board_au1200fb_panel_init (void);
  20784. +extern int board_au1200fb_panel_shutdown (void);
  20785. +
  20786. +#if defined(CONFIG_FOCUS_ENHANCEMENTS)
  20787. +extern int board_au1200fb_focus_init_hdtv(void);
  20788. +extern int board_au1200fb_focus_init_component(void);
  20789. +extern int board_au1200fb_focus_init_cvsv(void);
  20790. +extern int board_au1200fb_focus_shutdown(void);
  20791. +#endif
  20792. +
  20793. +/*
  20794. + * Default window configurations
  20795. + */
  20796. +static struct window_settings windows[] =
  20797. +{
  20798. + { /* Index 0 */
  20799. + "0-FS gfx, 1-video, 2-ovly gfx, 3-ovly gfx",
  20800. + /* mode_backcolor */ 0x006600ff,
  20801. + /* mode_colorkey,msk*/ 0, 0,
  20802. + {
  20803. + {
  20804. + /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
  20805. + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP,
  20806. + /* mode_winenable*/ LCD_WINENABLE_WEN0,
  20807. + },
  20808. + {
  20809. + /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
  20810. + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP,
  20811. + /* mode_winenable*/ 0,
  20812. + },
  20813. + {
  20814. + /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
  20815. + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP|LCD_WINCTRL1_PIPE,
  20816. + /* mode_winenable*/ 0,
  20817. + },
  20818. + {
  20819. + /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
  20820. + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP|LCD_WINCTRL1_PIPE,
  20821. + /* mode_winenable*/ 0,
  20822. + },
  20823. + },
  20824. + },
  20825. +
  20826. + { /* Index 1 */
  20827. + "0-FS gfx, 1-video, 2-ovly gfx, 3-ovly gfx",
  20828. + /* mode_backcolor */ 0x006600ff,
  20829. + /* mode_colorkey,msk*/ 0, 0,
  20830. + {
  20831. + {
  20832. + /* xres, yres, xpos, ypos */ 320, 240, 5, 5,
  20833. +#if 0
  20834. + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP,
  20835. +#endif
  20836. + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_24BPP|LCD_WINCTRL1_PO_00,
  20837. + /* mode_winenable*/ LCD_WINENABLE_WEN0,
  20838. + },
  20839. + {
  20840. + /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
  20841. + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP,
  20842. + /* mode_winenable*/ 0,
  20843. + },
  20844. + {
  20845. + /* xres, yres, xpos, ypos */ 100, 100, 0, 0,
  20846. + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP|LCD_WINCTRL1_PIPE,
  20847. + /* mode_winenable*/ 0/*LCD_WINENABLE_WEN2*/,
  20848. + },
  20849. + {
  20850. + /* xres, yres, xpos, ypos */ 200, 25, 0, 0,
  20851. + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP|LCD_WINCTRL1_PIPE,
  20852. + /* mode_winenable*/ 0,
  20853. + },
  20854. + },
  20855. + },
  20856. + /* Need VGA 640 @ 24bpp, @ 32bpp */
  20857. + /* Need VGA 800 @ 24bpp, @ 32bpp */
  20858. + /* Need VGA 1024 @ 24bpp, @ 32bpp */
  20859. +} ;
  20860. +
  20861. +/*
  20862. + * Controller configurations for various panels.
  20863. + */
  20864. +static struct panel_settings panels[] =
  20865. +{
  20866. + { /* Index 0: QVGA 320x240 H:33.3kHz V:110Hz */
  20867. + "VGA_320x240",
  20868. + 320, 240,
  20869. + /* mode_screen */ LCD_SCREEN_SX_N(320) | LCD_SCREEN_SY_N(240),
  20870. + /* mode_horztiming */ 0x00c4623b,
  20871. + /* mode_verttiming */ 0x00502814,
  20872. + /* mode_clkcontrol */ 0x00020002, /* /4=24Mhz */
  20873. + /* mode_pwmdiv */ 0x00000000,
  20874. + /* mode_pwmhi */ 0x00000000,
  20875. + /* mode_outmask */ 0x00FFFFFF,
  20876. + /* mode_fifoctrl */ 0x2f2f2f2f,
  20877. + /* mode_toyclksrc */ 0x00000004, /* 96MHz AUXPLL directly */
  20878. + /* mode_backlight */ 0x00000000,
  20879. + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
  20880. + /* device_init */ NULL,
  20881. + /* device_shutdown */ NULL,
  20882. + },
  20883. +
  20884. + { /* Index 1: VGA 640x480 H:30.3kHz V:58Hz */
  20885. + "VGA_640x480",
  20886. + 640, 480,
  20887. + /* mode_screen */ 0x13f9df80,
  20888. + /* mode_horztiming */ 0x003c5859,
  20889. + /* mode_verttiming */ 0x00741201,
  20890. + /* mode_clkcontrol */ 0x00020001, /* /4=24Mhz */
  20891. + /* mode_pwmdiv */ 0x00000000,
  20892. + /* mode_pwmhi */ 0x00000000,
  20893. + /* mode_outmask */ 0x00FFFFFF,
  20894. + /* mode_fifoctrl */ 0x2f2f2f2f,
  20895. + /* mode_toyclksrc */ 0x00000004, /* AUXPLL directly */
  20896. + /* mode_backlight */ 0x00000000,
  20897. + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
  20898. + /* device_init */ NULL,
  20899. + /* device_shutdown */ NULL,
  20900. + },
  20901. +
  20902. + { /* Index 2: SVGA 800x600 H:46.1kHz V:69Hz */
  20903. + "SVGA_800x600",
  20904. + 800, 600,
  20905. + /* mode_screen */ 0x18fa5780,
  20906. + /* mode_horztiming */ 0x00dc7e77,
  20907. + /* mode_verttiming */ 0x00584805,
  20908. + /* mode_clkcontrol */ 0x00020000, /* /2=48Mhz */
  20909. + /* mode_pwmdiv */ 0x00000000,
  20910. + /* mode_pwmhi */ 0x00000000,
  20911. + /* mode_outmask */ 0x00FFFFFF,
  20912. + /* mode_fifoctrl */ 0x2f2f2f2f,
  20913. + /* mode_toyclksrc */ 0x00000004, /* AUXPLL directly */
  20914. + /* mode_backlight */ 0x00000000,
  20915. + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
  20916. + /* device_init */ NULL,
  20917. + /* device_shutdown */ NULL,
  20918. + },
  20919. +
  20920. + { /* Index 3: XVGA 1024x768 H:56.2kHz V:70Hz */
  20921. + "XVGA_1024x768",
  20922. + 1024, 768,
  20923. + /* mode_screen */ 0x1ffaff80,
  20924. + /* mode_horztiming */ 0x007d0e57,
  20925. + /* mode_verttiming */ 0x00740a01,
  20926. + /* mode_clkcontrol */ 0x000A0000, /* /1 */
  20927. + /* mode_pwmdiv */ 0x00000000,
  20928. + /* mode_pwmhi */ 0x00000000,
  20929. + /* mode_outmask */ 0x00FFFFFF,
  20930. + /* mode_fifoctrl */ 0x2f2f2f2f,
  20931. + /* mode_toyclksrc */ 0x00000004, /* AUXPLL directly */
  20932. + /* mode_backlight */ 0x00000000,
  20933. + /* mode_auxpll */ 6, /* 72MHz AUXPLL */
  20934. + /* device_init */ NULL,
  20935. + /* device_shutdown */ NULL,
  20936. + },
  20937. +
  20938. + { /* Index 4: XVGA 1280x1024 H:68.5kHz V:65Hz */
  20939. + "XVGA_1280x1024",
  20940. + 1280, 1024,
  20941. + /* mode_screen */ 0x27fbff80,
  20942. + /* mode_horztiming */ 0x00cdb2c7,
  20943. + /* mode_verttiming */ 0x00600002,
  20944. + /* mode_clkcontrol */ 0x000A0000, /* /1 */
  20945. + /* mode_pwmdiv */ 0x00000000,
  20946. + /* mode_pwmhi */ 0x00000000,
  20947. + /* mode_outmask */ 0x00FFFFFF,
  20948. + /* mode_fifoctrl */ 0x2f2f2f2f,
  20949. + /* mode_toyclksrc */ 0x00000004, /* AUXPLL directly */
  20950. + /* mode_backlight */ 0x00000000,
  20951. + /* mode_auxpll */ 10, /* 120MHz AUXPLL */
  20952. + /* device_init */ NULL,
  20953. + /* device_shutdown */ NULL,
  20954. + },
  20955. +
  20956. + { /* Index 5: Samsung 1024x768 TFT */
  20957. + "Samsung_1024x768_TFT",
  20958. + 1024, 768,
  20959. + /* mode_screen */ 0x1ffaff80,
  20960. + /* mode_horztiming */ 0x018cc677,
  20961. + /* mode_verttiming */ 0x00241217,
  20962. + /* mode_clkcontrol */ 0x00000000, /* SCB 0x1 /4=24Mhz */
  20963. + /* mode_pwmdiv */ 0x8000063f, /* SCB 0x0 */
  20964. + /* mode_pwmhi */ 0x03400000, /* SCB 0x0 */
  20965. + /* mode_outmask */ 0x00fcfcfc,
  20966. + /* mode_fifoctrl */ 0x2f2f2f2f,
  20967. + /* mode_toyclksrc */ 0x00000004, /* 96MHz AUXPLL directly */
  20968. + /* mode_backlight */ 0x00000000,
  20969. + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
  20970. + /* device_init */ board_au1200fb_panel_init,
  20971. + /* device_shutdown */ board_au1200fb_panel_shutdown,
  20972. + },
  20973. +
  20974. + { /* Index 6: Toshiba 640x480 TFT */
  20975. + "Toshiba_640x480_TFT",
  20976. + 640, 480,
  20977. + /* mode_screen */ LCD_SCREEN_SX_N(640) | LCD_SCREEN_SY_N(480),
  20978. + /* mode_horztiming */ LCD_HORZTIMING_HPW_N(96) | LCD_HORZTIMING_HND1_N(13) | LCD_HORZTIMING_HND2_N(51),
  20979. + /* mode_verttiming */ LCD_VERTTIMING_VPW_N(2) | LCD_VERTTIMING_VND1_N(11) | LCD_VERTTIMING_VND2_N(32) ,
  20980. + /* mode_clkcontrol */ 0x00000000, /* /4=24Mhz */
  20981. + /* mode_pwmdiv */ 0x8000063f,
  20982. + /* mode_pwmhi */ 0x03400000,
  20983. + /* mode_outmask */ 0x00fcfcfc,
  20984. + /* mode_fifoctrl */ 0x2f2f2f2f,
  20985. + /* mode_toyclksrc */ 0x00000004, /* 96MHz AUXPLL directly */
  20986. + /* mode_backlight */ 0x00000000,
  20987. + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
  20988. + /* device_init */ board_au1200fb_panel_init,
  20989. + /* device_shutdown */ board_au1200fb_panel_shutdown,
  20990. + },
  20991. +
  20992. + { /* Index 7: Sharp 320x240 TFT */
  20993. + "Sharp_320x240_TFT",
  20994. + 320, 240,
  20995. + /* mode_screen */ LCD_SCREEN_SX_N(320) | LCD_SCREEN_SY_N(240),
  20996. + /* mode_horztiming */ LCD_HORZTIMING_HPW_N(60) | LCD_HORZTIMING_HND1_N(13) | LCD_HORZTIMING_HND2_N(2),
  20997. + /* mode_verttiming */ LCD_VERTTIMING_VPW_N(2) | LCD_VERTTIMING_VND1_N(2) | LCD_VERTTIMING_VND2_N(5) ,
  20998. + /* mode_clkcontrol */ LCD_CLKCONTROL_PCD_N(7), /* /16=6Mhz */
  20999. + /* mode_pwmdiv */ 0x8000063f,
  21000. + /* mode_pwmhi */ 0x03400000,
  21001. + /* mode_outmask */ 0x00fcfcfc,
  21002. + /* mode_fifoctrl */ 0x2f2f2f2f,
  21003. + /* mode_toyclksrc */ 0x00000004, /* 96MHz AUXPLL directly */
  21004. + /* mode_backlight */ 0x00000000,
  21005. + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
  21006. + /* device_init */ board_au1200fb_panel_init,
  21007. + /* device_shutdown */ board_au1200fb_panel_shutdown,
  21008. + },
  21009. + { /* Index 8: Toppoly TD070WGCB2 7" 854x480 TFT */
  21010. + "Toppoly_TD070WGCB2",
  21011. + 854, 480,
  21012. + /* mode_screen */ LCD_SCREEN_SX_N(854) | LCD_SCREEN_SY_N(480),
  21013. + /* mode_horztiming */ LCD_HORZTIMING_HND2_N(44) | LCD_HORZTIMING_HND1_N(44) | LCD_HORZTIMING_HPW_N(114),
  21014. + /* mode_verttiming */ LCD_VERTTIMING_VND2_N(20) | LCD_VERTTIMING_VND1_N(21) | LCD_VERTTIMING_VPW_N(4),
  21015. + /* mode_clkcontrol */ 0x00020001, /* /4=24Mhz */
  21016. + /* mode_pwmdiv */ 0x8000063f,
  21017. + /* mode_pwmhi */ 0x03400000,
  21018. + /* mode_outmask */ 0x00FCFCFC,
  21019. + /* mode_fifoctrl */ 0x2f2f2f2f,
  21020. + /* mode_toyclksrc */ 0x00000004, /* AUXPLL directly */
  21021. + /* mode_backlight */ 0x00000000,
  21022. + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
  21023. + /* device_init */ board_au1200fb_panel_init,
  21024. + /* device_shutdown */ board_au1200fb_panel_shutdown,
  21025. + },
  21026. +#if defined(CONFIG_FOCUS_ENHANCEMENTS)
  21027. + { /* Index 9: Focus FS453 TV-Out 640x480 */
  21028. + "FS453_640x480 (Composite/S-Video)",
  21029. + 640, 480,
  21030. + /* mode_screen */ LCD_SCREEN_SX_N(640) | LCD_SCREEN_SY_N(480),
  21031. + /* mode_horztiming */ LCD_HORZTIMING_HND2_N(143) | LCD_HORZTIMING_HND1_N(143) | LCD_HORZTIMING_HPW_N(10),
  21032. + /* mode_verttiming */ LCD_VERTTIMING_VND2_N(30) | LCD_VERTTIMING_VND1_N(30) | LCD_VERTTIMING_VPW_N(5),
  21033. + /* mode_clkcontrol */ 0x00480000 | (1<<17) | (1<<18), /* External Clock, 1:1 clock ratio */
  21034. + /* mode_pwmdiv */ 0x00000000,
  21035. + /* mode_pwmhi */ 0x00000000,
  21036. + /* mode_outmask */ 0x00FFFFFF,
  21037. + /* mode_fifoctrl */ 0x2f2f2f2f,
  21038. + /* mode_toyclksrc */ 0x00000000,
  21039. + /* mode_backlight */ 0x00000000,
  21040. + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
  21041. + /* device_init */ board_au1200fb_focus_init_cvsv,
  21042. + /* device_shutdown */ board_au1200fb_focus_shutdown,
  21043. + },
  21044. +
  21045. + { /* Index 10: Focus FS453 TV-Out 640x480 */
  21046. + "FS453_640x480 (Component Video)",
  21047. + 640, 480,
  21048. + /* mode_screen */ LCD_SCREEN_SX_N(640) | LCD_SCREEN_SY_N(480),
  21049. + /* mode_horztiming */ LCD_HORZTIMING_HND2_N(143) | LCD_HORZTIMING_HND1_N(143) | LCD_HORZTIMING_HPW_N(10),
  21050. + /* mode_verttiming */ LCD_VERTTIMING_VND2_N(30) | LCD_VERTTIMING_VND1_N(30) | LCD_VERTTIMING_VPW_N(5),
  21051. + /* mode_clkcontrol */ 0x00480000 | (1<<17) | (1<<18), /* External Clock, 1:1 clock ratio */
  21052. + /* mode_pwmdiv */ 0x00000000,
  21053. + /* mode_pwmhi */ 0x00000000,
  21054. + /* mode_outmask */ 0x00FFFFFF,
  21055. + /* mode_fifoctrl */ 0x2f2f2f2f,
  21056. + /* mode_toyclksrc */ 0x00000000,
  21057. + /* mode_backlight */ 0x00000000,
  21058. + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
  21059. + /* device_init */ board_au1200fb_focus_init_component,
  21060. + /* device_shutdown */ board_au1200fb_focus_shutdown,
  21061. + },
  21062. +
  21063. + { /* Index 11: Focus FS453 TV-Out 640x480 */
  21064. + "FS453_640x480 (HDTV)",
  21065. + 720, 480,
  21066. + /* mode_screen */ LCD_SCREEN_SX_N(720) | LCD_SCREEN_SY_N(480),
  21067. + /* mode_horztiming */ LCD_HORZTIMING_HND2_N(28) | LCD_HORZTIMING_HND1_N(46) | LCD_HORZTIMING_HPW_N(64),
  21068. + /* mode_verttiming */ LCD_VERTTIMING_VND2_N(7) | LCD_VERTTIMING_VND1_N(31) | LCD_VERTTIMING_VPW_N(7),
  21069. + /* mode_clkcontrol */ 0x00480000 | (1<<17) | (1<<18), /* External Clock, 1:1 clock ratio */
  21070. + /* mode_pwmdiv */ 0x00000000,
  21071. + /* mode_pwmhi */ 0x00000000,
  21072. + /* mode_outmask */ 0x00FFFFFF,
  21073. + /* mode_fifoctrl */ 0x2f2f2f2f,
  21074. + /* mode_toyclksrc */ 0x00000000,
  21075. + /* mode_backlight */ 0x00000000,
  21076. + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
  21077. + /* device_init */ board_au1200fb_focus_init_hdtv,
  21078. + /* device_shutdown */ board_au1200fb_focus_shutdown,
  21079. + },
  21080. +#endif
  21081. +};
  21082. +
  21083. +#define NUM_PANELS (sizeof(panels) / sizeof(struct panel_settings))
  21084. +
  21085. +static struct window_settings *win;
  21086. +static struct panel_settings *panel;
  21087. +
  21088. +struct au1200fb_info {
  21089. + struct fb_info_gen gen;
  21090. + unsigned long fb_virt_start;
  21091. + unsigned long fb_size;
  21092. + unsigned long fb_phys;
  21093. + int mmaped;
  21094. + int nohwcursor;
  21095. + int noblanking;
  21096. +
  21097. + struct { unsigned red, green, blue, pad; } palette[256];
  21098. +
  21099. +#if defined(FBCON_HAS_CFB16)
  21100. + u16 fbcon_cmap16[16];
  21101. +#endif
  21102. +#if defined(FBCON_HAS_CFB32)
  21103. + u32 fbcon_cmap32[16];
  21104. +#endif
  21105. +};
  21106. +
  21107. +
  21108. +struct au1200fb_par {
  21109. + struct fb_var_screeninfo var;
  21110. +
  21111. + int line_length; /* in bytes */
  21112. + int cmap_len; /* color-map length */
  21113. +};
  21114. +
  21115. +#ifndef CONFIG_FB_AU1200_DEVS
  21116. +#define CONFIG_FB_AU1200_DEVS 1
  21117. +#endif
  21118. +
  21119. +static struct au1200fb_info fb_infos[CONFIG_FB_AU1200_DEVS];
  21120. +static struct au1200fb_par fb_pars[CONFIG_FB_AU1200_DEVS];
  21121. +static struct display disps[CONFIG_FB_AU1200_DEVS];
  21122. +
  21123. +int au1200fb_init(void);
  21124. +void au1200fb_setup(char *options, int *ints);
  21125. +static int au1200fb_mmap(struct fb_info *fb, struct file *file,
  21126. + struct vm_area_struct *vma);
  21127. +static int au1200_blank(int blank_mode, struct fb_info_gen *info);
  21128. +static int au1200fb_ioctl(struct inode *inode, struct file *file, u_int cmd,
  21129. + u_long arg, int con, struct fb_info *info);
  21130. +
  21131. +void au1200_nocursor(struct display *p, int mode, int xx, int yy){};
  21132. +
  21133. +static int au1200_setlocation (int plane, int xpos, int ypos);
  21134. +static int au1200_setsize (int plane, int xres, int yres);
  21135. +static void au1200_setmode(int plane);
  21136. +static void au1200_setpanel (struct panel_settings *newpanel);
  21137. +
  21138. +static struct fb_ops au1200fb_ops = {
  21139. + owner: THIS_MODULE,
  21140. + fb_get_fix: fbgen_get_fix,
  21141. + fb_get_var: fbgen_get_var,
  21142. + fb_set_var: fbgen_set_var,
  21143. + fb_get_cmap: fbgen_get_cmap,
  21144. + fb_set_cmap: fbgen_set_cmap,
  21145. + fb_pan_display: fbgen_pan_display,
  21146. + fb_ioctl: au1200fb_ioctl,
  21147. + fb_mmap: au1200fb_mmap,
  21148. +};
  21149. +
  21150. +
  21151. +static int
  21152. +winbpp (unsigned int winctrl1)
  21153. +{
  21154. + /* how many bytes of memory are needed for each pixel format */
  21155. + switch (winctrl1 & LCD_WINCTRL1_FRM)
  21156. + {
  21157. + case LCD_WINCTRL1_FRM_1BPP: return 1; break;
  21158. + case LCD_WINCTRL1_FRM_2BPP: return 2; break;
  21159. + case LCD_WINCTRL1_FRM_4BPP: return 4; break;
  21160. + case LCD_WINCTRL1_FRM_8BPP: return 8; break;
  21161. + case LCD_WINCTRL1_FRM_12BPP: return 16; break;
  21162. + case LCD_WINCTRL1_FRM_16BPP655: return 16; break;
  21163. + case LCD_WINCTRL1_FRM_16BPP565: return 16; break;
  21164. + case LCD_WINCTRL1_FRM_16BPP556: return 16; break;
  21165. + case LCD_WINCTRL1_FRM_16BPPI1555: return 16; break;
  21166. + case LCD_WINCTRL1_FRM_16BPPI5551: return 16; break;
  21167. + case LCD_WINCTRL1_FRM_16BPPA1555: return 16; break;
  21168. + case LCD_WINCTRL1_FRM_16BPPA5551: return 16; break;
  21169. + case LCD_WINCTRL1_FRM_24BPP: return 32; break;
  21170. + case LCD_WINCTRL1_FRM_32BPP: return 32; break;
  21171. + default: return 0; break;
  21172. + }
  21173. +}
  21174. +
  21175. +static int
  21176. +fbinfo2index (struct fb_info *fb_info)
  21177. +{
  21178. + int i;
  21179. + for (i = 0; i < CONFIG_FB_AU1200_DEVS; ++i)
  21180. + {
  21181. + if (fb_info == (struct fb_info *)(&fb_infos[i]))
  21182. + return i;
  21183. + }
  21184. + printk("au1200fb: ERROR: fbinfo2index failed!\n");
  21185. + return -1;
  21186. +}
  21187. +
  21188. +static void au1200_detect(void)
  21189. +{
  21190. + /*
  21191. + * This function should detect the current video mode settings
  21192. + * and store it as the default video mode
  21193. + * Yeh, well, we're not going to change any settings so we're
  21194. + * always stuck with the default ...
  21195. + */
  21196. +}
  21197. +
  21198. +static int au1200_encode_fix(struct fb_fix_screeninfo *fix,
  21199. + const void *_par, struct fb_info_gen *_info)
  21200. +{
  21201. + struct au1200fb_info *info = (struct au1200fb_info *) _info;
  21202. + struct au1200fb_par *par = (struct au1200fb_par *) _par;
  21203. + int plane;
  21204. +
  21205. + plane = fbinfo2index(info);
  21206. +
  21207. + memset(fix, 0, sizeof(struct fb_fix_screeninfo));
  21208. +
  21209. + fix->smem_start = info->fb_phys;
  21210. + fix->smem_len = info->fb_size;
  21211. + fix->type = FB_TYPE_PACKED_PIXELS;
  21212. + fix->type_aux = 0;
  21213. + fix->visual = (par->var.bits_per_pixel == 8) ?
  21214. + FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
  21215. + fix->ywrapstep = 0;
  21216. + fix->xpanstep = 1;
  21217. + fix->ypanstep = 1;
  21218. + /* FIX!!!! why doesn't par->line_length work???? it does for au1100 */
  21219. + fix->line_length = fb_pars[plane].line_length; /*par->line_length;*/
  21220. + return 0;
  21221. +}
  21222. +
  21223. +static void set_color_bitfields(struct fb_var_screeninfo *var, int plane)
  21224. +{
  21225. + if (var->bits_per_pixel == 8)
  21226. + {
  21227. + var->red.offset = 0;
  21228. + var->red.length = 8;
  21229. + var->green.offset = 0;
  21230. + var->green.length = 8;
  21231. + var->blue.offset = 0;
  21232. + var->blue.length = 8;
  21233. + var->transp.offset = 0;
  21234. + var->transp.length = 0;
  21235. + }
  21236. + else
  21237. +
  21238. + if (var->bits_per_pixel == 16)
  21239. + {
  21240. + /* FIX!!! How does CCO affect this ? */
  21241. + /* FIX!!! Not exactly sure how many of these work with FB */
  21242. + switch (win->w[plane].mode_winctrl1 & LCD_WINCTRL1_FRM)
  21243. + {
  21244. + case LCD_WINCTRL1_FRM_16BPP655:
  21245. + var->red.offset = 10;
  21246. + var->red.length = 6;
  21247. + var->green.offset = 5;
  21248. + var->green.length = 5;
  21249. + var->blue.offset = 0;
  21250. + var->blue.length = 5;
  21251. + var->transp.offset = 0;
  21252. + var->transp.length = 0;
  21253. + break;
  21254. +
  21255. + case LCD_WINCTRL1_FRM_16BPP565:
  21256. + var->red.offset = 11;
  21257. + var->red.length = 5;
  21258. + var->green.offset = 5;
  21259. + var->green.length = 6;
  21260. + var->blue.offset = 0;
  21261. + var->blue.length = 5;
  21262. + var->transp.offset = 0;
  21263. + var->transp.length = 0;
  21264. + break;
  21265. +
  21266. + case LCD_WINCTRL1_FRM_16BPP556:
  21267. + var->red.offset = 11;
  21268. + var->red.length = 5;
  21269. + var->green.offset = 6;
  21270. + var->green.length = 5;
  21271. + var->blue.offset = 0;
  21272. + var->blue.length = 6;
  21273. + var->transp.offset = 0;
  21274. + var->transp.length = 0;
  21275. + break;
  21276. +
  21277. + case LCD_WINCTRL1_FRM_16BPPI1555:
  21278. + var->red.offset = 10;
  21279. + var->red.length = 5;
  21280. + var->green.offset = 5;
  21281. + var->green.length = 5;
  21282. + var->blue.offset = 0;
  21283. + var->blue.length = 5;
  21284. + var->transp.offset = 0;
  21285. + var->transp.length = 0;
  21286. + break;
  21287. +
  21288. + case LCD_WINCTRL1_FRM_16BPPI5551:
  21289. + var->red.offset = 11;
  21290. + var->red.length = 5;
  21291. + var->green.offset = 6;
  21292. + var->green.length = 5;
  21293. + var->blue.offset = 1;
  21294. + var->blue.length = 5;
  21295. + var->transp.offset = 0;
  21296. + var->transp.length = 0;
  21297. + break;
  21298. +
  21299. + case LCD_WINCTRL1_FRM_16BPPA1555:
  21300. + var->red.offset = 10;
  21301. + var->red.length = 5;
  21302. + var->green.offset = 5;
  21303. + var->green.length = 5;
  21304. + var->blue.offset = 0;
  21305. + var->blue.length = 5;
  21306. + var->transp.offset = 15;
  21307. + var->transp.length = 1;
  21308. + break;
  21309. +
  21310. + case LCD_WINCTRL1_FRM_16BPPA5551:
  21311. + var->red.offset = 11;
  21312. + var->red.length = 5;
  21313. + var->green.offset = 6;
  21314. + var->green.length = 5;
  21315. + var->blue.offset = 1;
  21316. + var->blue.length = 5;
  21317. + var->transp.offset = 0;
  21318. + var->transp.length = 1;
  21319. + break;
  21320. +
  21321. + default:
  21322. + printk("ERROR: Invalid PIXEL FORMAT!!!\n"); break;
  21323. + }
  21324. + }
  21325. + else
  21326. +
  21327. + if (var->bits_per_pixel == 32)
  21328. + {
  21329. + switch (win->w[plane].mode_winctrl1 & LCD_WINCTRL1_FRM)
  21330. + {
  21331. + case LCD_WINCTRL1_FRM_24BPP:
  21332. + var->red.offset = 16;
  21333. + var->red.length = 8;
  21334. + var->green.offset = 8;
  21335. + var->green.length = 8;
  21336. + var->blue.offset = 0;
  21337. + var->blue.length = 8;
  21338. + var->transp.offset = 0;
  21339. + var->transp.length = 0;
  21340. + break;
  21341. +
  21342. + case LCD_WINCTRL1_FRM_32BPP:
  21343. + var->red.offset = 16;
  21344. + var->red.length = 8;
  21345. + var->green.offset = 8;
  21346. + var->green.length = 8;
  21347. + var->blue.offset = 0;
  21348. + var->blue.length = 8;
  21349. + var->transp.offset = 24;
  21350. + var->transp.length = 8;
  21351. + break;
  21352. + }
  21353. + }
  21354. + var->red.msb_right = 0;
  21355. + var->green.msb_right = 0;
  21356. + var->blue.msb_right = 0;
  21357. + var->transp.msb_right = 0;
  21358. +#if 0
  21359. +printk("set_color_bitfields(a=%d, r=%d..%d, g=%d..%d, b=%d..%d)\n",
  21360. + var->transp.offset,
  21361. + var->red.offset+var->red.length-1, var->red.offset,
  21362. + var->green.offset+var->green.length-1, var->green.offset,
  21363. + var->blue.offset+var->blue.length-1, var->blue.offset);
  21364. +#endif
  21365. +}
  21366. +
  21367. +static int au1200_decode_var(const struct fb_var_screeninfo *var,
  21368. + void *_par, struct fb_info_gen *_info)
  21369. +{
  21370. + struct au1200fb_par *par = (struct au1200fb_par *)_par;
  21371. + int plane, bpp;
  21372. +
  21373. + plane = fbinfo2index((struct fb_info *)_info);
  21374. +
  21375. + /*
  21376. + * Don't allow setting any of these yet: xres and yres don't
  21377. + * make sense for LCD panels.
  21378. + */
  21379. + if (var->xres != win->w[plane].xres ||
  21380. + var->yres != win->w[plane].yres ||
  21381. + var->xres != win->w[plane].xres ||
  21382. + var->yres != win->w[plane].yres) {
  21383. + return -EINVAL;
  21384. + }
  21385. +
  21386. + bpp = winbpp(win->w[plane].mode_winctrl1);
  21387. + if(var->bits_per_pixel != bpp) {
  21388. + /* on au1200, window pixel format is independent of panel pixel */
  21389. + printk("WARNING: bits_per_pizel != panel->bpp\n");
  21390. + }
  21391. +
  21392. + memset(par, 0, sizeof(struct au1200fb_par));
  21393. + par->var = *var;
  21394. +
  21395. + /* FIX!!! */
  21396. + switch (var->bits_per_pixel) {
  21397. + case 8:
  21398. + par->var.bits_per_pixel = 8;
  21399. + break;
  21400. + case 16:
  21401. + par->var.bits_per_pixel = 16;
  21402. + break;
  21403. + case 24:
  21404. + case 32:
  21405. + par->var.bits_per_pixel = 32;
  21406. + break;
  21407. + default:
  21408. + printk("color depth %d bpp not supported\n",
  21409. + var->bits_per_pixel);
  21410. + return -EINVAL;
  21411. +
  21412. + }
  21413. + set_color_bitfields(&par->var, plane);
  21414. + /* FIX!!! what is this for 24/32bpp? */
  21415. + par->cmap_len = (par->var.bits_per_pixel == 8) ? 256 : 16;
  21416. + return 0;
  21417. +}
  21418. +
  21419. +static int au1200_encode_var(struct fb_var_screeninfo *var,
  21420. + const void *par, struct fb_info_gen *_info)
  21421. +{
  21422. + *var = ((struct au1200fb_par *)par)->var;
  21423. + return 0;
  21424. +}
  21425. +
  21426. +static void
  21427. +au1200_get_par(void *_par, struct fb_info_gen *_info)
  21428. +{
  21429. + int index;
  21430. +
  21431. + index = fbinfo2index((struct fb_info *)_info);
  21432. + *(struct au1200fb_par *)_par = fb_pars[index];
  21433. +}
  21434. +
  21435. +static void au1200_set_par(const void *par, struct fb_info_gen *info)
  21436. +{
  21437. + /* nothing to do: we don't change any settings */
  21438. +}
  21439. +
  21440. +static int au1200_getcolreg(unsigned regno, unsigned *red, unsigned *green,
  21441. + unsigned *blue, unsigned *transp,
  21442. + struct fb_info *info)
  21443. +{
  21444. + struct au1200fb_info* i = (struct au1200fb_info*)info;
  21445. +
  21446. + if (regno > 255)
  21447. + return 1;
  21448. +
  21449. + *red = i->palette[regno].red;
  21450. + *green = i->palette[regno].green;
  21451. + *blue = i->palette[regno].blue;
  21452. + *transp = 0;
  21453. +
  21454. + return 0;
  21455. +}
  21456. +
  21457. +static int au1200_setcolreg(unsigned regno, unsigned red, unsigned green,
  21458. + unsigned blue, unsigned transp,
  21459. + struct fb_info *info)
  21460. +{
  21461. + struct au1200fb_info* i = (struct au1200fb_info *)info;
  21462. + u32 rgbcol;
  21463. + int plane, bpp;
  21464. +
  21465. + plane = fbinfo2index((struct fb_info *)info);
  21466. + bpp = winbpp(win->w[plane].mode_winctrl1);
  21467. +
  21468. + if (regno > 255)
  21469. + return 1;
  21470. +
  21471. + i->palette[regno].red = red;
  21472. + i->palette[regno].green = green;
  21473. + i->palette[regno].blue = blue;
  21474. +
  21475. + switch(bpp) {
  21476. +#ifdef FBCON_HAS_CFB8
  21477. + case 8:
  21478. + red >>= 10;
  21479. + green >>= 10;
  21480. + blue >>= 10;
  21481. + panel_reg->lcd_pallettebase[regno] = (blue&0x1f) |
  21482. + ((green&0x3f)<<5) | ((red&0x1f)<<11);
  21483. + break;
  21484. +#endif
  21485. +#ifdef FBCON_HAS_CFB16
  21486. +/* FIX!!!! depends upon pixel format */
  21487. + case 16:
  21488. + i->fbcon_cmap16[regno] =
  21489. + ((red & 0xf800) >> 0) |
  21490. + ((green & 0xfc00) >> 5) |
  21491. + ((blue & 0xf800) >> 11);
  21492. + break;
  21493. +#endif
  21494. +#ifdef FBCON_HAS_CFB32
  21495. + case 32:
  21496. + i->fbcon_cmap32[regno] =
  21497. + (((u32 )transp & 0xff00) << 16) |
  21498. + (((u32 )red & 0xff00) << 8) |
  21499. + (((u32 )green & 0xff00)) |
  21500. + (((u32 )blue & 0xff00) >> 8);
  21501. + break;
  21502. +#endif
  21503. + default:
  21504. + printk("unsupported au1200_setcolreg(%d)\n", bpp);
  21505. + break;
  21506. + }
  21507. +
  21508. + return 0;
  21509. +}
  21510. +
  21511. +
  21512. +static int au1200_blank(int blank_mode, struct fb_info_gen *_info)
  21513. +{
  21514. + struct au1200fb_info *fb_info = (struct au1200fb_info *)_info;
  21515. + int plane;
  21516. +
  21517. + /* Short-circuit screen blanking */
  21518. + if (fb_info->noblanking)
  21519. + return 0;
  21520. +
  21521. + plane = fbinfo2index((struct fb_info *)_info);
  21522. +
  21523. + switch (blank_mode) {
  21524. + case VESA_NO_BLANKING:
  21525. + /* printk("turn on panel\n"); */
  21526. + au1200_setpanel(panel);
  21527. + break;
  21528. +
  21529. + case VESA_VSYNC_SUSPEND:
  21530. + case VESA_HSYNC_SUSPEND:
  21531. + case VESA_POWERDOWN:
  21532. + /* printk("turn off panel\n"); */
  21533. + au1200_setpanel(NULL);
  21534. + break;
  21535. + default:
  21536. + break;
  21537. +
  21538. + }
  21539. + return 0;
  21540. +}
  21541. +
  21542. +static void au1200_set_disp(const void *unused, struct display *disp,
  21543. + struct fb_info_gen *info)
  21544. +{
  21545. + struct au1200fb_info *fb_info;
  21546. + int plane;
  21547. +
  21548. + fb_info = (struct au1200fb_info *)info;
  21549. +
  21550. + disp->screen_base = (char *)fb_info->fb_virt_start;
  21551. +
  21552. + switch (disp->var.bits_per_pixel) {
  21553. +#ifdef FBCON_HAS_CFB8
  21554. + case 8:
  21555. + disp->dispsw = &fbcon_cfb8;
  21556. + if (fb_info->nohwcursor)
  21557. + fbcon_cfb8.cursor = au1200_nocursor;
  21558. + break;
  21559. +#endif
  21560. +#ifdef FBCON_HAS_CFB16
  21561. + case 16:
  21562. + disp->dispsw = &fbcon_cfb16;
  21563. + disp->dispsw_data = fb_info->fbcon_cmap16;
  21564. + if (fb_info->nohwcursor)
  21565. + fbcon_cfb16.cursor = au1200_nocursor;
  21566. + break;
  21567. +#endif
  21568. +#ifdef FBCON_HAS_CFB32
  21569. + case 32:
  21570. + disp->dispsw = &fbcon_cfb32;
  21571. + disp->dispsw_data = fb_info->fbcon_cmap32;
  21572. + if (fb_info->nohwcursor)
  21573. + fbcon_cfb32.cursor = au1200_nocursor;
  21574. + break;
  21575. +#endif
  21576. + default:
  21577. + disp->dispsw = &fbcon_dummy;
  21578. + disp->dispsw_data = NULL;
  21579. + break;
  21580. + }
  21581. +}
  21582. +
  21583. +static int
  21584. +au1200fb_mmap(struct fb_info *_fb,
  21585. + struct file *file,
  21586. + struct vm_area_struct *vma)
  21587. +{
  21588. + unsigned int len;
  21589. + unsigned long start=0, off;
  21590. +
  21591. + struct au1200fb_info *fb_info = (struct au1200fb_info *)_fb;
  21592. +
  21593. + if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) {
  21594. + return -EINVAL;
  21595. + }
  21596. +
  21597. + start = fb_info->fb_phys & PAGE_MASK;
  21598. + len = PAGE_ALIGN((start & ~PAGE_MASK) + fb_info->fb_size);
  21599. +
  21600. + off = vma->vm_pgoff << PAGE_SHIFT;
  21601. +
  21602. + if ((vma->vm_end - vma->vm_start + off) > len) {
  21603. + return -EINVAL;
  21604. + }
  21605. +
  21606. + off += start;
  21607. + vma->vm_pgoff = off >> PAGE_SHIFT;
  21608. +
  21609. + pgprot_val(vma->vm_page_prot) &= ~_CACHE_MASK;
  21610. + pgprot_val(vma->vm_page_prot) |= _CACHE_UNCACHED;
  21611. +
  21612. + /* This is an IO map - tell maydump to skip this VMA */
  21613. + vma->vm_flags |= VM_IO;
  21614. +
  21615. + if (io_remap_page_range(vma->vm_start, off,
  21616. + vma->vm_end - vma->vm_start,
  21617. + vma->vm_page_prot)) {
  21618. + return -EAGAIN;
  21619. + }
  21620. +
  21621. + fb_info->mmaped = 1;
  21622. + return 0;
  21623. +}
  21624. +
  21625. +int au1200_pan_display(const struct fb_var_screeninfo *var,
  21626. + struct fb_info_gen *info)
  21627. +{
  21628. + return 0;
  21629. +}
  21630. +
  21631. +
  21632. +static int au1200fb_ioctl(struct inode *inode, struct file *file, u_int cmd,
  21633. + u_long arg, int con, struct fb_info *info)
  21634. +{
  21635. + int plane;
  21636. +
  21637. + plane = fbinfo2index(info);
  21638. +
  21639. + /* printk("au1200fb: ioctl %d on plane %d\n", cmd, plane); */
  21640. +
  21641. + if (cmd == 0x46FF)
  21642. + {
  21643. + au1200_lcd_getset_t iodata;
  21644. +
  21645. + if (copy_from_user(&iodata, (void *) arg, sizeof(au1200_lcd_getset_t)))
  21646. + return -EFAULT;
  21647. +
  21648. + switch (iodata.subcmd)
  21649. + {
  21650. + case AU1200_LCD_GET_WINENABLE:
  21651. + iodata.winenable.enable = (lcd->winenable & (1<<plane)) ? 1 : 0;
  21652. + break;
  21653. + case AU1200_LCD_SET_WINENABLE:
  21654. + {
  21655. + u32 winenable;
  21656. + winenable = lcd->winenable;
  21657. + winenable &= ~(1<<plane);
  21658. + winenable |= (iodata.winenable.enable) ? (1<<plane) : 0;
  21659. + lcd->winenable = winenable;
  21660. + }
  21661. + break;
  21662. + case AU1200_LCD_GET_WINLOCATION:
  21663. + iodata.winlocation.x =
  21664. + (lcd->window[plane].winctrl0 & LCD_WINCTRL0_OX) >> 21;
  21665. + iodata.winlocation.y =
  21666. + (lcd->window[plane].winctrl0 & LCD_WINCTRL0_OY) >> 10;
  21667. + break;
  21668. + case AU1200_LCD_SET_WINLOCATION:
  21669. + au1200_setlocation(plane, iodata.winlocation.x, iodata.winlocation.y);
  21670. + break;
  21671. + case AU1200_LCD_GET_WINSIZE:
  21672. + iodata.winsize.hsz =
  21673. + (lcd->window[plane].winctrl1 & LCD_WINCTRL1_SZX) >> 11;
  21674. + iodata.winsize.vsz =
  21675. + (lcd->window[plane].winctrl0 & LCD_WINCTRL1_SZY) >> 0;
  21676. + break;
  21677. + case AU1200_LCD_SET_WINSIZE:
  21678. + au1200_setsize(plane, iodata.winsize.hsz, iodata.winsize.vsz);
  21679. + break;
  21680. + case AU1200_LCD_GET_BACKCOLOR:
  21681. + iodata.backcolor.color = lcd->backcolor;
  21682. + break;
  21683. + case AU1200_LCD_SET_BACKCOLOR:
  21684. + lcd->backcolor = iodata.backcolor.color;
  21685. + break;
  21686. + case AU1200_LCD_GET_COLORKEY:
  21687. + iodata.colorkey.key = lcd->colorkey;
  21688. + iodata.colorkey.mask = lcd->colorkeymsk;
  21689. + break;
  21690. + case AU1200_LCD_SET_COLORKEY:
  21691. + lcd->colorkey = iodata.colorkey.key;
  21692. + lcd->colorkeymsk = iodata.colorkey.mask;
  21693. + break;
  21694. + case AU1200_LCD_GET_PANEL:
  21695. + iodata.panel.panel = panel_index;
  21696. + break;
  21697. + case AU1200_LCD_SET_PANEL:
  21698. + if ((iodata.panel.panel >= 0) && (iodata.panel.panel < NUM_PANELS))
  21699. + {
  21700. + struct panel_settings *newpanel;
  21701. + panel_index = iodata.panel.panel;
  21702. + newpanel = &panels[panel_index];
  21703. + au1200_setpanel(newpanel);
  21704. + }
  21705. + break;
  21706. + }
  21707. +
  21708. + return copy_to_user((void *) arg, &iodata, sizeof(au1200_lcd_getset_t)) ? -EFAULT : 0;
  21709. + }
  21710. +
  21711. + return -EINVAL;
  21712. +}
  21713. +
  21714. +static struct fbgen_hwswitch au1200_switch = {
  21715. + au1200_detect,
  21716. + au1200_encode_fix,
  21717. + au1200_decode_var,
  21718. + au1200_encode_var,
  21719. + au1200_get_par,
  21720. + au1200_set_par,
  21721. + au1200_getcolreg,
  21722. + au1200_setcolreg,
  21723. + au1200_pan_display,
  21724. + au1200_blank,
  21725. + au1200_set_disp
  21726. +};
  21727. +
  21728. +static void au1200_setpanel (struct panel_settings *newpanel)
  21729. +{
  21730. + /*
  21731. + * Perform global setup/init of LCD controller
  21732. + */
  21733. + uint32 winenable;
  21734. +
  21735. + /* Make sure all windows disabled */
  21736. + winenable = lcd->winenable;
  21737. + lcd->winenable = 0;
  21738. +
  21739. + /*
  21740. + * Ensure everything is disabled before reconfiguring
  21741. + */
  21742. + if (lcd->screen & LCD_SCREEN_SEN)
  21743. + {
  21744. + /* Wait for vertical sync period */
  21745. + lcd->intstatus = LCD_INT_SS;
  21746. + while ((lcd->intstatus & LCD_INT_SS) == 0)
  21747. + ;
  21748. +
  21749. + lcd->screen &= ~LCD_SCREEN_SEN; /*disable the controller*/
  21750. +
  21751. + do
  21752. + {
  21753. + lcd->intstatus = lcd->intstatus; /*clear interrupts*/
  21754. + }
  21755. + /*wait for controller to shut down*/
  21756. + while ((lcd->intstatus & LCD_INT_SD) == 0);
  21757. +
  21758. + /* Call shutdown of current panel (if up) */
  21759. + /* this must occur last, because if an external clock is driving
  21760. + the controller, the clock cannot be turned off before first
  21761. + shutting down the controller.
  21762. + */
  21763. + if (panel->device_shutdown != NULL) panel->device_shutdown();
  21764. + }
  21765. +
  21766. + /* Check if only needing to turn off panel */
  21767. + if (panel == NULL) return;
  21768. +
  21769. + panel = newpanel;
  21770. +
  21771. + printk("Panel(%s), %dx%d\n", panel->name, panel->Xres, panel->Yres);
  21772. +
  21773. + /*
  21774. + * Setup clocking if internal LCD clock source (assumes sys_auxpll valid)
  21775. + */
  21776. + if (!(panel->mode_clkcontrol & LCD_CLKCONTROL_EXT))
  21777. + {
  21778. + uint32 sys_clksrc;
  21779. + /* WARNING! This should really be a check since other peripherals can
  21780. + be affected by changins sys_auxpll */
  21781. + au_writel(panel->mode_auxpll, SYS_AUXPLL);
  21782. + sys_clksrc = au_readl(SYS_CLKSRC) & ~0x0000001f;
  21783. + sys_clksrc |= panel->mode_toyclksrc;
  21784. + au_writel(sys_clksrc, SYS_CLKSRC);
  21785. + }
  21786. +
  21787. + /*
  21788. + * Configure panel timings
  21789. + */
  21790. + lcd->screen = panel->mode_screen;
  21791. + lcd->horztiming = panel->mode_horztiming;
  21792. + lcd->verttiming = panel->mode_verttiming;
  21793. + lcd->clkcontrol = panel->mode_clkcontrol;
  21794. + lcd->pwmdiv = panel->mode_pwmdiv;
  21795. + lcd->pwmhi = panel->mode_pwmhi;
  21796. + lcd->outmask = panel->mode_outmask;
  21797. + lcd->fifoctrl = panel->mode_fifoctrl;
  21798. + au_sync();
  21799. +
  21800. + /* FIX!!! Check window settings to make sure still valid for new geometry */
  21801. + au1200_setlocation(0, win->w[0].xpos, win->w[0].ypos);
  21802. + au1200_setlocation(1, win->w[1].xpos, win->w[1].ypos);
  21803. + au1200_setlocation(2, win->w[2].xpos, win->w[2].ypos);
  21804. + au1200_setlocation(3, win->w[3].xpos, win->w[3].ypos);
  21805. + lcd->winenable = winenable;
  21806. +
  21807. + /*
  21808. + * Re-enable screen now that it is configured
  21809. + */
  21810. + lcd->screen |= LCD_SCREEN_SEN;
  21811. + au_sync();
  21812. +
  21813. + /* Call init of panel */
  21814. + if (panel->device_init != NULL) panel->device_init();
  21815. +
  21816. +#if 0
  21817. +#define D(X) printk("%25s: %08X\n", #X, X)
  21818. + D(lcd->screen);
  21819. + D(lcd->horztiming);
  21820. + D(lcd->verttiming);
  21821. + D(lcd->clkcontrol);
  21822. + D(lcd->pwmdiv);
  21823. + D(lcd->pwmhi);
  21824. + D(lcd->outmask);
  21825. + D(lcd->fifoctrl);
  21826. + D(lcd->window[0].winctrl0);
  21827. + D(lcd->window[0].winctrl1);
  21828. + D(lcd->window[0].winctrl2);
  21829. + D(lcd->window[0].winbuf0);
  21830. + D(lcd->window[0].winbuf1);
  21831. + D(lcd->window[0].winbufctrl);
  21832. + D(lcd->window[1].winctrl0);
  21833. + D(lcd->window[1].winctrl1);
  21834. + D(lcd->window[1].winctrl2);
  21835. + D(lcd->window[1].winbuf0);
  21836. + D(lcd->window[1].winbuf1);
  21837. + D(lcd->window[1].winbufctrl);
  21838. + D(lcd->window[2].winctrl0);
  21839. + D(lcd->window[2].winctrl1);
  21840. + D(lcd->window[2].winctrl2);
  21841. + D(lcd->window[2].winbuf0);
  21842. + D(lcd->window[2].winbuf1);
  21843. + D(lcd->window[2].winbufctrl);
  21844. + D(lcd->window[3].winctrl0);
  21845. + D(lcd->window[3].winctrl1);
  21846. + D(lcd->window[3].winctrl2);
  21847. + D(lcd->window[3].winbuf0);
  21848. + D(lcd->window[3].winbuf1);
  21849. + D(lcd->window[3].winbufctrl);
  21850. + D(lcd->winenable);
  21851. + D(lcd->intenable);
  21852. + D(lcd->intstatus);
  21853. + D(lcd->backcolor);
  21854. + D(lcd->winenable);
  21855. + D(lcd->colorkey);
  21856. + D(lcd->colorkeymsk);
  21857. + D(lcd->hwc.cursorctrl);
  21858. + D(lcd->hwc.cursorpos);
  21859. + D(lcd->hwc.cursorcolor0);
  21860. + D(lcd->hwc.cursorcolor1);
  21861. + D(lcd->hwc.cursorcolor2);
  21862. + D(lcd->hwc.cursorcolor3);
  21863. +#endif
  21864. +}
  21865. +
  21866. +static int au1200_setsize (int plane, int xres, int yres)
  21867. +{
  21868. +#if 0
  21869. + uint32 winctrl0, winctrl1, winenable;
  21870. + int xsz, ysz;
  21871. +
  21872. + /* FIX!!! X*Y can not surpass allocated memory */
  21873. +
  21874. + printk("setsize: x %d y %d\n", xres, yres);
  21875. + winctrl1 = lcd->window[plane].winctrl1;
  21876. + printk("org winctrl1 %08X\n", winctrl1);
  21877. + winctrl1 &= ~(LCD_WINCTRL1_SZX | LCD_WINCTRL1_SZY);
  21878. +
  21879. + xres -= 1;
  21880. + yres -= 1;
  21881. + winctrl1 |= (xres << 11);
  21882. + winctrl1 |= (yres << 0);
  21883. +
  21884. + printk("new winctrl1 %08X\n", winctrl1);
  21885. +
  21886. + /*winenable = lcd->winenable & (1 << plane); */
  21887. + /*lcd->winenable &= ~(1 << plane); */
  21888. + lcd->window[plane].winctrl1 = winctrl1;
  21889. + /*lcd->winenable |= winenable; */
  21890. +#endif
  21891. + return 0;
  21892. +}
  21893. +
  21894. +static int au1200_setlocation (int plane, int xpos, int ypos)
  21895. +{
  21896. + uint32 winctrl0, winctrl1, winenable, fb_offset = 0;
  21897. + int xsz, ysz;
  21898. +
  21899. + /* FIX!!! NOT CHECKING FOR COMPLETE OFFSCREEN YET */
  21900. +
  21901. + winctrl0 = lcd->window[plane].winctrl0;
  21902. + winctrl1 = lcd->window[plane].winctrl1;
  21903. + winctrl0 &= (LCD_WINCTRL0_A | LCD_WINCTRL0_AEN);
  21904. + winctrl1 &= ~(LCD_WINCTRL1_SZX | LCD_WINCTRL1_SZY);
  21905. +
  21906. + /* Check for off-screen adjustments */
  21907. + xsz = win->w[plane].xres;
  21908. + ysz = win->w[plane].yres;
  21909. + if ((xpos + win->w[plane].xres) > panel->Xres)
  21910. + {
  21911. + /* Off-screen to the right */
  21912. + xsz = panel->Xres - xpos; /* off by 1 ??? */
  21913. + /*printk("off screen right\n");*/
  21914. + }
  21915. +
  21916. + if ((ypos + win->w[plane].yres) > panel->Yres)
  21917. + {
  21918. + /* Off-screen to the bottom */
  21919. + ysz = panel->Yres - ypos; /* off by 1 ??? */
  21920. + /*printk("off screen bottom\n");*/
  21921. + }
  21922. +
  21923. + if (xpos < 0)
  21924. + {
  21925. + /* Off-screen to the left */
  21926. + xsz = win->w[plane].xres + xpos;
  21927. + fb_offset += (((0 - xpos) * winbpp(lcd->window[plane].winctrl1))/8);
  21928. + xpos = 0;
  21929. + /*printk("off screen left\n");*/
  21930. + }
  21931. +
  21932. + if (ypos < 0)
  21933. + {
  21934. + /* Off-screen to the top */
  21935. + ysz = win->w[plane].yres + ypos;
  21936. + fb_offset += ((0 - ypos) * fb_pars[plane].line_length);
  21937. + ypos = 0;
  21938. + /*printk("off screen top\n");*/
  21939. + }
  21940. +
  21941. + /* record settings */
  21942. + win->w[plane].xpos = xpos;
  21943. + win->w[plane].ypos = ypos;
  21944. +
  21945. + xsz -= 1;
  21946. + ysz -= 1;
  21947. + winctrl0 |= (xpos << 21);
  21948. + winctrl0 |= (ypos << 10);
  21949. + winctrl1 |= (xsz << 11);
  21950. + winctrl1 |= (ysz << 0);
  21951. +
  21952. + /* Disable the window while making changes, then restore WINEN */
  21953. + winenable = lcd->winenable & (1 << plane);
  21954. + lcd->winenable &= ~(1 << plane);
  21955. + lcd->window[plane].winctrl0 = winctrl0;
  21956. + lcd->window[plane].winctrl1 = winctrl1;
  21957. + lcd->window[plane].winbuf0 =
  21958. + lcd->window[plane].winbuf1 = fb_infos[plane].fb_phys + fb_offset;
  21959. + lcd->window[plane].winbufctrl = 0; /* select winbuf0 */
  21960. + lcd->winenable |= winenable;
  21961. +
  21962. + return 0;
  21963. +}
  21964. +
  21965. +static void au1200_setmode(int plane)
  21966. +{
  21967. + /* Window/plane setup */
  21968. + lcd->window[plane].winctrl1 = ( 0
  21969. + | LCD_WINCTRL1_PRI_N(plane)
  21970. + | win->w[plane].mode_winctrl1 /* FRM,CCO,PO,PIPE */
  21971. + ) ;
  21972. +
  21973. + au1200_setlocation(plane, win->w[plane].xpos, win->w[plane].ypos);
  21974. +
  21975. + lcd->window[plane].winctrl2 = ( 0
  21976. + | LCD_WINCTRL2_CKMODE_00
  21977. + | LCD_WINCTRL2_DBM
  21978. +/* | LCD_WINCTRL2_RAM */
  21979. + | LCD_WINCTRL2_BX_N(fb_pars[plane].line_length)
  21980. + | LCD_WINCTRL2_SCX_1
  21981. + | LCD_WINCTRL2_SCY_1
  21982. + ) ;
  21983. + lcd->winenable |= win->w[plane].mode_winenable;
  21984. + au_sync();
  21985. +
  21986. +}
  21987. +
  21988. +static unsigned long
  21989. +au1200fb_alloc_fbmem (unsigned long size)
  21990. +{
  21991. + /* __get_free_pages() fulfills a max request of 2MB */
  21992. + /* do multiple requests to obtain large contigous mem */
  21993. +#define MAX_GFP 0x00200000
  21994. +
  21995. + unsigned long mem, amem, alloced = 0, allocsize;
  21996. +
  21997. + size += 0x1000;
  21998. + allocsize = (size < MAX_GFP) ? size : MAX_GFP;
  21999. +
  22000. + /* Get first chunk */
  22001. + mem = (unsigned long )
  22002. + __get_free_pages(GFP_ATOMIC | GFP_DMA, get_order(allocsize));
  22003. + if (mem != 0) alloced = allocsize;
  22004. +
  22005. + /* Get remaining, contiguous chunks */
  22006. + while (alloced < size)
  22007. + {
  22008. + amem = (unsigned long )
  22009. + __get_free_pages(GFP_ATOMIC | GFP_DMA, get_order(allocsize));
  22010. + if (amem != 0)
  22011. + alloced += allocsize;
  22012. +
  22013. + /* check for contiguous mem alloced */
  22014. + if ((amem == 0) || (amem + allocsize) != mem)
  22015. + break;
  22016. + else
  22017. + mem = amem;
  22018. + }
  22019. + return mem;
  22020. +}
  22021. +
  22022. +int __init au1200fb_init(void)
  22023. +{
  22024. + int num_panels = sizeof(panels)/sizeof(struct panel_settings);
  22025. + struct au1200fb_info *fb_info;
  22026. + struct display *disp;
  22027. + struct au1200fb_par *par;
  22028. + unsigned long page;
  22029. + int plane, bpp;
  22030. +
  22031. + /*
  22032. + * Get the panel information/display mode
  22033. + */
  22034. + if (panel_index < 0)
  22035. + panel_index = board_au1200fb_panel();
  22036. + if ((panel_index < 0) || (panel_index >= num_panels)) {
  22037. + printk("ERROR: INVALID PANEL %d\n", panel_index);
  22038. + return -EINVAL;
  22039. + }
  22040. + panel = &panels[panel_index];
  22041. + win = &windows[window_index];
  22042. +
  22043. + printk("au1200fb: Panel %d %s\n", panel_index, panel->name);
  22044. + printk("au1200fb: Win %d %s\n", window_index, win->name);
  22045. +
  22046. + /* Global setup/init */
  22047. + au1200_setpanel(panel);
  22048. + lcd->intenable = 0;
  22049. + lcd->intstatus = ~0;
  22050. + lcd->backcolor = win->mode_backcolor;
  22051. + lcd->winenable = 0;
  22052. +
  22053. + /* Setup Color Key - FIX!!! */
  22054. + lcd->colorkey = win->mode_colorkey;
  22055. + lcd->colorkeymsk = win->mode_colorkeymsk;
  22056. +
  22057. + /* Setup HWCursor - FIX!!! Need to support this eventually */
  22058. + lcd->hwc.cursorctrl = 0;
  22059. + lcd->hwc.cursorpos = 0;
  22060. + lcd->hwc.cursorcolor0 = 0;
  22061. + lcd->hwc.cursorcolor1 = 0;
  22062. + lcd->hwc.cursorcolor2 = 0;
  22063. + lcd->hwc.cursorcolor3 = 0;
  22064. +
  22065. + /* Register each plane as a frame buffer device */
  22066. + for (plane = 0; plane < CONFIG_FB_AU1200_DEVS; ++plane)
  22067. + {
  22068. + fb_info = &fb_infos[plane];
  22069. + disp = &disps[plane];
  22070. + par = &fb_pars[plane];
  22071. +
  22072. + bpp = winbpp(win->w[plane].mode_winctrl1);
  22073. + if (win->w[plane].xres == 0)
  22074. + win->w[plane].xres = panel->Xres;
  22075. + if (win->w[plane].yres == 0)
  22076. + win->w[plane].yres = panel->Yres;
  22077. +
  22078. + par->var.xres =
  22079. + par->var.xres_virtual = win->w[plane].xres;
  22080. + par->var.yres =
  22081. + par->var.yres_virtual = win->w[plane].yres;
  22082. + par->var.bits_per_pixel = bpp;
  22083. + par->line_length = win->w[plane].xres * bpp / 8; /* in bytes */
  22084. + /*
  22085. + * Allocate LCD framebuffer from system memory
  22086. + * Set page reserved so that mmap will work. This is necessary
  22087. + * since we'll be remapping normal memory.
  22088. + */
  22089. + fb_info->fb_size = (win->w[plane].xres * win->w[plane].yres * bpp) / 8;
  22090. + fb_info->fb_virt_start = au1200fb_alloc_fbmem(fb_info->fb_size);
  22091. + if (!fb_info->fb_virt_start) {
  22092. + printk("Unable to allocate fb memory\n");
  22093. + return -ENOMEM;
  22094. + }
  22095. + fb_info->fb_phys = virt_to_bus((void *)fb_info->fb_virt_start);
  22096. + for (page = fb_info->fb_virt_start;
  22097. + page < PAGE_ALIGN(fb_info->fb_virt_start + fb_info->fb_size);
  22098. + page += PAGE_SIZE) {
  22099. + SetPageReserved(virt_to_page(page));
  22100. + }
  22101. + /* Convert to kseg1 */
  22102. + fb_info->fb_virt_start =
  22103. + (void *)((u32)fb_info->fb_virt_start | 0xA0000000);
  22104. + /* FIX!!! may wish to avoid this to save startup time??? */
  22105. + memset((void *)fb_info->fb_virt_start, 0, fb_info->fb_size);
  22106. +
  22107. + fb_info->gen.parsize = sizeof(struct au1200fb_par);
  22108. + fb_info->gen.fbhw = &au1200_switch;
  22109. + strcpy(fb_info->gen.info.modename, "Au1200 LCD");
  22110. + fb_info->gen.info.changevar = NULL;
  22111. + fb_info->gen.info.node = -1;
  22112. +
  22113. + fb_info->gen.info.fbops = &au1200fb_ops;
  22114. + fb_info->gen.info.disp = disp;
  22115. + fb_info->gen.info.switch_con = &fbgen_switch;
  22116. + fb_info->gen.info.updatevar = &fbgen_update_var;
  22117. + fb_info->gen.info.blank = &fbgen_blank;
  22118. + fb_info->gen.info.flags = FBINFO_FLAG_DEFAULT;
  22119. +
  22120. + fb_info->nohwcursor = 1;
  22121. + fb_info->noblanking = 1;
  22122. +
  22123. + /* This should give a reasonable default video mode */
  22124. + fbgen_get_var(&disp->var, -1, &fb_info->gen.info);
  22125. + fbgen_do_set_var(&disp->var, 1, &fb_info->gen);
  22126. + fbgen_set_disp(-1, &fb_info->gen);
  22127. + fbgen_install_cmap(0, &fb_info->gen);
  22128. +
  22129. + /* Turn on plane */
  22130. + au1200_setmode(plane);
  22131. +
  22132. + if (register_framebuffer(&fb_info->gen.info) < 0)
  22133. + return -EINVAL;
  22134. +
  22135. + printk(KERN_INFO "fb%d: %s plane %d @ %08X (%d x %d x %d)\n",
  22136. + GET_FB_IDX(fb_info->gen.info.node),
  22137. + fb_info->gen.info.modename, plane, fb_info->fb_phys,
  22138. + win->w[plane].xres, win->w[plane].yres, bpp);
  22139. + }
  22140. + /* uncomment this if your driver cannot be unloaded */
  22141. + /* MOD_INC_USE_COUNT; */
  22142. + return 0;
  22143. +}
  22144. +
  22145. +void au1200fb_setup(char *options, int *ints)
  22146. +{
  22147. + char* this_opt;
  22148. + int i;
  22149. + int num_panels = sizeof(panels)/sizeof(struct panel_settings);
  22150. +
  22151. + if (!options || !*options)
  22152. + return;
  22153. +
  22154. + for(this_opt=strtok(options, ","); this_opt;
  22155. + this_opt=strtok(NULL, ",")) {
  22156. + if (!strncmp(this_opt, "panel:", 6)) {
  22157. + int i;
  22158. + long int li;
  22159. + char *endptr;
  22160. + this_opt += 6;
  22161. +
  22162. + /* Panel name can be name, "bs" for board-switch, or number/index */
  22163. + li = simple_strtol(this_opt, &endptr, 0);
  22164. + if (*endptr == '\0') {
  22165. + panel_index = (int)li;
  22166. + }
  22167. + else if (strcmp(this_opt, "bs") == 0) {
  22168. + panel_index = board_au1200fb_panel();
  22169. + }
  22170. + else
  22171. + for (i=0; i<num_panels; i++) {
  22172. + if (!strcmp(this_opt, panels[i].name)) {
  22173. + panel_index = i;
  22174. + break;
  22175. + }
  22176. + }
  22177. + }
  22178. + else if (!strncmp(this_opt, "nohwcursor", 10)) {
  22179. + printk("nohwcursor\n");
  22180. + fb_infos[0].nohwcursor = 1;
  22181. + }
  22182. + }
  22183. +
  22184. + printk("au1200fb: Panel %d %s\n", panel_index,
  22185. + panels[panel_index].name);
  22186. +}
  22187. +
  22188. +
  22189. +
  22190. +#ifdef MODULE
  22191. +MODULE_LICENSE("GPL");
  22192. +MODULE_DESCRIPTION("Au1200 LCD framebuffer driver");
  22193. +
  22194. +void au1200fb_cleanup(struct fb_info *info)
  22195. +{
  22196. + unregister_framebuffer(info);
  22197. +}
  22198. +
  22199. +module_init(au1200fb_init);
  22200. +module_exit(au1200fb_cleanup);
  22201. +#endif /* MODULE */
  22202. +
  22203. +
  22204. Index: linux-2.4.35.4/drivers/video/au1200fb.h
  22205. ===================================================================
  22206. --- /dev/null
  22207. +++ linux-2.4.35.4/drivers/video/au1200fb.h
  22208. @@ -0,0 +1,288 @@
  22209. +/*
  22210. + * BRIEF MODULE DESCRIPTION
  22211. + * Hardware definitions for the Au1200 LCD controller
  22212. + *
  22213. + * Copyright 2004 AMD
  22214. + * Author: AMD
  22215. + *
  22216. + * This program is free software; you can redistribute it and/or modify it
  22217. + * under the terms of the GNU General Public License as published by the
  22218. + * Free Software Foundation; either version 2 of the License, or (at your
  22219. + * option) any later version.
  22220. + *
  22221. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  22222. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  22223. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  22224. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  22225. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  22226. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  22227. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  22228. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22229. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  22230. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22231. + *
  22232. + * You should have received a copy of the GNU General Public License along
  22233. + * with this program; if not, write to the Free Software Foundation, Inc.,
  22234. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  22235. + */
  22236. +
  22237. +#ifndef _AU1200LCD_H
  22238. +#define _AU1200LCD_H
  22239. +
  22240. +/********************************************************************/
  22241. +#define AU1200_LCD_ADDR 0xB5000000
  22242. +
  22243. +#define uint8 unsigned char
  22244. +#define uint32 unsigned int
  22245. +
  22246. +typedef volatile struct
  22247. +{
  22248. + uint32 reserved0;
  22249. + uint32 screen;
  22250. + uint32 backcolor;
  22251. + uint32 horztiming;
  22252. + uint32 verttiming;
  22253. + uint32 clkcontrol;
  22254. + uint32 pwmdiv;
  22255. + uint32 pwmhi;
  22256. + uint32 reserved1;
  22257. + uint32 winenable;
  22258. + uint32 colorkey;
  22259. + uint32 colorkeymsk;
  22260. + struct
  22261. + {
  22262. + uint32 cursorctrl;
  22263. + uint32 cursorpos;
  22264. + uint32 cursorcolor0;
  22265. + uint32 cursorcolor1;
  22266. + uint32 cursorcolor2;
  22267. + uint32 cursorcolor3;
  22268. + } hwc;
  22269. + uint32 intstatus;
  22270. + uint32 intenable;
  22271. + uint32 outmask;
  22272. + uint32 fifoctrl;
  22273. + uint32 reserved2[(0x0100-0x0058)/4];
  22274. + struct
  22275. + {
  22276. + uint32 winctrl0;
  22277. + uint32 winctrl1;
  22278. + uint32 winctrl2;
  22279. + uint32 winbuf0;
  22280. + uint32 winbuf1;
  22281. + uint32 winbufctrl;
  22282. + uint32 winreserved0;
  22283. + uint32 winreserved1;
  22284. + } window[4];
  22285. +
  22286. + uint32 reserved3[(0x0400-0x0180)/4];
  22287. +
  22288. + uint32 palette[(0x0800-0x0400)/4];
  22289. +
  22290. + uint8 cursorpattern[256];
  22291. +
  22292. +} AU1200_LCD;
  22293. +
  22294. +/* lcd_screen */
  22295. +#define LCD_SCREEN_SEN (1<<31)
  22296. +#define LCD_SCREEN_SX (0x07FF<<19)
  22297. +#define LCD_SCREEN_SY (0x07FF<< 8)
  22298. +#define LCD_SCREEN_SWP (1<<7)
  22299. +#define LCD_SCREEN_SWD (1<<6)
  22300. +#define LCD_SCREEN_ST (7<<0)
  22301. +#define LCD_SCREEN_ST_TFT (0<<0)
  22302. +#define LCD_SCREEN_SX_N(WIDTH) ((WIDTH-1)<<19)
  22303. +#define LCD_SCREEN_SY_N(HEIGHT) ((HEIGHT-1)<<8)
  22304. +#define LCD_SCREEN_ST_CSTN (1<<0)
  22305. +#define LCD_SCREEN_ST_CDSTN (2<<0)
  22306. +#define LCD_SCREEN_ST_M8STN (3<<0)
  22307. +#define LCD_SCREEN_ST_M4STN (4<<0)
  22308. +
  22309. +/* lcd_backcolor */
  22310. +#define LCD_BACKCOLOR_SBGR (0xFF<<16)
  22311. +#define LCD_BACKCOLOR_SBGG (0xFF<<8)
  22312. +#define LCD_BACKCOLOR_SBGB (0xFF<<0)
  22313. +#define LCD_BACKCOLOR_SBGR_N(N) ((N)<<16)
  22314. +#define LCD_BACKCOLOR_SBGG_N(N) ((N)<<8)
  22315. +#define LCD_BACKCOLOR_SBGB_N(N) ((N)<<0)
  22316. +
  22317. +/* lcd_winenable */
  22318. +#define LCD_WINENABLE_WEN3 (1<<3)
  22319. +#define LCD_WINENABLE_WEN2 (1<<2)
  22320. +#define LCD_WINENABLE_WEN1 (1<<1)
  22321. +#define LCD_WINENABLE_WEN0 (1<<0)
  22322. +
  22323. +/* lcd_colorkey */
  22324. +#define LCD_COLORKEY_CKR (0xFF<<16)
  22325. +#define LCD_COLORKEY_CKG (0xFF<<8)
  22326. +#define LCD_COLORKEY_CKB (0xFF<<0)
  22327. +#define LCD_COLORKEY_CKR_N(N) ((N)<<16)
  22328. +#define LCD_COLORKEY_CKG_N(N) ((N)<<8)
  22329. +#define LCD_COLORKEY_CKB_N(N) ((N)<<0)
  22330. +
  22331. +/* lcd_colorkeymsk */
  22332. +#define LCD_COLORKEYMSK_CKMR (0xFF<<16)
  22333. +#define LCD_COLORKEYMSK_CKMG (0xFF<<8)
  22334. +#define LCD_COLORKEYMSK_CKMB (0xFF<<0)
  22335. +#define LCD_COLORKEYMSK_CKMR_N(N) ((N)<<16)
  22336. +#define LCD_COLORKEYMSK_CKMG_N(N) ((N)<<8)
  22337. +#define LCD_COLORKEYMSK_CKMB_N(N) ((N)<<0)
  22338. +
  22339. +/* lcd windows control 0 */
  22340. +#define LCD_WINCTRL0_OX (0x07FF<<21)
  22341. +#define LCD_WINCTRL0_OY (0x07FF<<10)
  22342. +#define LCD_WINCTRL0_A (0x00FF<<2)
  22343. +#define LCD_WINCTRL0_AEN (1<<1)
  22344. +#define LCD_WINCTRL0_OX_N(N) ((N)<<21)
  22345. +#define LCD_WINCTRL0_OY_N(N) ((N)<<10)
  22346. +#define LCD_WINCTRL0_A_N(N) ((N)<<2)
  22347. +
  22348. +/* lcd windows control 1 */
  22349. +#define LCD_WINCTRL1_PRI (3<<30)
  22350. +#define LCD_WINCTRL1_PIPE (1<<29)
  22351. +#define LCD_WINCTRL1_FRM (0xF<<25)
  22352. +#define LCD_WINCTRL1_CCO (1<<24)
  22353. +#define LCD_WINCTRL1_PO (3<<22)
  22354. +#define LCD_WINCTRL1_SZX (0x07FF<<11)
  22355. +#define LCD_WINCTRL1_SZY (0x07FF<<0)
  22356. +#define LCD_WINCTRL1_FRM_1BPP (0<<25)
  22357. +#define LCD_WINCTRL1_FRM_2BPP (1<<25)
  22358. +#define LCD_WINCTRL1_FRM_4BPP (2<<25)
  22359. +#define LCD_WINCTRL1_FRM_8BPP (3<<25)
  22360. +#define LCD_WINCTRL1_FRM_12BPP (4<<25)
  22361. +#define LCD_WINCTRL1_FRM_16BPP655 (5<<25)
  22362. +#define LCD_WINCTRL1_FRM_16BPP565 (6<<25)
  22363. +#define LCD_WINCTRL1_FRM_16BPP556 (7<<25)
  22364. +#define LCD_WINCTRL1_FRM_16BPPI1555 (8<<25)
  22365. +#define LCD_WINCTRL1_FRM_16BPPI5551 (9<<25)
  22366. +#define LCD_WINCTRL1_FRM_16BPPA1555 (10<<25)
  22367. +#define LCD_WINCTRL1_FRM_16BPPA5551 (11<<25)
  22368. +#define LCD_WINCTRL1_FRM_24BPP (12<<25)
  22369. +#define LCD_WINCTRL1_FRM_32BPP (13<<25)
  22370. +#define LCD_WINCTRL1_PRI_N(N) ((N)<<30)
  22371. +#define LCD_WINCTRL1_PO_00 (0<<22)
  22372. +#define LCD_WINCTRL1_PO_01 (1<<22)
  22373. +#define LCD_WINCTRL1_PO_10 (2<<22)
  22374. +#define LCD_WINCTRL1_PO_11 (3<<22)
  22375. +#define LCD_WINCTRL1_SZX_N(N) ((N-1)<<11)
  22376. +#define LCD_WINCTRL1_SZY_N(N) ((N-1)<<0)
  22377. +
  22378. +/* lcd windows control 2 */
  22379. +#define LCD_WINCTRL2_CKMODE (3<<24)
  22380. +#define LCD_WINCTRL2_DBM (1<<23)
  22381. +#define LCD_WINCTRL2_RAM (3<<21)
  22382. +#define LCD_WINCTRL2_BX (0x1FFF<<8)
  22383. +#define LCD_WINCTRL2_SCX (0xF<<4)
  22384. +#define LCD_WINCTRL2_SCY (0xF<<0)
  22385. +#define LCD_WINCTRL2_CKMODE_00 (0<<24)
  22386. +#define LCD_WINCTRL2_CKMODE_01 (1<<24)
  22387. +#define LCD_WINCTRL2_CKMODE_10 (2<<24)
  22388. +#define LCD_WINCTRL2_CKMODE_11 (3<<24)
  22389. +#define LCD_WINCTRL2_RAM_NONE (0<<21)
  22390. +#define LCD_WINCTRL2_RAM_PALETTE (1<<21)
  22391. +#define LCD_WINCTRL2_RAM_GAMMA (2<<21)
  22392. +#define LCD_WINCTRL2_RAM_BUFFER (3<<21)
  22393. +#define LCD_WINCTRL2_BX_N(N) ((N)<<8)
  22394. +#define LCD_WINCTRL2_SCX_1 (0<<4)
  22395. +#define LCD_WINCTRL2_SCX_2 (1<<4)
  22396. +#define LCD_WINCTRL2_SCX_4 (2<<4)
  22397. +#define LCD_WINCTRL2_SCY_1 (0<<0)
  22398. +#define LCD_WINCTRL2_SCY_2 (1<<0)
  22399. +#define LCD_WINCTRL2_SCY_4 (2<<0)
  22400. +
  22401. +/* lcd windows buffer control */
  22402. +#define LCD_WINBUFCTRL_DB (1<<1)
  22403. +#define LCD_WINBUFCTRL_DBN (1<<0)
  22404. +
  22405. +/* lcd_intstatus, lcd_intenable */
  22406. +#define LCD_INT_IFO (0xF<<14)
  22407. +#define LCD_INT_IFU (0xF<<10)
  22408. +#define LCD_INT_OFO (1<<9)
  22409. +#define LCD_INT_OFU (1<<8)
  22410. +#define LCD_INT_WAIT (1<<3)
  22411. +#define LCD_INT_SD (1<<2)
  22412. +#define LCD_INT_SA (1<<1)
  22413. +#define LCD_INT_SS (1<<0)
  22414. +
  22415. +/* lcd_horztiming */
  22416. +#define LCD_HORZTIMING_HND2 (0x1FF<<18)
  22417. +#define LCD_HORZTIMING_HND1 (0x1FF<<9)
  22418. +#define LCD_HORZTIMING_HPW (0x1FF<<0)
  22419. +#define LCD_HORZTIMING_HND2_N(N)(((N)-1)<<18)
  22420. +#define LCD_HORZTIMING_HND1_N(N)(((N)-1)<<9)
  22421. +#define LCD_HORZTIMING_HPW_N(N) (((N)-1)<<0)
  22422. +
  22423. +/* lcd_verttiming */
  22424. +#define LCD_VERTTIMING_VND2 (0x1FF<<18)
  22425. +#define LCD_VERTTIMING_VND1 (0x1FF<<9)
  22426. +#define LCD_VERTTIMING_VPW (0x1FF<<0)
  22427. +#define LCD_VERTTIMING_VND2_N(N)(((N)-1)<<18)
  22428. +#define LCD_VERTTIMING_VND1_N(N)(((N)-1)<<9)
  22429. +#define LCD_VERTTIMING_VPW_N(N) (((N)-1)<<0)
  22430. +
  22431. +/* lcd_clkcontrol */
  22432. +#define LCD_CLKCONTROL_EXT (1<<22)
  22433. +#define LCD_CLKCONTROL_DELAY (3<<20)
  22434. +#define LCD_CLKCONTROL_CDD (1<<19)
  22435. +#define LCD_CLKCONTROL_IB (1<<18)
  22436. +#define LCD_CLKCONTROL_IC (1<<17)
  22437. +#define LCD_CLKCONTROL_IH (1<<16)
  22438. +#define LCD_CLKCONTROL_IV (1<<15)
  22439. +#define LCD_CLKCONTROL_BF (0x1F<<10)
  22440. +#define LCD_CLKCONTROL_PCD (0x3FF<<0)
  22441. +#define LCD_CLKCONTROL_BF_N(N) (((N)-1)<<10)
  22442. +#define LCD_CLKCONTROL_PCD_N(N) ((N)<<0)
  22443. +
  22444. +/* lcd_pwmdiv */
  22445. +#define LCD_PWMDIV_EN (1<<31)
  22446. +#define LCD_PWMDIV_PWMDIV (0x1FFFF<<0)
  22447. +#define LCD_PWMDIV_PWMDIV_N(N) ((N)<<0)
  22448. +
  22449. +/* lcd_pwmhi */
  22450. +#define LCD_PWMHI_PWMHI1 (0xFFFF<<16)
  22451. +#define LCD_PWMHI_PWMHI0 (0xFFFF<<0)
  22452. +#define LCD_PWMHI_PWMHI1_N(N) ((N)<<16)
  22453. +#define LCD_PWMHI_PWMHI0_N(N) ((N)<<0)
  22454. +
  22455. +/* lcd_hwccon */
  22456. +#define LCD_HWCCON_EN (1<<0)
  22457. +
  22458. +/* lcd_cursorpos */
  22459. +#define LCD_CURSORPOS_HWCXOFF (0x1F<<27)
  22460. +#define LCD_CURSORPOS_HWCXPOS (0x07FF<<16)
  22461. +#define LCD_CURSORPOS_HWCYOFF (0x1F<<11)
  22462. +#define LCD_CURSORPOS_HWCYPOS (0x07FF<<0)
  22463. +#define LCD_CURSORPOS_HWCXOFF_N(N) ((N)<<27)
  22464. +#define LCD_CURSORPOS_HWCXPOS_N(N) ((N)<<16)
  22465. +#define LCD_CURSORPOS_HWCYOFF_N(N) ((N)<<11)
  22466. +#define LCD_CURSORPOS_HWCYPOS_N(N) ((N)<<0)
  22467. +
  22468. +/* lcd_cursorcolor */
  22469. +#define LCD_CURSORCOLOR_HWCA (0xFF<<24)
  22470. +#define LCD_CURSORCOLOR_HWCR (0xFF<<16)
  22471. +#define LCD_CURSORCOLOR_HWCG (0xFF<<8)
  22472. +#define LCD_CURSORCOLOR_HWCB (0xFF<<0)
  22473. +#define LCD_CURSORCOLOR_HWCA_N(N) ((N)<<24)
  22474. +#define LCD_CURSORCOLOR_HWCR_N(N) ((N)<<16)
  22475. +#define LCD_CURSORCOLOR_HWCG_N(N) ((N)<<8)
  22476. +#define LCD_CURSORCOLOR_HWCB_N(N) ((N)<<0)
  22477. +
  22478. +/* lcd_fifoctrl */
  22479. +#define LCD_FIFOCTRL_F3IF (1<<29)
  22480. +#define LCD_FIFOCTRL_F3REQ (0x1F<<24)
  22481. +#define LCD_FIFOCTRL_F2IF (1<<29)
  22482. +#define LCD_FIFOCTRL_F2REQ (0x1F<<16)
  22483. +#define LCD_FIFOCTRL_F1IF (1<<29)
  22484. +#define LCD_FIFOCTRL_F1REQ (0x1F<<8)
  22485. +#define LCD_FIFOCTRL_F0IF (1<<29)
  22486. +#define LCD_FIFOCTRL_F0REQ (0x1F<<0)
  22487. +#define LCD_FIFOCTRL_F3REQ_N(N) ((N-1)<<24)
  22488. +#define LCD_FIFOCTRL_F2REQ_N(N) ((N-1)<<16)
  22489. +#define LCD_FIFOCTRL_F1REQ_N(N) ((N-1)<<8)
  22490. +#define LCD_FIFOCTRL_F0REQ_N(N) ((N-1)<<0)
  22491. +
  22492. +/* lcd_outmask */
  22493. +#define LCD_OUTMASK_MASK (0x00FFFFFF)
  22494. +
  22495. +/********************************************************************/
  22496. +#endif /* _AU1200LCD_H */
  22497. Index: linux-2.4.35.4/drivers/video/Config.in
  22498. ===================================================================
  22499. --- linux-2.4.35.4.orig/drivers/video/Config.in
  22500. +++ linux-2.4.35.4/drivers/video/Config.in
  22501. @@ -87,8 +87,8 @@ if [ "$CONFIG_FB" = "y" ]; then
  22502. if [ "$CONFIG_HP300" = "y" ]; then
  22503. define_bool CONFIG_FB_HP300 y
  22504. fi
  22505. - if [ "$ARCH" = "alpha" ]; then
  22506. - tristate ' TGA framebuffer support' CONFIG_FB_TGA
  22507. + if [ "$ARCH" = "alpha" -o "$CONFIG_TC" = "y" ]; then
  22508. + tristate ' TGA/SFB+ framebuffer support' CONFIG_FB_TGA
  22509. fi
  22510. if [ "$CONFIG_X86" = "y" ]; then
  22511. bool ' VESA VGA graphics console' CONFIG_FB_VESA
  22512. @@ -121,6 +121,17 @@ if [ "$CONFIG_FB" = "y" ]; then
  22513. hex ' Framebuffer Base Address' CONFIG_E1355_FB_BASE a8200000
  22514. fi
  22515. fi
  22516. + if [ "$CONFIG_SOC_AU1100" = "y" ]; then
  22517. + bool ' Au1100 LCD Driver' CONFIG_FB_AU1100
  22518. + fi
  22519. +
  22520. + if [ "$CONFIG_SOC_AU1200" = "y" ]; then
  22521. + bool ' Au1200 LCD Driver' CONFIG_FB_AU1200
  22522. + if [ "$CONFIG_FB_AU1200" = "y" ]; then
  22523. + int ' Number of planes (1 to 4)' CONFIG_FB_AU1200_DEVS 1
  22524. + fi
  22525. + fi
  22526. +
  22527. if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
  22528. if [ "$CONFIG_PCI" != "n" ]; then
  22529. tristate ' Matrox acceleration (EXPERIMENTAL)' CONFIG_FB_MATROX
  22530. @@ -178,9 +189,6 @@ if [ "$CONFIG_FB" = "y" ]; then
  22531. bool ' Use CRT on Pb1100 ' CONFIG_PB1500_CRT
  22532. bool ' Use TFT Panel on Pb1100 ' CONFIG_PB1500_TFT
  22533. fi
  22534. - if [ "$CONFIG_SOC_AU1100" = "y" ]; then
  22535. - bool ' Au1100 LCD Driver' CONFIG_FB_AU1100
  22536. - fi
  22537. fi
  22538. fi
  22539. fi
  22540. Index: linux-2.4.35.4/drivers/video/fbmem.c
  22541. ===================================================================
  22542. --- linux-2.4.35.4.orig/drivers/video/fbmem.c
  22543. +++ linux-2.4.35.4/drivers/video/fbmem.c
  22544. @@ -139,6 +139,8 @@ extern int e1356fb_init(void);
  22545. extern int e1356fb_setup(char*);
  22546. extern int au1100fb_init(void);
  22547. extern int au1100fb_setup(char*);
  22548. +extern int au1200fb_init(void);
  22549. +extern int au1200fb_setup(char*);
  22550. extern int pvr2fb_init(void);
  22551. extern int pvr2fb_setup(char*);
  22552. extern int sstfb_init(void);
  22553. @@ -331,6 +333,9 @@ static struct {
  22554. #ifdef CONFIG_FB_AU1100
  22555. { "au1100fb", au1100fb_init, au1100fb_setup },
  22556. #endif
  22557. +#ifdef CONFIG_FB_AU1200
  22558. + { "au1200fb", au1200fb_init, au1200fb_setup },
  22559. +#endif
  22560. #ifdef CONFIG_FB_IT8181
  22561. { "it8181fb", it8181fb_init, it8181fb_setup },
  22562. #endif
  22563. Index: linux-2.4.35.4/drivers/video/ims332.h
  22564. ===================================================================
  22565. --- /dev/null
  22566. +++ linux-2.4.35.4/drivers/video/ims332.h
  22567. @@ -0,0 +1,275 @@
  22568. +/*
  22569. + * linux/drivers/video/ims332.h
  22570. + *
  22571. + * Copyright 2003 Thiemo Seufer <[email protected]>
  22572. + *
  22573. + * This file is subject to the terms and conditions of the GNU General
  22574. + * Public License. See the file COPYING in the main directory of this
  22575. + * archive for more details.
  22576. + */
  22577. +#include <linux/types.h>
  22578. +
  22579. +/*
  22580. + * IMS332 16-bit wide, 128-bit aligned registers.
  22581. + */
  22582. +struct _ims332_reg {
  22583. + volatile u16 r;
  22584. + u16 pad[7];
  22585. +};
  22586. +
  22587. +struct _ims332_regs {
  22588. +#define IMS332_BOOT_PLL_MUTLIPLIER 0x00001f
  22589. +#define IMS332_BOOT_CLOCK_SOURCE_SEL 0x000020
  22590. +#define IMS332_BOOT_ADDRESS_ALIGNMENT 0x000040
  22591. +#define IMS332_BOOT_WRITE_ZERO 0xffff80
  22592. + struct _ims332_reg boot;
  22593. + struct _ims332_reg pad0[0x020 - 0x000];
  22594. + struct _ims332_reg half_sync;
  22595. + struct _ims332_reg back_porch;
  22596. + struct _ims332_reg display;
  22597. + struct _ims332_reg short_display;
  22598. + struct _ims332_reg broad_pulse;
  22599. + struct _ims332_reg vsync;
  22600. + struct _ims332_reg vpre_equalise;
  22601. + struct _ims332_reg vpost_equalise;
  22602. + struct _ims332_reg vblank;
  22603. + struct _ims332_reg vdisplay;
  22604. + struct _ims332_reg line_time;
  22605. + struct _ims332_reg line_start;
  22606. + struct _ims332_reg mem_init;
  22607. + struct _ims332_reg transfer_delay;
  22608. + struct _ims332_reg pad1[0x03f - 0x02e];
  22609. + struct _ims332_reg pixel_address_mask;
  22610. + struct _ims332_reg pad2[0x05f - 0x040];
  22611. +
  22612. +#define IMS332_CTRL_A_BOOT_ENABLE_VTG 0x000001
  22613. +#define IMS332_CTRL_A_SCREEN_FORMAT 0x000002
  22614. +#define IMS332_CTRL_A_INTERLACED_STANDARD 0x000004
  22615. +#define IMS332_CTRL_A_OPERATING_MODE 0x000008
  22616. +#define IMS332_CTRL_A_FRAME_FLYBACK_PATTERN 0x000010
  22617. +#define IMS332_CTRL_A_DIGITAL_SYNC_FORMAT 0x000020
  22618. +#define IMS332_CTRL_A_ANALOGUE_VIDEO_FORMAT 0x000040
  22619. +#define IMS332_CTRL_A_BLANK_LEVEL 0x000080
  22620. +#define IMS332_CTRL_A_BLANK_IO 0x000100
  22621. +#define IMS332_CTRL_A_BLANK_FUNCTION_SWITCH 0x000200
  22622. +#define IMS332_CTRL_A_FORCE_BLANKING 0x000400
  22623. +#define IMS332_CTRL_A_TURN_OFF_BLANKING 0x000800
  22624. +#define IMS332_CTRL_A_VRAM_ADDRESS_INCREMENT 0x003000
  22625. +#define IMS332_CTRL_A_TURN_OFF_DMA 0x004000
  22626. +#define IMS332_CTRL_A_SYNC_DELAY 0x038000
  22627. +#define IMS332_CTRL_A_PIXEL_PORT_INTERLEAVING 0x040000
  22628. +#define IMS332_CTRL_A_DELAYED_SAMPLING 0x080000
  22629. +#define IMS332_CTRL_A_BITS_PER_PIXEL 0x700000
  22630. +#define IMS332_CTRL_A_CURSOR_DISABLE 0x800000
  22631. + struct _ims332_reg config_control_a;
  22632. + struct _ims332_reg pad3[0x06f - 0x060];
  22633. +
  22634. +#define IMS332_CTRL_B_WRITE_ZERO 0xffffff
  22635. + struct _ims332_reg config_control_b;
  22636. + struct _ims332_reg pad4[0x07f - 0x070];
  22637. + struct _ims332_reg screen_top;
  22638. + struct _ims332_reg pad5[0x0a0 - 0x080];
  22639. + /* cursor color palette, 3 entries, reg no. 0xa1 - 0xa3 */
  22640. + struct _ims332_reg cursor_color_palette0;
  22641. + struct _ims332_reg cursor_color_palette1;
  22642. + struct _ims332_reg cursor_color_palette2;
  22643. + struct _ims332_reg pad6[0x0bf - 0x0a3];
  22644. + struct _ims332_reg rgb_frame_checksum0;
  22645. + struct _ims332_reg rgb_frame_checksum1;
  22646. + struct _ims332_reg rgb_frame_checksum2;
  22647. + struct _ims332_reg pad7[0x0c6 - 0x0c2];
  22648. + struct _ims332_reg cursor_start;
  22649. + struct _ims332_reg pad8[0x0ff - 0x0c7];
  22650. + /* color palette, 256 entries of form 0x00BBGGRR, reg no. 0x100 - 0x1ff */
  22651. + struct _ims332_reg color_palette[0x1ff - 0x0ff];
  22652. + /* hardware cursor bitmap, reg no. 0x200 - 0x3ff */
  22653. + struct _ims332_reg cursor_ram[0x3ff - 0x1ff];
  22654. +};
  22655. +
  22656. +/*
  22657. + * In the functions below we use some weird looking helper variables to
  22658. + * access most members of this struct, otherwise the compiler splits
  22659. + * the read/write in two byte accesses.
  22660. + */
  22661. +struct ims332_regs {
  22662. + struct _ims332_regs rw;
  22663. + char pad0[0x80000 - sizeof (struct _ims332_regs)];
  22664. + struct _ims332_regs r;
  22665. + char pad1[0xa0000 - (sizeof (struct _ims332_regs) + 0x80000)];
  22666. + struct _ims332_regs w;
  22667. +} __attribute__((packed));
  22668. +
  22669. +static inline void ims332_control_reg_bits(struct ims332_regs *regs, u32 mask,
  22670. + u32 val)
  22671. +{
  22672. + volatile u16 *ctr = &(regs->r.config_control_a.r);
  22673. + volatile u16 *ctw = &(regs->w.config_control_a.r);
  22674. + u32 ctrl;
  22675. +
  22676. + mb();
  22677. + ctrl = *ctr;
  22678. + rmb();
  22679. + ctrl |= ((regs->rw.boot.r << 8) & 0x00ff0000);
  22680. + ctrl |= val & mask;
  22681. + ctrl &= ~(~val & mask);
  22682. + wmb();
  22683. + regs->rw.boot.r = (ctrl >> 8) & 0xff00;
  22684. + wmb();
  22685. + *ctw = ctrl & 0xffff;
  22686. +}
  22687. +
  22688. +/* FIXME: This is maxinefb specific. */
  22689. +static inline void ims332_bootstrap(struct ims332_regs *regs)
  22690. +{
  22691. + volatile u16 *ctw = &(regs->w.config_control_a.r);
  22692. + u32 ctrl = IMS332_CTRL_A_BOOT_ENABLE_VTG | IMS332_CTRL_A_TURN_OFF_DMA;
  22693. +
  22694. + /* bootstrap sequence */
  22695. + mb();
  22696. + regs->rw.boot.r = 0;
  22697. + wmb();
  22698. + *ctw = 0;
  22699. +
  22700. + /* init control A register */
  22701. + wmb();
  22702. + regs->rw.boot.r = (ctrl >> 8) & 0xff00;
  22703. + wmb();
  22704. + *ctw = ctrl & 0xffff;
  22705. +}
  22706. +
  22707. +static inline void ims332_blank_screen(struct ims332_regs *regs, int blank)
  22708. +{
  22709. + ims332_control_reg_bits(regs, IMS332_CTRL_A_FORCE_BLANKING,
  22710. + blank ? IMS332_CTRL_A_FORCE_BLANKING : 0);
  22711. +}
  22712. +
  22713. +static inline void ims332_set_color_depth(struct ims332_regs *regs, u32 depth)
  22714. +{
  22715. + u32 dp;
  22716. + u32 mask = (IMS332_CTRL_A_PIXEL_PORT_INTERLEAVING
  22717. + | IMS332_CTRL_A_DELAYED_SAMPLING
  22718. + | IMS332_CTRL_A_BITS_PER_PIXEL);
  22719. +
  22720. + switch (depth) {
  22721. + case 1: dp = 0 << 20; break;
  22722. + case 2: dp = 1 << 20; break;
  22723. + case 4: dp = 2 << 20; break;
  22724. + case 8: dp = 3 << 20; break;
  22725. + case 15: dp = (4 << 20) | IMS332_CTRL_A_PIXEL_PORT_INTERLEAVING; break;
  22726. + case 16: dp = (5 << 20) | IMS332_CTRL_A_PIXEL_PORT_INTERLEAVING; break;
  22727. + default: return;
  22728. + }
  22729. + ims332_control_reg_bits(regs, mask, dp);
  22730. +
  22731. + if (depth <= 8) {
  22732. + volatile u16 *pmask = &(regs->w.pixel_address_mask.r);
  22733. + u32 dm = (1 << depth) - 1;
  22734. +
  22735. + wmb();
  22736. + regs->rw.boot.r = dm << 8;
  22737. + wmb();
  22738. + *pmask = dm << 8 | dm;
  22739. + }
  22740. +}
  22741. +
  22742. +static inline void ims332_set_screen_top(struct ims332_regs *regs, u16 top)
  22743. +{
  22744. + volatile u16 *st = &(regs->w.screen_top.r);
  22745. +
  22746. + mb();
  22747. + *st = top & 0xffff;
  22748. +}
  22749. +
  22750. +static inline void ims332_enable_cursor(struct ims332_regs *regs, int on)
  22751. +{
  22752. + ims332_control_reg_bits(regs, IMS332_CTRL_A_CURSOR_DISABLE,
  22753. + on ? 0 : IMS332_CTRL_A_CURSOR_DISABLE);
  22754. +}
  22755. +
  22756. +static inline void ims332_position_cursor(struct ims332_regs *regs,
  22757. + u16 x, u16 y)
  22758. +{
  22759. + volatile u16 *cp = &(regs->w.cursor_start.r);
  22760. + u32 val = ((x & 0xfff) << 12) | (y & 0xfff);
  22761. +
  22762. + if (x > 2303 || y > 2303)
  22763. + return;
  22764. +
  22765. + mb();
  22766. + regs->rw.boot.r = (val >> 8) & 0xff00;
  22767. + wmb();
  22768. + *cp = val & 0xffff;
  22769. +}
  22770. +
  22771. +static inline void ims332_set_font(struct ims332_regs *regs, u8 fgc,
  22772. + u16 width, u16 height)
  22773. +{
  22774. + volatile u16 *cp0 = &(regs->w.cursor_color_palette0.r);
  22775. + int i;
  22776. +
  22777. + mb();
  22778. + for (i = 0; i < 0x200; i++) {
  22779. + volatile u16 *cram = &(regs->w.cursor_ram[i].r);
  22780. +
  22781. + if (height << 6 <= i << 3)
  22782. + *cram = 0x0000;
  22783. + else if (width <= i % 8 << 3)
  22784. + *cram = 0x0000;
  22785. + else if (((width >> 3) & 0xffff) > i % 8)
  22786. + *cram = 0x5555;
  22787. + else
  22788. + *cram = 0x5555 & ~(0xffff << (width % 8 << 1));
  22789. + wmb();
  22790. + }
  22791. + regs->rw.boot.r = fgc << 8;
  22792. + wmb();
  22793. + *cp0 = fgc << 8 | fgc;
  22794. +}
  22795. +
  22796. +static inline void ims332_read_cmap(struct ims332_regs *regs, u8 reg,
  22797. + u8* red, u8* green, u8* blue)
  22798. +{
  22799. + volatile u16 *rptr = &(regs->r.color_palette[reg].r);
  22800. + u16 val;
  22801. +
  22802. + mb();
  22803. + val = *rptr;
  22804. + *red = val & 0xff;
  22805. + *green = (val >> 8) & 0xff;
  22806. + rmb();
  22807. + *blue = (regs->rw.boot.r >> 8) & 0xff;
  22808. +}
  22809. +
  22810. +static inline void ims332_write_cmap(struct ims332_regs *regs, u8 reg,
  22811. + u8 red, u8 green, u8 blue)
  22812. +{
  22813. + volatile u16 *wptr = &(regs->w.color_palette[reg].r);
  22814. +
  22815. + mb();
  22816. + regs->rw.boot.r = blue << 8;
  22817. + wmb();
  22818. + *wptr = (green << 8) + red;
  22819. +}
  22820. +
  22821. +static inline void ims332_dump_regs(struct ims332_regs *regs)
  22822. +{
  22823. + int i;
  22824. +
  22825. + printk(__FUNCTION__);
  22826. + ims332_control_reg_bits(regs, IMS332_CTRL_A_BOOT_ENABLE_VTG, 0);
  22827. + for (i = 0; i < 0x100; i++) {
  22828. + volatile u16 *cpad = (u16 *)((char *)(&regs->r) + sizeof(struct _ims332_reg) * i);
  22829. + u32 val;
  22830. +
  22831. + val = *cpad;
  22832. + rmb();
  22833. + val |= regs->rw.boot.r << 8;
  22834. + rmb();
  22835. + if (! (i % 8))
  22836. + printk("\n%02x:", i);
  22837. + printk(" %06x", val);
  22838. + }
  22839. + ims332_control_reg_bits(regs, IMS332_CTRL_A_BOOT_ENABLE_VTG,
  22840. + IMS332_CTRL_A_BOOT_ENABLE_VTG);
  22841. + printk("\n");
  22842. +}
  22843. Index: linux-2.4.35.4/drivers/video/Makefile
  22844. ===================================================================
  22845. --- linux-2.4.35.4.orig/drivers/video/Makefile
  22846. +++ linux-2.4.35.4/drivers/video/Makefile
  22847. @@ -87,6 +87,7 @@ obj-$(CONFIG_FB_PMAGB_B) += pma
  22848. obj-$(CONFIG_FB_MAXINE) += maxinefb.o
  22849. obj-$(CONFIG_FB_TX3912) += tx3912fb.o
  22850. obj-$(CONFIG_FB_AU1100) += au1100fb.o fbgen.o
  22851. +obj-$(CONFIG_FB_AU1200) += au1200fb.o fbgen.o
  22852. obj-$(CONFIG_FB_IT8181) += it8181fb.o fbgen.o
  22853. subdir-$(CONFIG_STI_CONSOLE) += sti
  22854. Index: linux-2.4.35.4/drivers/video/maxinefb.h
  22855. ===================================================================
  22856. --- linux-2.4.35.4.orig/drivers/video/maxinefb.h
  22857. +++ /dev/null
  22858. @@ -1,38 +0,0 @@
  22859. -/*
  22860. - * linux/drivers/video/maxinefb.h
  22861. - *
  22862. - * DECstation 5000/xx onboard framebuffer support, Copyright (C) 1999 by
  22863. - * Michael Engel <[email protected]> and Karsten Merker <[email protected]>
  22864. - * This file is subject to the terms and conditions of the GNU General
  22865. - * Public License. See the file COPYING in the main directory of this
  22866. - * archive for more details.
  22867. - */
  22868. -
  22869. -#include <asm/addrspace.h>
  22870. -
  22871. -/*
  22872. - * IMS332 video controller register base address
  22873. - */
  22874. -#define MAXINEFB_IMS332_ADDRESS KSEG1ADDR(0x1c140000)
  22875. -
  22876. -/*
  22877. - * Begin of DECstation 5000/xx onboard framebuffer memory, default resolution
  22878. - * is 1024x768x8
  22879. - */
  22880. -#define DS5000_xx_ONBOARD_FBMEM_START KSEG1ADDR(0x0a000000)
  22881. -
  22882. -/*
  22883. - * The IMS 332 video controller used in the DECstation 5000/xx series
  22884. - * uses 32 bits wide registers; the following defines declare the
  22885. - * register numbers, to get the real offset, these have to be multiplied
  22886. - * by four.
  22887. - */
  22888. -
  22889. -#define IMS332_REG_CURSOR_RAM 0x200 /* hardware cursor bitmap */
  22890. -
  22891. -/*
  22892. - * The color palette entries have the form 0x00BBGGRR
  22893. - */
  22894. -#define IMS332_REG_COLOR_PALETTE 0x100 /* color palette, 256 entries */
  22895. -#define IMS332_REG_CURSOR_COLOR_PALETTE 0x0a1 /* cursor color palette, */
  22896. - /* 3 entries */
  22897. Index: linux-2.4.35.4/drivers/video/newport_con.c
  22898. ===================================================================
  22899. --- linux-2.4.35.4.orig/drivers/video/newport_con.c
  22900. +++ linux-2.4.35.4/drivers/video/newport_con.c
  22901. @@ -22,6 +22,7 @@
  22902. #include <linux/module.h>
  22903. #include <linux/slab.h>
  22904. +#include <asm/io.h>
  22905. #include <asm/uaccess.h>
  22906. #include <asm/system.h>
  22907. #include <asm/page.h>
  22908. @@ -77,7 +78,7 @@ static int newport_set_def_font(int unit
  22909. static inline void newport_render_background(int xstart, int ystart,
  22910. int xend, int yend, int ci)
  22911. {
  22912. - newport_wait();
  22913. + newport_wait(npregs);
  22914. npregs->set.wrmask = 0xffffffff;
  22915. npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
  22916. NPORT_DMODE0_DOSETUP | NPORT_DMODE0_STOPX
  22917. @@ -94,7 +95,7 @@ static inline void newport_init_cmap(voi
  22918. unsigned short i;
  22919. for (i = 0; i < 16; i++) {
  22920. - newport_bfwait();
  22921. + newport_bfwait(npregs);
  22922. newport_cmap_setaddr(npregs, color_table[i]);
  22923. newport_cmap_setrgb(npregs,
  22924. default_red[i],
  22925. @@ -107,7 +108,7 @@ static inline void newport_show_logo(voi
  22926. unsigned long i;
  22927. for (i = 0; i < LINUX_LOGO_COLORS; i++) {
  22928. - newport_bfwait();
  22929. + newport_bfwait(npregs);
  22930. newport_cmap_setaddr(npregs, i + 0x20);
  22931. newport_cmap_setrgb(npregs,
  22932. linux_logo_red[i],
  22933. @@ -115,13 +116,13 @@ static inline void newport_show_logo(voi
  22934. linux_logo_blue[i]);
  22935. }
  22936. - newport_wait();
  22937. + newport_wait(npregs);
  22938. npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
  22939. NPORT_DMODE0_CHOST);
  22940. npregs->set.xystarti = ((newport_xsize - LOGO_W) << 16) | (0);
  22941. npregs->set.xyendi = ((newport_xsize - 1) << 16);
  22942. - newport_wait();
  22943. + newport_wait(npregs);
  22944. for (i = 0; i < LOGO_W * LOGO_H; i++)
  22945. npregs->go.hostrw0 = linux_logo[i] << 24;
  22946. @@ -133,7 +134,7 @@ static inline void newport_clear_screen(
  22947. if (logo_active)
  22948. return;
  22949. - newport_wait();
  22950. + newport_wait(npregs);
  22951. npregs->set.wrmask = 0xffffffff;
  22952. npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
  22953. NPORT_DMODE0_DOSETUP | NPORT_DMODE0_STOPX
  22954. @@ -155,7 +156,7 @@ void newport_reset(void)
  22955. unsigned short treg;
  22956. int i;
  22957. - newport_wait();
  22958. + newport_wait(npregs);
  22959. treg = newport_vc2_get(npregs, VC2_IREG_CONTROL);
  22960. newport_vc2_set(npregs, VC2_IREG_CONTROL,
  22961. (treg | VC2_CTRL_EVIDEO));
  22962. @@ -165,7 +166,7 @@ void newport_reset(void)
  22963. npregs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_RAM |
  22964. NPORT_DMODE_W2 | VC2_PROTOCOL);
  22965. for (i = 0; i < 128; i++) {
  22966. - newport_bfwait();
  22967. + newport_bfwait(npregs);
  22968. if (i == 92 || i == 94)
  22969. npregs->set.dcbdata0.byshort.s1 = 0xff00;
  22970. else
  22971. @@ -205,7 +206,7 @@ void newport_get_screensize(void)
  22972. npregs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_RAM |
  22973. NPORT_DMODE_W2 | VC2_PROTOCOL);
  22974. for (i = 0; i < 128; i++) {
  22975. - newport_bfwait();
  22976. + newport_bfwait(npregs);
  22977. linetable[i] = npregs->set.dcbdata0.byshort.s1;
  22978. }
  22979. @@ -216,12 +217,12 @@ void newport_get_screensize(void)
  22980. npregs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_RAM |
  22981. NPORT_DMODE_W2 | VC2_PROTOCOL);
  22982. do {
  22983. - newport_bfwait();
  22984. + newport_bfwait(npregs);
  22985. treg = npregs->set.dcbdata0.byshort.s1;
  22986. if ((treg & 1) == 0)
  22987. cols += (treg >> 7) & 0xfe;
  22988. if ((treg & 0x80) == 0) {
  22989. - newport_bfwait();
  22990. + newport_bfwait(npregs);
  22991. treg = npregs->set.dcbdata0.byshort.s1;
  22992. }
  22993. } while ((treg & 0x8000) == 0);
  22994. @@ -291,16 +292,16 @@ static const char *newport_startup(void)
  22995. if (!sgi_gfxaddr)
  22996. return NULL;
  22997. - npregs = (struct newport_regs *) (KSEG1 + sgi_gfxaddr);
  22998. + npregs = (struct newport_regs *) /* ioremap cannot fail */
  22999. + ioremap(sgi_gfxaddr, sizeof(struct newport_regs));
  23000. npregs->cset.config = NPORT_CFG_GD0;
  23001. - if (newport_wait()) {
  23002. - return NULL;
  23003. - }
  23004. + if (newport_wait(npregs))
  23005. + goto out_unmap;
  23006. npregs->set.xstarti = TESTVAL;
  23007. if (npregs->set._xstart.word != XSTI_TO_FXSTART(TESTVAL))
  23008. - return NULL;
  23009. + goto out_unmap;
  23010. for (i = 0; i < MAX_NR_CONSOLES; i++)
  23011. font_data[i] = FONT_DATA;
  23012. @@ -310,6 +311,10 @@ static const char *newport_startup(void)
  23013. newport_get_screensize();
  23014. return "SGI Newport";
  23015. +
  23016. +out_unmap:
  23017. + iounmap((void *)npregs);
  23018. + return NULL;
  23019. }
  23020. static void newport_init(struct vc_data *vc, int init)
  23021. @@ -363,7 +368,7 @@ static void newport_putc(struct vc_data
  23022. (charattr & 0xf0) >> 4);
  23023. /* Set the color and drawing mode. */
  23024. - newport_wait();
  23025. + newport_wait(npregs);
  23026. npregs->set.colori = charattr & 0xf;
  23027. npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
  23028. NPORT_DMODE0_STOPX | NPORT_DMODE0_ZPENAB |
  23029. @@ -372,7 +377,7 @@ static void newport_putc(struct vc_data
  23030. /* Set coordinates for bitmap operation. */
  23031. npregs->set.xystarti = (xpos << 16) | ((ypos + topscan) & 0x3ff);
  23032. npregs->set.xyendi = ((xpos + 7) << 16);
  23033. - newport_wait();
  23034. + newport_wait(npregs);
  23035. /* Go, baby, go... */
  23036. RENDER(npregs, p);
  23037. @@ -396,7 +401,7 @@ static void newport_putcs(struct vc_data
  23038. xpos + ((count - 1) << 3), ypos,
  23039. (charattr & 0xf0) >> 4);
  23040. - newport_wait();
  23041. + newport_wait(npregs);
  23042. /* Set the color and drawing mode. */
  23043. npregs->set.colori = charattr & 0xf;
  23044. @@ -407,7 +412,7 @@ static void newport_putcs(struct vc_data
  23045. for (i = 0; i < count; i++, xpos += 8) {
  23046. p = &font_data[vc->vc_num][(scr_readw(s++) & 0xff) << 4];
  23047. - newport_wait();
  23048. + newport_wait(npregs);
  23049. /* Set coordinates for bitmap operation. */
  23050. npregs->set.xystarti =
  23051. @@ -689,7 +694,7 @@ static void newport_bmove(struct vc_data
  23052. xe = xs;
  23053. xs = tmp;
  23054. }
  23055. - newport_wait();
  23056. + newport_wait(npregs);
  23057. npregs->set.drawmode0 = (NPORT_DMODE0_S2S | NPORT_DMODE0_BLOCK |
  23058. NPORT_DMODE0_DOSETUP | NPORT_DMODE0_STOPX
  23059. | NPORT_DMODE0_STOPY);
  23060. @@ -706,35 +711,35 @@ static int newport_dummy(struct vc_data
  23061. #define DUMMY (void *) newport_dummy
  23062. const struct consw newport_con = {
  23063. - con_startup: newport_startup,
  23064. - con_init: newport_init,
  23065. - con_deinit: newport_deinit,
  23066. - con_clear: newport_clear,
  23067. - con_putc: newport_putc,
  23068. - con_putcs: newport_putcs,
  23069. - con_cursor: newport_cursor,
  23070. - con_scroll: newport_scroll,
  23071. - con_bmove: newport_bmove,
  23072. - con_switch: newport_switch,
  23073. - con_blank: newport_blank,
  23074. - con_font_op: newport_font_op,
  23075. - con_set_palette: newport_set_palette,
  23076. - con_scrolldelta: newport_scrolldelta,
  23077. - con_set_origin: DUMMY,
  23078. - con_save_screen: DUMMY
  23079. + .con_startup = newport_startup,
  23080. + .con_init = newport_init,
  23081. + .con_deinit = newport_deinit,
  23082. + .con_clear = newport_clear,
  23083. + .con_putc = newport_putc,
  23084. + .con_putcs = newport_putcs,
  23085. + .con_cursor = newport_cursor,
  23086. + .con_scroll = newport_scroll,
  23087. + .con_bmove = newport_bmove,
  23088. + .con_switch = newport_switch,
  23089. + .con_blank = newport_blank,
  23090. + .con_font_op = newport_font_op,
  23091. + .con_set_palette = newport_set_palette,
  23092. + .con_scrolldelta = newport_scrolldelta,
  23093. + .con_set_origin = DUMMY,
  23094. + .con_save_screen = DUMMY
  23095. };
  23096. #ifdef MODULE
  23097. static int __init newport_console_init(void)
  23098. {
  23099. take_over_console(&newport_con, 0, MAX_NR_CONSOLES - 1, 1);
  23100. -
  23101. return 0;
  23102. }
  23103. static void __exit newport_console_exit(void)
  23104. {
  23105. give_up_console(&newport_con);
  23106. + iounmap((void *)npregs);
  23107. }
  23108. module_init(newport_console_init);
  23109. Index: linux-2.4.35.4/drivers/video/tgafb.c
  23110. ===================================================================
  23111. --- linux-2.4.35.4.orig/drivers/video/tgafb.c
  23112. +++ linux-2.4.35.4/drivers/video/tgafb.c
  23113. @@ -45,6 +45,15 @@
  23114. #include <linux/console.h>
  23115. #include <asm/io.h>
  23116. +#ifdef CONFIG_TC
  23117. +#include <asm/dec/tc.h>
  23118. +#else
  23119. +static int search_tc_card(const char *) { return -1; }
  23120. +static void claim_tc_card(int) { }
  23121. +static void release_tc_card(int) { }
  23122. +static unsigned long get_tc_base_addr(int) { return 0; }
  23123. +#endif
  23124. +
  23125. #include <video/fbcon.h>
  23126. #include <video/fbcon-cfb8.h>
  23127. #include <video/fbcon-cfb32.h>
  23128. @@ -84,10 +93,10 @@ static unsigned int fb_offset_presets[4]
  23129. };
  23130. static unsigned int deep_presets[4] = {
  23131. - 0x00014000,
  23132. - 0x0001440d,
  23133. + 0x00004000,
  23134. + 0x0000440d,
  23135. 0xffffffff,
  23136. - 0x0001441d
  23137. + 0x0000441d
  23138. };
  23139. static unsigned int rasterop_presets[4] = {
  23140. @@ -131,6 +140,13 @@ static struct {
  23141. 0,
  23142. FB_VMODE_NONINTERLACED
  23143. }},
  23144. + { "1280x1024-72", { /* mode #0 of PMAGD boards */
  23145. + 1280, 1024, 1280, 1024, 0, 0, 0, 0,
  23146. + {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
  23147. + 0, 0, -1, -1, FB_ACCELF_TEXT, 7692, 232, 32, 34, 3, 160, 3,
  23148. + FB_SYNC_ON_GREEN,
  23149. + FB_VMODE_NONINTERLACED
  23150. + }},
  23151. { "800x600-56", {
  23152. 800, 600, 800, 600, 0, 0, 0, 0,
  23153. {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
  23154. @@ -488,7 +504,8 @@ static void tgafb_set_par(const void *fb
  23155. continue;
  23156. mb();
  23157. - TGA_WRITE_REG(deep_presets[fb_info.tga_type], TGA_DEEP_REG);
  23158. + TGA_WRITE_REG(deep_presets[fb_info.tga_type] |
  23159. + (par->sync_on_green ? 0x0 : 0x00010000), TGA_DEEP_REG);
  23160. while (TGA_READ_REG(TGA_CMD_STAT_REG) & 1) /* wait for not busy */
  23161. continue;
  23162. mb();
  23163. @@ -548,7 +565,7 @@ static void tgafb_set_par(const void *fb
  23164. BT463_WRITE(BT463_REG_ACC, BT463_CMD_REG_0, 0x40);
  23165. BT463_WRITE(BT463_REG_ACC, BT463_CMD_REG_1, 0x08);
  23166. BT463_WRITE(BT463_REG_ACC, BT463_CMD_REG_2,
  23167. - (par->sync_on_green ? 0x80 : 0x40));
  23168. + (par->sync_on_green ? 0xc0 : 0x40));
  23169. BT463_WRITE(BT463_REG_ACC, BT463_READ_MASK_0, 0xff);
  23170. BT463_WRITE(BT463_REG_ACC, BT463_READ_MASK_1, 0xff);
  23171. @@ -921,19 +938,34 @@ int __init tgafb_setup(char *options) {
  23172. int __init tgafb_init(void)
  23173. {
  23174. struct pci_dev *pdev;
  23175. + int slot;
  23176. pdev = pci_find_device(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TGA, NULL);
  23177. if (!pdev)
  23178. + slot = search_tc_card("PMAGD");
  23179. + if (!pdev && slot < 0)
  23180. return -ENXIO;
  23181. /* divine board type */
  23182. - fb_info.tga_mem_base = (unsigned long)ioremap(pdev->resource[0].start, 0);
  23183. - fb_info.tga_type = (readl(fb_info.tga_mem_base) >> 12) & 0x0f;
  23184. - fb_info.tga_regs_base = fb_info.tga_mem_base + TGA_REGS_OFFSET;
  23185. - fb_info.tga_fb_base = (fb_info.tga_mem_base
  23186. + if (pdev) {
  23187. + fb_info.tga_mem_base = (unsigned long)ioremap(pdev->resource[0].start,
  23188. + 0);
  23189. + fb_info.tga_type = (readl(fb_info.tga_mem_base) >> 12) & 0x0f;
  23190. + fb_info.tga_regs_base = fb_info.tga_mem_base + TGA_REGS_OFFSET;
  23191. + fb_info.tga_fb_base = (fb_info.tga_mem_base
  23192. + fb_offset_presets[fb_info.tga_type]);
  23193. - pci_read_config_byte(pdev, PCI_REVISION_ID, &fb_info.tga_chip_rev);
  23194. + pci_read_config_byte(pdev, PCI_REVISION_ID, &fb_info.tga_chip_rev);
  23195. +
  23196. + } else {
  23197. + claim_tc_card(slot);
  23198. + fb_info.tga_mem_base = get_tc_base_addr(slot);
  23199. + fb_info.tga_type = (readl(fb_info.tga_mem_base) >> 12) & 0x0f; /* ? */
  23200. + fb_info.tga_regs_base = fb_info.tga_mem_base + TGA_REGS_OFFSET;
  23201. + fb_info.tga_fb_base = (fb_info.tga_mem_base
  23202. + + fb_offset_presets[fb_info.tga_type]);
  23203. + fb_info.tga_chip_rev = TGA_READ_REG(TGA_START_REG) & 0xff;
  23204. + }
  23205. /* setup framebuffer */
  23206. @@ -950,40 +982,62 @@ int __init tgafb_init(void)
  23207. fb_info.gen.fbhw = &tgafb_hwswitch;
  23208. fb_info.gen.fbhw->detect();
  23209. - printk (KERN_INFO "tgafb: DC21030 [TGA] detected, rev=0x%02x\n", fb_info.tga_chip_rev);
  23210. - printk (KERN_INFO "tgafb: at PCI bus %d, device %d, function %d\n",
  23211. - pdev->bus->number, PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
  23212. + if (pdev) {
  23213. + printk (KERN_INFO "tgafb: DC21030 [TGA] detected, rev=0x%02x\n",
  23214. + fb_info.tga_chip_rev);
  23215. + printk (KERN_INFO "tgafb: at PCI bus %d, device %d, function %d\n",
  23216. + pdev->bus->number,
  23217. + PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
  23218. + } else {
  23219. + printk (KERN_INFO "tgafb: SFB+ detected, rev=0x%02x\n",
  23220. + fb_info.tga_chip_rev);
  23221. + }
  23222. switch (fb_info.tga_type)
  23223. {
  23224. case TGA_TYPE_8PLANE:
  23225. - strcpy (fb_info.gen.info.modename,"Digital ZLXp-E1");
  23226. + if (pdev)
  23227. + strcpy (fb_info.gen.info.modename,"Digital ZLXp-E1");
  23228. + else
  23229. + strcpy (fb_info.gen.info.modename,"Digital ZLX-E1");
  23230. break;
  23231. case TGA_TYPE_24PLANE:
  23232. - strcpy (fb_info.gen.info.modename,"Digital ZLXp-E2");
  23233. + if (pdev)
  23234. + strcpy (fb_info.gen.info.modename,"Digital ZLXp-E2");
  23235. + else
  23236. + strcpy (fb_info.gen.info.modename,"Digital ZLX-E2");
  23237. break;
  23238. case TGA_TYPE_24PLUSZ:
  23239. - strcpy (fb_info.gen.info.modename,"Digital ZLXp-E3");
  23240. + if (pdev)
  23241. + strcpy (fb_info.gen.info.modename,"Digital ZLXp-E3");
  23242. + else
  23243. + strcpy (fb_info.gen.info.modename,"Digital ZLX-E3");
  23244. break;
  23245. }
  23246. /* This should give a reasonable default video mode */
  23247. if (!default_var_valid) {
  23248. - default_var = tgafb_predefined[0].var;
  23249. + if (pdev)
  23250. + default_var = tgafb_predefined[0].var;
  23251. + else
  23252. + default_var = tgafb_predefined[1].var;
  23253. }
  23254. fbgen_get_var(&disp.var, -1, &fb_info.gen.info);
  23255. disp.var.activate = FB_ACTIVATE_NOW;
  23256. fbgen_do_set_var(&disp.var, 1, &fb_info.gen);
  23257. fbgen_set_disp(-1, &fb_info.gen);
  23258. fbgen_install_cmap(0, &fb_info.gen);
  23259. - if (register_framebuffer(&fb_info.gen.info) < 0)
  23260. + if (register_framebuffer(&fb_info.gen.info) < 0) {
  23261. + if (slot >= 0)
  23262. + release_tc_card(slot);
  23263. return -EINVAL;
  23264. - printk(KERN_INFO "fb%d: %s frame buffer device at 0x%lx\n",
  23265. + }
  23266. + printk(KERN_INFO "fb%d: %s frame buffer device at 0x%llx\n",
  23267. GET_FB_IDX(fb_info.gen.info.node), fb_info.gen.info.modename,
  23268. - pdev->resource[0].start);
  23269. + fb_info.tga_mem_base);
  23270. return 0;
  23271. }
  23272. Index: linux-2.4.35.4/drivers/video/tgafb.h
  23273. ===================================================================
  23274. --- linux-2.4.35.4.orig/drivers/video/tgafb.h
  23275. +++ linux-2.4.35.4/drivers/video/tgafb.h
  23276. @@ -36,6 +36,7 @@
  23277. #define TGA_RASTEROP_REG 0x0034
  23278. #define TGA_PIXELSHIFT_REG 0x0038
  23279. #define TGA_DEEP_REG 0x0050
  23280. +#define TGA_START_REG 0x0054
  23281. #define TGA_PIXELMASK_REG 0x005c
  23282. #define TGA_CURSOR_BASE_REG 0x0060
  23283. #define TGA_HORIZ_REG 0x0064
  23284. Index: linux-2.4.35.4/fs/binfmt_elf.c
  23285. ===================================================================
  23286. --- linux-2.4.35.4.orig/fs/binfmt_elf.c
  23287. +++ linux-2.4.35.4/fs/binfmt_elf.c
  23288. @@ -665,6 +665,9 @@ static int load_elf_binary(struct linux_
  23289. bprm->argc++;
  23290. }
  23291. }
  23292. + } else {
  23293. + /* Executables without an interpreter also need a personality */
  23294. + SET_PERSONALITY(elf_ex, ibcs2_interpreter);
  23295. }
  23296. /* Flush all traces of the currently running executable */
  23297. @@ -1225,7 +1228,11 @@ static int elf_core_dump(long signr, str
  23298. elf.e_entry = 0;
  23299. elf.e_phoff = sizeof(elf);
  23300. elf.e_shoff = 0;
  23301. +#ifdef ELF_CORE_EFLAGS
  23302. + elf.e_flags = ELF_CORE_EFLAGS;
  23303. +#else
  23304. elf.e_flags = 0;
  23305. +#endif
  23306. elf.e_ehsize = sizeof(elf);
  23307. elf.e_phentsize = sizeof(struct elf_phdr);
  23308. elf.e_phnum = segs+1; /* Include notes */
  23309. Index: linux-2.4.35.4/fs/partitions/sgi.c
  23310. ===================================================================
  23311. --- linux-2.4.35.4.orig/fs/partitions/sgi.c
  23312. +++ linux-2.4.35.4/fs/partitions/sgi.c
  23313. @@ -17,6 +17,11 @@
  23314. #include "check.h"
  23315. #include "sgi.h"
  23316. +#if CONFIG_BLK_DEV_MD
  23317. +extern void md_autodetect_dev(kdev_t dev);
  23318. +#endif
  23319. +
  23320. +
  23321. int sgi_partition(struct gendisk *hd, struct block_device *bdev, unsigned long first_sector, int current_minor)
  23322. {
  23323. int i, csum, magic;
  23324. @@ -77,6 +82,10 @@ int sgi_partition(struct gendisk *hd, st
  23325. if(!blocks)
  23326. continue;
  23327. add_gd_partition(hd, current_minor, start, blocks);
  23328. +#ifdef CONFIG_BLK_DEV_MD
  23329. + if (be32_to_cpu(p->type) == LINUX_RAID_PARTITION)
  23330. + md_autodetect_dev(MKDEV(hd->major, current_minor));
  23331. +#endif
  23332. current_minor++;
  23333. }
  23334. printk("\n");
  23335. Index: linux-2.4.35.4/fs/proc/array.c
  23336. ===================================================================
  23337. --- linux-2.4.35.4.orig/fs/proc/array.c
  23338. +++ linux-2.4.35.4/fs/proc/array.c
  23339. @@ -368,15 +368,15 @@ int proc_pid_stat(struct task_struct *ta
  23340. task->cmin_flt,
  23341. task->maj_flt,
  23342. task->cmaj_flt,
  23343. - task->times.tms_utime,
  23344. - task->times.tms_stime,
  23345. - task->times.tms_cutime,
  23346. - task->times.tms_cstime,
  23347. + hz_to_std(task->times.tms_utime),
  23348. + hz_to_std(task->times.tms_stime),
  23349. + hz_to_std(task->times.tms_cutime),
  23350. + hz_to_std(task->times.tms_cstime),
  23351. priority,
  23352. nice,
  23353. 0UL /* removed */,
  23354. task->it_real_value,
  23355. - task->start_time,
  23356. + hz_to_std(task->start_time),
  23357. vsize,
  23358. mm ? mm->rss : 0, /* you might want to shift this left 3 */
  23359. task->rlim[RLIMIT_RSS].rlim_cur,
  23360. @@ -615,14 +615,14 @@ int proc_pid_cpu(struct task_struct *tas
  23361. len = sprintf(buffer,
  23362. "cpu %lu %lu\n",
  23363. - task->times.tms_utime,
  23364. - task->times.tms_stime);
  23365. + hz_to_std(task->times.tms_utime),
  23366. + hz_to_std(task->times.tms_stime));
  23367. for (i = 0 ; i < smp_num_cpus; i++)
  23368. len += sprintf(buffer + len, "cpu%d %lu %lu\n",
  23369. i,
  23370. - task->per_cpu_utime[cpu_logical_map(i)],
  23371. - task->per_cpu_stime[cpu_logical_map(i)]);
  23372. + hz_to_std(task->per_cpu_utime[cpu_logical_map(i)]),
  23373. + hz_to_std(task->per_cpu_stime[cpu_logical_map(i)]));
  23374. return len;
  23375. }
  23376. Index: linux-2.4.35.4/fs/proc/proc_misc.c
  23377. ===================================================================
  23378. --- linux-2.4.35.4.orig/fs/proc/proc_misc.c
  23379. +++ linux-2.4.35.4/fs/proc/proc_misc.c
  23380. @@ -308,16 +308,16 @@ static int kstat_read_proc(char *page, c
  23381. {
  23382. int i, len = 0;
  23383. extern unsigned long total_forks;
  23384. - unsigned long jif = jiffies;
  23385. + unsigned long jif = hz_to_std(jiffies);
  23386. unsigned int sum = 0, user = 0, nice = 0, system = 0;
  23387. int major, disk;
  23388. for (i = 0 ; i < smp_num_cpus; i++) {
  23389. int cpu = cpu_logical_map(i), j;
  23390. - user += kstat.per_cpu_user[cpu];
  23391. - nice += kstat.per_cpu_nice[cpu];
  23392. - system += kstat.per_cpu_system[cpu];
  23393. + user += hz_to_std(kstat.per_cpu_user[cpu]);
  23394. + nice += hz_to_std(kstat.per_cpu_nice[cpu]);
  23395. + system += hz_to_std(kstat.per_cpu_system[cpu]);
  23396. #if !defined(CONFIG_ARCH_S390)
  23397. for (j = 0 ; j < NR_IRQS ; j++)
  23398. sum += kstat.irqs[cpu][j];
  23399. @@ -331,10 +331,10 @@ static int kstat_read_proc(char *page, c
  23400. proc_sprintf(page, &off, &len,
  23401. "cpu%d %u %u %u %lu\n",
  23402. i,
  23403. - kstat.per_cpu_user[cpu_logical_map(i)],
  23404. - kstat.per_cpu_nice[cpu_logical_map(i)],
  23405. - kstat.per_cpu_system[cpu_logical_map(i)],
  23406. - jif - ( kstat.per_cpu_user[cpu_logical_map(i)] \
  23407. + hz_to_std(kstat.per_cpu_user[cpu_logical_map(i)]),
  23408. + hz_to_std(kstat.per_cpu_nice[cpu_logical_map(i)]),
  23409. + hz_to_std(kstat.per_cpu_system[cpu_logical_map(i)]),
  23410. + jif - hz_to_std( kstat.per_cpu_user[cpu_logical_map(i)] \
  23411. + kstat.per_cpu_nice[cpu_logical_map(i)] \
  23412. + kstat.per_cpu_system[cpu_logical_map(i)]));
  23413. proc_sprintf(page, &off, &len,
  23414. Index: linux-2.4.35.4/include/asm-alpha/param.h
  23415. ===================================================================
  23416. --- linux-2.4.35.4.orig/include/asm-alpha/param.h
  23417. +++ linux-2.4.35.4/include/asm-alpha/param.h
  23418. @@ -13,6 +13,9 @@
  23419. # else
  23420. # define HZ 1200
  23421. # endif
  23422. +#ifdef __KERNEL__
  23423. +# define hz_to_std(a) (a)
  23424. +#endif
  23425. #endif
  23426. #define EXEC_PAGESIZE 8192
  23427. Index: linux-2.4.35.4/include/asm-i386/param.h
  23428. ===================================================================
  23429. --- linux-2.4.35.4.orig/include/asm-i386/param.h
  23430. +++ linux-2.4.35.4/include/asm-i386/param.h
  23431. @@ -3,6 +3,9 @@
  23432. #ifndef HZ
  23433. #define HZ 100
  23434. +#ifdef __KERNEL__
  23435. +#define hz_to_std(a) (a)
  23436. +#endif
  23437. #endif
  23438. #define EXEC_PAGESIZE 4096
  23439. Index: linux-2.4.35.4/include/asm-ia64/param.h
  23440. ===================================================================
  23441. --- linux-2.4.35.4.orig/include/asm-ia64/param.h
  23442. +++ linux-2.4.35.4/include/asm-ia64/param.h
  23443. @@ -7,9 +7,15 @@
  23444. * Based on <asm-i386/param.h>.
  23445. *
  23446. * Modified 1998, 1999, 2002-2003
  23447. - * David Mosberger-Tang <[email protected]>, Hewlett-Packard Co
  23448. + * David Mosberger-Tang <[email protected]>, Hewlett-Packard Co
  23449. */
  23450. +#include <linux/config.h>
  23451. +
  23452. +#ifdef __KERNEL__
  23453. +#define hz_to_std(a) (a)
  23454. +#endif
  23455. +
  23456. #define EXEC_PAGESIZE 65536
  23457. #ifndef NGROUPS
  23458. Index: linux-2.4.35.4/include/asm-m68k/param.h
  23459. ===================================================================
  23460. --- linux-2.4.35.4.orig/include/asm-m68k/param.h
  23461. +++ linux-2.4.35.4/include/asm-m68k/param.h
  23462. @@ -3,6 +3,9 @@
  23463. #ifndef HZ
  23464. #define HZ 100
  23465. +#ifdef __KERNEL__
  23466. +#define hz_to_std(a) (a)
  23467. +#endif
  23468. #endif
  23469. #define EXEC_PAGESIZE 8192
  23470. Index: linux-2.4.35.4/include/asm-mips/au1000_gpio.h
  23471. ===================================================================
  23472. --- linux-2.4.35.4.orig/include/asm-mips/au1000_gpio.h
  23473. +++ linux-2.4.35.4/include/asm-mips/au1000_gpio.h
  23474. @@ -30,6 +30,13 @@
  23475. * 675 Mass Ave, Cambridge, MA 02139, USA.
  23476. */
  23477. +/*
  23478. + * Revision history
  23479. + * 01/31/02 0.01 Initial release. Steve Longerbeam, MontaVista
  23480. + * 10/12/03 0.1 Added Au1100/Au1500, GPIO2, and bit operations. K.C. Nishio, AMD
  23481. + * 08/05/04 0.11 Added Au1550 and Au1200. K.C. Nishio
  23482. + */
  23483. +
  23484. #ifndef __AU1000_GPIO_H
  23485. #define __AU1000_GPIO_H
  23486. @@ -44,13 +51,94 @@
  23487. #define AU1000GPIO_TRISTATE _IOW (AU1000GPIO_IOC_MAGIC, 4, int)
  23488. #define AU1000GPIO_AVAIL_MASK _IOR (AU1000GPIO_IOC_MAGIC, 5, int)
  23489. +// bit operations
  23490. +#define AU1000GPIO_BIT_READ _IOW (AU1000GPIO_IOC_MAGIC, 6, int)
  23491. +#define AU1000GPIO_BIT_SET _IOW (AU1000GPIO_IOC_MAGIC, 7, int)
  23492. +#define AU1000GPIO_BIT_CLEAR _IOW (AU1000GPIO_IOC_MAGIC, 8, int)
  23493. +#define AU1000GPIO_BIT_TRISTATE _IOW (AU1000GPIO_IOC_MAGIC, 9, int)
  23494. +#define AU1000GPIO_BIT_INIT _IOW (AU1000GPIO_IOC_MAGIC, 10, int)
  23495. +#define AU1000GPIO_BIT_TERM _IOW (AU1000GPIO_IOC_MAGIC, 11, int)
  23496. +
  23497. +/* set this major numer same as the CRIS GPIO driver */
  23498. +#define AU1X00_GPIO_MAJOR (120)
  23499. +
  23500. +#define ENABLED_ZERO (0)
  23501. +#define ENABLED_ONE (1)
  23502. +#define ENABLED_10 (0x2)
  23503. +#define ENABLED_11 (0x3)
  23504. +#define ENABLED_111 (0x7)
  23505. +#define NOT_AVAIL (-1)
  23506. +#define AU1X00_MAX_PRIMARY_GPIO (32)
  23507. +
  23508. +#define AU1000_GPIO_MINOR_MAX AU1X00_MAX_PRIMARY_GPIO
  23509. +/* Au1100, 1500, 1550 and 1200 have the secondary GPIO block */
  23510. +#define AU1XX0_GPIO_MINOR_MAX (48)
  23511. +
  23512. +#define AU1X00_GPIO_NAME "gpio"
  23513. +
  23514. +/* GPIO pins which are not multiplexed */
  23515. +#if defined(CONFIG_SOC_AU1000)
  23516. + #define NATIVE_GPIOPIN ((1 << 15) | (1 << 8) | (1 << 7) | (1 << 1) | (1 << 0))
  23517. + #define NATIVE_GPIO2PIN (0)
  23518. +#elif defined(CONFIG_SOC_AU1100)
  23519. + #define NATIVE_GPIOPIN ((1 << 23) | (1 << 22) | (1 << 21) | (1 << 20) | (1 << 19) | (1 << 18) | \
  23520. + (1 << 17) | (1 << 16) | (1 << 7) | (1 << 1) | (1 << 0))
  23521. + #define NATIVE_GPIO2PIN (0)
  23522. +#elif defined(CONFIG_SOC_AU1500)
  23523. + #define NATIVE_GPIOPIN ((1 << 15) | (1 << 8) | (1 << 7) | (1 << 1) | (1 << 0))
  23524. + /* exclude the PCI reset output signal: GPIO[200], DMA_REQ2 and DMA_REQ3 */
  23525. + #define NATIVE_GPIO2PIN (0xfffe & ~((1 << 9) | (1 << 8)))
  23526. +#elif defined(CONFIG_SOC_AU1550)
  23527. + #define NATIVE_GPIOPIN ((1 << 15) | (1 << 8) | (1 << 7) | (1 << 6) | (1 << 1) | (1 << 0))
  23528. + /* please refere Au1550 Data Book, chapter 15 */
  23529. + #define NATIVE_GPIO2PIN (1 << 5)
  23530. +#elif defined(CONFIG_SOC_AU1200)
  23531. + #define NATIVE_GPIOPIN ((1 << 7) | (1 << 5))
  23532. + #define NATIVE_GPIO2PIN (0)
  23533. +#endif
  23534. +
  23535. +/* minor as u32 */
  23536. +#define MINOR_TO_GPIOPIN(minor) ((minor < AU1X00_MAX_PRIMARY_GPIO) ? minor : (minor - AU1X00_MAX_PRIMARY_GPIO))
  23537. +#define IS_PRIMARY_GPIOPIN(minor) ((minor < AU1X00_MAX_PRIMARY_GPIO) ? 1 : 0)
  23538. +
  23539. +/*
  23540. + * pin to minor mapping.
  23541. + * GPIO0-GPIO31, minor=0-31.
  23542. + * GPIO200-GPIO215, minor=32-47.
  23543. + */
  23544. +typedef struct _au1x00_gpio_bit_ctl {
  23545. + int direction; // The direction of this GPIO pin. 0: IN, 1: OUT.
  23546. + int data; // Pin output when itized (0/1), or at the term. 0/1/-1 (tristate).
  23547. +} au1x00_gpio_bit_ctl;
  23548. +
  23549. +typedef struct _au1x00_gpio_driver {
  23550. + const char *driver_name;
  23551. + const char *name;
  23552. + int name_base; /* offset of printed name */
  23553. + short major; /* major device number */
  23554. + short minor_start; /* start of minor device number*/
  23555. + short num; /* number of devices */
  23556. +} au1x00_gpio_driver;
  23557. +
  23558. #ifdef __KERNEL__
  23559. -extern u32 get_au1000_avail_gpio_mask(void);
  23560. -extern int au1000gpio_tristate(u32 data);
  23561. -extern int au1000gpio_in(u32 *data);
  23562. -extern int au1000gpio_set(u32 data);
  23563. -extern int au1000gpio_clear(u32 data);
  23564. -extern int au1000gpio_out(u32 data);
  23565. +extern u32 get_au1000_avail_gpio_mask(u32 *avail_gpio2);
  23566. +extern int au1000gpio_tristate(u32 minor, u32 data);
  23567. +extern int au1000gpio_in(u32 minor, u32 *data);
  23568. +extern int au1000gpio_set(u32 minor, u32 data);
  23569. +extern int au1000gpio_clear(u32 minor, u32 data);
  23570. +extern int au1000gpio_out(u32 minor, u32 data);
  23571. +extern int au1000gpio_bit_read(u32 minor, u32 *read_data);
  23572. +extern int au1000gpio_bit_set(u32 minor);
  23573. +extern int au1000gpio_bit_clear(u32 minor);
  23574. +extern int au1000gpio_bit_tristate(u32 minor);
  23575. +extern int check_minor_to_gpio(u32 minor);
  23576. +extern int au1000gpio_bit_init(u32 minor, au1x00_gpio_bit_ctl *bit_opt);
  23577. +extern int au1000gpio_bit_term(u32 minor, au1x00_gpio_bit_ctl *bit_opt);
  23578. +
  23579. +extern void gpio_register_devfs (au1x00_gpio_driver *driver, unsigned int flags, unsigned minor);
  23580. +extern void gpio_unregister_devfs (au1x00_gpio_driver *driver, unsigned minor);
  23581. +extern int gpio_register_driver(au1x00_gpio_driver *driver);
  23582. +extern int gpio_unregister_driver(au1x00_gpio_driver *driver);
  23583. #endif
  23584. #endif
  23585. Index: linux-2.4.35.4/include/asm-mips/au1000.h
  23586. ===================================================================
  23587. --- linux-2.4.35.4.orig/include/asm-mips/au1000.h
  23588. +++ linux-2.4.35.4/include/asm-mips/au1000.h
  23589. @@ -160,28 +160,356 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  23590. #define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
  23591. #endif
  23592. -/* SDRAM Controller */
  23593. +/*
  23594. + * SDRAM Register Offsets
  23595. + */
  23596. #if defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1100)
  23597. -#define MEM_SDMODE0 0xB4000000
  23598. -#define MEM_SDMODE1 0xB4000004
  23599. -#define MEM_SDMODE2 0xB4000008
  23600. -
  23601. -#define MEM_SDADDR0 0xB400000C
  23602. -#define MEM_SDADDR1 0xB4000010
  23603. -#define MEM_SDADDR2 0xB4000014
  23604. -
  23605. -#define MEM_SDREFCFG 0xB4000018
  23606. -#define MEM_SDPRECMD 0xB400001C
  23607. -#define MEM_SDAUTOREF 0xB4000020
  23608. -
  23609. -#define MEM_SDWRMD0 0xB4000024
  23610. -#define MEM_SDWRMD1 0xB4000028
  23611. -#define MEM_SDWRMD2 0xB400002C
  23612. +#define MEM_SDMODE0 (0x0000)
  23613. +#define MEM_SDMODE1 (0x0004)
  23614. +#define MEM_SDMODE2 (0x0008)
  23615. +#define MEM_SDADDR0 (0x000C)
  23616. +#define MEM_SDADDR1 (0x0010)
  23617. +#define MEM_SDADDR2 (0x0014)
  23618. +#define MEM_SDREFCFG (0x0018)
  23619. +#define MEM_SDPRECMD (0x001C)
  23620. +#define MEM_SDAUTOREF (0x0020)
  23621. +#define MEM_SDWRMD0 (0x0024)
  23622. +#define MEM_SDWRMD1 (0x0028)
  23623. +#define MEM_SDWRMD2 (0x002C)
  23624. +#define MEM_SDSLEEP (0x0030)
  23625. +#define MEM_SDSMCKE (0x0034)
  23626. +
  23627. +#ifndef ASSEMBLER
  23628. +/*typedef volatile struct
  23629. +{
  23630. + uint32 sdmode0;
  23631. + uint32 sdmode1;
  23632. + uint32 sdmode2;
  23633. + uint32 sdaddr0;
  23634. + uint32 sdaddr1;
  23635. + uint32 sdaddr2;
  23636. + uint32 sdrefcfg;
  23637. + uint32 sdautoref;
  23638. + uint32 sdwrmd0;
  23639. + uint32 sdwrmd1;
  23640. + uint32 sdwrmd2;
  23641. + uint32 sdsleep;
  23642. + uint32 sdsmcke;
  23643. +
  23644. +} AU1X00_SDRAM;*/
  23645. +#endif
  23646. +
  23647. +/*
  23648. + * MEM_SDMODE register content definitions
  23649. + */
  23650. +#define MEM_SDMODE_F (1<<22)
  23651. +#define MEM_SDMODE_SR (1<<21)
  23652. +#define MEM_SDMODE_BS (1<<20)
  23653. +#define MEM_SDMODE_RS (3<<18)
  23654. +#define MEM_SDMODE_CS (7<<15)
  23655. +#define MEM_SDMODE_TRAS (15<<11)
  23656. +#define MEM_SDMODE_TMRD (3<<9)
  23657. +#define MEM_SDMODE_TWR (3<<7)
  23658. +#define MEM_SDMODE_TRP (3<<5)
  23659. +#define MEM_SDMODE_TRCD (3<<3)
  23660. +#define MEM_SDMODE_TCL (7<<0)
  23661. +
  23662. +#define MEM_SDMODE_BS_2Bank (0<<20)
  23663. +#define MEM_SDMODE_BS_4Bank (1<<20)
  23664. +#define MEM_SDMODE_RS_11Row (0<<18)
  23665. +#define MEM_SDMODE_RS_12Row (1<<18)
  23666. +#define MEM_SDMODE_RS_13Row (2<<18)
  23667. +#define MEM_SDMODE_RS_N(N) ((N)<<18)
  23668. +#define MEM_SDMODE_CS_7Col (0<<15)
  23669. +#define MEM_SDMODE_CS_8Col (1<<15)
  23670. +#define MEM_SDMODE_CS_9Col (2<<15)
  23671. +#define MEM_SDMODE_CS_10Col (3<<15)
  23672. +#define MEM_SDMODE_CS_11Col (4<<15)
  23673. +#define MEM_SDMODE_CS_N(N) ((N)<<15)
  23674. +#define MEM_SDMODE_TRAS_N(N) ((N)<<11)
  23675. +#define MEM_SDMODE_TMRD_N(N) ((N)<<9)
  23676. +#define MEM_SDMODE_TWR_N(N) ((N)<<7)
  23677. +#define MEM_SDMODE_TRP_N(N) ((N)<<5)
  23678. +#define MEM_SDMODE_TRCD_N(N) ((N)<<3)
  23679. +#define MEM_SDMODE_TCL_N(N) ((N)<<0)
  23680. +
  23681. +/*
  23682. + * MEM_SDADDR register contents definitions
  23683. + */
  23684. +#define MEM_SDADDR_E (1<<20)
  23685. +#define MEM_SDADDR_CSBA (0x03FF<<10)
  23686. +#define MEM_SDADDR_CSMASK (0x03FF<<0)
  23687. +#define MEM_SDADDR_CSBA_N(N) ((N)&(0x03FF<<22)>>12)
  23688. +#define MEM_SDADDR_CSMASK_N(N) ((N)&(0x03FF<<22)>>22)
  23689. +
  23690. +/*
  23691. + * MEM_SDREFCFG register content definitions
  23692. + */
  23693. +#define MEM_SDREFCFG_TRC (15<<28)
  23694. +#define MEM_SDREFCFG_TRPM (3<<26)
  23695. +#define MEM_SDREFCFG_E (1<<25)
  23696. +#define MEM_SDREFCFG_RE (0x1ffffff<<0)
  23697. +#define MEM_SDREFCFG_TRC_N(N) ((N)<<MEM_SDREFCFG_TRC)
  23698. +#define MEM_SDREFCFG_TRPM_N(N) ((N)<<MEM_SDREFCFG_TRPM)
  23699. +#define MEM_SDREFCFG_REF_N(N) (N)
  23700. +#endif
  23701. +
  23702. +/***********************************************************************/
  23703. +
  23704. +/*
  23705. + * Au1550 SDRAM Register Offsets
  23706. + */
  23707. +
  23708. +/***********************************************************************/
  23709. +
  23710. +#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
  23711. +#define MEM_SDMODE0 (0x0800)
  23712. +#define MEM_SDMODE1 (0x0808)
  23713. +#define MEM_SDMODE2 (0x0810)
  23714. +#define MEM_SDADDR0 (0x0820)
  23715. +#define MEM_SDADDR1 (0x0828)
  23716. +#define MEM_SDADDR2 (0x0830)
  23717. +#define MEM_SDCONFIGA (0x0840)
  23718. +#define MEM_SDCONFIGB (0x0848)
  23719. +#define MEM_SDSTAT (0x0850)
  23720. +#define MEM_SDERRADDR (0x0858)
  23721. +#define MEM_SDSTRIDE0 (0x0860)
  23722. +#define MEM_SDSTRIDE1 (0x0868)
  23723. +#define MEM_SDSTRIDE2 (0x0870)
  23724. +#define MEM_SDWRMD0 (0x0880)
  23725. +#define MEM_SDWRMD1 (0x0888)
  23726. +#define MEM_SDWRMD2 (0x0890)
  23727. +#define MEM_SDPRECMD (0x08C0)
  23728. +#define MEM_SDAUTOREF (0x08C8)
  23729. +#define MEM_SDSREF (0x08D0)
  23730. +#define MEM_SDSLEEP MEM_SDSREF
  23731. +
  23732. +#ifndef ASSEMBLER
  23733. +/*typedef volatile struct
  23734. +{
  23735. + uint32 sdmode0;
  23736. + uint32 reserved0;
  23737. + uint32 sdmode1;
  23738. + uint32 reserved1;
  23739. + uint32 sdmode2;
  23740. + uint32 reserved2[3];
  23741. + uint32 sdaddr0;
  23742. + uint32 reserved3;
  23743. + uint32 sdaddr1;
  23744. + uint32 reserved4;
  23745. + uint32 sdaddr2;
  23746. + uint32 reserved5[3];
  23747. + uint32 sdconfiga;
  23748. + uint32 reserved6;
  23749. + uint32 sdconfigb;
  23750. + uint32 reserved7;
  23751. + uint32 sdstat;
  23752. + uint32 reserved8;
  23753. + uint32 sderraddr;
  23754. + uint32 reserved9;
  23755. + uint32 sdstride0;
  23756. + uint32 reserved10;
  23757. + uint32 sdstride1;
  23758. + uint32 reserved11;
  23759. + uint32 sdstride2;
  23760. + uint32 reserved12[3];
  23761. + uint32 sdwrmd0;
  23762. + uint32 reserved13;
  23763. + uint32 sdwrmd1;
  23764. + uint32 reserved14;
  23765. + uint32 sdwrmd2;
  23766. + uint32 reserved15[11];
  23767. + uint32 sdprecmd;
  23768. + uint32 reserved16;
  23769. + uint32 sdautoref;
  23770. + uint32 reserved17;
  23771. + uint32 sdsref;
  23772. +
  23773. +} AU1550_SDRAM;*/
  23774. +#endif
  23775. +#endif
  23776. +
  23777. +/*
  23778. + * Physical base addresses for integrated peripherals
  23779. + */
  23780. +
  23781. +#ifdef CONFIG_SOC_AU1000
  23782. +#define MEM_PHYS_ADDR 0x14000000
  23783. +#define STATIC_MEM_PHYS_ADDR 0x14001000
  23784. +#define DMA0_PHYS_ADDR 0x14002000
  23785. +#define DMA1_PHYS_ADDR 0x14002100
  23786. +#define DMA2_PHYS_ADDR 0x14002200
  23787. +#define DMA3_PHYS_ADDR 0x14002300
  23788. +#define DMA4_PHYS_ADDR 0x14002400
  23789. +#define DMA5_PHYS_ADDR 0x14002500
  23790. +#define DMA6_PHYS_ADDR 0x14002600
  23791. +#define DMA7_PHYS_ADDR 0x14002700
  23792. +#define IC0_PHYS_ADDR 0x10400000
  23793. +#define IC1_PHYS_ADDR 0x11800000
  23794. +#define AC97_PHYS_ADDR 0x10000000
  23795. +#define USBH_PHYS_ADDR 0x10100000
  23796. +#define USBD_PHYS_ADDR 0x10200000
  23797. +#define IRDA_PHYS_ADDR 0x10300000
  23798. +#define MAC0_PHYS_ADDR 0x10500000
  23799. +#define MAC1_PHYS_ADDR 0x10510000
  23800. +#define MACEN_PHYS_ADDR 0x10520000
  23801. +#define MACDMA0_PHYS_ADDR 0x14004000
  23802. +#define MACDMA1_PHYS_ADDR 0x14004200
  23803. +#define I2S_PHYS_ADDR 0x11000000
  23804. +#define UART0_PHYS_ADDR 0x11100000
  23805. +#define UART1_PHYS_ADDR 0x11200000
  23806. +#define UART2_PHYS_ADDR 0x11300000
  23807. +#define UART3_PHYS_ADDR 0x11400000
  23808. +#define SSI0_PHYS_ADDR 0x11600000
  23809. +#define SSI1_PHYS_ADDR 0x11680000
  23810. +#define SYS_PHYS_ADDR 0x11900000
  23811. +#define PCMCIA_IO_PHYS_ADDR 0xF00000000
  23812. +#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000
  23813. +#define PCMCIA_MEM_PHYS_ADDR 0xF80000000
  23814. +#endif
  23815. +
  23816. +/********************************************************************/
  23817. -#define MEM_SDSLEEP 0xB4000030
  23818. -#define MEM_SDSMCKE 0xB4000034
  23819. +#ifdef CONFIG_SOC_AU1500
  23820. +#define MEM_PHYS_ADDR 0x14000000
  23821. +#define STATIC_MEM_PHYS_ADDR 0x14001000
  23822. +#define DMA0_PHYS_ADDR 0x14002000
  23823. +#define DMA1_PHYS_ADDR 0x14002100
  23824. +#define DMA2_PHYS_ADDR 0x14002200
  23825. +#define DMA3_PHYS_ADDR 0x14002300
  23826. +#define DMA4_PHYS_ADDR 0x14002400
  23827. +#define DMA5_PHYS_ADDR 0x14002500
  23828. +#define DMA6_PHYS_ADDR 0x14002600
  23829. +#define DMA7_PHYS_ADDR 0x14002700
  23830. +#define IC0_PHYS_ADDR 0x10400000
  23831. +#define IC1_PHYS_ADDR 0x11800000
  23832. +#define AC97_PHYS_ADDR 0x10000000
  23833. +#define USBH_PHYS_ADDR 0x10100000
  23834. +#define USBD_PHYS_ADDR 0x10200000
  23835. +#define PCI_PHYS_ADDR 0x14005000
  23836. +#define MAC0_PHYS_ADDR 0x11500000
  23837. +#define MAC1_PHYS_ADDR 0x11510000
  23838. +#define MACEN_PHYS_ADDR 0x11520000
  23839. +#define MACDMA0_PHYS_ADDR 0x14004000
  23840. +#define MACDMA1_PHYS_ADDR 0x14004200
  23841. +#define I2S_PHYS_ADDR 0x11000000
  23842. +#define UART0_PHYS_ADDR 0x11100000
  23843. +#define UART3_PHYS_ADDR 0x11400000
  23844. +#define GPIO2_PHYS_ADDR 0x11700000
  23845. +#define SYS_PHYS_ADDR 0x11900000
  23846. +#define PCI_MEM_PHYS_ADDR 0x400000000
  23847. +#define PCI_IO_PHYS_ADDR 0x500000000
  23848. +#define PCI_CONFIG0_PHYS_ADDR 0x600000000
  23849. +#define PCI_CONFIG1_PHYS_ADDR 0x680000000
  23850. +#define PCMCIA_IO_PHYS_ADDR 0xF00000000
  23851. +#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000
  23852. +#define PCMCIA_MEM_PHYS_ADDR 0xF80000000
  23853. #endif
  23854. +/********************************************************************/
  23855. +
  23856. +#ifdef CONFIG_SOC_AU1100
  23857. +#define MEM_PHYS_ADDR 0x14000000
  23858. +#define STATIC_MEM_PHYS_ADDR 0x14001000
  23859. +#define DMA0_PHYS_ADDR 0x14002000
  23860. +#define DMA1_PHYS_ADDR 0x14002100
  23861. +#define DMA2_PHYS_ADDR 0x14002200
  23862. +#define DMA3_PHYS_ADDR 0x14002300
  23863. +#define DMA4_PHYS_ADDR 0x14002400
  23864. +#define DMA5_PHYS_ADDR 0x14002500
  23865. +#define DMA6_PHYS_ADDR 0x14002600
  23866. +#define DMA7_PHYS_ADDR 0x14002700
  23867. +#define IC0_PHYS_ADDR 0x10400000
  23868. +#define SD0_PHYS_ADDR 0x10600000
  23869. +#define SD1_PHYS_ADDR 0x10680000
  23870. +#define IC1_PHYS_ADDR 0x11800000
  23871. +#define AC97_PHYS_ADDR 0x10000000
  23872. +#define USBH_PHYS_ADDR 0x10100000
  23873. +#define USBD_PHYS_ADDR 0x10200000
  23874. +#define IRDA_PHYS_ADDR 0x10300000
  23875. +#define MAC0_PHYS_ADDR 0x10500000
  23876. +#define MACEN_PHYS_ADDR 0x10520000
  23877. +#define MACDMA0_PHYS_ADDR 0x14004000
  23878. +#define MACDMA1_PHYS_ADDR 0x14004200
  23879. +#define I2S_PHYS_ADDR 0x11000000
  23880. +#define UART0_PHYS_ADDR 0x11100000
  23881. +#define UART1_PHYS_ADDR 0x11200000
  23882. +#define UART3_PHYS_ADDR 0x11400000
  23883. +#define SSI0_PHYS_ADDR 0x11600000
  23884. +#define SSI1_PHYS_ADDR 0x11680000
  23885. +#define GPIO2_PHYS_ADDR 0x11700000
  23886. +#define SYS_PHYS_ADDR 0x11900000
  23887. +#define LCD_PHYS_ADDR 0x15000000
  23888. +#define PCMCIA_IO_PHYS_ADDR 0xF00000000
  23889. +#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000
  23890. +#define PCMCIA_MEM_PHYS_ADDR 0xF80000000
  23891. +#endif
  23892. +
  23893. +/***********************************************************************/
  23894. +
  23895. +#ifdef CONFIG_SOC_AU1550
  23896. +#define MEM_PHYS_ADDR 0x14000000
  23897. +#define STATIC_MEM_PHYS_ADDR 0x14001000
  23898. +#define IC0_PHYS_ADDR 0x10400000
  23899. +#define IC1_PHYS_ADDR 0x11800000
  23900. +#define USBH_PHYS_ADDR 0x14020000
  23901. +#define USBD_PHYS_ADDR 0x10200000
  23902. +#define PCI_PHYS_ADDR 0x14005000
  23903. +#define MAC0_PHYS_ADDR 0x10500000
  23904. +#define MAC1_PHYS_ADDR 0x10510000
  23905. +#define MACEN_PHYS_ADDR 0x10520000
  23906. +#define MACDMA0_PHYS_ADDR 0x14004000
  23907. +#define MACDMA1_PHYS_ADDR 0x14004200
  23908. +#define UART0_PHYS_ADDR 0x11100000
  23909. +#define UART1_PHYS_ADDR 0x11200000
  23910. +#define UART3_PHYS_ADDR 0x11400000
  23911. +#define GPIO2_PHYS_ADDR 0x11700000
  23912. +#define SYS_PHYS_ADDR 0x11900000
  23913. +#define DDMA_PHYS_ADDR 0x14002000
  23914. +#define PE_PHYS_ADDR 0x14008000
  23915. +#define PSC0_PHYS_ADDR 0x11A00000
  23916. +#define PSC1_PHYS_ADDR 0x11B00000
  23917. +#define PSC2_PHYS_ADDR 0x10A00000
  23918. +#define PSC3_PHYS_ADDR 0x10B00000
  23919. +#define PCI_MEM_PHYS_ADDR 0x400000000
  23920. +#define PCI_IO_PHYS_ADDR 0x500000000
  23921. +#define PCI_CONFIG0_PHYS_ADDR 0x600000000
  23922. +#define PCI_CONFIG1_PHYS_ADDR 0x680000000
  23923. +#define PCMCIA_IO_PHYS_ADDR 0xF00000000
  23924. +#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000
  23925. +#define PCMCIA_MEM_PHYS_ADDR 0xF80000000
  23926. +#endif
  23927. +
  23928. +/***********************************************************************/
  23929. +
  23930. +#ifdef CONFIG_SOC_AU1200
  23931. +#define MEM_PHYS_ADDR 0x14000000
  23932. +#define STATIC_MEM_PHYS_ADDR 0x14001000
  23933. +#define AES_PHYS_ADDR 0x10300000
  23934. +#define CIM_PHYS_ADDR 0x14004000
  23935. +#define IC0_PHYS_ADDR 0x10400000
  23936. +#define IC1_PHYS_ADDR 0x11800000
  23937. +#define USBM_PHYS_ADDR 0x14020000
  23938. +#define USBH_PHYS_ADDR 0x14020100
  23939. +#define UART0_PHYS_ADDR 0x11100000
  23940. +#define UART1_PHYS_ADDR 0x11200000
  23941. +#define GPIO2_PHYS_ADDR 0x11700000
  23942. +#define SYS_PHYS_ADDR 0x11900000
  23943. +#define DDMA_PHYS_ADDR 0x14002000
  23944. +#define PSC0_PHYS_ADDR 0x11A00000
  23945. +#define PSC1_PHYS_ADDR 0x11B00000
  23946. +#define PCMCIA_IO_PHYS_ADDR 0xF00000000
  23947. +#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000
  23948. +#define PCMCIA_MEM_PHYS_ADDR 0xF80000000
  23949. +#define SD0_PHYS_ADDR 0x10600000
  23950. +#define SD1_PHYS_ADDR 0x10680000
  23951. +#define LCD_PHYS_ADDR 0x15000000
  23952. +#define SWCNT_PHYS_ADDR 0x1110010C
  23953. +#define MAEFE_PHYS_ADDR 0x14012000
  23954. +#define MAEBE_PHYS_ADDR 0x14010000
  23955. +#endif
  23956. +
  23957. +
  23958. /* Static Bus Controller */
  23959. #define MEM_STCFG0 0xB4001000
  23960. #define MEM_STTIME0 0xB4001004
  23961. @@ -367,7 +695,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  23962. #define AU1000_MAC0_ENABLE 0xB0520000
  23963. #define AU1000_MAC1_ENABLE 0xB0520004
  23964. #define NUM_ETH_INTERFACES 2
  23965. -#endif // CONFIG_SOC_AU1000
  23966. +#endif /* CONFIG_SOC_AU1000 */
  23967. /* Au1500 */
  23968. #ifdef CONFIG_SOC_AU1500
  23969. @@ -438,7 +766,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  23970. #define AU1500_MAC0_ENABLE 0xB1520000
  23971. #define AU1500_MAC1_ENABLE 0xB1520004
  23972. #define NUM_ETH_INTERFACES 2
  23973. -#endif // CONFIG_SOC_AU1500
  23974. +#endif /* CONFIG_SOC_AU1500 */
  23975. /* Au1100 */
  23976. #ifdef CONFIG_SOC_AU1100
  23977. @@ -483,6 +811,22 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  23978. #define AU1000_GPIO_13 45
  23979. #define AU1000_GPIO_14 46
  23980. #define AU1000_GPIO_15 47
  23981. +#define AU1000_GPIO_16 48
  23982. +#define AU1000_GPIO_17 49
  23983. +#define AU1000_GPIO_18 50
  23984. +#define AU1000_GPIO_19 51
  23985. +#define AU1000_GPIO_20 52
  23986. +#define AU1000_GPIO_21 53
  23987. +#define AU1000_GPIO_22 54
  23988. +#define AU1000_GPIO_23 55
  23989. +#define AU1000_GPIO_24 56
  23990. +#define AU1000_GPIO_25 57
  23991. +#define AU1000_GPIO_26 58
  23992. +#define AU1000_GPIO_27 59
  23993. +#define AU1000_GPIO_28 60
  23994. +#define AU1000_GPIO_29 61
  23995. +#define AU1000_GPIO_30 62
  23996. +#define AU1000_GPIO_31 63
  23997. #define UART0_ADDR 0xB1100000
  23998. #define UART1_ADDR 0xB1200000
  23999. @@ -494,7 +838,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  24000. #define AU1100_ETH0_BASE 0xB0500000
  24001. #define AU1100_MAC0_ENABLE 0xB0520000
  24002. #define NUM_ETH_INTERFACES 1
  24003. -#endif // CONFIG_SOC_AU1100
  24004. +#endif /* CONFIG_SOC_AU1100 */
  24005. #ifdef CONFIG_SOC_AU1550
  24006. #define AU1550_UART0_INT 0
  24007. @@ -511,14 +855,14 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  24008. #define AU1550_PSC1_INT 11
  24009. #define AU1550_PSC2_INT 12
  24010. #define AU1550_PSC3_INT 13
  24011. -#define AU1550_TOY_INT 14
  24012. -#define AU1550_TOY_MATCH0_INT 15
  24013. -#define AU1550_TOY_MATCH1_INT 16
  24014. -#define AU1550_TOY_MATCH2_INT 17
  24015. -#define AU1550_RTC_INT 18
  24016. -#define AU1550_RTC_MATCH0_INT 19
  24017. -#define AU1550_RTC_MATCH1_INT 20
  24018. -#define AU1550_RTC_MATCH2_INT 21
  24019. +#define AU1000_TOY_INT 14
  24020. +#define AU1000_TOY_MATCH0_INT 15
  24021. +#define AU1000_TOY_MATCH1_INT 16
  24022. +#define AU1000_TOY_MATCH2_INT 17
  24023. +#define AU1000_RTC_INT 18
  24024. +#define AU1000_RTC_MATCH0_INT 19
  24025. +#define AU1000_RTC_MATCH1_INT 20
  24026. +#define AU1000_RTC_MATCH2_INT 21
  24027. #define AU1550_NAND_INT 23
  24028. #define AU1550_USB_DEV_REQ_INT 24
  24029. #define AU1550_USB_DEV_SUS_INT 25
  24030. @@ -573,7 +917,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  24031. #define AU1550_MAC0_ENABLE 0xB0520000
  24032. #define AU1550_MAC1_ENABLE 0xB0520004
  24033. #define NUM_ETH_INTERFACES 2
  24034. -#endif // CONFIG_SOC_AU1550
  24035. +#endif /* CONFIG_SOC_AU1550 */
  24036. #ifdef CONFIG_SOC_AU1200
  24037. #define AU1200_UART0_INT 0
  24038. @@ -590,14 +934,14 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  24039. #define AU1200_PSC1_INT 11
  24040. #define AU1200_AES_INT 12
  24041. #define AU1200_CAMERA_INT 13
  24042. -#define AU1200_TOY_INT 14
  24043. -#define AU1200_TOY_MATCH0_INT 15
  24044. -#define AU1200_TOY_MATCH1_INT 16
  24045. -#define AU1200_TOY_MATCH2_INT 17
  24046. -#define AU1200_RTC_INT 18
  24047. -#define AU1200_RTC_MATCH0_INT 19
  24048. -#define AU1200_RTC_MATCH1_INT 20
  24049. -#define AU1200_RTC_MATCH2_INT 21
  24050. +#define AU1000_TOY_INT 14
  24051. +#define AU1000_TOY_MATCH0_INT 15
  24052. +#define AU1000_TOY_MATCH1_INT 16
  24053. +#define AU1000_TOY_MATCH2_INT 17
  24054. +#define AU1000_RTC_INT 18
  24055. +#define AU1000_RTC_MATCH0_INT 19
  24056. +#define AU1000_RTC_MATCH1_INT 20
  24057. +#define AU1000_RTC_MATCH2_INT 21
  24058. #define AU1200_NAND_INT 23
  24059. #define AU1200_GPIO_204 24
  24060. #define AU1200_GPIO_205 25
  24061. @@ -605,6 +949,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  24062. #define AU1200_GPIO_207 27
  24063. #define AU1200_GPIO_208_215 28 // Logical OR of 208:215
  24064. #define AU1200_USB_INT 29
  24065. +#define AU1000_USB_HOST_INT AU1200_USB_INT
  24066. #define AU1200_LCD_INT 30
  24067. #define AU1200_MAE_BOTH_INT 31
  24068. #define AU1000_GPIO_0 32
  24069. @@ -643,21 +988,36 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  24070. #define UART0_ADDR 0xB1100000
  24071. #define UART1_ADDR 0xB1200000
  24072. -#define USB_OHCI_BASE 0x14020000 // phys addr for ioremap
  24073. -#define USB_HOST_CONFIG 0xB4027ffc
  24074. +#define USB_UOC_BASE 0x14020020
  24075. +#define USB_UOC_LEN 0x20
  24076. +#define USB_OHCI_BASE 0x14020100
  24077. +#define USB_OHCI_LEN 0x100
  24078. +#define USB_EHCI_BASE 0x14020200
  24079. +#define USB_EHCI_LEN 0x100
  24080. +#define USB_UDC_BASE 0x14022000
  24081. +#define USB_UDC_LEN 0x2000
  24082. +#define USB_MSR_BASE 0xB4020000
  24083. +#define USB_MSR_MCFG 4
  24084. +#define USBMSRMCFG_OMEMEN 0
  24085. +#define USBMSRMCFG_OBMEN 1
  24086. +#define USBMSRMCFG_EMEMEN 2
  24087. +#define USBMSRMCFG_EBMEN 3
  24088. +#define USBMSRMCFG_DMEMEN 4
  24089. +#define USBMSRMCFG_DBMEN 5
  24090. +#define USBMSRMCFG_GMEMEN 6
  24091. +#define USBMSRMCFG_OHCCLKEN 16
  24092. +#define USBMSRMCFG_EHCCLKEN 17
  24093. +#define USBMSRMCFG_UDCCLKEN 18
  24094. +#define USBMSRMCFG_PHYPLLEN 19
  24095. +#define USBMSRMCFG_RDCOMB 30
  24096. +#define USBMSRMCFG_PFEN 31
  24097. -// these are here for prototyping on au1550 (do not exist on au1200)
  24098. -#define AU1200_ETH0_BASE 0xB0500000
  24099. -#define AU1200_ETH1_BASE 0xB0510000
  24100. -#define AU1200_MAC0_ENABLE 0xB0520000
  24101. -#define AU1200_MAC1_ENABLE 0xB0520004
  24102. -#define NUM_ETH_INTERFACES 2
  24103. -#endif // CONFIG_SOC_AU1200
  24104. +#endif /* CONFIG_SOC_AU1200 */
  24105. #define AU1000_LAST_INTC0_INT 31
  24106. +#define AU1000_LAST_INTC1_INT 63
  24107. #define AU1000_MAX_INTR 63
  24108. -
  24109. /* Programmable Counters 0 and 1 */
  24110. #define SYS_BASE 0xB1900000
  24111. #define SYS_COUNTER_CNTRL (SYS_BASE + 0x14)
  24112. @@ -728,6 +1088,8 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  24113. #define I2S_CONTROL_D (1<<1)
  24114. #define I2S_CONTROL_CE (1<<0)
  24115. +#ifndef CONFIG_SOC_AU1200
  24116. +
  24117. /* USB Host Controller */
  24118. #define USB_OHCI_LEN 0x00100000
  24119. @@ -773,6 +1135,8 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  24120. #define USBDEV_ENABLE (1<<1)
  24121. #define USBDEV_CE (1<<0)
  24122. +#endif /* !CONFIG_SOC_AU1200 */
  24123. +
  24124. /* Ethernet Controllers */
  24125. /* 4 byte offsets from AU1000_ETH_BASE */
  24126. @@ -1171,6 +1535,37 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  24127. #define SYS_PF_PSC1_S1 (1 << 1)
  24128. #define SYS_PF_MUST_BE_SET ((1 << 5) | (1 << 2))
  24129. +/* Au1200 Only */
  24130. +#ifdef CONFIG_SOC_AU1200
  24131. +#define SYS_PINFUNC_DMA (1<<31)
  24132. +#define SYS_PINFUNC_S0A (1<<30)
  24133. +#define SYS_PINFUNC_S1A (1<<29)
  24134. +#define SYS_PINFUNC_LP0 (1<<28)
  24135. +#define SYS_PINFUNC_LP1 (1<<27)
  24136. +#define SYS_PINFUNC_LD16 (1<<26)
  24137. +#define SYS_PINFUNC_LD8 (1<<25)
  24138. +#define SYS_PINFUNC_LD1 (1<<24)
  24139. +#define SYS_PINFUNC_LD0 (1<<23)
  24140. +#define SYS_PINFUNC_P1A (3<<21)
  24141. +#define SYS_PINFUNC_P1B (1<<20)
  24142. +#define SYS_PINFUNC_FS3 (1<<19)
  24143. +#define SYS_PINFUNC_P0A (3<<17)
  24144. +#define SYS_PINFUNC_CS (1<<16)
  24145. +#define SYS_PINFUNC_CIM (1<<15)
  24146. +#define SYS_PINFUNC_P1C (1<<14)
  24147. +#define SYS_PINFUNC_U1T (1<<12)
  24148. +#define SYS_PINFUNC_U1R (1<<11)
  24149. +#define SYS_PINFUNC_EX1 (1<<10)
  24150. +#define SYS_PINFUNC_EX0 (1<<9)
  24151. +#define SYS_PINFUNC_U0R (1<<8)
  24152. +#define SYS_PINFUNC_MC (1<<7)
  24153. +#define SYS_PINFUNC_S0B (1<<6)
  24154. +#define SYS_PINFUNC_S0C (1<<5)
  24155. +#define SYS_PINFUNC_P0B (1<<4)
  24156. +#define SYS_PINFUNC_U0T (1<<3)
  24157. +#define SYS_PINFUNC_S1B (1<<2)
  24158. +#endif
  24159. +
  24160. #define SYS_TRIOUTRD 0xB1900100
  24161. #define SYS_TRIOUTCLR 0xB1900100
  24162. #define SYS_OUTPUTRD 0xB1900108
  24163. @@ -1298,7 +1693,6 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  24164. #define SD1_XMIT_FIFO 0xB0680000
  24165. #define SD1_RECV_FIFO 0xB0680004
  24166. -
  24167. #if defined (CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)
  24168. /* Au1500 PCI Controller */
  24169. #define Au1500_CFG_BASE 0xB4005000 // virtual, kseg0 addr
  24170. @@ -1388,9 +1782,60 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  24171. #endif
  24172. +#ifndef _LANGUAGE_ASSEMBLY
  24173. +typedef volatile struct
  24174. +{
  24175. + /* 0x0000 */ u32 toytrim;
  24176. + /* 0x0004 */ u32 toywrite;
  24177. + /* 0x0008 */ u32 toymatch0;
  24178. + /* 0x000C */ u32 toymatch1;
  24179. + /* 0x0010 */ u32 toymatch2;
  24180. + /* 0x0014 */ u32 cntrctrl;
  24181. + /* 0x0018 */ u32 scratch0;
  24182. + /* 0x001C */ u32 scratch1;
  24183. + /* 0x0020 */ u32 freqctrl0;
  24184. + /* 0x0024 */ u32 freqctrl1;
  24185. + /* 0x0028 */ u32 clksrc;
  24186. + /* 0x002C */ u32 pinfunc;
  24187. + /* 0x0030 */ u32 reserved0;
  24188. + /* 0x0034 */ u32 wakemsk;
  24189. + /* 0x0038 */ u32 endian;
  24190. + /* 0x003C */ u32 powerctrl;
  24191. + /* 0x0040 */ u32 toyread;
  24192. + /* 0x0044 */ u32 rtctrim;
  24193. + /* 0x0048 */ u32 rtcwrite;
  24194. + /* 0x004C */ u32 rtcmatch0;
  24195. + /* 0x0050 */ u32 rtcmatch1;
  24196. + /* 0x0054 */ u32 rtcmatch2;
  24197. + /* 0x0058 */ u32 rtcread;
  24198. + /* 0x005C */ u32 wakesrc;
  24199. + /* 0x0060 */ u32 cpupll;
  24200. + /* 0x0064 */ u32 auxpll;
  24201. + /* 0x0068 */ u32 reserved1;
  24202. + /* 0x006C */ u32 reserved2;
  24203. + /* 0x0070 */ u32 reserved3;
  24204. + /* 0x0074 */ u32 reserved4;
  24205. + /* 0x0078 */ u32 slppwr;
  24206. + /* 0x007C */ u32 sleep;
  24207. + /* 0x0080 */ u32 reserved5[32];
  24208. + /* 0x0100 */ u32 trioutrd;
  24209. +#define trioutclr trioutrd
  24210. + /* 0x0104 */ u32 reserved6;
  24211. + /* 0x0108 */ u32 outputrd;
  24212. +#define outputset outputrd
  24213. + /* 0x010C */ u32 outputclr;
  24214. + /* 0x0110 */ u32 pinstaterd;
  24215. +#define pininputen pinstaterd
  24216. +
  24217. +} AU1X00_SYS;
  24218. +
  24219. +static AU1X00_SYS* const sys = (AU1X00_SYS *)SYS_BASE;
  24220. +
  24221. +#endif
  24222. /* Processor information base on prid.
  24223. * Copied from PowerPC.
  24224. */
  24225. +#ifndef _LANGUAGE_ASSEMBLY
  24226. struct cpu_spec {
  24227. /* CPU is matched via (PRID & prid_mask) == prid_value */
  24228. unsigned int prid_mask;
  24229. @@ -1404,3 +1849,6 @@ struct cpu_spec {
  24230. extern struct cpu_spec cpu_specs[];
  24231. extern struct cpu_spec *cur_cpu_spec[];
  24232. #endif
  24233. +
  24234. +#endif
  24235. +
  24236. Index: linux-2.4.35.4/include/asm-mips/au1000_pcmcia.h
  24237. ===================================================================
  24238. --- linux-2.4.35.4.orig/include/asm-mips/au1000_pcmcia.h
  24239. +++ linux-2.4.35.4/include/asm-mips/au1000_pcmcia.h
  24240. @@ -38,16 +38,41 @@
  24241. #define AU1X_SOCK0_PHYS_MEM 0xF80000000
  24242. /* pcmcia socket 1 needs external glue logic so the memory map
  24243. - * differs from board to board.
  24244. + * differs from board to board. the general rule is that
  24245. + * static bus address bit 26 should be used to decode socket 0
  24246. + * from socket 1. alas, some boards dont follow this...
  24247. + * These really belong in a board-specific header file...
  24248. */
  24249. -#if defined(CONFIG_MIPS_PB1000) || defined(CONFIG_MIPS_PB1100) || defined(CONFIG_MIPS_PB1500)
  24250. -#define AU1X_SOCK1_IO 0xF08000000
  24251. -#define AU1X_SOCK1_PHYS_ATTR 0xF48000000
  24252. -#define AU1X_SOCK1_PHYS_MEM 0xF88000000
  24253. -#elif defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100) || defined(CONFIG_MIPS_DB1500) || defined(CONFIG_MIPS_PB1550) || defined(CONFIG_MIPS_DB1550)
  24254. -#define AU1X_SOCK1_IO 0xF04000000
  24255. -#define AU1X_SOCK1_PHYS_ATTR 0xF44000000
  24256. -#define AU1X_SOCK1_PHYS_MEM 0xF84000000
  24257. +#ifdef CONFIG_MIPS_PB1000
  24258. +#define SOCK1_DECODE (1<<27)
  24259. +#endif
  24260. +#ifdef CONFIG_MIPS_DB1000
  24261. +#define SOCK1_DECODE (1<<26)
  24262. +#endif
  24263. +#ifdef CONFIG_MIPS_DB1500
  24264. +#define SOCK1_DECODE (1<<26)
  24265. +#endif
  24266. +#ifdef CONFIG_MIPS_DB1100
  24267. +#define SOCK1_DECODE (1<<26)
  24268. +#endif
  24269. +#ifdef CONFIG_MIPS_DB1550
  24270. +#define SOCK1_DECODE (1<<26)
  24271. +#endif
  24272. +#ifdef CONFIG_MIPS_DB1200
  24273. +#define SOCK1_DECODE (1<<26)
  24274. +#endif
  24275. +#ifdef CONFIG_MIPS_PB1550
  24276. +#define SOCK1_DECODE (1<<26)
  24277. +#endif
  24278. +#ifdef CONFIG_MIPS_PB1200
  24279. +#define SOCK1_DECODE (1<<26)
  24280. +#endif
  24281. +
  24282. +/* The board has a second PCMCIA socket */
  24283. +#ifdef SOCK1_DECODE
  24284. +#define AU1X_SOCK1_IO (0xF00000000|SOCK1_DECODE)
  24285. +#define AU1X_SOCK1_PHYS_ATTR (0xF40000000|SOCK1_DECODE)
  24286. +#define AU1X_SOCK1_PHYS_MEM (0xF80000000|SOCK1_DECODE)
  24287. #endif
  24288. struct pcmcia_state {
  24289. Index: linux-2.4.35.4/include/asm-mips/au1100_mmc.h
  24290. ===================================================================
  24291. --- linux-2.4.35.4.orig/include/asm-mips/au1100_mmc.h
  24292. +++ linux-2.4.35.4/include/asm-mips/au1100_mmc.h
  24293. @@ -39,16 +39,22 @@
  24294. #define __ASM_AU1100_MMC_H
  24295. -#define NUM_AU1100_MMC_CONTROLLERS 2
  24296. -
  24297. -
  24298. -#define AU1100_SD_IRQ 2
  24299. -
  24300. +#if defined(CONFIG_SOC_AU1100)
  24301. +#define NUM_MMC_CONTROLLERS 2
  24302. +#define AU1X_MMC_INT AU1100_SD_INT
  24303. +#endif
  24304. +
  24305. +#if defined(CONFIG_SOC_AU1200)
  24306. +#define NUM_MMC_CONTROLLERS 2
  24307. +#define AU1X_MMC_INT AU1200_SD_INT
  24308. +#endif
  24309. #define SD0_BASE 0xB0600000
  24310. #define SD1_BASE 0xB0680000
  24311. +
  24312. +
  24313. /*
  24314. * Register offsets.
  24315. */
  24316. @@ -201,5 +207,12 @@
  24317. #define SD_CMD_RT_1B (0x00810000)
  24318. +/* support routines required on a platform-specific basis */
  24319. +extern void mmc_card_inserted(int _n_, int *_res_);
  24320. +extern void mmc_card_writable(int _n_, int *_res_);
  24321. +extern void mmc_power_on(int _n_);
  24322. +extern void mmc_power_off(int _n_);
  24323. +
  24324. +
  24325. #endif /* __ASM_AU1100_MMC_H */
  24326. Index: linux-2.4.35.4/include/asm-mips/au1xxx_dbdma.h
  24327. ===================================================================
  24328. --- linux-2.4.35.4.orig/include/asm-mips/au1xxx_dbdma.h
  24329. +++ linux-2.4.35.4/include/asm-mips/au1xxx_dbdma.h
  24330. @@ -43,7 +43,7 @@
  24331. #define DDMA_GLOBAL_BASE 0xb4003000
  24332. #define DDMA_CHANNEL_BASE 0xb4002000
  24333. -typedef struct dbdma_global {
  24334. +typedef volatile struct dbdma_global {
  24335. u32 ddma_config;
  24336. u32 ddma_intstat;
  24337. u32 ddma_throttle;
  24338. @@ -60,7 +60,7 @@ typedef struct dbdma_global {
  24339. /* The structure of a DMA Channel.
  24340. */
  24341. -typedef struct au1xxx_dma_channel {
  24342. +typedef volatile struct au1xxx_dma_channel {
  24343. u32 ddma_cfg; /* See below */
  24344. u32 ddma_desptr; /* 32-byte aligned pointer to descriptor */
  24345. u32 ddma_statptr; /* word aligned pointer to status word */
  24346. @@ -96,7 +96,7 @@ typedef struct au1xxx_dma_channel {
  24347. /* "Standard" DDMA Descriptor.
  24348. * Must be 32-byte aligned.
  24349. */
  24350. -typedef struct au1xxx_ddma_desc {
  24351. +typedef volatile struct au1xxx_ddma_desc {
  24352. u32 dscr_cmd0; /* See below */
  24353. u32 dscr_cmd1; /* See below */
  24354. u32 dscr_source0; /* source phys address */
  24355. @@ -105,6 +105,12 @@ typedef struct au1xxx_ddma_desc {
  24356. u32 dscr_dest1; /* See below */
  24357. u32 dscr_stat; /* completion status */
  24358. u32 dscr_nxtptr; /* Next descriptor pointer (mostly) */
  24359. + /* First 32bytes are HW specific!!!
  24360. + Lets have some SW data following.. make sure its 32bytes
  24361. + */
  24362. + u32 sw_status;
  24363. + u32 sw_context;
  24364. + u32 sw_reserved[6];
  24365. } au1x_ddma_desc_t;
  24366. #define DSCR_CMD0_V (1 << 31) /* Descriptor valid */
  24367. @@ -123,6 +129,8 @@ typedef struct au1xxx_ddma_desc {
  24368. #define DSCR_CMD0_CV (0x1 << 2) /* Clear Valid when done */
  24369. #define DSCR_CMD0_ST_MASK (0x3 << 0) /* Status instruction */
  24370. +#define SW_STATUS_INUSE (1<<0)
  24371. +
  24372. /* Command 0 device IDs.
  24373. */
  24374. #ifdef CONFIG_SOC_AU1550
  24375. @@ -169,8 +177,8 @@ typedef struct au1xxx_ddma_desc {
  24376. #define DSCR_CMD0_SDMS_RX0 9
  24377. #define DSCR_CMD0_SDMS_TX1 10
  24378. #define DSCR_CMD0_SDMS_RX1 11
  24379. -#define DSCR_CMD0_AES_TX 12
  24380. -#define DSCR_CMD0_AES_RX 13
  24381. +#define DSCR_CMD0_AES_TX 13
  24382. +#define DSCR_CMD0_AES_RX 12
  24383. #define DSCR_CMD0_PSC0_TX 14
  24384. #define DSCR_CMD0_PSC0_RX 15
  24385. #define DSCR_CMD0_PSC1_TX 16
  24386. @@ -189,6 +197,10 @@ typedef struct au1xxx_ddma_desc {
  24387. #define DSCR_CMD0_THROTTLE 30
  24388. #define DSCR_CMD0_ALWAYS 31
  24389. #define DSCR_NDEV_IDS 32
  24390. +/* THis macro is used to find/create custom device types */
  24391. +#define DSCR_DEV2CUSTOM_ID(x,d) (((((x)&0xFFFF)<<8)|0x32000000)|((d)&0xFF))
  24392. +#define DSCR_CUSTOM2DEV_ID(x) ((x)&0xFF)
  24393. +
  24394. #define DSCR_CMD0_SID(x) (((x) & 0x1f) << 25)
  24395. #define DSCR_CMD0_DID(x) (((x) & 0x1f) << 20)
  24396. @@ -277,6 +289,43 @@ typedef struct au1xxx_ddma_desc {
  24397. */
  24398. #define NUM_DBDMA_CHANS 16
  24399. +/*
  24400. + * Ddma API definitions
  24401. + * FIXME: may not fit to this header file
  24402. + */
  24403. +typedef struct dbdma_device_table {
  24404. + u32 dev_id;
  24405. + u32 dev_flags;
  24406. + u32 dev_tsize;
  24407. + u32 dev_devwidth;
  24408. + u32 dev_physaddr; /* If FIFO */
  24409. + u32 dev_intlevel;
  24410. + u32 dev_intpolarity;
  24411. +} dbdev_tab_t;
  24412. +
  24413. +
  24414. +typedef struct dbdma_chan_config {
  24415. + spinlock_t lock;
  24416. +
  24417. + u32 chan_flags;
  24418. + u32 chan_index;
  24419. + dbdev_tab_t *chan_src;
  24420. + dbdev_tab_t *chan_dest;
  24421. + au1x_dma_chan_t *chan_ptr;
  24422. + au1x_ddma_desc_t *chan_desc_base;
  24423. + au1x_ddma_desc_t *get_ptr, *put_ptr, *cur_ptr;
  24424. + void *chan_callparam;
  24425. + void (*chan_callback)(int, void *, struct pt_regs *);
  24426. +} chan_tab_t;
  24427. +
  24428. +#define DEV_FLAGS_INUSE (1 << 0)
  24429. +#define DEV_FLAGS_ANYUSE (1 << 1)
  24430. +#define DEV_FLAGS_OUT (1 << 2)
  24431. +#define DEV_FLAGS_IN (1 << 3)
  24432. +#define DEV_FLAGS_BURSTABLE (1 << 4)
  24433. +#define DEV_FLAGS_SYNC (1 << 5)
  24434. +/* end Ddma API definitions */
  24435. +
  24436. /* External functions for drivers to use.
  24437. */
  24438. /* Use this to allocate a dbdma channel. The device ids are one of the
  24439. @@ -299,8 +348,8 @@ u32 au1xxx_dbdma_ring_alloc(u32 chanid,
  24440. /* Put buffers on source/destination descriptors.
  24441. */
  24442. -u32 au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes);
  24443. -u32 au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes);
  24444. +u32 _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags);
  24445. +u32 _au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags);
  24446. /* Get a buffer from the destination descriptor.
  24447. */
  24448. @@ -314,5 +363,25 @@ u32 au1xxx_get_dma_residue(u32 chanid);
  24449. void au1xxx_dbdma_chan_free(u32 chanid);
  24450. void au1xxx_dbdma_dump(u32 chanid);
  24451. +u32 au1xxx_dbdma_put_dscr(u32 chanid, au1x_ddma_desc_t *dscr );
  24452. +
  24453. +u32 au1xxx_ddma_add_device( dbdev_tab_t *dev );
  24454. +
  24455. +/*
  24456. + Some compatibilty macros --
  24457. + Needed to make changes to API without breaking existing drivers
  24458. +*/
  24459. +#define au1xxx_dbdma_put_source(chanid,buf,nbytes)_au1xxx_dbdma_put_source(chanid, buf, nbytes, DDMA_FLAGS_IE)
  24460. +#define au1xxx_dbdma_put_source_flags(chanid,buf,nbytes,flags) _au1xxx_dbdma_put_source(chanid, buf, nbytes, flags)
  24461. +
  24462. +#define au1xxx_dbdma_put_dest(chanid,buf,nbytes) _au1xxx_dbdma_put_dest(chanid, buf, nbytes, DDMA_FLAGS_IE)
  24463. +#define au1xxx_dbdma_put_dest_flags(chanid,buf,nbytes,flags) _au1xxx_dbdma_put_dest(chanid, buf, nbytes, flags)
  24464. +
  24465. +/*
  24466. + * Flags for the put_source/put_dest functions.
  24467. + */
  24468. +#define DDMA_FLAGS_IE (1<<0)
  24469. +#define DDMA_FLAGS_NOIE (1<<1)
  24470. +
  24471. #endif /* _LANGUAGE_ASSEMBLY */
  24472. #endif /* _AU1000_DBDMA_H_ */
  24473. Index: linux-2.4.35.4/include/asm-mips/au1xxx_gpio.h
  24474. ===================================================================
  24475. --- /dev/null
  24476. +++ linux-2.4.35.4/include/asm-mips/au1xxx_gpio.h
  24477. @@ -0,0 +1,22 @@
  24478. +
  24479. +
  24480. +#ifndef __AU1XXX_GPIO_H
  24481. +#define __AU1XXX_GPIO_H
  24482. +
  24483. +void au1xxx_gpio1_set_inputs(void);
  24484. +void au1xxx_gpio_tristate(int signal);
  24485. +void au1xxx_gpio_write(int signal, int value);
  24486. +int au1xxx_gpio_read(int signal);
  24487. +
  24488. +typedef volatile struct
  24489. +{
  24490. + u32 dir;
  24491. + u32 reserved;
  24492. + u32 output;
  24493. + u32 pinstate;
  24494. + u32 inten;
  24495. + u32 enable;
  24496. +
  24497. +} AU1X00_GPIO2;
  24498. +
  24499. +#endif //__AU1XXX_GPIO_H
  24500. Index: linux-2.4.35.4/include/asm-mips/au1xxx_psc.h
  24501. ===================================================================
  24502. --- linux-2.4.35.4.orig/include/asm-mips/au1xxx_psc.h
  24503. +++ linux-2.4.35.4/include/asm-mips/au1xxx_psc.h
  24504. @@ -41,6 +41,11 @@
  24505. #define PSC3_BASE_ADDR 0xb0d00000
  24506. #endif
  24507. +#ifdef CONFIG_SOC_AU1200
  24508. +#define PSC0_BASE_ADDR 0xb1a00000
  24509. +#define PSC1_BASE_ADDR 0xb1b00000
  24510. +#endif
  24511. +
  24512. /* The PSC select and control registers are common to
  24513. * all protocols.
  24514. */
  24515. @@ -226,6 +231,8 @@ typedef struct psc_i2s {
  24516. #define PSC_I2SCFG_DD_DISABLE (1 << 27)
  24517. #define PSC_I2SCFG_DE_ENABLE (1 << 26)
  24518. #define PSC_I2SCFG_SET_WS(x) (((((x) / 2) - 1) & 0x7f) << 16)
  24519. +#define PSC_I2SCFG_WS(n) ((n&0xFF)<<16)
  24520. +#define PSC_I2SCFG_WS_MASK (PSC_I2SCFG_WS(0x3F))
  24521. #define PSC_I2SCFG_WI (1 << 15)
  24522. #define PSC_I2SCFG_DIV_MASK (3 << 13)
  24523. Index: linux-2.4.35.4/include/asm-mips/bootinfo.h
  24524. ===================================================================
  24525. --- linux-2.4.35.4.orig/include/asm-mips/bootinfo.h
  24526. +++ linux-2.4.35.4/include/asm-mips/bootinfo.h
  24527. @@ -180,6 +180,9 @@
  24528. #define MACH_MTX1 7 /* 4G MTX-1 Au1500-based board */
  24529. #define MACH_CSB250 8 /* Cogent Au1500 */
  24530. #define MACH_PB1550 9 /* Au1550-based eval board */
  24531. +#define MACH_PB1200 10 /* Au1200-based eval board */
  24532. +#define MACH_DB1550 11 /* Au1550-based eval board */
  24533. +#define MACH_DB1200 12 /* Au1200-based eval board */
  24534. /*
  24535. * Valid machtype for group NEC_VR41XX
  24536. Index: linux-2.4.35.4/include/asm-mips/db1200.h
  24537. ===================================================================
  24538. --- /dev/null
  24539. +++ linux-2.4.35.4/include/asm-mips/db1200.h
  24540. @@ -0,0 +1,214 @@
  24541. +/*
  24542. + * AMD Alchemy DB1200 Referrence Board
  24543. + * Board Registers defines.
  24544. + *
  24545. + * ########################################################################
  24546. + *
  24547. + * This program is free software; you can distribute it and/or modify it
  24548. + * under the terms of the GNU General Public License (Version 2) as
  24549. + * published by the Free Software Foundation.
  24550. + *
  24551. + * This program is distributed in the hope it will be useful, but WITHOUT
  24552. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  24553. + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  24554. + * for more details.
  24555. + *
  24556. + * You should have received a copy of the GNU General Public License along
  24557. + * with this program; if not, write to the Free Software Foundation, Inc.,
  24558. + * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  24559. + *
  24560. + * ########################################################################
  24561. + *
  24562. + *
  24563. + */
  24564. +#ifndef __ASM_DB1200_H
  24565. +#define __ASM_DB1200_H
  24566. +
  24567. +#include <linux/types.h>
  24568. +
  24569. +// This is defined in au1000.h with bogus value
  24570. +#undef AU1X00_EXTERNAL_INT
  24571. +
  24572. +#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
  24573. +#define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
  24574. +#define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC1_TX
  24575. +#define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC1_RX
  24576. +
  24577. +/* SPI and SMB are muxed on the Pb1200 board.
  24578. + Refer to board documentation.
  24579. + */
  24580. +#define SPI_PSC_BASE PSC0_BASE_ADDR
  24581. +#define SMBUS_PSC_BASE PSC0_BASE_ADDR
  24582. +/* AC97 and I2S are muxed on the Pb1200 board.
  24583. + Refer to board documentation.
  24584. + */
  24585. +#define AC97_PSC_BASE PSC1_BASE_ADDR
  24586. +#define I2S_PSC_BASE PSC1_BASE_ADDR
  24587. +
  24588. +#define BCSR_KSEG1_ADDR 0xB9800000
  24589. +
  24590. +typedef volatile struct
  24591. +{
  24592. + /*00*/ u16 whoami;
  24593. + u16 reserved0;
  24594. + /*04*/ u16 status;
  24595. + u16 reserved1;
  24596. + /*08*/ u16 switches;
  24597. + u16 reserved2;
  24598. + /*0C*/ u16 resets;
  24599. + u16 reserved3;
  24600. +
  24601. + /*10*/ u16 pcmcia;
  24602. + u16 reserved4;
  24603. + /*14*/ u16 board;
  24604. + u16 reserved5;
  24605. + /*18*/ u16 disk_leds;
  24606. + u16 reserved6;
  24607. + /*1C*/ u16 system;
  24608. + u16 reserved7;
  24609. +
  24610. + /*20*/ u16 intclr;
  24611. + u16 reserved8;
  24612. + /*24*/ u16 intset;
  24613. + u16 reserved9;
  24614. + /*28*/ u16 intclr_mask;
  24615. + u16 reserved10;
  24616. + /*2C*/ u16 intset_mask;
  24617. + u16 reserved11;
  24618. +
  24619. + /*30*/ u16 sig_status;
  24620. + u16 reserved12;
  24621. + /*34*/ u16 int_status;
  24622. + u16 reserved13;
  24623. + /*38*/ u16 reserved14;
  24624. + u16 reserved15;
  24625. + /*3C*/ u16 reserved16;
  24626. + u16 reserved17;
  24627. +
  24628. +} BCSR;
  24629. +
  24630. +static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  24631. +
  24632. +/*
  24633. + * Register bit definitions for the BCSRs
  24634. + */
  24635. +#define BCSR_WHOAMI_DCID 0x000F
  24636. +#define BCSR_WHOAMI_CPLD 0x00F0
  24637. +#define BCSR_WHOAMI_BOARD 0x0F00
  24638. +
  24639. +#define BCSR_STATUS_PCMCIA0VS 0x0003
  24640. +#define BCSR_STATUS_PCMCIA1VS 0x000C
  24641. +#define BCSR_STATUS_SWAPBOOT 0x0040
  24642. +#define BCSR_STATUS_FLASHBUSY 0x0100
  24643. +#define BCSR_STATUS_IDECBLID 0x0200
  24644. +#define BCSR_STATUS_SD0WP 0x0400
  24645. +#define BCSR_STATUS_U0RXD 0x1000
  24646. +#define BCSR_STATUS_U1RXD 0x2000
  24647. +
  24648. +#define BCSR_SWITCHES_OCTAL 0x00FF
  24649. +#define BCSR_SWITCHES_DIP_1 0x0080
  24650. +#define BCSR_SWITCHES_DIP_2 0x0040
  24651. +#define BCSR_SWITCHES_DIP_3 0x0020
  24652. +#define BCSR_SWITCHES_DIP_4 0x0010
  24653. +#define BCSR_SWITCHES_DIP_5 0x0008
  24654. +#define BCSR_SWITCHES_DIP_6 0x0004
  24655. +#define BCSR_SWITCHES_DIP_7 0x0002
  24656. +#define BCSR_SWITCHES_DIP_8 0x0001
  24657. +#define BCSR_SWITCHES_ROTARY 0x0F00
  24658. +
  24659. +#define BCSR_RESETS_ETH 0x0001
  24660. +#define BCSR_RESETS_CAMERA 0x0002
  24661. +#define BCSR_RESETS_DC 0x0004
  24662. +#define BCSR_RESETS_IDE 0x0008
  24663. +#define BCSR_RESETS_TV 0x0010
  24664. +/* not resets but in the same register */
  24665. +#define BCSR_RESETS_PWMR1mUX 0x0800
  24666. +#define BCSR_RESETS_PCS0MUX 0x1000
  24667. +#define BCSR_RESETS_PCS1MUX 0x2000
  24668. +#define BCSR_RESETS_SPISEL 0x4000
  24669. +
  24670. +#define BCSR_PCMCIA_PC0VPP 0x0003
  24671. +#define BCSR_PCMCIA_PC0VCC 0x000C
  24672. +#define BCSR_PCMCIA_PC0DRVEN 0x0010
  24673. +#define BCSR_PCMCIA_PC0RST 0x0080
  24674. +#define BCSR_PCMCIA_PC1VPP 0x0300
  24675. +#define BCSR_PCMCIA_PC1VCC 0x0C00
  24676. +#define BCSR_PCMCIA_PC1DRVEN 0x1000
  24677. +#define BCSR_PCMCIA_PC1RST 0x8000
  24678. +
  24679. +#define BCSR_BOARD_LCDVEE 0x0001
  24680. +#define BCSR_BOARD_LCDVDD 0x0002
  24681. +#define BCSR_BOARD_LCDBL 0x0004
  24682. +#define BCSR_BOARD_CAMSNAP 0x0010
  24683. +#define BCSR_BOARD_CAMPWR 0x0020
  24684. +#define BCSR_BOARD_SD0PWR 0x0040
  24685. +
  24686. +#define BCSR_LEDS_DECIMALS 0x0003
  24687. +#define BCSR_LEDS_LED0 0x0100
  24688. +#define BCSR_LEDS_LED1 0x0200
  24689. +#define BCSR_LEDS_LED2 0x0400
  24690. +#define BCSR_LEDS_LED3 0x0800
  24691. +
  24692. +#define BCSR_SYSTEM_POWEROFF 0x4000
  24693. +#define BCSR_SYSTEM_RESET 0x8000
  24694. +
  24695. +/* Bit positions for the different interrupt sources */
  24696. +#define BCSR_INT_IDE 0x0001
  24697. +#define BCSR_INT_ETH 0x0002
  24698. +#define BCSR_INT_PC0 0x0004
  24699. +#define BCSR_INT_PC0STSCHG 0x0008
  24700. +#define BCSR_INT_PC1 0x0010
  24701. +#define BCSR_INT_PC1STSCHG 0x0020
  24702. +#define BCSR_INT_DC 0x0040
  24703. +#define BCSR_INT_FLASHBUSY 0x0080
  24704. +#define BCSR_INT_PC0INSERT 0x0100
  24705. +#define BCSR_INT_PC0EJECT 0x0200
  24706. +#define BCSR_INT_PC1INSERT 0x0400
  24707. +#define BCSR_INT_PC1EJECT 0x0800
  24708. +#define BCSR_INT_SD0INSERT 0x1000
  24709. +#define BCSR_INT_SD0EJECT 0x2000
  24710. +
  24711. +#define AU1XXX_SMC91111_PHYS_ADDR (0x19000300)
  24712. +#define AU1XXX_SMC91111_IRQ DB1200_ETH_INT
  24713. +
  24714. +#define AU1XXX_ATA_PHYS_ADDR (0x18800000)
  24715. +#define AU1XXX_ATA_PHYS_LEN (0x100)
  24716. +#define AU1XXX_ATA_REG_OFFSET (5)
  24717. +#define AU1XXX_ATA_INT DB1200_IDE_INT
  24718. +#define AU1XXX_ATA_DDMA_REQ DSCR_CMD0_DMA_REQ1;
  24719. +#define AU1XXX_ATA_RQSIZE 128
  24720. +
  24721. +#define NAND_PHYS_ADDR 0x20000000
  24722. +
  24723. +/*
  24724. + * External Interrupts for Pb1200 as of 8/6/2004.
  24725. + * Bit positions in the CPLD registers can be calculated by taking
  24726. + * the interrupt define and subtracting the DB1200_INT_BEGIN value.
  24727. + * *example: IDE bis pos is = 64 - 64
  24728. + ETH bit pos is = 65 - 64
  24729. + */
  24730. +#define DB1200_INT_BEGIN (AU1000_LAST_INTC1_INT + 1)
  24731. +#define DB1200_IDE_INT (DB1200_INT_BEGIN + 0)
  24732. +#define DB1200_ETH_INT (DB1200_INT_BEGIN + 1)
  24733. +#define DB1200_PC0_INT (DB1200_INT_BEGIN + 2)
  24734. +#define DB1200_PC0_STSCHG_INT (DB1200_INT_BEGIN + 3)
  24735. +#define DB1200_PC1_INT (DB1200_INT_BEGIN + 4)
  24736. +#define DB1200_PC1_STSCHG_INT (DB1200_INT_BEGIN + 5)
  24737. +#define DB1200_DC_INT (DB1200_INT_BEGIN + 6)
  24738. +#define DB1200_FLASHBUSY_INT (DB1200_INT_BEGIN + 7)
  24739. +#define DB1200_PC0_INSERT_INT (DB1200_INT_BEGIN + 8)
  24740. +#define DB1200_PC0_EJECT_INT (DB1200_INT_BEGIN + 9)
  24741. +#define DB1200_PC1_INSERT_INT (DB1200_INT_BEGIN + 10)
  24742. +#define DB1200_PC1_EJECT_INT (DB1200_INT_BEGIN + 11)
  24743. +#define DB1200_SD0_INSERT_INT (DB1200_INT_BEGIN + 12)
  24744. +#define DB1200_SD0_EJECT_INT (DB1200_INT_BEGIN + 13)
  24745. +
  24746. +#define DB1200_INT_END (DB1200_INT_BEGIN + 15)
  24747. +
  24748. +/* For drivers/pcmcia/au1000_db1x00.c */
  24749. +#define BOARD_PC0_INT DB1200_PC0_INT
  24750. +#define BOARD_PC1_INT DB1200_PC1_INT
  24751. +#define BOARD_CARD_INSERTED(SOCKET) bcsr->sig_status & (1<<(8+(2*SOCKET)))
  24752. +
  24753. +#endif /* __ASM_DB1200_H */
  24754. +
  24755. Index: linux-2.4.35.4/include/asm-mips/db1x00.h
  24756. ===================================================================
  24757. --- linux-2.4.35.4.orig/include/asm-mips/db1x00.h
  24758. +++ linux-2.4.35.4/include/asm-mips/db1x00.h
  24759. @@ -1,5 +1,5 @@
  24760. /*
  24761. - * AMD Alchemy DB1x00 Reference Boards
  24762. + * AMD Alchemy DB1x00 Reference Boards (BUT NOT DB1200)
  24763. *
  24764. * Copyright 2001 MontaVista Software Inc.
  24765. * Author: MontaVista Software, Inc.
  24766. @@ -36,9 +36,18 @@
  24767. #define AC97_PSC_BASE PSC1_BASE_ADDR
  24768. #define SMBUS_PSC_BASE PSC2_BASE_ADDR
  24769. #define I2S_PSC_BASE PSC3_BASE_ADDR
  24770. +#define NAND_CS 1
  24771. +/* for drivers/pcmcia/au1000_db1x00.c */
  24772. +#define BOARD_PC0_INT AU1000_GPIO_3
  24773. +#define BOARD_PC1_INT AU1000_GPIO_5
  24774. +#define BOARD_CARD_INSERTED(SOCKET) !(bcsr->status & (1<<(4+SOCKET)))
  24775. #else
  24776. #define BCSR_KSEG1_ADDR 0xAE000000
  24777. +/* for drivers/pcmcia/au1000_db1x00.c */
  24778. +#define BOARD_PC0_INT AU1000_GPIO_2
  24779. +#define BOARD_PC1_INT AU1000_GPIO_5
  24780. +#define BOARD_CARD_INSERTED(SOCKET) !(bcsr->status & (1<<(4+SOCKET)))
  24781. #endif
  24782. /*
  24783. @@ -66,6 +75,7 @@ typedef volatile struct
  24784. } BCSR;
  24785. +static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  24786. /*
  24787. * Register/mask bit definitions for the BCSRs
  24788. @@ -130,14 +140,6 @@ typedef volatile struct
  24789. #define BCSR_SWRESET_RESET 0x0080
  24790. -/* PCMCIA Db1x00 specific defines */
  24791. -#define PCMCIA_MAX_SOCK 1
  24792. -#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK+1)
  24793. -
  24794. -/* VPP/VCC */
  24795. -#define SET_VCC_VPP(VCC, VPP, SLOT)\
  24796. - ((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8))
  24797. -
  24798. /* MTD CONFIG OPTIONS */
  24799. #if defined(CONFIG_MTD_DB1X00_BOOT) && defined(CONFIG_MTD_DB1X00_USER)
  24800. #define DB1X00_BOTH_BANKS
  24801. @@ -147,48 +149,15 @@ typedef volatile struct
  24802. #define DB1X00_USER_ONLY
  24803. #endif
  24804. -/* SD controller macros */
  24805. -/*
  24806. - * Detect card.
  24807. - */
  24808. -#define mmc_card_inserted(_n_, _res_) \
  24809. - do { \
  24810. - BCSR * const bcsr = (BCSR *)0xAE000000; \
  24811. - unsigned long mmc_wp, board_specific; \
  24812. - if ((_n_)) { \
  24813. - mmc_wp = BCSR_BOARD_SD1_WP; \
  24814. - } else { \
  24815. - mmc_wp = BCSR_BOARD_SD0_WP; \
  24816. - } \
  24817. - board_specific = au_readl((unsigned long)(&bcsr->specific)); \
  24818. - if (!(board_specific & mmc_wp)) {/* low means card present */ \
  24819. - *(int *)(_res_) = 1; \
  24820. - } else { \
  24821. - *(int *)(_res_) = 0; \
  24822. - } \
  24823. - } while (0)
  24824. -
  24825. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX) && defined(CONFIG_MIPS_DB1550)
  24826. /*
  24827. - * Apply power to card slot(s).
  24828. + * Daughter card information.
  24829. */
  24830. -#define mmc_power_on(_n_) \
  24831. - do { \
  24832. - BCSR * const bcsr = (BCSR *)0xAE000000; \
  24833. - unsigned long mmc_pwr, mmc_wp, board_specific; \
  24834. - if ((_n_)) { \
  24835. - mmc_pwr = BCSR_BOARD_SD1_PWR; \
  24836. - mmc_wp = BCSR_BOARD_SD1_WP; \
  24837. - } else { \
  24838. - mmc_pwr = BCSR_BOARD_SD0_PWR; \
  24839. - mmc_wp = BCSR_BOARD_SD0_WP; \
  24840. - } \
  24841. - board_specific = au_readl((unsigned long)(&bcsr->specific)); \
  24842. - if (!(board_specific & mmc_wp)) {/* low means card present */ \
  24843. - board_specific |= mmc_pwr; \
  24844. - au_writel(board_specific, (int)(&bcsr->specific)); \
  24845. - au_sync(); \
  24846. - } \
  24847. - } while (0)
  24848. +#define DAUGHTER_CARD_IRQ (AU1000_GPIO_8)
  24849. +/* DC_IDE */
  24850. +#define AU1XXX_ATA_PHYS_ADDR (0x0C000000)
  24851. +#define AU1XXX_ATA_REG_OFFSET (5)
  24852. +#endif /* CONFIG_MIPS_DB1550 */
  24853. #endif /* __ASM_DB1X00_H */
  24854. Index: linux-2.4.35.4/include/asm-mips/elf.h
  24855. ===================================================================
  24856. --- linux-2.4.35.4.orig/include/asm-mips/elf.h
  24857. +++ linux-2.4.35.4/include/asm-mips/elf.h
  24858. @@ -66,9 +66,10 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_N
  24859. #define USE_ELF_CORE_DUMP
  24860. #define ELF_EXEC_PAGESIZE PAGE_SIZE
  24861. -#define ELF_CORE_COPY_REGS(_dest,_regs) \
  24862. - memcpy((char *) &_dest, (char *) _regs, \
  24863. - sizeof(struct pt_regs));
  24864. +extern void dump_regs(elf_greg_t *, struct pt_regs *regs);
  24865. +
  24866. +#define ELF_CORE_COPY_REGS(elf_regs, regs) \
  24867. + dump_regs((elf_greg_t *)&(elf_regs), regs);
  24868. /* This yields a mask that user programs can use to figure out what
  24869. instruction set this cpu supports. This could be done in userspace,
  24870. Index: linux-2.4.35.4/include/asm-mips/ficmmp.h
  24871. ===================================================================
  24872. --- /dev/null
  24873. +++ linux-2.4.35.4/include/asm-mips/ficmmp.h
  24874. @@ -0,0 +1,156 @@
  24875. +/*
  24876. + * FIC MMP
  24877. + *
  24878. + * ########################################################################
  24879. + *
  24880. + * This program is free software; you can distribute it and/or modify it
  24881. + * under the terms of the GNU General Public License (Version 2) as
  24882. + * published by the Free Software Foundation.
  24883. + *
  24884. + * This program is distributed in the hope it will be useful, but WITHOUT
  24885. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  24886. + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  24887. + * for more details.
  24888. + *
  24889. + * You should have received a copy of the GNU General Public License along
  24890. + * with this program; if not, write to the Free Software Foundation, Inc.,
  24891. + * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  24892. + *
  24893. + * ########################################################################
  24894. + *
  24895. + *
  24896. + */
  24897. +#ifndef __ASM_FICMMP_H
  24898. +#define __ASM_FICMMP_H
  24899. +
  24900. +#include <linux/types.h>
  24901. +#include <asm/au1000.h>
  24902. +#include <asm/au1xxx_gpio.h>
  24903. +
  24904. +// This is defined in au1000.h with bogus value
  24905. +#undef AU1X00_EXTERNAL_INT
  24906. +
  24907. +#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
  24908. +#define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
  24909. +#define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC1_TX
  24910. +#define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC1_RX
  24911. +/* SPI and SMB are muxed on the Pb1200 board.
  24912. + Refer to board documentation.
  24913. + */
  24914. +#define SPI_PSC_BASE PSC0_BASE_ADDR
  24915. +#define SMBUS_PSC_BASE PSC0_BASE_ADDR
  24916. +/* AC97 and I2S are muxed on the Pb1200 board.
  24917. + Refer to board documentation.
  24918. + */
  24919. +#define AC97_PSC_BASE PSC1_BASE_ADDR
  24920. +#define I2S_PSC_BASE PSC1_BASE_ADDR
  24921. +
  24922. +
  24923. +/*
  24924. + * SMSC LAN91C111
  24925. + */
  24926. +#define AU1XXX_SMC91111_PHYS_ADDR (0xAC000300)
  24927. +#define AU1XXX_SMC91111_IRQ AU1000_GPIO_5
  24928. +
  24929. +/* DC_IDE and DC_ETHERNET */
  24930. +#define FICMMP_IDE_INT AU1000_GPIO_4
  24931. +
  24932. +#define AU1XXX_ATA_PHYS_ADDR (0x0C800000)
  24933. +#define AU1XXX_ATA_REG_OFFSET (5)
  24934. +/*
  24935. +#define AU1XXX_ATA_BASE (0x0C800000)
  24936. +#define AU1XXX_ATA_END (0x0CFFFFFF)
  24937. +#define AU1XXX_ATA_MEM_SIZE (AU1XXX_ATA_END - AU1XXX_ATA_BASE +1)
  24938. +
  24939. +#define AU1XXX_ATA_REG_OFFSET (5)
  24940. +*/
  24941. +/* VPP/VCC */
  24942. +#define SET_VCC_VPP(VCC, VPP, SLOT)\
  24943. + ((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8))
  24944. +
  24945. +
  24946. +#define FICMMP_CONFIG_BASE 0xAD000000
  24947. +#define FICMMP_CONFIG_ENABLE 13
  24948. +
  24949. +#define FICMMP_CONFIG_I2SFREQ(N) (N<<0)
  24950. +#define FICMMP_CONFIG_I2SXTAL0 (1<<0)
  24951. +#define FICMMP_CONFIG_I2SXTAL1 (1<<1)
  24952. +#define FICMMP_CONFIG_I2SXTAL2 (1<<2)
  24953. +#define FICMMP_CONFIG_I2SXTAL3 (1<<3)
  24954. +#define FICMMP_CONFIG_ADV1 (1<<4)
  24955. +#define FICMMP_CONFIG_IDERST (1<<5)
  24956. +#define FICMMP_CONFIG_LCMEN (1<<6)
  24957. +#define FICMMP_CONFIG_CAMPWDN (1<<7)
  24958. +#define FICMMP_CONFIG_USBPWREN (1<<8)
  24959. +#define FICMMP_CONFIG_LCMPWREN (1<<9)
  24960. +#define FICMMP_CONFIG_TVOUTPWREN (1<<10)
  24961. +#define FICMMP_CONFIG_RS232PWREN (1<<11)
  24962. +#define FICMMP_CONFIG_LCMDATAOUT (1<<12)
  24963. +#define FICMMP_CONFIG_TVODATAOUT (1<<13)
  24964. +#define FICMMP_CONFIG_ADV3 (1<<14)
  24965. +#define FICMMP_CONFIG_ADV4 (1<<15)
  24966. +
  24967. +#define I2S_FREQ_8_192 (0x0)
  24968. +#define I2S_FREQ_11_2896 (0x1)
  24969. +#define I2S_FREQ_12_288 (0x2)
  24970. +#define I2S_FREQ_24_576 (0x3)
  24971. +//#define I2S_FREQ_12_288 (0x4)
  24972. +#define I2S_FREQ_16_9344 (0x5)
  24973. +#define I2S_FREQ_18_432 (0x6)
  24974. +#define I2S_FREQ_36_864 (0x7)
  24975. +#define I2S_FREQ_16_384 (0x8)
  24976. +#define I2S_FREQ_22_5792 (0x9)
  24977. +//#define I2S_FREQ_24_576 (0x10)
  24978. +#define I2S_FREQ_49_152 (0x11)
  24979. +//#define I2S_FREQ_24_576 (0x12)
  24980. +#define I2S_FREQ_33_8688 (0x13)
  24981. +//#define I2S_FREQ_36_864 (0x14)
  24982. +#define I2S_FREQ_73_728 (0x15)
  24983. +
  24984. +#define FICMMP_IDE_PWR 9
  24985. +#define FICMMP_FOCUS_RST 2
  24986. +
  24987. +static __inline void ficmmp_config_set(u16 bits)
  24988. +{
  24989. + extern u16 ficmmp_config;
  24990. + //printk("set_config: %X, Old: %X, New: %X\n", bits, ficmmp_config, ficmmp_config | bits);
  24991. + ficmmp_config |= bits;
  24992. + *((u16*)FICMMP_CONFIG_BASE) = ficmmp_config;
  24993. +}
  24994. +
  24995. +static __inline void ficmmp_config_clear(u16 bits)
  24996. +{
  24997. + extern u16 ficmmp_config;
  24998. +// printk("clear_config: %X, Old: %X, New: %X\n", bits, ficmmp_config, ficmmp_config & ~bits);
  24999. + ficmmp_config &= ~bits;
  25000. + *((u16*)FICMMP_CONFIG_BASE) = ficmmp_config;
  25001. +}
  25002. +
  25003. +static __inline void ficmmp_config_init(void)
  25004. +{
  25005. + au1xxx_gpio_write(FICMMP_CONFIG_ENABLE, 0); //Enable configuration latch
  25006. + ficmmp_config_set(FICMMP_CONFIG_LCMDATAOUT | FICMMP_CONFIG_TVODATAOUT | FICMMP_CONFIG_IDERST); //Disable display data buffers
  25007. + ficmmp_config_set(FICMMP_CONFIG_I2SFREQ(I2S_FREQ_36_864));
  25008. +}
  25009. +
  25010. +static __inline u32 ficmmp_set_i2s_sample_rate(u32 rate)
  25011. +{
  25012. + u32 freq;
  25013. +
  25014. + switch(rate)
  25015. + {
  25016. + case 88200:
  25017. + case 44100:
  25018. + case 8018: freq = I2S_FREQ_11_2896; break;
  25019. + case 48000:
  25020. + case 32000: //freq = I2S_FREQ_18_432; break;
  25021. + case 8000: freq = I2S_FREQ_12_288; break;
  25022. + default: freq = I2S_FREQ_12_288; rate = 8000;
  25023. + }
  25024. + ficmmp_config_clear(FICMMP_CONFIG_I2SFREQ(0xF));
  25025. + ficmmp_config_set(FICMMP_CONFIG_I2SFREQ(freq));
  25026. + return rate;
  25027. +}
  25028. +
  25029. +#endif /* __ASM_FICMMP_H */
  25030. +
  25031. Index: linux-2.4.35.4/include/asm-mips/hazards.h
  25032. ===================================================================
  25033. --- linux-2.4.35.4.orig/include/asm-mips/hazards.h
  25034. +++ linux-2.4.35.4/include/asm-mips/hazards.h
  25035. @@ -3,7 +3,7 @@
  25036. * License. See the file "COPYING" in the main directory of this archive
  25037. * for more details.
  25038. *
  25039. - * Copyright (C) 2003 Ralf Baechle
  25040. + * Copyright (C) 2003, 2004 Ralf Baechle
  25041. */
  25042. #ifndef _ASM_HAZARDS_H
  25043. #define _ASM_HAZARDS_H
  25044. @@ -12,38 +12,200 @@
  25045. #ifdef __ASSEMBLY__
  25046. + .macro _ssnop
  25047. + sll $0, $0, 1
  25048. + .endm
  25049. +
  25050. /*
  25051. * RM9000 hazards. When the JTLB is updated by tlbwi or tlbwr, a subsequent
  25052. * use of the JTLB for instructions should not occur for 4 cpu cycles and use
  25053. * for data translations should not occur for 3 cpu cycles.
  25054. */
  25055. #ifdef CONFIG_CPU_RM9000
  25056. -#define rm9000_tlb_hazard \
  25057. +
  25058. +#define mtc0_tlbw_hazard \
  25059. .set push; \
  25060. .set mips32; \
  25061. - ssnop; ssnop; ssnop; ssnop; \
  25062. + _ssnop; _ssnop; _ssnop; _ssnop; \
  25063. .set pop
  25064. +
  25065. +#define tlbw_eret_hazard \
  25066. + .set push; \
  25067. + .set mips32; \
  25068. + _ssnop; _ssnop; _ssnop; _ssnop; \
  25069. + .set pop
  25070. +
  25071. #else
  25072. -#define rm9000_tlb_hazard
  25073. +
  25074. +/*
  25075. + * The taken branch will result in a two cycle penalty for the two killed
  25076. + * instructions on R4000 / R4400. Other processors only have a single cycle
  25077. + * hazard so this is nice trick to have an optimal code for a range of
  25078. + * processors.
  25079. + */
  25080. +#define mtc0_tlbw_hazard \
  25081. + b . + 8
  25082. +#define tlbw_eret_hazard \
  25083. + nop
  25084. #endif
  25085. +/*
  25086. + * mtc0->mfc0 hazard
  25087. + * The 24K has a 2 cycle mtc0/mfc0 execution hazard.
  25088. + * It is a MIPS32R2 processor so ehb will clear the hazard.
  25089. + */
  25090. +
  25091. +#ifdef CONFIG_CPU_MIPSR2
  25092. +/*
  25093. + * Use a macro for ehb unless explicit support for MIPSR2 is enabled
  25094. + */
  25095. + .macro ehb
  25096. + sll $0, $0, 3
  25097. + .endm
  25098. +
  25099. +#define irq_enable_hazard \
  25100. + ehb # irq_enable_hazard
  25101. +
  25102. +#define irq_disable_hazard \
  25103. + ehb # irq_disable_hazard
  25104. +
  25105. +#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000)
  25106. +
  25107. +/*
  25108. + * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
  25109. + */
  25110. +
  25111. +#define irq_enable_hazard
  25112. +
  25113. +#define irq_disable_hazard
  25114. +
  25115. #else
  25116. /*
  25117. + * Classic MIPS needs 1 - 3 nops or ssnops
  25118. + */
  25119. +#define irq_enable_hazard
  25120. +#define irq_disable_hazard \
  25121. + _ssnop; _ssnop; _ssnop
  25122. +
  25123. +#endif
  25124. +
  25125. +#else /* __ASSEMBLY__ */
  25126. +
  25127. +/*
  25128. * RM9000 hazards. When the JTLB is updated by tlbwi or tlbwr, a subsequent
  25129. * use of the JTLB for instructions should not occur for 4 cpu cycles and use
  25130. * for data translations should not occur for 3 cpu cycles.
  25131. */
  25132. #ifdef CONFIG_CPU_RM9000
  25133. -#define rm9000_tlb_hazard() \
  25134. +
  25135. +#define mtc0_tlbw_hazard() \
  25136. __asm__ __volatile__( \
  25137. ".set\tmips32\n\t" \
  25138. - "ssnop; ssnop; ssnop; ssnop\n\t" \
  25139. + "_ssnop; _ssnop; _ssnop; _ssnop\n\t" \
  25140. + ".set\tmips0")
  25141. +
  25142. +#define tlbw_use_hazard() \
  25143. + __asm__ __volatile__( \
  25144. + ".set\tmips32\n\t" \
  25145. + "_ssnop; _ssnop; _ssnop; _ssnop\n\t" \
  25146. ".set\tmips0")
  25147. #else
  25148. -#define rm9000_tlb_hazard() do { } while (0)
  25149. +
  25150. +/*
  25151. + * Overkill warning ...
  25152. + */
  25153. +#define mtc0_tlbw_hazard() \
  25154. + __asm__ __volatile__( \
  25155. + ".set noreorder\n\t" \
  25156. + "nop; nop; nop; nop; nop; nop;\n\t" \
  25157. + ".set reorder\n\t")
  25158. +
  25159. +#define tlbw_use_hazard() \
  25160. + __asm__ __volatile__( \
  25161. + ".set noreorder\n\t" \
  25162. + "nop; nop; nop; nop; nop; nop;\n\t" \
  25163. + ".set reorder\n\t")
  25164. +
  25165. #endif
  25166. +/*
  25167. + * mtc0->mfc0 hazard
  25168. + * The 24K has a 2 cycle mtc0/mfc0 execution hazard.
  25169. + * It is a MIPS32R2 processor so ehb will clear the hazard.
  25170. + */
  25171. +
  25172. +#ifdef CONFIG_CPU_MIPSR2
  25173. +/*
  25174. + * Use a macro for ehb unless explicit support for MIPSR2 is enabled
  25175. + */
  25176. +__asm__(
  25177. + " .macro ehb \n\t"
  25178. + " sll $0, $0, 3 \n\t"
  25179. + " .endm \n\t"
  25180. + " \n\t"
  25181. + " .macro\tirq_enable_hazard \n\t"
  25182. + " ehb \n\t"
  25183. + " .endm \n\t"
  25184. + " \n\t"
  25185. + " .macro\tirq_disable_hazard \n\t"
  25186. + " ehb \n\t"
  25187. + " .endm");
  25188. +
  25189. +#define irq_enable_hazard() \
  25190. + __asm__ __volatile__( \
  25191. + "ehb\t\t\t\t# irq_enable_hazard")
  25192. +
  25193. +#define irq_disable_hazard() \
  25194. + __asm__ __volatile__( \
  25195. + "ehb\t\t\t\t# irq_disable_hazard")
  25196. +
  25197. +#elif defined(CONFIG_CPU_R10000)
  25198. +
  25199. +/*
  25200. + * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
  25201. + */
  25202. +
  25203. +__asm__(
  25204. + " .macro\tirq_enable_hazard \n\t"
  25205. + " .endm \n\t"
  25206. + " \n\t"
  25207. + " .macro\tirq_disable_hazard \n\t"
  25208. + " .endm");
  25209. +
  25210. +#define irq_enable_hazard() do { } while (0)
  25211. +#define irq_disable_hazard() do { } while (0)
  25212. +
  25213. +#else
  25214. +
  25215. +/*
  25216. + * Default for classic MIPS processors. Assume worst case hazards but don't
  25217. + * care about the irq_enable_hazard - sooner or later the hardware will
  25218. + * enable it and we don't care when exactly.
  25219. + */
  25220. +
  25221. +__asm__(
  25222. + " .macro _ssnop \n\t"
  25223. + " sll $0, $2, 1 \n\t"
  25224. + " .endm \n\t"
  25225. + " \n\t"
  25226. + " # \n\t"
  25227. + " # There is a hazard but we do not care \n\t"
  25228. + " # \n\t"
  25229. + " .macro\tirq_enable_hazard \n\t"
  25230. + " .endm \n\t"
  25231. + " \n\t"
  25232. + " .macro\tirq_disable_hazard \n\t"
  25233. + " _ssnop; _ssnop; _ssnop \n\t"
  25234. + " .endm");
  25235. +
  25236. +#define irq_enable_hazard() do { } while (0)
  25237. +#define irq_disable_hazard() \
  25238. + __asm__ __volatile__( \
  25239. + "_ssnop; _ssnop; _ssnop;\t\t# irq_disable_hazard")
  25240. +
  25241. #endif
  25242. +#endif /* __ASSEMBLY__ */
  25243. +
  25244. #endif /* _ASM_HAZARDS_H */
  25245. Index: linux-2.4.35.4/include/asm-mips/ide.h
  25246. ===================================================================
  25247. --- linux-2.4.35.4.orig/include/asm-mips/ide.h
  25248. +++ linux-2.4.35.4/include/asm-mips/ide.h
  25249. @@ -32,12 +32,12 @@ struct ide_ops {
  25250. extern struct ide_ops *ide_ops;
  25251. -static __inline__ int ide_default_irq(ide_ioreg_t base)
  25252. +static inline int ide_default_irq(ide_ioreg_t base)
  25253. {
  25254. return ide_ops->ide_default_irq(base);
  25255. }
  25256. -static __inline__ ide_ioreg_t ide_default_io_base(int index)
  25257. +static inline ide_ioreg_t ide_default_io_base(int index)
  25258. {
  25259. return ide_ops->ide_default_io_base(index);
  25260. }
  25261. @@ -48,7 +48,7 @@ static inline void ide_init_hwif_ports(h
  25262. ide_ops->ide_init_hwif_ports(hw, data_port, ctrl_port, irq);
  25263. }
  25264. -static __inline__ void ide_init_default_hwifs(void)
  25265. +static inline void ide_init_default_hwifs(void)
  25266. {
  25267. #ifndef CONFIG_BLK_DEV_IDEPCI
  25268. hw_regs_t hw;
  25269. @@ -68,7 +68,89 @@ static __inline__ void ide_init_default_
  25270. #define ide_ack_intr(hwif) ((hwif)->hw.ack_intr ? (hwif)->hw.ack_intr(hwif) : 1)
  25271. #endif
  25272. -#include <asm-generic/ide_iops.h>
  25273. +/* MIPS port and memory-mapped I/O string operations. */
  25274. +
  25275. +static inline void __ide_flush_dcache_range(unsigned long addr, unsigned long size)
  25276. +{
  25277. + if (cpu_has_dc_aliases) {
  25278. + unsigned long end = addr + size;
  25279. + for (; addr < end; addr += PAGE_SIZE)
  25280. + flush_dcache_page(virt_to_page(addr));
  25281. + }
  25282. +}
  25283. +
  25284. +static inline void __ide_insw(unsigned long port, void *addr,
  25285. + unsigned int count)
  25286. +{
  25287. + insw(port, addr, count);
  25288. + __ide_flush_dcache_range((unsigned long)addr, count * 2);
  25289. +}
  25290. +
  25291. +static inline void __ide_insl(unsigned long port, void *addr, unsigned int count)
  25292. +{
  25293. + insl(port, addr, count);
  25294. + __ide_flush_dcache_range((unsigned long)addr, count * 4);
  25295. +}
  25296. +
  25297. +static inline void __ide_outsw(unsigned long port, const void *addr,
  25298. + unsigned long count)
  25299. +{
  25300. + outsw(port, addr, count);
  25301. + __ide_flush_dcache_range((unsigned long)addr, count * 2);
  25302. +}
  25303. +
  25304. +static inline void __ide_outsl(unsigned long port, const void *addr,
  25305. + unsigned long count)
  25306. +{
  25307. + outsl(port, addr, count);
  25308. + __ide_flush_dcache_range((unsigned long)addr, count * 4);
  25309. +}
  25310. +
  25311. +static inline void __ide_mm_insw(unsigned long port, void *addr, u32 count)
  25312. +{
  25313. + unsigned long start = (unsigned long) addr;
  25314. +
  25315. + while (count--) {
  25316. + *(u16 *)addr = readw(port);
  25317. + addr += 2;
  25318. + }
  25319. + __ide_flush_dcache_range(start, count * 2);
  25320. +}
  25321. +
  25322. +static inline void __ide_mm_insl(unsigned long port, void *addr, u32 count)
  25323. +{
  25324. + unsigned long start = (unsigned long) addr;
  25325. +
  25326. + while (count--) {
  25327. + *(u32 *)addr = readl(port);
  25328. + addr += 4;
  25329. + }
  25330. + __ide_flush_dcache_range(start, count * 4);
  25331. +}
  25332. +
  25333. +static inline void __ide_mm_outsw(unsigned long port, const void *addr,
  25334. + u32 count)
  25335. +{
  25336. + unsigned long start = (unsigned long) addr;
  25337. +
  25338. + while (count--) {
  25339. + writew(*(u16 *)addr, port);
  25340. + addr += 2;
  25341. + }
  25342. + __ide_flush_dcache_range(start, count * 2);
  25343. +}
  25344. +
  25345. +static inline void __ide_mm_outsl(unsigned long port, const void *addr,
  25346. + u32 count)
  25347. +{
  25348. + unsigned long start = (unsigned long) addr;
  25349. +
  25350. + while (count--) {
  25351. + writel(*(u32 *)addr, port);
  25352. + addr += 4;
  25353. + }
  25354. + __ide_flush_dcache_range(start, count * 4);
  25355. +}
  25356. #endif /* __KERNEL__ */
  25357. Index: linux-2.4.35.4/include/asm-mips/io.h
  25358. ===================================================================
  25359. --- linux-2.4.35.4.orig/include/asm-mips/io.h
  25360. +++ linux-2.4.35.4/include/asm-mips/io.h
  25361. @@ -392,7 +392,8 @@ static inline unsigned int inl_p(unsigne
  25362. return __ioswab32(__val);
  25363. }
  25364. -static inline void __outsb(unsigned long port, void *addr, unsigned int count)
  25365. +static inline void __outsb(unsigned long port, const void *addr,
  25366. + unsigned int count)
  25367. {
  25368. while (count--) {
  25369. outb(*(u8 *)addr, port);
  25370. @@ -408,7 +409,8 @@ static inline void __insb(unsigned long
  25371. }
  25372. }
  25373. -static inline void __outsw(unsigned long port, void *addr, unsigned int count)
  25374. +static inline void __outsw(unsigned long port, const void *addr,
  25375. + unsigned int count)
  25376. {
  25377. while (count--) {
  25378. outw(*(u16 *)addr, port);
  25379. @@ -424,7 +426,8 @@ static inline void __insw(unsigned long
  25380. }
  25381. }
  25382. -static inline void __outsl(unsigned long port, void *addr, unsigned int count)
  25383. +static inline void __outsl(unsigned long port, const void *addr,
  25384. + unsigned int count)
  25385. {
  25386. while (count--) {
  25387. outl(*(u32 *)addr, port);
  25388. Index: linux-2.4.35.4/include/asm-mips/mipsregs.h
  25389. ===================================================================
  25390. --- linux-2.4.35.4.orig/include/asm-mips/mipsregs.h
  25391. +++ linux-2.4.35.4/include/asm-mips/mipsregs.h
  25392. @@ -757,10 +757,18 @@ do { \
  25393. #define read_c0_config1() __read_32bit_c0_register($16, 1)
  25394. #define read_c0_config2() __read_32bit_c0_register($16, 2)
  25395. #define read_c0_config3() __read_32bit_c0_register($16, 3)
  25396. +#define read_c0_config4() __read_32bit_c0_register($16, 4)
  25397. +#define read_c0_config5() __read_32bit_c0_register($16, 5)
  25398. +#define read_c0_config6() __read_32bit_c0_register($16, 6)
  25399. +#define read_c0_config7() __read_32bit_c0_register($16, 7)
  25400. #define write_c0_config(val) __write_32bit_c0_register($16, 0, val)
  25401. #define write_c0_config1(val) __write_32bit_c0_register($16, 1, val)
  25402. #define write_c0_config2(val) __write_32bit_c0_register($16, 2, val)
  25403. #define write_c0_config3(val) __write_32bit_c0_register($16, 3, val)
  25404. +#define write_c0_config4(val) __write_32bit_c0_register($16, 4, val)
  25405. +#define write_c0_config5(val) __write_32bit_c0_register($16, 5, val)
  25406. +#define write_c0_config6(val) __write_32bit_c0_register($16, 6, val)
  25407. +#define write_c0_config7(val) __write_32bit_c0_register($16, 7, val)
  25408. /*
  25409. * The WatchLo register. There may be upto 8 of them.
  25410. @@ -874,42 +882,34 @@ do { \
  25411. */
  25412. static inline void tlb_probe(void)
  25413. {
  25414. - rm9000_tlb_hazard();
  25415. __asm__ __volatile__(
  25416. ".set noreorder\n\t"
  25417. "tlbp\n\t"
  25418. ".set reorder");
  25419. - rm9000_tlb_hazard();
  25420. }
  25421. static inline void tlb_read(void)
  25422. {
  25423. - rm9000_tlb_hazard();
  25424. __asm__ __volatile__(
  25425. ".set noreorder\n\t"
  25426. "tlbr\n\t"
  25427. ".set reorder");
  25428. - rm9000_tlb_hazard();
  25429. }
  25430. static inline void tlb_write_indexed(void)
  25431. {
  25432. - rm9000_tlb_hazard();
  25433. __asm__ __volatile__(
  25434. ".set noreorder\n\t"
  25435. "tlbwi\n\t"
  25436. ".set reorder");
  25437. - rm9000_tlb_hazard();
  25438. }
  25439. static inline void tlb_write_random(void)
  25440. {
  25441. - rm9000_tlb_hazard();
  25442. __asm__ __volatile__(
  25443. ".set noreorder\n\t"
  25444. "tlbwr\n\t"
  25445. ".set reorder");
  25446. - rm9000_tlb_hazard();
  25447. }
  25448. /*
  25449. Index: linux-2.4.35.4/include/asm-mips/mmu_context.h
  25450. ===================================================================
  25451. --- linux-2.4.35.4.orig/include/asm-mips/mmu_context.h
  25452. +++ linux-2.4.35.4/include/asm-mips/mmu_context.h
  25453. @@ -27,7 +27,7 @@
  25454. #define TLBMISS_HANDLER_SETUP_PGD(pgd) \
  25455. pgd_current[smp_processor_id()] = (unsigned long)(pgd)
  25456. #define TLBMISS_HANDLER_SETUP() \
  25457. - write_c0_context((unsigned long) smp_processor_id() << (23 + 3)); \
  25458. + write_c0_context((unsigned long) smp_processor_id() << 23); \
  25459. TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir)
  25460. extern unsigned long pgd_current[];
  25461. Index: linux-2.4.35.4/include/asm-mips/pb1100.h
  25462. ===================================================================
  25463. --- linux-2.4.35.4.orig/include/asm-mips/pb1100.h
  25464. +++ linux-2.4.35.4/include/asm-mips/pb1100.h
  25465. @@ -1,5 +1,5 @@
  25466. /*
  25467. - * Alchemy Semi PB1100 Referrence Board
  25468. + * AMD Alchemy PB1100 Reference Boards
  25469. *
  25470. * Copyright 2001 MontaVista Software Inc.
  25471. * Author: MontaVista Software, Inc.
  25472. @@ -27,55 +27,108 @@
  25473. #ifndef __ASM_PB1100_H
  25474. #define __ASM_PB1100_H
  25475. -#define PB1100_IDENT 0xAE000000
  25476. -#define BOARD_STATUS_REG 0xAE000004
  25477. - #define PB1100_ROM_SEL (1<<15)
  25478. - #define PB1100_ROM_SIZ (1<<14)
  25479. - #define PB1100_SWAP_BOOT (1<<13)
  25480. - #define PB1100_FLASH_WP (1<<12)
  25481. - #define PB1100_ROM_H_STS (1<<11)
  25482. - #define PB1100_ROM_L_STS (1<<10)
  25483. - #define PB1100_FLASH_H_STS (1<<9)
  25484. - #define PB1100_FLASH_L_STS (1<<8)
  25485. - #define PB1100_SRAM_SIZ (1<<7)
  25486. - #define PB1100_TSC_BUSY (1<<6)
  25487. - #define PB1100_PCMCIA_VS_MASK (3<<4)
  25488. - #define PB1100_RS232_CD (1<<3)
  25489. - #define PB1100_RS232_CTS (1<<2)
  25490. - #define PB1100_RS232_DSR (1<<1)
  25491. - #define PB1100_RS232_RI (1<<0)
  25492. -
  25493. -#define PB1100_IRDA_RS232 0xAE00000C
  25494. - #define PB1100_IRDA_FULL (0<<14) /* full power */
  25495. - #define PB1100_IRDA_SHUTDOWN (1<<14)
  25496. - #define PB1100_IRDA_TT (2<<14) /* 2/3 power */
  25497. - #define PB1100_IRDA_OT (3<<14) /* 1/3 power */
  25498. - #define PB1100_IRDA_FIR (1<<13)
  25499. -
  25500. -#define PCMCIA_BOARD_REG 0xAE000010
  25501. - #define PB1100_SD_WP1_RO (1<<15) /* read only */
  25502. - #define PB1100_SD_WP0_RO (1<<14) /* read only */
  25503. - #define PB1100_SD_PWR1 (1<<11) /* applies power to SD1 */
  25504. - #define PB1100_SD_PWR0 (1<<10) /* applies power to SD0 */
  25505. - #define PB1100_SEL_SD_CONN1 (1<<9)
  25506. - #define PB1100_SEL_SD_CONN0 (1<<8)
  25507. - #define PC_DEASSERT_RST (1<<7)
  25508. - #define PC_DRV_EN (1<<4)
  25509. -
  25510. -#define PB1100_G_CONTROL 0xAE000014 /* graphics control */
  25511. -
  25512. -#define PB1100_RST_VDDI 0xAE00001C
  25513. - #define PB1100_SOFT_RESET (1<<15) /* clear to reset the board */
  25514. - #define PB1100_VDDI_MASK (0x1F)
  25515. +#define BCSR_KSEG1_ADDR 0xAE000000
  25516. +
  25517. +/*
  25518. + * Overlay data structure of the Pb1100 board registers.
  25519. + * Registers located at physical 0E0000xx, KSEG1 0xAE0000xx
  25520. + */
  25521. +typedef volatile struct
  25522. +{
  25523. + /*00*/ unsigned short whoami;
  25524. + unsigned short reserved0;
  25525. + /*04*/ unsigned short status;
  25526. + unsigned short reserved1;
  25527. + /*08*/ unsigned short switches;
  25528. + unsigned short reserved2;
  25529. + /*0C*/ unsigned short resets;
  25530. + unsigned short reserved3;
  25531. + /*10*/ unsigned short pcmcia;
  25532. + unsigned short reserved4;
  25533. + /*14*/ unsigned short graphics;
  25534. + unsigned short reserved5;
  25535. + /*18*/ unsigned short leds;
  25536. + unsigned short reserved6;
  25537. + /*1C*/ unsigned short swreset;
  25538. + unsigned short reserved7;
  25539. +
  25540. +} BCSR;
  25541. -#define PB1100_LEDS 0xAE000018
  25542. -/* 11:8 is 4 discreet LEDs. Clearing a bit illuminates the LED.
  25543. - * 7:0 is the LED Display's decimal points.
  25544. +/*
  25545. + * Register/mask bit definitions for the BCSRs
  25546. */
  25547. -#define PB1100_HEX_LED 0xAE000018
  25548. +#define BCSR_WHOAMI_DCID 0x000F
  25549. +#define BCSR_WHOAMI_CPLD 0x00F0
  25550. +#define BCSR_WHOAMI_BOARD 0x0F00
  25551. +
  25552. +#define BCSR_STATUS_RS232_RI 0x0001
  25553. +#define BCSR_STATUS_RS232_DSR 0x0002
  25554. +#define BCSR_STATUS_RS232_CTS 0x0004
  25555. +#define BCSR_STATUS_RS232_CD 0x0008
  25556. +#define BCSR_STATUS_PCMCIA_VS_MASK 0x0030
  25557. +#define BCSR_STATUS_TSC_BUSY 0x0040
  25558. +#define BCSR_STATUS_SRAM_SIZ 0x0080
  25559. +#define BCSR_STATUS_FLASH_L_STS 0x0100
  25560. +#define BCSR_STATUS_FLASH_H_STS 0x0200
  25561. +#define BCSR_STATUS_ROM_H_STS 0x0400
  25562. +#define BCSR_STATUS_ROM_L_STS 0x0800
  25563. +#define BCSR_STATUS_FLASH_WP 0x1000
  25564. +#define BCSR_STATUS_SWAP_BOOT 0x2000
  25565. +#define BCSR_STATUS_ROM_SIZ 0x4000
  25566. +#define BCSR_STATUS_ROM_SEL 0x8000
  25567. +
  25568. +#define BCSR_SWITCHES_DIP 0x00FF
  25569. +#define BCSR_SWITCHES_DIP_1 0x0080
  25570. +#define BCSR_SWITCHES_DIP_2 0x0040
  25571. +#define BCSR_SWITCHES_DIP_3 0x0020
  25572. +#define BCSR_SWITCHES_DIP_4 0x0010
  25573. +#define BCSR_SWITCHES_DIP_5 0x0008
  25574. +#define BCSR_SWITCHES_DIP_6 0x0004
  25575. +#define BCSR_SWITCHES_DIP_7 0x0002
  25576. +#define BCSR_SWITCHES_DIP_8 0x0001
  25577. +#define BCSR_SWITCHES_ROTARY 0x0F00
  25578. +#define BCSR_SWITCHES_SDO_CL 0x8000
  25579. +
  25580. +#define BCSR_RESETS_PHY0 0x0001
  25581. +#define BCSR_RESETS_PHY1 0x0002
  25582. +#define BCSR_RESETS_DC 0x0004
  25583. +#define BCSR_RESETS_RS232_RTS 0x0100
  25584. +#define BCSR_RESETS_RS232_DTR 0x0200
  25585. +#define BCSR_RESETS_FIR_SEL 0x2000
  25586. +#define BCSR_RESETS_IRDA_MODE_MASK 0xC000
  25587. +#define BCSR_RESETS_IRDA_MODE_FULL 0x0000
  25588. +#define BCSR_RESETS_IRDA_MODE_OFF 0x4000
  25589. +#define BCSR_RESETS_IRDA_MODE_2_3 0x8000
  25590. +#define BCSR_RESETS_IRDA_MODE_1_3 0xC000
  25591. +
  25592. +#define BCSR_PCMCIA_PC0VPP 0x0003
  25593. +#define BCSR_PCMCIA_PC0VCC 0x000C
  25594. +#define BCSR_PCMCIA_PC0_DR_VEN 0x0010
  25595. +#define BCSR_PCMCIA_PC0RST 0x0080
  25596. +#define BCSR_PCMCIA_SEL_SD_CON0 0x0100
  25597. +#define BCSR_PCMCIA_SEL_SD_CON1 0x0200
  25598. +#define BCSR_PCMCIA_SD0_PWR 0x0400
  25599. +#define BCSR_PCMCIA_SD1_PWR 0x0800
  25600. +#define BCSR_PCMCIA_SD0_WP 0x4000
  25601. +#define BCSR_PCMCIA_SD1_WP 0x8000
  25602. +
  25603. +#define PB1100_G_CONTROL 0xAE000014
  25604. +#define BCSR_GRAPHICS_GPX_SMPASS 0x0010
  25605. +#define BCSR_GRAPHICS_GPX_BIG_ENDIAN 0x0020
  25606. +#define BCSR_GRAPHICS_GPX_RST 0x0040
  25607. +
  25608. +#define BCSR_LEDS_DECIMALS 0x00FF
  25609. +#define BCSR_LEDS_LED0 0x0100
  25610. +#define BCSR_LEDS_LED1 0x0200
  25611. +#define BCSR_LEDS_LED2 0x0400
  25612. +#define BCSR_LEDS_LED3 0x0800
  25613. +
  25614. +#define BCSR_SWRESET_RESET 0x0080
  25615. +#define BCSR_VDDI_VDI 0x001F
  25616. -/* PCMCIA PB1100 specific defines */
  25617. +
  25618. + /* PCMCIA Pb1x00 specific defines */
  25619. #define PCMCIA_MAX_SOCK 0
  25620. #define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK+1)
  25621. @@ -83,3 +136,4 @@
  25622. #define SET_VCC_VPP(VCC, VPP) (((VCC)<<2) | ((VPP)<<0))
  25623. #endif /* __ASM_PB1100_H */
  25624. +
  25625. Index: linux-2.4.35.4/include/asm-mips/pb1200.h
  25626. ===================================================================
  25627. --- /dev/null
  25628. +++ linux-2.4.35.4/include/asm-mips/pb1200.h
  25629. @@ -0,0 +1,244 @@
  25630. +/*
  25631. + * AMD Alchemy PB1200 Referrence Board
  25632. + * Board Registers defines.
  25633. + *
  25634. + * ########################################################################
  25635. + *
  25636. + * This program is free software; you can distribute it and/or modify it
  25637. + * under the terms of the GNU General Public License (Version 2) as
  25638. + * published by the Free Software Foundation.
  25639. + *
  25640. + * This program is distributed in the hope it will be useful, but WITHOUT
  25641. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  25642. + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  25643. + * for more details.
  25644. + *
  25645. + * You should have received a copy of the GNU General Public License along
  25646. + * with this program; if not, write to the Free Software Foundation, Inc.,
  25647. + * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  25648. + *
  25649. + * ########################################################################
  25650. + *
  25651. + *
  25652. + */
  25653. +#ifndef __ASM_PB1200_H
  25654. +#define __ASM_PB1200_H
  25655. +
  25656. +#include <linux/types.h>
  25657. +
  25658. +// This is defined in au1000.h with bogus value
  25659. +#undef AU1X00_EXTERNAL_INT
  25660. +
  25661. +#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
  25662. +#define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
  25663. +#define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC1_TX
  25664. +#define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC1_RX
  25665. +
  25666. +/* SPI and SMB are muxed on the Pb1200 board.
  25667. + Refer to board documentation.
  25668. + */
  25669. +#define SPI_PSC_BASE PSC0_BASE_ADDR
  25670. +#define SMBUS_PSC_BASE PSC0_BASE_ADDR
  25671. +/* AC97 and I2S are muxed on the Pb1200 board.
  25672. + Refer to board documentation.
  25673. + */
  25674. +#define AC97_PSC_BASE PSC1_BASE_ADDR
  25675. +#define I2S_PSC_BASE PSC1_BASE_ADDR
  25676. +
  25677. +#define BCSR_KSEG1_ADDR 0xAD800000
  25678. +
  25679. +typedef volatile struct
  25680. +{
  25681. + /*00*/ u16 whoami;
  25682. + u16 reserved0;
  25683. + /*04*/ u16 status;
  25684. + u16 reserved1;
  25685. + /*08*/ u16 switches;
  25686. + u16 reserved2;
  25687. + /*0C*/ u16 resets;
  25688. + u16 reserved3;
  25689. +
  25690. + /*10*/ u16 pcmcia;
  25691. + u16 reserved4;
  25692. + /*14*/ u16 board;
  25693. + u16 reserved5;
  25694. + /*18*/ u16 disk_leds;
  25695. + u16 reserved6;
  25696. + /*1C*/ u16 system;
  25697. + u16 reserved7;
  25698. +
  25699. + /*20*/ u16 intclr;
  25700. + u16 reserved8;
  25701. + /*24*/ u16 intset;
  25702. + u16 reserved9;
  25703. + /*28*/ u16 intclr_mask;
  25704. + u16 reserved10;
  25705. + /*2C*/ u16 intset_mask;
  25706. + u16 reserved11;
  25707. +
  25708. + /*30*/ u16 sig_status;
  25709. + u16 reserved12;
  25710. + /*34*/ u16 int_status;
  25711. + u16 reserved13;
  25712. + /*38*/ u16 reserved14;
  25713. + u16 reserved15;
  25714. + /*3C*/ u16 reserved16;
  25715. + u16 reserved17;
  25716. +
  25717. +} BCSR;
  25718. +
  25719. +static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  25720. +
  25721. +/*
  25722. + * Register bit definitions for the BCSRs
  25723. + */
  25724. +#define BCSR_WHOAMI_DCID 0x000F
  25725. +#define BCSR_WHOAMI_CPLD 0x00F0
  25726. +#define BCSR_WHOAMI_BOARD 0x0F00
  25727. +
  25728. +#define BCSR_STATUS_PCMCIA0VS 0x0003
  25729. +#define BCSR_STATUS_PCMCIA1VS 0x000C
  25730. +#define BCSR_STATUS_SWAPBOOT 0x0040
  25731. +#define BCSR_STATUS_FLASHBUSY 0x0100
  25732. +#define BCSR_STATUS_IDECBLID 0x0200
  25733. +#define BCSR_STATUS_SD0WP 0x0400
  25734. +#define BCSR_STATUS_SD1WP 0x0800
  25735. +#define BCSR_STATUS_U0RXD 0x1000
  25736. +#define BCSR_STATUS_U1RXD 0x2000
  25737. +
  25738. +#define BCSR_SWITCHES_OCTAL 0x00FF
  25739. +#define BCSR_SWITCHES_DIP_1 0x0080
  25740. +#define BCSR_SWITCHES_DIP_2 0x0040
  25741. +#define BCSR_SWITCHES_DIP_3 0x0020
  25742. +#define BCSR_SWITCHES_DIP_4 0x0010
  25743. +#define BCSR_SWITCHES_DIP_5 0x0008
  25744. +#define BCSR_SWITCHES_DIP_6 0x0004
  25745. +#define BCSR_SWITCHES_DIP_7 0x0002
  25746. +#define BCSR_SWITCHES_DIP_8 0x0001
  25747. +#define BCSR_SWITCHES_ROTARY 0x0F00
  25748. +
  25749. +#define BCSR_RESETS_ETH 0x0001
  25750. +#define BCSR_RESETS_CAMERA 0x0002
  25751. +#define BCSR_RESETS_DC 0x0004
  25752. +#define BCSR_RESETS_IDE 0x0008
  25753. +/* not resets but in the same register */
  25754. +#define BCSR_RESETS_WSCFSM 0x0800
  25755. +#define BCSR_RESETS_PCS0MUX 0x1000
  25756. +#define BCSR_RESETS_PCS1MUX 0x2000
  25757. +#define BCSR_RESETS_SPISEL 0x4000
  25758. +#define BCSR_RESETS_SD1MUX 0x8000
  25759. +
  25760. +#define BCSR_PCMCIA_PC0VPP 0x0003
  25761. +#define BCSR_PCMCIA_PC0VCC 0x000C
  25762. +#define BCSR_PCMCIA_PC0DRVEN 0x0010
  25763. +#define BCSR_PCMCIA_PC0RST 0x0080
  25764. +#define BCSR_PCMCIA_PC1VPP 0x0300
  25765. +#define BCSR_PCMCIA_PC1VCC 0x0C00
  25766. +#define BCSR_PCMCIA_PC1DRVEN 0x1000
  25767. +#define BCSR_PCMCIA_PC1RST 0x8000
  25768. +
  25769. +#define BCSR_BOARD_LCDVEE 0x0001
  25770. +#define BCSR_BOARD_LCDVDD 0x0002
  25771. +#define BCSR_BOARD_LCDBL 0x0004
  25772. +#define BCSR_BOARD_CAMSNAP 0x0010
  25773. +#define BCSR_BOARD_CAMPWR 0x0020
  25774. +#define BCSR_BOARD_SD0PWR 0x0040
  25775. +#define BCSR_BOARD_SD1PWR 0x0080
  25776. +
  25777. +#define BCSR_LEDS_DECIMALS 0x00FF
  25778. +#define BCSR_LEDS_LED0 0x0100
  25779. +#define BCSR_LEDS_LED1 0x0200
  25780. +#define BCSR_LEDS_LED2 0x0400
  25781. +#define BCSR_LEDS_LED3 0x0800
  25782. +
  25783. +#define BCSR_SYSTEM_VDDI 0x001F
  25784. +#define BCSR_SYSTEM_POWEROFF 0x4000
  25785. +#define BCSR_SYSTEM_RESET 0x8000
  25786. +
  25787. +/* Bit positions for the different interrupt sources */
  25788. +#define BCSR_INT_IDE 0x0001
  25789. +#define BCSR_INT_ETH 0x0002
  25790. +#define BCSR_INT_PC0 0x0004
  25791. +#define BCSR_INT_PC0STSCHG 0x0008
  25792. +#define BCSR_INT_PC1 0x0010
  25793. +#define BCSR_INT_PC1STSCHG 0x0020
  25794. +#define BCSR_INT_DC 0x0040
  25795. +#define BCSR_INT_FLASHBUSY 0x0080
  25796. +#define BCSR_INT_PC0INSERT 0x0100
  25797. +#define BCSR_INT_PC0EJECT 0x0200
  25798. +#define BCSR_INT_PC1INSERT 0x0400
  25799. +#define BCSR_INT_PC1EJECT 0x0800
  25800. +#define BCSR_INT_SD0INSERT 0x1000
  25801. +#define BCSR_INT_SD0EJECT 0x2000
  25802. +#define BCSR_INT_SD1INSERT 0x4000
  25803. +#define BCSR_INT_SD1EJECT 0x8000
  25804. +
  25805. +#define AU1XXX_SMC91111_PHYS_ADDR (0x0D000300)
  25806. +#define AU1XXX_SMC91111_IRQ PB1200_ETH_INT
  25807. +
  25808. +#define AU1XXX_ATA_PHYS_ADDR (0x0C800000)
  25809. +#define AU1XXX_ATA_PHYS_LEN (0x100)
  25810. +#define AU1XXX_ATA_REG_OFFSET (5)
  25811. +#define AU1XXX_ATA_INT PB1200_IDE_INT
  25812. +#define AU1XXX_ATA_DDMA_REQ DSCR_CMD0_DMA_REQ1;
  25813. +#define AU1XXX_ATA_RQSIZE 128
  25814. +
  25815. +#define NAND_PHYS_ADDR 0x1C000000
  25816. +
  25817. +/* Timing values as described in databook, * ns value stripped of
  25818. + * lower 2 bits.
  25819. + * These defines are here rather than an SOC1200 generic file because
  25820. + * the parts chosen on another board may be different and may require
  25821. + * different timings.
  25822. + */
  25823. +#define NAND_T_H (18 >> 2)
  25824. +#define NAND_T_PUL (30 >> 2)
  25825. +#define NAND_T_SU (30 >> 2)
  25826. +#define NAND_T_WH (30 >> 2)
  25827. +
  25828. +/* Bitfield shift amounts */
  25829. +#define NAND_T_H_SHIFT 0
  25830. +#define NAND_T_PUL_SHIFT 4
  25831. +#define NAND_T_SU_SHIFT 8
  25832. +#define NAND_T_WH_SHIFT 12
  25833. +
  25834. +#define NAND_TIMING ((NAND_T_H & 0xF) << NAND_T_H_SHIFT) | \
  25835. + ((NAND_T_PUL & 0xF) << NAND_T_PUL_SHIFT) | \
  25836. + ((NAND_T_SU & 0xF) << NAND_T_SU_SHIFT) | \
  25837. + ((NAND_T_WH & 0xF) << NAND_T_WH_SHIFT)
  25838. +
  25839. +
  25840. +/*
  25841. + * External Interrupts for Pb1200 as of 8/6/2004.
  25842. + * Bit positions in the CPLD registers can be calculated by taking
  25843. + * the interrupt define and subtracting the PB1200_INT_BEGIN value.
  25844. + * *example: IDE bis pos is = 64 - 64
  25845. + ETH bit pos is = 65 - 64
  25846. + */
  25847. +#define PB1200_INT_BEGIN (AU1000_LAST_INTC1_INT + 1)
  25848. +#define PB1200_IDE_INT (PB1200_INT_BEGIN + 0)
  25849. +#define PB1200_ETH_INT (PB1200_INT_BEGIN + 1)
  25850. +#define PB1200_PC0_INT (PB1200_INT_BEGIN + 2)
  25851. +#define PB1200_PC0_STSCHG_INT (PB1200_INT_BEGIN + 3)
  25852. +#define PB1200_PC1_INT (PB1200_INT_BEGIN + 4)
  25853. +#define PB1200_PC1_STSCHG_INT (PB1200_INT_BEGIN + 5)
  25854. +#define PB1200_DC_INT (PB1200_INT_BEGIN + 6)
  25855. +#define PB1200_FLASHBUSY_INT (PB1200_INT_BEGIN + 7)
  25856. +#define PB1200_PC0_INSERT_INT (PB1200_INT_BEGIN + 8)
  25857. +#define PB1200_PC0_EJECT_INT (PB1200_INT_BEGIN + 9)
  25858. +#define PB1200_PC1_INSERT_INT (PB1200_INT_BEGIN + 10)
  25859. +#define PB1200_PC1_EJECT_INT (PB1200_INT_BEGIN + 11)
  25860. +#define PB1200_SD0_INSERT_INT (PB1200_INT_BEGIN + 12)
  25861. +#define PB1200_SD0_EJECT_INT (PB1200_INT_BEGIN + 13)
  25862. +#define PB1200_SD1_INSERT_INT (PB1200_INT_BEGIN + 14)
  25863. +#define PB1200_SD1_EJECT_INT (PB1200_INT_BEGIN + 15)
  25864. +
  25865. +#define PB1200_INT_END (PB1200_INT_BEGIN + 15)
  25866. +
  25867. +/* For drivers/pcmcia/au1000_db1x00.c */
  25868. +#define BOARD_PC0_INT PB1200_PC0_INT
  25869. +#define BOARD_PC1_INT PB1200_PC1_INT
  25870. +#define BOARD_CARD_INSERTED(SOCKET) bcsr->sig_status & (1<<(8+(2*SOCKET)))
  25871. +
  25872. +#endif /* __ASM_PB1200_H */
  25873. +
  25874. Index: linux-2.4.35.4/include/asm-mips/pb1550.h
  25875. ===================================================================
  25876. --- linux-2.4.35.4.orig/include/asm-mips/pb1550.h
  25877. +++ linux-2.4.35.4/include/asm-mips/pb1550.h
  25878. @@ -30,13 +30,11 @@
  25879. #define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
  25880. #define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
  25881. -#define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC3_TX
  25882. -#define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC3_RX
  25883. -
  25884. #define SPI_PSC_BASE PSC0_BASE_ADDR
  25885. #define AC97_PSC_BASE PSC1_BASE_ADDR
  25886. #define SMBUS_PSC_BASE PSC2_BASE_ADDR
  25887. #define I2S_PSC_BASE PSC3_BASE_ADDR
  25888. +#define NAND_CS 1
  25889. #define BCSR_PHYS_ADDR 0xAF000000
  25890. @@ -160,9 +158,23 @@ static BCSR * const bcsr = (BCSR *)BCSR_
  25891. #define NAND_T_SU_SHIFT 8
  25892. #define NAND_T_WH_SHIFT 12
  25893. -#define NAND_TIMING ((NAND_T_H & 0xF) << NAND_T_H_SHIFT) | \
  25894. - ((NAND_T_PUL & 0xF) << NAND_T_PUL_SHIFT) | \
  25895. - ((NAND_T_SU & 0xF) << NAND_T_SU_SHIFT) | \
  25896. - ((NAND_T_WH & 0xF) << NAND_T_WH_SHIFT)
  25897. +#define NAND_TIMING ((NAND_T_H & 0xF) << NAND_T_H_SHIFT) | \
  25898. + ((NAND_T_PUL & 0xF) << NAND_T_PUL_SHIFT) | \
  25899. + ((NAND_T_SU & 0xF) << NAND_T_SU_SHIFT) | \
  25900. + ((NAND_T_WH & 0xF) << NAND_T_WH_SHIFT)
  25901. +
  25902. +/*
  25903. + * Daughter card information.
  25904. + */
  25905. +#define DAUGHTER_CARD_BASE (0xAC000000)
  25906. +#define DAUGHTER_CARD_MEM_SIZE (0xADFFFFFF - DAUGHTER_CARD_BASE + 1)
  25907. +#define DAUGHTER_CARD_IRQ (AU1000_GPIO_3)
  25908. +
  25909. +/* DC_IDE and DC_ETHERNET */
  25910. +#define AU1XXX_ATA_PHYS_ADDR (0x0C000000)
  25911. +#define AU1XXX_ATA_REG_OFFSET (5)
  25912. +
  25913. +#define AU1XXX_SMC91111_PHYS_ADDR (0x0C000300)
  25914. +#define AU1XXX_SMC91111_IRQ AU1000_GPIO_3
  25915. #endif /* __ASM_PB1550_H */
  25916. Index: linux-2.4.35.4/include/asm-mips/reg.h
  25917. ===================================================================
  25918. --- linux-2.4.35.4.orig/include/asm-mips/reg.h
  25919. +++ linux-2.4.35.4/include/asm-mips/reg.h
  25920. @@ -45,6 +45,9 @@
  25921. /*
  25922. * k0/k1 unsaved
  25923. */
  25924. +#define EF_REG26 32
  25925. +#define EF_REG27 33
  25926. +
  25927. #define EF_REG28 34
  25928. #define EF_REG29 35
  25929. #define EF_REG30 36
  25930. @@ -60,6 +63,7 @@
  25931. #define EF_CP0_BADVADDR 41
  25932. #define EF_CP0_STATUS 42
  25933. #define EF_CP0_CAUSE 43
  25934. +#define EF_UNUSED0 44
  25935. #define EF_SIZE 180 /* size in bytes */
  25936. Index: linux-2.4.35.4/include/asm-mips/sgi/hpc3.h
  25937. ===================================================================
  25938. --- linux-2.4.35.4.orig/include/asm-mips/sgi/hpc3.h
  25939. +++ linux-2.4.35.4/include/asm-mips/sgi/hpc3.h
  25940. @@ -128,26 +128,26 @@ struct hpc3_ethregs {
  25941. volatile u32 rx_gfptr; /* current GIO fifo ptr */
  25942. volatile u32 rx_dfptr; /* current device fifo ptr */
  25943. u32 _unused1; /* padding */
  25944. - volatile u32 rx_reset; /* reset register */
  25945. -#define HPC3_ERXRST_CRESET 0x1 /* Reset dma channel and external controller */
  25946. -#define HPC3_ERXRST_CLRIRQ 0x2 /* Clear channel interrupt */
  25947. -#define HPC3_ERXRST_LBACK 0x4 /* Enable diagnostic loopback mode of Seeq8003 */
  25948. -
  25949. - volatile u32 rx_dconfig; /* DMA configuration register */
  25950. -#define HPC3_ERXDCFG_D1 0x0000f /* Cycles to spend in D1 state for PIO */
  25951. -#define HPC3_ERXDCFG_D2 0x000f0 /* Cycles to spend in D2 state for PIO */
  25952. -#define HPC3_ERXDCFG_D3 0x00f00 /* Cycles to spend in D3 state for PIO */
  25953. -#define HPC3_ERXDCFG_WCTRL 0x01000 /* Enable writes of desc into ex ctrl port */
  25954. -#define HPC3_ERXDCFG_FRXDC 0x02000 /* Clear eop stat bits upon rxdc, hw seeq fix */
  25955. -#define HPC3_ERXDCFG_FEOP 0x04000 /* Bad packet marker timeout enable */
  25956. -#define HPC3_ERXDCFG_FIRQ 0x08000 /* Another bad packet timeout enable */
  25957. -#define HPC3_ERXDCFG_PTO 0x30000 /* Programmed timeout value for above two */
  25958. -
  25959. - volatile u32 rx_pconfig; /* PIO configuration register */
  25960. -#define HPC3_ERXPCFG_P1 0x000f /* Cycles to spend in P1 state for PIO */
  25961. -#define HPC3_ERXPCFG_P2 0x00f0 /* Cycles to spend in P2 state for PIO */
  25962. -#define HPC3_ERXPCFG_P3 0x0f00 /* Cycles to spend in P3 state for PIO */
  25963. -#define HPC3_ERXPCFG_TST 0x1000 /* Diagnistic ram test feature bit */
  25964. + volatile u32 reset; /* reset register */
  25965. +#define HPC3_ERST_CRESET 0x1 /* Reset dma channel and external controller */
  25966. +#define HPC3_ERST_CLRIRQ 0x2 /* Clear channel interrupt */
  25967. +#define HPC3_ERST_LBACK 0x4 /* Enable diagnostic loopback mode of Seeq8003 */
  25968. +
  25969. + volatile u32 dconfig; /* DMA configuration register */
  25970. +#define HPC3_EDCFG_D1 0x0000f /* Cycles to spend in D1 state for PIO */
  25971. +#define HPC3_EDCFG_D2 0x000f0 /* Cycles to spend in D2 state for PIO */
  25972. +#define HPC3_EDCFG_D3 0x00f00 /* Cycles to spend in D3 state for PIO */
  25973. +#define HPC3_EDCFG_WCTRL 0x01000 /* Enable writes of desc into ex ctrl port */
  25974. +#define HPC3_EDCFG_FRXDC 0x02000 /* Clear eop stat bits upon rxdc, hw seeq fix */
  25975. +#define HPC3_EDCFG_FEOP 0x04000 /* Bad packet marker timeout enable */
  25976. +#define HPC3_EDCFG_FIRQ 0x08000 /* Another bad packet timeout enable */
  25977. +#define HPC3_EDCFG_PTO 0x30000 /* Programmed timeout value for above two */
  25978. +
  25979. + volatile u32 pconfig; /* PIO configuration register */
  25980. +#define HPC3_EPCFG_P1 0x000f /* Cycles to spend in P1 state for PIO */
  25981. +#define HPC3_EPCFG_P2 0x00f0 /* Cycles to spend in P2 state for PIO */
  25982. +#define HPC3_EPCFG_P3 0x0f00 /* Cycles to spend in P3 state for PIO */
  25983. +#define HPC3_EPCFG_TST 0x1000 /* Diagnistic ram test feature bit */
  25984. u32 _unused2[0x1000/4 - 8]; /* padding */
  25985. @@ -221,7 +221,7 @@ struct hpc3_regs {
  25986. #define HPC3_BESTAT_PIDMASK 0x3f700 /* DMA channel parity identifier */
  25987. u32 _unused1[0x14000/4 - 5]; /* padding */
  25988. -
  25989. +
  25990. /* Now direct PIO per-HPC3 peripheral access to external regs. */
  25991. volatile u32 scsi0_ext[256]; /* SCSI channel 0 external regs */
  25992. u32 _unused2[0x7c00/4];
  25993. @@ -304,7 +304,7 @@ struct hpc3_regs {
  25994. volatile u32 bbram[8192-50-14]; /* Battery backed ram */
  25995. };
  25996. -/*
  25997. +/*
  25998. * It is possible to have two HPC3's within the address space on
  25999. * one machine, though only having one is more likely on an Indy.
  26000. */
  26001. Index: linux-2.4.35.4/include/asm-mips/tx4927/tx4927.h
  26002. ===================================================================
  26003. --- linux-2.4.35.4.orig/include/asm-mips/tx4927/tx4927.h
  26004. +++ linux-2.4.35.4/include/asm-mips/tx4927/tx4927.h
  26005. @@ -88,8 +88,8 @@
  26006. /* TX4927 Configuration registers (64-bit registers) */
  26007. -#define TX4927_CONFIG_BASE 0xe300
  26008. -#define TX4927_CONFIG_CCFG 0xe300
  26009. +#define TX4927_CONFIG_BASE 0xe000
  26010. +#define TX4927_CONFIG_CCFG 0xe000
  26011. #define TX4927_CONFIG_CCFG_RESERVED_42_63 BM_63_42
  26012. #define TX4927_CONFIG_CCFG_WDRST BM_41_41
  26013. #define TX4927_CONFIG_CCFG_WDREXEN BM_40_40
  26014. @@ -124,14 +124,14 @@
  26015. #define TX4927_CONFIG_CCFG_ENDIAN BM_02_02
  26016. #define TX4927_CONFIG_CCFG_ARMODE BM_01_01
  26017. #define TX4927_CONFIG_CCFG_ACEHOLD BM_00_00
  26018. -#define TX4927_CONFIG_REVID 0xe308
  26019. +#define TX4927_CONFIG_REVID 0xe008
  26020. #define TX4927_CONFIG_REVID_RESERVED_32_63 BM_32_63
  26021. #define TX4927_CONFIG_REVID_PCODE BM_16_31
  26022. #define TX4927_CONFIG_REVID_MJERREV BM_12_15
  26023. #define TX4927_CONFIG_REVID_MINEREV BM_08_11
  26024. #define TX4927_CONFIG_REVID_MJREV BM_04_07
  26025. #define TX4927_CONFIG_REVID_MINREV BM_00_03
  26026. -#define TX4927_CONFIG_PCFG 0xe310
  26027. +#define TX4927_CONFIG_PCFG 0xe010
  26028. #define TX4927_CONFIG_PCFG_RESERVED_57_63 BM_57_63
  26029. #define TX4927_CONFIG_PCFG_DRVDATA BM_56_56
  26030. #define TX4927_CONFIG_PCFG_DRVCB BM_55_55
  26031. @@ -197,10 +197,10 @@
  26032. #define TX4927_CONFIG_PCFG_DMASEL0_SIO1 BM_00_00
  26033. #define TX4927_CONFIG_PCFG_DMASEL0_ACLC0 BM_01_01
  26034. #define TX4927_CONFIG_PCFG_DMASEL0_ACLC2 BM_00_01
  26035. -#define TX4927_CONFIG_TOEA 0xe318
  26036. +#define TX4927_CONFIG_TOEA 0xe018
  26037. #define TX4927_CONFIG_TOEA_RESERVED_36_63 BM_36_63
  26038. #define TX4927_CONFIG_TOEA_TOEA BM_00_35
  26039. -#define TX4927_CONFIG_CLKCTR 0xe320
  26040. +#define TX4927_CONFIG_CLKCTR 0xe020
  26041. #define TX4927_CONFIG_CLKCTR_RESERVED_26_63 BM_26_63
  26042. #define TX4927_CONFIG_CLKCTR_ACLCKD BM_25_25
  26043. #define TX4927_CONFIG_CLKCTR_PIOCKD BM_24_24
  26044. @@ -223,7 +223,7 @@
  26045. #define TX4927_CONFIG_CLKCTR_TM2RST BM_02_02
  26046. #define TX4927_CONFIG_CLKCTR_SIO0RST BM_01_01
  26047. #define TX4927_CONFIG_CLKCTR_SIO1RST BM_00_00
  26048. -#define TX4927_CONFIG_GARBC 0xe330
  26049. +#define TX4927_CONFIG_GARBC 0xe030
  26050. #define TX4927_CONFIG_GARBC_RESERVED_10_63 BM_10_63
  26051. #define TX4927_CONFIG_GARBC_SET_09 BM_09_09
  26052. #define TX4927_CONFIG_GARBC_ARBMD BM_08_08
  26053. @@ -243,7 +243,7 @@
  26054. #define TX4927_CONFIG_GARBC_PRIORITY_H3_PDMAC BM_00_00
  26055. #define TX4927_CONFIG_GARBC_PRIORITY_H3_DMAC BM_01_01
  26056. #define TX4927_CONFIG_GARBC_PRIORITY_H3_BAD_VALUE BM_00_01
  26057. -#define TX4927_CONFIG_RAMP 0xe348
  26058. +#define TX4927_CONFIG_RAMP 0xe048
  26059. #define TX4927_CONFIG_RAMP_RESERVED_20_63 BM_20_63
  26060. #define TX4927_CONFIG_RAMP_RAMP BM_00_19
  26061. #define TX4927_CONFIG_LIMIT 0xefff
  26062. @@ -456,7 +456,7 @@
  26063. #define TX4927_ACLC_ACINTSTS 0xf710
  26064. #define TX4927_ACLC_ACINTMSTS 0xf714
  26065. #define TX4927_ACLC_ACINTEN 0xf718
  26066. -#define TX4927_ACLC_ACINTDIS 0xfR71c
  26067. +#define TX4927_ACLC_ACINTDIS 0xf71c
  26068. #define TX4927_ACLC_ACSEMAPH 0xf720
  26069. #define TX4927_ACLC_ACGPIDAT 0xf740
  26070. #define TX4927_ACLC_ACGPODAT 0xf744
  26071. Index: linux-2.4.35.4/include/asm-mips/unistd.h
  26072. ===================================================================
  26073. --- linux-2.4.35.4.orig/include/asm-mips/unistd.h
  26074. +++ linux-2.4.35.4/include/asm-mips/unistd.h
  26075. @@ -760,7 +760,7 @@ type name(void) \
  26076. if (__a3 == 0) \
  26077. return (type) __v0; \
  26078. errno = __v0; \
  26079. - return -1; \
  26080. + return (type)-1; \
  26081. }
  26082. /*
  26083. @@ -788,7 +788,7 @@ type name(atype a) \
  26084. if (__a3 == 0) \
  26085. return (type) __v0; \
  26086. errno = __v0; \
  26087. - return -1; \
  26088. + return (type)-1; \
  26089. }
  26090. #define _syscall2(type,name,atype,a,btype,b) \
  26091. @@ -813,7 +813,7 @@ type name(atype a, btype b) \
  26092. if (__a3 == 0) \
  26093. return (type) __v0; \
  26094. errno = __v0; \
  26095. - return -1; \
  26096. + return (type)-1; \
  26097. }
  26098. #define _syscall3(type,name,atype,a,btype,b,ctype,c) \
  26099. @@ -839,7 +839,7 @@ type name(atype a, btype b, ctype c) \
  26100. if (__a3 == 0) \
  26101. return (type) __v0; \
  26102. errno = __v0; \
  26103. - return -1; \
  26104. + return (type)-1; \
  26105. }
  26106. #define _syscall4(type,name,atype,a,btype,b,ctype,c,dtype,d) \
  26107. @@ -865,7 +865,7 @@ type name(atype a, btype b, ctype c, dty
  26108. if (__a3 == 0) \
  26109. return (type) __v0; \
  26110. errno = __v0; \
  26111. - return -1; \
  26112. + return (type)-1; \
  26113. }
  26114. #if (_MIPS_SIM == _MIPS_SIM_ABI32)
  26115. @@ -902,7 +902,7 @@ type name(atype a, btype b, ctype c, dty
  26116. if (__a3 == 0) \
  26117. return (type) __v0; \
  26118. errno = __v0; \
  26119. - return -1; \
  26120. + return (type)-1; \
  26121. }
  26122. #define _syscall6(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f) \
  26123. @@ -935,7 +935,7 @@ type name(atype a, btype b, ctype c, dty
  26124. if (__a3 == 0) \
  26125. return (type) __v0; \
  26126. errno = __v0; \
  26127. - return -1; \
  26128. + return (type)-1; \
  26129. }
  26130. #endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
  26131. @@ -966,7 +966,7 @@ type name (atype a,btype b,ctype c,dtype
  26132. if (__a3 == 0) \
  26133. return (type) __v0; \
  26134. errno = __v0; \
  26135. - return -1; \
  26136. + return (type)-1; \
  26137. }
  26138. #define _syscall6(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f) \
  26139. @@ -995,7 +995,7 @@ type name (atype a,btype b,ctype c,dtype
  26140. if (__a3 == 0) \
  26141. return (type) __v0; \
  26142. errno = __v0; \
  26143. - return -1; \
  26144. + return (type)-1; \
  26145. }
  26146. #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
  26147. Index: linux-2.4.35.4/include/asm-mips64/checksum.h
  26148. ===================================================================
  26149. --- linux-2.4.35.4.orig/include/asm-mips64/checksum.h
  26150. +++ linux-2.4.35.4/include/asm-mips64/checksum.h
  26151. @@ -144,7 +144,7 @@ static inline unsigned long csum_tcpudp_
  26152. "daddu\t%0, %4\n\t"
  26153. "dsll32\t$1, %0, 0\n\t"
  26154. "daddu\t%0, $1\n\t"
  26155. - "dsrl32\t%0, %0, 0\n\t"
  26156. + "dsra32\t%0, %0, 0\n\t"
  26157. ".set\tat"
  26158. : "=&r" (sum)
  26159. : "0" (daddr), "r"(saddr),
  26160. Index: linux-2.4.35.4/include/asm-mips64/elf.h
  26161. ===================================================================
  26162. --- linux-2.4.35.4.orig/include/asm-mips64/elf.h
  26163. +++ linux-2.4.35.4/include/asm-mips64/elf.h
  26164. @@ -64,9 +64,10 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_N
  26165. #define USE_ELF_CORE_DUMP
  26166. #define ELF_EXEC_PAGESIZE PAGE_SIZE
  26167. -#define ELF_CORE_COPY_REGS(_dest,_regs) \
  26168. - memcpy((char *) &_dest, (char *) _regs, \
  26169. - sizeof(struct pt_regs));
  26170. +extern void dump_regs(elf_greg_t *, struct pt_regs *regs);
  26171. +
  26172. +#define ELF_CORE_COPY_REGS(elf_regs, regs) \
  26173. + dump_regs((elf_greg_t *)&(elf_regs), regs);
  26174. /* This yields a mask that user programs can use to figure out what
  26175. instruction set this cpu supports. This could be done in userspace,
  26176. Index: linux-2.4.35.4/include/asm-mips64/hazards.h
  26177. ===================================================================
  26178. --- linux-2.4.35.4.orig/include/asm-mips64/hazards.h
  26179. +++ linux-2.4.35.4/include/asm-mips64/hazards.h
  26180. @@ -3,7 +3,7 @@
  26181. * License. See the file "COPYING" in the main directory of this archive
  26182. * for more details.
  26183. *
  26184. - * Copyright (C) 2003 Ralf Baechle
  26185. + * Copyright (C) 2003, 2004 Ralf Baechle
  26186. */
  26187. #ifndef _ASM_HAZARDS_H
  26188. #define _ASM_HAZARDS_H
  26189. @@ -12,37 +12,200 @@
  26190. #ifdef __ASSEMBLY__
  26191. + .macro _ssnop
  26192. + sll $0, $0, 1
  26193. + .endm
  26194. +
  26195. /*
  26196. * RM9000 hazards. When the JTLB is updated by tlbwi or tlbwr, a subsequent
  26197. * use of the JTLB for instructions should not occur for 4 cpu cycles and use
  26198. * for data translations should not occur for 3 cpu cycles.
  26199. */
  26200. #ifdef CONFIG_CPU_RM9000
  26201. -#define rm9000_tlb_hazard \
  26202. +
  26203. +#define mtc0_tlbw_hazard \
  26204. + .set push; \
  26205. .set mips32; \
  26206. - ssnop; ssnop; ssnop; ssnop; \
  26207. - .set mips0
  26208. + _ssnop; _ssnop; _ssnop; _ssnop; \
  26209. + .set pop
  26210. +
  26211. +#define tlbw_eret_hazard \
  26212. + .set push; \
  26213. + .set mips32; \
  26214. + _ssnop; _ssnop; _ssnop; _ssnop; \
  26215. + .set pop
  26216. +
  26217. #else
  26218. -#define rm9000_tlb_hazard
  26219. +
  26220. +/*
  26221. + * The taken branch will result in a two cycle penalty for the two killed
  26222. + * instructions on R4000 / R4400. Other processors only have a single cycle
  26223. + * hazard so this is nice trick to have an optimal code for a range of
  26224. + * processors.
  26225. + */
  26226. +#define mtc0_tlbw_hazard \
  26227. + b . + 8
  26228. +#define tlbw_eret_hazard \
  26229. + nop
  26230. #endif
  26231. +/*
  26232. + * mtc0->mfc0 hazard
  26233. + * The 24K has a 2 cycle mtc0/mfc0 execution hazard.
  26234. + * It is a MIPS32R2 processor so ehb will clear the hazard.
  26235. + */
  26236. +
  26237. +#ifdef CONFIG_CPU_MIPSR2
  26238. +/*
  26239. + * Use a macro for ehb unless explicit support for MIPSR2 is enabled
  26240. + */
  26241. + .macro ehb
  26242. + sll $0, $0, 3
  26243. + .endm
  26244. +
  26245. +#define irq_enable_hazard \
  26246. + ehb # irq_enable_hazard
  26247. +
  26248. +#define irq_disable_hazard \
  26249. + ehb # irq_disable_hazard
  26250. +
  26251. +#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000)
  26252. +
  26253. +/*
  26254. + * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
  26255. + */
  26256. +
  26257. +#define irq_enable_hazard
  26258. +
  26259. +#define irq_disable_hazard
  26260. +
  26261. #else
  26262. /*
  26263. + * Classic MIPS needs 1 - 3 nops or ssnops
  26264. + */
  26265. +#define irq_enable_hazard
  26266. +#define irq_disable_hazard \
  26267. + _ssnop; _ssnop; _ssnop
  26268. +
  26269. +#endif
  26270. +
  26271. +#else /* __ASSEMBLY__ */
  26272. +
  26273. +/*
  26274. * RM9000 hazards. When the JTLB is updated by tlbwi or tlbwr, a subsequent
  26275. * use of the JTLB for instructions should not occur for 4 cpu cycles and use
  26276. * for data translations should not occur for 3 cpu cycles.
  26277. */
  26278. #ifdef CONFIG_CPU_RM9000
  26279. -#define rm9000_tlb_hazard() \
  26280. +
  26281. +#define mtc0_tlbw_hazard() \
  26282. + __asm__ __volatile__( \
  26283. + ".set\tmips32\n\t" \
  26284. + "_ssnop; _ssnop; _ssnop; _ssnop\n\t" \
  26285. + ".set\tmips0")
  26286. +
  26287. +#define tlbw_use_hazard() \
  26288. __asm__ __volatile__( \
  26289. ".set\tmips32\n\t" \
  26290. - "ssnop; ssnop; ssnop; ssnop\n\t" \
  26291. + "_ssnop; _ssnop; _ssnop; _ssnop\n\t" \
  26292. ".set\tmips0")
  26293. #else
  26294. -#define rm9000_tlb_hazard() do { } while (0)
  26295. +
  26296. +/*
  26297. + * Overkill warning ...
  26298. + */
  26299. +#define mtc0_tlbw_hazard() \
  26300. + __asm__ __volatile__( \
  26301. + ".set noreorder\n\t" \
  26302. + "nop; nop; nop; nop; nop; nop;\n\t" \
  26303. + ".set reorder\n\t")
  26304. +
  26305. +#define tlbw_use_hazard() \
  26306. + __asm__ __volatile__( \
  26307. + ".set noreorder\n\t" \
  26308. + "nop; nop; nop; nop; nop; nop;\n\t" \
  26309. + ".set reorder\n\t")
  26310. +
  26311. #endif
  26312. +/*
  26313. + * mtc0->mfc0 hazard
  26314. + * The 24K has a 2 cycle mtc0/mfc0 execution hazard.
  26315. + * It is a MIPS32R2 processor so ehb will clear the hazard.
  26316. + */
  26317. +
  26318. +#ifdef CONFIG_CPU_MIPSR2
  26319. +/*
  26320. + * Use a macro for ehb unless explicit support for MIPSR2 is enabled
  26321. + */
  26322. +__asm__(
  26323. + " .macro ehb \n\t"
  26324. + " sll $0, $0, 3 \n\t"
  26325. + " .endm \n\t"
  26326. + " \n\t"
  26327. + " .macro\tirq_enable_hazard \n\t"
  26328. + " ehb \n\t"
  26329. + " .endm \n\t"
  26330. + " \n\t"
  26331. + " .macro\tirq_disable_hazard \n\t"
  26332. + " ehb \n\t"
  26333. + " .endm");
  26334. +
  26335. +#define irq_enable_hazard() \
  26336. + __asm__ __volatile__( \
  26337. + "ehb\t\t\t\t# irq_enable_hazard")
  26338. +
  26339. +#define irq_disable_hazard() \
  26340. + __asm__ __volatile__( \
  26341. + "ehb\t\t\t\t# irq_disable_hazard")
  26342. +
  26343. +#elif defined(CONFIG_CPU_R10000)
  26344. +
  26345. +/*
  26346. + * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
  26347. + */
  26348. +
  26349. +__asm__(
  26350. + " .macro\tirq_enable_hazard \n\t"
  26351. + " .endm \n\t"
  26352. + " \n\t"
  26353. + " .macro\tirq_disable_hazard \n\t"
  26354. + " .endm");
  26355. +
  26356. +#define irq_enable_hazard() do { } while (0)
  26357. +#define irq_disable_hazard() do { } while (0)
  26358. +
  26359. +#else
  26360. +
  26361. +/*
  26362. + * Default for classic MIPS processors. Assume worst case hazards but don't
  26363. + * care about the irq_enable_hazard - sooner or later the hardware will
  26364. + * enable it and we don't care when exactly.
  26365. + */
  26366. +
  26367. +__asm__(
  26368. + " .macro _ssnop \n\t"
  26369. + " sll $0, $2, 1 \n\t"
  26370. + " .endm \n\t"
  26371. + " \n\t"
  26372. + " # \n\t"
  26373. + " # There is a hazard but we do not care \n\t"
  26374. + " # \n\t"
  26375. + " .macro\tirq_enable_hazard \n\t"
  26376. + " .endm \n\t"
  26377. + " \n\t"
  26378. + " .macro\tirq_disable_hazard \n\t"
  26379. + " _ssnop; _ssnop; _ssnop \n\t"
  26380. + " .endm");
  26381. +
  26382. +#define irq_enable_hazard() do { } while (0)
  26383. +#define irq_disable_hazard() \
  26384. + __asm__ __volatile__( \
  26385. + "_ssnop; _ssnop; _ssnop;\t\t# irq_disable_hazard")
  26386. +
  26387. #endif
  26388. +#endif /* __ASSEMBLY__ */
  26389. +
  26390. #endif /* _ASM_HAZARDS_H */
  26391. Index: linux-2.4.35.4/include/asm-mips64/ide.h
  26392. ===================================================================
  26393. --- linux-2.4.35.4.orig/include/asm-mips64/ide.h
  26394. +++ linux-2.4.35.4/include/asm-mips64/ide.h
  26395. @@ -32,12 +32,12 @@ struct ide_ops {
  26396. extern struct ide_ops *ide_ops;
  26397. -static __inline__ int ide_default_irq(ide_ioreg_t base)
  26398. +static inline int ide_default_irq(ide_ioreg_t base)
  26399. {
  26400. return ide_ops->ide_default_irq(base);
  26401. }
  26402. -static __inline__ ide_ioreg_t ide_default_io_base(int index)
  26403. +static inline ide_ioreg_t ide_default_io_base(int index)
  26404. {
  26405. return ide_ops->ide_default_io_base(index);
  26406. }
  26407. @@ -48,7 +48,7 @@ static inline void ide_init_hwif_ports(h
  26408. ide_ops->ide_init_hwif_ports(hw, data_port, ctrl_port, irq);
  26409. }
  26410. -static __inline__ void ide_init_default_hwifs(void)
  26411. +static inline void ide_init_default_hwifs(void)
  26412. {
  26413. #ifndef CONFIG_BLK_DEV_IDEPCI
  26414. hw_regs_t hw;
  26415. @@ -68,7 +68,89 @@ static __inline__ void ide_init_default_
  26416. #define ide_ack_intr(hwif) ((hwif)->hw.ack_intr ? (hwif)->hw.ack_intr(hwif) : 1)
  26417. #endif
  26418. -#include <asm-generic/ide_iops.h>
  26419. +/* MIPS port and memory-mapped I/O string operations. */
  26420. +
  26421. +static inline void __ide_flush_dcache_range(unsigned long addr, unsigned long size)
  26422. +{
  26423. + if (cpu_has_dc_aliases) {
  26424. + unsigned long end = addr + size;
  26425. + for (; addr < end; addr += PAGE_SIZE)
  26426. + flush_dcache_page(virt_to_page(addr));
  26427. + }
  26428. +}
  26429. +
  26430. +static inline void __ide_insw(unsigned long port, void *addr,
  26431. + unsigned int count)
  26432. +{
  26433. + insw(port, addr, count);
  26434. + __ide_flush_dcache_range((unsigned long)addr, count * 2);
  26435. +}
  26436. +
  26437. +static inline void __ide_insl(unsigned long port, void *addr, unsigned int count)
  26438. +{
  26439. + insl(port, addr, count);
  26440. + __ide_flush_dcache_range((unsigned long)addr, count * 4);
  26441. +}
  26442. +
  26443. +static inline void __ide_outsw(unsigned long port, const void *addr,
  26444. + unsigned long count)
  26445. +{
  26446. + outsw(port, addr, count);
  26447. + __ide_flush_dcache_range((unsigned long)addr, count * 2);
  26448. +}
  26449. +
  26450. +static inline void __ide_outsl(unsigned long port, const void *addr,
  26451. + unsigned long count)
  26452. +{
  26453. + outsl(port, addr, count);
  26454. + __ide_flush_dcache_range((unsigned long)addr, count * 4);
  26455. +}
  26456. +
  26457. +static inline void __ide_mm_insw(unsigned long port, void *addr, u32 count)
  26458. +{
  26459. + unsigned long start = (unsigned long) addr;
  26460. +
  26461. + while (count--) {
  26462. + *(u16 *)addr = readw(port);
  26463. + addr += 2;
  26464. + }
  26465. + __ide_flush_dcache_range(start, count * 2);
  26466. +}
  26467. +
  26468. +static inline void __ide_mm_insl(unsigned long port, void *addr, u32 count)
  26469. +{
  26470. + unsigned long start = (unsigned long) addr;
  26471. +
  26472. + while (count--) {
  26473. + *(u32 *)addr = readl(port);
  26474. + addr += 4;
  26475. + }
  26476. + __ide_flush_dcache_range(start, count * 4);
  26477. +}
  26478. +
  26479. +static inline void __ide_mm_outsw(unsigned long port, const void *addr,
  26480. + u32 count)
  26481. +{
  26482. + unsigned long start = (unsigned long) addr;
  26483. +
  26484. + while (count--) {
  26485. + writew(*(u16 *)addr, port);
  26486. + addr += 2;
  26487. + }
  26488. + __ide_flush_dcache_range(start, count * 2);
  26489. +}
  26490. +
  26491. +static inline void __ide_mm_outsl(unsigned long port, const void *addr,
  26492. + u32 count)
  26493. +{
  26494. + unsigned long start = (unsigned long) addr;
  26495. +
  26496. + while (count--) {
  26497. + writel(*(u32 *)addr, port);
  26498. + addr += 4;
  26499. + }
  26500. + __ide_flush_dcache_range(start, count * 4);
  26501. +}
  26502. #endif /* __KERNEL__ */
  26503. Index: linux-2.4.35.4/include/asm-mips64/io.h
  26504. ===================================================================
  26505. --- linux-2.4.35.4.orig/include/asm-mips64/io.h
  26506. +++ linux-2.4.35.4/include/asm-mips64/io.h
  26507. @@ -414,7 +414,8 @@ static inline unsigned int inl_p(unsigne
  26508. return __ioswab32(__val);
  26509. }
  26510. -static inline void __outsb(unsigned long port, void *addr, unsigned int count)
  26511. +static inline void __outsb(unsigned long port, const void *addr,
  26512. + unsigned int count)
  26513. {
  26514. while (count--) {
  26515. outb(*(u8 *)addr, port);
  26516. @@ -430,7 +431,8 @@ static inline void __insb(unsigned long
  26517. }
  26518. }
  26519. -static inline void __outsw(unsigned long port, void *addr, unsigned int count)
  26520. +static inline void __outsw(unsigned long port, const void *addr,
  26521. + unsigned int count)
  26522. {
  26523. while (count--) {
  26524. outw(*(u16 *)addr, port);
  26525. @@ -446,7 +448,8 @@ static inline void __insw(unsigned long
  26526. }
  26527. }
  26528. -static inline void __outsl(unsigned long port, void *addr, unsigned int count)
  26529. +static inline void __outsl(unsigned long port, const void *addr,
  26530. + unsigned int count)
  26531. {
  26532. while (count--) {
  26533. outl(*(u32 *)addr, port);
  26534. Index: linux-2.4.35.4/include/asm-mips64/mipsregs.h
  26535. ===================================================================
  26536. --- linux-2.4.35.4.orig/include/asm-mips64/mipsregs.h
  26537. +++ linux-2.4.35.4/include/asm-mips64/mipsregs.h
  26538. @@ -757,10 +757,18 @@ do { \
  26539. #define read_c0_config1() __read_32bit_c0_register($16, 1)
  26540. #define read_c0_config2() __read_32bit_c0_register($16, 2)
  26541. #define read_c0_config3() __read_32bit_c0_register($16, 3)
  26542. +#define read_c0_config4() __read_32bit_c0_register($16, 4)
  26543. +#define read_c0_config5() __read_32bit_c0_register($16, 5)
  26544. +#define read_c0_config6() __read_32bit_c0_register($16, 6)
  26545. +#define read_c0_config7() __read_32bit_c0_register($16, 7)
  26546. #define write_c0_config(val) __write_32bit_c0_register($16, 0, val)
  26547. #define write_c0_config1(val) __write_32bit_c0_register($16, 1, val)
  26548. #define write_c0_config2(val) __write_32bit_c0_register($16, 2, val)
  26549. #define write_c0_config3(val) __write_32bit_c0_register($16, 3, val)
  26550. +#define write_c0_config4(val) __write_32bit_c0_register($16, 4, val)
  26551. +#define write_c0_config5(val) __write_32bit_c0_register($16, 5, val)
  26552. +#define write_c0_config6(val) __write_32bit_c0_register($16, 6, val)
  26553. +#define write_c0_config7(val) __write_32bit_c0_register($16, 7, val)
  26554. /*
  26555. * The WatchLo register. There may be upto 8 of them.
  26556. @@ -856,42 +864,34 @@ do { \
  26557. */
  26558. static inline void tlb_probe(void)
  26559. {
  26560. - rm9000_tlb_hazard();
  26561. __asm__ __volatile__(
  26562. ".set noreorder\n\t"
  26563. "tlbp\n\t"
  26564. ".set reorder");
  26565. - rm9000_tlb_hazard();
  26566. }
  26567. static inline void tlb_read(void)
  26568. {
  26569. - rm9000_tlb_hazard();
  26570. __asm__ __volatile__(
  26571. ".set noreorder\n\t"
  26572. "tlbr\n\t"
  26573. ".set reorder");
  26574. - rm9000_tlb_hazard();
  26575. }
  26576. static inline void tlb_write_indexed(void)
  26577. {
  26578. - rm9000_tlb_hazard();
  26579. __asm__ __volatile__(
  26580. ".set noreorder\n\t"
  26581. "tlbwi\n\t"
  26582. ".set reorder");
  26583. - rm9000_tlb_hazard();
  26584. }
  26585. static inline void tlb_write_random(void)
  26586. {
  26587. - rm9000_tlb_hazard();
  26588. __asm__ __volatile__(
  26589. ".set noreorder\n\t"
  26590. "tlbwr\n\t"
  26591. ".set reorder");
  26592. - rm9000_tlb_hazard();
  26593. }
  26594. /*
  26595. Index: linux-2.4.35.4/include/asm-mips64/reg.h
  26596. ===================================================================
  26597. --- linux-2.4.35.4.orig/include/asm-mips64/reg.h
  26598. +++ linux-2.4.35.4/include/asm-mips64/reg.h
  26599. @@ -46,6 +46,9 @@
  26600. /*
  26601. * k0/k1 unsaved
  26602. */
  26603. +#define EF_REG26 26
  26604. +#define EF_REG27 27
  26605. +
  26606. #define EF_REG28 28
  26607. #define EF_REG29 29
  26608. #define EF_REG30 30
  26609. Index: linux-2.4.35.4/include/asm-mips64/sgi/hpc3.h
  26610. ===================================================================
  26611. --- linux-2.4.35.4.orig/include/asm-mips64/sgi/hpc3.h
  26612. +++ linux-2.4.35.4/include/asm-mips64/sgi/hpc3.h
  26613. @@ -128,26 +128,26 @@ struct hpc3_ethregs {
  26614. volatile u32 rx_gfptr; /* current GIO fifo ptr */
  26615. volatile u32 rx_dfptr; /* current device fifo ptr */
  26616. u32 _unused1; /* padding */
  26617. - volatile u32 rx_reset; /* reset register */
  26618. -#define HPC3_ERXRST_CRESET 0x1 /* Reset dma channel and external controller */
  26619. -#define HPC3_ERXRST_CLRIRQ 0x2 /* Clear channel interrupt */
  26620. -#define HPC3_ERXRST_LBACK 0x4 /* Enable diagnostic loopback mode of Seeq8003 */
  26621. -
  26622. - volatile u32 rx_dconfig; /* DMA configuration register */
  26623. -#define HPC3_ERXDCFG_D1 0x0000f /* Cycles to spend in D1 state for PIO */
  26624. -#define HPC3_ERXDCFG_D2 0x000f0 /* Cycles to spend in D2 state for PIO */
  26625. -#define HPC3_ERXDCFG_D3 0x00f00 /* Cycles to spend in D3 state for PIO */
  26626. -#define HPC3_ERXDCFG_WCTRL 0x01000 /* Enable writes of desc into ex ctrl port */
  26627. -#define HPC3_ERXDCFG_FRXDC 0x02000 /* Clear eop stat bits upon rxdc, hw seeq fix */
  26628. -#define HPC3_ERXDCFG_FEOP 0x04000 /* Bad packet marker timeout enable */
  26629. -#define HPC3_ERXDCFG_FIRQ 0x08000 /* Another bad packet timeout enable */
  26630. -#define HPC3_ERXDCFG_PTO 0x30000 /* Programmed timeout value for above two */
  26631. -
  26632. - volatile u32 rx_pconfig; /* PIO configuration register */
  26633. -#define HPC3_ERXPCFG_P1 0x000f /* Cycles to spend in P1 state for PIO */
  26634. -#define HPC3_ERXPCFG_P2 0x00f0 /* Cycles to spend in P2 state for PIO */
  26635. -#define HPC3_ERXPCFG_P3 0x0f00 /* Cycles to spend in P3 state for PIO */
  26636. -#define HPC3_ERXPCFG_TST 0x1000 /* Diagnistic ram test feature bit */
  26637. + volatile u32 reset; /* reset register */
  26638. +#define HPC3_ERST_CRESET 0x1 /* Reset dma channel and external controller */
  26639. +#define HPC3_ERST_CLRIRQ 0x2 /* Clear channel interrupt */
  26640. +#define HPC3_ERST_LBACK 0x4 /* Enable diagnostic loopback mode of Seeq8003 */
  26641. +
  26642. + volatile u32 dconfig; /* DMA configuration register */
  26643. +#define HPC3_EDCFG_D1 0x0000f /* Cycles to spend in D1 state for PIO */
  26644. +#define HPC3_EDCFG_D2 0x000f0 /* Cycles to spend in D2 state for PIO */
  26645. +#define HPC3_EDCFG_D3 0x00f00 /* Cycles to spend in D3 state for PIO */
  26646. +#define HPC3_EDCFG_WCTRL 0x01000 /* Enable writes of desc into ex ctrl port */
  26647. +#define HPC3_EDCFG_FRXDC 0x02000 /* Clear eop stat bits upon rxdc, hw seeq fix */
  26648. +#define HPC3_EDCFG_FEOP 0x04000 /* Bad packet marker timeout enable */
  26649. +#define HPC3_EDCFG_FIRQ 0x08000 /* Another bad packet timeout enable */
  26650. +#define HPC3_EDCFG_PTO 0x30000 /* Programmed timeout value for above two */
  26651. +
  26652. + volatile u32 pconfig; /* PIO configuration register */
  26653. +#define HPC3_EPCFG_P1 0x000f /* Cycles to spend in P1 state for PIO */
  26654. +#define HPC3_EPCFG_P2 0x00f0 /* Cycles to spend in P2 state for PIO */
  26655. +#define HPC3_EPCFG_P3 0x0f00 /* Cycles to spend in P3 state for PIO */
  26656. +#define HPC3_EPCFG_TST 0x1000 /* Diagnistic ram test feature bit */
  26657. u32 _unused2[0x1000/4 - 8]; /* padding */
  26658. @@ -221,7 +221,7 @@ struct hpc3_regs {
  26659. #define HPC3_BESTAT_PIDMASK 0x3f700 /* DMA channel parity identifier */
  26660. u32 _unused1[0x14000/4 - 5]; /* padding */
  26661. -
  26662. +
  26663. /* Now direct PIO per-HPC3 peripheral access to external regs. */
  26664. volatile u32 scsi0_ext[256]; /* SCSI channel 0 external regs */
  26665. u32 _unused2[0x7c00/4];
  26666. @@ -304,7 +304,7 @@ struct hpc3_regs {
  26667. volatile u32 bbram[8192-50-14]; /* Battery backed ram */
  26668. };
  26669. -/*
  26670. +/*
  26671. * It is possible to have two HPC3's within the address space on
  26672. * one machine, though only having one is more likely on an Indy.
  26673. */
  26674. Index: linux-2.4.35.4/include/asm-mips64/sn/nmi.h
  26675. ===================================================================
  26676. --- linux-2.4.35.4.orig/include/asm-mips64/sn/nmi.h
  26677. +++ linux-2.4.35.4/include/asm-mips64/sn/nmi.h
  26678. @@ -8,7 +8,7 @@
  26679. #ifndef __ASM_SN_NMI_H
  26680. #define __ASM_SN_NMI_H
  26681. -#ident "$Revision: 1.2.4.2 $"
  26682. +#ident "$Revision: 1.2.4.1 $"
  26683. #include <asm/sn/addrs.h>
  26684. Index: linux-2.4.35.4/include/asm-mips64/unistd.h
  26685. ===================================================================
  26686. --- linux-2.4.35.4.orig/include/asm-mips64/unistd.h
  26687. +++ linux-2.4.35.4/include/asm-mips64/unistd.h
  26688. @@ -760,7 +760,7 @@ type name(void) \
  26689. if (__a3 == 0) \
  26690. return (type) __v0; \
  26691. errno = __v0; \
  26692. - return -1; \
  26693. + return (type)-1; \
  26694. }
  26695. /*
  26696. @@ -788,7 +788,7 @@ type name(atype a) \
  26697. if (__a3 == 0) \
  26698. return (type) __v0; \
  26699. errno = __v0; \
  26700. - return -1; \
  26701. + return (type)-1; \
  26702. }
  26703. #define _syscall2(type,name,atype,a,btype,b) \
  26704. @@ -813,7 +813,7 @@ type name(atype a, btype b) \
  26705. if (__a3 == 0) \
  26706. return (type) __v0; \
  26707. errno = __v0; \
  26708. - return -1; \
  26709. + return (type)-1; \
  26710. }
  26711. #define _syscall3(type,name,atype,a,btype,b,ctype,c) \
  26712. @@ -839,7 +839,7 @@ type name(atype a, btype b, ctype c) \
  26713. if (__a3 == 0) \
  26714. return (type) __v0; \
  26715. errno = __v0; \
  26716. - return -1; \
  26717. + return (type)-1; \
  26718. }
  26719. #define _syscall4(type,name,atype,a,btype,b,ctype,c,dtype,d) \
  26720. @@ -865,7 +865,7 @@ type name(atype a, btype b, ctype c, dty
  26721. if (__a3 == 0) \
  26722. return (type) __v0; \
  26723. errno = __v0; \
  26724. - return -1; \
  26725. + return (type)-1; \
  26726. }
  26727. #if (_MIPS_SIM == _MIPS_SIM_ABI32)
  26728. @@ -902,7 +902,7 @@ type name(atype a, btype b, ctype c, dty
  26729. if (__a3 == 0) \
  26730. return (type) __v0; \
  26731. errno = __v0; \
  26732. - return -1; \
  26733. + return (type)-1; \
  26734. }
  26735. #define _syscall6(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f) \
  26736. @@ -935,7 +935,7 @@ type name(atype a, btype b, ctype c, dty
  26737. if (__a3 == 0) \
  26738. return (type) __v0; \
  26739. errno = __v0; \
  26740. - return -1; \
  26741. + return (type)-1; \
  26742. }
  26743. #endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
  26744. @@ -966,7 +966,7 @@ type name (atype a,btype b,ctype c,dtype
  26745. if (__a3 == 0) \
  26746. return (type) __v0; \
  26747. errno = __v0; \
  26748. - return -1; \
  26749. + return (type)-1; \
  26750. }
  26751. #define _syscall6(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f) \
  26752. @@ -995,7 +995,7 @@ type name (atype a,btype b,ctype c,dtype
  26753. if (__a3 == 0) \
  26754. return (type) __v0; \
  26755. errno = __v0; \
  26756. - return -1; \
  26757. + return (type)-1; \
  26758. }
  26759. #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
  26760. Index: linux-2.4.35.4/include/asm-ppc/param.h
  26761. ===================================================================
  26762. --- linux-2.4.35.4.orig/include/asm-ppc/param.h
  26763. +++ linux-2.4.35.4/include/asm-ppc/param.h
  26764. @@ -3,6 +3,9 @@
  26765. #ifndef HZ
  26766. #define HZ 100
  26767. +#ifdef __KERNEL__
  26768. +#define hz_to_std(a) (a)
  26769. +#endif
  26770. #endif
  26771. #define EXEC_PAGESIZE 4096
  26772. Index: linux-2.4.35.4/include/asm-s390/param.h
  26773. ===================================================================
  26774. --- linux-2.4.35.4.orig/include/asm-s390/param.h
  26775. +++ linux-2.4.35.4/include/asm-s390/param.h
  26776. @@ -11,6 +11,9 @@
  26777. #ifndef HZ
  26778. #define HZ 100
  26779. +#ifdef __KERNEL__
  26780. +#define hz_to_std(a) (a)
  26781. +#endif
  26782. #endif
  26783. #define EXEC_PAGESIZE 4096
  26784. Index: linux-2.4.35.4/include/asm-sh/param.h
  26785. ===================================================================
  26786. --- linux-2.4.35.4.orig/include/asm-sh/param.h
  26787. +++ linux-2.4.35.4/include/asm-sh/param.h
  26788. @@ -3,6 +3,9 @@
  26789. #ifndef HZ
  26790. #define HZ 100
  26791. +#ifdef __KERNEL__
  26792. +#define hz_to_std(a) (a)
  26793. +#endif
  26794. #endif
  26795. #define EXEC_PAGESIZE 4096
  26796. Index: linux-2.4.35.4/include/asm-sparc/param.h
  26797. ===================================================================
  26798. --- linux-2.4.35.4.orig/include/asm-sparc/param.h
  26799. +++ linux-2.4.35.4/include/asm-sparc/param.h
  26800. @@ -4,6 +4,9 @@
  26801. #ifndef HZ
  26802. #define HZ 100
  26803. +#ifdef __KERNEL__
  26804. +#define hz_to_std(a) (a)
  26805. +#endif
  26806. #endif
  26807. #define EXEC_PAGESIZE 8192 /* Thanks for sun4's we carry baggage... */
  26808. Index: linux-2.4.35.4/include/asm-sparc64/param.h
  26809. ===================================================================
  26810. --- linux-2.4.35.4.orig/include/asm-sparc64/param.h
  26811. +++ linux-2.4.35.4/include/asm-sparc64/param.h
  26812. @@ -4,6 +4,9 @@
  26813. #ifndef HZ
  26814. #define HZ 100
  26815. +#ifdef __KERNEL__
  26816. +#define hz_to_std(a) (a)
  26817. +#endif
  26818. #endif
  26819. #define EXEC_PAGESIZE 8192 /* Thanks for sun4's we carry baggage... */
  26820. Index: linux-2.4.35.4/include/linux/i2c-algo-au1550.h
  26821. ===================================================================
  26822. --- /dev/null
  26823. +++ linux-2.4.35.4/include/linux/i2c-algo-au1550.h
  26824. @@ -0,0 +1,31 @@
  26825. +/*
  26826. + * Copyright (C) 2004 Embedded Edge, LLC <[email protected]>
  26827. + *
  26828. + * This program is free software; you can redistribute it and/or modify
  26829. + * it under the terms of the GNU General Public License as published by
  26830. + * the Free Software Foundation; either version 2 of the License, or
  26831. + * (at your option) any later version.
  26832. + *
  26833. + * This program is distributed in the hope that it will be useful,
  26834. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  26835. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26836. + * GNU General Public License for more details.
  26837. + *
  26838. + * You should have received a copy of the GNU General Public License
  26839. + * along with this program; if not, write to the Free Software
  26840. + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  26841. + */
  26842. +
  26843. +#ifndef I2C_ALGO_AU1550_H
  26844. +#define I2C_ALGO_AU1550_H 1
  26845. +
  26846. +struct i2c_algo_au1550_data {
  26847. + u32 psc_base;
  26848. + int xfer_timeout;
  26849. + int ack_timeout;
  26850. +};
  26851. +
  26852. +int i2c_au1550_add_bus(struct i2c_adapter *);
  26853. +int i2c_au1550_del_bus(struct i2c_adapter *);
  26854. +
  26855. +#endif /* I2C_ALGO_AU1550_H */
  26856. Index: linux-2.4.35.4/include/linux/i2c-id.h
  26857. ===================================================================
  26858. --- linux-2.4.35.4.orig/include/linux/i2c-id.h
  26859. +++ linux-2.4.35.4/include/linux/i2c-id.h
  26860. @@ -155,6 +155,8 @@
  26861. #define I2C_ALGO_SIBYTE 0x150000 /* Broadcom SiByte SOCs */
  26862. #define I2C_ALGO_SGI 0x160000 /* SGI algorithm */
  26863. +#define I2C_ALGO_AU1550 0x140000 /* Alchemy Au1550 PSC */
  26864. +
  26865. #define I2C_ALGO_EXP 0x800000 /* experimental */
  26866. #define I2C_ALGO_MASK 0xff0000 /* Mask for algorithms */
  26867. @@ -203,6 +205,9 @@
  26868. #define I2C_HW_SGI_VINO 0x00
  26869. #define I2C_HW_SGI_MACE 0x01
  26870. +/* --- Au1550 PSC adapters */
  26871. +#define I2C_HW_AU1550_PSC 0x00
  26872. +
  26873. /* --- SMBus only adapters */
  26874. #define I2C_HW_SMBUS_PIIX4 0x00
  26875. #define I2C_HW_SMBUS_ALI15X3 0x01
  26876. Index: linux-2.4.35.4/include/linux/sched.h
  26877. ===================================================================
  26878. --- linux-2.4.35.4.orig/include/linux/sched.h
  26879. +++ linux-2.4.35.4/include/linux/sched.h
  26880. @@ -617,6 +617,10 @@ asmlinkage long sys_wait4(pid_t pid,unsi
  26881. extern int in_group_p(gid_t);
  26882. extern int in_egroup_p(gid_t);
  26883. +extern ATTRIB_NORET void cpu_idle(void);
  26884. +
  26885. +extern void release_task(struct task_struct * p);
  26886. +
  26887. extern void proc_caches_init(void);
  26888. extern void flush_signals(struct task_struct *);
  26889. extern void flush_signal_handlers(struct task_struct *);
  26890. Index: linux-2.4.35.4/include/linux/serial.h
  26891. ===================================================================
  26892. --- linux-2.4.35.4.orig/include/linux/serial.h
  26893. +++ linux-2.4.35.4/include/linux/serial.h
  26894. @@ -75,7 +75,8 @@ struct serial_struct {
  26895. #define PORT_16654 11
  26896. #define PORT_16850 12
  26897. #define PORT_RSA 13 /* RSA-DV II/S card */
  26898. -#define PORT_MAX 13
  26899. +#define PORT_SB1250 14
  26900. +#define PORT_MAX 14
  26901. #define SERIAL_IO_PORT 0
  26902. #define SERIAL_IO_HUB6 1
  26903. Index: linux-2.4.35.4/include/linux/swap.h
  26904. ===================================================================
  26905. --- linux-2.4.35.4.orig/include/linux/swap.h
  26906. +++ linux-2.4.35.4/include/linux/swap.h
  26907. @@ -1,6 +1,12 @@
  26908. #ifndef _LINUX_SWAP_H
  26909. #define _LINUX_SWAP_H
  26910. +#include <linux/config.h>
  26911. +
  26912. +#define MAX_SWAPFILES 32
  26913. +
  26914. +#ifdef __KERNEL__
  26915. +
  26916. #include <linux/spinlock.h>
  26917. #include <asm/page.h>
  26918. @@ -8,8 +14,6 @@
  26919. #define SWAP_FLAG_PRIO_MASK 0x7fff
  26920. #define SWAP_FLAG_PRIO_SHIFT 0
  26921. -#define MAX_SWAPFILES 32
  26922. -
  26923. /*
  26924. * Magic header for a swap area. The first part of the union is
  26925. * what the swap magic looks like for the old (limited to 128MB)
  26926. @@ -39,8 +43,6 @@ union swap_header {
  26927. } info;
  26928. };
  26929. -#ifdef __KERNEL__
  26930. -
  26931. /*
  26932. * Max bad pages in the new format..
  26933. */
  26934. Index: linux-2.4.35.4/include/video/newport.h
  26935. ===================================================================
  26936. --- linux-2.4.35.4.orig/include/video/newport.h
  26937. +++ linux-2.4.35.4/include/video/newport.h
  26938. @@ -291,8 +291,6 @@ struct newport_regs {
  26939. unsigned int _unused2[0x1ef];
  26940. struct newport_cregs cgo;
  26941. };
  26942. -extern struct newport_regs *npregs;
  26943. -
  26944. typedef struct {
  26945. unsigned int drawmode1;
  26946. @@ -450,38 +448,26 @@ static __inline__ void newport_cmap_setr
  26947. /* Miscellaneous NEWPORT routines. */
  26948. #define BUSY_TIMEOUT 100000
  26949. -static __inline__ int newport_wait(void)
  26950. +static __inline__ int newport_wait(struct newport_regs *regs)
  26951. {
  26952. - int i = 0;
  26953. + int t = BUSY_TIMEOUT;
  26954. - while(i < BUSY_TIMEOUT)
  26955. - if(!(npregs->cset.status & NPORT_STAT_GBUSY))
  26956. + while (t--)
  26957. + if (!(regs->cset.status & NPORT_STAT_GBUSY))
  26958. break;
  26959. - if(i == BUSY_TIMEOUT)
  26960. - return 1;
  26961. - return 0;
  26962. + return !t;
  26963. }
  26964. -static __inline__ int newport_bfwait(void)
  26965. +static __inline__ int newport_bfwait(struct newport_regs *regs)
  26966. {
  26967. - int i = 0;
  26968. + int t = BUSY_TIMEOUT;
  26969. - while(i < BUSY_TIMEOUT)
  26970. - if(!(npregs->cset.status & NPORT_STAT_BBUSY))
  26971. + while (t--)
  26972. + if(!(regs->cset.status & NPORT_STAT_BBUSY))
  26973. break;
  26974. - if(i == BUSY_TIMEOUT)
  26975. - return 1;
  26976. - return 0;
  26977. + return !t;
  26978. }
  26979. -/* newport.c and cons_newport.c routines */
  26980. -extern struct graphics_ops *newport_probe (int, const char **);
  26981. -
  26982. -void newport_save (void *);
  26983. -void newport_restore (void *);
  26984. -void newport_reset (void);
  26985. -int newport_ioctl (int card, int cmd, unsigned long arg);
  26986. -
  26987. /*
  26988. * DCBMODE register defines:
  26989. */
  26990. @@ -564,7 +550,7 @@ xmap9FIFOWait (struct newport_regs *rex)
  26991. {
  26992. rex->set.dcbmode = DCB_XMAP0 | XM9_CRS_FIFO_AVAIL |
  26993. DCB_DATAWIDTH_1 | R_DCB_XMAP9_PROTOCOL;
  26994. - newport_bfwait ();
  26995. + newport_bfwait (rex);
  26996. while ((rex->set.dcbdata0.bybytes.b3 & 3) != XM9_FIFO_EMPTY)
  26997. ;
  26998. Index: linux-2.4.35.4/init/main.c
  26999. ===================================================================
  27000. --- linux-2.4.35.4.orig/init/main.c
  27001. +++ linux-2.4.35.4/init/main.c
  27002. @@ -296,7 +296,6 @@ static void __init parse_options(char *l
  27003. extern void setup_arch(char **);
  27004. -extern void cpu_idle(void);
  27005. unsigned long wait_init_idle;
  27006. Index: linux-2.4.35.4/kernel/exit.c
  27007. ===================================================================
  27008. --- linux-2.4.35.4.orig/kernel/exit.c
  27009. +++ linux-2.4.35.4/kernel/exit.c
  27010. @@ -26,7 +26,7 @@ extern struct task_struct *child_reaper;
  27011. int getrusage(struct task_struct *, int, struct rusage *);
  27012. -static void release_task(struct task_struct * p)
  27013. +void release_task(struct task_struct * p)
  27014. {
  27015. if (p != current) {
  27016. #ifdef CONFIG_SMP
  27017. Index: linux-2.4.35.4/kernel/signal.c
  27018. ===================================================================
  27019. --- linux-2.4.35.4.orig/kernel/signal.c
  27020. +++ linux-2.4.35.4/kernel/signal.c
  27021. @@ -14,6 +14,7 @@
  27022. #include <linux/init.h>
  27023. #include <linux/sched.h>
  27024. +#include <asm/param.h>
  27025. #include <asm/uaccess.h>
  27026. /*
  27027. @@ -28,6 +29,14 @@
  27028. #define SIG_SLAB_DEBUG 0
  27029. #endif
  27030. +#define DEBUG_SIG 0
  27031. +
  27032. +#if DEBUG_SIG
  27033. +#define SIG_SLAB_DEBUG (SLAB_DEBUG_FREE | SLAB_RED_ZONE /* | SLAB_POISON */)
  27034. +#else
  27035. +#define SIG_SLAB_DEBUG 0
  27036. +#endif
  27037. +
  27038. static kmem_cache_t *sigqueue_cachep;
  27039. atomic_t nr_queued_signals;
  27040. @@ -270,6 +279,11 @@ printk("SIG dequeue (%s:%d): %d ", curre
  27041. signal_pending(current));
  27042. #endif
  27043. +#if DEBUG_SIG
  27044. +printk("SIG dequeue (%s:%d): %d ", current->comm, current->pid,
  27045. + signal_pending(current));
  27046. +#endif
  27047. +
  27048. sig = next_signal(current, mask);
  27049. if (sig) {
  27050. if (current->notifier) {
  27051. @@ -293,6 +307,10 @@ printk("SIG dequeue (%s:%d): %d ", curre
  27052. printk(" %d -> %d\n", signal_pending(current), sig);
  27053. #endif
  27054. +#if DEBUG_SIG
  27055. +printk(" %d -> %d\n", signal_pending(current), sig);
  27056. +#endif
  27057. +
  27058. return sig;
  27059. }
  27060. @@ -540,6 +558,11 @@ send_sig_info(int sig, struct siginfo *i
  27061. printk("SIG queue (%s:%d): %d ", t->comm, t->pid, sig);
  27062. #endif
  27063. +
  27064. +#if DEBUG_SIG
  27065. +printk("SIG queue (%s:%d): %d ", t->comm, t->pid, sig);
  27066. +#endif
  27067. +
  27068. ret = -EINVAL;
  27069. if (sig < 0 || sig > _NSIG)
  27070. goto out_nolock;
  27071. @@ -778,8 +801,8 @@ void do_notify_parent(struct task_struct
  27072. info.si_uid = tsk->uid;
  27073. /* FIXME: find out whether or not this is supposed to be c*time. */
  27074. - info.si_utime = tsk->times.tms_utime;
  27075. - info.si_stime = tsk->times.tms_stime;
  27076. + info.si_utime = hz_to_std(tsk->times.tms_utime);
  27077. + info.si_stime = hz_to_std(tsk->times.tms_stime);
  27078. status = tsk->exit_code & 0x7f;
  27079. why = SI_KERNEL; /* shouldn't happen */
  27080. Index: linux-2.4.35.4/kernel/sys.c
  27081. ===================================================================
  27082. --- linux-2.4.35.4.orig/kernel/sys.c
  27083. +++ linux-2.4.35.4/kernel/sys.c
  27084. @@ -801,16 +801,23 @@ asmlinkage long sys_setfsgid(gid_t gid)
  27085. asmlinkage long sys_times(struct tms * tbuf)
  27086. {
  27087. + struct tms temp;
  27088. +
  27089. /*
  27090. * In the SMP world we might just be unlucky and have one of
  27091. * the times increment as we use it. Since the value is an
  27092. * atomically safe type this is just fine. Conceptually its
  27093. * as if the syscall took an instant longer to occur.
  27094. */
  27095. - if (tbuf)
  27096. - if (copy_to_user(tbuf, &current->times, sizeof(struct tms)))
  27097. + if (tbuf) {
  27098. + temp.tms_utime = hz_to_std(current->times.tms_utime);
  27099. + temp.tms_stime = hz_to_std(current->times.tms_stime);
  27100. + temp.tms_cutime = hz_to_std(current->times.tms_cutime);
  27101. + temp.tms_cstime = hz_to_std(current->times.tms_cstime);
  27102. + if (copy_to_user(tbuf, &temp, sizeof(struct tms)))
  27103. return -EFAULT;
  27104. - return jiffies;
  27105. + }
  27106. + return hz_to_std(jiffies);
  27107. }
  27108. /*
  27109. Index: linux-2.4.35.4/lib/Makefile
  27110. ===================================================================
  27111. --- linux-2.4.35.4.orig/lib/Makefile
  27112. +++ linux-2.4.35.4/lib/Makefile
  27113. @@ -27,6 +27,7 @@ obj-$(CONFIG_CRC32) += crc32.o
  27114. subdir-$(CONFIG_ZLIB_INFLATE) += zlib_inflate
  27115. subdir-$(CONFIG_ZLIB_DEFLATE) += zlib_deflate
  27116. +-include $(TOPDIR)/arch/$(ARCH)/Makefile.lib
  27117. include $(TOPDIR)/drivers/net/Makefile.lib
  27118. include $(TOPDIR)/drivers/usb/Makefile.lib
  27119. include $(TOPDIR)/drivers/bluetooth/Makefile.lib
  27120. Index: linux-2.4.35.4/Makefile
  27121. ===================================================================
  27122. --- linux-2.4.35.4.orig/Makefile
  27123. +++ linux-2.4.35.4/Makefile
  27124. @@ -469,10 +469,11 @@ mrproper: clean archmrproper
  27125. $(MAKE) -C Documentation/DocBook mrproper
  27126. distclean: mrproper
  27127. - rm -f core `find . \( -not -type d \) -and \
  27128. - \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
  27129. - -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
  27130. - -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f -print` TAGS tags
  27131. + find . \( -not -type d \) -and \
  27132. + \( -name core -o -name '*.orig' -o -name '*.rej' \
  27133. + -o -name '*~' -o -name '*.bak' -o -name '#*#' \
  27134. + -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \
  27135. + -o -name TAGS -o -name tags \) -print | env -i xargs rm -f
  27136. backup: mrproper
  27137. cd .. && tar cf - linux/ | gzip -9 > backup.gz
  27138. @@ -499,7 +500,7 @@ mandocs:
  27139. $(MAKE) -C Documentation/DocBook man
  27140. sums:
  27141. - find . -type f -print | sort | xargs sum > .SUMS
  27142. + find . -type f -print | sort | env -i xargs sum > .SUMS
  27143. dep-files: scripts/mkdep archdep include/linux/version.h
  27144. rm -f .depend .hdepend